JP6281302B2 - Information processing apparatus, IC card, and data processing method - Google Patents

Information processing apparatus, IC card, and data processing method Download PDF

Info

Publication number
JP6281302B2
JP6281302B2 JP2014017757A JP2014017757A JP6281302B2 JP 6281302 B2 JP6281302 B2 JP 6281302B2 JP 2014017757 A JP2014017757 A JP 2014017757A JP 2014017757 A JP2014017757 A JP 2014017757A JP 6281302 B2 JP6281302 B2 JP 6281302B2
Authority
JP
Japan
Prior art keywords
area
data
command
rewriting
processing
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
JP2014017757A
Other languages
Japanese (ja)
Other versions
JP2015146071A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2014017757A priority Critical patent/JP6281302B2/en
Publication of JP2015146071A publication Critical patent/JP2015146071A/en
Application granted granted Critical
Publication of JP6281302B2 publication Critical patent/JP6281302B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Description

本発明は、外部機器との間で通信可能なICカードの技術分野に関する。   The present invention relates to the technical field of an IC card that can communicate with an external device.

一般に、ICカードは外部機器(例えば、ICカードリーダライタ)からのデータ書き換えコマンドと書き換えデータを受信すると、ICカードのCPUあるいはシーケンサによる書き換え処理手続きを経て、不揮発性メモリのデータを書き換える。ICカードに内蔵される不揮発性メモリの書き換えには、数ミリ秒の時間が必要である。ICカードのCPUあるいはシーケンサは、書き換え終了までに必要な時間あるいは書き換え終了を示す信号を受信した後、書き換えたデータをベリファイし、書き換え結果の正常/異常を外部機器へ返信する。   In general, when an IC card receives a data rewrite command and rewrite data from an external device (for example, an IC card reader / writer), it rewrites data in a nonvolatile memory through a rewrite processing procedure by the CPU or sequencer of the IC card. To rewrite the nonvolatile memory built in the IC card, several milliseconds are required. The CPU or sequencer of the IC card receives a signal indicating the time required for completion of rewriting or completion of rewriting, verifies the rewritten data, and returns normality / abnormality of the rewriting result to the external device.

一般的なICカードには偽造や鍵漏洩を防止するためのプログラムやセンサーが組み込まれているため、使用している最中に発生した物理的な衝撃や信号ノイズによって動作が中断する場合がある。接触式ICカードは、外部機器の電極から電源を供給され、電極を通じて信号を送受信しているため、電極の接点不良や電極に印加されるノイズが動作停止の原因となる。また、非接触式ICカードは外部機器(例えば、無線ICカードリーダライタ)に近づくことにより、磁界をエネルギーとして無結線状態で動作する。このため、非接触式ICカードは、外部機器から離れて、動作に必要なエネルギーの供給を受けなくなると動作が途中で中断する。書き込み処理が停止すると、書き込み途中であったメモリ上のデータの信頼性が損なわれるため、以降に継続してICカードを使用することが不可能になってしまう。   Since general IC cards have programs and sensors for preventing counterfeiting and key leakage, operations may be interrupted by physical shock or signal noise that occurs during use. . Since the contact IC card is supplied with power from an electrode of an external device and transmits / receives a signal through the electrode, the contact failure of the electrode and noise applied to the electrode cause the operation to stop. Further, the non-contact type IC card operates in a non-wired state using a magnetic field as energy by approaching an external device (for example, a wireless IC card reader / writer). For this reason, the operation of the non-contact type IC card is interrupted when it is separated from the external device and is not supplied with the energy necessary for the operation. When the writing process is stopped, the reliability of the data on the memory in the middle of writing is impaired, and it becomes impossible to continue using the IC card thereafter.

特許文献1に開示されたICカードでは、書き換え処理を実施する際に、書き換え対象領域のデータを退避させた後に、書き換え処理を実行し、書き換え処理が正常に終了しなかった場合には、動作可能となった時点で、書き換え対象領域を退避データによって書き戻し、退避していたデータを消去することにより、データの信頼性を保持している。   In the IC card disclosed in Patent Document 1, when the rewriting process is performed, the rewriting process is executed after the data in the rewriting target area is saved, and the rewriting process is not completed normally. When it becomes possible, the reliability of the data is maintained by rewriting the area to be rewritten with the saved data and erasing the saved data.

特開2008−9521号公報Japanese Patent Laid-Open No. 2008-9521

ところが、ICカード等の国際規格ISO/IEC 7816-3及びISO/IEC 14443-3 では、ICカードが起動されてから初期応答情報を返さなければならない時間が規定されており、この規定時間内に初期応答情報を返信しなければ、ICカードは外部機器との通信を確立することができない。そのため、書き戻しデータが少量であれば、特許文献1に開示されたICカードのように、動作可能となった時点において書き戻し処理を実行する方式は有効であるが、書き戻しデータがある一定量を超えると、国際規格に規定されている制限時間を超えてしまうため、ICカードが外部機器との通信を確立することができなくなる。   However, the international standards ISO / IEC 7816-3 and ISO / IEC 14443-3 for IC cards, etc. stipulate the time that the initial response information must be returned after the IC card is activated. Unless the initial response information is returned, the IC card cannot establish communication with the external device. Therefore, if the amount of write-back data is small, a method of executing the write-back processing at the time when the operation becomes possible, as in the IC card disclosed in Patent Document 1, is effective, but there is a certain amount of write-back data. If the amount is exceeded, the time limit defined in the international standard will be exceeded, so that the IC card cannot establish communication with the external device.

特に、トランザクションの概念を実現する場合には、複数のデータが同時に更新された状態になるか、あるいは更新されていなかった状態にならなければならないため、メモリ容量が少ないICカードと言えども、容易に制限時間を超えてしまうという問題があった。   In particular, when the concept of transaction is realized, it is easy even for an IC card with a small memory capacity because a plurality of data must be updated or not updated at the same time. There was a problem that the time limit was exceeded.

そこで、本発明は、ICカードのデータ書き換えの際に異常が生じたとしても、データを修復し、かつ国際規格に規定された初期応答情報を返信すべき制限時間を守ることが可能な情報処理装置及びデータ処理方法を提供することを目的とする。   Therefore, the present invention provides an information processing that can restore data and keep the time limit for returning the initial response information stipulated in the international standard, even if an abnormality occurs during the data rewriting of the IC card. An object is to provide an apparatus and a data processing method.

上記課題を解決するために、請求項1に記載の発明は、外部機器との間で通信可能な情報処理装置であって、メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換手段と、前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信手段と、前記リセット受信手段により受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答手段と、前記応答手段による応答後に、前記外部機器からコマンドを受信するコマンド受信手段と、前記コマンド受信手段により受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理手段と、を備え、前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とする。   In order to solve the above-described problem, an invention according to claim 1 is an information processing apparatus capable of communicating with an external device, and is a data rewriting unit that executes a data rewriting process in a rewrite target area of a memory. The rewriting process for rewriting the data in the rewrite target area after the data in the rewrite target area is written in a different area from the rewrite target area, and after the write data is written in a different area from the rewrite target area. The rewrite process for rewriting data in the rewrite target area with write data, or the rewrite process for changing the area where the write data is written to the rewrite target area after writing the write data in a different area from the rewrite target area Data rewriting means for executing A reset receiving unit for receiving a reset signal from the external device, a response unit for responding to the external device with initial response information for the reset signal received by the reset receiving unit, and a response unit, Command response means for receiving a command from the external device after the response by the command processing, command processing according to the command received by the command receiving means, and command processing for transmitting the processing result of the command processing to the external device And when the rewrite processing is not normally completed, the command processing means is provided in a region different from the rewrite target region between the reception of the command and the transmission of the processing result. Erasing process of the written data, an area different from the area to be rewritten The write operation to the rewriting target area of the data written, or and executes the area change processing for changing the different areas in the rewritable region of interest and the rewriting target area.

請求項2に記載の発明は、請求項1に記載の情報処理装置において、前記書き換え処理が正常に終了しなかった場合において、前記コマンドが前記応答後に最初に受信されたコマンドである場合に、前記コマンド処理手段は、前記消去処理、書き込み処理、または領域変更処理を実行することを特徴とする。   According to a second aspect of the present invention, in the information processing apparatus according to the first aspect, when the rewriting process does not end normally and the command is a command first received after the response, The command processing means executes the erasing process, the writing process, or the area changing process.

請求項3に記載の発明は、請求項1または2に記載の情報処理装置において、前記消去処理、書き込み処理、または領域変更処理と、前記コマンド処理とに要する処理時間が、予め設定された時間を超える場合に、前記外部機器に対して待ち時間の延長要求を送信する延長要求送信手段を更に備えることを特徴とする。   According to a third aspect of the present invention, in the information processing apparatus according to the first or second aspect, a processing time required for the erasing process, the writing process, or the area changing process and the command process is a preset time. When the number exceeds, an extension request transmission means for transmitting an extension request for waiting time to the external device is further provided.

請求項4に記載の発明は、請求項1乃至3の何れか一項に記載の情報処理装置において、前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信後、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行した後に、前記コマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信することを特徴とする。請求項5に記載の発明は、外部機器との間で通信可能なICカードであって、メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換手段と、前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信手段と、前記リセット受信手段により受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答手段と、前記応答手段による応答後に、前記外部機器からコマンドを受信するコマンド受信手段と、前記コマンド受信手段により受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理手段と、を備え、前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とする。請求項6に記載の発明は、外部機器との間で通信可能な情報処理装置に含まれるコンピュータにより実行されるデータ処理方法であって、メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換ステップと、前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信ステップと、前記リセット受信ステップにより受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答ステップと、前記応答ステップによる応答後に、前記外部機器からコマンドを受信するコマンド受信ステップと、前記コマンド受信ステップにより受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理ステップと、を含み、前記コマンド処理ステップにおいては、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とする。 According to a fourth aspect of the present invention, in the information processing apparatus according to any one of the first to third aspects, the command processing unit receives the command when the rewriting process is not completed normally. Thereafter, the erasing process of the data written in an area different from the rewriting target area, the writing process of the data written in an area different from the rewriting target area, or the rewriting target area and After executing a region change process for changing a different region to the rewrite target region, a command process corresponding to the command is executed, and a processing result of the command process is transmitted to the external device. The invention according to claim 5 is an IC card that can communicate with an external device, and is a data rewriting means for executing a data rewriting process in a rewrite target area of a memory, wherein the data in the rewrite target area The rewrite processing for rewriting data in the rewrite target area after writing the data in a different area from the rewrite target area, and writing the write data in the area different from the rewrite target area and then writing the data in the rewrite target area by the write data Data rewriting means for executing the rewriting process for rewriting, or writing the write data in an area different from the area to be rewritten and changing the area in which the write data is written to the area to be rewritten, and If the rewrite process does not end normally Reset receiving means for receiving a reset signal from the external device, response means for responding initial response information to the reset signal received by the reset receiving means to the external device, and after the response by the response means, Command receiving means for receiving a command from the device, command processing means for executing command processing according to the command received by the command receiving means, and transmitting the processing result of the command processing to the external device, The command processing means, when the rewriting process is not completed normally, between the reception of the command and the transmission of the processing result, the data of the data written in an area different from the rewriting target area. Erase processing, before the data written in an area different from the area to be rewritten Writing to the rewriting target area, or and executes the area change processing for changing the different areas in the rewritable region of interest and the rewriting target area. The invention according to claim 6 is a data processing method executed by a computer included in an information processing apparatus capable of communicating with an external device, and performs data rewriting processing of data in a memory rewriting target area. Rewriting means, the rewriting process for rewriting the data in the rewrite target area after the data in the rewrite target area is written in a different area from the rewrite target area, and writing the write data in a different area from the rewrite target area. After that, the rewrite processing for rewriting the data in the rewrite target area with the write data, or the area where the write data is written is changed to the rewrite target area after the write data is written in a different area from the rewrite target area. Data rewriting that executes the rewriting process And a reset reception step for receiving a reset signal from the external device when the rewrite processing is not normally completed, and initial response information for the reset signal received by the reset reception step is returned to the external device. A response step, a command reception step for receiving a command from the external device after a response by the response step, and a command process corresponding to the command received by the command reception step, and executing a process result of the command process A command processing step for transmitting to the external device, and in the command processing step, when the rewrite processing is not completed normally, until the processing result is transmitted after receiving the command, An area different from the area to be rewritten Erasing process of the written data, writing process of the data written in an area different from the rewrite target area, or changing an area different from the rewrite target area to the rewrite target area An area change process is executed.

本発明によれば、ICカードのデータ書き換えの際に異常が生じたとしても、データを修復し、かつ国際規格に規定された初期応答情報を返信すべき制限時間を守ることができる。   According to the present invention, even if an abnormality occurs during data rewriting of an IC card, the time limit for restoring data and returning the initial response information defined in the international standard can be maintained.

ICカード1の概要構成例を示す図である。1 is a diagram illustrating a schematic configuration example of an IC card 1. FIG. CPU11の書き換え処理の一例を示すフローチャートである。It is a flowchart which shows an example of the rewriting process of CPU11. ICカード1の起動時(再起動時)におけるCPU11の処理の一例を示すフローチャートである。3 is a flowchart showing an example of processing of a CPU 11 when the IC card 1 is activated (reactivated). コマンドの受信から処理結果の送信までにおける処理の流れを示すシーケンス図である。It is a sequence diagram which shows the flow of a process from reception of a command to transmission of a processing result.

以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、ICカードに対して本発明を適用した場合の実施の形態である。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC card.

先ず、図1を参照して、本実施形態に係るICカードの構成及び機能等について説明する。図1は、ICカード1の概要構成例を示す図である。ICカード1は、金融、通信、交通等の様々な分野で用いられるICカードの他、携帯電話機やスマートホン等の携帯端末に搭載されるICカードとして適用可能である。ICカード1は、リーダライタ2(外部機器の一例)との間で通信可能になっている。   First, with reference to FIG. 1, the configuration and functions of the IC card according to the present embodiment will be described. FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. The IC card 1 can be applied as an IC card mounted on a portable terminal such as a mobile phone or a smart phone, in addition to an IC card used in various fields such as finance, communication, and traffic. The IC card 1 can communicate with a reader / writer 2 (an example of an external device).

ICカード1に搭載されるICチップC(本発明の情報処理装置の一例)は、図1に示すように、CPU(Central Processing Unit)11、ROM(Read Only Memory)12、RAM(Random Access Memory)13、不揮発性メモリ14、及びI/O回路15等を備えている。不揮発性メモリ14は、例えばフラッシュメモリであるが、EEPROMであってもよい。I/O回路15は、ISO/IEC7816等によって定められた、C1〜C8の8個の端子を有する。ここで、C1端子は電源端子(VCC)であり、C5端子はグランド端子(GND)である。また、C2端子は、リセット端子(RST)であり、リーダライタ2からリセット信号を入力するために用いられる。また、C3端子は、クロック端子(CLK)であり、クロック信号を入力するために用いられる。C7端子は、リーダライタ2との間の通信のために用いられる。なお、この例では、接触式のICカードの例を示したが、外部機器に近づくことにより、磁界をエネルギーとして無結線状態で電源供給され(電圧印加され)、動作する非接触式ICカードであってもよい。   As shown in FIG. 1, an IC chip C (an example of an information processing apparatus of the present invention) mounted on an IC card 1 includes a CPU (Central Processing Unit) 11, a ROM (Read Only Memory) 12, a RAM (Random Access Memory). ) 13, a nonvolatile memory 14, an I / O circuit 15 and the like. The nonvolatile memory 14 is, for example, a flash memory, but may be an EEPROM. The I / O circuit 15 has eight terminals C1 to C8 defined by ISO / IEC7816 or the like. Here, the C1 terminal is a power supply terminal (VCC), and the C5 terminal is a ground terminal (GND). The C2 terminal is a reset terminal (RST) and is used for inputting a reset signal from the reader / writer 2. The C3 terminal is a clock terminal (CLK) and is used to input a clock signal. The C7 terminal is used for communication with the reader / writer 2. In this example, an example of a contact type IC card is shown. However, by approaching an external device, a non-contact type IC card is operated by being supplied with power (voltage applied) in a non-wired state using a magnetic field as energy. There may be.

ROM12又は不揮発性メモリ14は、オペレーティングシステム、及び各種アプリケーションプログラムが記憶される。また、不揮発性メモリ14には、書き換え対象領域と、書き換え対象領域とは異なる領域とが含まれる。書き換え対象領域には、データが記憶される。書き換え対象領域とは異なる領域には、上記データの退避先として当該データが記憶される退避領域が含まれる。なお、書き換え対象領域とは異なる領域には、退避領域以外の領域も存在するが、説明を省略する。RAM13には、退避領域に退避されるデータ等が一時的に記憶される。   The ROM 12 or the nonvolatile memory 14 stores an operating system and various application programs. The nonvolatile memory 14 includes a rewrite target area and a different area from the rewrite target area. Data is stored in the rewrite target area. The area different from the rewrite target area includes a save area in which the data is stored as the save destination of the data. Note that there is an area other than the save area in the area different from the rewrite target area, but the description is omitted. The RAM 13 temporarily stores data saved in the save area.

CPU11は、上記オペレーティングシステム及び各種アプリケーションプログラムを実行することで、本発明におけるデータ書換手段、リセット受信手段、応答手段、コマンド処理手段、及び延長要求送信手段として機能する。これにより、CPU11は、リーダライタ2からI/O回路15を介してリセット信号を受信すると、当該受信されたリセット信号に対する初期応答情報をリーダライタ2へ応答する。そして、CPU11は、上記応答後に、リーダライタ2からI/O回路15を介してコマンドを受信すると、当該受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果をリーダライタ2へ送信する。また、例えば、上記コマンドが書き換えコマンドであった場合、上記コマンド処理において、CPU11は、書き換え対象領域のデータ(つまり、既に書き込まれているデータ)を退避領域に退避させた後(つまり、書き込み完了後)後に当該データを書き換える書き換え処理(いわゆるロールバック方式の一例)を実行する。または、CPU11は、書き込みデータ(つまり、新たに書き込まれるデータ)を書き換え対象領域とは異なる領域(一時的な領域)に書き込んだ後(つまり、書き込み完了後)に、書き込みデータにより書き換え対象領域(本領域)のデータを書き換える(つまり、更新する)書き換え処理(いわゆるロールフォワード方式の一例)を実行する。または、CPU11は、書き込みデータを書き換え対象領域(本領域)とは異なる領域(一時的な領域)に書き込んだ後に当該書き込みデータが書き込まれた領域を書き換え対象領域に変更(当該一時的な領域を本領域に変更するようにアドレス変更)する書き換え処理(いわゆるロールフォワード方式の他の例)を実行する。   The CPU 11 functions as data rewrite means, reset reception means, response means, command processing means, and extension request transmission means in the present invention by executing the operating system and various application programs. Thus, when the CPU 11 receives a reset signal from the reader / writer 2 via the I / O circuit 15, the CPU 11 responds to the reader / writer 2 with initial response information for the received reset signal. When the CPU 11 receives a command from the reader / writer 2 via the I / O circuit 15 after the response, the CPU 11 executes command processing according to the received command, and displays the processing result of the command processing as the reader / writer 2. Send to. For example, when the command is a rewrite command, in the command processing, the CPU 11 saves the data in the rewrite target area (that is, already written data) in the save area (that is, completes the writing). Later) A rewriting process (an example of a so-called rollback method) for rewriting the data later is executed. Alternatively, the CPU 11 writes the write data (that is, newly written data) in an area (temporary area) that is different from the area to be rewritten (that is, after the completion of writing), and then writes the area to be rewritten by the write data ( A rewriting process (an example of a so-called roll forward method) for rewriting (that is, updating) data in this area) is executed. Alternatively, the CPU 11 writes the write data in a region (temporary region) different from the rewrite target region (main region) and then changes the region where the write data is written to the rewrite target region (the temporary region is changed). A rewrite process (another example of a so-called roll forward method) is executed to change the address so as to change to this area.

そして、CPU11は、書き換え処理中に、例えば不揮発性メモリ14の故障や不具合等が発生することにより、書き換え処理が正常に終了しなかった場合、再起動により、再び、リーダライタ2からリセット信号を受信して、当該受信されたリセット信号に対する初期応答情報をリーダライタ2へ応答し、上記応答後に、リーダライタ2からコマンドを受信することになるが、この場合、CPU11は、当該コマンドの受信から当該コマンドに応じたコマンド処理の処理結果を送信するまでの間に、上記退避領域に退避された上記データの消去処理、または退避領域に退避された上記データの書き換え対象領域への書き戻し処理(書き込み処理)を実行する。或いは、CPU11は、当該コマンドの受信から当該コマンドに応じたコマンド処理の処理結果を送信するまでの間に、上記一時的な領域に書き込まれた書き込みデータの消去処理、上記一時的な領域に書き込まれた書き込みデータの書き換え対象領域(本領域)への書き込み処理(つまり、一時的な領域の内容を使用して更新を実施)、または上記一時的な領域を書き換え対象領域(本領域)に変更する領域変更処理を実行する。つまり、消去処理、書き込み処理(例えば、書き戻し処理など)、または領域変更処理は、起動直後に実行されるのではなく、起動してから受信されたコマンド(例えば最初に受信されたコマンド)に応じたコマンド処理が実行される直前または直後に実行される。   When the rewrite process does not end normally due to, for example, a failure or malfunction of the nonvolatile memory 14 during the rewrite process, the CPU 11 restarts the reset signal from the reader / writer 2 again. In response, the initial response information for the received reset signal is returned to the reader / writer 2, and after the response, a command is received from the reader / writer 2. In this case, the CPU 11 receives the command from the reception of the command. Before the processing result of the command processing corresponding to the command is transmitted, the data saved in the save area is erased or the data saved in the save area is written back to the rewrite target area ( Write process). Alternatively, the CPU 11 erases the write data written in the temporary area and writes it in the temporary area from when the command is received until the command processing result corresponding to the command is transmitted. Process to write the written data to the rewrite target area (this area) (that is, update using the contents of the temporary area), or change the temporary area to the rewrite target area (this area) Execute area change processing. In other words, the erasure process, the write process (for example, the write back process), or the area change process is not executed immediately after activation, but instead of the command received after activation (for example, the first received command). It is executed immediately before or after the corresponding command processing is executed.

従来一般に、コンピュータにおけるスタートアップチェックは、起動時(電源投入時)に全ての項目(RAMやI/O等チェック)が行われ、正常であれば、アイドル状態に移行してコマンド受付可能状態となるが、本実施形態では、消去処理、書き込み処理(例えば、書き戻し処理)、または領域変更処理に限っては起動時に実行されるのではなく(RAMやI/O等チェック等のスタートアップチェックは従来と同様、起動時に行われる)、起動してから受信されたコマンドに応じたコマンド処理が実行される直前または直後に実行されるように構成した。そのため、ICカード1のデータ書き換えの際に異常が生じたとしても、データを修復し、かつ国際規格に規定された初期応答情報を返信すべき制限時間を守ることが可能となる。ただし、この構成では、例えば書き戻しデータがある一定量を超えると、コマンド処理の実行中に処理時間が国際規格ISO/IEC 7816-3及びISO/IEC 14443-3に規定されている待ち時間(ブロック待ち時間)を超える場合がありうる。したがって、待ち時間を超えると予想された場合、つまり、上記消去処理、書き込み処理(例えば、書き戻し処理)、または領域変更処理とコマンド処理とに要する処理時間が、予め設定された時間を超える場合には、CPU11は、リーダライタ2に対して待ち時間の延長要求を送信する。この待ち時間の延長要求は、国際規格で定められている。リーダライタ2は、待ち時間の延長要求を判断し、これに応じたことを示す結果をICカード1へ返信する。これにより、CPU11は、上記消去処理、書き込み処理(例えば、書き戻し処理)、または領域変更処理とコマンド処理とが完了するまで、必要に応じて、待ち時間の延長要求を送出しながら処理を実行することになる。   Conventionally, in general, a startup check in a computer has all items (checks such as RAM and I / O) performed at startup (when the power is turned on), and if normal, shifts to an idle state and enters a command reception enabled state. However, in the present embodiment, the erasure process, the write process (for example, the write back process), or the area change process is not executed at the time of startup (a startup check such as a RAM or I / O check is conventionally performed). As is the case with the above, it is performed at the time of startup), and is configured to be executed immediately before or after the command processing corresponding to the command received after the startup is executed. Therefore, even if an abnormality occurs during data rewriting of the IC card 1, it is possible to restore the data and keep the time limit for returning the initial response information defined in the international standard. However, in this configuration, for example, when the write-back data exceeds a certain amount, the processing time during execution of command processing is a waiting time (specified in international standards ISO / IEC 7816-3 and ISO / IEC 14443-3 ( Block waiting time). Therefore, when it is predicted that the waiting time will be exceeded, that is, when the processing time required for the erasing process, the writing process (for example, the writing back process), or the area changing process and the command process exceeds a preset time. The CPU 11 transmits a request for extending the waiting time to the reader / writer 2. This request for extending the waiting time is defined by international standards. The reader / writer 2 determines a request for extending the waiting time, and returns a result indicating that it has responded to the IC card 1. As a result, the CPU 11 executes the process while sending a request for extending the waiting time as necessary until the erasure process, the write process (for example, the write back process), or the area change process and the command process are completed. Will do.

次に、図2を参照して、本実施形態に係るICカード1におけるCPU11の書き換え処理について説明する。図2は、CPU11の書き換え処理の一例を示すフローチャートである。図2に示す処理は、例えば書き換えコマンドが受信された場合に開始される。図2に示す処理が開始すると、CPU11は、カウンターを初期化(例えば“1”にセット)する(ステップS1)。次いで、CPU11は、書き換え対象領域のデータを退避領域に退避させる(ステップS2)。次いで、CPU11は、退避領域への退避が正常に終了したか否かを判定する(ステップS3)。そして、退避領域への退避が正常に終了したと判定された場合(ステップS3:YES)、ステップS4へ進む。一方、不揮発性メモリ14の故障や不具合等により、退避領域への退避が正常に終了しないと判定された場合(ステップS3:NO)、図2に示す処理が終了し、コマンド処理を終了させることになる。なお、コマンド処理の終了にあたっては、CPU11は、カウンターの値に応じてステータスワードを応答する。例えば、カウンターが“0”の場合、CPU11は、正常終了を示すステータスワードを応答する。一方、カウンターが“0”以外の場合、CPU11は、エラーを示すステータスワードを応答する。   Next, with reference to FIG. 2, the rewriting process of the CPU 11 in the IC card 1 according to the present embodiment will be described. FIG. 2 is a flowchart illustrating an example of the rewriting process of the CPU 11. The process shown in FIG. 2 is started when a rewrite command is received, for example. When the process shown in FIG. 2 starts, the CPU 11 initializes a counter (for example, sets it to “1”) (step S1). Next, the CPU 11 saves the data in the rewrite target area in the save area (step S2). Next, the CPU 11 determines whether or not the saving to the saving area has been normally completed (step S3). When it is determined that the saving to the saving area has been normally completed (step S3: YES), the process proceeds to step S4. On the other hand, when it is determined that the saving to the saving area does not end normally due to a failure or malfunction of the nonvolatile memory 14 (step S3: NO), the processing shown in FIG. 2 is ended and the command processing is ended. become. At the end of command processing, the CPU 11 responds with a status word according to the value of the counter. For example, when the counter is “0”, the CPU 11 responds with a status word indicating normal termination. On the other hand, when the counter is other than “0”, the CPU 11 responds with a status word indicating an error.

ステップS4では、CPU11は、カウンターを加算(例えば“1”を加算)する。次いで、CPU11は、書き換え対象領域のデータを書き換える(ステップS5)。次いで、CPU11は、書き換え対象領域のデータの書き換えが正常に終了したか否かを判定する(ステップS6)。そして、書き換え対象領域のデータの書き換えが正常に終了したと判定された場合(ステップS6:YES)、ステップS7へ進む。一方、不揮発性メモリ14の故障や不具合等により、書き換え対象領域のデータの書き換えが正常に終了しないと判定された場合(ステップS6:NO)、図2に示す処理が終了し、コマンド処理を終了させることになる。   In step S4, the CPU 11 adds a counter (for example, “1” is added). Next, the CPU 11 rewrites the data in the rewrite target area (step S5). Next, the CPU 11 determines whether or not the rewriting of the data in the rewriting target area has been normally completed (step S6). If it is determined that the rewriting of the data in the rewriting target area has been normally completed (step S6: YES), the process proceeds to step S7. On the other hand, when it is determined that the rewriting of the data in the rewriting target area does not end normally due to a failure or malfunction of the non-volatile memory 14 (step S6: NO), the processing shown in FIG. 2 ends and the command processing ends. I will let you.

ステップS7では、CPU11は、カウンターを加算(例えば“1”を加算)する。次いで、CPU11は、退避領域に退避されたデータを消去する(ステップS8)。次いで、CPU11は、データの消去が正常に終了したか否かを判定する(ステップS9)。そして、データの消去が正常に終了したと判定された場合(ステップS9:YES)、カウンターがリセット(例えば“0”にリセット)され(ステップS10)、図2に示す処理が終了する。一方、不揮発性メモリ14の故障や不具合等により、データの消去が正常に終了しないと判定された場合(ステップS9:NO)、図2に示す処理が終了し、コマンド処理を終了させることになる。   In step S7, the CPU 11 adds a counter (for example, “1” is added). Next, the CPU 11 erases the data saved in the save area (step S8). Next, the CPU 11 determines whether or not the data erasure has ended normally (step S9). If it is determined that the data erasure has been normally completed (step S9: YES), the counter is reset (for example, reset to “0”) (step S10), and the process shown in FIG. On the other hand, if it is determined that data erasure does not end normally due to a failure or malfunction of the non-volatile memory 14 (step S9: NO), the processing shown in FIG. 2 ends and the command processing ends. .

次に、図3を参照して、本実施形態に係るICカード1の起動時(再起動時)の処理について説明する。図3は、ICカード1の起動時(再起動時)におけるCPU11の処理の一例を示すフローチャートである。   Next, with reference to FIG. 3, processing when the IC card 1 according to the present embodiment is started (when restarted) will be described. FIG. 3 is a flowchart illustrating an example of processing of the CPU 11 when the IC card 1 is activated (rebooted).

図2に示す書き換え処理が正常に終了しなかった場合(電源遮断が発生した場合を含む)において、再起動により図3が開始されると、CPU11は、リーダライタ2から送信されたリセット信号を受信する(ステップS11)。次いで、第1コマンド受信情報を初期化(例えば“0”にセット)する(ステップS12)。次いで、CPU11は、ステップS11で受信されたリセット信号に対する初期応答情報をリーダライタ2へ応答(送信)し(ステップS13)、コマンド受信待ち状態となる(ステップS14)。そして、CPU11は、リーダライタ2から送信されたコマンドを受信した場合(ステップS15)、第1コマンド受信情報が初期化された値(例えば“0”)であるか否かを判定する(ステップS16)。そして、第1コマンド受信情報が初期化された値(例えば“0”)であると判定された場合(ステップS16:YES)、つまり、ステップS15で受信されたコマンドが再起動後に最初に受信されたコマンド(第1コマンド)である場合、ステップS17へ進む。これにより、最初に受信されたコマンド(第1コマンド)の場合に、上記消去処理又は書き戻し処理が実行されるので、データを迅速に修復し、その後は不要となった処理(消去処理または書き戻し処理)を省略することができる。一方、第1コマンド受信情報が初期化された値(例えば“0”)でないと判定された場合(ステップS16:NO)、ステップS21へ進む。   When the rewriting process shown in FIG. 2 does not end normally (including when the power is shut down), when FIG. 3 is started by restart, the CPU 11 receives the reset signal transmitted from the reader / writer 2. Receive (step S11). Next, the first command reception information is initialized (for example, set to “0”) (step S12). Next, the CPU 11 responds (transmits) the initial response information to the reset signal received in step S11 to the reader / writer 2 (step S13), and enters a command reception waiting state (step S14). Then, when receiving a command transmitted from the reader / writer 2 (step S15), the CPU 11 determines whether or not the first command reception information is an initialized value (eg, “0”) (step S16). ). If it is determined that the first command reception information is an initialized value (for example, “0”) (step S16: YES), that is, the command received in step S15 is first received after the restart. If the received command is the first command, the process proceeds to step S17. As a result, in the case of the first received command (first command), the erasure process or the write-back process is executed, so that the data is quickly repaired, and then the process (erasure process or write process) that is no longer necessary. (Return processing) can be omitted. On the other hand, when it is determined that the first command reception information is not an initialized value (for example, “0”) (step S16: NO), the process proceeds to step S21.

ステップS17では、CPU11は、カウンター値を判定する。そして、CPU11は、カウンター値が“1”又は“3”であると判定した場合、上記退避領域に退避されたデータを消去(削除)し(ステップS18)、ステップS20へ進む。一方、CPU11は、カウンター値が“2”であると判定した場合、退避領域に退避されたデータを、書き換え対象領域への書き戻し(ステップS19)、ステップS20へ進む。一方、カウンター値が“0”であると判定した場合、そのまま、ステップS20へ進む。   In step S17, the CPU 11 determines a counter value. If the CPU 11 determines that the counter value is “1” or “3”, the CPU 11 erases (deletes) the data saved in the save area (step S18), and proceeds to step S20. On the other hand, when determining that the counter value is “2”, the CPU 11 writes the data saved in the save area back to the rewrite target area (step S19), and proceeds to step S20. On the other hand, if it is determined that the counter value is “0”, the process proceeds to step S20 as it is.

ステップS20では、CPU11は、第1コマンド受信情報を加算(例えば“1”を加算)する。次いで、CPU11は、ステップS15で受信されたコマンドに応じたコマンド処理を実行し(ステップS21)、当該コマンド処理の処理結果をリーダライタ2へ送信し(ステップS22)、ステップS14に戻る。   In step S20, the CPU 11 adds the first command reception information (for example, “1” is added). Next, the CPU 11 executes command processing according to the command received in step S15 (step S21), transmits the processing result of the command processing to the reader / writer 2 (step S22), and returns to step S14.

次に、図4を参照して、消去処理または書き戻し処理とコマンド処理とに要する処理時間がリーダライタ2の待ち時間を超える場合に、リーダライタ2に対して待ち時間の延長要求がされる場合におけるCPU11の処理について説明する。図4は、コマンドの受信から処理結果の送信までにおける処理の流れを示すシーケンス図である。   Next, referring to FIG. 4, when the processing time required for the erasure process or the write-back process and the command process exceeds the waiting time of the reader / writer 2, the reader / writer 2 is requested to extend the waiting time. The processing of the CPU 11 in this case will be described. FIG. 4 is a sequence diagram showing the flow of processing from command reception to processing result transmission.

図4に示すように、ICカード1において、リーダライタ2からコマンドが受信されると(ステップS101)、タイマーが初期化されタイマーのカウントが開始される(ステップS102)。ステップS101で受信されたコマンドが、上述した第1コマンドである場合、書き戻し処理が開始される(ステップS103)。そして、書き戻し処理が行われているときに(ステップS104)、タイマーがリミット値に到達した(つまり、タイマーのカウントがカウントアップした)場合、割込み処理が開始され、タイマーが停止され(ステップS105)、待ち時間の延長要求がリーダライタ2へ送信される(ステップS106)。そして、リーダライタ2から待ち時間の延長応答が受信されると(ステップS107)、タイマーが初期化され、タイマーのカウントが開始され、さらに割込み前の処理(つまり、書き戻し処理)に戻る(ステップS108)。そして、上記ステップS104〜S108と同様に、ステップS109〜S113の処理が行われる。そして、書き戻し処理が完了した場合、上記第1コマンドに応じたコマンド処理が実行され(ステップS114)、当該コマンド処理が完了した場合、コマンド処理の処理結果の送信処理が実行され(ステップS115)、タイマー停止(ステップS116及びS117)がされた後に、上記処理結果がリーダライタ2へ送信され、次にコマンドの受信待ちになる(ステップS118)。   As shown in FIG. 4, when a command is received from the reader / writer 2 in the IC card 1 (step S101), the timer is initialized and the timer starts counting (step S102). If the command received in step S101 is the first command described above, the write back process is started (step S103). When the write-back process is being performed (step S104), if the timer reaches the limit value (that is, the timer count is counted up), the interrupt process is started and the timer is stopped (step S105). ) A waiting time extension request is transmitted to the reader / writer 2 (step S106). When an extension response for waiting time is received from the reader / writer 2 (step S107), the timer is initialized, the timer starts counting, and the process returns to the process before interruption (that is, the write-back process) (step S107). S108). And the process of step S109-S113 is performed similarly to said step S104-S108. When the write-back process is completed, a command process corresponding to the first command is executed (step S114), and when the command process is completed, a process result transmission process for the command process is executed (step S115). After the timer is stopped (steps S116 and S117), the processing result is transmitted to the reader / writer 2, and then the reception of a command is awaited (step S118).

以上説明したように、上記実施形態によれば、書き換え処理が正常に終了しなかった場合、ICカード1は、リーダライタ2からリセット信号を受信し当該リセット信号に対する初期応答情報をリーダライタ2へ応答し当該応答後にコマンドを受信すると、当該コマンドの受信から当該コマンドに応じたコマンド処理の処理結果を送信するまでの間に、例えば、退避領域に退避されたデータの消去処理、または退避領域に退避されたデータの書き換え対象領域への書き戻し処理等を実行するように構成したので、ICカード1のデータ書き換えの際に異常が生じたとしても、データを修復し、かつ国際規格に規定された初期応答情報を返信すべき制限時間を守ることができる。   As described above, according to the above embodiment, when the rewriting process is not normally completed, the IC card 1 receives the reset signal from the reader / writer 2 and sends the initial response information for the reset signal to the reader / writer 2. When a command is received after a response is received, the data saved in the save area, for example, between the receipt of the command and the transmission of the command processing result corresponding to the command, Since it is configured to execute a write-back process of the saved data to the area to be rewritten, even if an abnormality occurs during the data rewriting of the IC card 1, the data is restored and specified in the international standard. The time limit for returning the initial response information can be kept.

1 ICカード
2 リーダライタ
11 CPU
12 ROM
13 RAM
14 不揮発性メモリ
15 I/O回路
1 IC Card 2 Reader / Writer 11 CPU
12 ROM
13 RAM
14 Nonvolatile memory 15 I / O circuit

Claims (6)

外部機器との間で通信可能な情報処理装置であって、
メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換手段と、
前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信手段と、
前記リセット受信手段により受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答手段と、
前記応答手段による応答後に、前記外部機器からコマンドを受信するコマンド受信手段と、
前記コマンド受信手段により受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理手段と、
を備え、
前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とする情報処理装置。
An information processing apparatus capable of communicating with an external device,
Data rewriting means for performing rewriting processing of data in a rewrite target area of the memory, wherein the rewriting process is performed to rewrite data in the rewrite target area after writing the data in the rewrite target area in a different area from the rewrite target area The rewrite processing for rewriting the data in the rewrite target area with the write data after the write data is written in a different area from the rewrite target area, or the write data after the write data is written in a different area from the rewrite target area Data rewriting means for executing the rewriting process for changing the area in which data is written to the rewriting target area;
In the case where the rewriting process has not been completed normally, reset receiving means for receiving a reset signal from the external device;
Response means for responding to the external device with initial response information for the reset signal received by the reset receiving means;
Command receiving means for receiving a command from the external device after response by the response means;
Command processing means for executing command processing according to the command received by the command receiving means, and transmitting the processing result of the command processing to the external device;
With
The command processing means, when the rewriting process is not completed normally, between the reception of the command and the transmission of the processing result, the data of the data written in an area different from the rewriting target area. An erasing process, a process of writing the data written in an area different from the area to be rewritten to the area to be rewritten, or an area changing process for changing an area different from the area to be rewritten to the area to be rewritten An information processing apparatus characterized by that.
前記書き換え処理が正常に終了しなかった場合において、前記コマンドが前記応答後に最初に受信されたコマンドである場合に、前記コマンド処理手段は、前記消去処理、書き込み処理、または領域変更処理を実行することを特徴とする請求項1に記載の情報処理装置。   If the rewriting process does not end normally and the command is the first command received after the response, the command processing means executes the erasing process, the writing process, or the area changing process. The information processing apparatus according to claim 1. 前記消去処理、書き込み処理、または領域変更処理と、前記コマンド処理とに要する処理時間が、予め設定された時間を超える場合に、前記外部機器に対して待ち時間の延長要求を送信する延長要求送信手段を更に備えることを特徴とする請求項1または2に記載の情報処理装置。   When the processing time required for the erasure process, the write process, or the area change process and the command process exceeds a preset time, an extension request transmission for transmitting a wait time extension request to the external device The information processing apparatus according to claim 1, further comprising means. 前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信後、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行した後に、前記コマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信することを特徴とする請求項1乃至3の何れか一項に記載の情報処理装置。The command processing means is different from the erasure process of the data written in an area different from the rewritable area after receiving the command when the rewritable process does not end normally. After executing the process of writing the data written in the area to the area to be rewritten, or the area changing process for changing the area different from the area to be rewritten to the area to be rewritten, command processing according to the command is performed. 4. The information processing apparatus according to claim 1, wherein the information processing apparatus executes the command processing result and transmits the processing result of the command processing to the external device. 外部機器との間で通信可能なICカードであって、An IC card that can communicate with an external device,
メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換手段と、Data rewriting means for performing rewriting processing of data in a rewrite target area of the memory, wherein the rewriting process is performed to rewrite data in the rewrite target area after writing the data in the rewrite target area in a different area from the rewrite target area The rewrite processing for rewriting the data in the rewrite target area with the write data after the write data is written in a different area from the rewrite target area, or the write data after the write data is written in a different area from the rewrite target area Data rewriting means for executing the rewriting process for changing the area in which data is written to the rewriting target area;
前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信手段と、In the case where the rewriting process has not been completed normally, reset receiving means for receiving a reset signal from the external device;
前記リセット受信手段により受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答手段と、Response means for responding to the external device with initial response information for the reset signal received by the reset receiving means;
前記応答手段による応答後に、前記外部機器からコマンドを受信するコマンド受信手段と、Command receiving means for receiving a command from the external device after response by the response means;
前記コマンド受信手段により受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理手段と、Command processing means for executing command processing according to the command received by the command receiving means, and transmitting the processing result of the command processing to the external device;
を備え、With
前記コマンド処理手段は、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とするICカード。The command processing means, when the rewriting process is not completed normally, between the reception of the command and the transmission of the processing result, the data of the data written in an area different from the rewriting target area. An erasing process, a process of writing the data written in an area different from the area to be rewritten to the area to be rewritten, or an area changing process for changing an area different from the area to be rewritten to the area to be rewritten IC card characterized by that.
外部機器との間で通信可能な情報処理装置に含まれるコンピュータにより実行されるデータ処理方法であって、
メモリの書き換え対象領域のデータの書き換え処理を実行するデータ書換手段であって、前記書き換え対象領域のデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き換え対象領域のデータを書き換える前記書き換え処理、書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に前記書き込みデータにより前記書き換え対象領域のデータを書き換える前記書き換え処理、または書き込みデータを前記書き換え対象領域とは異なる領域に書き込んだ後に当該書き込みデータが書き込まれた領域を前記書き換え対象領域に変更する前記書き換え処理を実行するデータ書換ステップと、
前記書き換え処理が正常に終了しなかった場合において、前記外部機器からリセット信号を受信するリセット受信ステップと、
前記リセット受信ステップにより受信されたリセット信号に対する初期応答情報を前記外部機器へ応答する応答ステップと、
前記応答ステップによる応答後に、前記外部機器からコマンドを受信するコマンド受信ステップと、
前記コマンド受信ステップにより受信されたコマンドに応じたコマンド処理を実行し、当該コマンド処理の処理結果を前記外部機器へ送信するコマンド処理ステップと、
を含み、
前記コマンド処理ステップにおいては、前記書き換え処理が正常に終了しなかった場合において、前記コマンドの受信から前記処理結果を送信するまでの間に、前記書き換え対象領域とは異なる領域に書き込まれた前記データの消去処理、前記書き換え対象領域とは異なる領域に書き込まれた前記データの前記書き換え対象領域への書き込み処理、または前記書き換え対象領域とは異なる領域を前記書き換え対象領域に変更する領域変更処理を実行することを特徴とするデータ処理方法。
A data processing method executed by a computer included in an information processing apparatus capable of communicating with an external device,
Data rewriting means for performing rewriting processing of data in a rewrite target area of the memory, wherein the rewriting process is performed to rewrite data in the rewrite target area after writing the data in the rewrite target area in a different area from the rewrite target area The rewrite processing for rewriting the data in the rewrite target area with the write data after the write data is written in a different area from the rewrite target area, or the write data after the write data is written in a different area from the rewrite target area A data rewriting step for executing the rewriting process for changing the area in which data is written to the rewriting target area;
In the case where the rewriting process is not normally completed, a reset reception step of receiving a reset signal from the external device;
A response step of responding to the external device with initial response information for the reset signal received by the reset reception step;
A command receiving step of receiving a command from the external device after the response by the response step;
A command processing step for executing command processing according to the command received in the command receiving step, and transmitting a processing result of the command processing to the external device;
Including
In the command processing step, the data written in an area different from the rewrite target area between the reception of the command and the transmission of the processing result when the rewriting process is not normally completed. Erasing process, writing process of the data written in an area different from the area to be rewritten into the area to be rewritten, or area changing process for changing an area different from the area to be rewritten to the area to be rewritten And a data processing method.
JP2014017757A 2014-01-31 2014-01-31 Information processing apparatus, IC card, and data processing method Active JP6281302B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014017757A JP6281302B2 (en) 2014-01-31 2014-01-31 Information processing apparatus, IC card, and data processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014017757A JP6281302B2 (en) 2014-01-31 2014-01-31 Information processing apparatus, IC card, and data processing method

Publications (2)

Publication Number Publication Date
JP2015146071A JP2015146071A (en) 2015-08-13
JP6281302B2 true JP6281302B2 (en) 2018-02-21

Family

ID=53890279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014017757A Active JP6281302B2 (en) 2014-01-31 2014-01-31 Information processing apparatus, IC card, and data processing method

Country Status (1)

Country Link
JP (1) JP6281302B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3706703B2 (en) * 1996-12-27 2005-10-19 ローム株式会社 IC card
JP4965909B2 (en) * 2006-06-27 2012-07-04 株式会社東芝 IC card
JP5341947B2 (en) * 2011-04-25 2013-11-13 株式会社東芝 IC card, control method of IC card, and control method of portable electronic device

Also Published As

Publication number Publication date
JP2015146071A (en) 2015-08-13

Similar Documents

Publication Publication Date Title
JP4768237B2 (en) Portable electronic device and method for controlling portable electronic device
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP4896842B2 (en) Portable electronic device
JP2003216511A (en) Non-volatile memory device, data updating method, data updating program and computer readable recording medium with recorded program
JP6281302B2 (en) Information processing apparatus, IC card, and data processing method
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
JP2009009602A (en) Ic card and ic card program
JP6233134B2 (en) Electronic information storage medium, information processing method, and information processing program
JP3607658B2 (en) Portable electronic device
JP4784138B2 (en) IC card and IC card program
JP4950533B2 (en) Portable electronic device and IC card
JP2007087120A (en) Ic card mounted with multiple os (operating system) and issue consignment method
JP4195822B2 (en) IC card and IC card program
JP2006293706A (en) Multi-application ic card with application updating function
JP4965909B2 (en) IC card
JP7322923B2 (en) Secure element, transaction control method and device
JP5341947B2 (en) IC card, control method of IC card, and control method of portable electronic device
JP2016153945A (en) Electronic information storage medium, counter rewriting method and counter rewriting program
JP2008305263A (en) Nonvolatile semiconductor storage device and memory management method
JP5708228B2 (en) IC card and IC card refresh method
JP2006172271A (en) Multi-application ic card, and program for ic card
JP6015461B2 (en) Information recording medium, data read / write method, and data read / write program
JP7040053B2 (en) Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium
JP6252341B2 (en) Electronic information storage medium, information processing method, and information processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20161125

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170823

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170905

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171106

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180108

R150 Certificate of patent or registration of utility model

Ref document number: 6281302

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150