JP3920166B2 - IC card and information processing method thereof - Google Patents

IC card and information processing method thereof Download PDF

Info

Publication number
JP3920166B2
JP3920166B2 JP2002219629A JP2002219629A JP3920166B2 JP 3920166 B2 JP3920166 B2 JP 3920166B2 JP 2002219629 A JP2002219629 A JP 2002219629A JP 2002219629 A JP2002219629 A JP 2002219629A JP 3920166 B2 JP3920166 B2 JP 3920166B2
Authority
JP
Japan
Prior art keywords
area
address
data
buffer
information
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
JP2002219629A
Other languages
Japanese (ja)
Other versions
JP2004062504A (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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2002219629A priority Critical patent/JP3920166B2/en
Priority to US10/316,122 priority patent/US7017825B2/en
Priority to CN02154252A priority patent/CN1430179A/en
Priority to DE60218121T priority patent/DE60218121T2/en
Priority to EP02027644A priority patent/EP1324207B1/en
Publication of JP2004062504A publication Critical patent/JP2004062504A/en
Application granted granted Critical
Publication of JP3920166B2 publication Critical patent/JP3920166B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、例えば電子マネーやIDカードなどに利用されるICカード及びその情報処理方法に関し、特にICカードに搭載される不揮発性メモリに格納される情報の処理技術に関するものである。
【0002】
【従来の技術】
レジャー施設の利用券や金融機関などにおける電子財布として、情報を格納するメモリを所有するICカードとリーダライタとの間でデータの読み書きを行うICカードシステムが利用されている。ICカードには、リーダライタと接触して信号の受け渡しをするための接点を有する接触式ICカードと、電波を利用して通信を行う非接触式ICカードとがある。
【0003】
接触式ICカードは、電源、グランド、クロック、データ、リセットなどの信号とのインターフェース用接点を持っており、リーダライタより安定な電源が供給されている。一方、非接触式ICカードは、リーダライタからのキャリアを受けるためのアンテナコイルやキャパシタを内蔵しており、電源はリーダライタからのキャリアを整流して電源として用いている。
【0004】
上述した接触式ICカードにおいて、データの書き込み途中で機器からICカードの抜き差しが行われたり、また、非接触式ICカードにて同じくデータの書き込み途中で通信エリアから離れて、動作に必要な電力が得られなくなると、ICカードに搭載されているメモリ内のデータが破壊されることになってしまう。メモリ内のデータは所定のデータ長、例えば16バイトからなるブロック単位で構成されており、この複数のブロックデータに対して1回のコマンド処理にて同時に読み書きを行うこと可能な場合もあり、いかなる場合においてもデータの保証を行う必要がある。
【0005】
この課題に対して、第1の解決例として、例えばブロックデータの書き込みを行う際に、書き込み指定されたブロックデータについて、書き込み処理を行う前に有効であった旧のブロックデータを不揮発性メモリの別エリアに一旦保持し、その後にデータを書き込むといった旧データバックアップによるデータ保護手法がある。図12に示すように、複数のブロックデータから構成されるデータブロック領域に対して複数のブロックデータを同時に書き込む場合には、まず、指定されたブロック番号のブロックデータを予備ブロック領域における予備ブロックデータにそれぞれ保持した後、データブロック領域における指定されたブロック番号のブロックデータの書き込みを行う。これにより、データの書き込み途中で電源が途絶した場合においても、予備ブロック領域に書き込み処理を行う前のブロックデータが保持されているためデータを元の状態に戻すことができ、データ保証が可能となる。
【0006】
また、第2の解決例として、2つ以上のメモリ領域を確保し、どちらのメモリ領域が有効であるかを示す有効性情報を合わせて持たせておく有効性情報保持によるデータ保護手法も存在する。図13に示すように、データブロック領域Aとデータブロック領域Bの2つのメモリエリアを確保しており、それぞれのブロック番号のブロックデータにおいてどちらのデータが有効であるかのデータ有効性判定情報を保持することにする。ブロックデータを書き込む際にはデータ有効性判定情報を確認し、無効であるメモリ領域のブロックデータに新ブロックデータを書き込んだうえで、有効/無効情報をそれぞれ互いに書き換え更新することでデータの書き込み処理を行う。この場合においても、電源が途絶したときには、書き込み処理を行う前に有効であったブロックデータは保持されていることから有効性判定情報を書き込み処理前の状態にすることにより、データを元の状態に戻すことが可能となる。
【0007】
【発明が解決しようとする課題】
前述したブロックデータ管理方式により、不揮発性メモリに保持するデータも大量に必要とされることなく、少ない記憶領域で効率良くメモリを管理することが可能となる。
【0008】
しかしながら、論理アドレスと物理アドレスとを対応づけるアドレス管理方式では、データブロック領域と予備ブロック領域の総数が256ブロック以内であれば、アドレス管理領域内のブロック番号を1バイトで管理することが可能であるが、256ブロックを超えるブロック数を取り扱う際には、アドレス管理領域内のブロック番号を2バイト、3バイトといったように複数バイトで管理する必要が生じる。このため、アドレス管理領域のメモリ容量が2倍、3倍といったように多く必要となり、チップサイズが増大してしまうことになる。
【0009】
本発明は、このような大容量のデータブロック領域を取り扱う場合においても、電源途絶時のデータ保証を確保しながら、効率良くかつ高速に処理を実行することを可能とするICカード及びその情報処理方法を提供することを目的とする。
【0010】
【課題を解決するための手段】
本発明は、第1に、記憶保持するデータを格納するつ以上の記憶データ領域と、書き込み処理時において対象のデータを格納するつ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するメモリと、前記メモリへの書き込み処理時において、コマンドと対応して送られる書き込みデータを前記バッファ領域に格納し、前記アドレス管理領域における前記バッファ領域に対応するアドレス情報と前記コマンドで指定された前記記憶データ領域に対応するアドレス情報とを互いに書き換えてアドレス管理領域を更新するメモリ制御手段と、を備えたICカードを提供する。
【0011】
第2に、前記メモリは、前記アドレス管理領域において更新処理時の対象のアドレス情報を保持するアドレス保持領域を備えるとともに、前記つ以上のバッファ領域のうちのどの領域が有効であるかを示すバッファ領域の有効性情報を格納するバッファ判定フラグ領域と、書き込み処理の途中であることを示す書き込み処理中情報を格納するパラメータ領域とを備え、前記メモリ制御手段は、前記書き込み処理時において、前記コマンドで指定された論理アドレスを基に、前記つ以上の記憶データ領域及びバッファ領域から書き込み対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報を前記バッファ判定フラグ領域に格納し、前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを前記アドレス保持領域に一旦保持するとともに、前記書き込み処理中情報を前記パラメータ領域に設定し、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記記憶データ領域に対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを互いに書き換える更新処理を行った後に、前記書き込み処理中情報を元の状態に戻すことを特徴とする。
【0012】
第3に、前記メモリ制御手段は、前記書き込み処理中情報によって前記書き込み処理が完了したか否かを判断し、前記書き込み処理が正常に完了していない場合は、処理再開時に前記パラメータ領域に格納されている前記物理アドレスの更新総ブロック数及び更新済みブロック数と前記アドレス保持領域に保持されているアドレス情報と前記バッファ判定フラグ領域の有効性情報とに基づいて、未処理の前記物理アドレスの更新処理を完了させることを特徴とする。
【0013】
本発明は、第4に、記憶保持するデータを格納するつ以上の記憶データ領域と、読み出し処理時において対象のデータが格納されている2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するメモリと、前記メモリからの読み出し処理時において、前記アドレス管理領域におけるコマンドで指定された前記記憶データ領域に対応するアドレス情報でもって前記バッファ領域に対応するアドレス情報を書き換えてアドレス管理領域を更新し、この更新後のバッファ領域に格納された読み出しデータを読み出した後、前記アドレス管理領域を元の状態に復帰するメモリ制御手段と、を備えたICカードを提供する。
【0014】
第5に、前記メモリは、前記アドレス管理領域において更新処理時の対象のアドレス情報を保持するアドレス保持領域を備えるとともに、前記つ以上のバッファ領域のうちのどの領域が有効であるかを示すバッファ領域の有効性情報を格納するバッファ判定フラグ領域と、読み出し処理の途中であることを示す読み出し処理中情報を格納するパラメータ領域とを備え、前記メモリ制御手段は、前記読み出し処理時において、前記コマンドで指定された論理アドレスを基に、前記つ以上の記憶データ領域及びバッファ領域から読み出し対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報を前記バッファ判定フラグ領域に格納し、前記アドレス管理領域における前記バッファ領域に対応する物理アドレスを前記アドレス保持領域に一旦保持するとともに、前記読み出し処理中情報を前記パラメータ領域に設定し、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスを前記バッファ領域に対応する物理アドレスへ書き換える更新処理を行い、この更新後のバッファ領域に格納された読み出しデータを読み出してから前記保持したバッファ領域に対応する物理アドレスを元に戻す復元処理を行った後に、前記読み出し処理中情報を元の状態に戻すことを特徴とする。
【0015】
第6に、前記メモリ制御手段は、前記読み出し処理中情報によって前記読み出し処理が完了したか否かを判断し、前記読み出し処理が正常に完了していない場合は、処理再開時に前記パラメータ領域に格納されている前記物理アドレスの復元総ブロック数及び復元済みブロック数と前記アドレス保持領域に保持されているアドレス情報と前記バッファ判定フラグ領域の有効性情報とに基づいて、未処理の前記物理アドレスの復元処理を完了させることを特徴とする。
【0016】
本発明は、第7に、記憶保持するデータを格納する2つ以上の記憶データ領域と、書き込み処理時において対象のデータを格納する2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報および前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するICカード内のメモリへのデータの書き込み処理時において、ICカード内の制御部が、コマンドと対応して送られる書き込みデータを前記メモリのバッファ領域に格納するステップと、前記制御部が、前記コマンドで指定された論理アドレスを基に、つ以上の記憶データ領域及びバッファ領域から書き込み対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報をバッファ判定フラグ領域に格納するステップと、前記制御部が、前記メモリのアドレス情報を格納するアドレス管理領域における、前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスと前記バッファ領域に対応する物理アドレスとをアドレス保持領域に一旦保持するステップと、前記制御部が、書き込み処理の途中であることを示す書き込み処理中情報を設定するステップと、前記制御部が、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記記憶データ領域に対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを互いに書き換えて前記アドレス管理領域の更新処理を行うステップと、前記制御部が、前記更新処理の後に前記書き込み処理中情報を元の状態に戻すステップと、を有するICカードの情報処理方法を提供する。
【0017】
本発明は、第8に、記憶保持するデータを格納する2つ以上の記憶データ領域と、読み出し処理時において対象のデータが格納されている2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するICカード内のメモリからのデータの読み出し処理時において、ICカード内の制御部が、コマンドで指定された論理アドレスを基につ以上の記憶データ領域及びバッファ領域から読み出し対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報をバッファ判定フラグ領域に格納するステップと、前記制御部が、前記メモリのアドレス情報を格納するアドレス管理領域における、前記バッファ領域に対応する物理アドレスを前記アドレス保持領域に一旦保持するステップと、前記制御部が、読み出し処理の途中であることを示す読み出し処理中情報を設定するステップと、前記制御部が、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスを前記バッファ領域に対応する物理アドレスへ書き換えて前記アドレス管理領域の更新処理を行うステップと、前記制御部が、前記更新後のバッファ領域に格納された読み出しデータを読み出してから前記保持したバッファ領域に対応する物理アドレスを元に戻す復元処理を行うステップと、前記制御部が、前記復元処理の後に前記読み出し処理中情報を元の状態に戻すステップと、を有するICカードの情報処理方法を提供する。
【0018】
本発明では、メモリへの書き込み処理時において、コマンドと対応して送られる書き込みデータをバッファ領域に格納し、アドレス管理領域におけるバッファ領域に対応するアドレス情報と前記コマンドで指定された記憶データ領域に対応するアドレス情報とを書き換えてアドレス管理領域を更新する。このとき、1つ以上の記憶データ領域及びバッファ領域のうちから指定された書き込み対象の記憶データ領域及びバッファ領域を選択して対象領域を示す有効性情報をバッファ判定フラグ領域に格納し、このバッファ判定フラグ領域の有効性情報に基づき、有効な対象領域のアドレス管理領域の更新処理を行う。これにより、書き込みデータ自体を一旦バッファ領域に格納してから記憶データ領域に書き移すような手順が不要であり、書き込みデータを一度バッファ領域に格納した後にアドレス情報を更新するのみで書き込み処理が完了するため、データ伝送処理と並行して略同時にコマンドパケットに付加される書き込みデータをバッファ領域に格納することができ、効率良くかつ高速に処理を実行することが可能となる。また、電源途絶時にも電源復帰後に処理中断前の状態から書き込み処理を復帰して完了させることができ、データの誤りや喪失を防止し、常にデータ保証を確保することが可能となる。さらに、大容量のデータ領域を有するメモリに対しても、書き込み処理に用いるアドレス管理領域などのシステム制御用のメモリ容量が大幅に増加することを防止できる。
【0019】
また、メモリへのデータの読み出し処理時において、アドレス管理領域におけるコマンドで指定された記憶データ領域に対応するアドレス情報とバッファ領域に対応するアドレス情報とを書き換えてアドレス管理領域を更新し、更新後のバッファ領域に格納された読み出しデータを読み出した後、アドレス管理領域を元の状態に復帰する。このとき、1つ以上の記憶データ領域及びバッファ領域のうちから指定された読み出し対象の記憶データ領域及びバッファ領域を選択して対象領域を示す有効性情報をバッファ判定フラグ領域に格納し、このバッファ判定フラグ領域の有効性情報に基づき、有効な対象領域のアドレス管理領域の更新処理を行う。これにより、読み出しデータ自体を記憶データ領域からバッファ領域に書き写して読み出すような手順が不要であり、アドレス情報を更新して更新後のバッファ領域から読み出しデータを読み出した後にアドレス情報を復帰させることで読み出し処理が完了するため、データ伝送処理と並行して略同時にバッファ領域に格納された読み出しデータを読み出してレスポンスパケットに付加することができ、効率良くかつ高速に処理を実行することが可能となる。また、電源途絶時にも電源復帰後に処理中断前の状態から読み出し処理を復帰して完了させることができ、データの誤りや喪失を防止し、常にデータ保証を確保することが可能となる。さらに、大容量のデータ領域を有するメモリに対しても、読み出し処理に用いるアドレス管理領域などのシステム制御用のメモリ容量が大幅に増加することを防止できる。
【0020】
【発明の実施の形態】
以下、図面を参照して本発明の実施の形態について説明する。
図1は、本発明の一実施の形態における情報処理方式が適用される非接触式ICカードシステムの構成を示すブロック図である。ICカード101とICカード101に対してデータの読み書きを行うリーダライタ102との間のデータの送受信は、それぞれアンテナ103、104を用いて電磁誘導方式等により行われる。リーダライタ102は、ICカード101への送信データを内部で作成し、変調信号としてアンテナ104を通してICカード101へ送信する。通信エリア内に存在するICカード101は、アンテナ103にて変調されたデータを受信する。受信したデータは復調部105で復調され、制御部106へ送られる。
【0021】
制御部106は、例えばCPU等のプロセッサにより構成され、制御用メモリROM107に格納された制御プログラムに従って受信データの解析や受信したデータをEEPROM(Electrically Erasable Programmable ROM)やFeRAM(Ferroelectronic RAM )等のメモリからなる不揮発性メモリ109に格納するなどの処理を行う。受信データの格納は、不揮発性メモリ109にFeRAMなどの書き込み速度が速いメモリを用いる場合は直接この不揮発性メモリ109に書き込むようにする。また、受信データをRAM108内の送受信バッファに一旦書き込むようにしてもよい。
【0022】
その後、受信データについて、不揮発性メモリ109においてデータの読み出し、書き込み処理を行い、応答のための送信データを作成する。この送信データは、制御部106を介して変調部110で変調され、この変調信号をアンテナ103よりリーダライタ102へ送信する。
【0023】
図1に示すICカード101の不揮発性メモリ109は、リーダライタ102から見た論理的なメモリ空間において、図2に示すようなファイル構成を持つ。すなわち、利用者が必要とするデータが格納されるデータブロック領域1401(記憶データ領域に相当する)と、リーダライタ102からICカード101へデータの読み書き時に指定されるデータが格納される予備ブロック領域1402(バッファ領域に相当する)と、ICカード101の不揮発性メモリ109において論理的なメモリ空間と物理的なメモリ空間とを関連付けるアドレス情報が格納されるアドレス管理領域1403とを有してなる。また、不揮発性メモリ109には、データ更新の際に用いる書き込み処理中情報や読み出し処理中情報を含む各種パラメータを格納するパラメータ領域1404と、アドレス管理領域1403の更新処理において更新対象となるアドレス管理領域を指定する有効性情報を示すフラグを格納するバッファ判定フラグ領域1405とが設けられる。
【0024】
本実施形態は、ICカード101の不揮発性メモリ109に関して、ブロック単位でデータを管理する場合に、ブロックの総数が256ブロックを超えるような大容量のメモリにおける論理構成及びその情報処理方法の例を示したものである。ここでは、データブロック領域1401と予備ブロック領域1402の総数が256ブロックを超える場合の例を示す。なお、本実施形態においては、データブロック領域1401のブロック数を480ブロック、予備ブロック領域1402のブロック数を32ブロックとしているが、これらのブロック数に限られるものではない。
【0025】
データブロック領域1401及び予備ブロック領域1402は、それぞれ所定のデータ長、例えば16バイトからなるブロック単位で構成される複数のブロックデータが論理ブロック番号を基準として記憶するように構成されている。図2の例では、データブロック領域1401は、論理ブロック番号00、01、02、・・・、1DFで示される480の論理ブロックデータを記憶し、また、予備ブロック領域1402は、論理ブロック番号1E0、1E1、・・・、1FFで示される32の予備ブロックデータを記憶している。なお、本実施形態の説明において、論理ブロック番号や物理ブロック番号などのメモリ上のブロックのアドレスを示す値、各領域に格納されるデータの内容やフラグなどの値は、16進数で表すものとする。
【0026】
図2のようなブロック構成では、データブロック領域1401のブロック数と予備ブロック領域1402のブロック数の総数が256を超えるため、そのままではアドレス管理領域1403の管理ブロック番号を1バイトで管理することができない。そこで、本実施形態においては、データブロック領域のブロック数と予備ブロック領域のブロック数の総数が256×2以下であることから、図3に示すように、ブロック領域を論理的なメモリ空間において2つの領域に分割する。すなわち、2つのデータブロック領域A1501及びデータブロック領域B1502、2つの予備ブロック領域A1503及び予備ブロック領域B1504、それぞれの領域の論理的なメモリ空間と物理的なメモリ空間とを関連付けるアドレス情報が格納される2つのアドレス管理領域A1505及びアドレス管理領域B1506、パラメータ領域1507、バッファ判定フラグ領域1508から構成することとする。なお、図3では2つの領域に分割しているが、3つ以上に分割してもよく、データブロック領域と予備ブロック領域の総数に応じて適切な数の領域に分割してもよい。
【0027】
図3のブロック構成の場合、各ブロックデータは図2で示した論理ブロック番号に代わって、分割された複数の領域毎に定義されたエリア別論理ブロック番号によって管理される。すなわち、データブロック領域A1501及びデータブロック領域B1502は、それぞれの領域において、エリア別論理ブロック番号00、01、02、・・・、EFで示される240の論理ブロックデータを記憶し、予備ブロック領域A1503及び予備ブロック領域B1504は、それぞれの領域において、論理ブロック番号F0、F1、・・・、FFで示される16の予備ブロックデータを記憶している。
【0028】
リーダライタ102はICカード101に対して、搭載される不揮発性メモリ109内のデータブロック領域A1501及びデータブロック領域B1502に対してデータを読み書きを行うことが可能である。この場合、バッファ判定フラグ領域1508のフラグにより更新対象となるアドレス管理領域を選択し、対応するデータブロック領域A1501またはデータブロック領域B1502において、データの読み書きを行う論理ブロックデータのエリア別論理ブロック番号を指定してデータの読み書きを行うことになる。また、1回のコマンドにて複数の論理ブロック番号を指定することも可能であり、例えば、エリア別論理ブロック番号00と01を指定することにより複数の論理ブロックデータに対して同時にデータの読み書きを行うことができる。
【0029】
また本実施形態において、データの書き込み処理においては、ライトコマンドに付加される書き込み指定ブロックデータが受信データ伝送処理と略同時に並行して予備ブロック領域A1503または予備ブロック領域B1504の予備ブロック0データから予備ブロックFデータまで順に格納される。すなわち2つのブロックデータの同時書き込み処理を行った際には、ライトコマンドに付加される1番目に指定されたブロックデータが予備ブロック0データに、2番目に指定されたブロックデータが予備ブロック1データに格納されることになる。
【0030】
さらに、データの読み出し処理においては、リードコマンドにて指定されたエリア別論理ブロック番号のブロックデータが送信処理時において予備ブロック領域A1503または予備ブロック領域B1504の予備ブロック0データから予備ブロックFデータまで順に格納される。そして制御部106は、リードレスポンス返送時に予備ブロック0データから順にブロックデータの読み出しを行いながらリードレスポンスにブロックデータを付加して、送信データ伝送処理を行う。
【0031】
また、このとき不揮発性メモリ109は、実際のメモリ構成となる物理的なメモリ空間において、図4に示すようなファイル構成を持つ。物理的なメモリ空間は、アドレス管理領域A1601及びアドレス管理領域B1602と、データ領域A1603及びデータ領域B1604とを有して構成される。アドレス管理領域A1601は、論理ブロックデータのブロック番号を管理するデータブロック用アドレス管理領域A1611と、予備ブロックデータのブロック番号を管理する予備ブロック用アドレス管理領域A1612と、電源途絶時のデータ保証のため、ブロックデータの書き込み処理及び読み出し処理を行うときにブロック番号が記録されるブロック番号保持領域A1613と有して構成される。同様に、アドレス管理領域B1602は、データブロック用アドレス管理領域B1614と、予備ブロック用アドレス管理領域B1615と、ブロック番号保持領域B1616とを有して構成される。
【0032】
また、不揮発性メモリ109には、データ更新の際に用いる書き込み処理中情報や読み出し処理中情報を含む各種パラメータを格納するパラメータ領域1605と、それぞれのアドレス管理領域A1601、アドレス管理領域B1602の更新処理において、更新対象となるアドレス管理領域を指定するフラグを格納するバッファ判定フラグ領域1606とが設けられる。
【0033】
本実施形態では、データ領域を複数に分割し、それぞれのデータ領域A1603とデータ領域B1604のブロック数を256ブロック以下とすることにより、対応するアドレス管理領域A1601、アドレス管理領域B1602においてはそれぞれ1バイトのブロック番号で管理することができる。
【0034】
図3に示される論理的なメモリ空間におけるデータブロック領域A1501と予備ブロック領域A1503は、図4に示される物理的なメモリ空間においてはアドレス管理領域A1601内の各ブロック番号によりそれぞれ対応づけられ、双方がデータ領域A1603に混在して格納されている。同様に、図3に示される論理的なメモリ空間におけるデータブロック領域B1502と予備ブロック領域B1504は、図4に示される物理的なメモリ空間においてはアドレス管理領域B1602内の各ブロック番号によりそれぞれ対応づけられ、双方がデータ領域B1604に混在して格納されている。
【0035】
また、図3に示す論理的なメモリ空間におけるデータブロック領域A1501における論理ブロックデータは、図4に示す物理的なメモリ空間においては、アドレス管理領域A1601内のデータブロック用アドレス管理領域A1611における各ブロック番号により関連付けられてデータ領域A1603に記録されている。さらに、図3に示す論理的なメモリ空間における予備ブロック領域A1503における予備ブロックデータは、図4に示す物理的なメモリ空間においては、アドレス管理領域A1601内の予備ブロック用アドレス管理領域A1612における各ブロック番号により関連付けられてデータ領域A1603に記録されている。一方、図3に示す論理的なメモリ空間におけるデータブロック領域B1502における論理ブロックデータは、図4に示す物理的なメモリ空間においては、アドレス管理領域B1602内のデータブロック用アドレス管理領域B1614における各ブロック番号により関連付けられてデータ領域B1604に記録されている。また、図3に示す論理的なメモリ空間における予備ブロック領域B1504における予備ブロックデータは、図4に示す物理的なメモリ空間においては、アドレス管理領域B1602内の予備ブロック用アドレス管理領域B1615における各ブロック番号により関連付けられてデータ領域B1604に記録されている。
【0036】
さらに、アドレス管理領域A1601内のブロック番号保持領域A1613は、ブロックデータの書き込み処理及び読み出し処理時にコマンドにて指定される論理ブロック番号を保持する論理ブロック番号保持領域A1621と、指定された論理ブロック番号に対応する物理ブロック番号を保持する物理ブロック番号保持領域A1623と、書き込み処理時にコマンドパケットに付加される書き込みデータ及び、読み出し処理にレスポンスパケットに付加される読み出しデータが格納される予備ブロック番号を保持する予備ブロック番号保持領域A1625とを有して構成される。同様に、アドレス管理領域B1602内のブロック番号保持領域B1616は、論理ブロック番号保持領域B1622と、物理ブロック番号保持領域B1624と、予備ブロック番号保持領域B1626とを有して構成される。また、これら不揮発性メモリ109内のブロックデータの値が誤りなく正当なものであるかを判定、確認するために、それぞれのブロックデータにはブロック単位毎に誤り検査情報(パリティデータ)1607が格納される。
【0037】
次に、それぞれのアドレス管理領域A1601、アドレス管理領域B1602とバッファ判定フラグ領域1606の構成及び制御内容について図5を用いて説明する。
【0038】
データブロック用アドレス管理領域A1611は、先頭から順に、論理ブロック番号00、論理ブロック番号01、・・・、論理ブロック番号DFに対応する物理ブロック番号がそれぞれ格納されている。図5においては、データブロック用アドレス管理領域A1611の論理ブロック番号00に対応する物理ブロック番号は00が格納されているため、論理的なメモリ空間において論理ブロック番号00に格納されている論理ブロック00データは、物理的なメモリ空間においては物理ブロック番号00に格納されている。同様に論理ブロック番号01に対応する物理ブロック番号はF1が格納されているため、論理的なメモリ空間において論理ブロック番号01に格納されている論理ブロック01データは、物理的なメモリ空間においては物理ブロック番号F1に格納されている。また、データブロック用アドレス管理領域B1614についても同様に、論理ブロック番号00〜論理ブロック番号DFに対応する物理ブロック番号がそれぞれ格納されている。
【0039】
予備ブロック用アドレス管理領域A1612及び予備ブロック用アドレス管理領域B1615は、それぞれデータブロック用アドレス管理領域A1611及びデータブロック用アドレス管理領域B1614と同様に、論理ブロック番号F0〜論理ブロック番号FFに対応する物理ブロック番号がそれぞれ格納されている。例えば、予備ブロック用アドレス管理領域A1612の論理ブロック番号F0に対応する物理ブロック番号は02が格納されているため、論理的なメモリ空間において論理ブロック番号F0に格納されている予備ブロック0データは、物理的なメモリ空間においては物理ブロック番号02に格納されている。
【0040】
このように本実施形態では、データブロック用アドレス管理領域A1611及び予備ブロック用アドレス管理領域A1612と、データブロック用アドレス管理領域B1614及び予備ブロック用アドレス管理領域B1615とにおいて、それぞれ1バイトの物理ブロック番号が格納されている。
【0041】
また本実施形態においては、論理ブロック番号保持領域A1621は、データブロック領域A1501及びデータブロック領域B1502の総ブロック数が256ブロックを超え、かつ512ブロック以下であることから、2バイトで構成した論理ブロック番号を保持するようにしている。この論理ブロック番号保持領域A1621には、16個の論理ブロック番号を記憶保持することが可能となっている。そして、書き込みまたは読み出しブロックデータ数に応じて、また、書き込みまたは読み出しの順序に合わせて先頭より指定された論理ブロック番号が格納される。このとき論理ブロック番号保持領域B1622には同一データが格納されることになるため、確保しなくてもどちらでもよい。また、それぞれの論理ブロック番号保持領域A1621と論理ブロック番号保持領域B1622には、対応する各データ領域A1603、データ領域B1604を個別に指定できるように256ブロック以下の論理ブロック番号に変換した値を格納するようにしてもよい。なお、論理ブロック番号保持領域A1621及び論理ブロック番号保持領域B1622でそれぞれ記憶保持することが可能なブロック数は16個に限られるものではない。
【0042】
物理ブロック番号保持領域A1623及び物理ブロック番号保持領域B1624では、1バイトの物理ブロック番号をそれぞれ16個記憶保持することが可能となっている。そして、この物理ブロック番号保持領域A1623及び物理ブロック番号保持領域B1624には、書き込みまたは読み出しブロックデータ数に応じて、また、書き込みまたは読み出しの順序に合わせて先頭より指定される論理ブロック番号に対し、アドレス管理領域A1601またはアドレス管理領域B1602により対応付けられる物理ブロック番号が格納される。なお、物理ブロック番号保持領域A1623及び物理ブロック番号保持領域B1624でそれぞれ記憶保持することが可能なブロック数についても16個に限られるものではない。
【0043】
予備ブロック番号保持領域A1625及び予備ブロック番号保持領域B1626では、1バイトの予備ブロック番号をそれぞれ16個記憶保持することが可能となっている。そして、この予備ブロック番号保持領域A1625及び予備ブロック番号保持領域B1626には、書き込みまたは読み出しブロックデータ数に応じて、また、書き込みまたは読み出しの順序に合わせて先頭よりライトコマンドに付加されるブロックデータまたはリードレスポンスに付加されるブロックデータが格納される論理的なメモリ空間における予備ブロック領域A1503または予備ブロック領域B104の論理ブロック番号に対応する物理的なメモリ空間における物理ブロック番号が格納される。なお、予備ブロック番号保持領域A1625及び予備ブロック番号保持領域B1626でそれぞれ記憶保持することが可能なブロック数についても16個に限られるものではない。
【0044】
このように論理ブロック番号、物理ブロック番号、及び予備ブロック番号を保持することによって、データの書き込みや読み出しの処理中に電源途絶などによって処理が中断しても、確実にデータを中断時点または元の状態に復帰させることが可能であり、データの誤りを防止できる。
【0045】
次に、図6に示すフローチャートを参照して、本実施形態のコマンド処理について説明する。
【0046】
ICカード101はリーダライタ102からのコマンド受信を開始すると(ステップS1701)、受信したコマンドがどのコマンドであるかの判定を行い(ステップS1702)、ライトコマンドであった場合にはコマンドの受信を行いながら付加されたブロックデータを予備ブロックに格納する(ステップS1703)。このとき書き込みブロックデータは予備ブロック用アドレス管理領域に示される物理ブロック番号のブロックデータに格納されることになる。なお、ここでは予備ブロック領域A1503と予備ブロック領域B1504のそれぞれに同一データを書き込むようにする。
【0047】
受信したコマンドがライトコマンドでない場合はステップS1703の処理をスキップする。コマンド受信完了後(ステップS1704)、各コマンドに対する処理内容を実行する(ステップS1705)。ここで、受信データの確認を行った結果(ステップS1706)、伝送上の不具合により受信データに誤りがあったり、指定されたパラメータに異常が確認された場合には、エラーレスポンスを送信し(ステップS1707)、コマンド受信待ちに移行したり、エラーレスポンスを送信せずそのままコマンド受信待ちに移行する。
【0048】
各処理を正常に実行することが可能であった場合には、受信コマンドの判定を行う(ステップS1708)。受信コマンドがライトコマンドあるいは、リードコマンドでなかった場合には、レスポンスの送信を開始し(ステップS1711)、レスポンス送信完了後(ステップS1714)、コマンド受信待ちに移行する。受信コマンドがライトコマンドであった場合には、後述するバッファ判定フラグ領域の更新処理を行った後(ステップS1709)、ライトコマンドに対応するアドレス管理領域の更新処理を行う(ステップS1710)。その後、レスポンスの送信を開始し(ステップS1711)、レスポンス送信完了後(ステップS1714)、コマンド受信待ちに移行する。
【0049】
また、受信コマンドがリードコマンドであった場合には、バッファ判定フラグ領域の更新処理を行った後(ステップS1709)、リードコマンドに対応するアドレス管理領域の更新処理を行う(ステップS1711)。その後、レスポンスの送信を開始し(ステップS1711)、更新処理によって書き換えられた予備ブロックよりブロックデータを読み出しながらレスポンスを送信する(ステップS1712、ステップS1713)。そして、レスポンスの送信が完了し(ステップS1714)、アドレス管理領域の復帰処理を行った後に(ステップS1715、ステップS1716)、コマンド受信待ちに移行する。
【0050】
次に、図6のステップS1709に示されるバッファ判定フラグ領域の更新処理について、図7に示すフローチャートを参照して説明する。
【0051】
まずコマンドにて指定された論理ブロック番号を先頭から取り出し(ステップS1801)、そのM(M=1、2…)番目の論理ブロック番号がF0以上であるかどうかの判定処理を行う(ステップS1802)。本実施形態では、複数に分割した個々のデータブロック領域のブロック数をF0としているため、このステップS1802での論理ブロック番号の判定処理によって、指定された書き込みブロックがデータブロック領域A1501に該当するものか、あるいはデータブロック領域B1502に該当するものかどうかを判定することになる。
【0052】
ここで、指定された論理ブロック番号がF0より小さい場合には、対応するM番目のバッファ判定フラグに00を書き込み(ステップS1803)、F0以上であった場合には、対応するM番目のバッファ判定フラグに01を書き込む(ステップS1804)。そして、指定された全ブロックについて終了したかを判断し(ステップS1805)、終了するまでステップS1801〜S1804の処理を繰り返して、バッファ判定フラグへの書き込み処理をコマンドで指定されたブロック数全てに対して実施する。
【0053】
図5にはコマンドにおいて0001、00F2、0000、00F3の順序で書き込みを行う論理ブロックが指定された場合の例を示している。この場合、バッファ判定フラグ領域の更新処理により、バッファ判定フラグ領域1606には00、01、00、01の順序でフラグの値が格納されることになる。
【0054】
次に、図6のステップS1710に示されるアドレス管理領域の更新処理について、図8に示すフローチャートを参照して説明する。まず、ライトコマンド受信時における処理内容として、論理ブロック番号0001、00F2、0000、00F3の順序で指定してデータブロック領域A1501とデータブロック領域B1502に交互に1つずつ合計2つずつのブロックデータの書き込み処理を行う場合の手順を説明する。なお、図5にはライトコマンドを受信して書き込み処理を実行する前の状態のメモリ構成が示されている。
【0055】
アドレス管理領域の更新処理では、まず、ライトコマンド処理かリードコマンド処理かの判定を行う(ステップS1901)。ライトコマンド処理であった場合には、論理ブロック番号の保持処理を行う(ステップS1902)。本実施形態では、指定された論理ブロック番号0001、00F2、0000、00F3の順序で、図5に示す論理ブロック番号保持領域A1621に記録される。なお、論理ブロック番号保持領域B1622において同様に論理ブロック番号を保持してもよい。
【0056】
続いて、バッファ判定フラグ領域1606に保持されたバッファ判定フラグの値に基づき、各ブロック番号の保持処理や更新処理を行う領域をアドレス管理領域A1601とアドレス管理領域B1602のいずれかより選択する(ステップS1903)。その後、対象領域の物理ブロック番号保持領域A1623またはB1624に物理ブロック番号を保持する(ステップS1904)。指定された論理ブロック番号0001、00F2、0000、00F3に対応する物理ブロック番号は、データブロック用アドレス管理領域A1611及びB1614より図5において太線枠で示すF1、F0、00、13となり、これらの物理ブロック番号が順に物理ブロック番号保持領域A1623及びB1624に交互にそれぞれ記録される。
【0057】
さらに、対象領域の予備ブロック番号保持領域A1625またはB1626に予備ブロック番号を保持する(ステップS1905)。図5の例では、処理前の予備ブロック用アドレス管理領域A1612における1ブロック目、3ブロック目の物理ブロック番号は、図中太線枠で示す02、05であり、予備ブロック用アドレス管理領域B1615における2ブロック目、4ブロック目の物理ブロック番号は、図中太線枠で示す11、F3である。よって、これらの物理ブロック番号が予備ブロック番号保持領域A1625及びB1626にそれぞれ格納される。また、ライトブロック数(書き込みブロック数、更新総ブロック数に相当する)(N=4)を不揮発性メモリのパラメータ領域1605に保持する(ステップS1906)。
【0058】
次に、ライト処理カウンタ数(更新済みブロック数に相当する)(M=0)をインクリメント(+1)して値(M=1)を不揮発性メモリのパラメータ領域1605に保持する(ステップS1907)。続いて(M=1)番目のライト処理に対応する物理ブロック番号を更新する(ステップS1908)。本実施形態では、データブロック用アドレス管理領域A1611における1番目の論理ブロック番号01に対応する物理ブロック番号F1に、対応する1番目の予備ブロックの物理ブロック番号02を書き込み更新する。またさらに、(M=1)番目のライト処理に対応する予備ブロック番号を更新する(ステップS1909)。ここでは、予備ブロック用アドレス管理領域A1612における1番目の物理ブロック番号02に、対応する1番目のデータブロックの物理ブロック番号F1を書き込み、データブロック及び予備ブロックのそれぞれの物理ブロック番号を互いに書き換える。
【0059】
その後、ライトブロック数及びライト処理カウンタ数により得られる書き込み処理中情報によってライト処理が完了したかどうかの確認を行い(N=M)(ステップS1910)、完了していない場合にはステップS1907へ戻り、ライト処理カウンタ数をインクリメント(+1)するとともに、継続して対象領域の2ブロック目のデータブロック及び予備ブロックのそれぞれの物理ブロック番号を互いに書き換える(ステップS1907〜ステップS1909)。ライト処理が完了した場合には、ライト処理カウンタ数をクリアし(M=0)(ステップS1911)、アドレス管理領域A1601及びB1602の更新処理を終了する。このときの書き込み処理が完了した状態のメモリ構成を図9に示す。また、アドレス管理領域の更新処理完了後にライトコマンドに対するレスポンスの送信を行う。
【0060】
上記のアドレス管理領域の更新処理がブロックデータの書き込み処理となる。すなわち、複数に分割されたデータ領域中のコマンドで指定された対象領域において、それぞれライトコマンドによって書き込むブロックデータを一旦予備ブロックに格納し、アドレス管理領域においてライトコマンドで指定された論理ブロックと予備ブロックとを入れ替えるようにブロック番号を書き換えることによって、ブロックデータの書き込み処理が完了する。このアドレス管理領域におけるブロック番号の更新処理は、従来の書き込み処理におけるブロックデータの書き込み処理に比べ高速に処理を行うことが可能である。
【0061】
また、本実施形態では、各データ領域において書き込み処理時に指定されたブロックデータが格納される予備ブロック領域の論理ブロック番号がF0〜FFのように固定されることから、常に同じ論理ブロック番号に対して書き込み、読み出しの処理がなされ、かつ受信データの伝送処理と略同時に並行してブロックデータの予備ブロック領域への格納が行われるため、実質的なブロックデータの書き込み処理時間が別途必要なく、書き込み処理の高速化が実現される。
【0062】
また、書き込み処理途中時に電源途絶が発生した場合、書き込み処理が未完了であるので不揮発性メモリのパラメータ領域1605に格納されているライト処理カウンタ数(M)がクリアされていない状態(≠0)となる。このため、電源復帰時にライト処理カウンタ数(M)の値を確認することにより、書き込み処理時の電源途絶が発生したかどうかを確認することが可能となる。
【0063】
このように書き込み処理が未完了の場合は、処理再開時に、パラメータ領域1605に格納されているライトブロック数及びライト処理カウンタ数と、ブロック番号保持領域A1613、B1616に保持されているブロック番号と、バッファ判定フラグ領域1606のフラグの値とに基づいて、未処理のブロック番号の更新処理などを行って書き込み処理を完了させる。
【0064】
次に、リードコマンド受信時における処理内容として、論理ブロック番号0001、00F2、0000、00F3の順序で指定してデータブロック領域A1501とデータブロック領域B1502に交互に1つずつ合計2つずつのブロックデータの読み出し処理を行う場合の手順を説明する。
【0065】
図8のステップS1901でのコマンド判定処理において、リードコマンド処理であった場合には、前述のライトコマンド処理の場合と同様に、バッファ判定フラグ領域1606に保持されたバッファ判定フラグの値に基づき、各ブロック番号の保持処理や更新処理を行う領域をアドレス管理領域A1601とアドレス管理領域B1602のいずれかより選択する(ステップS1912)。
【0066】
その後、対象領域の予備ブロック番号保持領域A1625またはB1626に予備ブロック番号を保持する(ステップS1913)。図5の例では、処理前の予備ブロック用アドレス管理領域A1612における1ブロック目、3ブロック目の物理ブロック番号は、図中太線枠で示す02、05であり、予備ブロック用アドレス管理領域B1615における2ブロック目、4ブロック目の物理ブロック番号は、図中太線枠で示す11、F3である。よって、これらの物理ブロック番号が予備ブロック番号保持領域A1625及びB1626にそれぞれ格納される。また、リードブロック数(読み出しブロック数、復元総ブロック数に相当する)(N=4)を不揮発性メモリのパラメータ領域1605に保持する(ステップS1914)。
【0067】
次に、リード処理カウンタ数(復元済みブロック数に相当する)(M=0)をインクリメント(+1)して値(M=1)を不揮発性メモリのパラメータ領域1605に保持する(ステップS1915)。続いて(M=1)番目のリード処理に対応する予備ブロック番号を更新する(ステップS1916)。ここでは、予備ブロック用アドレス管理領域A1612における1番目の物理ブロック番号02に、対応する1番目のデータブロックの物理ブロック番号F1を書き込み更新する。
【0068】
その後、リードブロック数及びリード処理カウンタ数により得られる読み出し処理中情報によってリード処理が完了したかどうかの確認を行い(N=M)(ステップS1917)、完了していない場合にはステップS1915へ戻り、リード処理カウンタ数をインクリメント(+1)するとともに、継続して対象領域の2ブロック目の予備ブロックの物理ブロック番号を書き換える(ステップS1915、S1916)。リード処理が完了した場合には、アドレス管理領域A1601及びB1602の更新処理を終了する。
【0069】
なお、ライト処理カウンタ数(M)とリード処理カウンタ数(M)、ライトブロック数(N)とリードブロック数(N)は、それぞれ兼用してもよいし、別個に設けてもよい。
【0070】
そして、アドレス管理領域の更新処理完了後にリードコマンドに対するレスポンスの送信を行う。リードコマンドのレスポンスに付加される読み出しブロックデータは、予備ブロック用アドレス管理領域A1612またはB1615にて指定される物理ブロック番号のブロックデータであり、リードブロック数分だけ予備ブロック0データから順に読み出されながら送信される。そして、レスポンスの送信後、アドレス管理領域の復帰処理を行う。これにより、予備ブロック用アドレス管理領域A1612及びB1615における各物理ブロック番号をリードコマンドを受信する前の状態に戻すようにする。
【0071】
上記のアドレス管理領域の更新処理及び復帰処理がブロックデータの読み出し処理となる。すなわち、複数に分割されたデータ領域中のコマンドで指定された対象領域において、それぞれアドレス管理領域においてリードコマンドで指定された論理ブロックと予備ブロックとを入れ替えるようにブロック番号を書き換えて予備ブロックよりブロックデータを読み出し、その後この予備ブロックと論理ブロックのブロック番号を互いに書き換えて元の状態に戻すことによって、ブロックデータの読み出し処理が完了する。このアドレス管理領域におけるブロック番号の更新処理及び復帰処理は、従来の読み出し処理におけるブロックデータの読み出し処理に比べ高速に処理を行うことが可能である。
【0072】
また、本実施形態では、各データ領域において読み出し処理時に指定されたブロックデータが格納される予備ブロック領域の論理ブロック番号がF0〜FFのように固定されることから、常に同じ論理ブロック番号に対して読み出しの処理がなされ、かつ送信データの伝送処理と略同時に並行してブロックデータの予備ブロック領域からの読み出し処理が行われるため、実質的なブロックデータの読み出し処理時間が別途必要なく、読み出し処理の高速化が実現される。
【0073】
また、読み出し処理途中時に電源途絶が発生した場合、読み出し処理が未完了であるので不揮発性メモリのパラメータ領域1605に格納されているリード処理カウンタ数(M)がクリアされていない状態(≠0)となる。このため、電源復帰時にリード処理カウンタ数(M)の値を確認することにより、読み出し処理時の電源途絶が発生したかどうかを確認することが可能となる。
【0074】
このように読み出し処理が未完了の場合は、処理再開時に、パラメータ領域1605に格納されているリードブロック数及びリード処理カウンタ数と、ブロック番号保持領域A1613、B1616に保持されているブロック番号と、バッファ判定フラグ領域1606のフラグの値とに基づいて、未処理のブロック番号の更新処理などを行って読み出し処理を完了させる。
【0075】
上述したように、本実施形態では複数に分割されたデータ領域において、アドレス管理領域の更新処理時の各ブロック番号の保持処理や更新処理については、バッファ判定フラグの値を読み出し、バッファ判定フラグの値が00であった場合にはアドレス管理領域A1601のみ処理行い、バッファ判定フラグの値が01であった場合にはアドレス管理領域B1602のみ処理を行うことにする。
【0076】
ここで、アドレス管理領域A1505の論理ブロック番号は、リーダライタ102から見た論理的なメモリ空間における論理ブロック番号と一致することになる。一方、アドレス管理領域B1506の論理ブロック番号は、リーダライタ102から見た論理的なメモリ空間における論理ブロック番号からF0を減算した値として管理制御される。例えば、ライトコマンドで2ブロック目の指定として00F2が指定された場合、論理ブロック番号とF0との判定処理の結果、アドレス管理領域B1602に対する処理であると判断されて制御が行われ、この対象領域内の論理ブロック番号として、00F2−00F0=0002の演算結果が得られる。したがってこの場合、アドレス管理領域B1602における論理ブロック02への書き込みとして処理されることになる。
【0077】
なお、上記処理手順の説明では、ライトコマンド受信時の予備ブロックへのブロックデータ格納処理を、予備ブロック領域A1503と予備ブロック領域B1504のそれぞれに同一データを書き込むこととしていたが、これに限るものではない。例えば、上記のバッファ判定フラグ領域の更新処理において行われる対象領域判定処理によって、コマンドに付加された論理ブロック番号に基づいて指定された書き込みブロックがデータブロック領域Aに該当するものか、あるいはデータブロック領域Bに該当するものかどうかの判定を行い、該当する予備ブロック領域のみに書き込むことにしてもよい。
【0078】
以上の処理により、本実施形態においてはメモリ空間においてデータブロック領域の論理ブロック番号が1DFまで定義された場合など、ブロック単位でデータを管理する際にブロックの総数が256ブロックを超えるような場合であっても、アドレス管理領域などのメモリ容量の大幅な増加を伴うことなく、書き込みや読み出しに関する処理を効率よく行うことが可能となる。すなわち、本実施形態によれば、大容量のデータ領域を有する不揮発性メモリに対しても、システム制御用のメモリ容量を大量に要することなく、ブロックデータの読み出し処理及び書き込み処理中に電源途絶が発生した場合におけるデータの保証を行うことが可能であり、さらに効率良くかつ高速に処理を実行することができる。
【0079】
【発明の効果】
以上説明したように本発明によれば、ICカードにおいて大容量のデータブロック領域を取り扱う場合においても、電源途絶時のデータ保証を確保しながら、効率良くかつ高速に処理を実行することが可能となる。
【図面の簡単な説明】
【図1】本発明の一実施形態によるICカードシステムのブロック構成図。
【図2】本実施形態による論理的なメモリ空間におけるメモリ構成図。
【図3】本実施形態による分割された論理的なメモリ空間におけるメモリ構成図。
【図4】本実施形態による物理的なメモリ空間におけるメモリ構成図。
【図5】本実施形態による物理的なメモリ空間におけるアドレス管理領域の構成図。
【図6】本実施形態によるデータ処理の流れを示すフローチャート図。
【図7】本実施形態によるバッファ判定フラグ領域の更新処理の流れを示すフローチャート図。
【図8】本実施形態によるアドレス管理領域の更新処理の流れを示すフローチャート図。
【図9】本実施形態による書き込み処理後の物理的なメモリ空間におけるアドレス管理領域の構成図。
【符号の説明】
101 ICカード
102 リーダライタ
103,104 アンテナ
105 復調部
106 制御部
107 ROM
108 RAM
109 不揮発性メモリ
110 変調部
1401 データブロック領域
1402 予備ブロック領域
1403 アドレス管理領域
1404 パラメータ領域
1405 バッファ判定フラグ領域
1501 データブロック領域A
1502 データブロック領域B
1503 予備ブロック領域A
1504 予備ブロック領域B
1505 アドレス管理領域A
1506 アドレス管理領域B
1507 パラメータ領域
1508 バッファ判定フラグ領域
1601 アドレス管理領域A
1602 アドレス管理領域B
1603 データ領域A
1604 データ領域B
1605 パラメータ領域
1606 バッファ判定フラグ領域
1607 誤り検査情報
1611 データブロック用アドレス管理領域A
1612 予備ブロック用アドレス管理領域A
1613 ブロック番号保持領域A
1614 データブロック用アドレス管理領域B
1615 予備ブロック用アドレス管理領域B
1616 ブロック番号保持領域B
1621 論理ブロック番号保持領域A
1622 論理ブロック番号保持領域B
1623 物理ブロック番号保持領域A
1624 物理ブロック番号保持領域B
1625 予備ブロック番号保持領域A
1626 予備ブロック番号保持領域B
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an IC card used for, for example, electronic money and an ID card and an information processing method thereof, and more particularly to a technology for processing information stored in a non-volatile memory mounted on the IC card.
[0002]
[Prior art]
2. Description of the Related Art An IC card system that reads and writes data between an IC card that owns a memory for storing information and a reader / writer is used as an electronic wallet in a leisure facility use ticket or a financial institution. There are two types of IC cards: a contact type IC card having a contact point for contacting a reader / writer and exchanging signals, and a non-contact type IC card that performs communication using radio waves.
[0003]
The contact IC card has contacts for interface with signals such as power, ground, clock, data, and reset, and is supplied with stable power from the reader / writer. On the other hand, the non-contact type IC card incorporates an antenna coil and a capacitor for receiving a carrier from a reader / writer, and a power source rectifies the carrier from the reader / writer and uses it as a power source.
[0004]
In the contact IC card described above, the IC card is inserted and removed from the device in the middle of data writing, or the power required for the operation away from the communication area in the same way during the data writing in the non-contact IC card. If the data cannot be obtained, the data in the memory mounted on the IC card will be destroyed. The data in the memory is configured in units of a block having a predetermined data length, for example, 16 bytes, and it may be possible to simultaneously read / write these block data by one command processing. In some cases, it is necessary to guarantee data.
[0005]
To solve this problem, as a first solution, for example, when writing block data, for the block data designated for writing, the old block data that was valid before performing the writing process is stored in the nonvolatile memory. There is a data protection method based on old data backup in which data is temporarily stored in another area and then data is written. As shown in FIG. 12, when simultaneously writing a plurality of block data into a data block area composed of a plurality of block data, first, block data of a designated block number is reserved block data in the spare block area. Then, the block data of the designated block number is written in the data block area. As a result, even if the power supply is interrupted while data is being written, the block data before the write process is held in the spare block area, so that the data can be returned to the original state, and data guarantee is possible. Become.
[0006]
Also, as a second solution, there is a data protection method by holding validity information that secures two or more memory areas and also has validity information indicating which memory area is valid. To do. As shown in FIG. 13, two memory areas, a data block area A and a data block area B, are secured, and data validity determination information indicating which data is valid in the block data of each block number. I will keep it. When writing block data, check data validity judgment information, write new block data to invalid block data in the memory area, and then rewrite and update each valid / invalid information to write data. I do. Even in this case, when the power supply is interrupted, the block data that was valid before the writing process is retained, so the validity judgment information is set to the state before the writing process, so that the data is restored to the original state. It becomes possible to return to.
[0007]
[Problems to be solved by the invention]
The block data management method described above enables efficient memory management with a small storage area without requiring a large amount of data held in the nonvolatile memory.
[0008]
However, in the address management method for associating logical addresses with physical addresses, if the total number of data block areas and spare block areas is within 256 blocks, the block number in the address management area can be managed with 1 byte. However, when the number of blocks exceeding 256 blocks is handled, it is necessary to manage the block number in the address management area with a plurality of bytes such as 2 bytes and 3 bytes. For this reason, the memory capacity in the address management area is required to be twice or three times, which increases the chip size.
[0009]
The present invention provides an IC card capable of executing processing efficiently and at high speed while ensuring data guarantee at the time of power interruption even when handling such a large-capacity data block area and its information processing It aims to provide a method.
[0010]
[Means for Solving the Problems]
The present invention first stores data to be stored and held. 2 Store more than one storage data area and target data during writing process 2 One or more buffer areas and the storage data area Address information associating a logical address with a physical address and address information associating a logical address and a physical address with respect to the buffer area are respectively stored in predetermined physical addresses 2 A memory having at least two address management areas, and write data sent in correspondence with a command at the time of a write process to the memory is stored in the buffer area, and an address corresponding to the buffer area in the address management area Information and address information corresponding to the storage data area specified by the command. Each other There is provided an IC card comprising memory control means for rewriting and updating an address management area.
[0011]
Second, the memory includes an address holding area for holding target address information at the time of update processing in the address management area, and 2 A buffer determination flag area for storing validity information of a buffer area indicating which one of two or more buffer areas is valid, and a parameter area for storing in-writing information indicating that the writing process is in progress The memory control means based on the logical address specified by the command at the time of the write process. 2 A storage data area and a buffer area to be written are selected from two or more storage data areas and a buffer area, validity information for specifying the target area is stored in the buffer determination flag area, and the command in the address management area is used. The physical address corresponding to the logical address of the designated storage data area and the physical address corresponding to the buffer area are temporarily held in the address holding area, the in-write processing information is set in the parameter area, and the buffer Based on the validity information of the determination flag area, after performing an update process that rewrites the physical address corresponding to the storage data area and the physical address corresponding to the buffer area in the address management area of the valid target area, To restore the information during the writing process to its original state. And butterflies.
[0012]
Third, the memory control means determines whether or not the writing process is completed based on the information during the writing process, and stores the data in the parameter area when the process is resumed when the writing process is not completed normally. Based on the updated total block number and updated block number of the physical address, the address information held in the address holding area, and the validity information of the buffer determination flag area, the unprocessed physical address The update process is completed.
[0013]
Fourth, the present invention stores data to be stored and held 2 One or more storage data areas and target data during read processing 2 is stored One or more buffer areas and the storage data area Address information associating a logical address with a physical address and address information associating a logical address and a physical address with respect to the buffer area are respectively stored in predetermined physical addresses 2 A memory having at least two address management areas, and address information corresponding to the storage data area specified by a command in the address management area at the time of read processing from the memory Because Address corresponding to the buffer area information There is provided an IC card comprising memory control means for rewriting and updating an address management area, reading read data stored in the updated buffer area, and then returning the address management area to its original state. .
[0014]
Fifth, the memory includes an address holding area for holding target address information at the time of update processing in the address management area, and 2 A buffer determination flag area for storing validity information of the buffer area indicating which one of the two or more buffer areas is valid, and a parameter area for storing information during reading processing indicating that the reading processing is in progress And the memory control means at the time of the read process based on the logical address specified by the command. 2 A storage data area and a buffer area to be read are selected from two or more storage data areas and buffer areas, validity information designating the target area is stored in the buffer determination flag area, and the buffer area in the address management area Is temporarily held in the address holding area, the information being read is set in the parameter area, and the address management area of the effective target area is set based on the validity information of the buffer determination flag area After updating the physical address corresponding to the logical address of the storage data area specified by the command in the above to the physical address corresponding to the buffer area, after reading the read data stored in the buffer area after the update A thing corresponding to the held buffer area After the restoration process to restore the address, and returning the read processing in the information to the original state.
[0015]
Sixth, the memory control means determines whether or not the reading process is completed based on the information during the reading process, and if the reading process is not completed normally, stores it in the parameter area when the process is resumed. Based on the total number of restored blocks of the physical address and the number of restored blocks, the address information held in the address holding area, and the validity information of the buffer determination flag area, the unprocessed physical address The restoration process is completed.
[0016]
Seventh, the present invention Address information that associates two or more storage data areas for storing data to be stored, two or more buffer areas for storing target data at the time of write processing, and a logical address and a physical address related to the storage data area And two or more address management areas each storing address information associating a logical address and a physical address related to the buffer area at a predetermined physical address. When writing data to the memory in the IC card, The control unit in the IC card Storing write data sent in response to a command in a buffer area of the memory; The control unit is Based on the logical address specified in the command, 2 Selecting a storage data area and a buffer area to be written from two or more storage data areas and a buffer area, and storing validity information specifying the target area in a buffer determination flag area; and The control unit is Temporarily holding a physical address corresponding to a logical address of a storage data area designated by the command and a physical address corresponding to the buffer area in an address holding area in an address management area for storing address information of the memory; , The control unit is A step of setting in-writing information indicating that the writing process is in progress; The control unit is Based on the validity information of the buffer determination flag area, the physical address corresponding to the storage data area and the physical address corresponding to the buffer area in the address management area of the valid target area are rewritten to each other to rewrite the address management area. Performing the update process; The control unit is An information processing method for an IC card, comprising: returning the in-write information to the original state after the update process.
[0017]
The present invention eighthly, Two or more storage data areas for storing data to be stored and held, two or more buffer areas for storing target data at the time of read processing, and a logical address and a physical address for the storage data area are associated with each other. Address information and two or more address management areas each storing address information for associating a logical address and a physical address related to the buffer area at a predetermined physical address When reading data from the memory in the IC card, The control unit in the IC card Based on the logical address specified in the command 2 Selecting a storage data area and a buffer area to be read from two or more storage data areas and a buffer area, and storing validity information specifying the target area in a buffer determination flag area; The control unit is Temporarily holding a physical address corresponding to the buffer area in the address holding area in an address management area for storing address information of the memory; The control unit is A step of setting reading process in-process information indicating that the reading process is in progress; The control unit is Based on the validity information of the buffer determination flag area, the physical address corresponding to the logical address of the storage data area specified by the command in the address management area of the valid target area is rewritten to the physical address corresponding to the buffer area. Performing update processing of the address management area, The control unit is Performing a restoration process of restoring the physical address corresponding to the held buffer area after reading the read data stored in the updated buffer area; The control unit is An information processing method for an IC card, comprising: returning the in-reading information to an original state after the restoration processing.
[0018]
In the present invention, at the time of writing processing to the memory, write data sent corresponding to the command is stored in the buffer area, and the address information corresponding to the buffer area in the address management area and the storage data area designated by the command are stored. The address management area is updated by rewriting the corresponding address information. At this time, the specified storage data area and buffer area to be written are selected from one or more storage data areas and buffer areas, and the validity information indicating the target area is stored in the buffer determination flag area. Based on the validity information of the determination flag area, the address management area of the valid target area is updated. This eliminates the need to store the write data itself in the buffer area and then transfer it to the storage data area. The write process can be completed simply by updating the address information after storing the write data in the buffer area. Therefore, the write data added to the command packet can be stored in the buffer area substantially simultaneously with the data transmission process, and the process can be executed efficiently and at high speed. In addition, even when the power is interrupted, the writing process can be restored and completed from the state before the process interruption after the power is restored, so that an error or loss of data can be prevented and data guarantee can always be ensured. Furthermore, it is possible to prevent the memory capacity for system control such as the address management area used for the writing process from greatly increasing even for a memory having a large data area.
[0019]
Also, during the process of reading data to the memory, the address management area is updated by rewriting the address information corresponding to the storage data area specified by the command in the address management area and the address information corresponding to the buffer area. After reading the read data stored in the buffer area, the address management area is restored to the original state. At this time, the storage data area and the buffer area to be read specified from the one or more storage data areas and the buffer area are selected, and the validity information indicating the target area is stored in the buffer determination flag area. Based on the validity information of the determination flag area, the address management area of the valid target area is updated. This eliminates the need to copy and read the read data itself from the storage data area to the buffer area, and by updating the address information and reading the read data from the updated buffer area, the address information can be restored. Since the read process is completed, the read data stored in the buffer area can be read and added to the response packet almost simultaneously with the data transmission process, and the process can be executed efficiently and at high speed. . Further, even when the power is interrupted, after the power is restored, the reading process can be restored and completed from the state before the interruption of processing, so that an error or loss of data can be prevented and data guarantee can always be ensured. Further, even for a memory having a large capacity data area, it is possible to prevent the memory capacity for system control such as an address management area used for the reading process from being greatly increased.
[0020]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a non-contact type IC card system to which an information processing method according to an embodiment of the present invention is applied. Data transmission / reception between the IC card 101 and the reader / writer 102 that reads / writes data from / to the IC card 101 is performed by an electromagnetic induction method using antennas 103 and 104, respectively. The reader / writer 102 creates transmission data to the IC card 101 internally and transmits the data to the IC card 101 through the antenna 104 as a modulation signal. The IC card 101 existing in the communication area receives data modulated by the antenna 103. The received data is demodulated by the demodulator 105 and sent to the controller 106.
[0021]
The control unit 106 is configured by a processor such as a CPU, for example, analyzes received data according to a control program stored in the control memory ROM 107, and receives received data from a memory such as an EEPROM (Electrically Erasable Programmable ROM) or FeRAM (Ferroelectronic RAM). Processing such as storage in the non-volatile memory 109 is performed. The reception data is stored directly in the nonvolatile memory 109 when a memory having a high writing speed such as FeRAM is used as the nonvolatile memory 109. Further, the received data may be temporarily written in a transmission / reception buffer in the RAM 108.
[0022]
Thereafter, the received data is read and written in the non-volatile memory 109 to generate transmission data for response. This transmission data is modulated by the modulation unit 110 via the control unit 106, and this modulated signal is transmitted from the antenna 103 to the reader / writer 102.
[0023]
The non-volatile memory 109 of the IC card 101 shown in FIG. 1 has a file configuration as shown in FIG. 2 in a logical memory space viewed from the reader / writer 102. That is, a data block area 1401 (corresponding to a storage data area) in which data required by the user is stored, and a spare block area in which data specified when data is read / written from the reader / writer 102 to the IC card 101 are stored. 1402 (corresponding to a buffer area) and an address management area 1403 in which address information for associating a logical memory space with a physical memory space in the nonvolatile memory 109 of the IC card 101 is stored. Further, the nonvolatile memory 109 stores a parameter area 1404 for storing various parameters including information in writing process and information in reading process used for data update, and address management to be updated in the update process of the address management area 1403. A buffer determination flag area 1405 for storing a flag indicating validity information for designating an area is provided.
[0024]
In the present embodiment, in the case of managing data in units of blocks with respect to the nonvolatile memory 109 of the IC card 101, an example of a logical configuration in a large-capacity memory in which the total number of blocks exceeds 256 blocks and an information processing method thereof It is shown. In this example, the total number of data block areas 1401 and spare block areas 1402 exceeds 256 blocks. In this embodiment, the number of blocks in the data block area 1401 is 480 blocks, and the number of blocks in the spare block area 1402 is 32 blocks. However, the number of blocks is not limited thereto.
[0025]
Each of the data block area 1401 and the spare block area 1402 is configured to store a plurality of block data each having a predetermined data length, for example, a block unit of 16 bytes, based on the logical block number. In the example of FIG. 2, the data block area 1401 stores logical block data of 480 indicated by logical block numbers 00, 01, 02,..., 1DF, and the spare block area 1402 has logical block number 1E0. 32 spare block data indicated by 1E1,..., 1FF are stored. In the description of the present embodiment, values indicating the addresses of blocks on the memory such as logical block numbers and physical block numbers, values of data stored in each area, and values such as flags are expressed in hexadecimal numbers. To do.
[0026]
In the block configuration as shown in FIG. 2, since the total number of blocks in the data block area 1401 and the spare block area 1402 exceeds 256, the management block number in the address management area 1403 can be managed with 1 byte as it is. Can not. Therefore, in this embodiment, since the total number of blocks in the data block area and the number of blocks in the spare block area is 256 × 2 or less, as shown in FIG. Divide into two areas. That is, two data block areas A1501 and B1502, two spare block areas A1503 and B1504, and address information that associates the logical memory space and the physical memory space of each area are stored. The address management area A1505 and address management area B1506, a parameter area 1507, and a buffer determination flag area 1508 are included. In FIG. 3, the area is divided into two areas, but it may be divided into three or more areas, or may be divided into an appropriate number of areas according to the total number of data block areas and spare block areas.
[0027]
In the case of the block configuration of FIG. 3, each block data is managed by an area-specific logical block number defined for each of a plurality of divided areas, instead of the logical block number shown in FIG. That is, the data block area A1501 and the data block area B1502 store 240 logical block data indicated by area-specific logical block numbers 00, 01, 02,... EF in the respective areas, and the spare block area A1503. The spare block area B1504 stores 16 spare block data indicated by logical block numbers F0, F1,..., FF in each area.
[0028]
The reader / writer 102 can read / write data from / to the data block area A 1501 and the data block area B 1502 in the nonvolatile memory 109 mounted on the IC card 101. In this case, the address management area to be updated is selected by the flag of the buffer determination flag area 1508, and the logical block number for each area of the logical block data to be read / written in the corresponding data block area A1501 or data block area B1502 is set. Data is read and written by specifying. It is also possible to specify a plurality of logical block numbers with a single command. For example, by designating logical block numbers 00 and 01 for each area, data can be simultaneously read from and written to a plurality of logical block data. It can be carried out.
[0029]
In the present embodiment, in the data write process, the write designation block data added to the write command is reserved from the spare block 0 data in the spare block area A 1503 or spare block area B 1504 substantially simultaneously with the received data transmission process. Block F data is stored in order. That is, when two block data are simultaneously written, the first designated block data added to the write command is spare block 0 data, and the second designated block data is spare block 1 data. Will be stored.
[0030]
Furthermore, in the data reading process, block data of the logical block number for each area specified by the read command is sequentially transmitted from the spare block 0 data to the spare block F data in the spare block area A 1503 or spare block area B 1504 during the transmission process. Stored. Then, the control unit 106 performs transmission data transmission processing by adding block data to the read response while reading the block data in order from the spare block 0 data when returning the read response.
[0031]
At this time, the nonvolatile memory 109 has a file configuration as shown in FIG. 4 in a physical memory space that is an actual memory configuration. The physical memory space includes an address management area A1601 and an address management area B1602, and a data area A1603 and a data area B1604. The address management area A1601 is a data block address management area A1611 for managing the block number of the logical block data, a spare block address management area A1612 for managing the block number of the spare block data, and data guarantee at the time of power interruption. A block number holding area A1613 in which block numbers are recorded when block data writing processing and reading processing are performed is configured. Similarly, the address management area B1602 includes a data block address management area B1614, a spare block address management area B1615, and a block number holding area B1616.
[0032]
The nonvolatile memory 109 also stores a parameter area 1605 for storing various parameters including information in writing process and information in reading process used for data update, and update processing of each address management area A1601 and address management area B1602. Are provided with a buffer determination flag area 1606 for storing a flag for designating an address management area to be updated.
[0033]
In the present embodiment, the data area is divided into a plurality of parts, and the number of blocks in each of the data area A 1603 and the data area B 1604 is 256 blocks or less, so that each corresponding address management area A 1601 and address management area B 1602 has 1 byte. Can be managed with block numbers.
[0034]
The data block area A1501 and the spare block area A1503 in the logical memory space shown in FIG. 3 are associated with each block number in the address management area A1601 in the physical memory space shown in FIG. Are mixedly stored in the data area A1603. Similarly, the data block area B1502 and the spare block area B1504 in the logical memory space shown in FIG. 3 are associated with each block number in the address management area B1602 in the physical memory space shown in FIG. Both are stored in the data area B 1604 in a mixed manner.
[0035]
Also, the logical block data in the data block area A1501 in the logical memory space shown in FIG. 3 is the blocks in the data block address management area A1611 in the address management area A1601 in the physical memory space shown in FIG. They are recorded in the data area A1603 in association with each other. Further, the spare block data in the spare block area A1503 in the logical memory space shown in FIG. 3 are the blocks in the spare block address management area A1612 in the address management area A1601 in the physical memory space shown in FIG. They are recorded in the data area A1603 in association with each other. On the other hand, the logical block data in the data block area B1502 in the logical memory space shown in FIG. 3 is the block in the data block address management area B1614 in the address management area B1602 in the physical memory space shown in FIG. They are recorded in the data area B 1604 in association with each other. Further, the spare block data in the spare block area B1504 in the logical memory space shown in FIG. 3 is the blocks in the spare block address management area B1615 in the address management area B1602 in the physical memory space shown in FIG. They are recorded in the data area B 1604 in association with each other.
[0036]
Further, a block number holding area A1613 in the address management area A1601 includes a logical block number holding area A1621 that holds a logical block number specified by a command at the time of block data writing processing and reading processing, and a specified logical block number. Holds a physical block number holding area A 1623 for holding a physical block number corresponding to, and a spare block number for storing write data added to a command packet during write processing and read data added to a response packet during read processing And a spare block number holding area A1625. Similarly, the block number holding area B1616 in the address management area B1602 includes a logical block number holding area B1622, a physical block number holding area B1624, and a spare block number holding area B1626. In addition, in order to determine and confirm whether the block data values in the nonvolatile memory 109 are valid without error, error check information (parity data) 1607 is stored in each block data for each block. Is done.
[0037]
Next, the configuration and control contents of each address management area A1601, address management area B1602, and buffer determination flag area 1606 will be described with reference to FIG.
[0038]
In the data block address management area A1611, physical block numbers corresponding to the logical block number 00, the logical block number 01,..., And the logical block number DF are stored in order from the top. In FIG. 5, since 00 is stored as the physical block number corresponding to the logical block number 00 of the data block address management area A1611, the logical block 00 stored in the logical block number 00 in the logical memory space. Data is stored in physical block number 00 in the physical memory space. Similarly, since F1 is stored in the physical block number corresponding to the logical block number 01, the logical block 01 data stored in the logical block number 01 in the logical memory space is physically stored in the physical memory space. Stored in block number F1. Similarly, in the data block address management area B1614, physical block numbers corresponding to the logical block numbers 00 to DF are stored.
[0039]
The spare block address management area A 1612 and the spare block address management area B 1615 are similar to the data block address management area A 1611 and the data block address management area B 1614, respectively, and correspond to the logical block numbers F0 to FF. Each block number is stored. For example, since the physical block number corresponding to the logical block number F0 in the spare block address management area A1612 is 02, the spare block 0 data stored in the logical block number F0 in the logical memory space is In the physical memory space, the physical block number 02 is stored.
[0040]
As described above, in the present embodiment, the data block address management area A 1611 and the spare block address management area A 1612, the data block address management area B 1614 and the spare block address management area B 1615 are each 1-byte physical block numbers. Is stored.
[0041]
In this embodiment, since the total number of blocks in the data block area A1501 and the data block area B1502 exceeds 256 blocks and is 512 blocks or less, the logical block number holding area A1621 is a logical block composed of 2 bytes. Keep the number. In this logical block number holding area A1621, 16 logical block numbers can be stored and held. Then, the logical block number designated from the head is stored in accordance with the number of writing or reading block data and in accordance with the order of writing or reading. At this time, since the same data is stored in the logical block number holding area B1622, it does not have to be secured. Each logical block number holding area A 1621 and logical block number holding area B 1622 store values converted into logical block numbers of 256 blocks or less so that each corresponding data area A 1603 and data area B 1604 can be individually specified. You may make it do. The number of blocks that can be stored and held in each of the logical block number holding area A 1621 and the logical block number holding area B 1622 is not limited to 16.
[0042]
The physical block number holding area A 1623 and the physical block number holding area B 1624 can store and hold 16 1-byte physical block numbers. In the physical block number holding area A 1623 and the physical block number holding area B 1624, the logical block number specified from the top in accordance with the number of writing or reading block data and in accordance with the order of writing or reading, The physical block number associated with the address management area A1601 or the address management area B1602 is stored. The number of blocks that can be stored and held in the physical block number holding area A 1623 and the physical block number holding area B 1624 is not limited to 16.
[0043]
In the spare block number holding area A 1625 and the spare block number holding area B 1626, it is possible to store and hold 16 1-byte spare block numbers. In the spare block number holding area A 1625 and the spare block number holding area B 1626, block data added to the write command from the head in accordance with the number of writing or reading block data and in accordance with the order of writing or reading or The physical block number in the physical memory space corresponding to the logical block number of the spare block area A1503 or the spare block area B104 in the logical memory space in which the block data added to the read response is stored is stored. The number of blocks that can be stored and held in the spare block number holding area A 1625 and the spare block number holding area B 1626 is not limited to 16.
[0044]
By holding the logical block number, physical block number, and spare block number in this way, even if processing is interrupted due to power interruption during data writing or reading processing, the data is reliably transferred at the time of interruption or the original It is possible to return to the state, and data errors can be prevented.
[0045]
Next, command processing of this embodiment will be described with reference to the flowchart shown in FIG.
[0046]
When the IC card 101 starts receiving a command from the reader / writer 102 (step S1701), the IC card 101 determines which command is the received command (step S1702), and if it is a write command, receives the command. The added block data is stored in the spare block (step S1703). At this time, the write block data is stored in the block data of the physical block number indicated in the spare block address management area. Here, the same data is written in each of the spare block area A1503 and the spare block area B1504.
[0047]
If the received command is not a write command, step S1703 is skipped. After completion of command reception (step S1704), processing contents for each command are executed (step S1705). Here, as a result of confirming the received data (step S1706), if there is an error in the received data due to a malfunction in transmission or an abnormality is confirmed in the specified parameter, an error response is transmitted (step S1706). In step S1707, the process shifts to a command reception wait, or shifts to a command reception wait without transmitting an error response.
[0048]
If each process can be executed normally, the received command is determined (step S1708). If the received command is not a write command or a read command, response transmission is started (step S1711), and after the response transmission is completed (step S1714), the process shifts to command reception waiting. If the received command is a write command, a buffer determination flag area update process described later is performed (step S1709), and then an address management area update process corresponding to the write command is performed (step S1710). Thereafter, transmission of a response is started (step S1711), and after completion of response transmission (step S1714), the process proceeds to command reception waiting.
[0049]
If the received command is a read command, after updating the buffer determination flag area (step S1709), the address management area corresponding to the read command is updated (step S1711). Thereafter, transmission of a response is started (step S1711), and the response is transmitted while reading block data from the spare block rewritten by the update process (step S1712, step S1713). Then, transmission of the response is completed (step S1714), and after address management area restoration processing is performed (steps S1715 and S1716), the process shifts to a command reception wait state.
[0050]
Next, the buffer determination flag area update process shown in step S1709 of FIG. 6 will be described with reference to the flowchart shown in FIG.
[0051]
First, the logical block number designated by the command is extracted from the head (step S1801), and a determination process is performed to determine whether the M (M = 1, 2,...) Logical block number is F0 or more (step S1802). . In the present embodiment, since the number of blocks in each of the divided data block areas is F0, the specified write block corresponds to the data block area A1501 by the logical block number determination process in step S1802. Or whether it corresponds to the data block area B1502.
[0052]
If the designated logical block number is smaller than F0, 00 is written in the corresponding Mth buffer determination flag (step S1803), and if it is equal to or greater than F0, the corresponding Mth buffer determination. 01 is written in the flag (step S1804). Then, it is determined whether or not all the designated blocks have been completed (step S1805), and the processes of steps S1801 to S1804 are repeated until the process is completed, and the writing process to the buffer determination flag is performed for all the blocks designated by the command. To implement.
[0053]
FIG. 5 shows an example where a logical block to be written in the order of 0001, 00F2, 0000, and 00F3 is specified in the command. In this case, the flag value is stored in the buffer determination flag area 1606 in the order of 00, 01, 00, 01 by the update process of the buffer determination flag area.
[0054]
Next, the address management area update processing shown in step S1710 of FIG. 6 will be described with reference to the flowchart shown in FIG. First, as processing contents at the time of receiving a write command, logical block numbers 0001, 00F2, 0000, 00F3 are designated in the order of the block data of a total of two blocks one by one alternately in the data block area A1501 and the data block area B1502. A procedure for performing the writing process will be described. FIG. 5 shows a memory configuration in a state before receiving a write command and executing a write process.
[0055]
In the update process of the address management area, first, it is determined whether it is a write command process or a read command process (step S1901). If it is write command processing, logical block number holding processing is performed (step S1902). In this embodiment, the logical block numbers are recorded in the logical block number holding area A1621 shown in FIG. 5 in the order of the designated logical block numbers 0001, 00F2, 0000, and 00F3. Note that the logical block number may be similarly held in the logical block number holding area B1622.
[0056]
Subsequently, based on the value of the buffer determination flag held in the buffer determination flag area 1606, an area for holding and updating each block number is selected from either the address management area A1601 or the address management area B1602 (step S1903). Thereafter, the physical block number is held in the physical block number holding area A 1623 or B 1624 of the target area (step S 1904). The physical block numbers corresponding to the designated logical block numbers 0001, 00F2, 0000, and 00F3 are F1, F0, 00, and 13 indicated by bold lines in FIG. 5 from the data block address management areas A1611 and B1614. Block numbers are sequentially recorded in physical block number holding areas A1623 and B1624, respectively.
[0057]
Further, the spare block number is held in the spare block number holding area A1625 or B1626 of the target area (step S1905). In the example of FIG. 5, the physical block numbers of the first block and the third block in the spare block address management area A1612 before processing are 02 and 05 indicated by the thick line frame in the figure, and in the spare block address management area B1615. The physical block numbers of the second block and the fourth block are 11, F3 indicated by a bold frame in the drawing. Accordingly, these physical block numbers are stored in the spare block number holding areas A1625 and B1626, respectively. Further, the number of write blocks (corresponding to the number of write blocks and the total number of updated blocks) (N = 4) is held in the parameter area 1605 of the nonvolatile memory (step S1906).
[0058]
Next, the number of write processing counters (corresponding to the number of updated blocks) (M = 0) is incremented (+1) and the value (M = 1) is held in the parameter area 1605 of the nonvolatile memory (step S1907). Subsequently, the physical block number corresponding to the (M = 1) th write process is updated (step S1908). In the present embodiment, the physical block number 02 of the first spare block corresponding to the physical block number F1 corresponding to the first logical block number 01 in the data block address management area A1611 is written and updated. Furthermore, the spare block number corresponding to the (M = 1) -th write process is updated (step S1909). Here, the physical block number F1 of the corresponding first data block is written to the first physical block number 02 in the spare block address management area A1612, and the physical block numbers of the data block and the spare block are rewritten to each other.
[0059]
Thereafter, it is confirmed whether or not the write process is completed based on the write process in-progress information obtained from the number of write blocks and the write process counter (N = M) (step S1910). If not completed, the process returns to step S1907. The number of write processing counters is incremented (+1), and the physical block numbers of the second data block and the spare block in the target area are continuously rewritten to each other (steps S1907 to S1909). When the write process is completed, the write process counter number is cleared (M = 0) (step S1911), and the update process of the address management areas A1601 and B1602 is ended. FIG. 9 shows a memory configuration in a state where the writing process at this time is completed. Also, a response to the write command is transmitted after the address management area update processing is completed.
[0060]
The update process of the address management area is a block data writing process. That is, in the target area specified by the command in the divided data area, the block data to be written by the write command is temporarily stored in the spare block, and the logical block and spare block specified by the write command in the address management area The block data writing process is completed by rewriting the block number so that. The block number update process in the address management area can be performed at a higher speed than the block data write process in the conventional write process.
[0061]
In this embodiment, since the logical block number of the spare block area in which the block data designated at the time of the writing process is stored in each data area is fixed as F0 to FF, it always corresponds to the same logical block number. Thus, the block data is stored in the spare block area substantially in parallel with the transmission processing of the received data. High speed processing is realized.
[0062]
Further, when the power supply is interrupted in the middle of the writing process, the writing process is not completed, so the number of write processing counters (M) stored in the parameter area 1605 of the nonvolatile memory is not cleared (≠ 0). It becomes. Therefore, by checking the value of the number of write processing counters (M) when the power is restored, it is possible to check whether or not a power interruption has occurred during the writing process.
[0063]
When the writing process is not completed as described above, when the process is resumed, the number of write blocks and the number of write processing counters stored in the parameter area 1605, the block numbers held in the block number holding areas A1613 and B1616, Based on the value of the flag in the buffer determination flag area 1606, an update process of an unprocessed block number is performed to complete the write process.
[0064]
Next, as the processing contents at the time of receiving the read command, the logical block numbers 0001, 00F2, 0000, and 00F3 are designated in the order, and the block data of the data block area A1501 and the data block area B1502 are alternately alternated in total. A procedure for performing the reading process will be described.
[0065]
In the command determination process in step S1901 in FIG. 8, if it is a read command process, based on the value of the buffer determination flag held in the buffer determination flag area 1606 as in the case of the write command process described above, An area for holding and updating each block number is selected from either the address management area A1601 or the address management area B1602 (step S1912).
[0066]
Thereafter, the spare block number is held in the spare block number holding area A1625 or B1626 of the target area (step S1913). In the example of FIG. 5, the physical block numbers of the first block and the third block in the spare block address management area A1612 before processing are 02 and 05 indicated by the bold line frame in the figure, and in the spare block address management area B1615. The physical block numbers of the second block and the fourth block are 11, F3 indicated by the bold line frame in the figure. Accordingly, these physical block numbers are stored in the spare block number holding areas A1625 and B1626, respectively. Further, the number of read blocks (corresponding to the number of read blocks and the total number of restored blocks) (N = 4) is held in the parameter area 1605 of the nonvolatile memory (step S1914).
[0067]
Next, the number of read processing counters (corresponding to the number of restored blocks) (M = 0) is incremented (+1) and the value (M = 1) is held in the parameter area 1605 of the nonvolatile memory (step S1915). Subsequently, the spare block number corresponding to the (M = 1) th read process is updated (step S1916). Here, the physical block number F1 of the corresponding first data block is written and updated to the first physical block number 02 in the spare block address management area A1612.
[0068]
Thereafter, it is confirmed whether or not the read process is completed based on the read process in-progress information obtained from the number of read blocks and the read process counter (N = M) (step S1917). If not completed, the process returns to step S1915. Then, the number of read processing counters is incremented (+1) and the physical block number of the second spare block in the target area is continuously rewritten (steps S1915 and S1916). When the read process is completed, the update process of the address management areas A1601 and B1602 is terminated.
[0069]
Note that the number of write processing counters (M) and the number of read processing counters (M), the number of write blocks (N) and the number of read blocks (N) may be shared, or may be provided separately.
[0070]
Then, after completion of the address management area update process, a response to the read command is transmitted. The read block data added to the response to the read command is the block data of the physical block number specified in the spare block address management area A1612 or B1615, and is read sequentially from the spare block 0 data by the number of read blocks. Sent while. Then, after the response is transmitted, the address management area is restored. Thus, the physical block numbers in the spare block address management areas A1612 and B1615 are returned to the state before receiving the read command.
[0071]
The update process and the return process of the address management area are the block data read process. That is, in the target area specified by the command in the divided data area, the block number is rewritten so that the logical block specified by the read command in the address management area and the spare block are replaced, and the block is replaced by the spare block. The block data reading process is completed by reading the data and then rewriting the block numbers of the spare block and the logical block back to the original state. The block number update process and the return process in the address management area can be performed at a higher speed than the block data read process in the conventional read process.
[0072]
In this embodiment, since the logical block number of the spare block area in which the block data designated at the time of read processing is stored in each data area is fixed as F0 to FF, it always corresponds to the same logical block number. Thus, the read processing from the spare block area of the block data is performed almost simultaneously with the transmission processing of the transmission data. Speeding up is realized.
[0073]
Further, when the power supply is interrupted in the middle of the read process, the read process is not completed, and the read process counter number (M) stored in the parameter area 1605 of the nonvolatile memory is not cleared (≠ 0). It becomes. Therefore, by checking the value of the read processing counter number (M) when the power is restored, it is possible to check whether or not a power interruption has occurred during the reading process.
[0074]
Thus, when the read process is not completed, when the process is resumed, the number of read blocks and the read process counter stored in the parameter area 1605, the block numbers held in the block number holding areas A1613 and B1616, Based on the value of the flag in the buffer determination flag area 1606, update processing of an unprocessed block number is performed and the read processing is completed.
[0075]
As described above, in the present embodiment, in the data area divided into a plurality, the value of the buffer determination flag is read out for the holding process and the update process of each block number during the update process of the address management area. If the value is 00, only the address management area A1601 is processed, and if the value of the buffer determination flag is 01, only the address management area B1602 is processed.
[0076]
Here, the logical block number in the address management area A 1505 matches the logical block number in the logical memory space viewed from the reader / writer 102. On the other hand, the logical block number of the address management area B 1506 is managed and controlled as a value obtained by subtracting F0 from the logical block number in the logical memory space viewed from the reader / writer 102. For example, when 00F2 is designated as the second block designation by the write command, as a result of the judgment processing of the logical block number and F0, it is judged that the processing is for the address management area B1602, and control is performed. As a logical block number, an operation result of 00F2-00F0 = 0002 is obtained. Therefore, in this case, processing is performed as writing to the logical block 02 in the address management area B1602.
[0077]
In the description of the above processing procedure, the block data storage process in the spare block at the time of receiving the write command is to write the same data in the spare block area A 1503 and the spare block area B 1504. However, the present invention is not limited to this. Absent. For example, whether the write block designated based on the logical block number added to the command by the target area determination process performed in the buffer determination flag area update process corresponds to the data block area A, or the data block It may be determined whether the area corresponds to the area B and only the corresponding spare block area may be written.
[0078]
With the above processing, in this embodiment, when the total number of blocks exceeds 256 blocks when managing data in block units, such as when the logical block number of the data block area is defined up to 1DF in the memory space. Even in such a case, it is possible to efficiently perform processing related to writing and reading without significantly increasing the memory capacity of the address management area or the like. That is, according to the present embodiment, even for a nonvolatile memory having a large capacity data area, the power supply is interrupted during the block data read process and write process without requiring a large amount of system control memory capacity. Data can be guaranteed when it occurs, and processing can be executed more efficiently and at high speed.
[0079]
【The invention's effect】
As described above, according to the present invention, even when a large-capacity data block area is handled in an IC card, it is possible to execute processing efficiently and at high speed while ensuring data guarantee at the time of power interruption. Become.
[Brief description of the drawings]
FIG. 1 is a block diagram of an IC card system according to an embodiment of the present invention.
FIG. 2 is a memory configuration diagram in a logical memory space according to the present embodiment.
FIG. 3 is a memory configuration diagram in a divided logical memory space according to the present embodiment;
FIG. 4 is a memory configuration diagram in a physical memory space according to the present embodiment.
FIG. 5 is a configuration diagram of an address management area in a physical memory space according to the present embodiment.
FIG. 6 is a flowchart showing the flow of data processing according to the present embodiment.
FIG. 7 is a flowchart showing a flow of buffer determination flag area update processing according to the present embodiment;
FIG. 8 is a flowchart showing a flow of address management area update processing according to the embodiment;
FIG. 9 is a configuration diagram of an address management area in a physical memory space after a write process according to the present embodiment.
[Explanation of symbols]
101 IC card
102 Reader / Writer
103,104 antenna
105 Demodulator
106 Control unit
107 ROM
108 RAM
109 Nonvolatile memory
110 Modulator
1401 Data block area
1402 Spare block area
1403 Address management area
1404 Parameter area
1405 Buffer judgment flag area
1501 Data block area A
1502 Data block area B
1503 Spare block area A
1504 Spare block area B
1505 Address management area A
1506 Address management area B
1507 Parameter area
1508 Buffer judgment flag area
1601 Address management area A
1602 Address management area B
1603 Data area A
1604 Data area B
1605 Parameter area
1606 Buffer judgment flag area
1607 Error check information
1611 Data block address management area A
1612 Spare block address management area A
1613 Block number holding area A
1614 Data block address management area B
1615 Spare block address management area B
1616 Block number holding area B
1621 Logical block number holding area A
1622 Logical block number holding area B
1623 Physical block number holding area A
1624 Physical block number holding area B
1625 Spare block number holding area A
1626 Spare block number holding area B

Claims (8)

記憶保持するデータを格納するつ以上の記憶データ領域と、書き込み処理時において対象のデータを格納するつ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するメモリと、
前記メモリへの書き込み処理時において、コマンドと対応して送られる書き込みデータを前記バッファ領域に格納し、前記アドレス管理領域における前記バッファ領域に対応するアドレス情報と前記コマンドで指定された前記記憶データ領域に対応するアドレス情報とを互いに書き換えてアドレス管理領域を更新するメモリ制御手段と、
を備えたことを特徴とするICカード。
Address information that associates two or more storage data areas for storing data to be stored, two or more buffer areas for storing target data at the time of write processing, and a logical address and a physical address related to the storage data area And a memory having two or more address management areas each storing address information associating a logical address and a physical address related to the buffer area at a predetermined physical address ,
Write data sent in correspondence with a command is stored in the buffer area at the time of a write process to the memory, and address information corresponding to the buffer area in the address management area and the storage data area specified by the command Memory control means for renewing the address information corresponding to each other and updating the address management area;
An IC card characterized by comprising:
前記メモリは、前記アドレス管理領域において更新処理時の対象のアドレス情報を保持するアドレス保持領域を備えるとともに、前記つ以上のバッファ領域のうちのどの領域が有効であるかを示すバッファ領域の有効性情報を格納するバッファ判定フラグ領域と、書き込み処理の途中であることを示す書き込み処理中情報を格納するパラメータ領域とを備え、
前記メモリ制御手段は、前記書き込み処理時において、前記コマンドで指定された論理アドレスを基に、前記つ以上の記憶データ領域及びバッファ領域から書き込み対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報を前記バッファ判定フラグ領域に格納し、前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを前記アドレス保持領域に一旦保持するとともに、前記書き込み処理中情報を前記パラメータ領域に設定し、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記記憶データ領域に対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを互いに書き換える更新処理を行った後に、前記書き込み処理中情報を元の状態に戻すことを特徴とする請求項1に記載のICカード。
The memory is provided with a address holding area for holding target address information during the updating process in the address management area, the effective buffer area indicating which area among the two or more buffer areas are valid A buffer determination flag area for storing sex information, and a parameter area for storing in-writing information indicating that the writing process is in progress,
Said memory controlling means, at the time of writing process, based on a logical address designated by the command, and select the storage data area and buffer area of the write target from the two or more storage data area and buffer area, the Validity information for designating a target area is stored in the buffer determination flag area, a physical address corresponding to a logical address of a storage data area designated by the command in the address management area, and a physical address corresponding to the buffer area, Is temporarily stored in the address holding area, the write processing information is set in the parameter area, and the storage data area in the address management area of the effective target area based on the validity information of the buffer determination flag area Correspond to the physical address and the buffer area. After the update processing for rewriting the physical address from each other, IC card according to claim 1, wherein the returning the writing process in the information to the original state.
前記メモリ制御手段は、前記書き込み処理中情報によって前記書き込み処理が完了したか否かを判断し、前記書き込み処理が正常に完了していない場合は、処理再開時に前記パラメータ領域に格納されている前記物理アドレスの更新総ブロック数及び更新済みブロック数と前記アドレス保持領域に保持されているアドレス情報と前記バッファ判定フラグ領域の有効性情報とに基づいて、未処理の前記物理アドレスの更新処理を完了させることを特徴とする請求項2に記載のICカード。  The memory control means determines whether or not the writing process is completed according to the information during the writing process, and when the writing process is not completed normally, the memory control unit stores the parameter area when the process is resumed. The update processing of the unprocessed physical address is completed based on the total number of updated physical address blocks and the number of updated blocks, the address information held in the address holding area, and the validity information of the buffer determination flag area. The IC card according to claim 2, wherein: 記憶保持するデータを格納するつ以上の記憶データ領域と、読み出し処理時において対象のデータが格納されている2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するメモリと、
前記メモリからの読み出し処理時において、前記アドレス管理領域におけるコマンドで指定された前記記憶データ領域に対応するアドレス情報でもって前記バッファ領域に対応するアドレス情報を書き換えてアドレス管理領域を更新し、この更新後のバッファ領域に格納された読み出しデータを読み出した後、前記アドレス管理領域を元の状態に復帰するメモリ制御手段と、
を備えたことを特徴とするICカード。
Two or more storage data areas for storing data to be stored and held, two or more buffer areas for storing target data at the time of read processing, and a logical address and a physical address for the storage data area are associated with each other. A memory having two or more address management areas each storing address information and address information associating a logical address and a physical address related to the buffer area at a predetermined physical address ;
During the read process from the memory, the address management area is updated by rewriting the address information corresponding to the buffer area with the address information corresponding to the storage data area specified by the command in the address management area, and this update Memory control means for returning the address management area to the original state after reading the read data stored in the later buffer area;
An IC card characterized by comprising:
前記メモリは、前記アドレス管理領域において更新処理時の対象のアドレス情報を保持するアドレス保持領域を備えるとともに、前記つ以上のバッファ領域のうちのどの領域が有効であるかを示すバッファ領域の有効性情報を格納するバッファ判定フラグ領域と、読み出し処理の途中であることを示す読み出し処理中情報を格納するパラメータ領域とを備え、
前記メモリ制御手段は、前記読み出し処理時において、前記コマンドで指定された論理アドレスを基に、前記つ以上の記憶データ領域及びバッファ領域から読み出し対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報を前記バッファ判定フラグ領域に格納し、前記アドレス管理領域における前記バッファ領域に対応する物理アドレスを前記アドレス保持領域に一旦保持するとともに、前記読み出し処理中情報を前記パラメータ領域に設定し、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスを前記バッファ領域に対応する物理アドレスへ書き換える更新処理を行い、この更新後のバッファ領域に格納された読み出しデータを読み出してから前記保持したバッファ領域に対応する物理アドレスを元に戻す復元処理を行った後に、前記読み出し処理中情報を元の状態に戻すことを特徴とする請求項4に記載のICカード。
The memory is provided with a address holding area for holding target address information during the updating process in the address management area, the effective buffer area indicating which area among the two or more buffer areas are valid A buffer determination flag area for storing sex information, and a parameter area for storing in-read information indicating that the read process is in progress.
Said memory controlling means, at the time of reading process, on the basis of the logical address specified by the command, and select the storage data area and the buffer area to be read from the two or more storage data area and buffer area, the Validity information for designating a target area is stored in the buffer determination flag area, and a physical address corresponding to the buffer area in the address management area is temporarily held in the address holding area, and the information during reading processing is stored in the parameter The physical address corresponding to the logical address of the storage data area specified by the command in the address management area of the valid target area is set to the buffer area based on the validity information of the buffer determination flag area. Update processing to rewrite the physical address After the read data stored in the updated buffer area is read out and after performing a restoration process to restore the physical address corresponding to the held buffer area, the information during the read process is returned to the original state. The IC card according to claim 4.
前記メモリ制御手段は、前記読み出し処理中情報によって前記読み出し処理が完了したか否かを判断し、前記読み出し処理が正常に完了していない場合は、処理再開時に前記パラメータ領域に格納されている前記物理アドレスの復元総ブロック数及び復元済みブロック数と前記アドレス保持領域に保持されているアドレス情報と前記バッファ判定フラグ領域の有効性情報とに基づいて、未処理の前記物理アドレスの復元処理を完了させることを特徴とする請求項5に記載のICカード。  The memory control means determines whether or not the read process is completed based on the information during the read process. If the read process is not completed normally, the memory control unit stores the parameter area when the process is resumed. Based on the total number of restored physical addresses and the number of restored blocks, the address information held in the address holding area, and the validity information of the buffer determination flag area, the restoration processing of the unprocessed physical address is completed. 6. The IC card according to claim 5, wherein: 記憶保持するデータを格納する2つ以上の記憶データ領域と、書き込み処理時において対象のデータを格納する2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報および前記バッファ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するICカード内のメモリへのデータの書き込み処理時において、
ICカード内の制御部が、コマンドと対応して送られる書き込みデータを前記メモリのバッファ領域に格納するステップと、
前記制御部が、前記コマンドで指定された論理アドレスを基に、つ以上の記憶データ領域及びバッファ領域から書き込み対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報をバッファ判定フラグ領域に格納するステップと、
前記制御部が、前記メモリのアドレス情報を格納するアドレス管理領域における、前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスと前記バッファ領域に対応する物理アドレスとをアドレス保持領域に一旦保持するステップと、
前記制御部が、書き込み処理の途中であることを示す書き込み処理中情報を設定するステップと、
前記制御部が、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記記憶データ領域に対応する物理アドレスと前記バッファ領域に対応する物理アドレスとを互いに書き換えて前記アドレス管理領域の更新処理を行うステップと、
前記制御部が、前記更新処理の後に前記書き込み処理中情報を元の状態に戻すステップと、
を有することを特徴とするICカードの情報処理方法。
Address information that associates two or more storage data areas for storing data to be stored, two or more buffer areas for storing target data at the time of write processing, and a logical address and a physical address related to the storage data area And at the time of data write processing to the memory in the IC card having two or more address management areas each storing address information associating a logical address and a physical address related to the buffer area at a predetermined physical address ,
A control unit in the IC card stores write data sent corresponding to the command in the buffer area of the memory;
Wherein the control unit is based on a logical address designated by said command, select two or more storage data area and the storage data area and buffer area of the writing object from the buffer area, the validity information specifying the region of interest Storing in the buffer determination flag area;
In the address management area for storing the address information of the memory , the control unit uses the physical address corresponding to the logical address of the storage data area specified by the command and the physical address corresponding to the buffer area as an address holding area. Holding once, and
The controller sets information during the writing process indicating that the writing process is in progress; and
The control unit rewrites a physical address corresponding to the storage data area and a physical address corresponding to the buffer area in the address management area of the valid target area based on validity information of the buffer determination flag area. Performing an update process of the address management area;
The controller returning the in-write information to the original state after the update process;
An information processing method for an IC card, comprising:
記憶保持するデータを格納する2つ以上の記憶データ領域と、読み出し処理時において対象のデータが格納されている2つ以上のバッファ領域と、前記記憶データ領域に関する論理アドレスと物理アドレスとを対応づけるアドレス情報及び前記バッファ領域に関する 論理アドレスと物理アドレスとを対応づけるアドレス情報をそれぞれ所定の物理アドレスに格納する2つ以上のアドレス管理領域とを有するICカード内のメモリからのデータの読み出し処理時において、
ICカード内の制御部が、コマンドで指定された論理アドレスを基につ以上の記憶データ領域及びバッファ領域から読み出し対象の記憶データ領域及びバッファ領域を選択し、この対象領域を指定する有効性情報をバッファ判定フラグ領域に格納するステップと、
前記制御部が、前記メモリのアドレス情報を格納するアドレス管理領域における、前記バッファ領域に対応する物理アドレスを前記アドレス保持領域に一旦保持するステップと、
前記制御部が、読み出し処理の途中であることを示す読み出し処理中情報を設定するステップと、
前記制御部が、前記バッファ判定フラグ領域の有効性情報に基づき、有効な対象領域の前記アドレス管理領域における前記コマンドで指定された記憶データ領域の論理アドレスに対応する物理アドレスを前記バッファ領域に対応する物理アドレスへ書き換えて前記アドレス管理領域の更新処理を行うステップと、
前記制御部が、前記更新後のバッファ領域に格納された読み出しデータを読み出してから前記保持したバッファ領域に対応する物理アドレスを元に戻す復元処理を行うステップと、
前記制御部が、前記復元処理の後に前記読み出し処理中情報を元の状態に戻すステップと、
を有することを特徴とするICカードの情報処理方法。
Two or more storage data areas for storing data to be stored and held, two or more buffer areas for storing target data at the time of read processing, and a logical address and a physical address for the storage data area are associated with each other. When reading data from a memory in an IC card having address information and address information that associates a logical address and a physical address related to the buffer area with two or more address management areas respectively stored in predetermined physical addresses ,
Efficacy controller in the IC card, selects the storage data area and the buffer area to be read out from two or more storage data area and the buffer area based on the logical address specified in the command, specifying the target region Storing information in a buffer determination flag area;
A step wherein said control unit is once held in the address management area for storing address information of the memory, a physical address corresponding to the buffer area in said address holding area,
The control unit setting read-in-process information indicating that it is in the middle of a read process;
Based on the validity information of the buffer determination flag area , the control unit corresponds to the buffer area a physical address corresponding to the logical address of the storage data area specified by the command in the address management area of the valid target area. Rewriting to a physical address to perform the update process of the address management area,
The controller performs a restoration process of restoring the physical address corresponding to the held buffer area after reading the read data stored in the updated buffer area;
The control unit returning the in-reading information to the original state after the restoration process;
An information processing method for an IC card, comprising:
JP2002219629A 2001-12-11 2002-07-29 IC card and information processing method thereof Expired - Fee Related JP3920166B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2002219629A JP3920166B2 (en) 2002-07-29 2002-07-29 IC card and information processing method thereof
US10/316,122 US7017825B2 (en) 2001-12-11 2002-12-11 IC card and data processing method therefor
CN02154252A CN1430179A (en) 2001-12-11 2002-12-11 IC card and its data processing method
DE60218121T DE60218121T2 (en) 2001-12-11 2002-12-11 IC card and data processing method for it
EP02027644A EP1324207B1 (en) 2001-12-11 2002-12-11 Ic card and data processing method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002219629A JP3920166B2 (en) 2002-07-29 2002-07-29 IC card and information processing method thereof

Publications (2)

Publication Number Publication Date
JP2004062504A JP2004062504A (en) 2004-02-26
JP3920166B2 true JP3920166B2 (en) 2007-05-30

Family

ID=31940484

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002219629A Expired - Fee Related JP3920166B2 (en) 2001-12-11 2002-07-29 IC card and information processing method thereof

Country Status (1)

Country Link
JP (1) JP3920166B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653464B (en) * 2014-11-13 2024-05-07 紫光同芯微电子有限公司 Structure of JAVA intelligent card and object management method thereof

Also Published As

Publication number Publication date
JP2004062504A (en) 2004-02-26

Similar Documents

Publication Publication Date Title
EP1324207B1 (en) Ic card and data processing method therefor
EP1469419B1 (en) Proximity communication system, proximity communication method, data managing apparatus, data managing method, recording medium, and computer program
JP4806639B2 (en) Secure device and IC card issuing system
JP2010182270A (en) Mobile electronic apparatus and data management method in mobile electronic apparatus
EP2169639A1 (en) Portable electronic device and data processing method in portable electronic device
JP3920166B2 (en) IC card and information processing method thereof
US20090177921A1 (en) Portable electronic device and control method thereof
US8468493B2 (en) Information processing apparatus, information processing method, and program
JP7005934B2 (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program
JP7322923B2 (en) Secure element, transaction control method and device
JP2003178281A (en) Ic card and its information processing method
JP2011060136A (en) Portable electronic apparatus, and data management method in the same
JP7420179B1 (en) Electronic information storage medium, IC card, issuance processing method, and program
JP2006293706A (en) Multi-application ic card with application updating function
JP4476658B2 (en) Portable electronic device, electronic processing system, and electronic processing method
JP2008152411A (en) Information processor, information processing method and program
CN104267975A (en) Card, device and method for processing extensive application data
JP5050508B2 (en) Storage device, storage device program, and storage processing method
JP5971713B2 (en) IC card
US8704636B2 (en) Information processing apparatus, communication apparatus, and program
US6676019B2 (en) Electronic chip for a portable object
JP7439847B2 (en) Electronic information storage medium, key data setting method, and program
JP3863479B2 (en) IC card
JP2018014014A (en) Electronic information storage medium, information processing method, and information processing program
JPH1027225A (en) Memory management system for non-contact ic card

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041210

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20060325

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060912

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060927

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061127

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070214

R150 Certificate of patent or registration of utility model

Ref document number: 3920166

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100223

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110223

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120223

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130223

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130223

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140223

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees