JP2010122877A - Ic card - Google Patents

Ic card Download PDF

Info

Publication number
JP2010122877A
JP2010122877A JP2008295555A JP2008295555A JP2010122877A JP 2010122877 A JP2010122877 A JP 2010122877A JP 2008295555 A JP2008295555 A JP 2008295555A JP 2008295555 A JP2008295555 A JP 2008295555A JP 2010122877 A JP2010122877 A JP 2010122877A
Authority
JP
Japan
Prior art keywords
message
stored
command
command message
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.)
Pending
Application number
JP2008295555A
Other languages
Japanese (ja)
Inventor
Kenji Sato
賢治 佐藤
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.)
Tokin Corp
Original Assignee
NEC Tokin 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 NEC Tokin Corp filed Critical NEC Tokin Corp
Priority to JP2008295555A priority Critical patent/JP2010122877A/en
Publication of JP2010122877A publication Critical patent/JP2010122877A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an IC card which can specify a target file and correctly execute a receiving command message which the IC card has received, while shortening processing time required for data processing in an IC chip built in the IC card. <P>SOLUTION: An operating system of the IC card records information about a plurality of storing message groups comprising a pair of storing command messages and a storing response message in a predetermined area of a rewritable nonvolatile memory in the IC chip, gives ranking to them and makes them have a function to perform counting of these numbers. Furthermore, when comparing the receiving command message with the storing command message and they disagree, after interpreting and executing the content one by one from the storing command messages of the first rank storing message group, the operating system finally performs execution processing of the receiving command message as the disagreement. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、ICカードのデータ処理技術に係り、特にデータ処理に要する処理時間を短縮化したICカードに関する。   The present invention relates to a data processing technique for an IC card, and more particularly to an IC card in which a processing time required for data processing is shortened.

上位装置とICカードが通信する際、応答性が良好なICカードを実現することは、ICカードを利用する利用者、あるいはICカードシステムを提供する事業者等にとって、非常に有効である。とりわけICカードに内蔵されるICチップ内でのデータ処理を高速化し処理時間を短縮化する技術は、上位装置とICカードとの通信速度を高める有効な手段である。このようなデータ処理に要する処理時間を短縮化する技術は、従来から数多く提案されている。   When an IC card communicates with a host device, it is very effective for a user who uses an IC card or a business operator who provides an IC card system to realize an IC card with good responsiveness. In particular, the technology for speeding up the data processing in the IC chip built in the IC card and reducing the processing time is an effective means for increasing the communication speed between the host device and the IC card. Many techniques for shortening the processing time required for such data processing have been proposed.

例えば特許文献1には、過去に命令が処理したデータの内容を用いて、命令実行の高速化を図るため、既実行の各命令に対し演算の入力と結果のデータ、主記憶の読み出し/書き込みアドレスとデータなどを記憶する履歴記憶を用意し、再度同じ命令を実行するときに履歴記憶を参照し、履歴が残っていれば、演算命令の場合には現在の入力データと履歴データを比較し、読み出し/書き込み命令の場合には現在の読み出し/書き込みデータとアドレスを履歴と比較し、それらが同じであれば、演算の実行をスキップして履歴記憶の結果データを現在の結果として用いるか、現在の読み出し/書き込みをスキップすることにより高速化を達成し、これにより、各命令の実行に要するパイプラインステージ数を短縮でき、その結果、命令列の実行時間を短縮し、メモリに対する不要なロード/ストア操作を抑止することから、キャッシュ制御やアドレス変換など記憶域管理の負荷を軽減することができ、ロード/ストア命令の平均実行時間を短縮できるとする技術について開示されている。   For example, in Patent Document 1, in order to speed up the execution of an instruction using the contents of data processed by an instruction in the past, the operation input and the result data for each executed instruction, the reading / writing of the main memory Prepare a history memory to store addresses and data, etc., refer to the history memory when executing the same instruction again, and if the history remains, compare the current input data with the history data in the case of an operation instruction. In the case of a read / write command, the current read / write data and the address are compared with the history, and if they are the same, the execution of the operation is skipped and the result data of the history storage is used as the current result, By skipping the current read / write, speeding up can be achieved, thereby reducing the number of pipeline stages required to execute each instruction. Since the time is reduced and unnecessary load / store operations on memory are suppressed, the load of storage management such as cache control and address translation can be reduced, and the average execution time of load / store instructions can be reduced. The technology is disclosed.

また、特許文献2には、データ依存関係のある後続命令を投機的に実行する際に、本来の演算器を使用せず、演算器競合を回避するために、過去の命令実行結果をそのまま命令の実行結果として出力する履歴演算器と、オペランドが過去の値と同一の命令を履歴演算器に発行する命令発行回路を設け、投機実行そのものを省略して処理時間を短縮する技術について開示されている。   Further, in Patent Document 2, in order to speculatively execute a subsequent instruction having a data dependency, an original arithmetic unit is not used and a past instruction execution result is directly used as an instruction in order to avoid an arithmetic unit conflict. A technique has been disclosed in which a history calculator that outputs the execution result of the instruction and an instruction issue circuit that issues an instruction whose operand is the same as the past value to the history calculator is provided, and the processing time is reduced by omitting speculative execution itself. Yes.

また、特許文献3には、特定パターンのコマンド列が認められる場合に、ホスト装置から発行されるコマンドの列を予測して動作することで、ホスト装置からみた該当する処理に要する処理時間を短縮する技術について開示されている。   Further, in Patent Document 3, when a command string having a specific pattern is recognized, a command string issued from the host apparatus is predicted to operate, thereby reducing the processing time required for the corresponding process as viewed from the host apparatus. The technology to do is disclosed.

国際公開WO98/11484号パンフレットInternational Publication WO98 / 11484 Pamphlet 国際公開WO99/45463号パンフレットInternational publication WO99 / 45463 pamphlet 特開平10−187578号公報Japanese Patent Laid-Open No. 10-187578

一般に、ICカードは、少なくともCPUとメモリ装置を有したICチップを内蔵している。メモリ装置は、読み出し専用の不揮発性メモリであるROM、書き換え可能な不揮発性メモリであるEEPROM、および書き換え可能な揮発性メモリであるRAMで構成される。通常、ROMにはオペレーティングシステムが搭載され、EEPROMにはアプリケーションプログラムおよびユーザデータが搭載、および格納され、RAMはデータ処理の作業領域として使用される。   In general, an IC card contains an IC chip having at least a CPU and a memory device. The memory device includes a ROM that is a read-only nonvolatile memory, an EEPROM that is a rewritable nonvolatile memory, and a RAM that is a rewritable volatile memory. Usually, an operating system is mounted on the ROM, application programs and user data are mounted and stored on the EEPROM, and the RAM is used as a work area for data processing.

また、ICカードは、上位装置、例えばリーダライタに外部接続されたコンピュータ、あるいはMPU等を内蔵したリーダライタ等と情報のやりとりを行なう。情報のやりとりは、各々の接触端子を物理的に結合して行なう接触方式、もしくは無線等を利用した非接触方式による通信方式が用いられる。   The IC card exchanges information with a host device, for example, a computer externally connected to a reader / writer, or a reader / writer with a built-in MPU or the like. Information is exchanged using a contact method in which each contact terminal is physically coupled, or a non-contact communication method using wireless or the like.

なお、前記ICカードが、複数のアプリケーションを実行することが可能であるマルチアプリケーション型のICカードである場合は、前記EEPROMには複数のアプリケーションプログラムまたはアプリケーションデータが搭載され、前記ROMには複数のアプリケーションに対応したオペレーティングシステムが搭載される。   When the IC card is a multi-application type IC card that can execute a plurality of applications, the EEPROM has a plurality of application programs or application data, and the ROM has a plurality of applications. The operating system corresponding to the application is installed.

マルチアプリケーション型のICカードに搭載されるオペレーティングシステムは、各アプリケーションの管理、データの管理、および上位装置から送信されるコマンドメッセージの内容を解釈して実行し、データ処理全体の制御を担う機能を備える。通常、ICカードが受信したコマンドメッセージは、ICカードのICチップ内のROMに記録されているコマンドテーブルに基づいて選択され、実行処理される。   The operating system mounted on the multi-application type IC card has functions for managing each application, managing data, interpreting and executing the contents of command messages sent from the host device, and controlling the entire data processing. Prepare. Normally, a command message received by the IC card is selected and executed based on a command table recorded in a ROM in the IC chip of the IC card.

また、上位装置とICカードとの間の情報のやりとりは、上位装置からICカードへ向けてコマンドメッセージを送信し、このコマンドメッセージに応答する返事として、ICカードから上位装置へ向けてレスポンスメッセージを返信することによって実行される。通常は、このような種々のコマンドメッセージおよびレスポンスメッセージの送受信プロセスを繰り返し実行することによって、上位装置とICカード間の通信が成立している。   The exchange of information between the host device and the IC card is performed by sending a command message from the host device to the IC card, and sending a response message from the IC card to the host device as a response to this command message. It is executed by replying. Normally, communication between the host device and the IC card is established by repeatedly executing such various command message and response message transmission / reception processes.

図14は、上位装置とICカード間の通信におけるコマンドメッセージおよびレスポンスメッセージの送受信を実行するシーケンスの一例を示した概略図である。図14は、例えば複数のアプリケーションを実行することが可能であるマルチアプリケーション型のICカードと上位装置とが通信を行い、上位装置が、前記ICカードを活性化して複数のアプリケーションの中から任意のアプリケーションを選択した後、照合キーによる認証を行い、前記ICカード内の書き換え可能な不揮発性メモリの所定の領域に格納される任意のファイルのIDデータを読み出すまでのプロセスを示している。   FIG. 14 is a schematic diagram illustrating an example of a sequence for executing transmission / reception of a command message and a response message in communication between the host device and the IC card. In FIG. 14, for example, a multi-application type IC card capable of executing a plurality of applications communicates with a host device, and the host device activates the IC card to select any of the plurality of applications. This shows a process from selecting an application, authenticating with a verification key, and reading ID data of an arbitrary file stored in a predetermined area of the rewritable nonvolatile memory in the IC card.

図14において、始めに上位装置は、ICカードへ向けて活性化コマンドメッセージを送信する。これを受信したICカードは、前記活性化コマンドメッセージを実行し、上位装置へ向けて前記活性化コマンドメッセージが実行完了したことを通知するためのレスポンスメッセージを返信する。次に上位装置は、前記レスポンスメッセージを受信した後、ICカードへ向けてアプリケーション選択コマンドメッセージを送信する。これを受信したICカードは、前記アプリケーション選択コマンドメッセージを実行し、上位装置へ向けて前記アプリケーション選択コマンドメッセージが実行完了したことを通知するためのレスポンスメッセージを返信する。引き続き上位装置は、前記レスポンスメッセージを受信した後、ICカードへ向けて認証コマンドメッセージを送信する。これを受信したICカードは、前記認証コマンドメッセージを実行し、上位装置へ向けて前記認証コマンドメッセージが実行完了したことを通知するためのレスポンスメッセージを返信する。さらに上位装置は、前記レスポンスメッセージを受信した後、ICカードへ向けてID読み出しコマンドメッセージを送信する。これを受信したICカードは、前記ID読み出しコマンドメッセージを実行し、上位装置へ向けて前記ID読み出しコマンドメッセージが実行完了したことを通知するためのレスポンスメッセージを返信する。このように上位装置とICカードは、コマンドメッセージおよびレスポンスメッセージを交互に繰り返し送信して通信を行っている。   In FIG. 14, first, the higher-level device transmits an activation command message to the IC card. Upon receiving this, the IC card executes the activation command message and returns a response message for notifying the host device that the activation command message has been executed. Next, after receiving the response message, the higher-level device transmits an application selection command message to the IC card. Upon receiving this, the IC card executes the application selection command message, and returns a response message for notifying that the execution of the application selection command message is completed to the higher-level device. Subsequently, after receiving the response message, the host device transmits an authentication command message to the IC card. Upon receiving this, the IC card executes the authentication command message and returns a response message for notifying the host device that the authentication command message has been executed. Further, after receiving the response message, the host device transmits an ID read command message to the IC card. Upon receiving this, the IC card executes the ID read command message and returns a response message for notifying the host device that the ID read command message has been executed. In this way, the host device and the IC card communicate by repeatedly transmitting command messages and response messages alternately.

上述のように上位装置とICカード間でコマンドメッセージおよびレスポンスメッセージが繰り返し送信されるとき、ICカードに内蔵されているICチップのデータ処理回路においては、各コマンドメッセージに対応した、書き換え可能な不揮発性メモリの所定の領域に格納されている特定のデータを指定したり、読み出したり、あるいは書き換えたりする処理を頻繁に行なわなければならない。とりわけ複数のデータに対して交互にアクセスがなされる場合、非常に複雑な処理となってしまう。また、ICカードがマルチアプリケーション型のICカードである場合、複数のアプリケーション各々に対して、同様の処理を実行しなければならないため、さらに煩雑な処理となる。   When the command message and the response message are repeatedly transmitted between the host device and the IC card as described above, the rewritable nonvolatile data corresponding to each command message is received in the data processing circuit of the IC chip built in the IC card. A process of designating, reading, or rewriting specific data stored in a predetermined area of the volatile memory must be frequently performed. In particular, when a plurality of data are alternately accessed, the processing becomes very complicated. Further, when the IC card is a multi-application type IC card, the same processing must be executed for each of a plurality of applications, which makes the processing more complicated.

ところで、マルチアプリケーション型のICカードは、複数のアプリケーションを一枚のICカードで実行できる利便性の高いICカードであるが、実際の利用においては、単一の特定アプリケーションのみを使用する場合も非常に多い。このような、事実上単一のアプリケーションのみを使用するマルチアプリケーション型のICカード、あるいは単一のアプリケーションのみを搭載したICカードにおいては、上位装置から送信される複数のコマンドメッセージ、および前記複数のコマンドメッセージの実行順序が事実上固定され、上位装置とICカード間の毎回のアクセスにおいて、コマンドメッセージおよびレスポンスメッセージを実行する特定のシーケンスのほとんどが変更されない状態で運用される場合がある。例えば、毎回同じアクセスを実行し、個人を特定するためだけに運用される入退室管理用ICカードや社員証ICカード等が具体例として挙げられる。   By the way, the multi-application type IC card is a highly convenient IC card that can execute a plurality of applications with a single IC card. However, in actual use, it is very difficult to use only a single specific application. Too many. In such a multi-application type IC card that uses only a single application, or an IC card equipped with only a single application, a plurality of command messages transmitted from a host device, and the plurality of There are cases where the execution sequence of command messages is practically fixed, and in each access between the host device and the IC card, most of the specific sequences for executing the command messages and response messages are not changed. For example, an entrance / exit management IC card, an employee ID IC card, etc., which are used only for specifying the individual who performs the same access every time, can be cited as specific examples.

上述したような条件下で、事実上単一のアプリケーションのみを使用するマルチアプリケーション型のICカード、あるいは単一のアプリケーションのみを搭載したICカードを運用する場合、図14に示したような、その都度コマンドメッセージを実行し、レスポンスメッセージを返信する方法は、非効率的であり、その結果、処理時間の低下を招くという問題がある。   When operating a multi-application type IC card that uses only a single application or an IC card equipped with only a single application under the conditions as described above, as shown in FIG. The method of executing the command message each time and returning the response message is inefficient, and as a result, there is a problem that the processing time is reduced.

また、データ処理に要する時間を短縮化するため、上位装置から受信したコマンドメッセージを実行する際に、ICカードに内蔵されたICチップ内の書き換え可能な不揮発性メモリの所定の領域に、過去に実行したコマンドメッセージおよびその実行結果に関する情報、すなわち履歴情報を記録しておき、再度同じコマンドメッセージを実行する際には、これに該当する履歴情報を用いてデータ処理を行う技術がいくつか提案されている。   Also, in order to shorten the time required for data processing, when executing a command message received from a host device, a predetermined area of a rewritable nonvolatile memory in an IC chip built in the IC card has been stored in the past. Several techniques have been proposed to record information about executed command messages and execution results, that is, history information, and to execute data processing using the corresponding history information when executing the same command message again. ing.

以下、前記履歴情報を用いたデータ処理技術の具体例について、図12および図13を参照して説明する。   Hereinafter, a specific example of a data processing technique using the history information will be described with reference to FIGS. 12 and 13.

図12は、ICカードに内蔵されたICチップ内の書き換え可能な不揮発性メモリの所定の領域に格納されるデータのデータ構造の一例を示す概略図である。図12は、複数のアプリケーションを搭載することができるマルチアプリケーション型のICカードにおけるデータ構造の一例を示している。   FIG. 12 is a schematic diagram showing an example of a data structure of data stored in a predetermined area of a rewritable nonvolatile memory in an IC chip built in the IC card. FIG. 12 shows an example of a data structure in a multi-application type IC card that can mount a plurality of applications.

図12に示すように、一般にICカードに内蔵されたICチップ内の書き換え可能な不揮発性メモリの所定の領域に格納されるデータは、ファイル単位で構成され、これらが階層構造をなすツリー形式のデータ構造となっている。階層の最上位にある主ファイルの配下には、複数の専用ファイルが存在し、各専用ファイルの配下には、複数の基礎ファイルが存在する。例えば主ファイルに相当する「ルートフォルダ」の直下には、二つの専用ファイル、すなわち二つのアプリケーションに対応する「アプリケーション1フォルダ」および「アプリケーション2フォルダ」と、二つの基礎ファイルである「ファイル1」および「ファイル2」と、照合を行なうための「キー1」および「キー2」とが存在する。さらに「アプリケーション1フォルダ」の直下には、三つの基礎ファイルである「ファイル1」および「ファイル2」ならびに「ファイル3」と、照合を行なうための「キー3」とが存在する。同様に、「アプリケーション2フォルダ」の直下には、二つの基礎ファイルである「ファイル1」および「ファイル2」と、照合を行なうための「キー4」とが存在する。   As shown in FIG. 12, generally, data stored in a predetermined area of a rewritable nonvolatile memory in an IC chip built in an IC card is configured in units of files, and is in a tree format in which these form a hierarchical structure. It has a data structure. A plurality of dedicated files exist under the main file at the top of the hierarchy, and a plurality of basic files exist under each dedicated file. For example, immediately below the “root folder” corresponding to the main file, two dedicated files, that is, “application 1 folder” and “application 2 folder” corresponding to two applications, and two basic files “file 1”. And “file 2” and “key 1” and “key 2” for collation. Further, immediately below the “application 1 folder”, there are three basic files “file 1”, “file 2” and “file 3”, and “key 3” for collation. Similarly, immediately below “Application 2 folder”, there are two basic files “File 1” and “File 2” and “Key 4” for collation.

図13は、ICカードのオペレーティングシステムが上位装置から受信した受信コマンドメッセージを実行処理するプロセスを模式的に示した図である。   FIG. 13 is a diagram schematically showing a process in which the operating system of the IC card executes the received command message received from the host device.

図13は、例えば上位装置が、三つのコマンドメッセージ、すなわちアプリケーション選択コマンドメッセージ、認証コマンドメッセージ、およびID読み出しコマンドメッセージをICカードに対して送信し、ICカードがこれら三つのコマンドメッセージを受信し、同時にICカードのオペレーティングシステムが、受信した一連のコマンドメッセージを先の順番で実行するプロセスを示している。ただしこれに先立って、上位装置からは、ICカードを活性化するための活性化コマンドメッセージが送信されるが、ここでは説明を省略する。   In FIG. 13, for example, the host device transmits three command messages, that is, an application selection command message, an authentication command message, and an ID read command message to the IC card, and the IC card receives these three command messages. At the same time, a process is shown in which the operating system of the IC card executes a series of received command messages in the order mentioned above. However, prior to this, an activation command message for activating the IC card is transmitted from the host device, but the description is omitted here.

始めにICカードは、上位装置から、図12に示す専用ファイルである「アプリケーション1フォルダ」を選択するコマンドメッセージ、すなわちアプリケーション選択コマンドメッセージを受信する。そしてICカードのオペレーティングシステムは、書き換え可能な不揮発性メモリの所定の領域に格納される、過去に実行したコマンドメッセージおよびその実行結果に関する情報、すなわち履歴情報を参照し、受信した「アプリケーション1フォルダ」を選択するコマンドメッセージと比較する。比較した結果一致した場合、過去に実行した当該コマンドメッセージの実行結果からなるレスポンスメッセージを上位装置に返信する。   First, the IC card receives a command message for selecting “application 1 folder”, which is a dedicated file shown in FIG. The operating system of the IC card refers to the command message executed in the past and information related to the execution result, that is, history information stored in a predetermined area of the rewritable nonvolatile memory, and receives the received “application 1 folder”. Compare with the command message to select. If they match as a result of the comparison, a response message composed of the execution result of the command message executed in the past is returned to the host device.

なお、ここで表記した履歴情報について詳しく述べると、前記履歴情報は、例えば、書き換え可能な不揮発性メモリの所定の領域に格納される格納メッセージ組として定義付けて表記され、そのうち、過去に実行したコマンドメッセージに関する情報は、格納コマンドメッセージとして定義付けて表記することができ、また、その実行結果に関する情報は、格納レスポンスメッセージとして定義付けて表記することができる。加えて、ICカードが受信した受信コマンドメッセージについても、受信コマンドメッセージとして定義付けて表記することができ、その実行結果に関する情報は、送信レスポンスメッセージとして定義付けて表記することができる。   The history information described here will be described in detail. For example, the history information is defined as a stored message set stored in a predetermined area of the rewritable non-volatile memory, and has been executed in the past. Information related to the command message can be defined and expressed as a stored command message, and information regarding the execution result can be defined and expressed as a stored response message. In addition, the reception command message received by the IC card can also be defined and expressed as a reception command message, and information on the execution result can be defined and expressed as a transmission response message.

次にICカードは、上位装置から、図12に示す照合キーである「キー3」で照合するコマンドメッセージ、すなわち認証コマンドメッセージを受信する。そしてICカードのオペレーティングシステムは、書き換え可能な不揮発性メモリの所定の領域に格納される、格納コマンドメッセージを参照し、受信した「キー3」で照合するコマンドメッセージと比較する。比較した結果一致した場合、過去に実行した当該コマンドメッセージの実行結果であるレスポンスメッセージを上位装置に返信する。   Next, the IC card receives a command message to be collated with “key 3” which is the collation key shown in FIG. Then, the operating system of the IC card refers to the stored command message stored in a predetermined area of the rewritable non-volatile memory, and compares it with the received command message to be verified with “key 3”. If they match as a result of the comparison, a response message, which is the execution result of the command message executed in the past, is returned to the host device.

引き続きICカードは、上位装置から、図12に示す基礎ファイルである「ファイル2」を読み出すコマンドメッセージ、すなわちID読み出しコマンドメッセージを受信する。そしてICカードのオペレーティングシステムは、書き換え可能な不揮発性メモリの所定の領域に格納される、格納コマンドメッセージを参照し、受信した「ファイル2」を読み出すコマンドメッセージと比較する。しかしこの場合、オペレーティングシステムが参照した格納コマンドメッセージは、「ファイル1」を読み出す格納コマンドメッセージであり、受信した「ファイル2」を読み出す格納コマンドメッセージと一致しない。   Subsequently, the IC card receives a command message for reading “file 2” as the basic file shown in FIG. 12, that is, an ID read command message, from the host device. Then, the operating system of the IC card refers to the stored command message stored in a predetermined area of the rewritable nonvolatile memory, and compares it with the command message for reading the received “file 2”. However, in this case, the stored command message referred to by the operating system is a stored command message for reading “file 1” and does not match the received stored command message for reading “file 2”.

そこで、オペレーションシステムは、他の適合する格納コマンドメッセージを参照しようとするが、ルートフォルダの配下にある基礎ファイルのうち、ファイル名が「ファイル2」であるものが複数存在するため、目的のファイルを特定できない。   Therefore, the operation system tries to refer to another suitable stored command message, but since there are a plurality of basic files under the root folder whose file name is “File 2”, the target file Cannot be identified.

つまり、オペレーティングシステムは、受信した三つのコマンドメッセージの実行順序、およびこの「ファイル2」を読み出すコマンドメッセージ以前に実行済みの二つの受信コマンドメッセージ、すなわち「アプリケーション1フォルダ」を選択するコマンドメッセージ、および「キー3」で照合するコマンドメッセージの各々と、書き換え可能な不揮発性メモリの所定の領域に格納される、これら受信コマンドメッセージに対応する格納コマンドメッセージの各々が、一致したことについては把握しているものの、この「ファイル2」を読み出すコマンドメッセージ以前に実行されたコマンドメッセージの内容、すなわち、どのアプリケーションフォルダが選択されたのかについて認識していないため、どのアプリケーションフォルダの配下にある「ファイル2」なのかを判断できず、当該コマンドメッセージを実行することができないという問題がある。   That is, the operating system executes the execution order of the three received command messages, and the two received command messages executed before the command message for reading “file 2”, that is, the command message for selecting “application 1 folder”, and Ascertain that each of the command messages to be collated with “Key 3” matches each of the stored command messages corresponding to these received command messages stored in a predetermined area of the rewritable nonvolatile memory. However, since the contents of the command message executed before the command message for reading “file 2”, that is, which application folder is selected is not recognized, which application folder It can not determine whether the underlying "File 2" of the, it is impossible to execute the command message.

上述した技術の一例として、特許文献1に記載されているような、コマンドメッセージが処理したデータ内容と当該コマンドメッセージのアドレスを対にした履歴情報、換言すれば、格納メッセージ組を用いたものがある。しかしながら、上位装置から送信される複数のコマンドメッセージ、および前記複数のコマンドメッセージの実行順序が固定されている条件下においては、必ずしも適用できない。すなわち特許文献1に記載の技術は、単に、参照する格納メッセージ組の中に、受信した受信コマンドメッセージに関する情報、換言すれば受信コマンドメッセージと、書き換え可能な不揮発性メモリに格納された、過去に実行した該当するコマンドメッセージの実行結果に関する情報、換言すれば、格納コマンドメッセージが一致した場合に、当該コマンドメッセージの実行処理を省略して処理時間の短縮化を実現しようとするものであり、コマンドメッセージの実行順序に対する考慮がなされていないため、上述の問題は解決できない。   As an example of the above-described technique, as described in Patent Document 1, there is history information in which data contents processed by a command message and the address of the command message are paired, in other words, a stored message set is used. is there. However, it is not necessarily applicable under the condition that the plurality of command messages transmitted from the host device and the execution order of the plurality of command messages are fixed. In other words, the technique described in Patent Document 1 simply includes information about received received command messages in a stored message set to be referred to, in other words, received command messages and stored in a rewritable nonvolatile memory in the past. Information related to the execution result of the corresponding command message executed, in other words, if the stored command message matches, the command message execution process is omitted to reduce the processing time. Since the message execution order is not considered, the above problem cannot be solved.

また、特許文献2の記載の技術も、特許文献1と同様に履歴情報、すなわち格納メッセージ組を用いて処理時間の短縮化を実現しようとするものである。しかしこの技術では、格納メッセージ組の中にある過去のコマンドメッセージの内容、例えば格納コマンドメッセージ、およびその実行結果、例えば格納レスポンスメッセージと、受信した最初の受信コマンドメッセージの内容および当該受信コマンドメッセージの実行結果に対してのみ比較を行なって、それが一致したか否かを確認するものであり、後続する受信コマンドメッセージの内容に対しての比較は行なわない。そのため上述の問題は解決できない。   The technique described in Patent Document 2 also attempts to reduce processing time using history information, that is, a stored message set, as in Patent Document 1. However, with this technique, the contents of past command messages in the stored message set, for example, stored command messages, and the execution results thereof, for example, stored response messages, the contents of the first received command message received, and the received command message A comparison is made only for the execution result to check whether or not they match, and no comparison is made for the contents of the subsequent received command message. Therefore, the above problem cannot be solved.

また、特許文献3の記載の技術は、上位装置から発行される複数のコマンドメッセージのパターンがシステム起動の度に同じであるとき、これを履歴情報、例えば格納メッセージ組として保持し、この履歴情報を元に、あらかじめ予測して、前記パターンのコマンドメッセージ列を実行処理し、処理時間の短縮化を実現しようとするものである。しかしこの技術では、受信した受信コマンドメッセージ列と、これに対応する履歴情報にあるコマンドメッセージ列とを比較する際、両者のコマンドメッセージ列の中で一致しないコマンドメッセージがあった場合、これを優先して実行処理するため、コマンドメッセージの実行順序が固定されている条件下においては適用できない。したがって上述の問題は解決できない。   Further, the technique described in Patent Document 3 holds, when the patterns of a plurality of command messages issued from the host device are the same every time the system is activated, this is retained as history information, for example, a stored message set. Based on the above, the command message string having the above pattern is predicted and executed to reduce the processing time. However, in this technique, when a received command message sequence is compared with a command message sequence in the corresponding history information, if there is a command message that does not match in both command message sequences, this command is given priority. Therefore, it cannot be applied under conditions where the execution order of command messages is fixed. Therefore, the above problem cannot be solved.

すなわち従来の技術では、ICカードが上位装置から受信する受信コマンドメッセージを実行する際、受信した受信コマンドメッセージと、これに対応した前記履歴情報、すなわち格納コマンドメッセージとを比較して不一致となる場合、目的のファイルを特定できず、前記受信コマンドメッセージを正確に実行することができない。   That is, in the related art, when the IC card executes a received command message received from the host device, the received received command message is compared with the history information corresponding to the received command message, that is, the stored command message, resulting in a mismatch. The target file cannot be specified, and the received command message cannot be accurately executed.

本発明は、上記事情に鑑みてなされたものでその目的は、事実上単一のアプリケーションのみを使用するマルチアプリケーション型のICカード、あるいは単一のアプリケーションのみを搭載したICカードにおいて、上位装置から送信される複数のコマンドメッセージ、および前記複数のコマンドメッセージの実行順序が事実上固定され、コマンドメッセージおよびレスポンスメッセージを送信する特定のシーケンスが変更されない状態で運用される際、その都度行なわれるコマンドメッセージの内容の解釈および当該コマンドメッセージの実行処理をスキップしてこれを省略するための簡易な管理機能をICカードのオペレーティングシステムに具備させ、この処理を省略した分だけ、全体のデータ処理に要する時間を短縮するとともに、受信した受信コマンドメッセージと、これに対応した格納コマンドメッセージとを比較して不一致となる場合であっても、目的のファイルを特定し、前記受信コマンドメッセージを正確に実行することができるICカードを提供することにある。   The present invention has been made in view of the above circumstances, and its purpose is to be a multi-application type IC card that uses only a single application, or an IC card equipped with only a single application, from a host device. A plurality of command messages to be sent, and a command message to be executed each time when the execution sequence of the plurality of command messages is practically fixed and a specific sequence for sending command messages and response messages is not changed The IC card operating system is provided with a simple management function for skipping the processing of interpreting the contents of the command and executing the command message, and the time required for the entire data processing by omitting this processing. As well as shortening Even if the received command message received and the stored command message corresponding to the received command message do not match, an IC card that can identify the target file and execute the received command message accurately It is to provide.

上述した課題を解決すべく、本発明者らは種々の検討の結果、以下の解決手段を見出した。すなわち本発明は、上位装置がICカードに向けてコマンドメッセージの送信を行い、前記コマンドメッセージを受信した前記ICカードのオペレーティングシステムは、前記コマンドメッセージの内容、すなわち受信コマンドメッセージの内容を解釈して、これを実行するとともに、前記ICカードは、前記受信コマンドメッセージに応答する返事としてのレスポンスメッセージを、前記上位装置に向けて返信するものであって、前記ICカードのオペレーティングシステムは、自身に内蔵されるICチップ内の書き換え可能な不揮発性メモリの所定の領域に、一対の、コマンドヘッダおよびコマンドボディで構成される格納コマンドメッセージと、レスポンスボディおよびレスポンストレイラで構成される格納レスポンスメッセージとからなる、複数の格納メッセージ組に関する情報を記録し、前記格納メッセージ組に順位を付与し、かつ前記格納メッセージ組の個数を計数する機能を有している。   As a result of various studies, the present inventors have found the following means for solving the problems described above. That is, in the present invention, the host device transmits a command message to the IC card, and the operating system of the IC card that has received the command message interprets the content of the command message, that is, the content of the received command message. In addition to executing this, the IC card returns a response message as a reply to the received command message to the host device, and the operating system of the IC card is built in itself. In a predetermined area of the rewritable non-volatile memory in the IC chip, a stored command message composed of a pair of command header and command body, and a stored response message composed of response body and response trailer Made, and has a function of recording information on a plurality of storage message set, ranking the grant in the storage message set, and counting the storage message set number.

さらに本発明に係るICカードのオペレーティングシステムは、前記ICカードが受信した受信コマンドメッセージの内容、すなわち前記コマンドヘッダおよび前記コマンドボディ各々の記述形式等、および/または受信コマンドメッセージ長、すなわち前記コマンドヘッダおよび前記コマンドボディ各々のデータ長の合計値と、前記複数の格納メッセージ組の個数以内の値であって、かつ前記受信コマンドメッセージの受信回数の値と一致する順位に位置する格納メッセージ組に属する格納コマンドメッセージの内容、すなわち前記コマンドヘッダおよび前記コマンドボディ各々の記述形式等、および/または格納コマンドメッセージ長、すなわち前記コマンドヘッダおよび前記コマンドボディ各々のデータ長の合計値を比較する。そしてその比較した結果が一致した場合、前記オペレーティングシステムは、一致を確認した格納コマンドメッセージと対をなす格納レスポンスメッセージと、前記受信コマンドメッセージが実行された場合の実行結果である送信レスポンスメッセージとは同等であるものとみなして、前記受信コマンドメッセージの実行処理を省略し、前記格納レスポンスメッセージを前記上位装置に返信するのが好適である。   Further, the operating system of the IC card according to the present invention includes the contents of the received command message received by the IC card, that is, the description format of each of the command header and the command body, and / or the received command message length, that is, the command header. And a total value of the data lengths of each of the command bodies and a value within the number of the plurality of stored message sets and belonging to a stored message set located in a rank that matches the value of the number of reception times of the received command message The contents of the stored command message, that is, the description format of each of the command header and the command body, and / or the stored command message length, that is, the total value of the data lengths of the command header and the command body are compared. If the comparison result matches, the operating system determines that the storage response message that is paired with the storage command message that is confirmed to match, and the transmission response message that is the execution result when the reception command message is executed. It is preferable that the received command message execution process is omitted, and the stored response message is returned to the higher-level device, assuming that they are equivalent.

また、前記オペレーティングシステムが、前記ICカードが受信する複数のコマンドメッセージを順に実行処理する過程で、第n回目の受信コマンドメッセージを実行しようとしたとき、前記第n回目の受信コマンドメッセージに対応する、第n位の格納メッセージ組に属する格納コマンドメッセージが異なっていることを確認、すなわち前記第n回目の受信コマンドメッセージと前記第n位の格納メッセージ組に属する格納コマンドメッセージとを比較した結果、不一致を確認した場合、前記オペレーティングシステムは、一旦、第1位の格納メッセージ組まで戻り、第1位から始まり、前記不一致を確認した任意の格納メッセージ組の一つ前の格納メッセージ組が位置する順位、すなわち第(n−1)位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を、再度一つずつ順番に解釈、および前記格納コマンドメッセージに基づくコマンドメッセージを実行するのがよい。   Further, when the operating system attempts to execute the nth received command message in the process of sequentially executing a plurality of command messages received by the IC card, it corresponds to the nth received command message. Confirming that the stored command messages belonging to the nth stored message set are different, that is, comparing the nth received command message with the stored command message belonging to the nth stored message set, If a mismatch is confirmed, the operating system temporarily returns to the first stored message set, starting from the first place, and the stored message set immediately before any stored message set that has confirmed the mismatch is located. Each stored message set reaching the rank, i.e. the (n-1) th rank The contents belong storage command message, interpreting one by one sequentially again, and it is preferable to execute a command message based on the stored command message.

そして上述の処理を実行した後、前記オペレーティングシステムは、前記不一致を確認した任意の格納メッセージ組、すなわち第n位の格納メッセージ組が位置する順位の値と一致する順番で受信した受信コマンドメッセージ、すなわち第n回目の受信コマンドメッセージを実行し、前記不一致を確認した第n位の格納メッセージ組に属する一対の格納コマンドメッセージおよび格納レスポンスメッセージを、前記第n回目の受信コマンドメッセージと前記第n回目の受信コマンドメッセージの実行結果である送信レスポンスメッセージへ書き換えるのがよい。   Then, after executing the above-described processing, the operating system receives the received command message received in the order in which the stored message set in which the mismatch is confirmed, that is, the value of the rank in which the nth stored message set is located, In other words, the nth received command message is executed, and a pair of stored command message and stored response message belonging to the nth stored message group that has confirmed the mismatch are referred to as the nth received command message and the nth received command message. It is better to rewrite the transmission response message that is the execution result of the received command message.

さらに、前記不一致を確認した第n位の格納メッセージ組より後の順位にあるすべての格納メッセージ組、すなわち第(n+1)位以降の全格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの双方を無効化し、前記オペレーティングシステムがこれらを計数できないようにするのがよい。そして、書き換えられた第n位の格納メッセージ組に属する前記送信レスポンスメッセージを、前記上位装置に返信するのがよい。   Further, all the stored message groups in the rank after the nth stored message group that has confirmed the inconsistency, that is, both the stored command message and the stored response message that belong to all (n + 1) th stored message groups. It should be disabled so that the operating system cannot count them. Then, the transmission response message belonging to the rewritten nth stored message set may be sent back to the higher-level device.

また、前記ICカードが受信する、受信コマンドメッセージの受信回数の値が、書き換え可能な不揮発性メモリの所定の領域に格納された前記複数の格納メッセージ組の個数の値を超える場合、例えば前記受信コマンドメッセージの受信回数が(m+1)回であって、前記格納メッセージ組の個数がm個である場合、前記オペレーティングシステムは、順位が付与されている前記複数の格納メッセージ組のうち、第1位から始まり最後位である第m位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を、上述した場合と同様に一つずつ順番に解釈、および前記格納コマンドメッセージに基づくコマンドメッセージを実行した後、前記複数の格納メッセージ組の個数の値を超えた値と一致する順番で受信した受信コマンドメッセージ、すなわち第(m+1)回目の受信コマンドメッセージを実行し、一対の、前記第(m+1)回目の受信コマンドメッセージと前記第(m+1)回目の受信コマンドメッセージの実行結果である送信レスポンスメッセージからなる格納メッセージ組を、最後位である第m位の格納メッセージ組の後に追記するのがよい。そして、追記された前記送信レスポンスメッセージを、前記上位装置に返信するのがよい。   In addition, when the value of the reception command message received by the IC card exceeds the value of the number of the plurality of stored message sets stored in a predetermined area of the rewritable nonvolatile memory, for example, the reception When the number of command message receptions is (m + 1) times and the number of stored message groups is m, the operating system is the first among the plurality of stored message groups to which rankings are assigned. The contents of the stored command messages belonging to each stored message set starting from the last to the m-th position are interpreted one by one in the same manner as described above, and the command message based on the stored command message is executed Received command received in an order that matches the value exceeding the number of stored message sets. Message, ie, the (m + 1) th received command message is executed, and consists of a pair of transmission response messages that are the execution results of the (m + 1) th received command message and the (m + 1) th received command message. The stored message set should be added after the mth stored message set which is the last. The added transmission response message may be sent back to the higher-level device.

なお、ここで述べているコマンドメッセージとは、特定のデータ長を有するコマンドヘッダと、特定のデータ長を有するコマンドボディとで構成されたものを指す。同様にレスポンスメッセージとは、特定のデータ長を有するレスポンスボディと、特定のデータ長を有するレスポンストレイラとで構成されたものを指す。また、コマンドメッセージの内容とは、コマンドヘッダおよびコマンドボディの記述形式等を示し、同様にレスポンスメッセージの内容とはレスポンスボディおよびレスポンストレイラの記述形式等を示す。さらに、コマンドメッセージ長は、コマンドヘッダのデータ長とコマンドボディのデータ長を合計したデータ長を示す。同様にレスポンスメッセージ長は、レスポンスボディのデータ長とレスポンストレイラのデータ長を合計したデータ長を示す。   Note that the command message described here indicates a message composed of a command header having a specific data length and a command body having a specific data length. Similarly, a response message refers to a message composed of a response body having a specific data length and a response trailer having a specific data length. The command message content indicates a command header and command body description format, and the response message content similarly indicates a response body and response trailer description format. Further, the command message length indicates a data length obtained by adding up the data length of the command header and the data length of the command body. Similarly, the response message length indicates the total data length of the response body data length and the response trailer data length.

すなわち本発明によれば、上位装置から送信されるコマンドメッセージを受信し、前記コマンドメッセージの内容を解釈して、前記コマンドメッセージを実行するオペレーティングシステムを搭載し、かつ前記コマンドメッセージの実行結果を前記上位装置へ返信するICカードであって、前記オペレーティングシステムが、書き換え可能な不揮発性メモリの所定の領域に格納される、一対の格納コマンドメッセージおよび格納レスポンスメッセージからなる複数の格納メッセージ組に関する情報を記録する機能と、前記オペレーティングシステムが、前記複数の格納メッセージ組に順位を付与する機能と、前記オペレーティングシステムが、前記複数の格納メッセージ組の個数を計数する機能と、前記オペレーティングシステムが、前記ICカードが受信した受信コマンドメッセージと、前記複数の格納メッセージ組の個数以内の値であってかつ前記受信コマンドメッセージの受信回数の値と一致する順位に位置する格納メッセージ組に属する格納コマンドメッセージを、比較する機能を有するとともに、前記オペレーティングシステムが、前記受信コマンドメッセージと前記格納コマンドメッセージとを比較し、前記受信コマンドメッセージの内容および/またはコマンドメッセージ長と、前記格納コマンドメッセージの内容および/またはコマンドメッセージ長の一致を確認した場合、前記オペレーティングシステムは、前記一致を確認した任意の格納メッセージ組が位置する順位の値と一致する順番で受信した受信コマンドメッセージの内容の解釈、および前記受信コマンドメッセージの実行をせず、前記任意の格納メッセージ組の格納レスポンスメッセージを、前記上位装置に返信する機能を有したICカードが得られる。   That is, according to the present invention, an operating system that receives a command message transmitted from a host device, interprets the contents of the command message, and executes the command message is installed, and the execution result of the command message is An IC card that sends a reply to a host device, and the operating system stores information about a plurality of stored message sets that are stored in a predetermined area of a rewritable non-volatile memory and that includes a pair of stored command messages and stored response messages. A function for recording, a function for the operating system to give a ranking to the plurality of stored message sets, a function for the operating system to count the number of the plurality of stored message sets, and the operating system A received command message received by the card, and a stored command message belonging to a stored message set that is a value within the number of the plurality of stored message sets and that matches the value of the number of received times of the received command message, The operating system compares the received command message with the stored command message and compares the received command message content and / or command message length with the stored command message content and / or command. When the message length match is confirmed, the operating system interprets the contents of the received command message received in the order that matches the value of the order in which the arbitrary stored message set for which the match is confirmed, and the received command Without execution of the message, the optional storage message sets stored response message, IC card having a function to reply to the host device is obtained.

本発明によれば、前記オペレーティングシステムが、前記受信コマンドメッセージと前記格納コマンドメッセージとを比較し、前記受信コマンドメッセージの内容および/またはコマンドメッセージ長と、前記格納コマンドメッセージの内容および/またはコマンドメッセージ長の不一致を確認した場合、前記オペレーティングシステムは、順位が付与されている前記複数の格納メッセージ組のうち、第1位から始まり、前記不一致を確認した任意の格納メッセージ組の一つ前の格納メッセージ組が位置する順位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を一つずつ順番に解釈、実行した後、前記不一致を確認した任意の格納メッセージ組が位置する順位の値と一致する順番で受信した受信コマンドメッセージの内容の解釈、実行をして、前記不一致を確認した任意の格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージを、前記受信コマンドメッセージと前記受信コマンドメッセージの実行結果である送信レスポンスメッセージへ書き換えるとともに、前記不一致を確認した任意の格納メッセージ組より後の順位にあるすべての格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの双方を無効化した後、前記送信レスポンスメッセージを、前記上位装置に返信する機能を有した前記ICカードが得られる。   According to the present invention, the operating system compares the received command message with the stored command message, and the content and / or command message length of the received command message and the content and / or command message of the stored command message. When the length mismatch is confirmed, the operating system stores the previous stored message set starting from the first among the plurality of stored message sets to which the rank is given and confirming the mismatch. After interpreting and executing the contents of the stored command messages belonging to each stored message group one by one up to the order in which the message group is positioned, the value of the rank in which the arbitrary stored message group that has confirmed the inconsistency is positioned Received command messages received in matching order Interpret and execute the contents, rewrite the stored command message and the stored response message belonging to any stored message set for which the inconsistency is confirmed to the transmission response message that is the execution result of the received command message and the received command message After invalidating both the stored command message and the stored response message belonging to all the stored message groups in the rank after the arbitrary stored message group in which the mismatch is confirmed, the transmission response message is returned to the higher-level device. The IC card having the function of

本発明によれば、前記受信回数の値が前記複数の格納メッセージ組の個数の値を超える場合、前記オペレーティングシステムは、順位が付与されている前記複数の格納メッセージ組のうち、第1位から始まり最後位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を一つずつ順番に解釈、実行した後、前記複数の格納メッセージ組の個数の値を超えた位置で受信した受信コマンドメッセージの内容の解釈、実行をして、一対の、前記受信コマンドメッセージと前記受信コマンドメッセージの実行結果である送信レスポンスメッセージからなる格納メッセージ組を、最後位の格納メッセージ組の後に追記するとともに、前記送信レスポンスメッセージを、前記上位装置に返信する機能を有した前記ICカードが得られる。   According to the present invention, when the value of the number of receptions exceeds the value of the number of the plurality of stored message sets, the operating system starts from the first among the plurality of stored message sets to which the rank is assigned. Received command messages received at positions exceeding the number of stored message groups after interpreting and executing the contents of the stored command messages belonging to each stored message group one by one in order, starting with the last one Interpreting and executing the contents of the stored message set consisting of a pair of the received command message and a transmission response message that is the execution result of the received command message, and appending after the last stored message set, The IC card having a function of returning a transmission response message to the host device is obtained.

本発明は、上位装置と、事実上単一のアプリケーションのみを使用するマルチアプリケーション型のICカード、あるいは単一のアプリケーションを搭載したICカードにおいて、上位装置から送信される複数のコマンドメッセージ、および前記複数のコマンドメッセージの実行順序が事実上固定され、コマンドメッセージおよびレスポンスメッセージを送信する特定のシーケンスが変更されない状態で運用される際、その都度行なわれるコマンドメッセージの内容の解釈および当該コマンドメッセージの実行処理をスキップして、これを省略することが可能な機能、すなわち書き換え可能な不揮発性メモリの所定の領域に、順位が付与され、かつその個数が計測されて管理されている、一対の格納コマンドメッセージおよび格納レスポンスメッセージからなる複数の格納メッセージ組を格納し、受信した受信コマンドメッセージと前記格納コマンドメッセージを比較して一致した場合は、前記受信コマンドメッセージの内容の解釈および前記受信コマンドメッセージの実行をスキップする機能を、ICカードのオペレーティングシステムに具備することにより、前記格納レスポンスメッセージを、前記受信コマンドメッセージの実行結果と同等のものであるとみなし、前記格納レスポンスメッセージを上位装置へ返信することができる。その結果、この処理を省略した分だけ全体の処理時間を短縮し、結果として上位装置とICカード間の通信時間の短縮化が実現できる。さらに、受信コマンドメッセージと、これに対応した格納コマンドメッセージとを比較して不一致となる場合であっても、目的のファイルを特定し、前記受信コマンドメッセージを正確に実行することができる。   The present invention relates to a plurality of command messages transmitted from a host device in a multi-application type IC card that uses only a single device and a single application, or an IC card equipped with a single application, and Interpretation of command message contents and execution of the command message each time when the operation sequence of multiple command messages is practically fixed and the specific sequence for sending command messages and response messages is not changed A function that skips processing and omits it, that is, a pair of storage commands in which a rank is given to a predetermined area of a rewritable non-volatile memory, and the number is measured and managed Message and stored response A function for storing a plurality of stored message sets of messages and skipping the interpretation of the contents of the received command message and execution of the received command message when the received received command message matches the stored command message In the operating system of the IC card, the stored response message can be regarded as equivalent to the execution result of the received command message, and the stored response message can be returned to the host device. As a result, the entire processing time is shortened by the amount of omitting this processing, and as a result, the communication time between the host device and the IC card can be shortened. Furthermore, even if the received command message and the stored command message corresponding to the received command message do not match, the target file can be identified and the received command message can be executed accurately.

以下、本発明を実施するための最良の形態について、図面を参照しながら説明する。   The best mode for carrying out the present invention will be described below with reference to the drawings.

図1は、本発明のICカードのコマンドメッセージおよびレスポンスメッセージの処理過程を説明するフローチャートである。図2は、本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージがすべて一致する場合のデータ処理を説明する図である。図3は、本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージが一部一致しない場合のデータ処理を説明する図である。また図4は、本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数を超える場合のデータ処理を説明する図である。   FIG. 1 is a flowchart for explaining the process of command message and response message of the IC card of the present invention. FIG. 2 is a diagram for explaining data processing when the number of receptions of received command messages according to the IC card of the present invention is within the number of stored message sets, and all received command messages and stored command messages match. FIG. 3 is a diagram for explaining data processing when the number of receptions of received command messages according to the IC card of the present invention is within the number of stored message sets, and the received command messages and stored command messages do not partially match. FIG. 4 is a diagram for explaining data processing when the number of reception command messages received according to the IC card of the present invention exceeds the number of stored message sets.

図1において、本発明のICカードは、上位装置と通信する際、まず始めに外部からの電力の供給を受け、電源オン状態、すなわち活性化された状態となる(ステップS1)。ただし、ICカードが接触方式である場合は、ICカードのICチップの接続端子を介して電力が供給され、また非接触方式である場合は、ICカードに内蔵された電力受信アンテナ等を介して無線等により電力が供給される。   In FIG. 1, when communicating with a host device, the IC card of the present invention first receives external power supply and enters a power-on state, that is, an activated state (step S1). However, when the IC card is a contact system, power is supplied via the connection terminal of the IC chip of the IC card. When the IC card is a contactless system, the power is received via a power receiving antenna built in the IC card. Power is supplied by radio or the like.

そして引き続きICカードは、イニシャライズ処理、すなわちICカード内にあるCPUのリセット、内蔵メモリのチェック等を実行する(ステップS2)。その後、ICカードは、上位装置から送信される任意のコマンドメッセージを受信する(ステップS3)。   Subsequently, the IC card performs initialization processing, that is, resetting the CPU in the IC card, checking the built-in memory, etc. (step S2). Thereafter, the IC card receives an arbitrary command message transmitted from the host device (step S3).

以下、受信したコマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージがすべて一致する場合のデータ処理について、図2も参照しながら説明する。図2において、例えばICカードは、総計3回のコマンドメッセージを受信し、これに応答するレスポンスメッセージを上位装置に返信するものである。   Hereinafter, data processing when the number of received command messages is within the number of stored message sets and the received command message and the stored command message all match will be described with reference to FIG. In FIG. 2, for example, the IC card receives a total of three command messages and returns a response message in response to the command message to the host device.

また、ICカードに内蔵されたICチップ内の書き換え可能な不揮発性メモリ(以下、単にメモリという)の所定の領域には、5個の格納メッセージ組に関する情報が記録され格納されている。各々の格納メッセージ組は格納コマンドメッセージとこれに対応する格納レスポンスメッセージで構成されるものである。   Information on five stored message sets is recorded and stored in a predetermined area of a rewritable nonvolatile memory (hereinafter simply referred to as a memory) in an IC chip built in the IC card. Each stored message set includes a stored command message and a corresponding stored response message.

また、各々の格納メッセージ組には、第1位から最後位である第5位までの順位が割り振られている。これらの順位は、ICカードのオペレーティングシステムによって付与され、同時にオペレーティングシステムは、これら格納メッセージ組の個数を計数し管理している。   Each stored message set is assigned a rank from the first place to the fifth place which is the last place. These orders are given by the IC card operating system, and at the same time, the operating system counts and manages the number of stored message sets.

始めに、ICカードは第1回目のコマンドメッセージを上位装置から受信する(ステップS3)。そしてICカードのオペレーティングシステムは、受信第1回目の受信コマンドメッセージの「受信コマンドメッセージ1」と、メモリの所定の領域に格納されている第1位の格納メッセージ組に属する「格納コマンドメッセージ1」を比較する(ステップS4)。比較した結果、各々のコマンドメッセージの内容および/またはコマンドメッセージ長が一致した場合(ステップS5)、オペレーティングシステムは、受信第1回目の受信コマンドメッセージの「受信コマンドメッセージ1」のコマンドメッセージの内容を解釈、および当該受信コマンドメッセージを実行せず、当該受信コマンドメッセージを実行した場合の実行結果と同等であるとみなした、前記第1位の格納メッセージ組に属する「格納レスポンスメッセージ1」からなるレスポンスメッセージを上位装置に返信する(ステップS7)。   First, the IC card receives the first command message from the host device (step S3). Then, the operating system of the IC card receives the “reception command message 1” of the first reception command message and “storage command message 1” belonging to the first stored message group stored in a predetermined area of the memory. Are compared (step S4). As a result of the comparison, if the contents of each command message and / or the command message length match (step S5), the operating system determines the contents of the command message “Received Command Message 1” of the first received command message. Response consisting of “stored response message 1” belonging to the first stored message set that is interpreted and equivalent to the execution result when the received command message is executed without executing the received command message A message is returned to the host device (step S7).

次に、ICカードは第2回目のコマンドメッセージを上位装置から受信する(ステップS3)。そしてICカードのオペレーティングシステムは、受信第1回目の場合と同様に、受信第2回目の受信コマンドメッセージの「受信コマンドメッセージ2」と、メモリの所定の領域に格納されている第2位の格納メッセージ組に属する「格納コマンドメッセージ2」を比較する(ステップS4)。比較した結果、各々のコマンドメッセージの内容および/またはコマンドメッセージ長が一致した場合(ステップS5)、オペレーティングシステムは、受信第1回目の場合と同様に、受信第2回目の受信コマンドメッセージの「受信コマンドメッセージ2」のコマンドメッセージの内容を解釈、および当該受信コマンドメッセージを実行せず、当該受信コマンドメッセージを実行した場合の実行結果と同等であるとみなした、前記第2位の格納メッセージ組に属する「格納レスポンスメッセージ2」からなるレスポンスメッセージを上位装置に返信する(ステップS7)。   Next, the IC card receives the second command message from the host device (step S3). Then, the operating system of the IC card, as in the first reception, stores “reception command message 2” of the second reception command message and the second storage stored in a predetermined area of the memory. The “stored command message 2” belonging to the message set is compared (step S4). As a result of the comparison, if the contents and / or command message lengths of the command messages match each other (step S5), the operating system receives the “reception” of the reception command message for the second reception as in the case of the first reception. Interpret the contents of the command message “command message 2”, and execute the received command message without executing the received command message. A response message consisting of the “stored response message 2” to which it belongs belongs to the higher-level device (step S7).

そして、ICカードは最後のコマンドメッセージである第3回目のコマンドメッセージを上位装置から受信する(ステップS3)。この場合も上述した受信第1回目、または受信第2回目の場合と同様の処理がなされ、メモリの所定の領域に格納されている第3位の格納メッセージ組に属する「格納レスポンスメッセージ3」からなるレスポンスメッセージを上位装置に返信して一連の処理を完了する。   Then, the IC card receives the third command message, which is the last command message, from the host device (step S3). In this case as well, the same processing as in the case of the first reception or the second reception described above is performed, and from the “stored response message 3” belonging to the third stored message group stored in the predetermined area of the memory. Is returned to the host device to complete the series of processes.

このように、ICカードが受信した受信コマンドメッセージと、メモリの所定の領域に格納された、受信コマンドメッセージの受信回数の値と同一の値の順位にある格納メッセージ組に属する格納コマンドメッセージを比較し、その一致をみた場合、受信した受信コマンドメッセージの内容の解釈、および前記受信コマンドメッセージの実行にかかる処理をまるごとスキップする分、処理時間を短縮することができる。   In this way, the received command message received by the IC card is compared with the stored command message belonging to the stored message set in the same rank order as the received command message reception count stored in a predetermined area of the memory. However, when the match is found, the processing time can be shortened by skipping the entire processing related to the interpretation of the received received command message and the execution of the received command message.

次に、受信したコマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージが一部一致しない場合のデータ処理について、図1および図3を参照しながら説明する。図3において、例えばICカードは、総計n回(ただし、「n」は任意の受信回数を示す)のコマンドメッセージを受信し、これに応答するレスポンスメッセージを上位装置に返信するものである。   Next, data processing when the number of received command messages is within the number of stored message sets and the received command message and stored command message do not partially match will be described with reference to FIGS. In FIG. 3, for example, the IC card receives a total of n times (where “n” indicates an arbitrary number of receptions) command message, and returns a response message in response to the command message.

またメモリの所定の領域には、n個以上の格納メッセージ組に関する情報が記録され格納されている。各々の格納メッセージ組は格納コマンドメッセージとこれに対応する格納レスポンスメッセージで構成されるものである。また各々の格納メッセージ組には、上述した場合と同様に、オペレーティングシステムによって順位が付与され、同時にオペレーティングシステムは、これら格納メッセージ組の個数を計数し管理している。   In a predetermined area of the memory, information on n or more stored message sets is recorded and stored. Each stored message set includes a stored command message and a corresponding stored response message. Similarly to the case described above, each stored message set is given a rank by the operating system. At the same time, the operating system counts and manages the number of stored message sets.

図3において、ICカードは、第1回目から第(n−1)回目までのコマンドメッセージの受信、およびこれに応答する、上位装置に向けたレスポンスメッセージの返信を既に完了している。上位装置へレスポンスメッセージを返信するまでの過程については、上述した場合と同様であるので、ここでの説明は省略する。   In FIG. 3, the IC card has already received the first to (n−1) th command message and has responded to the response message to the higher-level device. Since the process until the response message is returned to the host device is the same as that described above, the description thereof is omitted here.

その後、ICカードは、第n回目のコマンドメッセージを受信する(ステップS3)。そしてオペレーティングシステムは、受信第n回目の受信コマンドメッセージの「受信コマンドメッセージn」と、メモリの所定の領域に格納されている第n位の格納メッセージ組に属する「格納コマンドメッセージn」を比較する(ステップS4)。比較した結果、各々のコマンドメッセージの内容および/またはコマンドメッセージ長は一致せず(ステップS5)、無効値でもなかった(ステップS6)。このときICカードのオペレーティングシステムは、一旦、第1位の格納メッセージ組まで戻り、第1位から始まり、前記不一致を確認した第n位の格納メッセージ組の一つ前の格納メッセージ組が位置する順位、すなわち第(n−1)位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を、再度一つずつ順番に解釈、および前記格納コマンドメッセージを実行する(ステップS8)。   Thereafter, the IC card receives the nth command message (step S3). Then, the operating system compares the “reception command message n” of the nth reception command message with the “stored command message n” belonging to the nth stored message group stored in a predetermined area of the memory. (Step S4). As a result of the comparison, the contents and / or command message lengths of the command messages did not match (step S5) and were not invalid values (step S6). At this time, the operating system of the IC card temporarily returns to the first stored message group, and the stored message group immediately preceding the nth stored message group starting from the first and confirming the mismatch is located. The contents of the stored command messages belonging to the respective stored message groups that reach the rank, that is, the (n-1) th position, are interpreted again one by one in order, and the stored command message is executed (step S8).

次いでオペレーティングシステムは、受信第n回目の受信コマンドメッセージの内容の解釈、および前記受信コマンドメッセージを実行する(ステップS9)。引き続きオペレーティングシステムは、不一致を確認した受信第n回目の受信コマンドメッセージの「受信コマンドメッセージn」を、メモリの所定の領域に格納された第n位の格納メッセージ組に属する「格納コマンドメッセージn」と入れ換え、書き換え処理を実行する。同時に、受信第n回目の受信コマンドメッセージの実行結果である「送信レスポンスメッセージn」を、メモリの所定の領域に格納された第n位の格納メッセージ組に属する「格納レスポンスメッセージn」と入れ換え、書き換え処理を実行する(ステップS10)。   Next, the operating system interprets the contents of the received nth received command message and executes the received command message (step S9). The operating system continues to store the “reception command message n” of the reception command message for the nth reception that has been confirmed to be inconsistent with the “storage command message n” belonging to the nth stored message group stored in a predetermined area of the memory. And rewrite processing is executed. At the same time, the “transmission response message n”, which is the execution result of the reception command message for the nth reception, is replaced with “stored response message n” belonging to the nth stored message group stored in a predetermined area of the memory, A rewriting process is executed (step S10).

これにより第n位の格納メッセージ組は、前記「受信コマンドメッセージn」と前記「送信レスポンスメッセージn」から構成される新たな第n位の格納メッセージ組として更新されメモリ上に保持される。   As a result, the nth stored message group is updated as a new nth stored message group composed of the “reception command message n” and the “transmission response message n”, and is stored in the memory.

そして、オペレーティングシステムは、不一致を確認した第n位の格納メッセージ組より後の順位にあるすべての格納メッセージ組、すなわち第(n+1)位以降の全格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの双方に無効値を適用して無効化し、オペレーティングシステムがこれらを計数できないようにする(ステップS11)。   The operating system then stores all the stored message groups in the rank after the nth stored message group that has confirmed the mismatch, that is, the stored command message and the stored response message that belong to all (n + 1) th stored message groups. Both are invalidated by applying invalid values so that the operating system cannot count them (step S11).

その後、オペレーティングシステムは、書き換えられた第n位の格納メッセージ組に属する「送信レスポンスメッセージn」からなる送信レスポンスメッセージを上位装置に返信する(ステップS12)。   After that, the operating system returns a transmission response message including “transmission response message n” belonging to the rewritten nth stored message set to the upper apparatus (step S12).

このように、本発明のICカードのオペレーティングシステムは、一連の処理において、比較した受信コマンドメッセージと格納コマンドメッセージの不一致があるとき、第1位の格納メッセージ組から、前記不一致を確認した任意の格納メッセージ組の一つ前の格納メッセージ組が位置する順位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を一つずつ順番に解釈、実行した後、最後にその不一致時の受信コマンドメッセージを実行処理するものである。   As described above, the IC card operating system according to the present invention, when there is a mismatch between the received command message and the stored command message compared in a series of processing, Interpret and execute the contents of the stored command messages belonging to each stored message group one by one up to the order in which the stored message group immediately before the stored message group is located, and finally receive commands when there is a mismatch The message is executed.

次に、受信したコマンドメッセージの受信回数が格納メッセージ組の個数を超える場合のデータ処理について、図1および図4を参照しながら説明する。図4において、例えばICカードは、総計(m+1)回(ただし、「m」は任意の受信回数を示す)のコマンドメッセージを受信し、これに応答するレスポンスメッセージを上位装置に返信するものである。   Next, data processing in the case where the received number of received command messages exceeds the number of stored message sets will be described with reference to FIG. 1 and FIG. In FIG. 4, for example, the IC card receives a total of (m + 1) times (where “m” indicates an arbitrary number of receptions) command message, and returns a response message in response to the command message. .

またメモリの所定の領域には、m個の格納メッセージ組に関する情報が記録され格納されている。各々の格納メッセージ組は格納コマンドメッセージとこれに対応する格納レスポンスメッセージで構成されるものである。また各々の格納メッセージ組には、上述した場合と同様に、オペレーティングシステムによって、第1位から第m位まで順位が付与され、同時にオペレーティングシステムは、これら格納メッセージ組の個数を計数し管理している。なおこの場合、メモリの所定の領域に格納される第(m+1)位以降の格納メッセージ組すべてには無効値が適用されている。   Information on m stored message sets is recorded and stored in a predetermined area of the memory. Each stored message set includes a stored command message and a corresponding stored response message. Similarly to the case described above, each stored message set is given a rank from the first place to the m-th place by the operating system. At the same time, the operating system counts and manages the number of these stored message sets. Yes. In this case, the invalid value is applied to all the stored message groups after the (m + 1) th place stored in a predetermined area of the memory.

図4において、ICカードは、第1回目から第m回目までのコマンドメッセージの受信、およびこれに応答する、上位装置に向けたレスポンスメッセージの返信を既に完了している。上位装置へレスポンスメッセージを返信するまでの過程については、上述した場合と同様であるのでここでの説明は省略する。   In FIG. 4, the IC card has already received the first to m-th command messages and has responded to the higher-level device in response to the command messages. Since the process until the response message is returned to the host apparatus is the same as that described above, the description thereof is omitted here.

その後、ICカードは、第(m+1)回目のコマンドメッセージを受信する(ステップS3)。そしてオペレーティングシステムは、受信第(m+1)回目の受信コマンドメッセージの「受信コマンドメッセージ(m+1)」と、メモリの所定の領域に格納されている第(m+1)位の格納メッセージ組に属する格納コマンドメッセージとを比較する(ステップS4)。比較した結果、第(m+1)位の格納メッセージ組には対応する格納コマンドメッセージが存在せず、オペレーティングシステムは、これを無効値と判断し(ステップS5、およびステップS6)、上述した場合と同様に、一旦、第1位の格納メッセージ組まで戻り、第1位から第m位の格納メッセージ組に属する格納コマンドメッセージの内容を、再度一つずつ順番に解釈、および前記格納コマンドメッセージに基づくコマンドメッセージを実行する(ステップS13)。   Thereafter, the IC card receives the (m + 1) th command message (step S3). The operating system then receives the received command message (m + 1) received command message “received command message (m + 1)” and the stored command message belonging to the (m + 1) th stored message group stored in a predetermined area of the memory. Are compared (step S4). As a result of the comparison, the corresponding stored command message does not exist in the (m + 1) th stored message set, and the operating system determines that this is an invalid value (step S5 and step S6), and is the same as described above. First, return to the first stored message group, interpret the contents of the stored command messages belonging to the first to mth stored message groups one by one again, and command based on the stored command message The message is executed (step S13).

次いでオペレーティングシステムは、受信第(m+1)回目の受信コマンドメッセージの内容の解釈、および実行する(ステップS14)。引き続きオペレーティングシステムは、受信第(m+1)回目の受信コマンドメッセージの「受信コマンドメッセージ(m+1)」と前記受信第(m+1)回目の受信コマンドメッセージの実行結果である「送信レスポンスメッセージ(m+1)」から構成される格納メッセージ組を、メモリの所定の領域に格納された最後位である第m位の格納メッセージ組の後に追記する(ステップS15)。   Next, the operating system interprets and executes the content of the (m + 1) th received command message (step S14). The operating system continues from “reception command message (m + 1)” of the (m + 1) th reception command message and “transmission response message (m + 1)” that is the execution result of the (m + 1) th reception command message. The stored message set to be configured is added after the m-th stored message set which is the last position stored in a predetermined area of the memory (step S15).

これにより第(m+1)位の格納メッセージ組は、前記「受信コマンドメッセージ(m+1)」と前記「送信レスポンスメッセージ(m+1)」から構成される新たな第(m+1)位の格納メッセージ組として更新されメモリ上に保持される。   As a result, the (m + 1) th stored message set is updated as a new (m + 1) th stored message set composed of the “reception command message (m + 1)” and the “transmission response message (m + 1)”. Retained in memory.

その後、オペレーティングシステムは、追記された第(m+1)位の格納メッセージ組に属する「送信レスポンスメッセージ(m+1)」からなるレスポンスメッセージを上位装置に返信する(ステップS12)。   Thereafter, the operating system returns a response message composed of “transmission response message (m + 1)” belonging to the added (m + 1) th stored message set to the higher-level device (step S12).

このように、本発明のICカードのオペレーティングシステムは、一連の処理において、受信した受信コマンドメッセージに対応する格納コマンドメッセージを有する格納メッセージ組がメモリ上にないときは、当該コマンドメッセージを実行して、その受信コマンドメッセージと、当該コマンドメッセージの実行結果である送信レスポンスメッセージからなる格納メッセージ組を追記してメモリ上に記録するものである。   In this way, the operating system of the IC card according to the present invention executes the command message when there is no stored message set having the stored command message corresponding to the received received command message in the series of processing. A stored message set consisting of the received command message and a transmission response message as an execution result of the command message is additionally recorded in the memory.

以下、上述した本発明を実施するための最良の形態で示したICカードを用いて、上位装置と通信を実行する際、オペレーティングシステムが実行するデータ処理の実施例について、図5から図11を用いて説明する。   In the following, examples of data processing executed by the operating system when performing communication with the host device using the IC card shown in the best mode for carrying out the present invention will be described with reference to FIGS. It explains using.

本実施例で用いたICカードは、上位装置と無線にて通信を行う非接触ICカードであり、複数のアプリケーションを搭載可能で、かつ複数のアプリケーションに対応可能なオペレーティングシステムを搭載したマルチアプリケーション型ICカードである。なお、上位装置が送信、すなわちICカードが受信する受信コマンドメッセージは総計3個であり、これら受信コマンドメッセージの内容は変更されることなく固定されたもので、かつその受信順序も固定されているものとする。ICカードが受信する受信コマンドメッセージは、受信順に、「アプリケーション選択」コマンドメッセージ、「認証」コマンドメッセージ、および「ID読み出し」コマンドメッセージである。   The IC card used in the present embodiment is a non-contact IC card that communicates wirelessly with a host device, and can be loaded with a plurality of applications and equipped with an operating system that can handle a plurality of applications. IC card. Note that there are a total of three received command messages transmitted by the host device, that is, received by the IC card, the contents of these received command messages are fixed without change, and the reception order is also fixed. Shall. The reception command messages received by the IC card are an “application selection” command message, an “authentication” command message, and an “ID read” command message in the order of reception.

図5は、本発明のICカードに係る各受信コマンドメッセージの内容、レスポンスメッセージの内容、およびそのデータ長を示す図である。   FIG. 5 is a diagram showing the contents of each received command message, the contents of the response message, and the data length thereof according to the IC card of the present invention.

図5において、例えばコマンド番号「C1」である受信第1回目の「アプリケーション選択」の受信コマンドメッセージあるいは格納コマンドメッセージ(以下、単にコマンドメッセージという)は、コマンドヘッダとコマンドボディで構成され、そのコマンドメッセージの内容は、各々「選択コマンド」および「アプリケーション名」である。そして各々のデータ長は、「5byte」および「16byte」である。   In FIG. 5, for example, a received command message or stored command message (hereinafter simply referred to as a command message) of the first “application selection” with the command number “C1” is composed of a command header and a command body. The contents of the message are “selection command” and “application name”, respectively. Each data length is “5 bytes” and “16 bytes”.

また、コマンド番号「C1」である受信第1回目の「アプリケーション選択」の送信レスポンスメッセージあるいは格納レスポンスメッセージ(以下、単にレスポンスメッセージという)は、レスポンスボディとレスポンストレイラで構成され、そのレスポンスメッセージの内容は、レスポンスボディについては該当するものはなく、レスポンストレイラについては「レスポンスステータス」である。そして各々のデータ長は、「0byte」および「2byte」である。   Further, the transmission response message or the stored response message (hereinafter simply referred to as response message) of the first “application selection” received with the command number “C1” is composed of a response body and a response trailer, and the contents of the response message Is not applicable for the response body, and is “response status” for the response trailer. Each data length is “0 bytes” and “2 bytes”.

これら各々のデータ長を合算すると、コマンドメッセージ全体のデータ長は、「21byte」となり、レスポンスメッセージ全体のデータ長は、「2byte」となる。よってコマンド番号「C1」である受信第1回目の「アプリケーション選択」に係るコマンドメッセージおよびレスポンスメッセージの総データ長は「23byte」である。   When these data lengths are added together, the data length of the entire command message is “21 bytes”, and the data length of the entire response message is “2 bytes”. Therefore, the total data length of the command message and the response message related to the first “application selection” with the command number “C1” is “23 bytes”.

同様に、コマンド番号「C2」である受信第2回目の「認証」に係るデータ長、およびコマンド番号「C3」である受信第3回目の「ID読み出し」に係るデータ長については図5に示すとおりである。なお、本実施例において、IDのデータ長は、「8byte」としている。   Similarly, the data length related to the second authentication “authentication” with the command number “C2” and the data length related to the third reception “ID read” with the command number “C3” are shown in FIG. It is as follows. In this embodiment, the data length of the ID is “8 bytes”.

図6は、本発明のICカードに係る1byteあたりのコマンドメッセージ比較処理に要する処理時間を示す図である。   FIG. 6 is a diagram showing a processing time required for a command message comparison process per 1 byte according to the IC card of the present invention.

図6に示すように、コマンドメッセージ比較処理、すなわち任意の受信コマンドメッセージと、これに対応し、かつメモリの所定の領域に格納されている任意の格納メッセージ組に属する格納コマンドメッセージを比較する際に実行される処理は、「タスク1」、「タスク2」、および「タスク3」とから構成され、各々の1byteあたりの処理時間は、「0.004msec」、「0.002msec」、および「0.004msec」である。よって1byteあたりのコマンドメッセージ比較処理に要する処理時間は、これらの合計「0.010msec」である。なお、図6に示した処理時間は、ICチップ命令セットのサイクル数により算出したものである。   As shown in FIG. 6, command message comparison processing, that is, when comparing an arbitrary received command message and a stored command message corresponding to this and belonging to an arbitrary stored message set stored in a predetermined area of the memory The processing executed in the process is composed of “task 1”, “task 2”, and “task 3”, and the processing time for each byte is “0.004 msec”, “0.002 msec”, and “task 3”. 0.004 msec ". Therefore, the processing time required for the command message comparison process per 1 byte is “0.010 msec” in total. Note that the processing time shown in FIG. 6 is calculated by the number of cycles of the IC chip instruction set.

図7は、本発明のICカードに係る1byteあたりの格納メッセージ組書き込み処理に要する処理時間を示す図である。   FIG. 7 is a diagram showing the processing time required for the stored message set writing process per byte according to the IC card of the present invention.

図7に示すように、格納メッセージ組書き込み処理、すなわち任意の受信コマンドメッセージと、これに対応する送信レスポンスメッセージを、メモリ上の任意の書き込み用レジスタへ記録する際に実行される処理は、「タスク1」、および「タスク2」とから構成され、各々の処理時間は、「0.004msec」、および「0.004msec」であり、1byteあたりの格納メッセージ組書き込み処理に要する処理時間は、これらの合計「0.008msec」である。なお、図7に示した処理時間は、ICチップ命令セットのサイクル数により算出したものである。   As shown in FIG. 7, the stored message set writing process, that is, the process executed when an arbitrary received command message and the corresponding transmission response message are recorded in an arbitrary register for writing on the memory is “ Task 1 ”and“ task 2 ”, and the processing times of each are“ 0.004 msec ”and“ 0.004 msec ”, and the processing time required for the stored message set writing processing per 1 byte is these The total of “0.008 msec”. The processing time shown in FIG. 7 is calculated by the number of cycles of the IC chip instruction set.

図8は、本発明のICカードに係る各受信コマンドメッセージのコマンドメッセージ比較処理、および格納メッセージ組書き込み処理に要する処理時間を示す図である。   FIG. 8 is a diagram showing processing time required for command message comparison processing and stored message set writing processing of each received command message according to the IC card of the present invention.

図8において、例えばコマンド番号「C1」である受信第1回目の「アプリケーション選択」のコマンドメッセージ比較処理に要する処理時間は、1byteあたりのコマンドメッセージ比較処理に要する処理時間「0.010msec」と、当該受信コマンドメッセージのデータ長「21byte」との積によって算出され、その値は、「0.010msec/byte」×「21byte」=「0.210msec」である。   In FIG. 8, for example, the processing time required for the command message comparison processing of the first “application selection” command number “C1” is “0.010 msec”, which is required for the command message comparison processing per 1 byte. It is calculated by the product of the data length “21 bytes” of the received command message, and the value is “0.010 msec / byte” × “21 bytes” = “0.210 msec”.

また、コマンド番号「C1」である受信第1回目の「アプリケーション選択」の格納メッセージ組書き込み処理に要する処理時間は、1byteあたりの格納メッセージ組書き込み処理に要する処理時間「0.008msec」と、当該受信コマンドメッセージおよび送信レスポンスメッセージの総データ長「23byte」との積、およびこれにメモリの書き込み待ち時間「2.000msec」を加えて算出され、その値は、「0.008msec/byte」×「23byte」+「2.000msec」=「2.184msec」である。ただし、前記メモリの書き込み待ち時間は、ICチップの性能に依存する値である。本実施例では、ICカードに内蔵されたICチップ内のメモリは、その書き込み待ち時間が「2.000msec」であるものを用いている。   In addition, the processing time required for the stored message set writing process of the first “application selection” received with the command number “C1” is the processing time “0.008 msec” required for the stored message set writing process per 1 byte. The product is calculated by adding the product of the total data length “23 bytes” of the reception command message and the transmission response message and the memory write waiting time “2.000 msec”, and the value is “0.008 msec / byte” × “ 23 bytes "+" 2.000 msec "=" 2.184 msec ". However, the write waiting time of the memory is a value that depends on the performance of the IC chip. In this embodiment, the memory in the IC chip built in the IC card uses a memory whose write waiting time is “2.000 msec”.

同様に、コマンド番号「C2」である受信第2回目の「認証」に係る、コマンドメッセージ比較処理と格納メッセージ組書き込み処理に要する処理時間、およびコマンド番号「C3」である受信第3回目の「ID読み出し」に係る、コマンドメッセージ比較処理と格納メッセージ組書き込み処理に要する処理時間については、図8に示すとおりである。   Similarly, the processing time required for the command message comparison process and the stored message set writing process related to the second authentication “authentication” with the command number “C2”, and the third reception “ The processing time required for the command message comparison process and the stored message set writing process related to “ID read” is as shown in FIG.

ところで、図8において、「C1」から「C3」に至るコマンドメッセージ比較処理を連続して実行する場合のプロセスは、上述した受信コマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージがすべて一致する場合のデータ処理(図2)の場合のプロセスに相当している。そして、このプロセスの実行処理に要する処理時間は、「C1」から「C3」に至る各々のコマンドメッセージ比較処理に要する処理時間の合計、すなわち「0.470msec」である。   By the way, in FIG. 8, when the command message comparison process from “C1” to “C3” is continuously executed, the above-mentioned reception command message reception count is within the number of stored message sets, and the received command This corresponds to the process in the case of data processing (FIG. 2) when the message and the stored command message all match. The processing time required for executing this process is the total processing time required for each command message comparison process from “C1” to “C3”, that is, “0.470 msec”.

図9は、従来のICカードに係るデータ処理で各受信コマンドメッセージを実行した場合の、データ処理に要する処理時間を示す図である。   FIG. 9 is a diagram showing a processing time required for data processing when each received command message is executed in data processing related to a conventional IC card.

図9において、従来のデータ処理、すなわちICカードが任意の受信コマンドメッセージを受信して、当該受信コマンドメッセージの内容を解釈、および当該受信コマンドメッセージを実行するのに要する処理時間は、コマンド番号「C1」である受信第1回目の受信コマンドメッセージ「アプリケーション選択」に係る処理においては、「23.00msec」、コマンド番号「C2」である受信第2回目の受信コマンドメッセージ「認証」に係る処理においては、「57.00msec」、コマンド番号「C3」である受信第3回目の受信コマンドメッセージ「ID読み出し」に係る処理においては、「14.00msec」である。   In FIG. 9, conventional data processing, that is, the processing time required for the IC card to receive an arbitrary received command message, interpret the content of the received command message, and execute the received command message is shown in the command number “ In the process related to the reception command message “application selection” for the first reception command “C1”, in the process related to the reception command message “authentication” for the reception second time “23.00 msec” and the command number “C2”. Is “14.00 msec” in the process related to the third received command message “ID read” with “57.00 msec” and command number “C3”.

なお、これらはいずれも、従来の市販されている任意のICカードのデータ処理に要した処理時間を測定したときの実測値である。ただし、前記従来の市販されている任意のICカードのハードウェア基本構成は、本実施例で用いたICカードと同等のものである。   Note that these are actually measured values when the processing time required for data processing of an arbitrary commercially available IC card is measured. However, the basic hardware configuration of the conventional IC card on the market is the same as that of the IC card used in this embodiment.

図10は、受信コマンドメッセージと格納コマンドメッセージが一部一致しない場合、本発明のICカードに係るオペレーティングシステムが実行するデータ処理の処理内容および処理時間を示す図である。   FIG. 10 is a diagram showing the processing contents and processing time of data processing executed by the operating system according to the IC card of the present invention when the received command message and the stored command message do not partially match.

図10において、受信コマンドメッセージと格納コマンドメッセージが一部一致しない実行例として、「実行例B」、「実行例C」、および「実行例D」の3パターンを例示した。「実行例B」は、コマンド番号「C1」である受信第1回目の「アプリケーション選択」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第1位の格納メッセージ組に属する格納コマンドメッセージと一致しない場合の実行例である。   In FIG. 10, three patterns of “execution example B”, “execution example C”, and “execution example D” are illustrated as execution examples in which the received command message and the stored command message do not partially match. “Execution example B” is a first-order storage in which the reception command message of the first “application selection” with the command number “C1” corresponds to this and is stored in a predetermined area of the memory. It is an execution example when it does not correspond to the stored command message belonging to the message set.

また、「実行例C」は、コマンド番号「C1」である受信第1回目の「アプリケーション選択」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第1位の格納メッセージ組に属する格納コマンドメッセージと一致し、コマンド番号「C2」である受信第2回目の「認証」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第2位の格納メッセージ組に属する格納コマンドメッセージと一致しない場合の実行例である。   “Execution example C” is the first received command message of the first “application selection” with command number “C1” corresponding to this and stored in a predetermined area of the memory. The received second received “authentication” received command message corresponding to the stored command message belonging to the stored message set and having the command number “C2” is stored in a predetermined area of the memory. It is an execution example when it does not correspond with the stored command message belonging to the second stored message set.

また、「実行例D」は、コマンド番号「C1」である受信第1回目の「アプリケーション選択」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第1位の格納メッセージ組に属する格納コマンドメッセージと一致し、コマンド番号「C2」である受信第2回目の「認証」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第2位の格納メッセージ組に属する格納コマンドメッセージと一致し、コマンド番号「C3」である受信第3回目の「ID読み出し」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第3位の格納メッセージ組に属する格納コマンドメッセージと一致しない場合の実行例である。   The “execution example D” is the first received command message of the first “application selection” with the command number “C1” corresponding to this and stored in a predetermined area of the memory. The received second received “authentication” received command message corresponding to the stored command message belonging to the stored message set and having the command number “C2” is stored in a predetermined area of the memory. A received command message of “ID read” for the third time of reception corresponding to the stored command message belonging to the second stored message set and having the command number “C3” corresponds to this and is stored in a predetermined area of the memory. It is an execution example when it does not correspond to the stored command message belonging to the third stored message group stored.

例えば「実行例B」において、ICカードがコマンド番号「C1」である受信第1回目の「アプリケーション選択」を受信した際、始めに、ICカードのオペレーティングシステムは、処理番号「処理1」の「C1比較」処理、すなわち「アプリケーション選択」の受信コマンドメッセージと、これに対応し、かつメモリの所定の領域に格納されている第1位の格納メッセージ組に属する格納コマンドメッセージを比較する。このときのコマンドメッセージ比較処理に要する処理時間は、上述の図8で示したように「0.210msec」である。   For example, in the “execution example B”, when the IC card receives the first “select application” received with the command number “C1”, the operating system of the IC card starts with “ The received command message of “C1 comparison” process, that is, “application selection” is compared with the stored command message corresponding to this and belonging to the first stored message group stored in a predetermined area of the memory. The processing time required for the command message comparison process at this time is “0.210 msec” as shown in FIG.

次に、ICカードのオペレーティングシステムは、処理番号「処理2」の「C1実行」処理、すなわち「アプリケーション選択」の受信コマンドメッセージの内容の解釈、実行をする。そして、その実行結果である送信レスポンスメッセージを上位装置に返信する。このときの処理に要する処理時間は、上述の図9で示したように「23.00msec」である。   Next, the operating system of the IC card interprets and executes the contents of the received command message of “C1 execution” of process number “processing 2”, that is, “application selection”. Then, a transmission response message that is the execution result is returned to the higher-level device. The processing time required for this processing is “23.00 msec” as shown in FIG.

引き続き、ICカードのオペレーティングシステムは、処理番号「処理3」の「C1組書込」処理、すなわち「アプリケーション選択」の受信コマンドメッセージと、「処理1」で生成された送信レスポンスメッセージを、メモリ上の第1位の格納メッセージ組を保持する所定の領域へ記録する格納メッセージ組書き込み処理を実行する。このときの処理に要する処理時間は、上述の図8で示したように「2.184msec」である。   Subsequently, the operating system of the IC card sends the “C1 set writing” process of process number “process 3”, that is, the reception command message of “application selection” and the transmission response message generated in “process 1” in the memory. The stored message set writing process for recording in a predetermined area holding the first stored message set is executed. The processing time required for this process is “2.184 msec” as shown in FIG. 8 described above.

最後に、ICカードのオペレーティングシステムは、処理番号「処理4」の「後続組消去」処理、すなわちメモリの所定の領域に格納されている第2位以降のすべての格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージを無効値とする無効化処理を実行する。このときの処理に要する処理時間は、書き込み待ち時間のみである「2.000msec」である。   Finally, the operating system of the IC card determines that the stored command messages belonging to all the stored message groups after the second place stored in the predetermined area of the memory, that is, the “following group deletion” process of the process number “process 4”. And invalidation processing that uses the stored response message as an invalid value. The processing time required for the processing at this time is “2.000 msec”, which is only the write waiting time.

ICカードのオペレーティングシステムは、上述した「処理1」から「処理4」に至る処理を連続して実行し、受信第1回目の受信コマンドメッセージ「アプリケーション選択」に係る実行処理を完了する。このときの処理全体に要する処理時間は「処理1」から「処理4」に至る処理に要した処理時間の総和となり、その値は「27.39msec」である。   The operating system of the IC card continuously executes the processes from “Process 1” to “Process 4” described above, and completes the execution process related to the first reception command message “application selection”. The processing time required for the entire processing at this time is the sum of the processing times required for the processing from “processing 1” to “processing 4”, and the value is “27.39 msec”.

その後、ICカードはコマンド番号「C2」である受信第2回目の「認証」を受信する。始めに、ICカードのオペレーティングシステムは、処理番号「処理1」の「C2実行」処理、すなわち「認証」の受信コマンドメッセージの内容の解釈、実行をする。そして、その実行結果である送信レスポンスメッセージを上位装置に返信する。このときの処理に要する処理時間は、上述の図9で示したように「57.00msec」である。   Thereafter, the IC card receives the second “authentication” received with the command number “C2”. First, the operating system of the IC card interprets and executes the contents of the received command message of “C2 execution” of process number “processing 1”, that is, “authentication”. Then, a transmission response message that is the execution result is returned to the higher-level device. The processing time required for this process is “57.00 msec” as shown in FIG.

なお、この「C2実行」処理は、先のコマンド番号「C1」である受信第1回目の「アプリケーション選択」に係る実行処理でなされた「処理4」、すなわちメモリの所定の領域に格納されていた第2位以降のすべての格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの無効化処理によって、メモリ上には、「認証」の受信コマンドメッセージに対応する格納コマンドメッセージおよび格納レスポンスメッセージからなる格納メッセージ組が存在しないためになされるものである。   This “C2 execution” process is stored in the “process 4” performed in the execution process related to the first “application selection” with the previous command number “C1”, that is, stored in a predetermined area of the memory. As a result of the invalidation processing of the stored command message and the stored response message belonging to all the stored message groups after the second place, the memory includes the stored command message and the stored response message corresponding to the received command message of “authentication”. This is done because there is no stored message set.

次に、ICカードのオペレーティングシステムは、処理番号「処理2」の「C2組書込」処理、すなわち「認証」の受信コマンドメッセージと、「処理1」で生成された送信レスポンスメッセージを、メモリ上の第2位の格納メッセージ組を保持する所定の領域へ記録する格納メッセージ組書き込み処理を実行する。このときの処理に要する処理時間は、上述の図8で示したように「2.184msec」である。   Next, the operating system of the IC card stores the “C2 set writing” process of process number “process 2”, that is, the reception command message of “authentication” and the transmission response message generated in “process 1” in the memory. The stored message set writing process for recording in a predetermined area holding the second stored message set is executed. The processing time required for this process is “2.184 msec” as shown in FIG. 8 described above.

ICカードのオペレーティングシステムは、上述した「処理1」から「処理2」に至る処理を連続して実行し、受信第2回目の受信コマンドメッセージ「認証」に係る実行処理を完了する。このときの処理全体に要する処理時間は「処理1」から「処理2」に至る処理に要した処理時間の総和となり、その値は「59.18msec」である。   The operating system of the IC card continuously executes the processes from “Process 1” to “Process 2” described above, and completes the execution process related to the second received command message “Authentication”. The processing time required for the entire processing at this time is the total processing time required for the processing from “processing 1” to “processing 2”, and the value is “59.18 msec”.

さらに、ICカードはコマンド番号「C3」である受信第3回目の「ID読み出し」を受信する。始めに、ICカードのオペレーティングシステムは、処理番号「処理1」の「C3実行」処理、すなわち「ID読み出し」の受信コマンドメッセージの内容の解釈、実行をする。そして、その実行結果である送信レスポンスメッセージを上位装置に返信する。このときの処理に要する処理時間は、上述の図9で示したように「14.00msec」である。   Further, the IC card receives the third “read ID” received with the command number “C3”. First, the operating system of the IC card interprets and executes the contents of the received command message of “C3 execution” of the process number “processing 1”, that is, “ID read”. Then, a transmission response message that is the execution result is returned to the higher-level device. The processing time required for this processing is “14.00 msec” as shown in FIG.

なお、この「C3実行」処理は、先のコマンド番号「C1」である受信第1回目の「アプリケーション選択」に係る実行処理でなされた「処理4」、すなわちメモリの所定の領域に格納されていた第2位以降のすべての格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの無効化処理によって、メモリ上には、「ID読み出し」の受信コマンドメッセージに対応する格納コマンドメッセージおよび格納レスポンスメッセージからなる格納メッセージ組が存在しないためになされるものである。   This “C3 execution” process is stored in the “process 4” performed in the execution process related to the first “application selection” with the previous command number “C1”, that is, stored in a predetermined area of the memory. From the stored command message and the stored response message corresponding to the “read ID” received command message, the stored command message and the stored response message belonging to all the stored message groups of the second and subsequent ranks are invalidated. This is because there is no stored message set.

次に、ICカードのオペレーティングシステムは、処理番号「処理2」の「C3組書込」処理、すなわち「ID読み出し」の受信コマンドメッセージと、「処理1」で生成された送信レスポンスメッセージを、メモリ上の第3位の格納メッセージ組を保持する所定の領域へ記録する格納メッセージ組書き込み処理を実行する。このときの処理に要する処理時間は、上述の図8で示したように「2.080msec」である。   Next, the operating system of the IC card stores the received command message of “C3 set writing” processing with the processing number “processing 2”, that is, “ID read”, and the transmission response message generated by “processing 1” in the memory. A stored message set writing process for recording in a predetermined area holding the third highest stored message set is executed. The processing time required for this processing is “2.080 msec” as shown in FIG.

ICカードのオペレーティングシステムは、上述した「処理1」から「処理2」に至る処理を連続して実行し、受信第3回目の受信コマンドメッセージ「ID読み出し」に係る実行処理を完了する。このときの処理全体に要する処理時間は「処理1」から「処理2」に至る処理に要した処理時間の総和となり、その値は「16.08msec」である。   The operating system of the IC card continuously executes the processes from “Process 1” to “Process 2” described above, and completes the execution process related to the third received command message “Read ID”. The processing time required for the entire processing at this time is the total processing time required for the processing from “processing 1” to “processing 2”, and the value is “16.08 msec”.

このように、ICカードは、上位装置から受信した3個のコマンドメッセージ、すなわちコマンド番号「C1」である受信第1回目の受信コマンドメッセージ「アプリケーション選択」、コマンド番号「C2」である受信第2回目の受信コマンドメッセージ「認証」、およびコマンド番号「C3」である受信第3回目の受信コマンドメッセージ「ID読み出し」の実行、およびこれら3個の受信コマンドメッセージに応答する各々のレスポンスメッセージを上位装置に返信する一連の情報のやりとりを行い、上位装置との通信を完了する。   In this way, the IC card receives the three command messages received from the host device, that is, the first received command message “application selection” with the command number “C1” and the second received command with the command number “C2”. Executing the received command message “authentication” for the first time and the received command message “ID read” for the third received command number “C3”, and the response messages in response to these three received command messages A series of information sent back to is exchanged to complete the communication with the host device.

なお、「実行例C」および「実行例D」については、一致しない受信コマンドメッセージが異なるのみで、それ以外の一連のプロセスは「実行例B」と同様であるので、ここでの詳細な説明は省略する。   Note that “execution example C” and “execution example D” differ only in the received command messages that do not match, and the other series of processes are the same as “execution example B”, and therefore detailed description here. Is omitted.

図11は、本発明のICカードのデータ処理に要する処理時間と、従来のICカードのデータ処理に要する処理時間との比較を示す図である。   FIG. 11 is a diagram showing a comparison between the processing time required for the data processing of the IC card of the present invention and the processing time required for the data processing of the conventional IC card.

図11において、本発明のICカードのデータ処理の実行例として、「実行例A」、「実行例B」、「実行例C」、および「実行例D」の4パターンを例示した。なお、「実行例A」は、3個の受信コマンドメッセージのすべてが一致する場合、すなわちコマンド番号「C1」である受信第1回目の「アプリケーション選択」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第1位の格納メッセージ組に属する格納コマンドメッセージと一致し、コマンド番号「C2」である受信第2回目の「認証」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第2位の格納メッセージ組に属する格納コマンドメッセージと一致し、コマンド番号「C3」である受信第3回目の「ID読み出し」の受信コマンドメッセージが、これに対応し、かつメモリの所定の領域に格納されている第3位の格納メッセージ組に属する格納コマンドメッセージと一致する場合の実行例である。ただしここで例示した、「実行例B」、「実行例C」、および「実行例D」は、上述の図10で説明したものと同一のものである。   In FIG. 11, four patterns of “execution example A”, “execution example B”, “execution example C”, and “execution example D” are illustrated as execution examples of data processing of the IC card of the present invention. In the “execution example A”, when all of the three received command messages match, that is, the received first “select application” received command message with the command number “C1” corresponds to this, The received command message of the second “authentication” received with the command number “C2” matches the stored command message belonging to the first stored message set stored in the predetermined area of the memory. Corresponding and the received command message of the third “read ID” received with the command number “C3” that matches the stored command message belonging to the second stored message set stored in the predetermined area of the memory Corresponds to this, and the stored command message belonging to the third stored message group stored in the predetermined area of the memory. An execution example of matching the over-di. However, “execution example B”, “execution example C”, and “execution example D” illustrated here are the same as those described in FIG.

また、「実行例A」は、3個の受信コマンドメッセージの各々の受信コマンドメッセージと、これらに対応し、かつメモリの所定の領域に格納される各々の格納コマンドメッセージがすべて一致することから、各々の受信コマンドメッセージに係る実行処理は、すべてコマンドメッセージ比較処理のみで完了する。したがって、「実行例A」の各受信コマンドメッセージに係るデータ処理に要する処理時間は、上述の図8に示したコマンドメッセージ比較処理に要する処理時間の値と同一のものとなる。   In addition, since “execution example A” matches each of the received command messages of the three received command messages with each of the stored command messages corresponding to these and stored in a predetermined area of the memory, Execution processing relating to each received command message is completed only by command message comparison processing. Therefore, the processing time required for data processing related to each received command message of “execution example A” is the same as the processing time value required for the command message comparison processing shown in FIG.

また、従来のICカードのデータ処理に要する処理時間は、上述の図9に示した処理時間の値と同一のものである。   The processing time required for data processing of the conventional IC card is the same as the processing time value shown in FIG.

図11において、従来のICカードのデータ処理、すなわち一連の3個の受信コマンドメッセージの実行処理に要する処理時間は、「94.00msec」である。これに対し、本発明のICカードのデータ処理のうち、「実行例A」では、その処理時間が「0.470msec」であり、従来のICカードのデータ処理に要する処理時間を「1.0」とした相対値で比較すると、「実行例A」の値は「0.005」となり、データ処理に要する処理時間は1/200である。   In FIG. 11, the processing time required for the data processing of the conventional IC card, that is, the execution processing of a series of three received command messages is “94.00 msec”. On the other hand, among the data processing of the IC card of the present invention, in “execution example A”, the processing time is “0.470 msec”, and the processing time required for data processing of the conventional IC card is “1.0”. The value of “execution example A” is “0.005”, and the processing time required for data processing is 1/200.

また、「実行例B」、「実行例C」、および「実行例D」のデータ処理に要する処理時間は、それぞれ「102.7msec」、「102.9msec」、および「102.9msec」であり、同様に相対値で比較すると、それぞれ「1.1」、「1.1」、および「1.1」となり、従来のICカードのデータ処理に要する処理時間とほぼ同等である。   In addition, the processing time required for data processing of “execution example B”, “execution example C”, and “execution example D” is “102.7 msec”, “102.9 msec”, and “102.9 msec”, respectively. Similarly, when compared with relative values, they are “1.1”, “1.1”, and “1.1”, respectively, which are almost the same as the processing time required for data processing of a conventional IC card.

したがって、マルチアプリケーション型のICカードであっても、事実上単一のアプリケーションのみしか使用せず、上位装置から受信する受信コマンドメッセージが変更されることなく固定され、かつその受信順序も固定されている場合においては、上述の「実行例A」の実行結果に示されたとおり、そのデータ処理に要する処理時間は大幅に短縮され、その結果、上位装置とICカード間の通信時間の短縮化が実現でき、通信の高速化が達成される。同時に、受信した受信コマンドメッセージと、これに対応した格納コマンドメッセージとを比較して不一致となる場合であっても、従来のICカードの処理時間とほぼ同等の処理時間で目的のファイルを特定し、前記受信コマンドメッセージを正確に実行することができる。   Therefore, even in a multi-application type IC card, only a single application is practically used, the reception command message received from the host device is fixed without being changed, and the reception order is also fixed. In this case, as shown in the execution result of “execution example A” described above, the processing time required for the data processing is greatly shortened, and as a result, the communication time between the host device and the IC card can be shortened. This can be realized and the communication speed can be increased. At the same time, even if there is a mismatch between the received command message received and the stored command message corresponding to the received command message, the target file is identified with a processing time almost equivalent to the processing time of the conventional IC card. The received command message can be executed accurately.

なお、本実施例で例示した各受信コマンドメッセージに係るデータ処理に要する処理時間の各々は、一例に過ぎず、使用するICカードに内蔵されているICチップの性能、あるいはICカードのオペレーティングシステムの設計等によってその結果は異なる。また、本実施例では、マルチアプリケーション型のICカードを例示して説明したが、これに限定されず、単一のアプリケーションを搭載したICカードであってもよい。また、上位装置との通信は、例示した非接触方式のICカードに限らず、接触方式のICカードであってもよい。   The processing time required for data processing related to each received command message illustrated in this embodiment is merely an example, and the performance of the IC chip built in the IC card to be used or the operating system of the IC card The results vary depending on the design. In this embodiment, the multi-application type IC card has been described as an example. However, the present invention is not limited to this, and an IC card on which a single application is mounted may be used. The communication with the host device is not limited to the illustrated non-contact type IC card, and may be a contact type IC card.

以上、実施例を用いて、本発明の実施の形態を説明したが、本発明は、本実施例に限定されるものではなく、本発明の要旨を逸脱しない範囲の設計変更があっても本発明に含まれる。すなわち、当業者であれば、当然なしえるであろう各種変形、修正もまた本発明に含まれることは勿論である。   The embodiments of the present invention have been described above using the embodiments. However, the present invention is not limited to the embodiments, and the present invention is not limited to the scope of the present invention. Included in the invention. That is, it goes without saying that the present invention also includes various variations and modifications that would be obvious to those skilled in the art.

本発明のICカードは、複数のアプリケーションを搭載してあっても、そのうちの単一の特定アプリケーションの使用頻度が高いマルチアプリケーション型のICカード、あるいは単一のアプリケーションを搭載したICカードを用いたICカード通信システムに利用可能である。   The IC card of the present invention uses a multi-application type IC card in which a single specific application is frequently used, or an IC card having a single application, even if a plurality of applications are mounted. It can be used for an IC card communication system.

本発明のICカードのコマンドメッセージおよびレスポンスメッセージの処理過程を説明するフローチャート。The flowchart explaining the process of the command message and response message of the IC card of the present invention. 本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージがすべて一致する場合のデータ処理を説明する図。The figure explaining the data processing when the frequency | count of reception of the received command message which concerns on the IC card of this invention is less than the number of stored message groups, and all the received command messages and the stored command messages match. 本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数以内で、かつ受信コマンドメッセージと格納コマンドメッセージが一部一致しない場合のデータ処理を説明する図。The figure explaining the data processing when the frequency | count of reception of the received command message which concerns on the IC card of this invention is less than the number of stored message sets, and a received command message and a stored command message do not correspond partially. 本発明のICカードに係る受信コマンドメッセージの受信回数が格納メッセージ組の個数を超える場合のデータ処理を説明する図。The figure explaining the data processing when the frequency | count of reception of the reception command message which concerns on the IC card of this invention exceeds the number of stored message groups. 本発明のICカードに係る各受信コマンドメッセージの内容、レスポンスメッセージの内容、およびそのデータ長を示す図。The figure which shows the content of each received command message concerning the IC card of this invention, the content of a response message, and its data length. 本発明のICカードに係る1byteあたりのコマンドメッセージ比較処理に要する処理時間を示す図。The figure which shows the processing time required for the command message comparison process per 1 byte concerning the IC card of this invention. 本発明のICカードに係る1byteあたりの格納メッセージ組書き込み処理に要する処理時間を示す図。The figure which shows the processing time which the stored message group write processing per 1 byte concerning the IC card of this invention requires. 本発明のICカードに係る各受信コマンドメッセージのコマンドメッセージ比較処理、および格納メッセージ組書き込み処理に要する処理時間を示す図。The figure which shows the processing time required for the command message comparison process of each received command message concerning the IC card of this invention, and a stored message group write process. 従来のICカードに係るデータ処理で各受信コマンドメッセージを実行した場合の、データ処理に要する処理時間を示す図である。It is a figure which shows the processing time required for a data process at the time of performing each reception command message by the data process which concerns on the conventional IC card. 受信コマンドメッセージと格納コマンドメッセージが一部一致しない場合、本発明のICカードに係るオペレーティングシステムが実行するデータ処理の処理内容および処理時間を示す図。The figure which shows the processing content and processing time of the data processing which the operating system which concerns on the IC card of this invention performs when a reception command message and a storage command message partially do not correspond. 本発明のICカードのデータ処理に要する処理時間と、従来のICカードのデータ処理に要する処理時間との比較を示す図。The figure which shows the comparison of the processing time required for the data processing of the IC card of this invention, and the processing time required for the data processing of the conventional IC card. ICカードに内蔵されたICチップ内の書き換え可能な不揮発性メモリの所定の領域に格納されるデータのデータ構造の一例を示す概略図。Schematic which shows an example of the data structure of the data stored in the predetermined area | region of the rewritable non-volatile memory in the IC chip incorporated in the IC card. ICカードのオペレーティングシステムが上位装置から受信した受信コマンドメッセージを実行処理するプロセスを模式的に示した図。The figure which showed typically the process in which the operating system of an IC card performs the execution process of the received command message received from the high-order apparatus. 上位装置とICカード間の通信におけるコマンドメッセージおよびレスポンスメッセージの送受信を実行するシーケンスの一例を示した概略図。Schematic which showed an example of the sequence which performs transmission / reception of the command message and response message in communication between a high-order apparatus and an IC card.

Claims (3)

上位装置から送信されるコマンドメッセージを受信し、前記コマンドメッセージの内容を解釈して、前記コマンドメッセージを実行するオペレーティングシステムを搭載し、かつ前記コマンドメッセージの実行結果を前記上位装置へ返信するICカードであって、
前記オペレーティングシステムが、書き換え可能な不揮発性メモリの所定の領域に格納される、一対の格納コマンドメッセージおよび格納レスポンスメッセージからなる複数の格納メッセージ組に関する情報を記録する機能と、
前記オペレーティングシステムが、前記複数の格納メッセージ組に順位を付与する機能と、
前記オペレーティングシステムが、前記複数の格納メッセージ組の個数を計数する機能と、
前記オペレーティングシステムが、前記ICカードが受信した受信コマンドメッセージと、前記複数の格納メッセージ組の個数以内の値であってかつ前記受信コマンドメッセージの受信回数の値と一致する順位に位置する格納メッセージ組に属する格納コマンドメッセージを、比較する機能を有するとともに、
前記オペレーティングシステムが、前記受信コマンドメッセージと前記格納コマンドメッセージとを比較し、前記受信コマンドメッセージの内容および/またはコマンドメッセージ長と、前記格納コマンドメッセージの内容および/またはコマンドメッセージ長の一致を確認した場合、
前記オペレーティングシステムは、前記一致を確認した任意の格納メッセージ組が位置する順位の値と一致する順番で受信した受信コマンドメッセージの内容の解釈、および前記受信コマンドメッセージの実行をせず、前記任意の格納メッセージ組の格納レスポンスメッセージを、前記上位装置に返信する機能を有したことを特徴とするICカード。
An IC card that receives a command message transmitted from a host device, interprets the content of the command message, and has an operating system that executes the command message, and returns the execution result of the command message to the host device Because
A function for recording information about a plurality of stored message sets, each of which is stored in a predetermined area of a rewritable nonvolatile memory, and which includes a pair of stored command messages and a stored response message;
A function for the operating system to give a ranking to the plurality of stored message sets;
A function for the operating system to count the number of the plurality of stored message sets;
The operating system receives a received message message received by the IC card and a stored message set that is a value that is within the number of the plurality of stored message sets and that matches the value of the number of times the received command message is received. Has a function to compare stored command messages belonging to
The operating system compares the received command message with the stored command message and confirms that the received command message content and / or command message length matches the stored command message content and / or command message length. If
The operating system does not interpret the content of the received command message received in the order that matches the value of the order in which the stored message set that has confirmed the match is located, and does not execute the received command message. An IC card having a function of returning a stored response message of a stored message set to the host device.
前記オペレーティングシステムが、前記受信コマンドメッセージと前記格納コマンドメッセージとを比較し、前記受信コマンドメッセージの内容および/またはコマンドメッセージ長と、前記格納コマンドメッセージの内容および/またはコマンドメッセージ長の不一致を確認した場合、
前記オペレーティングシステムは、順位が付与されている前記複数の格納メッセージ組のうち、第1位から始まり、前記不一致を確認した任意の格納メッセージ組の一つ前の格納メッセージ組が位置する順位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を一つずつ順番に解釈、実行した後、
前記不一致を確認した任意の格納メッセージ組が位置する順位の値と一致する順番で受信した受信コマンドメッセージの内容の解釈、実行をして、
前記不一致を確認した任意の格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージを、前記受信コマンドメッセージと前記受信コマンドメッセージの実行結果である送信レスポンスメッセージへ書き換えるとともに、
前記不一致を確認した任意の格納メッセージ組より後の順位にあるすべての格納メッセージ組に属する格納コマンドメッセージおよび格納レスポンスメッセージの双方を無効化した後、
前記送信レスポンスメッセージを、前記上位装置に返信する機能を有したことを特徴とする請求項1に記載のICカード。
The operating system compares the received command message with the stored command message and confirms that the received command message content and / or command message length does not match the stored command message content and / or command message length. If
The operating system starts from the first among the plurality of stored message groups to which the order is given, and reaches the order in which the stored message group immediately before the arbitrary stored message group in which the mismatch is confirmed is located. After interpreting and executing the contents of the stored command messages belonging to each stored message set one by one,
Interpret and execute the contents of the received command message received in an order that matches the value of the order in which any stored message set that confirmed the mismatch is located,
Rewriting the storage command message and the storage response message belonging to any stored message set that has confirmed the mismatch to the transmission response message that is the execution result of the reception command message and the reception command message,
After invalidating both the storage command message and the storage response message belonging to all the storage message pairs in the rank after the arbitrary storage message pair that confirmed the mismatch,
2. The IC card according to claim 1, further comprising a function of returning the transmission response message to the higher-level device.
前記受信回数の値が前記複数の格納メッセージ組の個数の値を超える場合、
前記オペレーティングシステムは、順位が付与されている前記複数の格納メッセージ組のうち、第1位から始まり最後位に至る、各々の格納メッセージ組に属する格納コマンドメッセージの内容を一つずつ順番に解釈、実行した後、
前記複数の格納メッセージ組の個数の値を超えた位置で受信した受信コマンドメッセージの内容の解釈、実行をして、
一対の、前記受信コマンドメッセージと前記受信コマンドメッセージの実行結果である送信レスポンスメッセージからなる格納メッセージ組を、最後位の格納メッセージ組の後に追記するとともに、
前記送信レスポンスメッセージを、前記上位装置に返信する機能を有したことを特徴とする請求項1ないし2に記載のICカード。
When the value of the number of receptions exceeds the value of the number of the plurality of stored message sets,
The operating system interprets the contents of the stored command messages belonging to each stored message group, one by one, in order from the first to the last among the plurality of stored message groups to which the order is given, After running
Interpreting and executing the contents of the received command message received at a position exceeding the value of the number of the plurality of stored message sets,
A pair of the received message message and a stored message set consisting of a transmission response message that is an execution result of the received command message are added after the last stored message set,
3. The IC card according to claim 1, further comprising a function of returning the transmission response message to the higher-level device.
JP2008295555A 2008-11-19 2008-11-19 Ic card Pending JP2010122877A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008295555A JP2010122877A (en) 2008-11-19 2008-11-19 Ic card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008295555A JP2010122877A (en) 2008-11-19 2008-11-19 Ic card

Publications (1)

Publication Number Publication Date
JP2010122877A true JP2010122877A (en) 2010-06-03

Family

ID=42324166

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008295555A Pending JP2010122877A (en) 2008-11-19 2008-11-19 Ic card

Country Status (1)

Country Link
JP (1) JP2010122877A (en)

Similar Documents

Publication Publication Date Title
CN101326735B (en) Method and equipment for simulating a plurality of RFID label in single mobile electronic apparatus
CN101965597B (en) Method and devices for installing and retrieving linked MIFARE applications
RU2607622C2 (en) Recording of data into smart card nonvolatile memory
JP5843674B2 (en) IC card, portable electronic device, and control method of IC card
JP2010072965A (en) Portable electronic device and data processing method in portable electronic device
CN109614048A (en) Data read-write method, device and computer readable storage medium based on flash memory
JP4896842B2 (en) Portable electronic device
US6301622B1 (en) Computer system having identification data and method for transferring identification data to computer
JP2010122877A (en) Ic card
JP2677589B2 (en) Portable electronic device and IC chip
JP4784138B2 (en) IC card and IC card program
JP4747450B2 (en) Portable information processing device
JP5217729B2 (en) IC card, its program, and IC card issuing method
JP2011060136A (en) Portable electronic apparatus, and data management method in the same
JP4836707B2 (en) Portable electronic device and IC card
JP4868979B2 (en) Portable electronic device and IC card
JP4371696B2 (en) IC card issuing system
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP7040053B2 (en) Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium
JP6039036B2 (en) IC card, portable electronic device, and control method of IC card
JP5516777B2 (en) IC card, its program, and IC card issuing method
JP2005056259A (en) Portable electronic medium and portable electronic medium handling device
JP4026796B2 (en) IC card with command distribution function
JP2005338926A (en) Portable electronic device
JP6015461B2 (en) Information recording medium, data read / write method, and data read / write program