JP4965909B2 - IC card - Google Patents

IC card Download PDF

Info

Publication number
JP4965909B2
JP4965909B2 JP2006176698A JP2006176698A JP4965909B2 JP 4965909 B2 JP4965909 B2 JP 4965909B2 JP 2006176698 A JP2006176698 A JP 2006176698A JP 2006176698 A JP2006176698 A JP 2006176698A JP 4965909 B2 JP4965909 B2 JP 4965909B2
Authority
JP
Japan
Prior art keywords
data
wireless
card
storage means
rewritten
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2006176698A
Other languages
Japanese (ja)
Other versions
JP2008009521A (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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2006176698A priority Critical patent/JP4965909B2/en
Publication of JP2008009521A publication Critical patent/JP2008009521A/en
Application granted granted Critical
Publication of JP4965909B2 publication Critical patent/JP4965909B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Debugging And Monitoring (AREA)

Description

本発明は、ICチップを内蔵した例えばICカードに関する。 The present invention relates to, for example, an IC card incorporating an IC chip.

従来、無線ICカードのデータ書き換えに関しては、無線ICカードが、外部装置(無線ICカードリーダライタ)からのデータ書き換えコマンドと書き換えデータを受信すると、無線ICカードのCPUあるいはシーケンサによる書き換え処理手続きを経て、無線ICカードの不揮発性メモリのデータが書き換えられる。   Conventionally, with regard to data rewriting of a wireless IC card, when the wireless IC card receives a data rewriting command and rewriting data from an external device (wireless IC card reader / writer), it undergoes a rewriting process procedure by the CPU or sequencer of the wireless IC card. The data in the nonvolatile memory of the wireless IC card is rewritten.

一般に、無線ICカードに内蔵される不揮発性メモリの書き換えには、数ミリ秒の時間が必要である。無線ICカードのCPUあるいはシーケンサは、書き換え終了までに必要な時間あるいは書き換え終了を示す信号を受信した後、書き換えたデータをベリファイし、書き換え結果の正常/異常を外部装置(無線ICカードリーダライタ)へ返信する。   In general, it takes several milliseconds to rewrite a nonvolatile memory built in a wireless IC card. The CPU or sequencer of the wireless IC card receives a signal indicating the time required for completion of rewriting or the end of rewriting, verifies the rewritten data, and determines whether the rewriting result is normal or abnormal as an external device (wireless IC card reader / writer). Reply to

無線ICカードは、外部装置(無線ICカードリーダライタ)に近づくことにより、磁界をエネルギーとして無結線状態で動作する。このため、無線ICカードは、外部装置(無線ICカードリーダライタ)から離れて、動作に必要なエネルギーの供給を受けなくなると動作が途中で中断する。   By approaching an external device (wireless IC card reader / writer), the wireless IC card operates in a non-wired state using a magnetic field as energy. For this reason, when the wireless IC card is separated from the external device (wireless IC card reader / writer) and is no longer supplied with energy necessary for the operation, the operation is interrupted.

そこで、本発明の発明者は、次のような発明を提案している(特許文献1:特開2005−275621号公報参照)。本発明によれば、まず、データ書換えを行うとき、書換えコマンド受信前に事前に書換え対象エリアのデータを退避させた後に、書き換えたいデータを書き換え対象エリアに書き込むようにしている。なお、退避エリアのデータは、書き換えが完了した時点で消去するようにしている。この一連の動作が途中で中断した場合は、書換えが失敗したことを意味する。従って、その場合には上位装置にエラー情報を返信するか、あるいは無線ICカードが書き込み中に無線ICカードリーダライタから離れた場合や、カードが再度リーダライタに近づいたときに、書換え異常が発生していたことをリーダライタ側に通信することで、上位装置からのコマンドに従い以前のデータを修復可能としている。
特開2005−275621号公報
Therefore, the inventor of the present invention has proposed the following invention (see Patent Document 1: Japanese Patent Application Laid-Open No. 2005-275621). According to the present invention, first, when data rewriting is performed, data in a rewriting target area is saved in advance before receiving a rewriting command, and then data to be rewritten is written in the rewriting target area. Note that the data in the save area is erased when the rewriting is completed. If this series of operations is interrupted, it means that rewriting has failed. Therefore, in that case, error information is returned to the host device, or rewriting error occurs when the wireless IC card leaves the wireless IC card reader / writer during writing or when the card approaches the reader / writer again. By communicating what has been done to the reader / writer, previous data can be restored in accordance with commands from the host device.
JP 2005-275621 A

本発明は、携帯型電子装置のデータの書き換えの際に異常が生じた場合に、高速に該携帯型電子装置のデータ修復を行うことが可能なICカードを提供することを目的とする。 An object of the present invention is to provide an IC card that can restore data of a portable electronic device at a high speed when an abnormality occurs during rewriting of data of the portable electronic device.

本発明では、携帯型電子装置が書換え不成功になった場合に、上位装置からのコマンドを待たずに、携帯型電子装置自身でデータの修復を行うようにしている。なお、修復が行われた結果は上位装置に通知することで、システムとしての一貫性は損なわれることはない。また、不正にデータを書き換えられることを想定して、上位装置は携帯型電子装置内のデータは常にログを取ることで、一貫性は実現できる。   In the present invention, when the portable electronic device is unsuccessfully rewritten, the portable electronic device itself restores data without waiting for a command from the host device. The consistency of the system is not impaired by notifying the host device of the result of the repair. In addition, assuming that data can be rewritten illegally, the host device always logs data in the portable electronic device, so that consistency can be realized.

一実施形態に係るICカードは、外部装置と通信する通信手段と、書き換え対象のデータを記憶する第1の記憶手段と、前記第1の記憶手段に記憶された書き換え対象のデータの退避先として、この書き換え対象のデータを記憶する第2の記憶手段と、前記第1の記憶手段に記憶されている書き換え対象のデータを前記第2の記憶手段へ退避させた後に、前記第1の記憶手段に記憶されている書き換え対象のデータを書き換える書換制御手段と、前記書換制御手段による処理の状態を示す情報を記憶する第3の記憶手段と、を具備し、前記書換制御手段は、起動時に前記第3の記憶手段により記憶されている情報に基づいて前記退避が正常に完了したか否か判断し、前記書換が正常に完了したか否か判断し、前記退避が正常に完了し、且つ前記書換が正常に完了していなかった場合、第2の記憶手段に記憶されているデータを第1の記憶手段に書き込む An IC card according to an embodiment is a communication unit that communicates with an external device, a first storage unit that stores data to be rewritten, and a save destination of data to be rewritten stored in the first storage unit. The second storage means for storing the data to be rewritten and the first storage means after the data to be rewritten stored in the first storage means are saved to the second storage means includes a rewrite control means for rewriting the data to be rewritten that is stored, a third storage means for storing information indicating the state of processing by the rewrite control means, in said rewrite control means, wherein upon startup Based on the information stored in the third storage means, it is determined whether or not the evacuation has been normally completed, it is determined whether or not the rewriting has been normally completed, the evacuation has been normally completed, and the previous If the rewriting is not completed successfully, and writes the data stored in the second storage means into the first storage means.

本発明によれば、データの修復を携帯型電子装置自身の判断で実行することで、処理の都度上位装置や携帯型電子装置とリーダライタ間での通信を発生させることなく、修復が完了した時点で通信を発生させるようにしている。これにより、全体としても処理時間あるいは、システムの負荷を軽減できる。   According to the present invention, the restoration of data is executed at the discretion of the portable electronic device itself, so that the restoration is completed without causing communication between the host device or portable electronic device and the reader / writer for each processing. Communication is generated at the time. Thereby, the processing time or the system load can be reduced as a whole.

図面を参照して本発明の実施の形態を説明する。図1は、本発明の一実施形態に係る電子処理システムの概略構成を示す図である。図1に示すように、電子処理システムは、携帯型電子装置としての無線ICカード本体1と、外部装置や処理端末としての無線ICカードリーダライタ2により構成される。   Embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing a schematic configuration of an electronic processing system according to an embodiment of the present invention. As shown in FIG. 1, the electronic processing system includes a wireless IC card main body 1 as a portable electronic device and a wireless IC card reader / writer 2 as an external device or a processing terminal.

無線ICカード本体1は、CPU101、ROM102、RAM103、不揮発性メモリ104、データ入出力部105、及びシステムコントローラ106などを有し、無線ICカード本体1に埋設されるICモジュールMを備えている。この無線ICカード本体1は、例えば無線ICカードリーダライタ2から誘導結合により動作電力の供給を受ける無線インタフェースで通信する非接触カードである。   The wireless IC card main body 1 includes a CPU 101, a ROM 102, a RAM 103, a nonvolatile memory 104, a data input / output unit 105, a system controller 106, and the like, and includes an IC module M embedded in the wireless IC card main body 1. The wireless IC card main body 1 is a contactless card that communicates with a wireless interface that receives operation power from the wireless IC card reader / writer 2 by inductive coupling.

CPU101は、全体の動作を制御する。ROM102は、CPU101が実行するプログラムを記憶する。RAM103は、例えば書き換え処理に必要なデータを一時的に記憶する。本実施形態では、ROM102は、例えば、次のような動作を実行するプログラムを記憶している。なお、プログラムは、単一のプログラムであっても、複数の機能を複数のモジュールで実行するように構成されていても良い。この、プログラムは、通常の制御プログラムの他に、本実施形態では、(1)所定の処理、例えば無線ICカードリーダライタ2からの所定コマンドの受信(例えば無線ICカードリーダライタ2との間の相互認証完了の通知)に対応して、書き換えコマンドの受信や書き換え対象のデータを予測する。(2)不揮発性メモリ104の第1の記憶エリアに記憶されている書き換え対象のデータを不揮発性メモリ104の第2の記憶エリアへ退避させる。(3)退避処理完了後に書き換えコマンドの受信に対応して第1の記憶エリアに記憶されている書き換え対象のデータを書き換える。(4)書き換えが正常に行われたら、第2の記憶エリアのデータを削除する。(5)上記の(2)〜(4)に異常が生じた場合に、詳細は後述する異常処理を実行する。そして、CPU101は、上記の各プログラムを実行して、所定の処理を行う。   The CPU 101 controls the overall operation. The ROM 102 stores a program executed by the CPU 101. The RAM 103 temporarily stores data necessary for the rewriting process, for example. In the present embodiment, the ROM 102 stores, for example, a program that executes the following operation. Note that the program may be a single program or configured to execute a plurality of functions by a plurality of modules. In this embodiment, in addition to a normal control program, this program is (1) predetermined processing, for example, reception of a predetermined command from the wireless IC card reader / writer 2 (for example, communication with the wireless IC card reader / writer 2). Corresponding to the notification of mutual authentication completion), reception of a rewrite command and data to be rewritten are predicted. (2) The data to be rewritten stored in the first storage area of the nonvolatile memory 104 is saved in the second storage area of the nonvolatile memory 104. (3) Rewrite the data to be rewritten stored in the first storage area in response to the reception of the rewrite command after the saving process is completed. (4) When rewriting is performed normally, the data in the second storage area is deleted. (5) When an abnormality occurs in the above (2) to (4), an abnormality process described in detail later is executed. Then, the CPU 101 executes each program described above to perform predetermined processing.

不揮発性メモリ104は、書き換えの対象となるデータを記憶する第1の記憶エリア、及びこの第1の記憶エリアに記憶される書き換えの対象となるデータの退避先としてこの書き換え対象のデータを一時的に記憶する第2の記憶エリアを含む。つまり、不揮発性メモリ104は、第1の記憶手段及び第2の記憶手段として機能する。なお、この不揮発性メモリ104には、プログラム等を格納することも可能である。   The non-volatile memory 104 temporarily stores the data to be rewritten as a first storage area for storing data to be rewritten and a save destination for data to be rewritten stored in the first storage area. Includes a second storage area for storage. That is, the nonvolatile memory 104 functions as a first storage unit and a second storage unit. The nonvolatile memory 104 can also store a program or the like.

データ入出力部105は、アンテナを含み、無線ICカードリーダライタ2からの各種コマンドを受信したり、無線ICカードリーダライタ2に対して各種応答を送信したりする。つまり、データ入出力部105は、外部装置と通信する通信手段として機能する。システムコントローラ106は、各部間の信号の伝達を制御する。   The data input / output unit 105 includes an antenna and receives various commands from the wireless IC card reader / writer 2 and transmits various responses to the wireless IC card reader / writer 2. That is, the data input / output unit 105 functions as a communication unit that communicates with an external device. The system controller 106 controls transmission of signals between the units.

無線ICカードリーダライタ2は、CPU201、ROM202、RAM203、データ入出力部205、及びシステムコントローラ206などを備えている。この無線ICカードリーダライタ2は、無線ICカード本体1に対して各種コマンドを送信し、無線ICカード本体1から返信される応答を受信する。無線ICカードリーダライタ2には、上位装置(複数の端末装置や中継装置を管理する装置を本明細書では、「上位装置」と称する)が接続されている。この上位装置は、ネットワークで接続されオンラインで集中管理システムに結ばれ、カードの処理を行なうことも可能であるし、ローカルな処理をするだけの場合もある。本実施態様では、無線ICカードリーダライタ2は、例えば、無線ICカードに対して書き換えコマンド及び書き換えデータを送信し、無線ICカードの書き換え対象のデータを書き換える。   The wireless IC card reader / writer 2 includes a CPU 201, a ROM 202, a RAM 203, a data input / output unit 205, a system controller 206, and the like. The wireless IC card reader / writer 2 transmits various commands to the wireless IC card body 1 and receives responses returned from the wireless IC card body 1. The wireless IC card reader / writer 2 is connected to a host device (a device that manages a plurality of terminal devices and relay devices is referred to as a “host device” in this specification). The host device is connected via a network and connected to a centralized management system online, and can perform card processing or only local processing. In the present embodiment, the wireless IC card reader / writer 2 transmits a rewrite command and rewrite data to the wireless IC card, for example, and rewrites data to be rewritten on the wireless IC card.

CPU201は、全体の動作を制御し、例えば各種コマンドの発行を指示する。つまり、CPU201は、コマンド発行手段として機能する。ROM202は、CPU201の動作プログラムを記憶する。RAM203は、例えば書き換え処理において必要なデータを一時的に記憶する。   The CPU 201 controls the overall operation, for example, issues an instruction to issue various commands. That is, the CPU 201 functions as a command issuing unit. The ROM 202 stores an operation program for the CPU 201. The RAM 203 temporarily stores data necessary for the rewriting process, for example.

データ入出力部205は、アンテナを含み、無線ICカード本体1に対して各種コマンドを送信したり、無線ICカード本体1からの各種応答を受信したりする。つまり、データ入出力部205は、無線ICカードと通信する通信手段として機能する。システムコントローラ206は、各部間の信号の伝達を制御する。   The data input / output unit 205 includes an antenna and transmits various commands to the wireless IC card body 1 and receives various responses from the wireless IC card body 1. That is, the data input / output unit 205 functions as a communication unit that communicates with the wireless IC card. The system controller 206 controls transmission of signals between the units.

上記のような構成において、例えば、買い物に伴い、所定残額(¥10000)が書き込まれている無線ICカードから、利用金額(¥1000)の引き去りを行なうとする。無線ICカード内で、所定残額(¥10000)が不揮発性メモリから読み出され、RAMに設定される。続いて、無線ICカード内で、所定残額(¥10000)から利用金額(¥1000)を引き去った結果(¥9000)が不揮発性メモリに書き込まれる。このとき、無線ICカードが無線ICカードリーダライタから十分な電力を得られず書き換え異常になると、無線ICカードの不揮発性メモリには当初の所定残額(¥10000)、引き去り結果(¥9000)、あるいは全く関連の無いデータが書き込まれた状態となる。この場合、再度、カード処理を最初から始めようとしても、正しいデータ(当初の所定残額)が分からない。仮に、無線ICカード内の不揮発性メモリに所定のデータ(¥9000)が書き込まれていたとしても、無線ICカードリーダライタ側では、この所定のデータが当初の所定残額なのか引き去り結果なのか判断できない。このため、特許文献1では、書換処理において、退避処理正常終了を示すフラグを保持することにより、このような問題を解消している。   In the above configuration, for example, it is assumed that the usage amount (¥ 1000) is deducted from a wireless IC card in which a predetermined remaining amount (¥ 10000) is written with shopping. In the wireless IC card, the predetermined remaining amount (¥ 10000) is read from the nonvolatile memory and set in the RAM. Subsequently, the result (¥ 9000) obtained by deducting the usage amount (¥ 1000) from the predetermined remaining amount (¥ 10000) in the wireless IC card is written in the nonvolatile memory. At this time, if the wireless IC card is unable to obtain sufficient power from the wireless IC card reader / writer and the rewriting is abnormal, the initial predetermined remaining amount (¥ 10000), the withdrawal result (¥ 9000), Alternatively, data that is completely unrelated is written. In this case, even if the card processing is started again from the beginning, the correct data (original predetermined remaining amount) is not known. Even if predetermined data (¥ 9000) is written in the non-volatile memory in the wireless IC card, the wireless IC card reader / writer determines whether the predetermined data is the initial predetermined balance or the withdrawal result. Can not. Therefore, in Patent Document 1, such a problem is solved by holding a flag indicating the normal end of the save process in the rewrite process.

以下、上記のように構成された電子処理システムの基本的な動作を、図2及び図3を参照して説明する。図2は、無線ICカードの書換処理を示すフローチャートである。図3は、無線ICカードの書換処理中に異常処理をした場合における無線ICカードの動作を示すフローチャートである。まず、図2を参照して、無線ICカード本体1のデータ書き換えの流れを説明し、次に、図3を参照して、書き換えが正常に行われたかどうかに応じた処理について説明する。   The basic operation of the electronic processing system configured as described above will be described below with reference to FIGS. FIG. 2 is a flowchart showing rewrite processing of the wireless IC card. FIG. 3 is a flowchart showing the operation of the wireless IC card when an abnormality process is performed during the rewriting process of the wireless IC card. First, the flow of data rewriting of the wireless IC card main body 1 will be described with reference to FIG. 2, and next, processing according to whether rewriting has been performed normally will be described with reference to FIG.

無線ICカード本体1のデータ書き換えは次のように行われる。無線ICカード本体1が、無線ICカードリーダライタ2との通信可能範囲内に入る(例えば、無線ICカード本体1が、無線ICカードリーダライタ2にかざされる)と、通信を確立するための初期化処理を行う(ステップS1)。なお、通信を確立するための初期化処理は、例えば、次のように行われる。また、本実施態様では、通信確立後に必ずデータの書き換えが発生するものとして、説明する。そのため、通信が確立した時点で書換処理を予測して書換対象データを待避させるために、異常処理を示すカウンタも初期化(I=1)される。無線ICカード本体1が、無線ICカードリーダライタ2との通信可能範囲内に入り、無線ICカードリーダライタ2からのコマンドを受信すると、初期化などの各種処理を実行し、その処理結果を無線ICカードリーダライタ2へ応答する。ここにおいて、通常、無線ICカードリーダライタ2及び無線ICカード本体1は相互認証を行い、お互いの正当性を確認し、例えば無線ICカード本体1へのアクセスが許可されることになる。その後、無線ICカード本体1に対して送信されるコマンドはシステムにより異なるが、例えば特定のシステムでは一連の決まったコマンドと応答が決まった順序で送受信される。   Data rewriting of the wireless IC card main body 1 is performed as follows. When the wireless IC card body 1 enters the communicable range with the wireless IC card reader / writer 2 (for example, when the wireless IC card body 1 is held over the wireless IC card reader / writer 2), an initial stage for establishing communication is established. (Step S1). The initialization process for establishing communication is performed as follows, for example. Also, in this embodiment, the description will be made assuming that data rewriting always occurs after communication is established. Therefore, a counter indicating an abnormal process is also initialized (I = 1) in order to predict the rewrite process when the communication is established and save the rewrite target data. When the wireless IC card body 1 enters the communicable range with the wireless IC card reader / writer 2 and receives a command from the wireless IC card reader / writer 2, various processes such as initialization are executed, and the processing result is wirelessly transmitted. It responds to the IC card reader / writer 2. Here, normally, the wireless IC card reader / writer 2 and the wireless IC card main body 1 perform mutual authentication, confirm the mutual validity, and, for example, access to the wireless IC card main body 1 is permitted. Thereafter, the command transmitted to the wireless IC card main body 1 varies depending on the system. For example, in a specific system, a series of predetermined commands and responses are transmitted and received in a predetermined order.

上記のような初期化処理が終了すると、無線ICカード本体1は、相互認証の完了によって第1の記憶エリアに記憶された書換対象データを第2の記憶エリアに待避する(ステップS2)。この場合において、相互認証完了によって、書換対象データを第2の記憶エリアに待避するシステムでは、相互認証によって常にデータの書き換えが発生することを意味する。このように相互認証のみならず、特定のコマンドの実行(或いは受信)後に必ずデータの書き換えが発生することがわかっているのであれば、当該コマンドの実行(或いは受信)時に書換対象データを第2の記憶エリアに待避するようにすることが好ましい。この理由は、不揮発性メモリの書き換えには、通常数ミリ秒要するので、書き込みコマンドが実行される前の特定のコマンドや相互認証時(或いは完了時)をトリガとして、待避処理を行うようにすれば、書換対象データの待避をバックグラウンドで行うことができ、時間の短縮につながるからである。   When the initialization process as described above is completed, the wireless IC card main body 1 saves the rewrite target data stored in the first storage area in the second storage area upon completion of the mutual authentication (step S2). In this case, in the system that saves the data to be rewritten in the second storage area upon completion of mutual authentication, this means that data rewrite always occurs by mutual authentication. In this way, if it is known that not only mutual authentication but also data rewriting occurs after the execution (or reception) of a specific command, the second data to be rewritten is stored at the time of execution (or reception) of the command. It is preferable to save in the storage area. The reason for this is that it usually takes several milliseconds to rewrite the non-volatile memory, so the save process should be triggered by a specific command before the write command is executed or by mutual authentication (or completion). This is because the data to be rewritten can be saved in the background, leading to a reduction in time.

書換対象データの第2の記憶エリアへの待避が終了したら、待避が正常に行われたかどうかを判定し(ステップS3)、待避が正常に行われた場合には、カウンタをインクリメントする(ステップS4)。そして、書換対象データの書き換えコマンドを受信したら、書換対象データの書き換えを実行する(ステップS5)。なお、ステップS3において、待避が正常に行われなかった場合には、そのまま処理を終了(又は中断)する。なお、ステップS2において、書換対象データの待避中に、例えば、無線ICカード本体1に電源が供給されないような状況が発生した場合も、ステップS3と同様に処理を中断するので、説明は省略する。なお、上記の待避処理や書換処理に、長時間要するようであれば、所定時間毎に、無線ICカード本体1から無線ICカードリーダライタ2にその旨の信号を送信することにより、無線ICカードリーダライタ2は無線ICカード本体1がビジー状態であることを知ることができるので、当該処理が終了するまで、無線ICカードリーダライタ2の処理を待つようにすればよい。   When the saving of the data to be rewritten to the second storage area is completed, it is determined whether or not the saving is normally performed (step S3). If the saving is normally performed, the counter is incremented (step S4). ). When the rewrite target data rewrite command is received, the rewrite target data is rewritten (step S5). In step S3, if the saving is not normally performed, the process is terminated (or interrupted) as it is. In step S2, during the saving of the data to be rewritten, for example, when a situation occurs in which power is not supplied to the wireless IC card main body 1, the processing is interrupted in the same manner as in step S3, and thus the description thereof is omitted. . If the above saving process and rewriting process take a long time, the wireless IC card main body 1 transmits a signal to that effect to the wireless IC card reader / writer 2 at predetermined time intervals. Since the reader / writer 2 can know that the wireless IC card main body 1 is busy, the processing of the wireless IC card reader / writer 2 may be waited until the processing is completed.

書換対象データの書き換えが終了したら、書き換えが正常に行われたどうかを判定し(ステップS6)、書き換えが正常に行われた場合には、カウンタをインクリメントする(ステップS7)。そして、第2の記憶エリアに記憶された待避データは、この時点で不要になるので、消去される(ステップS8)。そして、第2の記憶エリアに記憶された待避データが正常に消去されたら(ステップS9のYes)、カウンタをリセット(I=0)し、処理を終了する。   When the rewriting of the data to be rewritten is completed, it is determined whether the rewriting has been normally performed (Step S6). If the rewriting has been performed normally, the counter is incremented (Step S7). Then, the saved data stored in the second storage area becomes unnecessary at this point, and is erased (step S8). When the saved data stored in the second storage area is normally erased (Yes in step S9), the counter is reset (I = 0), and the process ends.

なお、ステップS6において、書き換えが正常に行われなかった場合や、ステップS9において消去が正常に行われなかった場合には、そのまま処理を終了(又は中断)する。
上記のように、本実施形態では、カウンタのカウンタ値によりどの時点でエラーが発生したかを知ることができるようにしている。例えば、
(1)I=1:書換対象データの待避エラー
(2)I=2:書換対象データの書き換えエラー
(3)I=3:待避データの消去エラー
(4)I=0:正常終了
としている。無線ICカード本体1と無線ICカードリーダライタ2とを再接続した際に、無線ICカード本体1がこのカウンタ値を読み込んで、このカウンタ値に対応するエラーに対する処理を実行すれば良い。なお、上記のエラーのうち、待避データの消去エラーについては、データの書き換えが正常に行われたことを意味するので、図2におけるステップS6で処理が正常に終了したものと判断した時点で、無線ICカードリーダライタ2へ書換対象データの正常書き換えが終了した信号を送信することが好ましく、本実施形態でもそのように取り扱う。
If rewriting is not performed normally in step S6 or if erasing is not performed normally in step S9, the process is terminated (or interrupted) as it is.
As described above, in this embodiment, it is possible to know at which point an error has occurred based on the counter value of the counter. For example,
(1) I = 1: Save error of data to be rewritten
(2) I = 2: Rewrite error of rewrite target data
(3) I = 3: Erasing data erase error
(4) I = 0: Normal end
It is said. When the wireless IC card body 1 and the wireless IC card reader / writer 2 are reconnected, the wireless IC card body 1 may read the counter value and execute processing for an error corresponding to the counter value. Of the above errors, the evacuation data erasure error means that the data has been rewritten normally. Therefore, when it is determined in step S6 in FIG. It is preferable to transmit a signal indicating that the rewriting of the data to be rewritten is completed to the wireless IC card reader / writer 2, and this is handled in this embodiment as well.

図3を参照して、無線ICカード本体1と無線ICカードリーダライタ2とを再接続した際において、エラーが発生したことを検知した場合(すなわち、I≠0)の処理を、説明する。なお、I=0の場合は、正常終了しているので、通常の処理を行うことになるので、説明を省略する。なお、このエラー処理は、通信の無線ICカード本体1の動作が可能になった時点で実行されるものとし、無線ICカードリーダライタ2との通信の確立前に実行が開始されることが好ましい。   With reference to FIG. 3, a process when it is detected that an error has occurred when the wireless IC card body 1 and the wireless IC card reader / writer 2 are reconnected (that is, I ≠ 0) will be described. When I = 0, the process has been completed normally, and normal processing is performed. This error processing is executed when the operation of the wireless IC card main body 1 for communication becomes possible, and is preferably started before the communication with the wireless IC card reader / writer 2 is established. .

無線ICカード本体1は、前回の通信時において、書換対象データの書き換えが正常に終了したかどうかを判定する(ステップS21)。そして、そのエラーの状況により、下記のようなエラー処理を実行する。なお、下記のエラー処理の間に、無線ICカードリーダライタ2との相互認証を完了させておくことが好ましい。   The wireless IC card body 1 determines whether or not the rewriting of the rewriting target data has been normally completed during the previous communication (step S21). Then, depending on the error status, the following error processing is executed. It is preferable that the mutual authentication with the wireless IC card reader / writer 2 is completed during the following error processing.

ここで、書換対象データの待避時にエラーが発生した場合には(I=1)、書換対象データの書き換え前であるので、書換対象データに変更はされていない。従って、第2の記憶エリアに待避されたデータ(書換対象データの一部又は全部)が消去される(ステップS22)。   Here, if an error occurs when saving the rewrite target data (I = 1), the rewrite target data is not rewritten, and therefore the rewrite target data is not changed. Accordingly, the data saved in the second storage area (part or all of the rewrite target data) is deleted (step S22).

次に、書換対象データの書き換え時にエラーが発生した場合には(I=2)、実際に書換対象データの一部又は全部が書き換えられている可能性があるので、第2の記憶エリアに待避されたデータが第1の記憶エリアに書き戻される(ステップS23)。そして、無線ICカードリーダライタ2との相互認証の完了を待って、この結果が無線ICカードリーダライタ2に通知され(ステップS25)、更に例えば、その上位装置にその旨が通知される。このとき、処理経過のログにおいて、書き換えが正常終了したログが残されており、データの不一致がみられた場合には当該ログとデータが、書き換え前のデータに訂正される。これにより、無線ICカード本体1に記憶されたデータの不正な改ざんを防止できる。   Next, if an error occurs during rewriting of the data to be rewritten (I = 2), there is a possibility that part or all of the data to be rewritten has actually been rewritten, so it is saved in the second storage area. The written data is written back to the first storage area (step S23). Then, after the mutual authentication with the wireless IC card reader / writer 2 is completed, the result is notified to the wireless IC card reader / writer 2 (step S25), and further, for example, to the host device. At this time, in the process progress log, a log in which the rewriting has been normally completed is left, and when a data mismatch is found, the log and the data are corrected to the data before the rewriting. Thereby, unauthorized tampering of data stored in the wireless IC card main body 1 can be prevented.

また、書換対象データの書き換えまで正常に行われたが、待避データの消去を行う際にエラーが生じた場合には(I=3)、第1の記憶エリアのデータは正しく書き換えられたことを意味するので、第2の記憶エリアに記憶された待避データを消去するのみでよい(ステップS24)。なお、無線ICカード本体1と無線ICカードリーダライタ2とが通信可能な状態であるのに、頻繁にエラーが起きる場合には、無線ICカード本体1自体の故障などが考えられる。このため、無線ICカード本体1に電源が供給されなくなったことによるエラー以外のエラーについては、本発明の主旨とは異なるので、説明を省略する。   In addition, although the data to be rewritten has been normally rewritten, if an error occurs when deleting the save data (I = 3), the data in the first storage area has been rewritten correctly. This means that it is only necessary to delete the saved data stored in the second storage area (step S24). If the wireless IC card body 1 and the wireless IC card reader / writer 2 are communicable, but errors frequently occur, the wireless IC card body 1 itself may be broken. For this reason, errors other than the error caused by the fact that power is no longer supplied to the wireless IC card main body 1 are different from the gist of the present invention, and a description thereof will be omitted.

そして、このエラー処理の終了後、無線ICカード本体1は、取引をするための手順を最初から行う。このように、相互認証確立後に無線ICカードが、上位装置からのコマンドによらず、書換え異常のデータを以前の状態に復帰することで、時間の短縮とともに、常時、ネットワークなどで上位と接続して、その都度データ検証をすることなくデータを復帰できる。このため、システムの負担が軽減できる。また、無線ICカードが自らデータ修復ができるので、ある無線ICカードリーダライタで異常が発生した場合に、その後他の無線ICカードリーダライタにカードを翳しても以前のデータに修復した後に通信できる。なお、システムが常時上位と接続していない場合であっても、ある時間間隔でデータの監査機能を一般に持っているため、無線ICカード内のデータが正しいものであることの検証は可能である。このため、システムとしての破綻は生じない。また、不正にデータを書き換えられることを想定して、上位装置はカード内のデータは常にログを取ることで、データの一貫性は実現できる。   And after completion | finish of this error process, the radio | wireless IC card main body 1 performs the procedure for making a transaction from the beginning. In this way, after mutual authentication is established, the wireless IC card restores the rewrite error data to the previous state regardless of the command from the host device. Thus, data can be restored without performing data verification each time. For this reason, the burden on the system can be reduced. In addition, since the wireless IC card can restore data by itself, if an abnormality occurs in a certain wireless IC card reader / writer, communication can be performed after restoring the previous data even if the card is placed on another wireless IC card reader / writer. . Even when the system is not always connected to the host, it is possible to verify that the data in the wireless IC card is correct because it generally has a data audit function at certain time intervals. . For this reason, there is no system failure. In addition, assuming that data can be rewritten illegally, the host device can always log the data in the card, thereby realizing data consistency.

本発明は、上記各実施の形態に限ることなく、その他、実施段階ではその要旨を逸脱しない範囲で種々の変形を実施し得ることが可能である。さらに、上記各実施形態には、種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組合せにより種々の発明が抽出され得る。   The present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention at the stage of implementation. Further, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements.

例えば、上記の実施形態では、非接触の無線ICカードにおける退避処理について説明したが、本発明は上記の実施形態に限定されるものではない。例えば、無線ICカードリーダライタと接触してデータの書き換え処理を受ける接触型の無線ICカードにも、上記の退避処理を適用することができる。   For example, in the above embodiment, the evacuation process in the non-contact wireless IC card has been described, but the present invention is not limited to the above embodiment. For example, the above save process can be applied to a contact type wireless IC card that is in contact with a wireless IC card reader / writer and receives a data rewrite process.

また、上記の実施形態では、特定のコマンドの受信に対応して書き換えコマンドの受信を予測し退避処理を実行するケースについて説明したが、本発明はこの実施形態に限定されるものではない。例えば、特定の無線ICカードであって、必ず、書き換え処理が発生することが事前に分かっていれば、この特性の無線ICカードが無線ICカードリーダライタ2に対して近づき無線ICカードリーダライタ2からの供給電力が所定レベルに達した時点で、退避処理を実行するようにしてもよい。   In the above embodiment, a case has been described in which the reception of a rewrite command is predicted in response to the reception of a specific command and the save process is executed. However, the present invention is not limited to this embodiment. For example, if it is a specific wireless IC card and it is known in advance that rewrite processing will always occur, the wireless IC card of this characteristic approaches the wireless IC card reader / writer 2 and the wireless IC card reader / writer 2. The evacuation process may be executed when the power supplied from the battery reaches a predetermined level.

また、無線ICカードリーダライタ2により、無線ICカード本体1の退避領域を指定したり、変更したりすることもできる。更に、無線ICカードリーダライタ2により、無線ICカード本体1に対して退避処理のタイミングを指定することができる。つまり、初期化後や特定コマンド受信後に、退避処理を実行するように指定することができる。   Further, the save area of the wireless IC card main body 1 can be designated or changed by the wireless IC card reader / writer 2. Furthermore, the wireless IC card reader / writer 2 can designate the timing of the saving process for the wireless IC card main body 1. That is, it is possible to specify to execute the save process after initialization or after receiving a specific command.

また、上記の実施形態では、不揮発性メモリ104に、第1の記憶エリアと第2の記憶エリアを設けておき、書換対象データを第2の記憶エリアに待避するようにしたが、第1と第2の記憶エリアは、他のメモリで構成しても良い。更に、エラーの種類及び発生をカウンタでなく、例えば、各エラーの発生時期に対応したビットを設定しておき、ビット反転でエラーの発生の有無を検出しても良いし、エラーに応じたフラグを保持するようにしても良い。   In the above embodiment, the nonvolatile memory 104 is provided with the first storage area and the second storage area, and the data to be rewritten is saved in the second storage area. The second storage area may be composed of another memory. Furthermore, instead of using a counter for the type and occurrence of an error, for example, a bit corresponding to the time of occurrence of each error may be set, and the presence or absence of an error may be detected by bit inversion. May be held.

また、例えば各実施形態に示される全構成要件から幾つかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。   In addition, for example, even if some structural requirements are deleted from all the structural requirements shown in each embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the effect of the invention Can be obtained as an invention.

本発明の一実施形態に係る電子処理システムの概略構成を示す図である。It is a figure showing a schematic structure of an electronic processing system concerning one embodiment of the present invention. 無線ICカードの書換処理を示すフローチャートである。It is a flowchart which shows the rewriting process of a radio | wireless IC card. 無線ICカードの書換処理中に異常処理をした場合における無線ICカードの動作を示すフローチャートである。It is a flowchart which shows the operation | movement of a radio | wireless IC card when abnormality processing is performed during the rewriting process of a radio | wireless IC card.

符号の説明Explanation of symbols

1…ICカード本体
M…ICモジュール
2…ICカードリーダライタ
101…CPU
101…書換制御手段
102…ROM
103…RAM
104…不揮発性メモリ
105…データ入出力部
106…システムコントローラ
201…CPU
202…ROM
203…RAM
205…データ入出力部
206…システムコントローラ
DESCRIPTION OF SYMBOLS 1 ... IC card body M ... IC module 2 ... IC card reader / writer 101 ... CPU
101 ... rewrite control means 102 ... ROM
103 ... RAM
104 ... Nonvolatile memory 105 ... Data input / output unit 106 ... System controller 201 ... CPU
202 ... ROM
203 ... RAM
205 ... Data input / output unit 206 ... System controller

Claims (6)

外部装置と通信する通信手段と、
書き換え対象のデータを記憶する第1の記憶手段と、
前記第1の記憶手段に記憶された書き換え対象のデータの退避先として、この書き換え対象のデータを記憶する第2の記憶手段と、
前記第1の記憶手段に記憶されている書き換え対象のデータを前記第2の記憶手段へ退避させた後に、前記第1の記憶手段に記憶されている書き換え対象のデータを書き換える書換制御手段と、
前記書換制御手段による処理の状態を示す情報を記憶する第3の記憶手段と、
を具備し、
前記書換制御手段は、起動時に前記第3の記憶手段により記憶されている情報に基づいて前記退避が正常に完了したか否か判断し、前記書換が正常に完了したか否か判断し、前記退避が正常に完了し、且つ前記書換が正常に完了していなかった場合、第2の記憶手段に記憶されているデータを第1の記憶手段に書き込む、
ICカード。
A communication means for communicating with an external device;
First storage means for storing data to be rewritten;
A second storage means for storing the data to be rewritten as a save destination of the data to be rewritten stored in the first storage means;
Rewrite control means for rewriting data to be rewritten stored in the first storage means after saving the data to be rewritten stored in the first storage means to the second storage means;
Third storage means for storing information indicating the state of processing by the rewrite control means;
Comprising
The rewrite control means determines whether or not the evacuation is normally completed based on information stored in the third storage means at the time of activation, determines whether or not the rewrite is normally completed, and When the evacuation is normally completed and the rewriting is not normally completed, the data stored in the second storage unit is written in the first storage unit.
IC card.
前記書換制御手段による前記退避が正常に完了したか否か判断し、判断の結果に基づいて前記第3の記憶手段により記憶されている情報を書き換え、前記書換制御手段による前記書換が正常に完了したか否か判断し、判断の結果に基づいて前記第3の記憶手段により記憶されている情報を書き換えるように前記第3の記憶手段を制御する制御手段をさらに具備する、請求項1に記載のICカード。
It is determined whether or not the evacuation by the rewrite control unit is normally completed, and the information stored in the third storage unit is rewritten based on the determination result, and the rewrite by the rewrite control unit is normally completed. 2. The apparatus according to claim 1, further comprising a control unit that determines whether the third storage unit is rewritten based on a result of the determination and rewrites information stored in the third storage unit based on the determination result. IC card.
前記書換制御手段は、起動時に前記第3の記憶手段により記憶されている情報に基づいて前記退避が正常に完了したか否か判断し、前記退避が正常に完了していなかった場合、第2の記憶手段に記憶されているデータを消去する、請求項2に記載のICカード。
The rewrite control means determines whether or not the evacuation has been normally completed based on information stored in the third storage means at the time of activation, and if the evacuation has not been normally completed, The IC card according to claim 2, wherein data stored in said storage means is erased.
前記書換制御手段は、前記書換が正常に完了した場合、前記第2の記憶手段に記憶されているデータを消去し、
前記制御手段は、前記書換制御手段による前記消去が正常に完了したか否か判断し、判断の結果に基づいて前記第3の記憶手段により記憶されている情報を書き換え、
前記書換制御手段は、起動時に前記第3の記憶手段により記憶されている情報に基づいて前記退避及び前記書換が正常に完了したか否か判断し、前記消去が正常に完了したか否か判断し、前記退避が正常及び前記書換が正常に完了し、且つ前記消去が正常に完了していなかった場合、第2の記憶手段に記憶されているデータを消去する、
請求項3に記載のICカード。
The rewrite control means erases the data stored in the second storage means when the rewrite is normally completed,
The control means determines whether or not the erasure by the rewrite control means is normally completed, and rewrites information stored in the third storage means based on the determination result,
The rewrite control means determines whether or not the evacuation and the rewrite are normally completed based on information stored in the third storage means at the time of activation, and determines whether or not the erasure is normally completed If the evacuation is normal and the rewriting is normally completed and the erasure is not normally completed, the data stored in the second storage means is erased.
The IC card according to claim 3.
前記書換制御手段は、前記通信手段により受信したコマンドに基づいて相互認証を行なった場合、前記第1の記憶手段に記憶されている書き換え対象のデータの前記第2の記憶手段への退避を行う請求項2に記載のICカード。
The rewrite control means, when performing mutual authentication based on the command received by the communication means, saves the data to be rewritten stored in the first storage means to the second storage means The IC card according to claim 2.
前記第1の記憶手段と、前記第2の記憶手段と、前記書換制御手段と、前記第3の記憶手段と、前記制御手段とを備えたモジュールと、
このモジュールが埋設された本体と、
を具備する請求項2に記載のICカード。
A module comprising the first storage means, the second storage means, the rewrite control means, the third storage means, and the control means;
A body in which this module is embedded,
The IC card according to claim 2, comprising:
JP2006176698A 2006-06-27 2006-06-27 IC card Active JP4965909B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006176698A JP4965909B2 (en) 2006-06-27 2006-06-27 IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006176698A JP4965909B2 (en) 2006-06-27 2006-06-27 IC card

Publications (2)

Publication Number Publication Date
JP2008009521A JP2008009521A (en) 2008-01-17
JP4965909B2 true JP4965909B2 (en) 2012-07-04

Family

ID=39067712

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006176698A Active JP4965909B2 (en) 2006-06-27 2006-06-27 IC card

Country Status (1)

Country Link
JP (1) JP4965909B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5522718B2 (en) * 2009-07-31 2014-06-18 Necカシオモバイルコミュニケーションズ株式会社 Electronic device and program
JP6281302B2 (en) * 2014-01-31 2018-02-21 大日本印刷株式会社 Information processing apparatus, IC card, and data processing method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3593818B2 (en) * 1996-09-30 2004-11-24 株式会社日立製作所 Non-contact IC card
JP2004151963A (en) * 2002-10-30 2004-05-27 Nec Tokin Corp Ic card
JP2005258851A (en) * 2004-03-12 2005-09-22 Renesas Technology Corp Memory card
JP4476658B2 (en) * 2004-03-23 2010-06-09 株式会社東芝 Portable electronic device, electronic processing system, and electronic processing method

Also Published As

Publication number Publication date
JP2008009521A (en) 2008-01-17

Similar Documents

Publication Publication Date Title
JP4768237B2 (en) Portable electronic device and method for controlling portable electronic device
KR101197556B1 (en) Device and method capable of verifying program operation of non-volatile memory and memory card including the same
JP2842750B2 (en) IC card
JP4896837B2 (en) Portable electronic device and method for controlling portable electronic device
KR101783526B1 (en) Ic card, electronic device and portable electronic device
CN101187912A (en) Memory card system and method transmitting host identification information thereof
JP4965909B2 (en) IC card
WO2006051692A1 (en) Nonvolatile memory system
JP5754287B2 (en) IC chip, processing method in IC chip, UIM, portable terminal, and processing program for IC chip
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
JP4476658B2 (en) Portable electronic device, electronic processing system, and electronic processing method
JP4713878B2 (en) Portable electronic device
JP6233134B2 (en) Electronic information storage medium, information processing method, and information processing program
EP3379424B1 (en) Ic card, portable electronic device, program, processing apparatus, and processing system
JP2006293706A (en) Multi-application ic card with application updating function
JP5341947B2 (en) IC card, control method of IC card, and control method of portable electronic device
WO2013021423A1 (en) Reprogramming system and reprogramming method
JP5092370B2 (en) Portable information recording medium and program thereof
JP2008305263A (en) Nonvolatile semiconductor storage device and memory management method
JP4645883B2 (en) Semiconductor integrated circuit, data storage method, and data communication apparatus
JP6281302B2 (en) Information processing apparatus, IC card, and data processing method
JP2022178821A (en) Secure element, and transaction control method and device
JP2007265496A (en) Ic card, and data managing method of nonvolatile memory
JP2005338924A (en) Nonvolatile memory to be used for portable electronic equipment and portable electronic equipment
JP2004118976A (en) Method of controlling flash memory writing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110728

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110823

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111024

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111220

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120220

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120330

R151 Written notification of patent or utility model registration

Ref document number: 4965909

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20150406

Year of fee payment: 3