JP6015461B2 - Information recording medium, data read / write method, and data read / write program - Google Patents
Information recording medium, data read / write method, and data read / write program Download PDFInfo
- Publication number
- JP6015461B2 JP6015461B2 JP2013008430A JP2013008430A JP6015461B2 JP 6015461 B2 JP6015461 B2 JP 6015461B2 JP 2013008430 A JP2013008430 A JP 2013008430A JP 2013008430 A JP2013008430 A JP 2013008430A JP 6015461 B2 JP6015461 B2 JP 6015461B2
- Authority
- JP
- Japan
- Prior art keywords
- block
- spare area
- data
- writing
- storage area
- 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.)
- Active
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Description
本発明は、複数のブロックに分割された記憶領域を有し、各ブロックには物理的なアドレス空間を形成する物理ブロック番号が付与されている不揮発性メモリと、コマンドに応じて前記不揮発性メモリに対するデータの読み書きを行うコントローラと、を備えるICカードの技術に関する。 The present invention includes a non-volatile memory having a storage area divided into a plurality of blocks, each block having a physical block number forming a physical address space, and the non-volatile memory according to a command The present invention relates to a technology of an IC card provided with a controller that reads and writes data with respect to the device.
現在普及しているICカードは、外部端末から供給される電源を利用して動作する。そのため、データ書き込み中に外部端末からICカードを引き抜くなどの電源供給を遮断する行為が行われた場合、動作に必要な電源が供給されなくなり、ICカードの不揮発性メモリに記憶されているデータが破壊されてしまう。そのため、書き込み処理は、書き込みを正常に完了させるか、または書き込み前の状態に戻すかによってデータの完全性を保障しなければならない。また、電子マネーやIDカードに利用されるICカードは、ユーザーの利便性を損なわないために処理速度を劣化させない工夫が必要である。 Currently popular IC cards operate using power supplied from an external terminal. Therefore, if an action to shut off the power supply such as pulling out the IC card from the external terminal during data writing is performed, the power necessary for the operation is not supplied, and the data stored in the non-volatile memory of the IC card It will be destroyed. Therefore, in the writing process, data integrity must be ensured by completing writing normally or returning to a state before writing. Further, an IC card used for electronic money or an ID card needs to be devised so as not to deteriorate the processing speed so as not to impair the convenience of the user.
特許文献1には、大容量のデータブロック領域を取り扱う場合においても、電源途絶時のデータ保証を確保しながら、効率良くかつ高速に処理を実行することを可能とするICカード及びその情報処理方法が開示されている。特許文献1に開示されるICカードの不揮発性メモリは、利用者が必要とするデータが格納されるデータブロック領域と、リーダライタからICカードへデータの読み書き時に指定されるデータが格納される予備ブロック領域と、ICカードの不揮発性メモリにおいて論理的なメモリ空間と物理的なメモリ空間とを関連付けるアドレス情報が格納されるアドレス管理領域とを有してなる。そして、書き込み処理時には、書き込み対象のデータブロック領域内のブロックの代わりに予備ブロック領域内のブロックに対象データを書き込み、そのブロックを書き込み対象のブロックと交換するようにアドレス管理領域を更新するようになっている。 Patent Document 1 discloses an IC card and an information processing method thereof capable of executing processing efficiently and at high speed while ensuring data guarantee at the time of power interruption even when a large-capacity data block area is handled. Is disclosed. The non-volatile memory of the IC card disclosed in Patent Document 1 includes a data block area in which data required by the user is stored, and a spare in which data specified when reading / writing data from the reader / writer to the IC card is stored. It has a block area and an address management area in which address information for associating a logical memory space with a physical memory space in the nonvolatile memory of the IC card is stored. During the writing process, the address management area is updated so that the target data is written to the block in the spare block area instead of the block in the data block area to be written, and the block is replaced with the block to be written. It has become.
ところで、特許文献1の技術では、書き込み処理時には、予備ブロック領域のブロックへの書き込みが完了した後、アドレス管理領域が更新される。しかし、アドレス管理領域には、データブロック記憶領域を管理(つまり、論理的なメモリ空間と物理的なメモリ空間とを関連付けるアドレス情報(テーブル)を管理)するブロックと、予備ブロック領域を管理(つまり、空き領域を管理)するブロックが含まれているため、一度の書き込み処理において、3回、ブロック(つまり、3ブロック)が更新されることになる。そのため、一般的なデータ保障方法(書き込み処理を実行する前に、その書き込み対象領域を不揮発性メモリ上の別のエリアに一時的に退避し、バックアップする方法)に比べ書き込み処理速度が低下してしまう可能性がある。 By the way, in the technique of Patent Document 1, at the time of the writing process, the address management area is updated after the writing to the block of the spare block area is completed. However, the address management area manages the data block storage area (that is, manages the address information (table) that associates the logical memory space with the physical memory space), and manages the spare block area (that is, Therefore, a block (that is, 3 blocks) is updated three times in one writing process. For this reason, the write processing speed is reduced compared to a general data guarantee method (a method in which the write target area is temporarily saved and backed up in another area on the nonvolatile memory before executing the write process). There is a possibility.
そこで、本発明は、一般的なデータ保障方法に比べ書き込み処理速度を向上させることが可能な情報記録媒体、データ読み書き方法、及びデータ読み書きプログラムを提供することを目的とする。 Accordingly, an object of the present invention is to provide an information recording medium, a data read / write method, and a data read / write program capable of improving the writing processing speed as compared with a general data guarantee method.
上記課題を解決するために、請求項1に記載の発明は、データ記憶領域ブロック、予備領域ブロック、及び予備領域管理ブロックを含む複数のブロックに分割された記憶領域を有し、各ブロックには物理アドレス空間を形成する物理ブロック番号が付与されている不揮発性メモリと、コマンドに応じて前記不揮発性メモリに対するデータの読み書きを行うコントローラと、を備える情報記録媒体であって、前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、前記コントローラは、前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索手段と、前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索手段と、前記第1検索手段により検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込手段と、前記第2検索手段により検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込手段による前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込手段と、を備えることを特徴とする。 In order to solve the above problems, the invention described in claim 1 has a storage area divided into a plurality of blocks including a data storage area block, a spare area block, and a spare area management block. An information recording medium comprising: a non-volatile memory to which a physical block number that forms a physical address space is assigned; and a controller that reads and writes data to and from the non-volatile memory in response to a command, the data storage area block The logical block number forming the data and logical address space is stored in, the initialized value is stored in the spare area block, and the physical block number of the spare area block is stored in the spare area management block The controller performs data write processing in response to the command First search means for searching for the spare area block with reference to the spare area management block, and second for searching for the data storage area block storing the logical block number calculated according to the command The spare area block searched by the search means and the first search means is stored in the spare area block as a new data storage area block and stored in the data storage area block searched by the second search means. A first writing means for writing update data corresponding to the data and the logical block number calculated in accordance with the command; and the physical block of the data storage area block searched by the second searching means The update by the first writing means with the number as the physical block number of a new spare area block Characterized in that it comprises a second writing means for writing after writing over data to the spare area management block.
請求項2に記載の発明は、請求項1に記載の情報記録媒体において、前記データ記憶領域ブロックには、当該データ記憶領域ブロックの使用回数を示す使用カウンタが記憶されており、前記第1書込手段は、前記更新データと前記論理ブロック番号とを前記予備領域ブロックへ書き込む際に、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記使用カウンタを1インクリメントした使用カウンタを前記予備領域ブロックへ書き込むことを特徴とする。 According to a second aspect of the present invention, in the information recording medium according to the first aspect, the data storage area block stores a usage counter indicating the number of times the data storage area block is used. The use means increments the use counter stored in the data storage area block searched by the second search means when the update data and the logical block number are written to the spare area block. A counter is written into the spare area block.
請求項3に記載の発明は、請求項1または2に記載の情報記録媒体において、前記第2書込手段は、前記第1検索手段により検索された複数の前記予備領域ブロックのうち前記第1書込手段により前記更新データが書き込まれなかった前記予備領域ブロックを新たな前記予備領域管理ブロックとして当該予備領域ブロックに、前記新たな予備領域ブロックの前記物理ブロック番号と、前記新たな前記データ記憶領域ブロック及び前記新たな前記予備領域管理ブロックとして使用されなかった前記予備領域ブロックの前記物理ブロック番号とを書き込むことを特徴とする。 According to a third aspect of the present invention, in the information recording medium according to the first or second aspect, the second writing unit includes the first of the plurality of spare area blocks retrieved by the first retrieval unit. The spare area block for which the update data has not been written by the writing means is used as the new spare area management block, the physical block number of the new spare area block, and the new data storage An area block and the physical block number of the spare area block that has not been used as the new spare area management block are written.
請求項4に記載の発明は、請求項1乃至3の何れか一項に記載の情報記録媒体において、前記予備領域管理ブロックには誤り検査情報がさらに記憶されており、前記コントローラは、前記第1検索手段により検索された前記予備領域ブロックが未使用でない場合、又は前記第2書込手段による書き込みが正常に終了しない場合、前記予備領域管理ブロックが2つ以上存在するか否かを判定する第1判定手段と、前記第1判定手段により前記予備領域管理ブロックが2つ以上存在すると判定された場合、最も新しい前記予備領域管理ブロックに記憶されている誤り検査情報が正常であるかを判定する第2判定手段と、前記第2判定手段により前記予備領域管理ブロックに記憶されている誤り検査情報が正常であると判定された場合、最も前記予備領域管理ブロックに記憶されている前記物理ブロック番号に対応する前記予備領域ブロックを初期化する一方、前記第2判定手段により前記予備領域管理ブロックに記憶されている誤り検査情報が正常でないと判定された場合、最も前記予備領域管理ブロック以外の前記予備領域管理ブロックに記憶されている前記物理ブロック番号に対応する前記予備領域ブロックを初期化する初期化手段と、を備えることを特徴とする。 According to a fourth aspect of the present invention, in the information recording medium according to any one of the first to third aspects, error check information is further stored in the spare area management block, and the controller If the spare area block searched by one search means is not unused, or if writing by the second writing means does not end normally, it is determined whether there are two or more spare area management blocks. When it is determined by the first determination means and the first determination means that there are two or more spare area management blocks, it is determined whether the error check information stored in the newest spare area management block is normal And when the error check information stored in the spare area management block is determined to be normal by the second determination unit and the second determination unit, While the spare area block corresponding to the physical block number stored in the area management block is initialized, the error determination information stored in the spare area management block is determined to be not normal by the second determination unit. In this case, an initialization means is provided for initializing the spare area block corresponding to the physical block number stored in the spare area management block other than the spare area management block.
請求項5に記載の発明は、データ記憶領域ブロック、予備領域ブロック、及び予備領域管理ブロックを含む複数のブロックに分割された記憶領域を有し、各ブロックには物理アドレス空間を形成する物理ブロック番号が付与されている不揮発性メモリと、コマンドに応じて前記不揮発性メモリに対するデータの読み書きを行うコントローラと、を備える情報記録媒体における前記コントローラにより行われるデータ読み書き方法であって、前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、前記データ読み書き方法は、前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索ステップと、前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索ステップと、前記第1検索ステップにより検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索ステップにより検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込ステップと、前記第2検索ステップにより検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込ステップによる前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込ステップと、を含むことを特徴とする。 The invention according to claim 5 has a storage area divided into a plurality of blocks including a data storage area block, a spare area block, and a spare area management block, and a physical block forming a physical address space in each block A data read / write method performed by the controller in an information recording medium comprising: a non-volatile memory to which a number is assigned; and a controller for reading and writing data to and from the non-volatile memory in response to a command, the data storage area The block stores data and logical block numbers forming a logical address space, the spare area block stores initialized values, and the spare area management block stores the physical block number of the spare area block. The data read / write method is stored in the command. When a data write process is performed for the first time, a first search step for searching for the spare area block with reference to the spare area management block and the logical block number calculated according to the command are stored. A second search step for searching for the data storage area block; and the spare area block searched in the first search step is searched as a new data storage area block in the spare area block by the second search step. The first write step for writing the update data corresponding to the data stored in the data storage area block and the logical block number calculated in response to the command, and the second search step are used for retrieval. The physical block number of the data storage area block is changed to a new spare area block. Wherein as the physical block number, characterized in that it comprises a second writing step of writing the reserved area management block after the writing of the update data by the first writing step.
請求項6に記載の発明は、データ記憶領域ブロック、予備領域ブロック、及び予備領域管理ブロックを含む複数のブロックに分割された記憶領域を有し、各ブロックには物理アドレス空間を形成する物理ブロック番号が付与されている不揮発性メモリと、コマンドに応じて前記不揮発性メモリに対するデータの読み書きを行うコントローラと、を備える情報記録媒体における前記コントローラにより実行されるデータ読み書きプログラムであって、前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、前記コントローラに、前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索手段、前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索手段、及び前記第1検索手段により検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込手段、及び、前記第2検索手段により検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込手段による前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込手段として機能させることを特徴とする。
The invention according to
本発明によれば、一度の書き込み処理において2ブロックの書き込みだけでデータを保障した書き込みを実現でき、書き込み処理速度を向上させることができる。 According to the present invention, it is possible to realize writing in which data is guaranteed only by writing two blocks in one writing process, and the writing processing speed can be improved.
以下、図面を参照して本発明の実施形態について詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
先ず、図1及び図2を参照して、本実施形態に係るICカードについて説明する。図1は、ICカード1の概要構成例を示す図である。図2(A)は、本実施形態に係るフラッシュメモリにおける物理アドレス空間を示す図であり、図2(B)は、本実施形態に係るフラッシュメモリにおける論理アドレス空間を示す図である。なお、ICカード1は、キャッシュカード、クレジットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等に組み込まれる。また、ICカード1は、上記カードの他に、不揮発性メモリを搭載した組込み機器、データ保障が必要なUSBメモリなどの情報記録媒体であっても良い。 First, an IC card according to this embodiment will be described with reference to FIGS. 1 and 2. FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. FIG. 2A is a diagram showing a physical address space in the flash memory according to this embodiment, and FIG. 2B is a diagram showing a logical address space in the flash memory according to this embodiment. The IC card 1 is used as a cash card, credit card, employee card or the like. Alternatively, the IC card 1 is incorporated into a smartphone, a mobile phone, or the like. In addition to the card, the IC card 1 may be an information recording medium such as an embedded device equipped with a non-volatile memory or a USB memory requiring data security.
図1に示すように、ICカード1には、ICチップ1aが搭載されている。ICチップ1aは、CPU(Central Processing Unit)11、RAM(Random Access Memory)12、フラッシュメモリ13、及びI/O回路14を備えて構成される。なお、フラッシュメモリの代わりにEEPROM(Electrically Erasable Programmable Read-Only Memory)であっても構わない。
As shown in FIG. 1, an IC chip 1 a is mounted on the IC card 1. The IC chip 1a includes a CPU (Central Processing Unit) 11, a RAM (Random Access Memory) 12, a
CPU11は、各種プログラムを実行するコントローラであり、例えばオペレーティングシステム(OS)に組み込まれる本発明のデータ読み書きプログラムにしたがって、外部端末2から受信したコマンドに対応した所定のコマンド処理を実行し、RAM12及びフラッシュメモリ13に対するデータの読み書き処理を行う。例えば、CPU11は、フラッシュメモリ13に対して、ページ単位(読み書きを行う最小単位であり、例えば128バイト、256バイト、または512バイト)の消去と、1バイト単位での読み書きを行う。外部端末2は、ICカード1との間で接触または非接触で通信を行うためのリーダーライタを備える。外部端末2の例としてはATM、改札機、認証用ゲート等が挙げられる。或いは、ICカード1が携帯端末に搭載される場合、外部端末2には携帯端末の機能を担う制御部が該当する。
The
RAM12は、データを一時的に記憶する揮発性メモリである。フラッシュメモリ13は、プログラム(本発明のデータ読み書きプログラムを含む)やデータを格納する不揮発性メモリである。フラッシュメモリ13では、記憶されたデータを書き換える際、ページ単位の消去処理(0→1あるいは1→0)と、1バイト書き込み処理(1→0あるいは0→1)が発生する。また、フラッシュメモリ13は、データ記憶領域ブロック、予備領域ブロック、及び予備領域管理ブロックを含む複数のブロックに分割された記憶領域を有し、各ブロックには、物理アドレス空間(物理的なアドレス空間)を形成する物理ブロック番号が付与されている。なお、ブロックはページを1つ以上連ねたものである。物理アドレス空間とは、メモリアドレスによってアクセス可能なメモリ空間を意味する。本実施形態では、ブロックを3種類に分類することでデータ保障を実現し、かつ書き込み処理時間やメモリの使用効率を向上させている。
The
図2(A)の例では、物理ブロック番号Nxが“01”と“02”と“04”のブロックが、それぞれ、データ記憶領域ブロックである。また、物理ブロック番号Nxが“03”と“05”と“06”と“7F”のブロックが、それぞれ、予備領域ブロックである。また、物理ブロック番号Nxが“80”のブロックが、予備領域管理ブロックである。データ記憶領域ブロックには、論理ブロック番号Ny、使用カウンタC、データD、及び誤り検査情報Pが記憶(格納)される。論理ブロック番号Nyは、図2(B)に示すように、論理アドレス空間(論理的なアドレス空間)を形成(構築)するための情報である。使用カウンタCは、当該使用カウンタCを記憶するデータ記憶領域ブロックの使用回数を示す値であり、当該データ記憶領域ブロックにデータDが書き込まれることで当該データ記憶領域ブロックが使用される度に1インクリメントされる。使用カウンタCにより各ブロックの新旧を判定することができ、また、当該ブロックの使用回数を管理することができる。データDは、例えば、CPU11によるコマンド処理の結果に基づいて外部端末2へ出力されるデータである。データDの例としては、ICチップ1a内に保持する値、またはICチップ1a内で演算した結果の値である。例えば、論理ブロック番号Ny“01”が記憶されているデータ記憶領域ブロックには、データDとして鍵データが記憶され、論理ブロック番号Ny“02”が記憶されているデータ記憶領域ブロックには、データDとして報酬ポイント(或いは日付)が記憶されるというように、論理ブロック番号NyとデータDの種別とが関連付けられる。誤り検査情報Pは、当該誤り検査情報Pが記憶されるブロック内のデータの値が正当であるかどうかを判定するための情報である。誤り検査情報Pの例には、CRC(Cyclic Redundancy Check, CRC)やチェックサム等がある。一方、予備領域ブロックには、初期化された値(例えば、FFFF…)が記憶される。また、予備領域管理ブロックには、予備領域管理ブロック識別子ID、使用カウンタC、予備領域ブロックの物理ブロック番号Nx、及び誤り検査情報Pが記憶される。予備領域管理ブロック識別子IDは、予備領域管理ブロックを識別するために当該予備領域管理ブロックに付与された識別情報である。図2(A)の例では、1つの予備領域管理ブロックを示しているが、予備領域管理ブロックは1つに限るものではなく、1ブロック内に予備領域ブロックの物理ブロック番号をすべて収めることができない場合は、複数の予備領域管理ブロックが確保される。予備領域ブロックの物理ブロック番号Nxを予備領域管理ブロックに記憶することで予備領域ブロックが管理される。
In the example of FIG. 2A, the blocks having physical block numbers Nx “01”, “02”, and “04” are data storage area blocks, respectively. In addition, blocks having physical block numbers Nx “03”, “05”, “06”, and “7F” are spare area blocks, respectively. A block having the physical block number Nx “80” is a spare area management block. In the data storage area block, a logical block number Ny, a usage counter C, data D, and error check information P are stored (stored). The logical block number Ny is information for forming (constructing) a logical address space (logical address space) as shown in FIG. The usage counter C is a value indicating the number of times the data storage area block that stores the usage counter C is used, and is 1 each time the data storage area block is used by writing data D to the data storage area block. Incremented. The usage counter C can determine whether each block is new or old, and can manage the number of times the block is used. The data D is, for example, data output to the
ところで、仮に、予備領域管理ブロックに、物理ブロック番号から論理ブロック番号に変換するためのテーブルを記憶する場合、当該テーブルが複数ページに跨る可能性が増すことになる。このことは、データを書き換える際にページ単位の消去処理及び1バイト書き込み処理が発生するフラッシュメモリ13において、書き込み処理速度を低下させる結果となる。本実施形態では、予備領域管理ブロックで予備領域ブロックを管理するものの、物理ブロック番号から論理ブロック番号に変換するためのテーブルを管理しないので、当該テーブルが複数ページに跨ることを回避でき、その結果、書き込み処理速度を向上することができる。
By the way, if a table for converting a physical block number to a logical block number is stored in the spare area management block, the possibility that the table extends over a plurality of pages increases. This results in a decrease in the writing processing speed in the
I/O回路14は、外部端末2とのインターフェイスを担う。I/O回路14には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部端末2とのデータ通信を行う端子である。
The I / O circuit 14 serves as an interface with the
そして、CPU11は、外部端末2からのコマンドに応じてデータの書き込み処理を行う場合に、本発明における第1検索手段として機能することにより、予備領域管理ブロックを参照して予備領域ブロックを検索し、本発明における第2検索手段として機能することにより、上記コマンドに応じて算出された論理ブロック番号Nyを記憶しているデータ記憶領域ブロックを検索する。ここで、論理ブロック番号Nyは、上記コマンドで指定される書き込み先論理アドレスと、1ブロックあたりのデータサイズとから算出される。
When the
また、CPU11は、本発明における第1書込手段として機能することにより、上記第1検索手段により検索された予備領域ブロックを新たなデータ記憶領域ブロックとして当該予備領域ブロックに、上記第2検索手段により検索されたデータ記憶領域ブロックに記憶されているデータDに対応する更新データDzと、上記コマンドに応じて算出された論理ブロック番号Nyとを書き込む。また、CPU11は、更新データDzと論理ブロック番号Nyとを予備領域ブロックへ書き込む際に、上記第2検索手段により検索されたデータ記憶領域ブロックに記憶されている使用カウンタを1インクリメントした使用カウンタCを上記予備領域ブロックへ書き込む。例えば、図2(A)に示す物理ブロック番号Nx“03”の予備領域ブロックが第1検索手段により検索され、且つ、物理ブロック番号Nx“01”のデータ記憶領域ブロックが第2検索手段により検索されたとする。この場合、物理ブロック番号Nx“01”のデータ記憶領域ブロックに記憶されているデータD“33333333・・・”に対応する更新データDz(例えば“33333333・・・”を上書きする値)と、同データ記憶領域ブロックに記憶されている論理ブロック番号Ny“03”と、同データ記憶領域ブロックに記憶されている使用カウンタC“02”を1インクリメントした使用カウンタC“03”とが物理ブロック番号Nx“03”の予備領域ブロックに書き込まれる。このとき、書き込まれた値に基づき誤り検査情報Pが新たに算出され、物理ブロック番号Nx“03”の予備領域ブロックに書き込まれる。こうして書き込まれた予備領域ブロックは、新たなデータ記憶領域ブロックとなる。
Further, the
また、CPU11は、本発明における第2書込手段として機能することにより、上記第2検索手段により検索されたデータ記憶領域ブロックの物理ブロック番号Nxを新たな予備領域ブロックの物理ブロック番号Nxとして、上記更新データDzの書き込み後に予備領域管理ブロックに書き込む。つまり、上記第2検索手段により検索されたデータ記憶領域ブロックは、古くなったので新たな予備領域ブロックとして管理されるのである。この場合において、上記第1検索手段により複数の予備領域ブロックが検索されたとすると、CPU11は、検索された複数の予備領域ブロックのうち更新データDzが書き込まれなかった何れかの予備領域ブロックを新たな予備領域管理ブロックとし、当該新たな予備領域管理ブロックに、上記新たな予備領域ブロック(古くなったデータ記憶領域ブロック)の物理ブロック番号Nx(図2(A)の例では、“01”)及び新たな予備領域管理ブロックとして使用されなかった予備領域ブロックの物理ブロック番号Nx(図2(A)の例では、“05”及び“06”)を書き込む。これにより、データ記憶領域ブロックを効率良く使い回すことができる。このとき、元の予備領域管理ブロックに記憶されている予備領域管理ブロック識別子ID“AA”と、同予備領域管理ブロックに記憶されている使用カウンタC“12”を1インクリメントした使用カウンタC“13”と、新たに算出された誤り検査情報Pとが新たな予備領域管理ブロックに書き込まれる。
Further, the
更に、CPU11は、書き込みに失敗や引き抜きなどによる電源遮断が発生した場合、書き込み処理発生前の状態に戻す、または書き込み処理を完了させるため、ロールバック処理を実行する。このロールバック処理において、CPU11は、本発明における第1判定手段として機能することにより、上記第1検索手段により検索された予備領域ブロックが未使用でない場合、又は予備領域管理ブロックへの物理ブロック番号Nxの書き込みが正常に終了しない場合、予備領域管理ブロックが2つ以上存在するか否かを判定する。予備領域管理ブロックが2つ以上存在する場合には、例えば、新たな予備領域管理ブロックへの書き込み途中、又は書き込み完了直後に電源遮断が発生した場合が該当する。
Further, the
そして、CPU11は、予備領域管理ブロックが2つ以上存在すると判定した場合、本発明における第2判定手段として機能することにより、最も新しい予備領域管理ブロックに記憶されている誤り検査情報Pが正常であるかを判定する。CPU11は、予備領域管理ブロックに記憶されている誤り検査情報Pが正常であると判定した場合、本発明における初期化手段として機能することにより、最も新しい予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックを初期化する(例えば、FFFF…を書き込む)。この場合、最も新しく作成された予備領域管理ブロック内の情報が正確であると推定できるため、この情報で示される予備領域ブロックを初期化することで予備領域ブロックが確保される。一方、CPU11は、予備領域管理ブロックに記憶されている誤り検査情報Pが正常でないと判定された場合、本発明における初期化手段として機能することにより、最も新しい予備領域管理ブロック以外の予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックを初期化する。この場合、最も新しく作成された予備領域管理ブロック内の情報が正確でないと推定できるため、元々存在していた古い予備領域管理ブロック内の情報で示される予備領域ブロックを初期化することで予備領域ブロックが確保される。このようなロールバック処理により、書き込みに失敗や引き抜きなどによる電源遮断が発生した場合でも、データを保障することができる。
When the
次に、図3〜図5を参照して、書き込み処理の詳細を説明する。図3は、CPU11により実行される書き込み処理を示すフローチャートである。図4は、図3に示すステップS8における予備領域管理ブロックの更新処理の詳細を示すフローチャートである。図5は、図3に示すステップS11におけるロールバック処理の詳細を示すフローチャートである。
Next, details of the writing process will be described with reference to FIGS. FIG. 3 is a flowchart showing the writing process executed by the
図3に示す処理は、CPU11が例えば外部端末2からI/O回路14を介して書き込みコマンドを受信した場合に開始される。図3に示す処理が開始されると、CPU11は、予備領域管理ブロックを参照して予備領域ブロックを検索し、検索された予備領域ブロックの物理ブロック番号Nx(物理アドレスでもよい)を例えばRAM12に記憶して保持する(ステップS1)。つまり、CPU11は、予備領域管理ブロック識別子IDにより予備領域管理ブロックを求めて物理アドレス空間内を検索し、見つかった予備領域管理ブロック内の予備領域ブロックの物理ブロック番号Nxを保持する。
The process shown in FIG. 3 is started when the
次いで、CPU11は、ステップS1で保持された物理ブロック番号Nxに基づき、未使用の予備領域ブロックが存在するか否かを判定する(ステップS2)。例えば、ステップS1で保持された物理ブロック番号Nxが付与されている予備領域ブロック内が初期化された値(例えば、FFFF…)で満たされている場合、未使用の予備領域ブロックが存在すると判定される。未使用の予備領域ブロックが存在すると判定された場合(ステップS2:YES)、ステップS3へ進み、未使用の予備領域ブロックが存在しない(つまり、検索された予備領域ブロックが未使用でない)と判定された場合(ステップS2:NO)、CPU11は、異常終了として書き込みを終了して、ロールバック処理(ステップS11)へ進む。ロールバック処理の詳細については後述する。
Next, the
ステップS3では、CPU11は、上記コマンドで指定された書き込み先論理アドレスより論理ブロック番号Nyを算出する。次いで、CPU11は、ステップS3で算出された論理ブロック番号Nyを記憶しているデータ記憶領域ブロックを検索し、検索されたデータ記憶領域ブロックの物理ブロック番号Nx(物理アドレスでもよい)を例えばRAM12に記憶して保持する(ステップS4)。つまり、CPU11は、論理ブロック番号Nyと一致するデータ記憶領域ブロックを求めて物理アドレス空間内を検索し、見つかったデータ記憶領域ブロックの物理ブロック番号Nxを保持する。
In step S3, the
次いで、CPU11は、検索されたデータ記憶領域ブロック内のデータ(以下、「ブロックデータ」といい、論理ブロック番号Ny、使用カウンタC、データD、及び誤り検査情報Pが含まれる)をRAM12に読み出し、当該読み出したブロックデータと、上記コマンドで指定されたデータとを基に、書き込みデータを構築する(ステップS5)。例えば、RAM12上で、上記読み出されたブロックデータに含まれる使用カウンタCが1インクリメントされ、該ブロックデータに含まれるデータDが上記コマンドで指定されたデータで更新データDzに更新される。そして、上記読み出されたブロックデータに含まれる論理ブロック番号Nyと、1インクリメントされたカウンタCと、更新された更新データDzと、これらのデータに基づき例えばCRC演算式により算出された誤り検査情報Pと、により書き込みデータが構築される。
Next, the
次いで、CPU11は、ステップS5で構築された書き込みデータを、ステップS1で保持された物理ブロック番号Nxに対応する予備領域ブロックに書き込む(ステップS6)。つまり、ステップS1で検索された予備領域ブロックを新たなデータ記憶領域ブロックとして当該予備領域ブロックに、ステップS5で構築された書き込みデータが書き込まれる。
Next, the
次いで、CPU11は、コマンドで指定された全てのデータの書き込みが完了したか否かを判定する(ステップS7)。そして、CPU11は、全てのデータの書き込みが完了していないと判定した場合(ステップ7:NO)、ステップS2に戻り、上記と同様の処理を行う。一方、CPU11は、全てのデータの書き込みが完了していると判定した場合(ステップ7:YES)、ステップS8へ進む。
Next, the
ステップS8では、CPU11は、予備領域管理ブロックの更新処理を実行することで、古いデータ記憶領域ブロックを予備領域ブロックとして予備領域管理ブロックに登録して予備領域管理ブロックを更新する。予備領域管理ブロックの更新処理の詳細については後述する。
In step S8, the
次いで、CPU11は、予備領域管理ブロックの更新が正常終了したか否かを判定する(ステップS9)。つまり、予備領域管理ブロックへの物理ブロック番号Nxの書き込みが正常に終了したか否かが判定される。CPU11は、予備領域管理ブロックの更新が正常終了していないと判定した場合(ステップ9:NO)、異常終了として書き込みを終了して、ロールバック処理(ステップS11)へ進む。一方、CPU11は、予備領域管理ブロックの更新が正常終了したと判定した場合(ステップ9:YES)、ステップS10へ進む。
Next, the
ステップS10では、CPU11は、使用済の(古い)データ記憶領域ブロックと、使用済の予備領域管理ブロックとを消去(つまり、ブロック内のデータを初期化)して、書き込み処理を終了する。なお、ステップS10の処理は書き込み処理内で行わずに、例えばICカード1のリセット指令があったときに行われるように構成してもよい。
In step S10, the
次に、図4に示す予備領域管理ブロックの更新処理では、CPU11は、先ず、更新後の予備領域管理ブロックとするための予備領域ブロックを、例えばステップS1で保持された物理ブロック番号Nxの中から検索する(ステップS81)。
Next, in the update process of the spare area management block shown in FIG. 4, the
次いで、CPU11は、ステップS2と同様に、未使用の予備領域ブロックが存在するか否かを判定する(ステップS82)。そして、未使用の予備領域ブロックが存在すると判定された場合(ステップS82:YES)、ステップS83へ進み、未使用の予備領域ブロックが存在しないと判定された場合(ステップS82:NO)、CPU11は、異常終了として書き込みを終了する。
Next, the
ステップS83では、CPU11は、ステップS82で判定された未使用の予備領域ブロックの物理ブロック番号Nx(物理アドレスでもよい)を例えばRAM12に記憶して保持する。
In step S83, the
次いで、CPU11は、ステップS1で参照した予備領域管理ブロック内のデータ(以下、「管理ブロックデータ」といい、予備領域管理ブロック識別子ID、使用カウンタC、予備領域ブロックの物理ブロック番号Nx、及び誤り検査情報Pが含まれる)をRAM12に読み出し、予備領域管理ブロック用の書き込みデータを構築する(ステップS84)。例えば、RAM12上で、上記読み出された管理ブロックデータに含まれる使用カウンタCが1インクリメントされる。さらに、RAM12上で、上記読み出された管理ブロックデータに含まれる物理ブロック番号Nxのうち、更新データDzが書き込まれた予備領域ブロックの物理ブロック番号Nxが削除される代わりに、ステップS5でブロックデータが読み出されたデータ記憶領域ブロック(新たな予備領域ブロックとなる)の物理ブロック番号Nxが記憶される。これにより、RAM12における予備領域ブロックの物理ブロック番号Nxは、読み出された予備領域ブロックの物理ブロック番号Nxのうちで更新データDzが書き込まれなかった予備領域ブロックの物理ブロック番号Nxと、ステップS5でブロックデータが読み出されたデータ記憶領域ブロックの物理ブロック番号Nxとにより再構成される。そして、上記読み出されたブロックデータに含まれる予備領域管理ブロック識別子IDと、1インクリメントされたカウンタCと、再構成された予備領域ブロックの物理ブロック番号Nxと、これらのデータに基づき例えばCRC演算式により算出された誤り検査情報Pと、により予備領域管理ブロック用の書き込みデータが構築される。
Next, the
次いで、CPU11は、ステップS84で構築された予備領域管理ブロック用の書き込みデータを、ステップS83で保持された物理ブロック番号Nxに対応する予備領域ブロックに書き込み(ステップS85)、図3に示す処理に戻る。つまり、ステップS81で検索された予備領域ブロックを新たな予備領域管理ブロックとして当該予備領域ブロックに、ステップS84で構築された予備領域管理ブロック用の書き込みデータが書き込まれる。
Next, the
次に、図5に示すロールバック処理では、CPU11は、先ず、予備領域管理ブロックが2つ以上存在するか否かを判定する(ステップS111)。そして、CPU11は、予備領域管理ブロックが2つ以上存在すると判定した場合(ステップS111:YES)、ステップS112に進み、予備領域管理ブロックが2つ以上存在しないと判定した場合(ステップS111:NO)、ステップS115に進む。
Next, in the rollback process shown in FIG. 5, the
ステップS112では、CPU11は、最も新しい予備領域管理ブロックに記憶されている誤り検査情報Pが正常であるか否かを判定する。例えば、最も新しい予備領域管理ブロックに記憶されている誤り検査情報Pと、このとき算出した誤り検査情報Pとが一致する場合、正常であると判定される。そして、CPU11は、予備領域管理ブロックに記憶されている誤り検査情報Pが正常であると判定した場合(ステップS112:YES)、最も新しい予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックを初期化し(ステップS113)、当該ロールバック処理を終了する。一方、CPU11は、予備領域管理ブロックに記憶されている誤り検査情報Pが正常でないと判定した場合(ステップS112:NO)、古い予備領域管理ブロック(つまり、最も予備領域管理ブロック以外の予備領域管理ブロック)に記憶されている物理ブロック番号Nxに対応する予備領域ブロックを初期化し(ステップS114)、当該ロールバック処理を終了する。
In step S112, the
一方、ステップS115では、CPU11は、ステップS111で判定された予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックが未使用であるか否かを判定する。そして、CPU11は、予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックが未使用である(つまり、初期化された値が保持されている)と判定した場合(ステップS115:YES)、当該ロールバック処理を終了する。一方、CPU11は、予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックが未使用でないと判定した場合(ステップS115:NO)、当該予備領域管理ブロックに記憶されている物理ブロック番号Nxに対応する予備領域ブロックを初期化し(ステップS116)、当該ロールバック処理を終了する。
On the other hand, in step S115, the
以上説明したように、上記実施形態によれば、データ記憶領域ブロックに論理ブロック番号Nyを保持させ、予備領域管理ブロックに予備領域ブロックの論理ブロック番号Nxを保持させるように構成し、書き込み処理を行う場合に、予備領域管理ブロックを参照して予備領域ブロックを検索し、当該検索された予備領域ブロックを新たなデータ記憶領域ブロックとして当該予備領域ブロックに書き込みデータを書き込んだ後、古くなったデータ記憶領域ブロックの物理ブロック番号Nxを新たな予備領域ブロックの物理ブロック番号Nxとして予備領域管理ブロックに書き込むように構成したので、一度の書き込み処理において2ブロックの書き込みだけでデータを保障した書き込みを実現でき、書き込み処理速度を向上させることができる。 As described above, according to the above embodiment, the logical block number Ny is held in the data storage area block, and the logical block number Nx of the spare area block is held in the spare area management block. When performing a search, a spare area block is searched with reference to the spare area management block, and after writing the write data into the spare area block with the searched spare area block as a new data storage area block, the stale data Since the configuration is such that the physical block number Nx of the storage area block is written to the spare area management block as the physical block number Nx of the new spare area block, writing that guarantees data by only writing two blocks in one writing process is realized. Can improve the writing process speed. .
1 ICカード
1a ICチップ
11 CPU
12 RAM
13 フラッシュメモリ
14 I/O回路
1 IC card
12 RAM
13 Flash memory 14 I / O circuit
Claims (6)
前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、
前記コントローラは、
前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索手段と、
前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索手段と、
前記第1検索手段により検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込手段と、
前記第2検索手段により検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込手段による前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込手段と、
を備えることを特徴とする情報記録媒体。 A non-volatile memory having a storage area divided into a plurality of blocks including a data storage area block, a spare area block, and a spare area management block, and each block having a physical block number forming a physical address space And a controller that reads and writes data to and from the nonvolatile memory in response to a command, an information recording medium comprising:
The data storage area block stores data and logical block numbers forming a logical address space, the spare area block stores an initialized value, and the spare area management block stores the spare area block. The physical block number is stored,
The controller is
A first search means for searching for the spare area block with reference to the spare area management block when performing a data write process in response to the command;
Second search means for searching for the data storage area block storing the logical block number calculated in response to the command;
The spare area block searched by the first search means as the new data storage area block in the spare area block, and the data stored in the data storage area block searched by the second search means First writing means for writing corresponding update data and the logical block number calculated in response to the command;
Using the physical block number of the data storage area block retrieved by the second retrieval means as the physical block number of a new spare area block, the spare area management block after writing the update data by the first writing means Second writing means for writing to
An information recording medium comprising:
前記第1書込手段は、前記更新データと前記論理ブロック番号とを前記予備領域ブロックへ書き込む際に、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記使用カウンタを1インクリメントした使用カウンタを前記予備領域ブロックへ書き込むことを特徴とする請求項1に記載の情報記録媒体。 In the data storage area block, a usage counter indicating the number of times the data storage area block is used is stored.
The first writing means sets the use counter stored in the data storage area block searched by the second searching means when writing the update data and the logical block number to the spare area block. 2. The information recording medium according to claim 1, wherein a use counter incremented by 1 is written in the spare area block.
前記コントローラは、
前記第1検索手段により検索された前記予備領域ブロックが未使用でない場合、又は前記第2書込手段による書き込みが正常に終了しない場合、前記予備領域管理ブロックが2つ以上存在するか否かを判定する第1判定手段と、
前記第1判定手段により前記予備領域管理ブロックが2つ以上存在すると判定された場合、最も新しい前記予備領域管理ブロックに記憶されている誤り検査情報が正常であるかを判定する第2判定手段と、
前記第2判定手段により前記予備領域管理ブロックに記憶されている誤り検査情報が正常であると判定された場合、最も前記予備領域管理ブロックに記憶されている前記物理ブロック番号に対応する前記予備領域ブロックを初期化する一方、前記第2判定手段により前記予備領域管理ブロックに記憶されている誤り検査情報が正常でないと判定された場合、最も前記予備領域管理ブロック以外の前記予備領域管理ブロックに記憶されている前記物理ブロック番号に対応する前記予備領域ブロックを初期化する初期化手段と、
を備えることを特徴とする請求項1乃至3の何れか一項に記載の情報記録媒体。 Error information is further stored in the spare area management block,
The controller is
Whether or not there are two or more spare area management blocks if the spare area block retrieved by the first retrieval means is not unused, or if the writing by the second writing means does not end normally. First determination means for determining;
Second determination means for determining whether or not error check information stored in the newest spare area management block is normal when the first determination means determines that there are two or more spare area management blocks; ,
When it is determined by the second determination means that the error check information stored in the spare area management block is normal, the spare area corresponding to the physical block number stored most in the spare area management block While the block is initialized, the error determination information stored in the spare area management block is determined to be not normal by the second determination unit, and stored in the spare area management block other than the spare area management block. Initialization means for initializing the spare area block corresponding to the physical block number being
The information recording medium according to any one of claims 1 to 3, further comprising:
前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、
前記データ読み書き方法は、
前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索ステップと、
前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索ステップと、
前記第1検索ステップにより検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索ステップにより検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込ステップと、
前記第2検索ステップにより検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込ステップによる前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込ステップと、
を含むことを特徴とするデータ読み書き方法。 A non-volatile memory having a storage area divided into a plurality of blocks including a data storage area block, a spare area block, and a spare area management block, and each block having a physical block number forming a physical address space A data read / write method performed by the controller in an information recording medium comprising: a controller that reads and writes data to and from the nonvolatile memory in response to a command;
The data storage area block stores data and logical block numbers forming a logical address space, the spare area block stores an initialized value, and the spare area management block stores the spare area block. The physical block number is stored,
The data read / write method is:
A first search step of searching for the spare area block with reference to the spare area management block when performing a data write process in response to the command;
A second search step of searching for the data storage area block storing the logical block number calculated in response to the command;
The spare area block searched in the first search step is used as the new data storage area block in the spare area block, and the data stored in the data storage area block searched in the second search step A first writing step of writing corresponding update data and the logical block number calculated in response to the command;
The spare area management block after writing the updated data in the first writing step, with the physical block number of the data storage area block searched in the second searching step as the physical block number of a new spare area block A second writing step for writing to
A method for reading and writing data, comprising:
前記データ記憶領域ブロックにはデータ及び論理アドレス空間を形成する論理ブロック番号が記憶され、前記予備領域ブロックには初期化された値が記憶され、前記予備領域管理ブロックには前記予備領域ブロックの前記物理ブロック番号が記憶されており、
前記コントローラに、
前記コマンドに応じてデータの書き込み処理を行う場合に、前記予備領域管理ブロックを参照して前記予備領域ブロックを検索する第1検索手段、
前記コマンドに応じて算出された前記論理ブロック番号を記憶している前記データ記憶領域ブロックを検索する第2検索手段、及び前記第1検索手段により検索された前記予備領域ブロックを新たな前記データ記憶領域ブロックとして当該予備領域ブロックに、前記第2検索手段により検索された前記データ記憶領域ブロックに記憶されている前記データに対応する更新データと、前記コマンドに応じて算出された前記論理ブロック番号とを書き込む第1書込手段、及び、
前記第2検索手段により検索された前記データ記憶領域ブロックの前記物理ブロック番号を新たな予備領域ブロックの前記物理ブロック番号として、前記第1書込手段による前記更新データの書き込み後に前記予備領域管理ブロックに書き込む第2書込手段として機能させることを特徴とするデータ読み書きプログラム。 A non-volatile memory having a storage area divided into a plurality of blocks including a data storage area block, a spare area block, and a spare area management block, and each block having a physical block number forming a physical address space A data read / write program executed by the controller in an information recording medium comprising: a controller that reads and writes data to and from the nonvolatile memory in response to a command;
The data storage area block stores data and logical block numbers forming a logical address space, the spare area block stores an initialized value, and the spare area management block stores the spare area block. The physical block number is stored,
In the controller,
A first search means for searching for the spare area block with reference to the spare area management block when performing a data write process in response to the command;
Second search means for searching for the data storage area block storing the logical block number calculated in response to the command, and the spare area block searched by the first search means for newly storing the data Update data corresponding to the data stored in the data storage area block searched by the second search means in the spare area block as the area block, and the logical block number calculated in response to the command First writing means for writing, and
Using the physical block number of the data storage area block retrieved by the second retrieval means as the physical block number of a new spare area block, the spare area management block after writing the update data by the first writing means A data read / write program which functions as a second writing means for writing to the data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013008430A JP6015461B2 (en) | 2013-01-21 | 2013-01-21 | Information recording medium, data read / write method, and data read / write program |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013008430A JP6015461B2 (en) | 2013-01-21 | 2013-01-21 | Information recording medium, data read / write method, and data read / write program |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014139737A JP2014139737A (en) | 2014-07-31 |
| JP6015461B2 true JP6015461B2 (en) | 2016-10-26 |
Family
ID=51416422
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013008430A Active JP6015461B2 (en) | 2013-01-21 | 2013-01-21 | Information recording medium, data read / write method, and data read / write program |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6015461B2 (en) |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0877074A (en) * | 1994-09-09 | 1996-03-22 | Hitachi Ltd | Storage system using flash memory |
| JP4462646B2 (en) * | 1996-06-28 | 2010-05-12 | ソニー株式会社 | Information processing apparatus, information processing method, reader / writer, access method, and recording medium |
| JP3950316B2 (en) * | 2001-10-17 | 2007-08-01 | 日本電信電話株式会社 | IC card and IC card memory access control method |
| JP2005190288A (en) * | 2003-12-26 | 2005-07-14 | Tdk Corp | Memory controller, flash memory system therewith, and method for controlling flash memory |
| JP4153535B2 (en) * | 2006-05-30 | 2008-09-24 | Tdk株式会社 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
| JP5570406B2 (en) * | 2010-12-14 | 2014-08-13 | 株式会社日立製作所 | Memory controller and data recording apparatus |
-
2013
- 2013-01-21 JP JP2013008430A patent/JP6015461B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014139737A (en) | 2014-07-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104205132B (en) | Write data in the smart card's non-volatile memory | |
| JP5329884B2 (en) | Portable electronic device and data processing method in portable electronic device | |
| US8417902B2 (en) | One-time-programmable memory emulation | |
| JP5843674B2 (en) | IC card, portable electronic device, and control method of IC card | |
| CN104978154A (en) | Cache operation-based flash rapid read-write method and system | |
| JP5259513B2 (en) | Portable electronic device, IC card, and portable electronic device control method | |
| CN107402717B (en) | Flash memory storage management | |
| KR20150135753A (en) | Ic card, electronic device and portable electronic device | |
| JP6015461B2 (en) | Information recording medium, data read / write method, and data read / write program | |
| CN113793634B (en) | Wear balancing method and storage device suitable for Nor Flash data storage | |
| JP6233134B2 (en) | Electronic information storage medium, information processing method, and information processing program | |
| JP6040895B2 (en) | Microcomputer and non-volatile memory block management method | |
| JP2019049876A (en) | Electronic information storage medium, IC card, table management method using electronic information storage medium, and table management program | |
| JP7021465B2 (en) | Electronic information storage device, IC card, data recovery method, and data recovery program | |
| US10223195B2 (en) | Counter in a flash memory | |
| JP2022187935A (en) | Secure element, electronic information storage medium and data update method | |
| JP7322923B2 (en) | Secure element, transaction control method and device | |
| US7346730B2 (en) | Mobile electronic device | |
| JP5983349B2 (en) | IC card, data read / write method, and data read / write program | |
| US20090034333A1 (en) | Method for Managing a Non-Volatile Memory In a Smart Card | |
| JP2016153945A (en) | Electronic information storage medium, counter rewriting method and counter rewriting program | |
| JP2019168944A (en) | Electronic information storage medium, IC card, command group execution method, and command group execution program | |
| JP7040053B2 (en) | Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium | |
| JP6281302B2 (en) | Information processing apparatus, IC card, and data processing method | |
| JP6252341B2 (en) | Electronic information storage medium, information processing method, and information processing program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20151127 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160817 |
|
| 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: 20160830 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160912 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6015461 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |