JP3337050B2 - IC card - Google Patents

IC card

Info

Publication number
JP3337050B2
JP3337050B2 JP34095895A JP34095895A JP3337050B2 JP 3337050 B2 JP3337050 B2 JP 3337050B2 JP 34095895 A JP34095895 A JP 34095895A JP 34095895 A JP34095895 A JP 34095895A JP 3337050 B2 JP3337050 B2 JP 3337050B2
Authority
JP
Japan
Prior art keywords
command
flag
command execution
execution flag
card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP34095895A
Other languages
Japanese (ja)
Other versions
JPH09179947A (en
Inventor
達次郎 川北
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone 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 Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP34095895A priority Critical patent/JP3337050B2/en
Publication of JPH09179947A publication Critical patent/JPH09179947A/en
Application granted granted Critical
Publication of JP3337050B2 publication Critical patent/JP3337050B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、他の装置との間でコマ
ンド/レスポンス形式でデータをやり取りし、かつ、コ
マンド/レスポンスがブロック伝送方式で転送されるI
Cカードに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for exchanging data in the form of a command / response with another device and transmitting the command / response in a block transmission system.
It concerns the C card.

【0002】[0002]

【従来の技術】ICカードと他装置、特にICカードリ
ーダライタ間のデータのやり取りはキャラクタ伝送とバ
イナリ伝送に分けられる。キャラクタ伝送は1キャラク
タずつのデータ転送で効率が悪いため、ICカードに持
っている不揮発性メモリの容量が大きい場合は通常バイ
ナリ伝送が使用される。データをバイナリで転送する場
合は、データを固定長でブロックにしてひとまとめに送
る方法もあるが、通常は、ヘッダバイトをつけ、これに
データ長をつけることで可変長のブロックにして転送さ
れる。コマンドブロックとレスポンスブロックの例を図
6(a),(b)に示す。
2. Description of the Related Art Data exchange between an IC card and another device, particularly an IC card reader / writer, is divided into character transmission and binary transmission. Since character transmission is inefficient in data transmission of one character at a time, binary transmission is usually used when the capacity of the nonvolatile memory of the IC card is large. When transferring data in binary, there is a method of sending the data as a block with a fixed length, but it is usually transferred as a variable length block by attaching a header byte and adding the data length . FIGS. 6A and 6B show examples of a command block and a response block.

【0003】図6において、(a)はコマンドブロック
100の例であり、(b)はレスポンスブロック200
の例を示す。コマンドブロック100は、ヘッダ部10
1、コマンド部102、コマンド付随データ部103お
よびブロックチェックデータ部104で構成されてい
る。また、レスポンスブロック200は、ヘッダ部20
1、コマンド部202、コマンド実行結果部203、コ
マンド実行結果付随データ部204およびブロックチェ
ックデータ部205で構成されている。
FIG. 6A shows an example of a command block 100, and FIG.
Here is an example. The command block 100 includes a header section 10
1, a command section 102, a command accompanying data section 103, and a block check data section 104. The response block 200 includes a header 20
1, a command section 202, a command execution result section 203, a command execution result accompanying data section 204, and a block check data section 205.

【0004】このようにICカードと他の装置間のデー
タ転送が可変長ブロックで行われる場合には、他装置が
ICカードにして欲しい処理をコマンドブロック100
としてICカードに送信し、ICカードがこのコマンド
ブロック100を受信し、コマンドに対する処理を実行
し結果をレスポンスブロック200に入れて他装置側へ
返送するコマンド/レスポンス形式でデータ転送が行わ
れている。この様子を図7に示す。
When data transfer between an IC card and another device is performed in a variable-length block, a process that the other device wants to use as an IC card is executed in a command block 100.
Is transmitted to the IC card, the IC card receives the command block 100, executes the processing for the command, puts the result in the response block 200, and returns the data to the other device side in the command / response format, and the data transfer is performed. . This is shown in FIG.

【0005】図7において、10Aは従来のICカード
で、コマンド受信手段11、コマンド解析手段12、コ
マンド実行手段16、レスポンスデータ作成手段17、
レスポンス送出手段18を備えている。300は他装置
を示し、ICカード10Aとの間で、図6に示したコマ
ンドブロック100、レスポンスブロック200により
データ転送が行われる。
In FIG. 7, reference numeral 10A denotes a conventional IC card, which is a command receiving means 11, a command analyzing means 12, a command executing means 16, a response data creating means 17,
Response sending means 18 is provided. Reference numeral 300 denotes another device, and data transfer is performed with the IC card 10A by the command block 100 and the response block 200 shown in FIG.

【0006】従来は、コマンド/レスポンスのブロック
100,200を受信するときにICカード10Aと他
装置300間のデータ伝送上のエラー(パリティエラ
ー,オーバーランエラー,ビット欠落等)を検出するた
めの図6に示すようにブロックチェックデータ部10
4,205を付加し、受信したブロックチェックデータ
が受信データから計算したチェックデータと異なってい
た場合にレスポンスにエラー表示を入れて他装置300
に伝送エラーが発生したことを知らせたり、他装置30
0側でエラーを検出した場合には、再度同じデータをI
Cカード10Aに要求したりして、エラーフリーなデー
タ転送を実現している。
Conventionally, when command / response blocks 100 and 200 are received, an error (parity error, overrun error, bit loss, etc.) in data transmission between the IC card 10A and the other device 300 is detected. As shown in FIG.
If the received block check data is different from the check data calculated from the received data, an error indication is added to the response and the other device 300 is added.
To the other device 30 that a transmission error has occurred.
If an error is detected on the 0 side, the same data is
By requesting the C card 10A, error-free data transfer is realized.

【0007】[0007]

【発明が解決しようとする課題】しかし、従来の方法
は、ICカード10Aと他装置300がコマンド/レス
ポンスのやり取りを行っている間はICカード10Aに
は電源が供給されていることが前提である。このため、
コマンドを受信したICカード10Aがコマンドに対す
る処理を実行しているときにICカード10Aへの電源
供給が断たれる等の事態が発生したとき、他装置300
側はICカード10Aからのレスポンスが帰ってこない
ので、ICカード10A側に何か異常事態が発生したこ
とがわかるので異常処理を行うことができるが、ICカ
ード10A側は外部からの電源供給がなければ動作しな
いため、コマンド処理を完了しないで、次に電源供給さ
れたときは新しいコマンドを受け付ける状態となり、異
常が前回のコマンドで起きたかどうかを知るすべがなか
った。
However, the conventional method presupposes that power is supplied to the IC card 10A while the IC card 10A and the other device 300 exchange commands / responses. is there. For this reason,
When the power supply to the IC card 10A is cut off while the IC card 10A that has received the command is executing the processing for the command, the other device 300
Since the response from the IC card 10A does not return, it can be understood that something abnormal has occurred on the IC card 10A side, so that the abnormal processing can be performed. If the power is supplied next time without receiving the command processing, the command processing is not completed, so that a new command is accepted, and there is no way to know whether or not the abnormality occurred in the previous command.

【0008】本発明の目的は、他装置との間でコマンド
/レスポンス形式でデータをやり取りする際に、電源供
給の有無にかかわらず適切なレスポンスを可能としたI
Cカードを供給することにある。
[0008] An object of the present invention is to enable an appropriate response when exchanging data with another device in a command / response format regardless of whether power is supplied or not.
To supply a C card.

【0009】[0009]

【課題を解決するための手段】本発明は、これらの問題
点を解決するためになされたものであり、第1の発明
(請求項1)は、不揮発性メモリの一部にコマンド実行
中フラグテーブルを設け、他装置から受信したコマンド
ブロックを正常受信したと当該ICカードのコマンド受
信手段が判定し、該コマンド実行中フラグがクリアされ
ているとき、コマンド実行中フラグテーブルの該コマン
ド対応フラグをコマンド実行中フラグセット手段でセッ
トし、コマンド実行処理を行い、レスポンスブロックを
送出後該フラグをコマンド実行中フラグクリア手段によ
りクリアする制御手段を備えたものである。
SUMMARY OF THE INVENTION The present invention has been made to solve these problems, and a first invention (claim 1) provides a command execution flag in a part of a nonvolatile memory. The command receiving means of the IC card determines that the command block received from the other device has been normally received. When the command execution flag is cleared, the command corresponding flag in the command execution flag table is set. Control means for setting by command execution flag setting means, performing command execution processing, clearing the flag by command execution flag clear means after transmitting a response block.

【0010】第2の発明(請求項2)は、第1の発明に
おいて、コマンドを正常受信した際、コマンド実行中フ
ラグ参照手段で不揮発性メモリ上のコマンド実行中フラ
グテーブルの該コマンド実行中フラグを参照しセットさ
れているかコマンド実行中フラグセット判断手段で判断
しセットされているとき、コマンド実行処理を行わない
で、レスポンスブロック中の特定ビットをレスポンス作
成手段でセットし、前回コマンド実行中にエラーがあっ
たことを示すフラグとして使用しレスポンスを送信する
ものである。
In a second aspect of the present invention, in the first aspect, when a command is normally received, the command execution flag in the command execution flag table on the nonvolatile memory is read by the command execution flag reference means. When the command is executed, the command execution processing is not performed, and the specific bit in the response block is set by the response creation means. This is used as a flag indicating that an error has occurred and a response is transmitted.

【0011】第3の発明(請求項3)は、第1の発明に
おいて、コマンドを正常受信した際、コマンド実行中フ
ラグ参照手段で不揮発性メモリ上のコマンド実行中フラ
グテーブルの該コマンド実行中フラグを参照しセットさ
れているかコマンド実行中フラグセット判断手段で判断
しセットされているとき、コマンド処理をコマンド実行
手段で実行し、前回の該コマンド実行中にエラーがあっ
たことを示すフラグをレスポンス作成手段で立てたレス
ポンス送信後に該フラグをクリアするものである。
In a third aspect of the present invention, in the first aspect, when the command is normally received, the command execution flag in the command execution flag table in the nonvolatile memory by the command execution flag reference means is used. When the command is executed, the command is executed by the command execution means, and a flag indicating that there was an error during the previous execution of the command is returned as a response. This flag is cleared after transmitting the response set by the creating means.

【0012】第4の発明(請求項4)は、第2の発明に
おいて、コマンド実行中フラグテーブルのコマンド実行
中フラグをコマンド対応にクリアするコマンドを他装置
からコマンド受信手段で受信したとき、該フラグをコマ
ンド実行中フラグ参照手段で参照しコマンド実行中フラ
グセット判断手段で判断しセットされていれば該フラグ
をコマンド実行中フラグクリア手段でクリアするもので
ある。
According to a fourth invention (claim 4), in the second invention, when a command for clearing the command execution flag of the command execution flag table corresponding to the command is received from another device by the command reception means, The flag is referred to by the command execution flag reference means, and the flag is determined by the command execution flag set determination means. If the flag is set, the flag is cleared by the command execution flag clear means.

【0013】[0013]

【作用】第1の発明においては、ICカードへの電源供
給がコマンド実行中に断たれた場合でも、どのコマンド
を実行中だったかのフラグが不揮発性メモリのコマンド
実行中フラグテーブルに残るので、次に同じコマンドを
ICカードが受信したときICカード側で、前回同コマ
ンド実行中であったことを知ることができる。
In the first invention, even if the power supply to the IC card is cut off during the execution of a command, a flag indicating which command was being executed remains in the command execution flag table of the nonvolatile memory. When the same command is received by the IC card, the IC card can know that the command was being executed last time.

【0014】第2の発明においては、コマンド実行中フ
ラグがセットされているコマンドをICカードが受信し
たとき、該コマンドを送信した装置に同じコマンド実行
中にICカード側で電源が切れるなどのトラブルがあり
コマンド実行を正常終了していないことを知らせること
ができる。
In the second invention, when the IC card receives a command in which the command-in-progress flag is set, a trouble such as power-off at the IC card side during execution of the same command is sent to the device that transmitted the command. And that the command execution has not been completed normally.

【0015】第3の発明においては、コマンド実行中フ
ラグがセットされているコマンドをICカードが受信し
たとき、該コマンドを送信した装置に前回同じコマンド
実行中にICカード側で電源が切れるなどのトラブルが
ありコマンド実行を正常終了していないことを知らせる
とともに該コマンドを実行することができる。
In the third invention, when the IC card receives a command in which the command-in-progress flag is set, the IC card side turns off the power to the device that transmitted the command during the previous execution of the same command. It is possible to notify that the command execution has not been completed normally due to a trouble and to execute the command.

【0016】第4の発明においては、第2の発明におい
て一度セットされたコマンド実行中フラグをクリアでき
るので、次に該コマンドをICカードで実行処理でき
る。
In the fourth invention, since the command-in-progress flag once set in the second invention can be cleared, the command can be executed next by the IC card.

【0017】[0017]

【実施例】図1は、本発明一実施例の構成を示すブロッ
ク図である。また、図2に本発明によるICカード10
のハードウェアブロック図を示す。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention. FIG. 2 shows an IC card 10 according to the present invention.
FIG. 2 shows a hardware block diagram of the first embodiment.

【0018】図1において、10は本発明によるICカ
ードで、図7と同じ符号は同じ部分を示し、13はコマ
ンド実行中フラグ参照手段、14はコマンド実行中フラ
グテーブル、15はコマンド実行中フラグセット手段、
19はコマンド実行中フラグクリア手段、20はコマン
ド実行中フラグセット判断手段である。
In FIG. 1, reference numeral 10 denotes an IC card according to the present invention, the same reference numerals as in FIG. 7 denote the same parts, 13 denotes a command executing flag reference means, 14 denotes a command executing flag table, and 15 denotes a command executing flag. Setting means,
Reference numeral 19 denotes a command executing flag clear unit, and reference numeral 20 denotes a command executing flag set determining unit.

【0019】図2に示すように、ICカード10のIC
チップハードウェアは、CPU31,プログラム格納用
メモリ(ROM)32,一時作業用メモリ(RAM)3
3,不揮発性メモリ(ここではEEPROM(電気的に
消去可能なプログラマブルメモリ))34,I/Oポー
ト35および外部接続インタフェース36から構成され
る。外部接続インタフェース36は、機械的な接点であ
ってもよいし、電磁誘導等を使用した非接触インタフェ
ースであってもよい。
As shown in FIG. 2, the IC card 10
The chip hardware includes a CPU 31, a program storage memory (ROM) 32, a temporary work memory (RAM) 3
3, a nonvolatile memory (here, an EEPROM (electrically erasable programmable memory)) 34, an I / O port 35, and an external connection interface 36. The external connection interface 36 may be a mechanical contact or a non-contact interface using electromagnetic induction or the like.

【0020】また、図1のICカード10に設けるコマ
ンド実行中フラグテーブル14の構成例を図3に示し
た。図3において、141はコマンド実行中フラグ格納
データ、142は前記コマンド実行中フラグ格納データ
141のチェックサムやCRC等のエラー検出用のチェ
ックデータ、C1,C2,……,C8はコマンドに対応
するコマンド実行中フラグデータを示す。図1における
コマンドブロック100・レスポンスブロック200の
構成例は図6で示したような従来技術で使用されている
ブロック転送形式と同じである。
FIG. 3 shows an example of the configuration of the command execution flag table 14 provided in the IC card 10 of FIG. In FIG. 3, 141 is command execution flag storage data, 142 is check data of the command execution flag storage data 141, check data for error detection such as CRC, and C1, C2,..., C8 correspond to commands. Indicates command execution flag data. The configuration example of the command block 100 and the response block 200 in FIG. 1 is the same as the block transfer format used in the prior art as shown in FIG.

【0021】本発明の動作フロー例を図4,図5に示し
た。以下、この動作フロー図にしたがって本発明の動作
を詳細に説明する。なお、各図における(1)〜(1
2)、(21)〜(30)は各ステップを示す。
FIGS. 4 and 5 show examples of the operation flow of the present invention. Hereinafter, the operation of the present invention will be described in detail with reference to this operation flowchart. Note that (1) to (1)
2), (21) to (30) show each step.

【0022】まず、第1の実施例について主として図4
を使用して説明する。
First, FIG. 4 mainly shows the first embodiment.
This will be described using.

【0023】ICカード10は、他装置300から電源
が供給され動作している状態では(ステップ(1
2))、他装置300からのコマンドブロック100の
受信待ちとなっている。このとき他装置300からIC
カード10に対して何か処理(ICカード10へのデー
タの書き込みやICカード10に格納されているデータ
の読み出しなどICカード内処理)を要求するために処
理対応のコマンドブロック100を送信する。ICカー
ド側ではそのコマンドブロック100をコマンド受信手
段11で受信し(ステップ(1))、コマンドブロック
伝送上のエラー(パリティエラーやブロックチェックエ
ラー等)がなければコマンド解析手段12で他装置30
0から送られてきたコマンドブロック100のコマンド
解析を行う(ステップ(2))。コマンド解析手段12
では、対応するコマンドに対するコマンド実行中フラグ
がセットされているかどうかをコマンド実行中フラグ参
照手段13を用いて不揮発性メモリ34にあるコマンド
実行中フラグテーブル14から取り出してチェックを行
う(ステップ(3))。対応するコマンド実行中フラグ
がクリアされているときは、コマンド実行中フラグセッ
ト手段15を用いてコマンド実行中フラグテーブルの該
当コマンドに対応するフラグをセットする(ステップ
(4))。その後、コマンド実行手段16を用いて該当
コマンドを実行する(ステップ(5))。次に、レスポ
ンスデータ作成手段17を用いてレスポンスブロック2
00を作成する。このレスポンスブロック200は、コ
マンド実行結果およびその実行結果に付随データがある
場合は付随データが格納される(ステップ(6))。こ
のレスポンスブロック200をコマンドを送信した他装
置300にレスポンス送出手段18を使用して送信する
(ステップ(7))。レスポンスブロック200が正常
に送信できた後コマンド実行中フラグクリア手段19を
使用して該コマンドに対応するコマンド実行中フラグテ
ーブル14の該当するコマンド実行中フラグをクリアす
る(ステップ(8))。この後コマンドブロック受信待
ち(ステップ(12))に戻って次のコマンドブロック
100の受信待ちとなる。ステップ(3)でコマンド実
行中フラグ参照手段13で対応するコマンドのコマンド
実行中フラグがコマンド実行中フラグセット判断手段2
0にセットされていると判断された場合には、まず、そ
のコマンドがコマンド実行中フラグクリアコマンドであ
るかどうかをチェックする(ステップ(9))。他装置
300からのコマンドがコマンド実行中フラグクリアコ
マンドである場合は、レスポンスを返してコマンド実行
中フラグをクリアするため(ステップ(6))に移る。
それ以外のコマンドの場合は、レスポンスブロック20
0に前回の同じコマンド実行中にエラーが発生したこと
を示すビットを立てた後(ステップ(10))、レスポ
ンスブロック200を送信する(ステップ(11))。
The IC card 10 is supplied with power from the other device 300 and operates (step (1)
2)), it is waiting to receive the command block 100 from the other device 300. At this time, IC
A command block 100 corresponding to the processing is transmitted to request the card 10 to perform some processing (processing in the IC card such as writing data to the IC card 10 or reading data stored in the IC card 10). On the IC card side, the command block 100 is received by the command receiving means 11 (step (1)). If there is no error in the command block transmission (parity error, block check error, etc.), the command analysis means 12 causes the other device 30 to receive the command block.
The command analysis of the command block 100 sent from 0 is performed (step (2)). Command analysis means 12
Then, it is checked whether the command execution flag for the corresponding command is set from the command execution flag table 14 in the nonvolatile memory 34 by using the command execution flag reference means 13 (step (3)). ). If the corresponding command execution flag is cleared, the command execution flag setting means 15 is used to set a flag corresponding to the command in the command execution flag table (step (4)). Thereafter, the corresponding command is executed using the command executing means 16 (step (5)). Next, the response block 2
Create 00. The response block 200 stores the command execution result and the accompanying data if the execution result has accompanying data (step (6)). The response block 200 is transmitted to the other device 300 that has transmitted the command by using the response transmission unit 18 (step (7)). After successfully transmitting the response block 200, the corresponding command execution flag in the command execution flag table 14 corresponding to the command is cleared using the command execution flag clearing means 19 (step (8)). Thereafter, the flow returns to the command block reception waiting (step (12)) to wait for the next command block 100. In step (3), the command execution flag of the corresponding command in the command execution flag reference unit 13 is set to the command execution flag set determination unit 2.
If it is determined that the command is set to 0, first, it is checked whether the command is a command execution flag clear command (step (9)). If the command from the other device 300 is a command execution flag clear command, the process returns to step (6) to return a response and clear the command execution flag.
In the case of other commands, the response block 20
After setting a bit indicating that an error has occurred during execution of the same command the previous time to 0 (step (10)), the response block 200 is transmitted (step (11)).

【0024】次に、他の実施例について図5の動作フロ
ー図で説明する。
Next, another embodiment will be described with reference to the operation flowchart of FIG.

【0025】図4と同様にICカード10は、他装置3
00から電源が供給され動作している状態では、他装置
300からのコマンドブロック100の受信待ちとなっ
ている(ステップ(30))。このとき他装置300か
らのICカード10に対して何か処理(ICカード10
へのデータの書き込みやICカード10に格納されてい
るデータの読み出しなどICカード内処理)を要求する
ために処理対応のコマンドブロック100を送信する。
ICカード10側ではそのコマンドブロック100をコ
マンド受信手段11で受信し(ステップ(21))、コ
マンドブロック伝送上のエラー(パリティエラーやブロ
ックチェックエラー等)がなければコマンド解析手段1
2で他装置300から送られてきたコマンドブロック1
00のコマンド解析を行う(ステップ(22))。コマ
ンド解析手段12では、対応するコマンドに対するコマ
ンド実行中フラグがセットされているかどうかをコマン
ド実行中フラグ参照手段13を用いて不揮発性メモリ3
4にあるコマンド実行中フラグテーブル14から取り出
してチェックを行う(ステップ(23))。対応するコ
マンド実行中フラグがクリアされているときは、コマン
ド実行中フラグセット手段15を用いてコマンド実行中
フラグテーブルの該当コマンドに対応するフラグをセッ
トする(ステップ(24))。その後、コマンド実行手
段16を用いて該当コマンドを実行する(ステップ(2
5))。次に、レスポンスデータ作成手段17を用いて
レスポンスブロック200を作成する。このレスポンス
ブロック200は、コマンド実行結果およびその実行結
果に付随データがある場合は付随データが格納される
(ステップ(26))。このレスポンスブロック200
をコマンドを送信した他装置300にレスポンス送出手
段18を使用して送信する(ステップ(27))。レス
ポンスブロック200が正常に送信できた後コマンド実
行中フラグクリア手段19を使用して該コマンドに対応
するコマンド実行中フラグテーブル14の該当するコマ
ンド実行中フラグをクリアする(ステップ(28))。
この後コマンドブロック受信待ち(ステップ(30))
に戻って次のコマンドブロック100の受信待ちとな
る。ステップ(23)で対応するコマンドのコマンド実
行中フラグがセットされている場合には、レスポンスブ
ロックに前回の同じコマンド実行中にエラーが発生した
ことを示すビット(ステップ(29))を立てた後、ス
テップ(25)に移行する。
As in FIG. 4, the IC card 10 is
In a state where power is supplied from 00 and operation is being performed, reception of the command block 100 from the other device 300 is awaited (step (30)). At this time, some processing (IC card 10
A command block 100 corresponding to the processing is transmitted in order to request data writing into the IC card or processing in the IC card such as reading of data stored in the IC card 10).
On the IC card 10 side, the command block 100 is received by the command receiving unit 11 (step (21)). If there is no error in the command block transmission (parity error, block check error, etc.), the command analysis unit 1
Command block 1 sent from other device 300 in 2
00 is analyzed (step (22)). The command analysis means 12 determines whether or not the command execution flag for the corresponding command has been set by using the command execution flag reference means 13.
4 is checked out from the command execution flag table 14 (step (23)). If the corresponding command execution flag is cleared, the command execution flag setting means 15 is used to set a flag corresponding to the command in the command execution flag table (step (24)). Thereafter, the corresponding command is executed using the command execution means 16 (step (2)
5)). Next, the response block 200 is created by using the response data creating means 17. The response block 200 stores the command execution result and the accompanying data if the execution result has accompanying data (step (26)). This response block 200
Is transmitted to the other device 300 that has transmitted the command using the response transmission means 18 (step (27)). After the response block 200 has been successfully transmitted, the corresponding command execution flag in the command execution flag table 14 corresponding to the command is cleared using the command execution flag clearing means 19 (step (28)).
After this, wait for command block reception (step (30))
And waits for reception of the next command block 100. If the command execution flag of the corresponding command is set in step (23), a bit (step (29)) indicating that an error has occurred during the previous execution of the same command is set in the response block. , To step (25).

【0026】ここで、第1〜第4の発明と図4,図5の
フローチャートとの対応を示すと下記のようになる。
Here, the correspondence between the first to fourth inventions and the flowcharts of FIGS. 4 and 5 is as follows.

【0027】第1の発明は、図4のステップ(1)〜
(8)、図5のステップ(21)〜(28)に対応して
いる。
According to the first invention, steps (1) to (4) in FIG.
(8) corresponds to steps (21) to (28) in FIG.

【0028】第2の発明は、図4のステップ(9)〜
(11)に対応している。
According to the second invention, steps (9) to (9) in FIG.
This corresponds to (11).

【0029】第3の発明は、図5のステップ(29),
(25)〜(28)に対応している。
A third aspect of the present invention relates to the method of FIG.
This corresponds to (25) to (28).

【0030】第4の発明は、図4のステップ(9),
(6)〜(8)に対応している。
A fourth aspect of the present invention relates to the method of FIG.
This corresponds to (6) to (8).

【0031】[0031]

【発明の効果】以上説明したように、第1の発明によれ
ば、不揮発性メモリの一部に設けられたコマンド実行中
フラグテーブルと、他装置から受信したコマンドブロッ
クを正常受信したと当該ICカードの前記コマンド受信
手段が判定し、該コマンド実行中フラグがクリアされて
いるとき、前記コマンド実行フラグテーブルの該コマン
ド対応フラグをセットするコマンド実行中フラグセット
手段と、前記コマンド実行手段によりコマンド実行処理
を行い、レスポンスブロックをレスポンス送出手段によ
り送出後該フラグをクリアするコマンド実行中フラグク
リア手段とを備えたので、ICカードへの電源供給がコ
マンド実行中に断たれた場合、すなわち、故意にICカ
ードが動作中にリーダライタから引き抜くなどの行為が
あっても、どのコマンドを実行中だったかのフラグが不
揮発性メモリのコマンド実行中フラグテーブルに残るの
で、次に同じコマンドをICカードが受信したときIC
カード側で、前回と同じコマンド実行中であったことを
知ることができ、コマンドを送信した装置側で特にIC
カードからのレスポンスデータを解析しコマンド実行中
引き抜きがあったかどうかをチェックする必要がなくな
る。
As described above, according to the first aspect, the command execution flag table provided in a part of the non-volatile memory and the IC which determines that the command block received from the other device is normally received. The command receiving means of the card determines, and when the command execution flag is cleared, the command execution flag setting means for setting the command corresponding flag of the command execution flag table, and executing the command by the command execution means Command execution flag clearing means for performing processing and clearing the flag after sending the response block by the response sending means, so that if the power supply to the IC card is cut off during command execution, Even if the IC card is removed from the reader / writer during operation, Because of flags that were running the command remains in the command execution flag table in the nonvolatile memory, IC next time the same command IC card receives
The card can know that the same command was being executed as before, and the device that sent the command, especially the IC
There is no need to analyze the response data from the card and check if there is any pull-out during command execution.

【0032】また、第2の発明によれば、コマンドを正
常受信した際、コマンド実行中フラグ参照手段で不揮発
性メモリ上のコマンド実行中フラグテーブルの該コマン
ド実行中フラグを参照しセットされているかコマンド実
行中フラグセット判断手段で判断しセットされていると
き、コマンド実行処理を行わないで、レスポンスブロッ
ク中の特定ビットをレスポンス作成手段でセットし、前
回コマンド実行中にエラーがあったことを示すフラグと
して使用しレスポンスを送信するようにしたのでコマン
ド実行中フラグがセットされているコマンドをICカー
ドが受信したとき、該コマンドを送信した装置に同じコ
マンド実行中にICカード側で電源が切れるなどのトラ
ブルがありコマンド実行を正常終了していないことをコ
マンドを送信した装置が特別な手段を用いることなく知
らせることができる。
According to the second aspect of the present invention, when a command is normally received, whether the command execution flag is set by referring to the command execution flag in the command execution flag table in the nonvolatile memory by the command execution flag reference means. When set by the command execution flag set judgment means, the command execution processing is not performed and a specific bit in the response block is set by the response creation means to indicate that there was an error during the previous command execution. When the IC card receives a command in which the command in progress flag is set, the power is turned off on the IC card side while the same command is being executed by the device that sent the command because the response is transmitted by using the flag as a response. Sent a command indicating that command execution was not completed normally due to a problem Location can be informed without using a special means.

【0033】また、第3の発明によれば、コマンドを正
常受信した際、コマンド実行中フラグ参照手段で不揮発
性メモリ上のコマンド実行中フラグテーブルの該コマン
ド実行中フラグを参照しセットされているかコマンド実
行中フラグセット判断手段で判断しセットされていると
き、コマンド処理をコマンド実行手段で実行し、前回の
該コマンド実行中にエラーがあったことを示すフラグを
レスポンス作成手段で立てたレスポンス送信後に該フラ
グをクリアするようにしたのでコマンド実行中フラグが
セットされているコマンドをICカードが受信したと
き、該コマンドを送信した装置に前回同じコマンド実行
中にICカード側で電源が切れるなどのトラブルがあり
コマンド実行を正常終了していないことをコマンドを送
信した装置に知らせるとともに該コマンドを実行し現在
のICカードの状態を通知することができる。
According to the third aspect of the present invention, when a command is normally received, whether or not the command execution flag is set by referring to the command execution flag in the command execution flag table in the nonvolatile memory by the command execution flag reference means. When the flag is determined by the command execution flag set determination means, the command processing is executed by the command execution means, and a response indicating that an error occurred during the previous execution of the command is set by the response creation means. Since the flag is cleared later, when the IC card receives a command in which the command in-progress flag is set, the IC card side may turn off the power to the device that transmitted the command during the previous execution of the same command. Notify the device that sent the command that the command execution has not been completed normally due to a problem. It is possible to notify the current state of the IC card executes the command.

【0034】また、第4の発明によれば、コマンド実行
中フラグテーブルのコマンド実行中フラグをコマンド対
応にクリアするコマンドを他装置からコマンド受信手段
で受信したとき、該フラグをコマンド実行中フラグ参照
手段で参照しコマンド実行中フラグセット判断手段で判
断しセットされていれば該フラグをコマンド実行中フラ
グクリア手段でクリアするようにしたので一度セットさ
れたコマンド実行中フラグをクリアできるので、次に該
コマンドをICカードで実行処理でき、現在のICカー
ドの状態をコマンドを送信した装置が知ることができ
る。
According to the fourth aspect, when a command for clearing the command execution flag of the command execution flag table corresponding to the command is received from another device by the command receiving means, the flag is referred to as the command execution flag. If the command execution flag is set by judging by the command execution flag setting judging means, the flag is cleared by the command execution flag clearing means, so that the once set command execution flag can be cleared. The command can be executed by the IC card, and the current status of the IC card can be known by the device that transmitted the command.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明のICカードの一実施例の構成を示すブ
ロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of an IC card according to the present invention.

【図2】本発明を適用するICカードのハードウェアブ
ロック図である。
FIG. 2 is a hardware block diagram of an IC card to which the present invention is applied.

【図3】本発明で使用するコマンド実行中フラグテーブ
ルの構成例を示す図である。
FIG. 3 is a diagram showing a configuration example of a command execution flag table used in the present invention.

【図4】図1の実施例の動作フローの第1の例を示す図
である。
FIG. 4 is a diagram showing a first example of an operation flow of the embodiment in FIG. 1;

【図5】本発明の動作フローの第1の例を示す図であ
る。
FIG. 5 is a diagram showing a first example of an operation flow of the present invention.

【図6】従来技術のICカードのブロック図である。FIG. 6 is a block diagram of a conventional IC card.

【図7】コマンド/レスポンスブロックの構成例を示す
図である。
FIG. 7 is a diagram illustrating a configuration example of a command / response block.

【符号の説明】[Explanation of symbols]

10 ICカード 11 コマンド受信手段 12 コマンド解析手段 13 コマンド実行中フラグ参照手段 14 コマンド実行中フラグテーブル 15 コマンド実行中フラグセット手段 16 コマンド実行手段 17 レスポンスデータ作成手段 18 レスポンス送出手段 19 コマンド実行中フラグクリア手段 20 コマンド実行中フラグセット判断手段 31 CPU 32 ROM 33 RAM 34 EERPOM 35 I/O 36 外部接続インタフェース 100 コマンドブロック 200 レスポンスブロック 300 他装置 DESCRIPTION OF SYMBOLS 10 IC card 11 Command receiving means 12 Command analyzing means 13 Command running flag reference means 14 Command running flag table 15 Command running flag setting means 16 Command running means 17 Response data creation means 18 Response sending means 19 Command running flag clear Means 20 Command execution flag set determining means 31 CPU 32 ROM 33 RAM 34 EERPOM 35 I / O 36 External connection interface 100 Command block 200 Response block 300 Other device

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 不揮発性メモリを有し、前記不揮発性メ
モリに対しての読み出し・書き込みを行う動作を他装置
から送られるコマンドをコマンド受信手段で受信して行
い、そのコマンドの実行をコマンド実行手段で行い、そ
の動作実行結果をコマンド/レスポンスとしてレスポン
ス送出手段により返し、該コマンド/レスポンスをブロ
ック伝送で行うICカードにおいて、 前記不揮発性メモリの一部に設けられたコマンド実行中
フラグテーブルと、他装置から受信したコマンドブロッ
クを正常受信したと当該ICカードの前記コマンド受信
手段が判定し、該コマンド実行中フラグがクリアされて
いるとき、前記コマンド実行中フラグテーブルの該コマ
ンド対応フラグをセットするコマンド実行中フラグセッ
ト手段と、前記コマンド実行手段によりコマンド実行処
理を行い、レスポンスブロックをレスポンス送出手段に
より送出後該フラグをクリアするコマンド実行中フラグ
クリア手段とを備えたことを特徴とするICカード。
An information processing apparatus includes a non-volatile memory, and performs a read / write operation on the non-volatile memory by receiving a command sent from another device by a command receiving unit, and executing the command by executing a command. Means for performing an operation execution result as a command / response by a response sending means, and performing the command / response by block transmission. A command execution flag table provided in a part of the nonvolatile memory; The command receiving means of the IC card determines that the command block received from the other device has been normally received, and sets the command corresponding flag in the command executing flag table when the command executing flag is cleared. Command execution flag setting means, and the command execution means Ri performs command execution processing, IC card, characterized in that a command execution flag clearing means for clearing the delivery after the flag by the response transmitting unit a response block.
【請求項2】 請求項1記載のICカードにおいて、コ
マンドを正常受信した際、コマンド実行中フラグ参照手
段で不揮発性メモリ上のコマンド実行中フラグテーブル
の該コマンド実行中フラグを参照しセットされているか
コマンド実行中フラグセット判断手段で判断しセットさ
れているとき、コマンド実行処理を行わないで、レスポ
ンスブロック中の特定ビットをレスポンス作成手段でセ
ットし、前回コマンド実行中にエラーがあったことを示
すフラグとして使用しレスポンスを送信することを特徴
とするICカード。
2. The IC card according to claim 1, wherein when the command is normally received, the command execution flag reference means refers to the command execution flag in the command execution flag table on the nonvolatile memory and is set. If the command execution flag is set by the command execution flag setting means, the command execution processing is not performed and the specific bit in the response block is set by the response creation means to confirm that there was an error during the previous command execution. An IC card for transmitting a response by using the flag as an indicating flag.
【請求項3】 請求項1記載のICカードにおいて、コ
マンドを正常受信した際、コマンド実行中フラグ参照手
段で不揮発性メモリ上のコマンド実行中フラグテーブル
の該コマンド実行中フラグを参照しセットされているか
コマンド実行中フラグセット判断手段で判断しセットさ
れているとき、コマンド処理をコマンド実行手段で実行
し、前回の該コマンド実行中にエラーがあったことを示
すフラグをレスポンス作成手段で立てたレスポンス送信
後に該フラグをクリアすることを特徴とするICカー
ド。
3. The IC card according to claim 1, wherein when the command is normally received, the command execution flag reference unit refers to the command execution flag in the command execution flag table on the nonvolatile memory and is set. When the command is executed by the command execution unit, the command execution unit executes the command processing, and sets a flag indicating that there was an error during the previous execution of the command by the response creation unit. An IC card wherein the flag is cleared after transmission.
【請求項4】 請求項2記載のICカードにおいて、コ
マンド実行中フラグテーブルのコマンド実行中フラグを
コマンド対応にクリアするコマンドを他装置からコマン
ド受信手段で受信したとき、該フラグをコマンド実行中
フラグ参照手段で参照しコマンド実行中フラグセット判
断手段で判断しセットされていれば該フラグをコマンド
実行中フラグクリア手段でクリアすることを特徴とする
ICカード。
4. The command card according to claim 2, wherein when a command for clearing the command execution flag in the command execution flag table corresponding to the command is received from another device by the command receiving means, the command execution flag is set. An IC card characterized in that the flag is cleared by a command execution flag clearing means, which is referred to by a reference means and set by the command execution flag setting judging means if judged and set by the command executing flag clearing means.
JP34095895A 1995-12-27 1995-12-27 IC card Expired - Fee Related JP3337050B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP34095895A JP3337050B2 (en) 1995-12-27 1995-12-27 IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP34095895A JP3337050B2 (en) 1995-12-27 1995-12-27 IC card

Publications (2)

Publication Number Publication Date
JPH09179947A JPH09179947A (en) 1997-07-11
JP3337050B2 true JP3337050B2 (en) 2002-10-21

Family

ID=18341884

Family Applications (1)

Application Number Title Priority Date Filing Date
JP34095895A Expired - Fee Related JP3337050B2 (en) 1995-12-27 1995-12-27 IC card

Country Status (1)

Country Link
JP (1) JP3337050B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002251524A (en) * 2001-02-23 2002-09-06 Sony Corp Communication system, card, control server, communication method, program, and recording medium recorded with program
JP4575067B2 (en) * 2004-07-29 2010-11-04 ルネサスエレクトロニクス株式会社 IC tag semiconductor device, IC tag and IC tag control method
WO2006057049A1 (en) 2004-11-26 2006-06-01 Kabushiki Kaisha Toshiba Card and host device
JP4958601B2 (en) * 2007-03-30 2012-06-20 パナソニック株式会社 Watching system and passing history recording method
JP2010044603A (en) * 2008-08-13 2010-02-25 Sony Corp Communication device, communication method, program, and communication system

Also Published As

Publication number Publication date
JPH09179947A (en) 1997-07-11

Similar Documents

Publication Publication Date Title
US9004349B2 (en) IC card and IC card system having suspend/resume functions
KR100456180B1 (en) A peripheral device and control method thereof
EP0733987B1 (en) Transmission method of changing protocol and data processing apparatus using this method
US20060224821A1 (en) System for parallel updating flash memory and method for the same
JP3337050B2 (en) IC card
CN113420035A (en) Data processing method, system, device, electronic equipment and computer storage medium
JP5085254B2 (en) Portable electronic device, IC card, and command processing method in portable electronic device
US7287098B2 (en) Control method and electronic device enabling recognition of functions installed in the electronic device
US20030154288A1 (en) Server-client system and data transfer method used in the same system
JP5286814B2 (en) Semiconductor device, portable electronic device, self-diagnosis method, self-diagnosis program
JP4747451B2 (en) Data access method to portable information recording medium
JP7468754B1 (en) ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, IC CARD, RECEPTION BLOCK PROCESSING METHOD, AND PROGRAM
JPH01213774A (en) Portable storage medium processor
JP2993008B2 (en) Article identification system
JP2004185419A (en) Portable electronic medium, issuing system of portable electronic medium, processing method, and issuing method
JP2956241B2 (en) Data processing system
JP2003114831A (en) Portable electronic device
JP7420179B1 (en) Electronic information storage medium, IC card, issuance processing method, and program
JP3087329B2 (en) Article identification device
EP1179907A2 (en) Data communication apparatus and method with error correction mode
JP5092370B2 (en) Portable information recording medium and program thereof
JP2517370B2 (en) Control method of intelligent measurement card
JP2006127128A (en) Slave apparatus of information processing system, operation control program for slave apparatus and operation control method for slave apparatus
JP2003162740A (en) Non-contact ic card system
JP3030821B2 (en) IC card data transmission system

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070809

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20080809

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20080809

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090809

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20090809

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100809

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20100809

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110809

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120809

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20130809

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees