JP2014059731A - Ic card and mobile electronic device - Google Patents

Ic card and mobile electronic device Download PDF

Info

Publication number
JP2014059731A
JP2014059731A JP2012204390A JP2012204390A JP2014059731A JP 2014059731 A JP2014059731 A JP 2014059731A JP 2012204390 A JP2012204390 A JP 2012204390A JP 2012204390 A JP2012204390 A JP 2012204390A JP 2014059731 A JP2014059731 A JP 2014059731A
Authority
JP
Japan
Prior art keywords
self
command
diagnosis
processing
external device
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.)
Pending
Application number
JP2012204390A
Other languages
Japanese (ja)
Inventor
Satoru Sekiya
哲 関谷
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 JP2012204390A priority Critical patent/JP2014059731A/en
Publication of JP2014059731A publication Critical patent/JP2014059731A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an IC card which can be efficiently self-diagnosed, and a mobile electronic device.SOLUTION: According to an embodiment, an IC card has a communication interface, control means, storage means, self-diagnosis execution means, and command processing means. The communication interface communicably connects to an external device. After the control means is activated on receipt of operation power supply and an operation clock from the external device, the control means enters standby for a command from the external device. The storage means stores execution statuses of a plurality of self-diagnoses to be implemented after activation. The self-diagnosis execution means sequentially executes the self-diagnoses, which have not been implemented in the storage means, during standby for the command from the external device. The command processing means executes processing for a received command irrespective of the execution statuses of the self-diagnoses stored in the storage means when communication means receives the command from the external device.

Description

本発明の実施形態は、ICカードおよび携帯可能電子装置に関する。   Embodiments described herein relate generally to an IC card and a portable electronic device.

一般的なICカードは、外部装置からの電源及び動作クロックを受けてCPUなどの電子回路が動作可能な状態(活性化)になる。ICカードは、活性化すると、まず、CPUやコプロセッサ、通信装置などの内部回路に異常がないかチェックを行い、さらには、内蔵するメモリに記録されているプログラムやデータに異常がないかをチェックする自己診断処理を行う。このような自己診断が正常であれば、当該ICカードは、外部装置からの命令を受付ける。   A general IC card is in a state (activated) in which an electronic circuit such as a CPU can operate upon receiving a power supply and an operation clock from an external device. When the IC card is activated, it first checks whether there are any abnormalities in the internal circuits such as the CPU, coprocessor, and communication device, and further checks whether there are any abnormalities in the programs and data recorded in the built-in memory. Perform a self-diagnosis process to check. If such a self-diagnosis is normal, the IC card accepts a command from an external device.

しかしながら、ICカードは、その用途によっては電源が供給されてから命令を受け取って処理を開始するまでに許容される時間が短くなることもある。例えば、交通機関で用いられるICカードでは、移動中に処理を完了させるため、上位装置(改札機)と通信を開始してから数ミリ秒〜数十ミリ秒後には処理を開始しなければならないような運用形態もある。この様な運用形態においては、従来のICカードでは、活性化後に自己診断を行うための時間を十分に確保できないという問題が生じる可能性がある。   However, depending on the use of the IC card, the allowable time from when the power is supplied to when the command is received and the processing is started may be shortened. For example, in an IC card used in transportation, processing must be started several milliseconds to several tens of milliseconds after starting communication with a host device (ticket gate) in order to complete processing during movement. There are also operational forms. In such an operation mode, there is a possibility that the conventional IC card may not have sufficient time for performing self-diagnosis after activation.

ISO/IEC 7816ISO / IEC 7816 ISO/IEC 14443ISO / IEC 14443

本発明の実施形態では、効率良く自己診断を行えるICカードおよび携帯可能電子装置を提供することを目的とする。   An object of an embodiment of the present invention is to provide an IC card and a portable electronic device that can perform self-diagnosis efficiently.

実施形態によれば、ICカードは、通信インターフェースと、制御手段と、記憶手段と、自己診断実行手段と、コマンド処理手段とを有する。通信インターフェースは、外部装置に通信接続する。制御手段は、外部装置からの動作電源及び動作クロックを受けて活性化した後に外部装置からのコマンド受信待ち状態とする。記憶手段は、活性化後に実施すべき複数の自己診断処理の実施状況を記憶する。自己診断実行手段は、外部装置からのコマンドの受信待ち状態において前記記憶手段で未実施の状態となっている自己診断処理を順番に実行する。コマンド処理手段は、通信手段により外部装置からコマンドを受信した場合、記憶手段に記憶した各自己診断処理の実施状況によらずに受信したコマンドに対する処理を実行する。   According to the embodiment, the IC card includes a communication interface, a control unit, a storage unit, a self-diagnosis execution unit, and a command processing unit. The communication interface is communicatively connected to an external device. The control means is activated by receiving an operation power supply and an operation clock from the external device, and then waits for receiving a command from the external device. The storage means stores the implementation status of a plurality of self-diagnosis processes to be performed after activation. The self-diagnosis execution means sequentially executes the self-diagnosis processes that are not performed in the storage means in a state of waiting for a command from the external device. When the command processing unit receives a command from the external device through the communication unit, the command processing unit executes processing for the received command regardless of the implementation status of each self-diagnosis processing stored in the storage unit.

実施形態に係るICカードとICカード処理装置とを有するICカードシステムの構成例を示す図である。It is a figure which shows the structural example of the IC card system which has the IC card and IC card processing apparatus which concern on embodiment. 実施形態に係るICカードの構成例を示すブロック図である。It is a block diagram which shows the structural example of the IC card which concerns on embodiment. 実施形態に係るICカードの第1の処理例を説明するためのフローチャートである。It is a flowchart for demonstrating the 1st process example of the IC card which concerns on embodiment. 実施形態に係るICカードのRAMが保持する自己診断の実施状況管理テーブルの例を示す図である。It is a figure which shows the example of the implementation status management table of the self-diagnosis which RAM of the IC card which concerns on embodiment hold | maintains. 実施形態に係るICカードの第2の処理例を説明するためのフローチャートである。It is a flowchart for demonstrating the 2nd process example of the IC card which concerns on embodiment. 実施形態に係るICカードの第3の処理例を説明するためのフローチャートである。10 is a flowchart for explaining a third processing example of the IC card according to the embodiment. 実施形態に係るICカードの第4の処理例を説明するためのフローチャートである。It is a flowchart for demonstrating the 4th process example of the IC card which concerns on embodiment. 実施形態に係るICカードの不揮発性メモリが保持する自己診断のコマンド別管理テーブルの例を示す図である。It is a figure which shows the example of the management table classified by command of the self-diagnosis which the non-volatile memory of the IC card which concerns on embodiment holds. 実施形態に係るICカードの第5の処理例を説明するためのフローチャートである。It is a flowchart for demonstrating the 5th example of a process of the IC card which concerns on embodiment. 実施形態に係るICカードの第5の処理例を説明するためのフローチャートである。It is a flowchart for demonstrating the 5th example of a process of the IC card which concerns on embodiment.

以下、実施形態について、図面を参照して説明する。
図1は、本実施形態に係る携帯可能電子装置としてのICカード2と、ICカード2と通信を行う外部装置(上位装置)としてのICカード処理装置1の構成について説明するためのブロック図である。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 1 is a block diagram for explaining a configuration of an IC card 2 as a portable electronic device according to the present embodiment and an IC card processing device 1 as an external device (higher level device) that communicates with the IC card 2. is there.

ICカード2は、運用形態としては、たとえば、キャッシュカード、クレジットカード、IDカード、定期券、乗車券として用いられるSF(ストアードフェア)カードなどが想定される。また、ICカード処理装置1は、ICカード2にコマンドを与え、与えたコマンドに対するレスポンスを受けて処理を行う装置である。たとえば、ICカード処理装置1は、運用形態としては、たとえば、クレジットカード処理機、自動テラーマシン(ATM)、個人認証装置、通行制御装置あるいは改札装置などが想定される。   The IC card 2 is assumed to be a cash card, a credit card, an ID card, a commuter pass, an SF (stored fair) card used as a boarding ticket, and the like as an operation mode. The IC card processing device 1 is a device that gives a command to the IC card 2 and performs processing in response to a response to the given command. For example, the operation mode of the IC card processing device 1 is assumed to be, for example, a credit card processing machine, an automatic teller machine (ATM), a personal authentication device, a traffic control device, or a ticket gate device.

まず、ICカード処理装置1の構成について説明する。
ICカード処理装置1は、基本的な構成として、図1に示すように、制御部11、ディスプレイ12、操作部13及びカードリーダライタ14などを有する。なお、ICカード処理装置1は、上述したような様々な運用形態が想定されるものであり、図1に示すような構成に加えて、運用形態に応じた構成を具備するようにして良い。
First, the configuration of the IC card processing apparatus 1 will be described.
As shown in FIG. 1, the IC card processing apparatus 1 includes a control unit 11, a display 12, an operation unit 13, a card reader / writer 14 and the like as shown in FIG. The IC card processing apparatus 1 is assumed to have various operation modes as described above, and may have a configuration corresponding to the operation mode in addition to the configuration shown in FIG.

制御部11は、ICカード処理装置1全体の動作を制御するものである。制御部11は、CPU、種々のメモリ及び各種インターフェースなどにより構成される。たとえば、制御部11は、パーソナルコンピュータ(PC)により構成されるようにしても良い。制御部11は、CPUがメモリに記憶されたプログラムを実行することにより種々の処理機能を実現するものである。たとえば、制御部11は、カードリーダライタ14によりICカード2へコマンドを送信する機能、ICカード2から受信するレスポンスなどのデータを基に種々の処理を行う機能などを有する。   The control unit 11 controls the operation of the entire IC card processing apparatus 1. The control unit 11 includes a CPU, various memories, various interfaces, and the like. For example, the control unit 11 may be configured by a personal computer (PC). The control part 11 implement | achieves various processing functions, when CPU runs the program memorize | stored in memory. For example, the control unit 11 has a function of transmitting a command to the IC card 2 by the card reader / writer 14 and a function of performing various processes based on data such as a response received from the IC card 2.

ディスプレイ12は、制御部11の制御により種々の情報を表示する表示装置である。ディスプレイ12は、たとえば、液晶モニタなどである。
操作部13は、ICカード処理装置1の使用者によって、種々の操作指示及び暗証番号などが入力される。操作部13は、入力された操作指示及び暗証番号などのデータを制御部11へ送信する。操作部13は、たとえば、キーボード、テンキー、及び、タッチパネルなどである。
The display 12 is a display device that displays various information under the control of the control unit 11. The display 12 is, for example, a liquid crystal monitor.
The operation unit 13 is input with various operation instructions and a password by the user of the IC card processing apparatus 1. The operation unit 13 transmits the input operation instruction and data such as a password to the control unit 11. The operation unit 13 is, for example, a keyboard, a numeric keypad, and a touch panel.

カードリーダライタ14は、ICカード2との通信を行うためのインターフェース装置である。カードリーダライタ14は、ICカード2の通信方式に応じたインターフェースにより構成される。たとえば、ICカード2が接触型のICカードである場合、カードリーダライタ14は、ICカード2のコンタクト部と物理的かつ電気的に接続するための接触部などにより構成される。   The card reader / writer 14 is an interface device for performing communication with the IC card 2. The card reader / writer 14 is configured by an interface corresponding to the communication method of the IC card 2. For example, when the IC card 2 is a contact type IC card, the card reader / writer 14 is configured by a contact portion for physically and electrically connecting with a contact portion of the IC card 2.

また、ICカード2が非接触型のICカードである場合、カードリーダライタ14は、ICカード2との無線通信を行うためのアンテナおよび通信制御部などにより構成される。カードリーダライタ14では、ICカード2に対する電源供給、クロック供給、リセット制御、データの送受信が行われるようになっている。このような機能によってカードリーダライタ14は、制御部11による制御に基づいてICカード2の活性化(起動)、種々のコマンドの送信、及び送信したコマンドに対する応答(レスポンス)の受信などを行なう。   When the IC card 2 is a non-contact type IC card, the card reader / writer 14 includes an antenna for performing wireless communication with the IC card 2 and a communication control unit. The card reader / writer 14 performs power supply, clock supply, reset control, and data transmission / reception with respect to the IC card 2. With such a function, the card reader / writer 14 performs activation (activation) of the IC card 2, transmission of various commands, reception of responses (responses) to the transmitted commands, and the like based on control by the control unit 11.

次に、ICカード2について説明する。
ICカード2は、ICカード処理装置1などの上位機器から電源および動作クロックの供給を受けて活性化される(動作可能な状態になる)ようになっている。例えば、ICカード2が接触型の通信によりICカード処理装置1と接続される場合、つまり、ICカード2が接触型のICカードで構成される場合、ICカード2は、通信インターフェースとしてのコンタクト部を介してICカード処理装置1からの動作電源及び動作クロックの供給を受けて活性化される。
Next, the IC card 2 will be described.
The IC card 2 is activated (becomes operable) upon receiving power and an operating clock from a host device such as the IC card processing device 1. For example, when the IC card 2 is connected to the IC card processing device 1 by contact-type communication, that is, when the IC card 2 is configured by a contact-type IC card, the IC card 2 is a contact unit as a communication interface. The IC card processor 1 is activated by receiving the operation power supply and the operation clock from the IC card processing apparatus 1 through the IC card.

また、ICカード2が非接触型の通信方式によりICカード処理装置1と接続される場合、つまり、ICカード2が非接触式のICカードで構成される場合、ICカード2は、通信インターフェースとしてのアンテナ及び変復調回路などを介してICカード処理装置1からの電波を受信し、その電波から図示しない電源部により動作電源及び動作クロックを生成して活性化するようになっている。   Further, when the IC card 2 is connected to the IC card processing device 1 by a non-contact type communication method, that is, when the IC card 2 is constituted by a non-contact type IC card, the IC card 2 is used as a communication interface. A radio wave is received from the IC card processing apparatus 1 via the antenna and modulation / demodulation circuit, and an operation power supply and an operation clock are generated from the radio wave by a power supply unit (not shown) and activated.

次に、ICカード2の構成例について説明する。
図2は、実施形態に係るICカード2の構成例を概略的に示すブロック図である。ICカード2は、プラスチックなどで形成されたカード状の本体Cを有する。ICカード2は、本体C内にモジュールMが内蔵されている。モジュールMは、1つまたは複数のICチップCaと通信用の外部インターフェース(通信インターフェース)とが接続された状態で一体的に形成され、ICカード2の本体C内に埋設されている。
Next, a configuration example of the IC card 2 will be described.
FIG. 2 is a block diagram schematically showing a configuration example of the IC card 2 according to the embodiment. The IC card 2 has a card-like main body C formed of plastic or the like. The IC card 2 has a module M built in the main body C. The module M is integrally formed in a state where one or a plurality of IC chips Ca and a communication external interface (communication interface) are connected, and is embedded in the main body C of the IC card 2.

図2に示す構成例において、ICカード2は、CPU21、ROM22、RAM23、不揮発性メモリ24、外部I/F25およびコプロセッサ26を備えている。これらの各部は、データバスを介して互いに接続されている。また、CPU21、ROM22、RAM23、不揮発性メモリ24およびコプロセッサ26は、1つ又は複数のICチップCaにより構成され、外部I/F25の一部を構成するコンタクト部あるいはアンテナに接続された状態でモジュールMを構成している。   In the configuration example shown in FIG. 2, the IC card 2 includes a CPU 21, a ROM 22, a RAM 23, a nonvolatile memory 24, an external I / F 25, and a coprocessor 26. These units are connected to each other via a data bus. The CPU 21, ROM 22, RAM 23, nonvolatile memory 24, and coprocessor 26 are configured by one or a plurality of IC chips Ca, and are connected to a contact portion or an antenna that constitutes a part of the external I / F 25. Module M is configured.

CPU21は、ICカード2全体の制御を司る制御部として機能する。CPU21は、ROM22あるいは不揮発性メモリ24に記憶されている制御プログラム及び制御データに基づいて種々の処理を行う。たとえば、CPU21は、ROM22に記憶されているプログラムを実行することにより、ICカード2の動作制御あるいはICカード2の運用形態に応じた種々の処理を行う。なお、各種の機能のうちの一部は、ハードウエア回路により実現されるものであっても良い。この場合、CPU21は、ハードウエア回路により実行される機能を制御する。   The CPU 21 functions as a control unit that controls the entire IC card 2. The CPU 21 performs various processes based on the control program and control data stored in the ROM 22 or the nonvolatile memory 24. For example, the CPU 21 executes various programs according to the operation control of the IC card 2 or the operation mode of the IC card 2 by executing a program stored in the ROM 22. Note that some of the various functions may be realized by a hardware circuit. In this case, the CPU 21 controls functions executed by the hardware circuit.

ROM22は、予め制御用のプログラム及び制御データなどを記憶する不揮発性のメモリである。ROM22は、製造段階で制御プログラム及び制御データなどを記憶した状態でICカード2に組み込まれる。即ち、ROM22に記憶される制御プログラム及び制御データは、予めICカード2の仕様に応じて組み込まれる。   The ROM 22 is a non-volatile memory that stores a control program and control data in advance. The ROM 22 is incorporated in the IC card 2 in a state where a control program, control data, and the like are stored at the manufacturing stage. That is, the control program and control data stored in the ROM 22 are incorporated in advance according to the specifications of the IC card 2.

RAM23は、揮発性のメモリである。RAM23は、CPU21の処理中のデータなどを一時的に格納する。たとえば、RAM23は、受信用バッファ、計算用バッファ、送信用バッファなどを備える。受信用バッファとしては、外部I/F25を通じてICカード処理装置1から送信されたコマンドを保持する。計算用バッファとしては、CPU21が種々の計算をするため一時的な結果を保持する。送信用バッファとしては、外部I/F25を通じてICカード処理装置1に送信するデータを保持する。また、RAM23は、複数の自己診断処理の実施状況を管理する自己診断の実施状況管理テーブル23aを記憶する。自己診断の実施状況管理テーブル23aの構成例については後述するものとする。   The RAM 23 is a volatile memory. The RAM 23 temporarily stores data being processed by the CPU 21. For example, the RAM 23 includes a reception buffer, a calculation buffer, a transmission buffer, and the like. As a reception buffer, a command transmitted from the IC card processing apparatus 1 through the external I / F 25 is held. As a calculation buffer, the CPU 21 holds temporary results for various calculations. As a transmission buffer, data to be transmitted to the IC card processing apparatus 1 through the external I / F 25 is held. The RAM 23 also stores a self-diagnosis execution status management table 23a for managing the execution status of a plurality of self-diagnosis processes. A configuration example of the self-diagnosis implementation status management table 23a will be described later.

不揮発性メモリ24は、例えば、EEPROMあるいはフラッシュROMなどのデータの書き込み及び書換えが可能な不揮発性のメモリにより構成される。不揮発性メモリ24は、ICカード2の運用用途に応じて制御プログラム、アプリケーション、及び種々のデータを格納する。不揮発性メモリ24には、プログラム領域、データ領域などが定義され、各領域にプログラムファイル及びデータファイルなどが作成される。作成された各ファイルには制御プログラム及び種々のデータなどが書き込まれる。たとえば、データ領域には、共通データ、鍵データ、アプリケーションデータなどがファイルデータとして記憶される。   The nonvolatile memory 24 is configured by a nonvolatile memory capable of writing and rewriting data, such as an EEPROM or a flash ROM. The non-volatile memory 24 stores a control program, an application, and various data according to the usage application of the IC card 2. In the nonvolatile memory 24, a program area, a data area, and the like are defined, and a program file and a data file are created in each area. In each created file, a control program and various data are written. For example, common data, key data, application data, and the like are stored as file data in the data area.

また、不揮発性メモリ24は、各種のコマンドに対応するコマンド処理を実行する前に実施しておくべき自己診断処理を示す自己診断のコマンド別管理テーブル24aを記憶する。自己診断のコマンド別管理テーブル24aの構成例については後述するものとする。なお、自己診断のコマンド別管理テーブル24aは、ROMなどに記憶するようにしても良い。   In addition, the nonvolatile memory 24 stores a self-diagnosis command management table 24a indicating self-diagnosis processing that should be performed before executing command processing corresponding to various commands. A configuration example of the self-diagnosis command-specific management table 24a will be described later. The self-diagnosis command management table 24a may be stored in a ROM or the like.

外部I/F25は、ICカード処理装置1のカードリーダライタ14との通信を行うためのインターフェース(通信回路)である。ICカード2が接触型のICカードとして実現される場合、外部I/F25は、ICカード処理装置1のカードリーダライタ14と物理的かつ電気的に接触して信号の送受信を行うための通信制御部(ICチップCaに含まれる回路部分)とコンタクト部とにより構成される。また、ICカード2が非接触型のICカードとして実現される場合、外部I/F25は、ICカード処理装置1のカードリーダライタ14との無線通信を行うための変復調回路などの通信制御部(ICチップCaに含まれる回路部分)とアンテナとにより構成される。   The external I / F 25 is an interface (communication circuit) for performing communication with the card reader / writer 14 of the IC card processing apparatus 1. When the IC card 2 is realized as a contact type IC card, the external I / F 25 performs communication control for transmitting and receiving signals in physical and electrical contact with the card reader / writer 14 of the IC card processing apparatus 1. Part (circuit part included in the IC chip Ca) and a contact part. When the IC card 2 is realized as a non-contact type IC card, the external I / F 25 is a communication control unit (such as a modulation / demodulation circuit for performing wireless communication with the card reader / writer 14 of the IC card processing device 1). The circuit portion included in the IC chip Ca) and an antenna.

コプロセッサ26は、暗号処理を実行するためのプロセッサである。コプロセッサ26は、たとえば、暗号化及び復号化を用いた認証処理、あるいは、暗号化されたデータの読み出し処理などに用いられる。   The coprocessor 26 is a processor for executing cryptographic processing. The coprocessor 26 is used for, for example, authentication processing using encryption and decryption, or read processing of encrypted data.

次に、本実施形態に係るICカード2における第1の処理例について説明する。
第1の処理例では、ICカード2は、活性化後に自己診断処理を実行せず、直ちにATR(Answer To Reset)信号を出力してコマンドの受信待ち状態になる。ATR信号は、上位装置(ICカード処理装置)1へコマンドの受信が可能な状態であることを示す信号である。ATR信号を出力した後、コマンド受信待ち状態になってから所定時間が経過した時点でICカード処理装置1からのコマンド受信が無ければ、ICカード2は、複数の自己診断処理を順番に1つずつ実行する。複数の自己診断処理は、ICカード2が実行すべき自己診断処理を比較的短時間で処理可能なモジュールに分割したものである。
Next, a first processing example in the IC card 2 according to the present embodiment will be described.
In the first processing example, the IC card 2 does not execute the self-diagnosis processing after activation but immediately outputs an ATR (Answer To Reset) signal and enters a command reception waiting state. The ATR signal is a signal indicating that the host apparatus (IC card processing apparatus) 1 can receive a command. If no command is received from the IC card processing device 1 after a predetermined time has elapsed since the ATR signal was output, the IC card 2 performs a plurality of self-diagnosis processes in order. Run one by one. The plurality of self-diagnosis processes are obtained by dividing the self-diagnosis process to be executed by the IC card 2 into modules that can be processed in a relatively short time.

1つの自己診断処理が完了した時点で、ICカード処理装置1からのコマンドを受信している場合、或いはコマンドの受信を開始している場合、ICカードは、受信したコマンドの処理を実行し、コマンドを受信していなければ次の自己診断処理を実行する。また、1つのコマンドの処理を実行した後に、一定時間内に次のコマンドを受信しなかった場合、ICカード2は、再び次の未実施の自己診断処理を実行する。   When one self-diagnosis process is completed, if the command is received from the IC card processing apparatus 1 or if the reception of the command is started, the IC card executes the process of the received command, If no command is received, the following self-diagnosis process is executed. If the next command is not received within a predetermined time after executing one command process, the IC card 2 executes the next unexecuted self-diagnosis process again.

図3は、実施形態に係るICカード2における第1の処理例を説明するためのフローチャートである。
ICカード2は、ICカード処理装置1からの動作電源及び動作クロックを受けて活性化する(ステップS200)。活性化すると、ICカード2のCPU21は、RAM23上に自己診断の実施状況管理テーブル23aを作成し(ステップS201)、外部I/F25によりICカード処理装置1へATR信号を出力する(ステップS202)。
FIG. 3 is a flowchart for explaining a first processing example in the IC card 2 according to the embodiment.
The IC card 2 is activated upon receiving the operation power and the operation clock from the IC card processing device 1 (step S200). When activated, the CPU 21 of the IC card 2 creates a self-diagnosis implementation status management table 23a on the RAM 23 (step S201), and outputs an ATR signal to the IC card processing device 1 by the external I / F 25 (step S202). .

自己診断の実施状況管理テーブル23aは、各種の自己診断処理の実施状況を示すテーブルである。本実施形態においては、ICカード2が実行すべき自己診断処理は、短時間で処理可能な複数の自己診断処理(例えば、各種の機能ごとの自己診断処理)に分割されているものとする。自己診断の実施状況管理テーブル23aは、分割された個々の自己診断処理ごとに実施状況を記憶(管理)するものである。   The self-diagnosis implementation status management table 23a is a table showing the implementation status of various self-diagnosis processes. In the present embodiment, the self-diagnosis process to be executed by the IC card 2 is divided into a plurality of self-diagnosis processes (for example, self-diagnosis processes for various functions) that can be processed in a short time. The self-diagnosis implementation status management table 23a stores (manages) the implementation status for each divided individual self-diagnosis process.

図4は、自己診断の実施状況管理テーブル23aの構成例を示す図である。図4に示す自己診断の実施状況管理テーブル23aの例では、実行順序と自己診断の内容(自己診断項目)と実施状況を示す情報とが対応づけて記憶される。CPU21は、自己診断の実施状況管理テーブル23aを参照することにより、各自己診断処理が実施済みか未実施かを判定できる。   FIG. 4 is a diagram illustrating a configuration example of the self-diagnosis implementation status management table 23a. In the example of the self-diagnosis implementation status management table 23a shown in FIG. 4, the execution order, self-diagnosis content (self-diagnostic item), and information indicating the implementation status are stored in association with each other. The CPU 21 can determine whether or not each self-diagnosis process has been performed by referring to the self-diagnosis execution status management table 23a.

第1の処理例においては、CPU21は、活性化直後、各自己診断処理の実施状況を未実施の状態とした自己診断の実施状況管理テーブル23aを作成し、ATR信号を出力する。すなわち、ICカード2からのATR信号を受信したICカード処理装置1は、当該ICカード2がコマンドに対する処理が実行可能な状態となったものと認識するようになっている。   In the first processing example, immediately after activation, the CPU 21 creates a self-diagnosis implementation status management table 23a in which the implementation status of each self-diagnosis process is not implemented, and outputs an ATR signal. In other words, the IC card processing apparatus 1 that has received the ATR signal from the IC card 2 recognizes that the IC card 2 is in a state where processing for the command can be executed.

ATR信号を出力した後、ICカード2のCPU21は、ICカード処理装置1からのコマンド受信待ちの状態となる(ステップS203)。ICカード処理装置1からのコマンドの受信がなければ(ステップS204、NO)、CPU21は、コマンド受信待ち状態で所定時間が経過したか否かを判断する(ステップS205)。ここで、所定時間は、自己診断処理を実行するタイミングを判断するための時間であり、所定時間が経過したか否かは、ICカード処理装置1から与えられる動作クロックが所定数に達したか否かにより判断するようにしても良い。   After outputting the ATR signal, the CPU 21 of the IC card 2 waits for receiving a command from the IC card processing device 1 (step S203). If no command is received from the IC card processing apparatus 1 (step S204, NO), the CPU 21 determines whether or not a predetermined time has elapsed in a command reception waiting state (step S205). Here, the predetermined time is a time for determining the timing for executing the self-diagnosis process, and whether or not the predetermined time has passed is whether the operation clock provided from the IC card processing device 1 has reached a predetermined number. You may make it judge by whether or not.

コマンド受信待ちの状態で所定時間が経過したと判断した場合(ステップS205、YES)、CPU21は、図4に示すような自己診断の実施状況管理テーブル23aを参照して、自己診断処理を全て完了しているか否かを判断する(ステップS206)。全ての自己診断処理を完了していると判断した場合(ステップS206、YES)、CPU21は、ステップS203へ戻り、コマンド受信待ち状態とする。   If it is determined that a predetermined time has elapsed while waiting for command reception (YES in step S205), the CPU 21 refers to the self-diagnosis execution status management table 23a as shown in FIG. It is determined whether or not (step S206). If it is determined that all the self-diagnosis processes have been completed (step S206, YES), the CPU 21 returns to step S203 and enters a command reception waiting state.

また、全ての自己診断処理を完了していないと判断した場合(ステップS206、NO)、CPU21は、自己診断処理の管理テーブル23aを参照して、未実施の自己診断処理から次に実行すべき自己診断処理を決定する(ステップS207)。たとえば、図4に示す構成例であれば、CPU21は、未実施の自己診断処理のうち最も実行順序が上位の自己診断処理を決定すれば良い。ただし、未実施の自己診断処理から次に実行すべき自己診断処理を決定する方法は、上述の方法に限定されるものではなく、例えば、アプリケーションごとに設定した実行順序により決定するようにしても良し、上位装置から指定される実行順序により決定するようにしても良い。   If it is determined that all the self-diagnosis processes have not been completed (step S206, NO), the CPU 21 refers to the self-diagnosis process management table 23a and should execute the next self-diagnosis process. Self-diagnosis processing is determined (step S207). For example, in the configuration example shown in FIG. 4, the CPU 21 may determine the self-diagnosis process with the highest execution order among the unexecuted self-diagnosis processes. However, the method for determining the self-diagnosis process to be executed next from the unexecuted self-diagnosis process is not limited to the above-described method. For example, the determination may be made according to the execution order set for each application. It is good, and you may make it determine with the execution order designated from a high-order apparatus.

実行すべき自己診断処理を決定すると、CPU21は、実行を決定した自己診断処理を実行する(ステップS208)。自己診断処理が正常終了した場合(ステップS209、YES)、CPU21は、自己診断の実施状況管理テーブル23aに、正常終了した自己診断処理を実施済みとして登録する(ステップS210)。たとえば、図4に示す構成の自己診断の実施状況管理テーブル23aであれば、CPU21は、正常終了した自己診断処理に対応する自己診断項目の実施状況を「未」から「完了」に書き換える。   When the self-diagnosis process to be executed is determined, the CPU 21 executes the self-diagnosis process determined to be executed (step S208). When the self-diagnosis process is normally completed (step S209, YES), the CPU 21 registers the self-diagnosis process that has been normally completed as having been performed in the self-diagnosis execution status management table 23a (step S210). For example, in the self-diagnosis implementation status management table 23a configured as shown in FIG. 4, the CPU 21 rewrites the implementation status of the self-diagnostic item corresponding to the normally completed self-diagnosis process from “not yet” to “completed”.

また、実行した自己診断処理がエラーとなった場合(ステップS209、NO)、CPU21は、動作を停止し、当該ICカード2を以後の処理が実行不能な状態にする処理(HALT)を行う(ステップS211)。また、自己診断処理がエラーとなった場合、ICカード処理装置1との通信が可能な状態であれば、CPU21は、エラーとなった機能を停止するとともに、エラーとなった自己診断処理の内容をICカード処理装置1へ通知するようにしても良い。この場合、ICカード処理装置1は、ICカード2からのエラーとなった自己診断処理(停止された機能)を示す通知を受けて、エラーとなった機能以外で所望の処理が実行できるか否か判断したり、エラーとなった機能以外で実行可能な処理のコマンドをICカード2へ供給したりするようにしても良い。これにより、ICカード処理装置1は、ICカード2における自己診断でエラーが発生しても一部の機能を停止したままで、エラーとなった機能以外での処理を継続させることが可能となる。   If the executed self-diagnosis process results in an error (step S209, NO), the CPU 21 stops the operation and performs a process (HALT) for making the IC card 2 incapable of performing the subsequent process ( Step S211). If an error occurs in the self-diagnosis process and the communication with the IC card processing apparatus 1 is possible, the CPU 21 stops the function in error and the content of the self-diagnosis process in error. May be notified to the IC card processing apparatus 1. In this case, the IC card processing device 1 receives a notification from the IC card 2 indicating the self-diagnosis process (stopped function) in error, and can execute a desired process other than the error function. Or a command for processing that can be executed by a function other than the function causing the error may be supplied to the IC card 2. As a result, the IC card processing apparatus 1 can continue processing other than the function that caused the error while stopping some functions even if an error occurs in the self-diagnosis in the IC card 2. .

自己診断処理が完了したことを実施状況管理テーブル23aに登録すると、CPU21は、自己診断処理を実行中にICカード処理装置1からのコマンドを受信したか否かを判断する(ステップS212)。第1の処理例では、CPU21は、自己診断処理を実行中にICカード処理装置1からのコマンドを受信した場合であっても、自己診断処理を実行中に受信したコマンドをRAM23などに保持しておき、実行中の自己診断処理を中断させずに完了させるものとする。   When the completion of the self-diagnosis process is registered in the implementation status management table 23a, the CPU 21 determines whether or not a command is received from the IC card processing apparatus 1 during the execution of the self-diagnosis process (step S212). In the first processing example, even when the CPU 21 receives a command from the IC card processing apparatus 1 during execution of the self-diagnosis processing, the CPU 21 holds the command received during execution of the self-diagnosis processing in the RAM 23 or the like. Assume that the self-diagnosis process being executed is completed without interruption.

自己診断処理中にコマンドを受信していなければ(ステップS212、NO)、CPU21は、ステップS203へ戻り、次のコマンドの受信待ち状態となる。また、CPU21は、ステップS212においてコマンドを受信していないと判断した場合には、ステップS206に戻るようにしても良い。この場合、コマンドの受信がない間、CPU21は、1つの自己診断処理を実行するたびに所定時間コマンドの受信待ち状態とすることなく、複数の自己診断処理を連続的に実行できる。   If no command has been received during the self-diagnosis process (step S212, NO), the CPU 21 returns to step S203 and enters a state of waiting for reception of the next command. If the CPU 21 determines that no command has been received in step S212, the CPU 21 may return to step S206. In this case, while no command is received, the CPU 21 can continuously execute a plurality of self-diagnosis processes without waiting for a command reception for a predetermined time each time one self-diagnosis process is executed.

また、コマンドを受信したと判断した場合(ステップS204、YES)(ステップS212、YES)、CPU21は、受信したコマンドに対応する処理を実行する(ステップS213)。たとえば、CPU21は、コマンド処理として、受信したコマンドの処理内容を解釈し、解釈したコマンドの処理内容に従って処理を実行し、実行した処理内容を示すレスポンスを生成し、生成したレスポンスをICカード処理装置1へ送信する。コマンド処理を終了すると、CPU21は、ステップS203へ戻り、上述した処理を繰り返す。   If it is determined that a command has been received (step S204, YES) (step S212, YES), the CPU 21 executes a process corresponding to the received command (step S213). For example, the CPU 21 interprets the processing content of the received command as the command processing, executes the processing according to the processing content of the interpreted command, generates a response indicating the executed processing content, and sends the generated response to the IC card processing device. Send to 1. When the command processing ends, the CPU 21 returns to step S203 and repeats the above-described processing.

上記のような第1の処理例のICカードは、活性化した後、自己診断処理を実行する前にATR信号を出力し、ATR信号を出力した後、受信したコマンドを実行するとともに、コマンドの受信待ち状態で複数の自己診断処理を1件ずつ順番に実行する。また、各自己診断処理の実施状況をテーブルに保持し、コマンドの待ち時間に未実行の自己診断処理を順番に実行する。   The IC card of the first processing example as described above outputs an ATR signal after activation and before executing the self-diagnosis processing, and after executing the ATR signal, executes the received command, A plurality of self-diagnosis processes are sequentially executed one by one while waiting for reception. Also, the execution status of each self-diagnosis process is held in a table, and unexecuted self-diagnosis processes are executed in order during the command waiting time.

これにより、第1の処理例によれば、ICカードは、活性化後、コマンド処理が実行可能となるまでの時間が短時間となり、上位装置に対して高速な応答が可能となる。また、第1の処理例によれば、自己診断処理をコマンドの受信待ち時間に行えるため、効率よく処理が行える。   Thus, according to the first processing example, the IC card takes a short time until the command processing can be executed after activation, and a high-speed response can be made to the host device. Further, according to the first processing example, since the self-diagnosis process can be performed during the command reception waiting time, the process can be performed efficiently.

次に、本実施形態に係るICカード2における第2の処理例について説明する。
第2の処理例では、ICカード2は、第1の処理例と同様に、活性化後に自己診断処理を実行せずにATR信号を出力してコマンドの受信待ち状態になり、コマンド受信待ち状態になってから所定時間が経過した時点でコマンド受信が無ければ、複数の自己診断処理を順番に1つずつ実行する。第2の処理例においては、自己診断処理の実行中に、コマンドの受信を開始したことを検知した場合、若しくはコマンドの受信を完了したことを検知した場合、ICカード2は、実行中の自己診断処理を中止して受信したコマンドに対するコマンド処理を実行する。
Next, a second processing example in the IC card 2 according to the present embodiment will be described.
In the second processing example, as in the first processing example, the IC card 2 outputs the ATR signal without executing the self-diagnosis processing after activation and enters a command reception waiting state. If a command is not received when a predetermined time has elapsed since then, a plurality of self-diagnosis processes are executed one by one in order. In the second processing example, when it is detected that the reception of a command is started during the execution of the self-diagnosis processing or when the reception of the command is detected, the IC card 2 Cancels the diagnostic process and executes the command process for the received command.

図5は、実施形態に係るICカード2における第2の処理例を説明するためのフローチャートである。
ICカード2は、ICカード処理装置1からの動作電源及び動作クロックを受けて活性化する(ステップS300)。活性化すると、ICカード2のCPU21は、RAM23上に自己診断の実施状況管理テーブル23aを作成し(ステップS301)、外部I/F25によりICカード処理装置1へATR(Answer To Reset)信号を出力する(ステップS302)。この段階では、自己診断の実施状況管理テーブル23aは、初期状態のままであり各種の自己診断処理の実施状況が「未」となっている。
FIG. 5 is a flowchart for explaining a second processing example in the IC card 2 according to the embodiment.
The IC card 2 is activated in response to the operating power supply and the operating clock from the IC card processing device 1 (step S300). When activated, the CPU 21 of the IC card 2 creates a self-diagnosis implementation status management table 23a on the RAM 23 (step S301), and outputs an ATR (Answer To Reset) signal to the IC card processing device 1 by the external I / F 25. (Step S302). At this stage, the self-diagnosis implementation status management table 23a remains in the initial state, and the implementation status of various self-diagnosis processes is “not yet”.

ATR信号を出力した後、ICカード2のCPU21は、ICカード処理装置1からのコマンド受信待ちの状態となる(ステップS303)。ICカード処理装置1からのコマンドの受信がなければ(ステップS304、NO)、CPU21は、コマンド受信待ち状態で所定時間が経過したか否かを判断する(ステップS305)。コマンド受信待ちの状態で所定時間が経過したと判断した場合(ステップS305、YES)、CPU21は、自己診断の実施状況管理テーブル23aを参照して自己診断処理を全て完了しているか否かを判断する(ステップS306)。全ての自己診断処理を完了していると判断した場合(ステップS306、YES)、CPU21は、ステップS303へ戻り、コマンド受信待ち状態とする。   After outputting the ATR signal, the CPU 21 of the IC card 2 waits for receiving a command from the IC card processing device 1 (step S303). If no command is received from the IC card processing device 1 (step S304, NO), the CPU 21 determines whether or not a predetermined time has elapsed in the command reception waiting state (step S305). If it is determined that a predetermined time has elapsed while waiting for command reception (YES in step S305), the CPU 21 refers to the self-diagnosis implementation status management table 23a to determine whether or not all self-diagnosis processing has been completed. (Step S306). If it is determined that all the self-diagnosis processes have been completed (step S306, YES), the CPU 21 returns to step S303 and enters a command reception waiting state.

全ての自己診断処理を完了していないと判断した場合(ステップS306、NO)、CPU21は、自己診断処理の実施状況管理テーブル23aを参照して、未実行の自己診断処理のうち次に実行すべき自己診断処理を決定する(ステップS307)。実行すべき自己診断処理を決定すると、CPU21は、実行を決定した自己診断処理を開始する(ステップS308)。   If it is determined that all the self-diagnosis processes have not been completed (NO in step S306), the CPU 21 refers to the self-diagnosis process implementation status management table 23a and executes the next of the unexecuted self-diagnosis processes. The self-diagnosis process to be determined is determined (step S307). When the self-diagnosis process to be executed is determined, the CPU 21 starts the self-diagnosis process determined to be executed (step S308).

第2の処理例では、CPU21は、自己診断処理を実行中もICカード処理装置1からのコマンドの受信を検知する。自己診断処理を実行中にコマンドの受信(コマンドの受信開始或いは受信完了)が検知されず(ステップS309、NO)、自己診断処理を終了した場合(ステップS310、YES)、CPU21は、自己診断処理が正常終了したか否かを判断する(ステップS311)。   In the second processing example, the CPU 21 detects the reception of a command from the IC card processing device 1 even during the execution of the self-diagnosis processing. If the reception of the command (command reception start or reception completion) is not detected during the execution of the self-diagnosis process (NO in step S309) and the self-diagnosis process is terminated (YES in step S310), the CPU 21 It is determined whether or not the process is normally completed (step S311).

自己診断処理が正常終了した場合(ステップS311、YES)、CPU21は、自己診断の実施状況管理テーブル23aに、正常終了した自己診断処理を実施済みとして登録する(ステップS312)。また、自己診断処理がエラーとなった場合(ステップS311、NO)、CPU21は、動作を停止し、当該ICカード2を以後の処理が実行不能な状態にする処理(HALT)を行う(ステップS313)。なお、自己診断処理がエラーとなった場合、ICカード処理装置1との通信が可能な状態であれば、CPU21は、エラーとなった自己診断処理の内容をICカード処理装置1へ通知するようにしても良い。   When the self-diagnosis process is normally completed (step S311, YES), the CPU 21 registers the self-diagnosis process that has been normally completed as having been performed in the self-diagnosis execution status management table 23a (step S312). If the self-diagnosis process results in an error (step S311, NO), the CPU 21 stops the operation and performs a process (HALT) for making the IC card 2 incapable of performing the subsequent processes (step S313). ). If an error occurs in the self-diagnosis process and the communication with the IC card processing apparatus 1 is possible, the CPU 21 notifies the IC card processing apparatus 1 of the content of the self-diagnosis process in error. Anyway.

自己診断処理が完了したことを実施状況管理テーブル23aに登録すると、CPU21は、ステップS303へ戻り、次のコマンドの受信待ち状態となる。また、CPU21は、自己診断処理が完了したことを登録した場合には、ステップS306に戻るようにしても良い。この場合、コマンドの受信がない間、CPU21は、1つの自己診断処理を完了するたびに所定時間コマンドの受信待ち状態とすることなく、複数の自己診断処理を連続的に実行できる。   When the completion of the self-diagnosis process is registered in the implementation status management table 23a, the CPU 21 returns to step S303 and enters a state of waiting for reception of the next command. Further, when registering that the self-diagnosis process is completed, the CPU 21 may return to step S306. In this case, while no command is received, the CPU 21 can continuously execute a plurality of self-diagnosis processes without waiting for a command reception for a predetermined time each time one self-diagnosis process is completed.

また、自己診断処理の実行中にコマンドの受信(コマンドの受信開始或いは受信完了)を検知した場合(ステップS309、YES)、CPU21は、実行中の自己診断処理を中止し、受信したコマンドに対応する処理を実行する(ステップS314)。実行中の自己診断処理を中止した場合、実施状況管理テーブル23aは、更新されず、当該自己診断処理の実施状況が未実施のままとなる。これにより、次に実行すべき自己診断処理を決定する場合には当該自己診断処理は未実施の処理として認識され、再実行される。   If the reception of a command (command reception start or reception completion) is detected during the execution of the self-diagnosis process (YES in step S309), the CPU 21 stops the self-diagnosis process being executed and responds to the received command. The process which performs is performed (step S314). When the self-diagnosis process being executed is stopped, the implementation status management table 23a is not updated, and the implementation status of the self-diagnosis process remains unexecuted. As a result, when the self-diagnosis process to be executed next is determined, the self-diagnosis process is recognized as an unexecuted process and re-executed.

また、CPU21は、コマンド処理として、コマンドの受信処理を完了し、受信したコマンドの処理内容を解釈し、解釈したコマンドの処理内容に従って処理を実行し、実行した処理内容を示すレスポンスを生成し、生成したレスポンスをICカード処理装置1へ送信する。このようなコマンド処理を終了すると、CPU21は、ステップS303へ戻り、上述した処理を繰り返す。   Further, the CPU 21 completes command reception processing as command processing, interprets processing content of the received command, executes processing according to processing content of the interpreted command, generates a response indicating the processing content executed, The generated response is transmitted to the IC card processing apparatus 1. When such command processing ends, the CPU 21 returns to step S303 and repeats the above-described processing.

上記のような第2の処理例のICカードは、活性化した後に自己診断処理を実行せずにATR信号を出力してコマンドの受信待ち状態とし、コマンドの受信待ち状態において複数の自己診断処理を1件ずつ順番に実行する。さらに、自己診断処理の実行中もコマンドの受信を検知し、自己診断処理の実行中にコマンドを受信した場合、実行中の自己診断処理を中止し、受信したコマンドに対する処理を実行する。   The IC card of the second processing example as described above outputs the ATR signal without executing the self-diagnosis process after being activated, and enters a command reception waiting state, and a plurality of self-diagnosis processes in the command reception waiting state. Are executed one by one in order. Further, when the reception of the command is detected during the execution of the self-diagnosis process and the command is received during the execution of the self-diagnosis process, the self-diagnosis process being executed is stopped and the process for the received command is executed.

これにより、第2の処理例によれば、ICカードは、活性化後、すぐにコマンド処理が可能となり、自己診断処理の実行中であってもコマンドを受信すると自己診断処理を中止してすぐにコマンド処理を実行できる。この結果として、ICカードは、上位装置に対する高速な応答を可能としつつ、自己診断処理を効率よく実行できる。   As a result, according to the second processing example, the IC card can perform command processing immediately after activation, and when the command is received even when the self-diagnosis processing is being executed, the self-diagnosis processing is immediately stopped. Command processing can be executed. As a result, the IC card can efficiently execute the self-diagnosis process while enabling a high-speed response to the host device.

次に、本実施形態に係るICカード2における第3の処理例について説明する。
第3の処理例では、ICカード2は、活性化後に一部の自己診断処理(例えばCPU機能確認)を実行し、その一部の自己診断処理が完了した後、ATR信号を出力してコマンドの受信待ち状態とする。ATR信号を出力した後、ICカード2は、第1の処理例あるいは第2の処理例と同様に、コマンド受信待ち状態になってから所定時間が経過した時点でコマンド受信が無ければ、複数の自己診断処理を順番に1つずつ実行する。
Next, a third processing example in the IC card 2 according to the present embodiment will be described.
In the third processing example, the IC card 2 executes a part of self-diagnosis processing (for example, CPU function confirmation) after activation, and after the part of self-diagnosis processing is completed, outputs an ATR signal to execute a command. Waiting to receive. After the output of the ATR signal, the IC card 2 is similar to the first processing example or the second processing example, and if there is no command reception when a predetermined time has elapsed since entering the command reception waiting state, The self-diagnosis process is executed one by one in order.

図6は、実施形態に係るICカード2における第3の処理例を説明するためのフローチャートである。
ICカード2は、ICカード処理装置1からの動作電源及び動作クロックを受けて活性化する(ステップS400)。活性化すると、ICカード2のCPU21は、RAM23上に自己診断の実施状況管理テーブル23aを作成する(ステップS401)。また、CPU21は、複数の自己診断処理のうち、ATR信号を出力する前に完了しておくべき自己診断処理を選定し、選定した一部の自己診断処理を実行する(ステップS402)。ATR信号を出力する前に完了しておくべき一部の自己診断処理は、たとえば、ICカードの基本的な動作を司る機能をチェックする自己診断処理(例えば、CPU機能確認)であり、予め設定されるものとする。
FIG. 6 is a flowchart for explaining a third processing example in the IC card 2 according to the embodiment.
The IC card 2 is activated in response to the operating power supply and the operating clock from the IC card processing device 1 (step S400). When activated, the CPU 21 of the IC card 2 creates a self-diagnosis implementation status management table 23a on the RAM 23 (step S401). Further, the CPU 21 selects a self-diagnosis process that should be completed before outputting the ATR signal among the plurality of self-diagnosis processes, and executes the selected part of the self-diagnosis process (step S402). A part of the self-diagnosis process to be completed before outputting the ATR signal is, for example, a self-diagnosis process (for example, CPU function confirmation) for checking a function that controls basic operation of the IC card. Shall be.

ATR信号を出力する前に実行する自己診断処理の実行中にエラーが発生した場合(ステップS403、NO)、CPU21は、動作を停止し、当該ICカード2を以後の処理が実行不能な状態にする処理(HALT)を行い、ICカード2の動作を停止する(ステップS404)。ここで、ATR信号を出力する前に実行するステップS402の自己診断処理は、ICカード2の基本的な機能であるため、ICカード2は処理を続けることなくHALT(CPU停止)とする。   If an error occurs during the execution of the self-diagnosis process executed before outputting the ATR signal (NO in step S403), the CPU 21 stops the operation and puts the IC card 2 into a state where the subsequent process cannot be executed. The processing (HALT) is performed, and the operation of the IC card 2 is stopped (step S404). Here, since the self-diagnosis process of step S402 executed before outputting the ATR signal is a basic function of the IC card 2, the IC card 2 is set to HALT (CPU stop) without continuing the process.

ATR信号を出力する前に実行すべき自己診断処理が正常終了した場合(ステップS403、YES)、CPU21は、自己診断の実施状況管理テーブル23aにおける正常終了した各自己診断処理の実施状況を示す情報を「完了」に書き換える(ステップS405)。ただし、ステップS402で実行する自己診断処理は、ATR信号を出力する前に必ず完了させておく自己診断であるため、自己診断の実施状況管理テーブル23aで管理しなくても良い。この場合、ステップS405の処理は省略される。   When the self-diagnosis process to be executed before outputting the ATR signal is normally completed (step S403, YES), the CPU 21 indicates information indicating the implementation status of each normally completed self-diagnosis process in the self-diagnosis implementation status management table 23a. Is rewritten to "completed" (step S405). However, since the self-diagnosis process executed in step S402 is a self-diagnosis that must be completed before outputting the ATR signal, the self-diagnosis execution status management table 23a may not be used. In this case, the process of step S405 is omitted.

自己診断の実施状況管理テーブル23aの更新が完了すると、CPU21は、外部I/F25によりICカード処理装置1へATR(Answer To Reset)信号を出力する(ステップS406)。ATR信号を出力した後、ICカード2のCPU21は、ICカード処理装置1からのコマンド受信待ちの状態となる(ステップS407)。   When the update of the self-diagnosis implementation status management table 23a is completed, the CPU 21 outputs an ATR (Answer To Reset) signal to the IC card processing device 1 by the external I / F 25 (step S406). After outputting the ATR signal, the CPU 21 of the IC card 2 waits for receiving a command from the IC card processing device 1 (step S407).

ICカード処理装置1からのコマンドの受信がなければ(ステップS408、NO)、CPU21は、コマンド受信待ち状態で所定時間が経過したか否かを判断する(ステップS409)。コマンド受信待ちの状態で所定時間が経過したと判断した場合(ステップS409、YES)、CPU21は、自己診断の実施状況管理テーブル23aを参照して、自己診断処理を全て完了しているか否かを判断する(ステップS410)。全ての自己診断処理を完了していると判断した場合(ステップS410、YES)、CPU21は、ステップS407へ戻り、コマンド受信待ち状態とする。   If no command is received from the IC card processing apparatus 1 (step S408, NO), the CPU 21 determines whether or not a predetermined time has elapsed in the command reception waiting state (step S409). If it is determined that the predetermined time has elapsed in the command reception waiting state (step S409, YES), the CPU 21 refers to the self-diagnosis implementation status management table 23a to determine whether or not all self-diagnosis processing has been completed. Judgment is made (step S410). If it is determined that all the self-diagnosis processes have been completed (step S410, YES), the CPU 21 returns to step S407 to enter a command reception waiting state.

また、全ての自己診断処理を完了していないと判断した場合(ステップS410、NO)、CPU21は、自己診断処理の管理テーブル23aを参照して、未実行の自己診断処理のうち次に実行すべき自己診断処理を決定する(ステップS411)。実行すべき自己診断処理を決定すると、CPU21は、実行を決定した自己診断処理を実行する(ステップS412)。実行した自己診断処理が正常終了した場合(ステップS413、YES)、CPU21は、自己診断の実施状況管理テーブル23aに、正常終了した自己診断処理の実施状況を示す情報を「完了」に書き換える(ステップS414)。   If it is determined that all self-diagnosis processes have not been completed (step S410, NO), the CPU 21 refers to the self-diagnosis process management table 23a and executes the next of the unexecuted self-diagnosis processes. The self-diagnosis process to be determined is determined (step S411). When the self-diagnosis process to be executed is determined, the CPU 21 executes the self-diagnosis process determined to be executed (step S412). When the executed self-diagnosis process is normally completed (step S413, YES), the CPU 21 rewrites the information indicating the execution state of the normally completed self-diagnosis process to “completed” in the self-diagnosis execution state management table 23a (step S413). S414).

また、実行した自己診断処理がエラーとなった場合(ステップS413、NO)、CPU21は、動作を停止し、当該ICカード2を以後の処理が実行不能な状態にする処理(HALT)を行う(ステップS415)。また、自己診断処理がエラーとなった場合、ICカード処理装置1との通信が可能な状態であれば、CPU21は、エラーとなった機能を停止するとともに、エラーとなった自己診断処理の内容をICカード処理装置1へ通知するようにしても良い。この場合、ICカード処理装置1は、ICカード2からのエラーとなった自己診断処理を示す通知を受けて、エラーとなった機能以外で実行可能な処理であればコマンドをICカード2へ供給するようにしても良い。これにより、ICカード2は、自己診断でエラーとなった場合であっても、エラーとなった機能以外で処理を継続することが可能となる。   If the executed self-diagnosis process results in an error (step S413, NO), the CPU 21 stops the operation and performs a process (HALT) for making the IC card 2 incapable of performing the subsequent process ( Step S415). If an error occurs in the self-diagnosis process and the communication with the IC card processing apparatus 1 is possible, the CPU 21 stops the function in error and the content of the self-diagnosis process in error. May be notified to the IC card processing apparatus 1. In this case, the IC card processing apparatus 1 receives a notification indicating the self-diagnosis process in error from the IC card 2 and supplies a command to the IC card 2 if it is a process that can be executed other than the function in error. You may make it do. Thereby, even if it is a case where it becomes an error by self-diagnosis, it becomes possible for IC card 2 to continue a process except the function which became an error.

自己診断処理が完了したことを登録すると、CPU21は、自己診断処理を実行中にICカード処理装置1からのコマンドを受信したか否かを判断する(ステップS416)。コマンドを受信していなければ(ステップS416、NO)、CPU21は、ステップS407へ戻り、次のコマンドの受信待ち状態となる。また、CPU21は、ステップS416においてコマンドを受信していないと判断した場合には、ステップS410に戻るようにしても良い。この場合、コマンドの受信がない間、CPU21は、1つの自己診断処理を実行するたびに所定時間コマンドの受信待ち状態とすることなく、複数の自己診断処理を連続的に実行できる。   When registering that the self-diagnosis process is completed, the CPU 21 determines whether or not a command from the IC card processing apparatus 1 has been received during the execution of the self-diagnosis process (step S416). If a command has not been received (step S416, NO), the CPU 21 returns to step S407 and enters a state of waiting for reception of the next command. If the CPU 21 determines in step S416 that a command has not been received, it may return to step S410. In this case, while no command is received, the CPU 21 can continuously execute a plurality of self-diagnosis processes without waiting for a command reception for a predetermined time each time one self-diagnosis process is executed.

コマンドを受信したと判断した場合(ステップS408、YES)(ステップS416、YES)、CPU21は、受信したコマンドに対応する処理を実行する(ステップS417)。コマンド処理を終了すると、CPU21は、ステップS407へ戻り、上述した処理を繰り返す。   If it is determined that a command has been received (step S408, YES) (step S416, YES), the CPU 21 executes processing corresponding to the received command (step S417). When the command processing ends, the CPU 21 returns to step S407 and repeats the above-described processing.

なお、第3の処理例は、第2の処理例を組み合わせて実施しても良い。すなわち、第3の処理例として説明したステップS411〜S416の処理は、第1の処理例で説明したS207〜S212に相当する処理であるが、ステップS411〜S416の処理は、第2の処理例で説明したS307〜S313に相当する処理に置き換えても実施するようにしても良い。   Note that the third processing example may be implemented in combination with the second processing example. That is, the processes of steps S411 to S416 described as the third process example are processes corresponding to S207 to S212 described in the first process example, but the processes of steps S411 to S416 are the second process example. The processing may be replaced with the processing corresponding to S307 to S313 described in the above.

上記のような第3の処理例のICカードは、活性化した後、一部の自己診断処理(例えば、CPU機能チェックなどのICカードの基本的な動作を司る機能の自己診断)を実行し、それらの一部の自己診断処理が正常終了した後にATR信号を出力する。ATR信号を出力した後、ICカードは、受信したコマンドを随時実行するとともに、コマンドの受信待ち状態において複数の自己診断処理を1件ずつ順番に実行する。   After being activated, the IC card of the third processing example as described above executes a part of self-diagnosis processing (for example, self-diagnosis of functions that control basic operations of the IC card such as CPU function check). The ATR signal is output after the self-diagnosis process of some of them is normally completed. After outputting the ATR signal, the IC card executes the received command as needed, and sequentially executes a plurality of self-diagnosis processes one by one in a command reception waiting state.

これにより、第3の処理例によれば、ICカードは、活性化後に基本的な動作を司る機能をチェックする一部の自己診断処理を実施することができ、基本的な動作を保障した状態でコマンドに対する処理を高速に行うことができる。この結果として、ICカード2の基本的な動作を保障しつつ、上位装置に対する高速な応答が実現できる。   As a result, according to the third processing example, the IC card can perform a part of self-diagnosis processing for checking the function that controls the basic operation after activation, and guarantees the basic operation. The command can be processed at high speed. As a result, a high-speed response to the host device can be realized while ensuring the basic operation of the IC card 2.

次に、本実施形態に係るICカード2における第4の処理例について説明する。
第4の処理例では、ICカード2は、活性化後に自己診断処理を実行せず、直ちにATR信号を出力してコマンドの受信待ち状態になる。コマンド受信待ち状態になった後、コマンドを受信すると、ICカード2は、受信したコマンドに応じた自己診断処理を完了させ、その自己診断処理が完了してからコマンド処理を実行するものである。
Next, a fourth processing example in the IC card 2 according to the present embodiment will be described.
In the fourth processing example, the IC card 2 does not execute the self-diagnosis processing after activation, but immediately outputs an ATR signal and enters a command reception waiting state. When receiving the command after entering the command reception waiting state, the IC card 2 completes the self-diagnosis process corresponding to the received command, and executes the command process after the self-diagnosis process is completed.

図7は、実施形態に係るICカード2における第4の処理例を説明するためのフローチャートである。
ICカード2は、ICカード処理装置1からの動作電源及び動作クロックを受けて活性化する(ステップS500)。活性化すると、ICカード2のCPU21は、RAM23上に自己診断の実施状況管理テーブル23aを作成し(ステップS501)、外部I/F25によりICカード処理装置1へATR(Answer To Reset)信号を出力する(ステップS502)。
FIG. 7 is a flowchart for explaining a fourth processing example in the IC card 2 according to the embodiment.
The IC card 2 is activated upon receiving the operation power and the operation clock from the IC card processing device 1 (step S500). When activated, the CPU 21 of the IC card 2 creates a self-diagnosis execution status management table 23a on the RAM 23 (step S501), and outputs an ATR (Answer To Reset) signal to the IC card processing device 1 by the external I / F 25. (Step S502).

ATR信号を出力した後、ICカード2のCPU21は、ICカード処理装置1からのコマンド受信待ちの状態となる(ステップS503)。ICカード処理装置1からのコマンドの受信があった場合(ステップS504、YES)、CPU21は、受信したコマンドの処理内容を解釈する(ステップS505)。受信したコマンドの処理内容を解釈すると、CPU21は、受信したコマンドが不適切な処理内容であるか否かを判断する(ステップS506)。たとえば、CPU21は、受信したコマンドにおけるパラメータ値が適切であるか、あるいは、受信したコマンドの実行順序などが正当であるかなどにより、受信したコマンドが不適切な内容であるか否かを判断する。受信したコマンドが不適切であると判断した場合(ステップS506、YES)、CPU21は、エラー内容などを示す情報を含むレスポンスを送信するなどのエラー処理を行う(ステップS507)。   After outputting the ATR signal, the CPU 21 of the IC card 2 waits to receive a command from the IC card processing device 1 (step S503). When a command is received from the IC card processing apparatus 1 (step S504, YES), the CPU 21 interprets the processing content of the received command (step S505). When interpreting the processing content of the received command, the CPU 21 determines whether or not the received command has inappropriate processing content (step S506). For example, the CPU 21 determines whether or not the received command has an inappropriate content depending on whether the parameter value in the received command is appropriate or the execution order of the received command is valid. . If it is determined that the received command is inappropriate (YES in step S506), the CPU 21 performs error processing such as transmitting a response including information indicating the error content (step S507).

受信したコマンドが不適切なものでないと判断した場合(ステップS506、NO)、CPU21は、自己診断のコマンド別管理テーブル24aを参照して、解釈したコマンドの処理内容に対してコマンド処理の実行前に実施しておくべき自己診断処理を判断する(ステップS508)。   If it is determined that the received command is not inappropriate (NO in step S506), the CPU 21 refers to the self-diagnosis command-by-command management table 24a and executes the command processing for the interpreted command processing content. The self-diagnosis process to be performed is determined (step S508).

自己診断のコマンド別管理テーブル24aは、各コマンドについてコマンド処理を実行する前に実施しておくべき自己診断処理を示す情報を格納したテーブルである。たとえば、自己診断のコマンド別管理テーブル24aには、各コマンドのコマンド処理で使用する機能に対応する自己診断処理を示す情報を設定する。本実施形態においては、ICカード2が実行すべき自己診断処理は、例えば、各種の機能ごとの自己診断処理に分割されており、自己診断のコマンド別管理テーブル24aは、コマンド別に分割された個々の自己診断処理が実行すべきか否かを示す情報を記憶するものとする。   The self-diagnosis command-by-command management table 24a is a table storing information indicating self-diagnosis processing to be performed before executing command processing for each command. For example, information indicating the self-diagnosis process corresponding to the function used in the command process of each command is set in the self-diagnosis command management table 24a. In the present embodiment, the self-diagnosis process to be executed by the IC card 2 is divided into, for example, self-diagnosis processes for various functions, and the self-diagnosis command-by-command management table 24a is divided into individual commands. Information indicating whether or not self-diagnosis processing should be executed is stored.

図8は、自己診断のコマンド別管理テーブル24aの構成例を示す図である。図8に示す自己診断のコマンド別管理テーブル24aの例では、コマンド(コマンドに対する処理内容)ごとに、各自己診断処理(自己診断項目)を実施すべきか不要であるかを示す情報が格納されている。たとえば、図8に示す例では、アプリケーションの選択を要求するコマンドに対しては、CPU機能確認、プログラム領域のCRCチェックおよび共通データのデータ領域のCRCチェックの自己診断処理が実施すべきで、その他の自己診断処理が不要と設定されている。   FIG. 8 is a diagram illustrating a configuration example of the self-diagnosis command management table 24a. In the example of the self-diagnosis command management table 24a shown in FIG. 8, information indicating whether each self-diagnosis process (self-diagnostic item) should be executed or not is stored for each command (processing contents for the command). Yes. For example, in the example shown in FIG. 8, for a command requesting selection of an application, CPU function confirmation, CRC check of the program area and CRC check of the data area of the common data should be performed. The self-diagnosis process is set to be unnecessary.

実施すべき自己診断処理を判断すると、CPU21は、さらに、自己診断の実施状況管理テーブル23aを参照して、実施しておくべきと判断した各自己判断処理のうち未処理の自己診断処理を実際に実行すべき自己判断処理として特定する(ステップS509)。実際に実行すべきる自己判断処理を特定すると、CPU21は、実行すべき自己診断処理を実行する(ステップS510)。   When determining the self-diagnosis process to be performed, the CPU 21 further refers to the self-diagnosis execution status management table 23a and actually executes the unprocessed self-diagnosis process among the self-determination processes determined to be performed. The self-determination process to be executed is specified (step S509). When the self-determination process to be actually executed is specified, the CPU 21 executes the self-diagnosis process to be executed (step S510).

自己診断処理の実行中にエラーが発生した場合(ステップS511、NO)、CPU21は、動作を停止し、当該ICカード2を以後の処理が実行不能な状態にする処理(HALT)を行う(ステップS512)。また、自己診断処理がエラーとなった場合であってもICカード処理装置1との通信が可能な状態であれば、CPU21は、エラーとなった機能を停止するとともに、エラーとなった自己診断処理の内容をICカード処理装置1へ通知するようにしても良い。   If an error occurs during the execution of the self-diagnosis process (step S511, NO), the CPU 21 stops the operation and performs a process (HALT) for making the IC card 2 incapable of performing the subsequent processes (step S511). S512). If the communication with the IC card processing apparatus 1 is still possible even when the self-diagnosis process is an error, the CPU 21 stops the function that caused the error and the self-diagnosis that caused the error. You may make it notify the content of a process to IC card processing apparatus 1. FIG.

自己診断処理が正常終了した場合(ステップS511、YES)、CPU21は、自己診断の実施状況管理テーブル23aにおける正常終了した各自己診断処理の実施状況を示す情報を「完了」に書き換える(ステップS513)。自己診断の実施状況管理テーブル23aの更新が完了すると、CPU21は、受信したコマンドに対する処理を実行する(ステップS514)。コマンドに対する処理を実行すると、CPU21は、当該コマンドに対する処理結果を示す情報を含むレスポンスを生成し、生成したレスポンスを外部I/F25によりICカード処理装置1へ出力する(ステップS515)。受信したコマンドに対するレスポンスを送信した後、CPU21は、ステップS503へ戻り、上述した処理を繰り返す。   When the self-diagnosis process is normally completed (step S511, YES), the CPU 21 rewrites the information indicating the execution status of each normally completed self-diagnosis process in the self-diagnosis execution status management table 23a to "completed" (step S513). . When the update of the self-diagnosis implementation status management table 23a is completed, the CPU 21 executes processing for the received command (step S514). When processing for the command is executed, the CPU 21 generates a response including information indicating the processing result for the command, and outputs the generated response to the IC card processing device 1 by the external I / F 25 (step S515). After transmitting a response to the received command, the CPU 21 returns to step S503 and repeats the above-described processing.

上記のような第4の処理例のICカードは、活性化した後、自己診断処理を実行する前にATR信号を出力する。ATR信号を出力した後、ICカードは、コマンドを受信するごとに、当該コマンドの処理を実行する前に実施しておくべき自己診断処理を判断し、実施しておくべきと判断した自己診断処理のうち未実施の自己診断処理をコマンド処理を実行する前に実行する。   The IC card of the fourth processing example as described above outputs an ATR signal after being activated and before executing the self-diagnosis processing. After outputting the ATR signal, each time the IC card receives a command, the IC card determines a self-diagnosis process that should be performed before executing the process of the command. The self-diagnosis process that has not been executed is executed before the command process is executed.

これにより、第4の処理例によれば、ICカードは、活性化後、直ぐにATR信号を出力することにより上位装置に対する高速な応答が可能となり、受信したコマンドに応じて必要な自己診断処理を実行することにより、コマンドの実行前にコマンドに応じた自己診断を確実に実施することができる。   As a result, according to the fourth processing example, the IC card can immediately respond to the host device by outputting an ATR signal immediately after activation, and can perform necessary self-diagnosis processing according to the received command. By executing, the self-diagnosis according to the command can be surely performed before executing the command.

次に、本実施形態に係るICカード2における第5の処理例について説明する。
第5の処理例としては、第1の処理例と第4の処理例とを組み合わせた処理が考えられる。つまり、第5の処理例では、ICカード2は、活性化後に自己診断処理を実行せずにATR信号を出力してコマンドの受信待ち状態になる。受信待ち状態になってから所定時間が経過してもコマンド受信が無ければ、ICカード2は、複数の自己診断処理を順番に1つずつ実行し、コマンドの受信が有れば、受信したコマンドに応じた自己診断処理のうち未実施の自己診断処理を完了させてからコマンド処理を実行するものである。
Next, a fifth processing example in the IC card 2 according to the present embodiment will be described.
As a fifth processing example, a combination of the first processing example and the fourth processing example can be considered. That is, in the fifth processing example, the IC card 2 outputs the ATR signal without executing the self-diagnosis processing after being activated, and enters a command reception waiting state. If no command is received even after a predetermined time has elapsed since entering the reception waiting state, the IC card 2 executes a plurality of self-diagnosis processes one by one in order, and if a command is received, the received command Among the self-diagnosis processes corresponding to the above, the command process is executed after the unexecuted self-diagnosis process is completed.

図9及び図10は、実施形態に係るICカード2における第5の処理例を説明するためのフローチャートである。
図9に示すステップS600〜S612は、第1の処理例として説明したステップS200〜S212に相当する処理であり、図10に示すS615〜S625は、第4の処理例として説明した図7のステップS505〜S515に相当する処理である。このため、第5の処理例としては、各ステップについての詳細な説明は省略するものとする。
9 and 10 are flowcharts for explaining a fifth processing example in the IC card 2 according to the embodiment.
Steps S600 to S612 shown in FIG. 9 are processes corresponding to steps S200 to S212 described as the first processing example, and S615 to S625 shown in FIG. 10 are steps of FIG. 7 described as the fourth processing example. This process corresponds to S505 to S515. For this reason, in the fifth processing example, detailed description of each step is omitted.

上記のような第5の処理例によれば、ICカードは、活性化後の上位装置に対する高速応答を実現でき、かつ、コマンドの実行前にコマンドに応じた自己診断を確実に実施することができる。   According to the fifth processing example as described above, the IC card can realize a high-speed response to the host device after activation, and can reliably perform self-diagnosis according to the command before executing the command. it can.

次に、本実施形態に係るICカード2における第6の処理例について説明する。
第6の処理例としては、第2の処理例と第4の処理例とを組み合わせた処理が考えられる。つまり、第6の処理例では、ICカード2は、活性化後に自己診断処理を実行せずにATR信号を出力してコマンドの受信待ち状態になる。受信待ち状態になってから所定時間が経過してもコマンド受信が無ければ、ICカード2は、複数の自己診断処理を順番に実行し、コマンド待ち時間に実行した自己診断処理の実行中にコマンドの受信を検知した場合には、実行中の自己診断処理を中止して受信したコマンドに対するコマンド処理を実行する。さらに、コマンドを受信した場合、ICカード2は、受信したコマンドに応じた自己診断処理のうち未実施の自己診断処理を完了させてからコマンド処理を実行するものである。
Next, a sixth processing example in the IC card 2 according to the present embodiment will be described.
As a sixth processing example, a combination of the second processing example and the fourth processing example can be considered. That is, in the sixth processing example, the IC card 2 outputs the ATR signal without executing the self-diagnosis processing after activation and enters a command reception waiting state. If no command is received even after a predetermined time has elapsed since entering the reception waiting state, the IC card 2 executes a plurality of self-diagnosis processes in order, and executes a command during execution of the self-diagnosis process executed during the command waiting time. Is detected, the currently executing self-diagnosis process is stopped, and the command process for the received command is executed. Further, when a command is received, the IC card 2 executes the command process after completing the unexecuted self-diagnosis process among the self-diagnosis processes corresponding to the received command.

たとえば、第6の処理例として、ICカード2は、第2の処理例として説明した図5のステップS300〜S313に相当する処理を実行しつつ、コマンドを受信した場合には、第4の処理例として説明した図7のステップS505〜S515に相当する処理を実行するようにすれば良い。
上記のような第6の処理例によれば、ICカードは、活性化後の上位装置への高速応答を実現でき、かつ、コマンドの実行前にコマンドに応じた自己診断を確実に実施することができる。
For example, as a sixth processing example, the IC card 2 executes the processing corresponding to steps S300 to S313 of FIG. 5 described as the second processing example, and receives the command, and then performs the fourth processing. What is necessary is just to perform the process corresponded to step S505-S515 of FIG. 7 demonstrated as an example.
According to the sixth processing example as described above, the IC card can realize a high-speed response to the host device after activation, and reliably perform a self-diagnosis according to the command before executing the command. Can do.

次に、本実施形態に係るICカード2における第7の処理例について説明する。
第7の処理例としては、第3の処理例と第4の処理例とを組み合わせた処理が考えられる。つまり、第7の処理例では、ICカード2は、活性化後に一部の自己診断処理(例えばICカードの基本的な動作を司る機能の確認)を実行し、その一部の自己診断処理が完了した後、ATR信号を出力してコマンドの受信待ち状態とする。ATR信号を出力した後、ICカード2は、コマンド受信待ち状態が所定時間継続すれば、複数の自己診断処理を順番に実行し、コマンドを受信した場合には、受信したコマンドに応じた自己診断処理のうち未実施の自己診断処理を完了させてからコマンド処理を実行するものである。
Next, a seventh processing example in the IC card 2 according to the present embodiment will be described.
As a seventh processing example, a combination of the third processing example and the fourth processing example can be considered. In other words, in the seventh processing example, the IC card 2 executes a part of self-diagnosis processing (for example, confirmation of functions that control basic operation of the IC card) after activation, and part of the self-diagnosis processing is performed. After completion, the ATR signal is output to wait for command reception. After outputting the ATR signal, the IC card 2 executes a plurality of self-diagnosis processes in order if the command reception waiting state continues for a predetermined time. When a command is received, the IC card 2 performs self-diagnosis according to the received command. The command processing is executed after completing the unexecuted self-diagnosis processing among the processing.

たとえば、第7の処理例として、ICカード2は、第3の処理例として説明した図6のステップS400〜S416に相当する処理を実行しつつ、コマンドを受信した場合には、第4の処理例として説明した図7のステップS505〜S515に相当する処理を実行するようにすれば良い。
上記のような第7の処理例によれば、ICカードは、活性化後にICカードの基本的な動作を司る機能を確認する自己診断を確実に行った上での上位装置への高速な応答を実現でき、かつ、コマンド処理の実行前にはコマンドに応じた自己診断処理を確実に完了しておくようにすることができる。
For example, as a seventh processing example, when the IC card 2 receives a command while executing the processing corresponding to steps S400 to S416 of FIG. 6 described as the third processing example, the fourth processing is performed. What is necessary is just to perform the process corresponded to step S505-S515 of FIG. 7 demonstrated as an example.
According to the seventh processing example as described above, the IC card performs a high-speed response to the host device after reliably performing a self-diagnosis for confirming the function that controls the basic operation of the IC card after activation. In addition, the self-diagnosis process corresponding to the command can be surely completed before the command process is executed.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

1…ICカード処理装置(外部装置)、2…ICカード(携帯可能電子装置)、11…制御部、12…ディスプレイ、13…操作部、14…カードリーダライタ、C…ICカード本体、M…ICモジュール、Ca…ICチップ、21…CPU、22…ROM、23…RAM、23a…自己診断の実施状況管理テーブル、24…不揮発性メモリ、24a…自己診断のコマンド別管理テーブル、25…外部I/F、26…コプロセッサ。   DESCRIPTION OF SYMBOLS 1 ... IC card processing apparatus (external device), 2 ... IC card (portable electronic device), 11 ... Control part, 12 ... Display, 13 ... Operation part, 14 ... Card reader / writer, C ... IC card main body, M ... IC module, Ca ... IC chip, 21 ... CPU, 22 ... ROM, 23 ... RAM, 23a ... Self-diagnosis implementation status management table, 24 ... Non-volatile memory, 24a ... Self-diagnosis command-specific management table, 25 ... External I / F, 26 ... Coprocessor.

Claims (14)

外部装置に通信接続する通信インターフェースと、
前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、
前記活性化後に実施すべき複数の自己診断処理の実施状況を記憶する記憶手段と、
前記外部装置からのコマンドの受信待ち状態において前記記憶手段で未実施の状態となっている自己診断処理を順番に実行する自己診断実行手段と、
前記通信手段により前記外部装置からコマンドを受信した場合、前記記憶手段に記憶した各自己診断処理の実施状況によらずに受信したコマンドに対する処理を実行するコマンド処理手段と、
を有するICカード。
A communication interface for communication connection to an external device;
Control means for waiting to receive a command from the external device after being activated by receiving an operation power supply and an operation clock from the external device;
Storage means for storing the implementation status of a plurality of self-diagnosis processes to be performed after the activation;
Self-diagnosis execution means for sequentially executing self-diagnosis processing in an unexecuted state in the storage means in a state of waiting to receive a command from the external device;
When a command is received from the external device by the communication unit, a command processing unit that executes a process for the received command regardless of the implementation status of each self-diagnosis process stored in the storage unit;
IC card having
さらに、前記活性化後に複数の自己診断処理のうち一部の自己診断処理を実行する第2の自己診断実行手段を有し、
前記制御手段は、前記第2の自己診断実行手段により実行した一部の自己診断処理が正常終了した場合、前記外部装置からのコマンド受信待ち状態とする、
前記請求項1に記載のICカード。
And a second self-diagnosis execution means for executing a part of the plurality of self-diagnosis processes after the activation.
The control means, when a part of the self-diagnosis processing executed by the second self-diagnosis execution means is normally completed, enters a command reception waiting state from the external device,
The IC card according to claim 1.
前記コマンド処理手段は、前記自己診断実行手段により自己診断処理を実行中にコマンドを受信した場合、実行中の1つの自己診断処理が終了した後、前記通信手段により前記外部装置から受信するコマンドに対する処理を実行する、
前記請求項1又は2の何れか1項に記載のICカード。
When the command processing means receives a command during execution of the self-diagnosis process by the self-diagnosis execution means, the command processing means responds to a command received from the external device by the communication means after completion of one self-diagnosis process being executed. Execute the process,
The IC card according to any one of claims 1 and 2.
前記自己診断実行手段は、前記自己診断処理を実行中にコマンドを受信した場合、実行中の自己診断処理を中止し、
前記コマンド処理手段は、前記自己診断処理の中止後に前記通信手段により前記外部装置から受信するコマンドに対する処理を実行する、
前記請求項1又は2の何れか1項に記載のICカード。
The self-diagnosis executing means, when receiving a command during the execution of the self-diagnosis process, stops the self-diagnosis process being executed,
The command processing means executes processing for a command received from the external device by the communication means after the self-diagnosis processing is stopped;
The IC card according to any one of claims 1 and 2.
外部装置に通信接続する通信インターフェースと、
コマンド毎にコマンド処理を実行する前に実施しておくべき自己診断処理を示す情報を記憶する記憶手段と、
前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、
前記外部装置からコマンドを受信した場合、前記記憶手段により受信したコマンドを実行する前に実施しておくべき自己診断処理を特定し、特定した自己診断処理を完了させる自己診断実行手段と、
前記自己診断実行手段により実施しておくべき自己診断処理が完了した後、前記外部装置から受信したコマンドに対する処理を実行するコマンド処理手段と、
を有するICカード。
A communication interface for communication connection to an external device;
Storage means for storing information indicating self-diagnosis processing to be performed before executing command processing for each command;
Control means for waiting to receive a command from the external device after being activated by receiving an operation power supply and an operation clock from the external device;
When receiving a command from the external device, the self-diagnosis execution unit for identifying the self-diagnosis process to be performed before executing the command received by the storage unit and completing the identified self-diagnosis process;
Command processing means for executing processing for a command received from the external device after completion of self-diagnosis processing to be performed by the self-diagnosis execution means;
IC card having
さらに、前記活性化後に実施すべき複数の自己診断処理の実施状況を記憶する第2の記憶手段を有し、
前記自己診断実行手段は、前記受信したコマンドを実行する前に実施しておくべき自己診断処理として特定した自己診断処理のうち未実施の自己診断処理を前記第2の記憶手段により判断し、未実施であると判断した自己診断処理を実行する、
前記請求項5に記載のICカード。
Furthermore, it has a 2nd memory | storage means to memorize | store the implementation condition of the several self-diagnosis process which should be implemented after the said activation,
The self-diagnosis execution unit determines an unexecuted self-diagnosis process among the self-diagnosis processes specified as the self-diagnosis process to be performed before executing the received command by the second storage unit. Execute the self-diagnosis process determined to be
The IC card according to claim 5.
さらに、前記外部装置からのコマンドの受信待ちが継続した状態において前記第2の記憶手段で未実施の状態となっている自己診断処理を順番に実行する第2の自己診断実行手段を有する、
前記請求項6に記載のICカード。
Furthermore, it has second self-diagnosis execution means for sequentially executing self-diagnosis processing that is in an unexecuted state in the second storage means in a state in which the reception of a command from the external device is continued.
The IC card according to claim 6.
さらに、前記活性化後に複数の自己診断処理のうち一部の自己診断処理を実行する第
3の自己診断実行手段を有し、
前記制御手段は、前記第3の自己診断実行手段により実行した一部の自己診断処理が正常終了した場合、前記外部装置からのコマンド受信待ち状態とする、
前記請求項5乃至7の何れか1項に記載のICカード。
Furthermore, it has a third self-diagnosis execution means for executing a part of the plurality of self-diagnosis processes after the activation,
The control means, when a part of the self-diagnosis processing executed by the third self-diagnosis execution means is normally completed, enters a command reception waiting state from the external device.
The IC card according to any one of claims 5 to 7.
前記コマンド処理手段は、前記第2の自己診断実行手段により自己診断処理を実行中にコマンドを受信した場合、実行中の1つの自己診断処理が終了した後、前記通信手段により前記外部装置から受信するコマンドに対する処理を実行する、
前記請求項7又は8の何れか1項に記載のICカード。
When the command processing means receives a command during execution of the self-diagnosis processing by the second self-diagnosis execution means, the command processing means receives from the external device by the communication means after completion of one self-diagnosis process being executed. Execute the process for the command
The IC card according to any one of claims 7 and 8.
前記第2の自己診断実行手段は、前記自己診断処理を実行中にコマンドを受信した場合、実行中の自己診断処理を中止し、
前記コマンド処理手段は、前記自己診断処理の中止後に前記通信手段により前記外部装置から受信するコマンドに対する処理を実行する、
前記請求項7又は8の何れか1項に記載のICカード。
When the second self-diagnosis execution unit receives a command during the execution of the self-diagnosis process, the second self-diagnosis execution unit stops the self-diagnosis process being executed,
The command processing means executes processing for a command received from the external device by the communication means after the self-diagnosis processing is stopped;
The IC card according to any one of claims 7 and 8.
外部装置に通信接続する通信インターフェースと、前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、前記活性化後に実施すべき複数の自己診断処理の実施状況を記憶する記憶手段と、前記外部装置からのコマンドの受信待ち状態において前記記憶手段で未実施の状態となっている自己診断処理を順番に実行する自己診断実行手段と、前記通信手段により前記外部装置からコマンドを受信した場合、前記記憶手段に記憶した各自己診断処理の実施状況によらずに受信したコマンドに対する処理を実行するコマンド処理手段とを有するモジュールと、
前記モジュールを有する本体と、
を有するICカード。
A communication interface for communication connection to an external device, a control means for waiting for a command to be received from the external device after being activated upon receipt of an operating power supply and an operating clock from the external device, and a plurality of units to be implemented after the activation Storage means for storing the execution status of the self-diagnosis processing, and self-diagnosis execution means for sequentially executing the self-diagnosis processing that has not been executed in the storage means in a state of waiting to receive a command from the external device. A command processing unit that executes processing for the received command regardless of the execution status of each self-diagnosis processing stored in the storage unit when a command is received from the external device by the communication unit;
A body having the module;
IC card having
外部装置に通信接続する通信インターフェースと、コマンド毎にコマンド処理を実行する前に実施しておくべき自己診断処理を示す情報を記憶する記憶手段と、前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、前記外部装置からコマンドを受信した場合、前記記憶手段により受信したコマンドを実行する前に実施しておくべき自己診断処理を特定し、特定した自己診断処理を完了させる自己診断実行手段と、前記自己診断実行手段により実施しておくべき自己診断処理が完了した後、前記外部装置から受信したコマンドに対する処理を実行するコマンド処理手段と、を有するモジュールと、
前記モジュールを有する本体と、
を有するICカード。
A communication interface for communicating with an external device, storage means for storing information indicating self-diagnosis processing to be performed before executing command processing for each command, an operating power supply and an operating clock from the external device are received. Control means for waiting to receive a command from the external device after activation, and a self-diagnosis process to be performed before executing the command received by the storage means when a command is received from the external device A self-diagnosis execution unit that completes the specified self-diagnosis process, and a command that executes a process for a command received from the external device after the self-diagnosis process to be performed by the self-diagnosis execution unit is completed A module having processing means;
A body having the module;
IC card having
外部装置からのコマンドに応じた処理を行う携帯可能電子装置において、
前記外部装置に通信接続する通信インターフェースと、
前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、
前記活性化後に実施すべき複数の自己診断処理の実施状況を記憶する記憶手段と、
前記外部装置からのコマンドの受信待ち状態において前記記憶手段で未実施の状態となっている自己診断処理を順番に実行する自己診断実行手段と、
前記通信手段により前記外部装置からコマンドを受信した場合、前記記憶手段に記憶した各自己診断処理の実施状況によらずに受信したコマンドに対する処理を実行するコマンド処理手段と、
を有する携帯可能電子装置。
In a portable electronic device that performs processing according to a command from an external device,
A communication interface for communication connection to the external device;
Control means for waiting to receive a command from the external device after being activated by receiving an operation power supply and an operation clock from the external device;
Storage means for storing the implementation status of a plurality of self-diagnosis processes to be performed after the activation;
Self-diagnosis execution means for sequentially executing self-diagnosis processing in an unexecuted state in the storage means in a state of waiting to receive a command from the external device;
When a command is received from the external device by the communication unit, a command processing unit that executes a process for the received command regardless of the implementation status of each self-diagnosis process stored in the storage unit;
A portable electronic device.
外部装置からのコマンドに応じた処理を行う携帯可能電子装置において、
前記外部装置に通信接続する通信インターフェースと、
コマンド毎にコマンド処理を実行する前に実施しておくべき自己診断処理を示す情報を記憶する記憶手段と、
前記外部装置からの動作電源及び動作クロックを受けて活性化した後に前記外部装置からのコマンド受信待ち状態とする制御手段と、
前記外部装置からコマンドを受信した場合、前記記憶手段により受信したコマンドを実行する前に実施しておくべき自己診断処理を特定し、特定した自己診断処理を完了させる自己診断実行手段と、
前記自己診断実行手段により実施しておくべき自己診断処理が完了した後、前記外部装置から受信したコマンドに対する処理を実行するコマンド処理手段と、
を有する携帯可能電子装置。
In a portable electronic device that performs processing according to a command from an external device,
A communication interface for communication connection to the external device;
Storage means for storing information indicating self-diagnosis processing to be performed before executing command processing for each command;
Control means for waiting to receive a command from the external device after being activated by receiving an operation power supply and an operation clock from the external device;
When receiving a command from the external device, the self-diagnosis execution unit for identifying the self-diagnosis process to be performed before executing the command received by the storage unit and completing the identified self-diagnosis process;
Command processing means for executing processing for a command received from the external device after completion of self-diagnosis processing to be performed by the self-diagnosis execution means;
A portable electronic device.
JP2012204390A 2012-09-18 2012-09-18 Ic card and mobile electronic device Pending JP2014059731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012204390A JP2014059731A (en) 2012-09-18 2012-09-18 Ic card and mobile electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012204390A JP2014059731A (en) 2012-09-18 2012-09-18 Ic card and mobile electronic device

Publications (1)

Publication Number Publication Date
JP2014059731A true JP2014059731A (en) 2014-04-03

Family

ID=50616152

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012204390A Pending JP2014059731A (en) 2012-09-18 2012-09-18 Ic card and mobile electronic device

Country Status (1)

Country Link
JP (1) JP2014059731A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016099711A (en) * 2014-11-19 2016-05-30 凸版印刷株式会社 Ic card and its starting method
JP7400528B2 (en) 2020-02-21 2023-12-19 大日本印刷株式会社 IC card with self-diagnosis function and IC card self-diagnosis method
JP7468598B1 (en) 2022-10-27 2024-04-16 大日本印刷株式会社 Electronic information storage medium, IC chip, non-contact IC card, processing method, and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016099711A (en) * 2014-11-19 2016-05-30 凸版印刷株式会社 Ic card and its starting method
JP7400528B2 (en) 2020-02-21 2023-12-19 大日本印刷株式会社 IC card with self-diagnosis function and IC card self-diagnosis method
JP7468598B1 (en) 2022-10-27 2024-04-16 大日本印刷株式会社 Electronic information storage medium, IC chip, non-contact IC card, processing method, and program

Similar Documents

Publication Publication Date Title
EP2033145B1 (en) Portable electronic device and control method thereof
KR20060049641A (en) Mobile electronic equipment
US20080184372A1 (en) Storage device, data processing device, data processing system, and program
US10528857B2 (en) IC card, portable electronic device, and information processing method
JP2014059731A (en) Ic card and mobile electronic device
KR101783526B1 (en) Ic card, electronic device and portable electronic device
US20170200071A1 (en) Ic card, portable electronic apparatus, and processing apparatus
EP2538365B1 (en) Information input display device and control program thereof
JP2006330891A (en) Id card preparation system and id card preparation method
US20110227708A1 (en) Portable electronic device, communication device, and command processing method
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
JP6251364B2 (en) Station service equipment
JP5444143B2 (en) Portable electronic device and IC card
KR101660180B1 (en) Ic card, portable electronic apparatus, and ic card processing apparatus
JP2005275456A (en) Portable electronic medium, integrated circuit used in portable electronic medium, and method for issuing portable electronic medium
JP5789526B2 (en) Mobile device
JP2010250407A (en) Portable terminal
JP2013164686A (en) Ic card and portable electronic device
JP6054218B2 (en) Station service equipment
JP6829123B2 (en) IC sheet issuing program and IC sheet issuing system
JP2009187495A (en) Information processing unit, information processing method, and program
JP2017142655A (en) Electronic information storage medium, information processing method, and information processing program
JP2005173871A (en) Portable information storage medium, its holder, and program for the portable information storage medium
JP2014182505A (en) Ic card and portable electronic device
JP2015219722A (en) Ic card and portable processing device

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131219

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131226

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20140109