JP2013069062A - Ic card, portable electronic device, and self-diagnosis method of ic card - Google Patents

Ic card, portable electronic device, and self-diagnosis method of ic card Download PDF

Info

Publication number
JP2013069062A
JP2013069062A JP2011206230A JP2011206230A JP2013069062A JP 2013069062 A JP2013069062 A JP 2013069062A JP 2011206230 A JP2011206230 A JP 2011206230A JP 2011206230 A JP2011206230 A JP 2011206230A JP 2013069062 A JP2013069062 A JP 2013069062A
Authority
JP
Japan
Prior art keywords
card
self
diagnosis
upper limit
specific command
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.)
Withdrawn
Application number
JP2011206230A
Other languages
Japanese (ja)
Inventor
Mitsufumi Matsuo
充史 松尾
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 JP2011206230A priority Critical patent/JP2013069062A/en
Publication of JP2013069062A publication Critical patent/JP2013069062A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Credit Cards Or The Like (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an IC card, a portable electronic device, and a self-diagnosis method of the IC card such that a self-diagnosis can be made even in a use style in which activation is hardly performed.SOLUTION: An IC card 1 includes counting means, determination means, and execution means. The counting means counts how many times a specific command is received. The determination means determines whether the number of times of reception of the specific command that the counting means counts reaches an upper-limit value. The execution means makes a self-diagnosis when the determination means determines that the number of times of reception of the specific command reaches the upper-limit value.

Description

本発明の実施形態は、ICカード、携帯可能電子装置及びICカードにおける自己診断方法に関する。   Embodiments described herein relate generally to an IC card, a portable electronic device, and a self-diagnosis method for an IC card.

ICカードは、活性化時に自己診断処理を実施するように実装されている場合が多い。従来のICカードは、活性化する毎に自己診断を実行し、アプリケーションが動作する前に故障を検知する。しかしながら、長期間電源のオフされないような運用形態では、ICカードは、自己診断が行わない可能性がある。たとえば、携帯電話機に接続されるICカードは、携帯電話機自体が長期間にわたって電源の遮断及び投入を実施されない場合、長期間自己診断が行われない。長期間自己診断が実施されないICカードでは、アプリケーション処理を実行中に故障が発生してしまう可能性がある。アプリケーション処理の実行途中で故障が発生すると、中途まで処理したアプリケーション状態を元に戻す必要があり、復旧が困難な状況となることがある。   IC cards are often mounted so that self-diagnosis processing is performed when activated. A conventional IC card performs a self-diagnosis each time it is activated, and detects a failure before an application operates. However, in an operation mode in which the power is not turned off for a long time, the IC card may not perform self-diagnosis. For example, an IC card connected to a mobile phone is not self-diagnosed for a long time if the mobile phone itself is not turned off and on for a long time. In an IC card that is not subjected to self-diagnosis for a long period of time, a failure may occur during execution of application processing. If a failure occurs during the execution of application processing, it is necessary to restore the application state that has been processed halfway, making recovery difficult.

ISO/IEC7816−3ISO / IEC7816-3

この発明は、活性化が行われにくい使用形態であっても自己診断を実行できるICカード、携帯可能電子装置およびICカードにおける自己診断方法を提供することを目的とする。   An object of the present invention is to provide an IC card, a portable electronic device, and a self-diagnosis method in an IC card that can execute self-diagnosis even in a usage form that is difficult to activate.

実施形態によれば、ICカードは、実施形態によれば、ICカードは、計数手段と、判断手段と、実行手段とを有する。計数手段は、特定のコマンドを受けた回数を計数する。判断手段は、計数手段により計数した特定のコマンドを受けた回数が上限値に達したか否かを判断する。実行段は、判断手段により特定のコマンドを受けた回数が上限値に達したと判断した場合、自己診断を実行する。   According to the embodiment, the IC card according to the embodiment includes a counting unit, a determining unit, and an executing unit. The counting means counts the number of times a specific command is received. The determining means determines whether or not the number of times of receiving the specific command counted by the counting means has reached an upper limit value. The execution stage executes self-diagnosis when it is determined that the number of times the specific command is received by the determination means has reached the upper limit.

図1は、実施形態に係るICカードの構成例を概略的に示す図である。FIG. 1 is a diagram schematically illustrating a configuration example of an IC card according to an embodiment. 図2は、実施形態に係るICカードが装着される端末装置としての携帯電話機の構成例を概略的に示す図である。FIG. 2 is a diagram schematically illustrating a configuration example of a mobile phone as a terminal device to which the IC card according to the embodiment is mounted. 図3は、ICカードの第1の動作例を説明するためのフローチャートである。FIG. 3 is a flowchart for explaining a first operation example of the IC card. 図4は、ICカードの第2の動作例を説明するためのフローチャートである。FIG. 4 is a flowchart for explaining a second operation example of the IC card. 図5は、ICカードの第3の動作例を説明するためのフローチャートである。FIG. 5 is a flowchart for explaining a third operation example of the IC card.

以下、実施形態について、図面を参照して説明する。
図1は、実施の形態に係る携帯可能電子装置としてのICカード1のハードウエア構成を概略的に示すブロック図である。
図1に示すように、ICカード1は、端末装置2と通信を行うことによりICカードシステムを構成している。このICカードシステムは、ICカード1と端末装置2とが双方向にデータの送受信を行う通信システムである。端末装置2は、たとえば、携帯電話機が想定され、ICカード1は、端末装置2としての携帯電話機に装着される運用形態が想定される。
Hereinafter, embodiments will be described with reference to the drawings.
FIG. 1 is a block diagram schematically showing a hardware configuration of an IC card 1 as a portable electronic device according to an embodiment.
As shown in FIG. 1, the IC card 1 constitutes an IC card system by communicating with the terminal device 2. This IC card system is a communication system in which the IC card 1 and the terminal device 2 transmit and receive data bidirectionally. The terminal device 2 is assumed to be a mobile phone, for example, and the IC card 1 is assumed to be in an operation form that is mounted on a mobile phone as the terminal device 2.

このようなシステムでは、端末装置2としての携帯電話機にICカード1が装着された状態でICカード1と携帯電話機とがデータ通信を行う。このような運用形態では、ICカード1が携帯電話機2に常に装着された状態であることが想定され、携帯電話機の電源がオフされなけば、ICカード1自体も電気的にはオフされない。このため、携帯電話機の電源が長期に亘ってオフされなければ、ICカード1も長期に亘って起動処理が実施されない可能性がある。   In such a system, the IC card 1 and the mobile phone perform data communication with the IC card 1 mounted on the mobile phone as the terminal device 2. In such an operation mode, it is assumed that the IC card 1 is always attached to the mobile phone 2, and the IC card 1 itself is not electrically turned off unless the power of the mobile phone is turned off. For this reason, if the power of the mobile phone is not turned off for a long time, the IC card 1 may not be activated for a long time.

ICカード1は、端末装置2からの電源供給により動作する。たとえば、上記ICカード1は、上記端末装置2と物理的、電気的に接触して通信を行う接触式の携帯可能電子装置(接触式ICカード)である。ただし、上記ICカード1は、アンテナあるいは無線通信部等により上記端末装置2と非接触の状態で無線通信を行う非接触式の携帯可能電子装置(非接触式ICカード)であっても良い。さらには、上記ICカード1は、非接触式ICカードとしての通信機能と接触式ICカードとしての通信機能とを有する複合型のICカード(デュアルインターフェースICカード)であっても良い。   The IC card 1 operates by supplying power from the terminal device 2. For example, the IC card 1 is a contact-type portable electronic device (contact IC card) that communicates with the terminal device 2 in physical and electrical contact. However, the IC card 1 may be a non-contact portable electronic device (non-contact IC card) that performs wireless communication in a non-contact state with the terminal device 2 using an antenna or a wireless communication unit. Furthermore, the IC card 1 may be a composite IC card (dual interface IC card) having a communication function as a non-contact IC card and a communication function as a contact IC card.

図1に示すように、上記ICカード1は、制御部(CPU)11、プログラムメモリ(ROM)12、ワーキングメモリ(RAM)13、データメモリ(不揮発性メモリ)14、通信制御部15、電源部16、および、インターフェース17などを有する。
上記ICカード1は、カード状の本体Cにより構成される。上記ICカード1を形成するカード状の本体Cには、1つ(あるいは複数)のICチップ1aとインターフェース17とが埋設される。上記ICチップ1aは、制御部11、プログラムメモリ12、ワーキングメモリ13、データメモリ14、通信制御部15および電源部16などを有している。上記ICチップ1aは、上記インターフェース17に接続された状態でモジュール化され、当該ICカード1を形成するカード状の本体C内に埋設される。
As shown in FIG. 1, the IC card 1 includes a control unit (CPU) 11, a program memory (ROM) 12, a working memory (RAM) 13, a data memory (nonvolatile memory) 14, a communication control unit 15, and a power supply unit. 16 and an interface 17 and the like.
The IC card 1 is composed of a card-shaped main body C. One (or a plurality) of IC chips 1 a and an interface 17 are embedded in the card-like main body C forming the IC card 1. The IC chip 1a includes a control unit 11, a program memory 12, a working memory 13, a data memory 14, a communication control unit 15, a power supply unit 16, and the like. The IC chip 1a is modularized while being connected to the interface 17, and is embedded in a card-like main body C that forms the IC card 1.

上記制御部11は、ICカード1全体の制御を司る。上記制御部11は、CPUなどのプロセッサを有する。上記制御部11は、上記プログラムメモリ12あるいはデータメモリ14に記憶されている制御プログラムおよび制御データなどに基づいて動作する。たとえば、上記制御部11は、上記プログラムメモリ12に記憶されている動作を司る制御プログラムを実行することにより、端末装置2から与えられるコマンドに応じた処理を実行する。   The control unit 11 controls the entire IC card 1. The control unit 11 includes a processor such as a CPU. The control unit 11 operates based on a control program and control data stored in the program memory 12 or the data memory 14. For example, the control unit 11 executes a process according to a command given from the terminal device 2 by executing a control program that controls the operation stored in the program memory 12.

上記プログラムメモリ12は、読み出し専用のメモリ(ROM:リードオンリーメモリ)により構成される。上記プログラムメモリ12は、当該ICカード1の仕様に応じた動作を司る制御プログラムおよび制御データなどを記憶する。   The program memory 12 is constituted by a read-only memory (ROM: read-only memory). The program memory 12 stores a control program, control data, and the like that control operations according to the specifications of the IC card 1.

上記ワーキングメモリ13は、揮発性のメモリ(RAM;ランダムアクセスメモリ)により構成される。上記ワーキングメモリ13は、データを一時保管するバッファメモリとして機能する。例えば、上記ワーキングメモリ13には、端末装置2との通信処理において、送受信されるデータを一時的に保管する通信バッファとして利用可能である。また、上記ワーキングメモリ13は、種々の書込みデータなどを一時的に保持するメモリとしても利用される。   The working memory 13 is composed of a volatile memory (RAM; random access memory). The working memory 13 functions as a buffer memory for temporarily storing data. For example, the working memory 13 can be used as a communication buffer that temporarily stores data to be transmitted and received in communication processing with the terminal device 2. The working memory 13 is also used as a memory for temporarily holding various write data.

上記データメモリ(不揮発性メモリ)14は、データの書き込みが可能な不揮発性のメモリである。上記データメモリ14は、例えば、EEPROMあるいはフラッシュメモリなどにより構成される。上記データメモリ14には、当該ICカード1の使用目的に応じた種々の情報(アプリケーションプログラムおよび運用データなど)が書込まれる。当該ICカード1が複数の使用目的に使用される場合、上記データメモリ14には、各使用目的に応じた複数のアプリケーションが記憶される。   The data memory (nonvolatile memory) 14 is a nonvolatile memory capable of writing data. The data memory 14 is composed of, for example, an EEPROM or a flash memory. In the data memory 14, various information (application program, operation data, etc.) according to the purpose of use of the IC card 1 is written. When the IC card 1 is used for a plurality of usage purposes, the data memory 14 stores a plurality of applications corresponding to the usage purposes.

また、上記データメモリ14は、特定のコマンドを受信した回数(特定の処理を実施した回数)をカウントするカウンタ14a、14bを有する。また、カウンタ14a、14bは、特定の複数のコマンドについてそれぞれの受信した回数をカウントするものであっても良い。たとえば、後述する動作例では、カウンタ14aは、ETSI TS 100.977で規定されるSTATUSコマンドの受信回数をカウントするものを想定する。上記STATUSコマンドは、通常の処理工程においては、定期的に実施される可能性が高いコマンドである。このため、カウンタ14aでカウントするSTATUSコマンドの受信回数は、処理時間あるいは一連の処理によるICカードの稼働状況を示す値となりうる。   The data memory 14 includes counters 14a and 14b that count the number of times a specific command has been received (the number of times that a specific process has been performed). Further, the counters 14a and 14b may count the number of times of reception for each of a plurality of specific commands. For example, in the operation example described later, it is assumed that the counter 14a counts the number of receptions of the STATUS command defined by ETSI TS 100.997. The STATUS command is a command that is highly likely to be periodically executed in a normal processing process. For this reason, the number of receptions of the STATUS command counted by the counter 14a can be a value indicating the processing time or the operating status of the IC card by a series of processes.

なお、カウンタ14a、14bは、活性化後の一連の処理における特定コマンド(例えば、STATUSコマンド)の受信回数を計数するものであるから、揮発性のメモリ(RAM)であるワーキングメモリ13に設けても良い。   The counters 14a and 14b count the number of receptions of a specific command (for example, STATUS command) in a series of processes after activation, and therefore are provided in the working memory 13 which is a volatile memory (RAM). Also good.

上記通信制御部15は、上記インターフェース17を介して端末装置2とのデータ通信を制御するものである。当該ICカード1が接触式ICカードである場合、通信制御部15は、端末装置2と物理的・電気的に接触するコンタクト部としてのインターフェース17を介してデータを送受信する。なお、非接触型のICカードであれば、上記通信制御部15は、インターフェース17としてのアンテナにより送受信するデータを変調あるいは復調する。   The communication control unit 15 controls data communication with the terminal device 2 via the interface 17. When the IC card 1 is a contact IC card, the communication control unit 15 transmits and receives data via the interface 17 as a contact unit that physically and electrically contacts the terminal device 2. In the case of a non-contact type IC card, the communication control unit 15 modulates or demodulates data to be transmitted / received by an antenna as the interface 17.

上記電源部16は、当該ICカード1の各部を動作させるための電力およびクロックパルスを供給する。たとえば、当該ICカード1が接触型のICカードである場合、上記電源部16は、インターフェース17を介して外部装置から直接的に供給される電力およびクロックパルスを各部へ供給する。なお、当該ICカードが非接触型のICカードである場合、上記電源部16は、上記インターフェース17としてのアンテナにより受信した電波から電力およびクロックパルスを生成し、当該ICカード内の各部に供給する。   The power supply unit 16 supplies power and clock pulses for operating each unit of the IC card 1. For example, when the IC card 1 is a contact type IC card, the power supply unit 16 supplies power and clock pulses directly supplied from an external device via the interface 17 to each unit. When the IC card is a non-contact type IC card, the power supply unit 16 generates power and clock pulses from the radio wave received by the antenna as the interface 17 and supplies the power and clock pulses to each unit in the IC card. .

次に、端末装置2の構成について説明する。
上記端末装置2は、ICカード1を動作させるための電源を供給するとともに、当該ICカード1とのデータ通信を行う。ここでは、端末装置2が携帯電話機である場合を想定する。端末装置2としての携帯電話機は、各ユーザが所持するICカード1を装着した状態で携帯電話機としての通信が利用可能となる運用形態が想定される。また、ICカード1は、端末装置2としての携帯電話機に設けられたICカード用のソケットに装着される。携帯電話機のICカード用のソケットに装着された状態で、携帯電話機のインターフェースとしてのコンタクト部とICカード1のインターフェースとが接触してデータ通信が可能となる。また、上記携帯電話機2は、ICカード1に物理的に接触しているコンタクト部を介して当該ICカード1に動作用の電力およびクロックパルスを供給する。
Next, the configuration of the terminal device 2 will be described.
The terminal device 2 supplies power for operating the IC card 1 and performs data communication with the IC card 1. Here, it is assumed that the terminal device 2 is a mobile phone. The mobile phone as the terminal device 2 is assumed to have an operation mode in which communication as a mobile phone can be used with the IC card 1 possessed by each user attached. The IC card 1 is mounted in an IC card socket provided in a mobile phone as the terminal device 2. In a state where the IC card socket of the mobile phone is mounted, the contact portion as an interface of the mobile phone and the interface of the IC card 1 come into contact with each other, thereby enabling data communication. The cellular phone 2 supplies power and clock pulses for operation to the IC card 1 through a contact portion that is in physical contact with the IC card 1.

図2は、端末装置2の一例としての携帯電話機の構成例を示すブロック図である。
図2に示す構成例では、携帯電話機2は、制御部31、RAM32、ROM33、不揮発性メモリ34、ICカード用のインターフェース(内部インターフェース)35、アンテナ37、通信部38、音声部39、振動部40、表示部41、操作部42および電源部43などを有する。
FIG. 2 is a block diagram illustrating a configuration example of a mobile phone as an example of the terminal device 2.
In the configuration example shown in FIG. 2, the mobile phone 2 includes a control unit 31, a RAM 32, a ROM 33, a nonvolatile memory 34, an IC card interface (internal interface) 35, an antenna 37, a communication unit 38, an audio unit 39, and a vibration unit. 40, a display unit 41, an operation unit 42, a power supply unit 43, and the like.

上記制御部31は、携帯電話機2全体の制御を司るものである。上記制御部31は、CPU、内部メモリ、各種のインターフェースなどを有する。また、上記制御部31は、その基本機能として、上記表示部41の表示を制御する表示制御機能、PLL(Phase Locked Loop)回路、データストリーム経路切換え、DMA(Direct Memory Access)コントローラ、割り込みコントローラ、タイマ、UART(Universal Asynchronous Receiver Transmitter)、秘匿、HDLC(High-level Data Link Control procedure)フレーミング、ディバイスコントローラなどの機能を有している。   The control unit 31 controls the entire mobile phone 2. The control unit 31 includes a CPU, an internal memory, various interfaces, and the like. The control unit 31 has, as its basic functions, a display control function for controlling the display of the display unit 41, a PLL (Phase Locked Loop) circuit, a data stream path switching, a DMA (Direct Memory Access) controller, an interrupt controller, It has functions such as timer, UART (Universal Asynchronous Receiver Transmitter), secrecy, HDLC (High-level Data Link Control procedure) framing, device controller, and the like.

上記RAM32は、作業用のデータを記憶するための揮発性メモリである。上記ROM33は、制御プログラムや制御データなどが記憶されている不揮発性メモリである。たとえば、上記ROM33には、当該携帯電話機2の基本的な制御を行うための制御プログラムおよび制御データが予め記憶されている。上記制御部31は、上記RAM32を用いて上記ROM33に記憶されている制御プログラムを実行することにより、当該携帯電話機2の基本的な制御を実現している。   The RAM 32 is a volatile memory for storing work data. The ROM 33 is a non-volatile memory that stores control programs, control data, and the like. For example, the ROM 33 stores a control program and control data for performing basic control of the mobile phone 2 in advance. The control unit 31 implements basic control of the mobile phone 2 by executing a control program stored in the ROM 33 using the RAM 32.

上記不揮発性メモリ34は、種々のデータが記憶される書き換え可能な不揮発性メモリである。上記不揮発性メモリ34には、種々のアプリケーションプログラム(アプリケーション)、制御データ、および、ユーザデータなどが記憶される。上記制御部31は、上記不揮発性メモリ34に記憶されているアプリケーションプログラムを実行することにより、種々の機能を実現する。   The nonvolatile memory 34 is a rewritable nonvolatile memory that stores various data. The nonvolatile memory 34 stores various application programs (applications), control data, user data, and the like. The control unit 31 implements various functions by executing application programs stored in the nonvolatile memory 34.

上記内部インターフェース35は、ICカード1が装着されるインターフェースである。上記内部インターフェース35は、上記制御部31に接続されている。これにより、上記制御部31は、上記内部インターフェース35を介して上記ICカード1とのデータ通信が可能となっている。   The internal interface 35 is an interface to which the IC card 1 is attached. The internal interface 35 is connected to the control unit 31. Accordingly, the control unit 31 can perform data communication with the IC card 1 via the internal interface 35.

上記通信部38は、通信用のアンテナ37を介して通話データあるいはデータ通信用のデータを電波で送受信する。上記音声部39は、アナログフロントエンド部及びオーディオ部を有し、音声の入出力を行う。上記振動部40は、当該携帯電話機2全体を振動させる振動機構により構成される。上記表示部41は、上記制御部31により表示のオンオフや表示内容などが制御される。上記操作部42は、キーボードなどにより構成され、ユーザによる操作指示が入力される。上記電源部43は、バッテリーなどにより構成され、当該携帯電話機2内の各部に電源を供給するようになっている。また、上記電源部43は、上記内部インターフェース35を介して接続されたICカード1にも電源を供給する機能も有している。   The communication unit 38 transmits and receives telephone call data or data communication data via radio waves via the communication antenna 37. The audio unit 39 has an analog front end unit and an audio unit, and inputs and outputs audio. The vibration unit 40 is configured by a vibration mechanism that vibrates the entire mobile phone 2. The display unit 41 is controlled by the control unit 31 to turn on / off the display and display contents. The operation unit 42 is configured by a keyboard or the like, and an operation instruction from the user is input. The power supply unit 43 is configured by a battery or the like, and supplies power to each unit in the mobile phone 2. The power supply unit 43 also has a function of supplying power to the IC card 1 connected via the internal interface 35.

次に、ICカード1におけるコマンド処理について説明する。
本実施形態のICカードシステムにおいて、ICカード1は、端末装置2として携帯電話機に装着された状態で使用されるものであり、端末装置2側から電源電圧の供給を常時受けているものとする。すなわち、ICカードは、端末装置2の電源がオフされなければ、ICカードは、起動処理が実施されないような使用形態であることを想定する。
Next, command processing in the IC card 1 will be described.
In the IC card system of the present embodiment, the IC card 1 is used as a terminal device 2 attached to a mobile phone, and is always supplied with a power supply voltage from the terminal device 2 side. . That is, it is assumed that the IC card is in a usage form in which the activation process is not performed unless the power of the terminal device 2 is turned off.

まず、端末装置2に装着された状態のICカード1における第1の動作例を説明する。
図3は、端末装置2に装着された状態のICカード1における第1の動作例(第1のコマンド処理例)を説明するためのフローチャートである。
端末装置2に装着された状態のICカード1は、端末装置2から電源電圧が供給され、制御部11を含む各部が動作可能な状態となっている。このような状態において、制御部11は、端末装置2からのコマンド受信待ち状態となっている(ステップS11)。端末装置2からのコマンドを受信した場合(ステップS11、YES)、制御部11は、受信したコマンドに含まれるコマンドを示す情報(コマンドコード)により当該コマンドを識別する(ステップS12)。受信したコマンドを識別すると、制御部11は、受信したコマンドが自己診断を実施する判断基準となる特定コマンドであるか否かを判定する(ステップS13)。
First, a first operation example in the IC card 1 attached to the terminal device 2 will be described.
FIG. 3 is a flowchart for explaining a first operation example (first command processing example) in the IC card 1 mounted in the terminal device 2.
The IC card 1 mounted in the terminal device 2 is supplied with a power supply voltage from the terminal device 2 and can operate each unit including the control unit 11. In such a state, the control unit 11 is in a state of waiting for receiving a command from the terminal device 2 (step S11). When the command from the terminal device 2 is received (step S11, YES), the control unit 11 identifies the command based on information (command code) indicating the command included in the received command (step S12). When the received command is identified, the control unit 11 determines whether or not the received command is a specific command serving as a criterion for performing self-diagnosis (step S13).

自己診断を実施する判断基準となる特定コマンドは、定期的に実施される可能性が高いコマンドが設定される。たとえば、自己診断を実施する判断基準となる特定コマンドとしては、ETSI TS 100.977で規定されるSTATUSコマンドがある。STATUSコマンドは、ICカードに状態を示す情報を要求するコマンドであり、一定の間隔で実行される可能性が高い。   A command that is highly likely to be periodically executed is set as a specific command that is a criterion for performing self-diagnosis. For example, as a specific command serving as a criterion for performing self-diagnosis, there is a STATUS command defined by ETSI TS 100.977. The STATUS command is a command for requesting information indicating the state from the IC card, and is highly likely to be executed at regular intervals.

また、ICカード1の制御部11は、コマンドを受信した場合、受信したコマンドを解釈し、そのコマンドが指示する内容に応じてコマンド処理モジュールへ処理を移行させる役割を果たすコマンドディスパッチャー機能を有する。たとえば、ICカード1の制御部11は、自己診断を実施する判断基準となる特定コマンドとしてのSTATUSコマンドを受信した場合、コマンドディスパッチャー機能により受信したコマンドがSTATUSコマンドであることを解釈し、自己診断を行うかどうかを判断する判断処理を実行する。   Further, when receiving a command, the control unit 11 of the IC card 1 has a command dispatcher function that interprets the received command and shifts the processing to the command processing module in accordance with the content indicated by the command. For example, when the control unit 11 of the IC card 1 receives a STATUS command as a specific command serving as a determination standard for performing self-diagnosis, the control unit 11 interprets that the command received by the command dispatcher function is a STATUS command, and performs self-diagnosis. A determination process is performed to determine whether or not to perform.

受信したコマンドが特定コマンドでないと判断した場合(ステップS13、NO)、制御部11は、受信したコマンドに対応するコマンド処理を実行する(ステップS20)。このコマンド処理が終了すると、制御部11は、上記ステップS11へ戻って次のコマンドの受信待ちとなる。   When determining that the received command is not a specific command (step S13, NO), the control unit 11 executes a command process corresponding to the received command (step S20). When this command processing is completed, the control unit 11 returns to step S11 and waits for reception of the next command.

また、受信したコマンドが特定コマンドであると判断した場合(ステップS13、YES)、制御部11は、特定コマンドに対応して設けた特定コマンド受信カウンタ14aのカウント値を更新する(ステップS14)。特定コマンド受信カウンタ14aは、不揮発性メモリ14に設けられ、特定コマンドを受信するごとにカウント値を更新する。たとえば、特定コマンド受信カウンタ14aは、特定コマンドを受信するごとにカウント値がインクリメントされる。   If it is determined that the received command is a specific command (step S13, YES), the control unit 11 updates the count value of the specific command reception counter 14a provided corresponding to the specific command (step S14). The specific command reception counter 14a is provided in the nonvolatile memory 14, and updates the count value every time a specific command is received. For example, the count value of the specific command reception counter 14a is incremented every time a specific command is received.

特定コマンド受信カウンタ14aのカウント値を更新すると、制御部11は、特定コマンド受信カウンタ14aのカウント値が所定の上限値以上であるか否かを判断する(ステップS15)。この上限値は、自己診断を実行するための閾値である。つまり、特定コマンドを上限値の回数受信するごとに、制御部11は、自己診断を実行するものと判断するようになっている。また、上限値は、予め設定され、不揮発性メモリ14などに記憶される。不揮発性メモリ14に記憶する上限値は、設定が変更できるようにしても良い。   When the count value of the specific command reception counter 14a is updated, the control unit 11 determines whether or not the count value of the specific command reception counter 14a is greater than or equal to a predetermined upper limit value (step S15). This upper limit value is a threshold value for executing the self-diagnosis. That is, every time a specific command is received for the upper limit value, the control unit 11 determines that a self-diagnosis is to be executed. The upper limit value is set in advance and stored in the nonvolatile memory 14 or the like. The setting of the upper limit value stored in the nonvolatile memory 14 may be changeable.

特定コマンド受信カウンタ14aのカウント値が所定の上限値未満であると判断した場合(ステップS15、NO)、制御部11は、当該特定コマンドに対応するコマンド処理を実行し(ステップS20)、上記ステップS11へ戻って、次のコマンドの受信待ち状態となる。   When it is determined that the count value of the specific command reception counter 14a is less than the predetermined upper limit value (step S15, NO), the control unit 11 executes command processing corresponding to the specific command (step S20), and the above step Returning to S11, the system waits for reception of the next command.

また、特定コマンド受信カウンタ14aのカウント値が所定の上限値以上であると判断した場合(ステップS15、YES)、制御部11は、特定コマンド受信カウンタ14aのカウント値をクリアする(ステップS16)。特定コマンド受信カウンタ14aのカウント値をクリアすると、制御部11は、実行すべき自己診断の内容を決定する(ステップS17)。本動作例では、起動時ではなくて、ICカード1が実際のコマンド処理中に自己診断を行う。このため、自己診断処理に多くの処理を要すると、ICカード1と端末装置2との通信による一連の処理が全体としてスムーズに実施されてない可能性が発生する。このため、本動作例は、自己診断処理(起動時に実行する自己診断処理)の1部の処理を分散して実行するようにする。このため、上記ステップS17では、カウンタ値が上限値に達するごとに、どのような内容の自己診断を行うかを決定する。   When it is determined that the count value of the specific command reception counter 14a is equal to or greater than the predetermined upper limit value (step S15, YES), the control unit 11 clears the count value of the specific command reception counter 14a (step S16). When the count value of the specific command reception counter 14a is cleared, the control unit 11 determines the content of self-diagnosis to be executed (step S17). In this operation example, the IC card 1 performs self-diagnosis during actual command processing, not at the time of activation. For this reason, when many processes are required for the self-diagnosis process, there is a possibility that a series of processes by communication between the IC card 1 and the terminal device 2 is not smoothly performed as a whole. For this reason, in this operation example, a part of the self-diagnosis process (self-diagnosis process executed at startup) is executed in a distributed manner. For this reason, in step S17, every time the counter value reaches the upper limit value, it is determined what kind of self-diagnosis is to be performed.

たとえば、起動時に実施する自己診断処理を複数の自己診断処理に分割し、それらの分割した自己診断処理を、カウンタ値が上限値に達するごとに、順番に実行するものとする。具体例としては、自己診断処理に、不揮発性メモリの正当性チェック、および、RAMの正当性チェックが含まれる場合、最初にカウンタ値が上限値に達した場合には津揮発性メモリの正当性チェックを行い、次にカウンタ値が上限値に達した場合にはRAMの正当性チェックを行うというように、自己診断処理に含まれる複数の処理を順番に実行するようする。   For example, the self-diagnosis process performed at the time of startup is divided into a plurality of self-diagnosis processes, and the divided self-diagnosis processes are sequentially executed every time the counter value reaches the upper limit value. As a specific example, when the self-diagnosis process includes a validity check of the nonvolatile memory and a validity check of the RAM, the validity of the volatile memory when the counter value reaches the upper limit first. A plurality of processes included in the self-diagnosis process are sequentially executed so that the check is performed and then the validity of the RAM is checked when the counter value reaches the upper limit value.

実行すべき自己診断の内容を決定すると、制御部11は、決定した内容の自己診断処理(通常の自己診断処理の一部の処理)を実行する(ステップS18)。この自己診断処理により故障が検知された場合(ステップS19、YES)、制御部11は、ICカード内に故障が発生している旨のレスポンス(エラー応答)を作成し、端末装置2へ通知する(ステップS21)。エラー応答を行うと、制御部11は、当該ICカード1におけるコマンド処理を中止する。また、上記自己診断処理により故障が検知されなかった場合(ステップS19、NO)、制御部11は、当該コマンドに対応するコマンド処理を実行し(ステップS20)、上記ステップS11へ戻る。   When the content of the self-diagnosis to be executed is determined, the control unit 11 executes self-diagnosis processing (part of normal self-diagnosis processing) of the determined content (step S18). When a failure is detected by this self-diagnosis process (step S19, YES), the control unit 11 creates a response (error response) indicating that a failure has occurred in the IC card, and notifies the terminal device 2 of the response. (Step S21). When an error response is made, the control unit 11 stops the command processing in the IC card 1. If no failure is detected by the self-diagnosis process (step S19, NO), the control unit 11 executes a command process corresponding to the command (step S20), and returns to step S11.

以上の第1の動作例では、特定コマンドの受信回数が所定の上限値以上となった場合に、自己診断処理を実施する。これにより、再起動などが行われない運用形態で使用されるICカードであっても、自己診断を実施できる。この結果として、ハードウエアの故障などを自ら早期に発見できるICカードを提供できる。   In the first operation example described above, the self-diagnosis process is performed when the number of receptions of the specific command exceeds a predetermined upper limit value. Thereby, even if it is an IC card used by the operation | use form in which restart etc. are not performed, a self-diagnosis can be implemented. As a result, it is possible to provide an IC card that can detect a hardware failure or the like at an early stage.

また、特定コマンドの受信回数が所定の上限値以上となったことにより実行する自己診断処理は、活性化時に実施する自己診断処理の一部の処理とする。これにより、分散して自己診断処理を実行でき、コマンド処理中であるICカードにおける動作能力の低下を抑えることできる。   In addition, the self-diagnosis process executed when the number of receptions of the specific command exceeds a predetermined upper limit value is a part of the self-diagnosis process executed at the time of activation. As a result, the self-diagnosis process can be executed in a distributed manner, and a decrease in the operating capability of the IC card that is executing the command process can be suppressed.

次に、端末装置2に装着された状態のICカード1における第2の動作例を説明する。
図4は、端末装置2に装着された状態のICカード1における第2の動作例(第2のコマンド処理例)を説明するためのフローチャートである。
端末装置2からのコマンドを受信した場合(ステップS31、YES)、制御部11は、受信したコマンドに含まれるコマンドを示す情報(コマンドコード)により当該コマンドを識別する(ステップS32)。受信したコマンドを識別すると、制御部11は、受信したコマンドが自己診断を実施する判断基準となる特定コマンドであるか否かを判定する(ステップS33)。自己診断を実施する判断基準となる特定コマンドは、第1の動作例と同様であり、たとえば、ETSI TS 100.977で規定されるSTATUSコマンドである。
Next, a second operation example of the IC card 1 mounted on the terminal device 2 will be described.
FIG. 4 is a flowchart for explaining a second operation example (second command processing example) in the IC card 1 mounted in the terminal device 2.
When the command from the terminal device 2 is received (step S31, YES), the control unit 11 identifies the command based on information (command code) indicating the command included in the received command (step S32). When the received command is identified, the control unit 11 determines whether or not the received command is a specific command serving as a determination criterion for performing self-diagnosis (step S33). The specific command that is a criterion for performing the self-diagnosis is the same as that in the first operation example, and is, for example, a STATUS command defined in ETSI TS 100.997.

受信したコマンドが特定コマンドでないと判断した場合(ステップS33、NO)、制御部11は、受信したコマンドに対応するコマンド処理を実行する(ステップS42)。このコマンド処理が終了すると、制御部11は、上記ステップS31へ戻って次のコマンドの受信待ちとなる。   When it is determined that the received command is not a specific command (step S33, NO), the control unit 11 executes command processing corresponding to the received command (step S42). When this command processing is completed, the control unit 11 returns to step S31 and waits for reception of the next command.

また、受信したコマンドが特定コマンドであると判断した場合(ステップS33、YES)、制御部11は、特定コマンドに対応して設けた特定コマンド受信カウンタ14aのカウント値を更新する(ステップS34)。たとえば、制御部11は、特定コマンドを受信するごとに、不揮発性メモリ14内に設けた特定コマンド受信カウンタ14aのカウンタ値をインクリメントする。   If it is determined that the received command is a specific command (step S33, YES), the control unit 11 updates the count value of the specific command reception counter 14a provided corresponding to the specific command (step S34). For example, every time a specific command is received, the control unit 11 increments a counter value of a specific command reception counter 14 a provided in the nonvolatile memory 14.

特定コマンド受信カウンタ14aのカウント値を更新すると、制御部11は、特定コマンド受信カウンタ14aのカウント値が所定の第1上限値であるか否かを判断する(ステップS35)。この第1上限値は、第1の自己診断を実行することを決定するための閾値である。つまり、特定コマンドを第1上限値の回数だけ受信すると、制御部11は、第1の自己診断を実行するものとする。   When the count value of the specific command reception counter 14a is updated, the control unit 11 determines whether or not the count value of the specific command reception counter 14a is a predetermined first upper limit value (step S35). This first upper limit value is a threshold value for determining to execute the first self-diagnosis. That is, when the specific command is received for the number of times of the first upper limit value, the control unit 11 performs the first self-diagnosis.

特定コマンド受信カウンタ14aのカウント値が第1上限値であると判断した場合(ステップS35、NO)、制御部11は、第1の自己診断を実行する(ステップS36)。なお、第1上限値および第1の自己診断の内容は、予め設定され、不揮発性メモリ14などに記憶される。また、不揮発性メモリ14に記憶する第1上限値および第1の自己診断の内容は、変更可能としても良い。   When determining that the count value of the specific command reception counter 14a is the first upper limit value (step S35, NO), the control unit 11 executes the first self-diagnosis (step S36). The contents of the first upper limit value and the first self-diagnosis are preset and stored in the nonvolatile memory 14 or the like. The first upper limit value stored in the nonvolatile memory 14 and the contents of the first self-diagnosis may be changeable.

また、特定コマンド受信カウンタ14aのカウント値が第1上限値でないと判断した場合(ステップS25、NO)、制御部11は、さらに、特定コマンド受信カウンタ14aのカウント値が所定の第2上限値であるか否かを判断する(ステップS37)。この第2上限値は、第1上限値よりも大きい値であり、第2の自己診断を実行することを決定するための閾値である。つまり、特定コマンドを第2上限値の回数だけ受信すると、制御部11は、第2の自己診断を実行するものとする。   If it is determined that the count value of the specific command reception counter 14a is not the first upper limit value (step S25, NO), the control unit 11 further determines that the count value of the specific command reception counter 14a is a predetermined second upper limit value. It is determined whether or not there is (step S37). The second upper limit value is a value larger than the first upper limit value, and is a threshold value for determining to execute the second self-diagnosis. That is, when the specific command is received for the number of times of the second upper limit value, the control unit 11 performs the second self-diagnosis.

特定コマンド受信カウンタ14aのカウント値が第2上限値であると判断した場合(ステップS37、NO)、制御部11は、特定コマンド受信カウンタのカウント値をクリアし(ステップS38)、第2の自己診断を実行する(ステップS39)。なお、第2上限値および第2の自己診断の内容は、予め設定され、不揮発性メモリ14などに記憶されるものとする。また、不揮発性メモリ14に記憶する第2上限値および第2の自己診断の内容は、変更可能としても良い。   When it is determined that the count value of the specific command reception counter 14a is the second upper limit value (step S37, NO), the control unit 11 clears the count value of the specific command reception counter (step S38), and the second self Diagnosis is executed (step S39). The contents of the second upper limit value and the second self-diagnosis are set in advance and stored in the nonvolatile memory 14 or the like. In addition, the second upper limit value stored in the nonvolatile memory 14 and the content of the second self-diagnosis may be changeable.

第1の自己診断あるいは第2の自己診断により故障が検知された場合(ステップS40YES)、制御部11は、当該ICカード1内に故障が発生している旨のレスポンス(エラー応答)を作成し、端末装置2へ通知する(ステップS41)。エラー応答を行うと、制御部11は、当該ICカード1におけるコマンド処理を中止する。また、第1の自己診断あるいは第2の自己診断において故障が検出されなかった場合(ステップS42、NO)、制御部11は、当該コマンドに対応するコマンド処理を実行し(ステップS42)、上記ステップS31へ戻る。   When a failure is detected by the first self-diagnosis or the second self-diagnosis (YES in step S40), the control unit 11 creates a response (error response) indicating that a failure has occurred in the IC card 1. The terminal device 2 is notified (step S41). When an error response is made, the control unit 11 stops the command processing in the IC card 1. If no failure is detected in the first self-diagnosis or the second self-diagnosis (step S42, NO), the control unit 11 executes command processing corresponding to the command (step S42), and the above steps Return to S31.

以上の第2の動作例によれば、ICカードは、特定コマンドの受信回数に対する複数の上限値(設定値)と、各上限値に対応する自己診断の内容とを設定しておき、特定コマンドの受信回数が何れかの上限値となるごとに、当該上限値に対応づけて内容の自己診断を実施する。これにより、再起動などが行われない運用形態で使用されるICカードであっても、自己診断を段階的に実施できる。この結果として、ハードウエアの故障などを自ら早期に発見できるICカードを提供できる。   According to the second operation example described above, the IC card sets a plurality of upper limit values (setting values) for the number of receptions of the specific command and the contents of the self-diagnosis corresponding to each upper limit value, and sets the specific command. Each time the number of receptions reaches any one of the upper limit values, self-diagnosis of the contents is performed in association with the upper limit value. Thereby, even if it is an IC card used by the operation | use form without restarting etc., a self-diagnosis can be implemented in steps. As a result, it is possible to provide an IC card that can detect a hardware failure or the like at an early stage.

次に、端末装置2に装着された状態のICカード1における第3の動作例を説明する。
図5は、端末装置2に装着された状態のICカード1における第3の動作例(第3のコマンド処理例)を説明するためのフローチャートである。
端末装置2からのコマンドを受信した場合(ステップS51、YES)、制御部11は、受信したコマンドに含まれるコマンドを示す情報(コマンドコード)により当該コマンドを識別する(ステップS52)。受信したコマンドを識別すると、制御部11は、受信したコマンドが第1の自己診断を実施する判断基準となる第1の特定コマンドであるか否かを判定する(ステップS53)。
Next, a third operation example of the IC card 1 mounted on the terminal device 2 will be described.
FIG. 5 is a flowchart for explaining a third operation example (third command processing example) in the IC card 1 mounted in the terminal device 2.
When the command from the terminal device 2 is received (step S51, YES), the control unit 11 identifies the command based on information (command code) indicating the command included in the received command (step S52). When the received command is identified, the control unit 11 determines whether or not the received command is a first specific command serving as a determination criterion for performing the first self-diagnosis (step S53).

受信したコマンドが第1の特定コマンドでないと判断した場合(ステップS53、NO)、制御部11は、さらに、受信したコマンドが第2の自己診断を実施する判断基準となる第2の特定コマンドであるか否かを判定する(ステップS54)。第1の特定コマンドと第2の特定コマンドとは、それぞれ定期的な使用が想定されるコマンドであっても良いし、第1の特定コマンドは、コマンド処理の内容が第1の自己診断の内容に関連のあるものとし、第2の特定コマンドは、コマンド処理の内容が第2の自己診断の内容に関連のあるものとしても良い。   When it is determined that the received command is not the first specific command (step S53, NO), the control unit 11 further uses the second specific command that is a determination criterion for performing the second self-diagnosis. It is determined whether or not there is (step S54). The first specific command and the second specific command may each be a command that is assumed to be used regularly, and the first specific command is a command processing content of the first self-diagnosis. In the second specific command, the content of the command processing may be related to the content of the second self-diagnosis.

受信したコマンドが第1の特定コマンドでも第2の特定コマンドでもないと判断した場合(ステップS54、NO)、制御部11は、受信したコマンドに対応するコマンド処理を実行する(ステップS55)。このコマンド処理が終了すると、制御部11は、上記ステップS51へ戻って次のコマンドの受信待ちとなる。   When determining that the received command is neither the first specific command nor the second specific command (step S54, NO), the control unit 11 executes command processing corresponding to the received command (step S55). When this command processing is completed, the control unit 11 returns to step S51 and waits for reception of the next command.

また、受信したコマンドが第1の特定コマンドであると判断した場合(ステップS53、YES)、制御部11は、第1の特定コマンドに対応して設けた第1特定コマンド受信カウンタ14aのカウント値を更新する(ステップS56)。たとえば、制御部11は、第1の特定コマンドを受信するごとに、不揮発性メモリ14内に設けた第1特定コマンド受信カウンタ14aのカウンタ値をインクリメントする。   When it is determined that the received command is the first specific command (YES in step S53), the control unit 11 counts the first specific command reception counter 14a provided corresponding to the first specific command. Is updated (step S56). For example, every time the first specific command is received, the control unit 11 increments the counter value of the first specific command reception counter 14 a provided in the nonvolatile memory 14.

第1特定コマンド受信カウンタ14aのカウント値を更新すると、制御部11は、第1特定コマンド受信カウンタ14aのカウント値が第1上限値以上であるか否かを判断する(ステップS57)。この第1上限値は、第1の特定コマンドに対応する第1の自己診断を実行することを決定するための閾値である。つまり、第1の特定コマンドを第1上限値の回数だけ受信すると、制御部11は、第1の自己診断を実行するものとする。   When the count value of the first specific command reception counter 14a is updated, the control unit 11 determines whether or not the count value of the first specific command reception counter 14a is greater than or equal to the first upper limit value (step S57). The first upper limit value is a threshold value for determining to execute the first self-diagnosis corresponding to the first specific command. In other words, when the first specific command is received for the number of times of the first upper limit value, the control unit 11 performs the first self-diagnosis.

第1特定コマンド受信カウンタ14aのカウント値が第1上限値であると判断した場合(ステップS57、NO)、制御部11は、第1特定コマンド受信カウンタ14aのカウント値をクリアし(ステップS58)、第1の自己診断を実行する(ステップS59)。たとえば、第1の自己診断の内容は、第1の特定コマンドに対応づけて予め設定しておく。ただし、第1の自己診断の内容は、上記ステップS17のように、第1特定コマンド受信カウンタ14aのカウント値が第1上限値に達するごとに決定するようにしても良い。   When it is determined that the count value of the first specific command reception counter 14a is the first upper limit value (step S57, NO), the control unit 11 clears the count value of the first specific command reception counter 14a (step S58). The first self-diagnosis is executed (step S59). For example, the content of the first self-diagnosis is set in advance in association with the first specific command. However, the content of the first self-diagnosis may be determined each time the count value of the first specific command reception counter 14a reaches the first upper limit value as in step S17.

また、受信したコマンドが第2の特定コマンドであると判断した場合(ステップS54、YES)、制御部11は、第2の特定コマンドに対応して設けた第2特定コマンド受信カウンタ14bのカウント値を更新する(ステップS60)。たとえば、制御部11は、第1の特定コマンドを受信するごとに、不揮発性メモリ14内に設けた第2特定コマンド受信カウンタ14aのカウンタ値をインクリメントする。   When it is determined that the received command is the second specific command (step S54, YES), the control unit 11 counts the second specific command reception counter 14b provided corresponding to the second specific command. Is updated (step S60). For example, every time the first specific command is received, the control unit 11 increments the counter value of the second specific command reception counter 14 a provided in the nonvolatile memory 14.

第2特定コマンド受信カウンタ14bのカウント値を更新すると、制御部11は、第2特定コマンド受信カウンタ14bのカウント値が第2上限値以上であるか否かを判断する(ステップS61)。第2上限値は、第2の特定コマンドに対応する第2の自己診断を実行することを決定するための閾値である。つまり、第2の特定コマンドを第2上限値の回数だけ受信すると、制御部11は、第2の自己診断を実行するものとする。   When the count value of the second specific command reception counter 14b is updated, the control unit 11 determines whether or not the count value of the second specific command reception counter 14b is greater than or equal to the second upper limit value (step S61). The second upper limit value is a threshold value for determining to execute the second self-diagnosis corresponding to the second specific command. That is, when the second specific command is received for the number of times of the second upper limit value, the control unit 11 performs the second self-diagnosis.

なお、第3の動作例では、第1上限値と第2上限値とは相関関係のない値を設定して良い。たとえば、第1上限値と第2上限値とは同じ値であって良い。たとえば、第1上限値、第2上限値、第1の自己診断の内容、及び第2の自己診断の内容は、予め設定され、不揮発性メモリ14などに記憶される。また、不揮発性メモリ14に記憶する第1上限値、第2上限値、第1の自己診断の内容および第2の自己診断の内容は、変更可能としても良い。   In the third operation example, the first upper limit value and the second upper limit value may be set to values having no correlation. For example, the first upper limit value and the second upper limit value may be the same value. For example, the first upper limit value, the second upper limit value, the contents of the first self-diagnosis, and the contents of the second self-diagnosis are set in advance and stored in the nonvolatile memory 14 or the like. Further, the first upper limit value, the second upper limit value, the contents of the first self-diagnosis, and the contents of the second self-diagnosis stored in the nonvolatile memory 14 may be changeable.

第2特定コマンド受信カウンタ14bのカウント値が第2上限値であると判断した場合(ステップS61、NO)、制御部11は、第2特定コマンド受信カウンタ14bのカウント値をクリアし(ステップS62)、第2の自己診断を実行する(ステップS63)。たとえば、第2の自己診断の内容は、第2の特定コマンドに対応づけて予め設定しておく。ただし、第2の自己診断の内容は、上記ステップS17のように、第2特定コマンド受信カウンタ14bのカウント値が第2上限値に達するごとに決定するようにしても良い。   When it is determined that the count value of the second specific command reception counter 14b is the second upper limit value (NO in step S61), the control unit 11 clears the count value of the second specific command reception counter 14b (step S62). The second self-diagnosis is executed (step S63). For example, the content of the second self-diagnosis is set in advance in association with the second specific command. However, the content of the second self-diagnosis may be determined every time the count value of the second specific command reception counter 14b reaches the second upper limit value as in step S17.

第1の自己診断あるいは第2の自己診断により故障が検知された場合(ステップS64、YES)、制御部11は、当該ICカード1内に故障が発生している旨のレスポンス(エラー応答)を作成し、端末装置2へ通知する(ステップS65)。エラー応答を行うと、制御部11は、当該ICカード1におけるコマンド処理を中止する。また、第1の自己診断あるいは第2の自己診断において故障が検出されなかった場合(ステップS64、NO)、制御部11は、当該コマンドに対応するコマンド処理を実行し(ステップS55)、上記ステップS31へ戻る。   When a failure is detected by the first self-diagnosis or the second self-diagnosis (YES in step S64), the control unit 11 gives a response (error response) that a failure has occurred in the IC card 1. Create and notify the terminal device 2 (step S65). When an error response is made, the control unit 11 stops the command processing in the IC card 1. If no failure is detected in the first self-diagnosis or the second self-diagnosis (step S64, NO), the control unit 11 executes command processing corresponding to the command (step S55), and the above step Return to S31.

以上の第3の動作例によれば、ICカードは、特定の2つのコマンドについて受信回数をカウントし、第1の特定コマンドの受信回数が第1上限値(設定値)に達した場合には第1の自己診断を実施し、第2の特定コマンドの受信回数が第2上限値(設定値)に達した場合には第2の自己診断を実施するようにできる。これにより、再起動などが行われない運用形態で使用されるICカードであっても、受信したコマンドの種類と回数とに応じた自己診断を適宜実施できる。この結果として、ハードウエアの故障などを自ら早期に発見できるICカードを提供できる。   According to the above third operation example, the IC card counts the number of receptions for two specific commands, and when the number of receptions of the first specific command reaches the first upper limit value (setting value). The first self-diagnosis is performed, and the second self-diagnosis can be performed when the number of times of reception of the second specific command reaches the second upper limit value (set value). As a result, even if the IC card is used in an operation mode in which no restart or the like is performed, self-diagnosis according to the type and number of received commands can be appropriately performed. As a result, it is possible to provide an IC card that can detect a hardware failure or the like at an early stage.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   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カード、C…本体、1a…ICチップ、2…端末装置(携帯電話機)、11…制御部(CPU)、12…プログラムメモリ(ROM)、13…ワーキングメモリ(RAM)、14…データメモリ(不揮発性メモリ)、14a、14b…特定コマンド受信カウンタ、15…通信制御部、16…電源部、17…インターフェース。   DESCRIPTION OF SYMBOLS 1 ... IC card, C ... Main body, 1a ... IC chip, 2 ... Terminal device (mobile phone), 11 ... Control part (CPU), 12 ... Program memory (ROM), 13 ... Working memory (RAM), 14 ... Data Memory (nonvolatile memory), 14a, 14b ... specific command reception counter, 15 ... communication control unit, 16 ... power supply unit, 17 ... interface.

Claims (9)

外部からのコマンドを処理するICカードにおいて、
特定のコマンドを受けた回数を計数する計数手段と、
前記計数手段により計数した特定のコマンドを受けた回数が上限値に達したか否かを判断する判断手段と、
前記判断手段により特定のコマンドを受けた回数が上限値に達したと判断した場合、自己診断を実行する実行手段と、
を有することを特徴とするICカード。
In an IC card that processes external commands,
Counting means for counting the number of times a specific command has been received;
Determination means for determining whether the number of times the specific command counted by the counting means has reached an upper limit;
Execution means for executing self-diagnosis when it is determined that the number of times a specific command is received by the determination means has reached an upper limit;
An IC card characterized by comprising:
前記計数手段は、前記実行手段により自己診断が実行された場合に計数した回数を初期値に戻す、
ことを特徴とする前記請求項1に記載のICカード。
The counting means returns the number of times counted when the self-diagnosis is executed by the executing means to an initial value.
The IC card according to claim 1, wherein:
さらに、前記実行手段により実行した自己診断により不具合を検知した場合、前記特定のコマンドの処理を実行せずに不具合が発生していることを示す情報を応答する応答手段を有する、
ことを特徴とする前記請求項1又は2に記載のICカード。
Furthermore, when a malfunction is detected by self-diagnosis performed by the execution means, response means that responds with information indicating that a malfunction has occurred without executing the processing of the specific command,
The IC card according to claim 1 or 2, wherein the IC card is characterized in that
前記実行手段は、当該ICカードの起動時に実行する自己診断処理の一部を自己診断として実行する、
ことを特徴とする前記請求項1乃至3の何れか1項に記載のICカード。
The execution means executes a part of self-diagnosis processing executed when the IC card is activated as self-diagnosis.
The IC card according to any one of claims 1 to 3, characterized in that:
さらに、第1の上限値と前記第1上限値よりも大きい第2の上限値とを記憶する記憶手段を有し、
前記判断手段は、前記計数手段により計数した特定のコマンドを受けた回数が前記第1の上限値であるか否かを判断する第1の判断機能と、前記計数手段により計数した特定のコマンドを受けた回数が前記第2の上限値であるか否かを判断する第2の判断機能とを有し、
前記実行手段は、前記第1の判断機能により特定のコマンドを受けた回数が第1上限値であると判断した場合、第1の自己診断を実行し、前記第2の判断機能により特定のコマンドを受けた回数が第1上限値であると判断した場合、第2の自己診断を実行する、
ことを特徴とする前記請求項1乃至4の何れか1項に記載のICカード。
Furthermore, it has a memory | storage means to memorize | store the 1st upper limit and the 2nd upper limit larger than the said 1st upper limit,
The determination means includes a first determination function for determining whether the number of times the specific command counted by the counting means is received is the first upper limit value, and the specific command counted by the counting means. A second determination function for determining whether or not the number of times of reception is the second upper limit value;
The execution means executes a first self-diagnosis when the number of times the specific command is received by the first determination function is the first upper limit value, and the specific command is determined by the second determination function. The second self-diagnosis is executed when it is determined that the number of times of receiving is the first upper limit value,
The IC card according to any one of claims 1 to 4, wherein:
前記計数手段は、第1の特定コマンドを受けた回数を計数する第1カウンタと、第2の特定カウントを受けた回数を計数する第2カウンタとを有し、
前記判断手段は、前記第1の特定コマンドを受けた場合には、前記第1カウンタの値が第1上限値以上であるか否かを判断し、前記第2の特定コマンドを受けた場合には、前記第2カウンタの値が第2上限値であるか否かを判断し、
前記実行手段は、前記第1カウンタの値が第1上限値以上であると判断した場合には第1の自己診断を実行し、前記第2カウンタの値が第2上限値以上であると判断した場合には第2の自己診断を実行する、
ことを特徴とする前記請求項1乃至4の何れか1項に記載のICカード。
The counting means includes a first counter that counts the number of times the first specific command is received, and a second counter that counts the number of times the second specific count is received,
The determination means determines whether the value of the first counter is equal to or greater than a first upper limit value when receiving the first specific command, and when receiving the second specific command. Determines whether the value of the second counter is a second upper limit value,
The execution means executes a first self-diagnosis when determining that the value of the first counter is equal to or greater than a first upper limit value, and determines that the value of the second counter is equal to or greater than a second upper limit value. If so, perform a second self-diagnosis,
The IC card according to any one of claims 1 to 4, wherein:
外部からのコマンドを処理するICカードにおいて、
特定のコマンドを受けた回数を計数する計数手段と、前記計数手段により計数した特定のコマンドを受けた回数が上限値に達したか否かを判断する判断手段と、前記判断手段により特定のコマンドを受けた回数が上限値に達したと判断した場合、自己診断を実行する実行手段とを有するモジュールと
前記モジュールを有する本体と、
を有することを特徴とするICカード。
In an IC card that processes external commands,
Counting means for counting the number of times a specific command has been received; determining means for determining whether the number of times the specific command counted by the counting means has reached an upper limit; and A module having execution means for executing a self-diagnosis, a main body having the module,
An IC card characterized by comprising:
外部からのコマンドを処理する携帯可能電子装置において、
特定のコマンドを受けた回数を計数する計数手段と、
前記計数手段により計数した特定のコマンドを受けた回数が上限値に達したか否かを判断する判断手段と、
前記判断手段により特定のコマンドを受けた回数が上限値に達したと判断した場合、自己診断を実行する実行手段と、
を有することを特徴とする携帯可能電子装置。
In portable electronic devices that process external commands,
Counting means for counting the number of times a specific command has been received;
Determination means for determining whether the number of times the specific command counted by the counting means has reached an upper limit;
Execution means for executing self-diagnosis when it is determined that the number of times a specific command is received by the determination means has reached an upper limit;
A portable electronic device comprising:
外部からのコマンドを処理するICカードにおける自己診断方法であって、
特定のコマンドを受けた回数を計数し、
前記計数した特定のコマンドを受けた回数が上限値に達したか否かを判断し、
前記判断により特定のコマンドを受けた回数が上限値に達したと判断した場合、自己診断を実行する、
ことを特徴とするICカードにおける自己診断方法。
A self-diagnosis method in an IC card for processing an external command,
Count the number of times you received a specific command,
Determine whether the number of received specific commands reaches the upper limit,
If it is determined that the number of times a specific command has been received has reached the upper limit, the self-diagnosis is executed.
A self-diagnosis method for an IC card.
JP2011206230A 2011-09-21 2011-09-21 Ic card, portable electronic device, and self-diagnosis method of ic card Withdrawn JP2013069062A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011206230A JP2013069062A (en) 2011-09-21 2011-09-21 Ic card, portable electronic device, and self-diagnosis method of ic card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011206230A JP2013069062A (en) 2011-09-21 2011-09-21 Ic card, portable electronic device, and self-diagnosis method of ic card

Publications (1)

Publication Number Publication Date
JP2013069062A true JP2013069062A (en) 2013-04-18

Family

ID=48474720

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011206230A Withdrawn JP2013069062A (en) 2011-09-21 2011-09-21 Ic card, portable electronic device, and self-diagnosis method of ic card

Country Status (1)

Country Link
JP (1) JP2013069062A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7219786B2 (en) 2021-03-30 2023-02-08 一弘 鈴木 Anti-swallowing device for fishing hooks
CN115914065A (en) * 2022-12-06 2023-04-04 中国联合网络通信集团有限公司 Terminal self-service diagnosis method, device, equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7219786B2 (en) 2021-03-30 2023-02-08 一弘 鈴木 Anti-swallowing device for fishing hooks
CN115914065A (en) * 2022-12-06 2023-04-04 中国联合网络通信集团有限公司 Terminal self-service diagnosis method, device, equipment and medium
CN115914065B (en) * 2022-12-06 2024-05-14 中国联合网络通信集团有限公司 Terminal self-help diagnosis method, device, equipment and medium

Similar Documents

Publication Publication Date Title
KR20060049641A (en) Mobile electronic equipment
JP2020038724A (en) Information processing device, information processing method, and program
CN110532785B (en) Controlled start method of electronic circuit and electronic equipment
US20070225038A1 (en) Mobile electronic device and IC card
JP2009048415A (en) Portable electronic device and control method of portable electronic device
US20190095771A1 (en) Ic card, portable electronic device, and information processing method
KR101783526B1 (en) Ic card, electronic device and portable electronic device
JP2013069062A (en) Ic card, portable electronic device, and self-diagnosis method of ic card
JP2013122690A (en) Ic card, portable electronic device and ic card control method
CN109426324B (en) Power-on control method, AP chip and mobile terminal
JP5516323B2 (en) IC chip, IC chip initialization method, IC chip processing program, portable terminal
JP5534969B2 (en) IC card, communication system, and communication method used for IC card
JP5602075B2 (en) PORTABLE ELECTRONIC DEVICE, COMMUNICATION METHOD USED FOR IC CARD AND PORTABLE ELECTRONIC DEVICE
EP3379424B1 (en) Ic card, portable electronic device, program, processing apparatus, and processing system
EP2782019A2 (en) IC card and portable electronic device
JP5724701B2 (en) IC chip, processing method in IC chip, IC chip processing program, and portable terminal
JP2013164686A (en) Ic card and portable electronic device
JP2017142655A (en) Electronic information storage medium, information processing method, and information processing program
JP6686725B2 (en) Electronic information storage medium, information processing method, and information processing program
EP3050001B1 (en) A method and system for initiating a function in an electronic device
JP2013003676A (en) Portable electronic device, ic card, communication system, and control method of portable electronic device
JP6221454B2 (en) Processing device, IC card, processing method, and processing program
JP4669262B2 (en) IC chip for IC card, IC card and IC card program
JP2014182505A (en) Ic card and portable electronic device
JP2016081117A (en) Ic card, portable electronic device, and manufacturing method for ic card

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131205

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20131212

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

A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20141202