JP2009032249A - Portable electronic device, file management method for portable electronic device, and IC card - Google Patents
Portable electronic device, file management method for portable electronic device, and IC card Download PDFInfo
- Publication number
- JP2009032249A JP2009032249A JP2008170228A JP2008170228A JP2009032249A JP 2009032249 A JP2009032249 A JP 2009032249A JP 2008170228 A JP2008170228 A JP 2008170228A JP 2008170228 A JP2008170228 A JP 2008170228A JP 2009032249 A JP2009032249 A JP 2009032249A
- Authority
- JP
- Japan
- Prior art keywords
- file
- record
- accessed
- data
- command
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
【課題】1つのファイルにおける規定の最大レコード数を超える数のレコードを書き込むことが可能な携帯可能電子装置、携帯可能電子装置のファイル管理方法及びICカードを提供する。
【解決手段】ICカード1は、同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報をメモリ102に記憶しておき、外部装置2からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定し、前記第1のファイルがアクセス対象とならないと判定された場合、使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定し、アクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う。
【選択図】図1A portable electronic device capable of writing a number of records exceeding a specified maximum number of records in one file, a file management method for the portable electronic device, and an IC card are provided.
The IC card 1 stores a plurality of file management information having the same file identification information and different usage order information stored in a memory 102, and a command is given from an external device 2. Whether the first file defined in the file management information of the usage order information with the first usage order among the file management information having the file identification information of the file to be accessed is to be accessed. If it is determined and the first file is determined not to be an access target, whether or not the second file defined in the file management information of the usage order information having the second usage order is to be accessed And processing according to the command is performed on the file determined to be the access target.
[Selection] Figure 1
Description
本発明は、たとえば、外部装置から与えられるコマンドに応じて不揮発性メモリ内のファイルに対してアクセスするICカードなどの携帯可能電子装置および携帯可能電子装置のファイル管理方法に関する。 The present invention relates to a portable electronic device such as an IC card that accesses a file in a nonvolatile memory in accordance with a command given from an external device, and a file management method for the portable electronic device.
従来、ICカードなどの携帯可能電子装置では、データを記憶するための書換え可能な不揮発性メモリおよび不揮発性メモリ内のデータに対する処理を実行する制御素子を有している。このようなICカードなどの携帯可能電子装置では、不揮発性メモリに記憶するデータをファイル単位で管理する方法が一般的である(たとえば、特許第2695857号参照)。このようなファイル単位でデータを管理するICカードでは、不揮発性メモリに格納されたデータに対して直接的にアクセスするものではない。つまり、ICカードは、まず、所望のデータが格納されているファイルに対してアクセスする。ファイルにアクセスすると、ICカードは、当該ファイルに格納されているデータに対して、読出しあるいは書込みなどを行う。 2. Description of the Related Art Conventionally, a portable electronic device such as an IC card has a rewritable nonvolatile memory for storing data and a control element that executes processing on the data in the nonvolatile memory. In such portable electronic devices such as an IC card, a method of managing data stored in a nonvolatile memory in file units is common (see, for example, Japanese Patent No. 2695857). Such an IC card that manages data in units of files does not directly access data stored in the nonvolatile memory. In other words, the IC card first accesses a file in which desired data is stored. When accessing a file, the IC card reads or writes data stored in the file.
また、ICカードは、外部装置からの処理命令であるコマンドに応じて動作するものである。たとえば、ICカードは、外部からのコマンドに応じてファイル内に格納されているデータへのアクセスする処理を行う。ICカードに与えられるコマンドは、所定の規格によって規定されている。すなわち、外部装置は、所定の規格で規定されているコマンドにより、ICカードに対して所望のデータへのアクセスを要求する。これに対して、ICカードは、外部装置からのコマンドを所定の規格に基づいて解釈し、当該コマンドに応じて処理を行う。 The IC card operates according to a command that is a processing command from an external device. For example, the IC card performs processing for accessing data stored in a file in response to a command from the outside. The command given to the IC card is defined by a predetermined standard. That is, the external device requests access to desired data from the IC card by a command defined by a predetermined standard. In contrast, the IC card interprets a command from an external device based on a predetermined standard, and performs processing according to the command.
上記のように、ICカードでは、特定の規格に基づいて動作するようになっている。たとえば、ICカードの国際標準化規格であるISO/IEC7816−4では、データを記憶するためのファイル(EF:エレメンタリファイルと称されるデータファイル)の構造および形式が規定されている。また、ISO/IEC7816−4では、ICカード内の各ファイルへのアクセスを要求するためのコマンドも規定されている。 As described above, the IC card operates based on a specific standard. For example, ISO / IEC7816-4, which is an international standard for IC cards, defines the structure and format of a file for storing data (EF: data file called an elementary file). In ISO / IEC7816-4, a command for requesting access to each file in the IC card is also defined.
上記ISO/IEC7816−4では、ICカードにおけるデータファイル内のデータ構造として、データファイル内にデータを記憶する複数のレコードを有する構造(レコード構造)が規定されている。また、上記ISO/IEC7816−4では、上記のようなレコード構造のファイルへのアクセスを要求するコマンドも規定されている。ただし、上記ISO/IEC7816−4では、1つのデータファイルに格納可能なレコード数に制限がある。このため、上記ISO/IEC7816−4では、レコード構造のファイルへのアクセスを要求するコマンドにおいてアクセス対象として指定できるレコード数にも制限がある。 In ISO / IEC7816-4, a structure (record structure) having a plurality of records for storing data in a data file is defined as a data structure in a data file in an IC card. The ISO / IEC 7816-4 also defines a command for requesting access to a file having the record structure as described above. However, ISO / IEC7816-4 has a limit on the number of records that can be stored in one data file. For this reason, ISO / IEC7816-4 has a limit on the number of records that can be specified as an access target in a command that requests access to a record-structured file.
上記ISO/IEC7816−4では、1つのファイルに格納されるレコード数の最大数として、「254」個を想定している。つまり、上記ISO/IEC7816−4では、レコード番号が「1」から「254」までのレコード番号で定義される「254」個までのレコードが1つのファイルに格納されることを想定している。このため、上記ISO/IEC7816−4では、レコードへのアクセスを要求するコマンドにおいて、アクセス対象として指定可能なレコード番号の値は、16進数で「01」から「FE」まで、つまり、10進数で「1」から「254」までとなっている。 In the ISO / IEC7816-4, “254” is assumed as the maximum number of records stored in one file. That is, in the ISO / IEC7816-4, it is assumed that up to “254” records defined by the record numbers from “1” to “254” are stored in one file. For this reason, in the ISO / IEC7816-4, in the command for requesting access to the record, the value of the record number that can be specified as an access target is “01” to “FE” in hexadecimal, that is, decimal. “1” to “254”.
一方、近年では、様々な用途でICカードまたはそれに類する携帯可能電子装置が使用されるようになってきている。たとえば、上記ISO/IEC7816−4のような国際規格に従って動作するICチップを埋め込んだ冊子が、旅券(パスポート)などとして利用される形態も考えられている。このように携帯可能電子装置が様々な用途で使用されるにつれて、携帯可能電子装置に、規格で想定されている以上のレコード数のデータを1つのファイルに記録したいという要望が強くなることが予想される。たとえば、ICチップを埋め込んだパスポートに出国および入国などの情報を消去することなく追記していくという使用方法を想定した場合、当該パスポートのICチップには、規格で想定されている数以上のレコード数のデータを1つのファイルに記録したいという状況が発生することが考えられる。また、セキュリティエリアへの入退出を管理するシステムに用いられるICカード、あるいは、料金決済などの商取引を行うシステムに用いられるICカードには、入退出の履歴情報を大量に記録したり、取引の履歴情報を大量に記録したりしたいという要求が発生することも予想される。 On the other hand, in recent years, IC cards or similar portable electronic devices have been used for various purposes. For example, a form in which a booklet in which an IC chip that operates in accordance with an international standard such as ISO / IEC7816-4 is embedded is used as a passport or the like. As portable electronic devices are used in various applications in this way, it is expected that there will be a strong demand for recording data in a single file with more records than the standard assumes for portable electronic devices. Is done. For example, assuming a usage method in which information such as departure and entry is added to a passport embedded with an IC chip without erasing it, the IC chip of the passport contains more records than expected in the standard. It is conceivable that a situation occurs in which it is desired to record a number of data in one file. In addition, a large amount of entry / exit history information can be recorded on an IC card used in a system for managing entry / exit to / from a security area, or an IC card used for a business transaction system such as fee settlement, A request to record a large amount of history information is also expected to occur.
しかしながら、上述したような既存の規格では、各データファイルには、予め規定されているレコード数までのデータしか格納できない。すなわち、既存の規格に準じたシステムでは、1つのデータファイルでは予め規定されているレコード数までのデータしか取り扱うことができない。今後、ICカードが広い分野で使用されることを想定すると、レコード構造のデータファイルにおいて格納できるレコード数の最大値が拡張可能であることが望ましい。さらには、既存システムの運用状況を考慮すると、上記のようなレコード数の最大数を拡張する場合であっても、上記ISO/IEC7816−4で規定されているような既存のコマンドで、データファイル内の各レコードにアクセス可能であることが望ましい。
この発明の一形態では、特定のファイルで管理可能なデータ量を容易に拡張することが可能な携帯可能電子装置、携帯可能電子装置のファイル管理方法およびICカードを提供することを目的とする。 An object of one aspect of the present invention is to provide a portable electronic device, a file management method for a portable electronic device, and an IC card that can easily expand the amount of data that can be managed by a specific file.
この発明の一形態としての携帯可能電子装置は、ファイル単位のデータを記憶する第1のメモリと、同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報を記憶する第2のメモリと、外部装置からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定する第1のアクセス判定部と、前記第1の判定部により前記第1のファイルがアクセス対象とならないと判定された場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定する第2のアクセス判定部と、前記第1あるいは第2のアクセス判定部によりアクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う処理部とを有する。 A portable electronic device according to an aspect of the present invention stores a plurality of file management information having the same file identification information and different usage order information set as the first memory for storing data in units of files. When the command is given from the second memory and the external device, it is defined by the file management information of the usage order information whose usage order is the first among the file management information having the file identification information of the file to be accessed A first access determination unit that determines whether or not the first file being accessed is an access target, and an access when the first determination unit determines that the first file is not an access target It is determined by the file management information of the usage order information that has the second highest usage order among the file management information having the file identification information of the target file. A second access determination unit that determines whether or not the second file being accessed is an access target, and a command that is determined to be an access target by the first or second access determination unit And a processing unit that performs a corresponding process.
この発明の一形態としての携帯可能電子装置のファイル管理方法は、ファイル単位のデータを第1のメモリに記憶しておき、同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報を第2のメモリに記憶しておき、外部装置からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定し、前記第1のファイルがアクセス対象とならないと判定された場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定し、前記判定によりアクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う。 According to one aspect of the present invention, there is provided a file management method for a portable electronic device, in which data in units of files is stored in a first memory, the same file identification information is set, and different usage order information is set. File management information is stored in the second memory, and when a command is given from an external device, the usage order is the first among the file management information having the file identification information of the file to be accessed It is determined whether or not the first file defined in the file management information of the rank information is to be accessed, and if it is determined that the first file is not to be accessed, the file of the file to be accessed Among the file management information having identification information, the second file defined in the file management information of the usage order information that has the second highest usage order. Determines whether to Il accessed, it performs processing corresponding to the command for a file is determined to an access target by the determination.
この発明の一形態としてのICカードは、ファイル単位のデータを記憶する第1のメモリと、同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報を記憶する第2のメモリと、外部装置からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定する第1のアクセス判定部と、前記第1の判定部により前記第1のファイルがアクセス対象とならないと判定された場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定する第2のアクセス判定部と、前記第1あるいは第2のアクセス判定部によりアクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う処理部とを有するモジュールと、前記モジュールを収納した本体と、を有する。
An IC card according to an aspect of the present invention stores a plurality of file management information in which different usage order information is set with the same file identification information as the first memory that stores data in file units. When the command is given from the
この発明の一形態では、特定のファイルで管理可能なデータ量を容易に拡張することが可能な携帯可能電子装置、携帯可能電子装置のファイル管理方法およびICカードを提供できる。 In one embodiment of the present invention, a portable electronic device, a file management method for a portable electronic device, and an IC card that can easily expand the amount of data that can be managed by a specific file can be provided.
以下、図面を参照して本発明の実施の形態について説明する。
図1は、本発明の実施の形態に係る携帯可能電子装置としてのICカード1およびICカード1を含むICカードシステムの構成例を示すブロック図である。
上記ICカード1は、外部装置としてのICカードリーダライタ2からの電源供給により動作可能な状態となる。動作可能となったICカード1は、上記ICカードリーダライタ2からのコマンドに応じて種々の処理を行う。上記ICカードリーダライタ2は、ICカード1を動作させるための電源を供給するとともに、当該ICカード1に対して種々の処理を要求するコマンドを供給する。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration example of an IC card 1 as a portable electronic device and an IC card system including the IC card 1 according to an embodiment of the present invention.
The IC card 1 becomes operable by supplying power from an IC card reader /
また、上記ICカード1は、上記ICカードリーダライタ2の接触部と物理的に接触して通信を行う接触式の携帯可能電子装置(接触式ICカード)であっても良いし、アンテナおよび無線通信部等により上記ICカードリーダライタ2と非接触の状態で通信を行う非接触式(contactless)の携帯可能電子装置(非接触式ICカード)であっても良い。さらには、上記ICカード1は、非接触式ICカードとしての通信機能と接触式ICカードとしての通信機能とを有する複合型のICカード(デュアルインターフェースICカード)であっても良い。なお、非接触式ICカードと接触式ICカードとは、外部装置との通信方式等が異なるだけである。このため、後述する処理例は、非接触式ICカードであっても接触式ICカードであっても同様に適用できる。
Further, the IC card 1 may be a contact-type portable electronic device (contact IC card) that physically communicates with the contact portion of the IC card reader /
次に、上記ICカード1の構成例について説明する。
図1に示すように、上記ICカード1は、カード状の本体BにモジュールMが埋設された状態で形成されている。上記モジュールMは、1つあるいは複数のICチップ10とインターフェース11とが接続された状態で一体的に形成されたものである。上記ICチップ10は、CPU(中央演算装置)101、データメモリ102、RAM103、ROM104、通信制御部106および電源部(図示しない)などを有している。上記ICチップ10の通信制御部106は、インターフェース11に接続されている。
Next, a configuration example of the IC card 1 will be described.
As shown in FIG. 1, the IC card 1 is formed with a module M embedded in a card-like main body B. The module M is integrally formed in a state where one or a plurality of
上記CPU101は、ICカード1全体の制御を司るものである。上記CPU101は、上記ROM104あるいはデータメモリ102に記憶された制御プログラムおよび制御データなどに基づいて動作する。上記のような制御プログラムを実行することにより、上記CPU101は、種々の処理を行う処理部として機能する。
The
上記データメモリ102は、書換え可能な不揮発性のメモリである。上記データメモリ102は、たとえば、EEPROM(エレクトリカリ・イレーザブル・アンド・プログラマブル・リード・オンリ・メモリ)あるいはフラッシュROMなどの消去(書換え)可能な不揮発性メモリで構成されている。上記データメモリ102には、当該ICカード1の使用目的に応じた種々の情報が記憶される。たとえば、上記データメモリ102には、各種の機能を実現するためのアプリケーションデータなどが記憶される。また、上記データメモリ102には、各種データがファイルに格納された状態で記憶される。上記データメモリ12内のファイル構造は、たとえば、ISO/IEC7816−4に基づくものである。
The
上記RAM103は、高速なアクセスが可能な揮発性のメモリである。上記RAM103は、データを一時的に記憶するためのバッファメモリとして機能する。たとえば、上記RAM103は、ICカードリーダライタ2との通信処理において送受信されるデータを一時的に記憶するバッファメモリとして機能する。また、上記RAM103は、CPU101による処理中のデータなどを一時的に保持するワーキングメモリとしても機能する。
The
上記ROM104は、書換え不可能な不揮発性のメモリである。上記ROM104はたとえば、マスクROM(リード・オンリ・メモリ)などの読み出し専用のメモリで構成されている。上記ROM104には、上記CPU101により実行される制御プログラムなどが記憶されるプログラムメモリとして機能する。特に、上記ROM104には、当該ICカード1の仕様に応じた基本動作を司る制御プログラムおよび制御データなどが記憶される。たとえば、上記ROM104には、外部から与えられるコマンドに応じた処理をCPU101が実行するための制御プログラムが記憶される。
The
上記通信制御部106は、上記インターフェース11を介したICカードリーダライタ2とのデータ通信を制御するものである。たとえば、当該ICカード1が接触式ICカードである場合、インターフェース11としてのコンタクト部および通信制御部106としての通信制御回路などにより接触式の通信機能が実現される。また、当該ICカード1が非接触式ICカードで構成される場合、インターフェース11としてのアンテナおよび通信制御部106としての変復調回路などにより非接触式の通信機能が実現される。
The
上記のような構成のICカード1では、ICカードリーダライタ2から上記データメモリ102へのデータの書込みを要求するコマンドが与えられた場合、上記CPU101が上記ROM104などに記憶されている制御プログラムを実行することにより、上記データメモリ102へのデータの書き込み処理を実行する。また、ICカードリーダライタ2から上記データメモリ102に記憶されているデータの読み出しを要求するコマンドが与えられた場合、上記CPU101が上記ROM104に記憶されている制御プログラムを実行することにより、上記データメモリ102からのデータの読み出し処理を実行する。さらに、上記ICカード1は、上記CPU101が当該ICカード1の用途などに応じてインストールされる処理プログラムを実行することにより、用途に応じた種々の処理を実現するようになっている。
In the IC card 1 configured as described above, when a command for requesting data writing to the
図2は、ICカード1の一形態としての接触式ICカードの外観構成例を示す図である。図2に示すように、接触式ICカードでは、インターフェース11としてのコンタクト部が本体Bの表面上に露出するように形成されている。上記接触式ICカードでは、表面に露出する上記コンタクト部に接続された1つあるいは複数のICチップCを有するモジュールMがカード状の本体B内に内蔵されている。なお、接触式ICカードにおけるインターフェース11としてのコンタクト部は、図2に示すように、複数の端子を有している。たとえば、上記コンタクト部は、供給電圧端子Vcc、グランド端子GND、リセット端子RST、入出力端子I/O、および、クロック端子CLKなどの端子により構成される。
FIG. 2 is a diagram illustrating an external configuration example of a contact IC card as one form of the IC card 1. As shown in FIG. 2, the contact IC card is formed so that the contact portion as the
図3は、ICカード1の一形態としての非接触式ICカードの構成例を示す図である。図3に示すように、非接触式ICカードでは、カード状の本体B内に、点線で示すような、1つあるいは複数のICチップCとインターフェース11としてのアンテナとを有するモジュールMが埋め込まれている。これにより、非接触式ICカードでは、アンテナで送受信する電波をICチップCで処理するようになっている。
FIG. 3 is a diagram illustrating a configuration example of a non-contact type IC card as one form of the IC card 1. As shown in FIG. 3, in a non-contact type IC card, a module M having one or a plurality of IC chips C and an antenna as an
次に、上記データメモリ102に記憶されるファイルの構成について説明する。
図4は、上記データメモリ102に記憶されるファイルの構成例を模式的に示す図である。
図4に示すように、ICカード内のデータメモリ102には、マスターファイル(MF)を最上位階層とする階層構造で種々のファイルが管理される。図4に示す例では、最上位階層であるマスターファイルMFの次の階層に、2つのエレメンタリファイル(EF)EF1、EF2が存在している。なお、マスターファイルMFの次の階層にDFファイルを定義し、そのDFファイルの次の階層にエレメンタリファイルが定義されるようにしても良い。
Next, the configuration of the file stored in the
FIG. 4 is a diagram schematically showing a configuration example of a file stored in the
As shown in FIG. 4, in the
上記エレメンタリファイルEF1、EF2は、実データを格納するためのデータファイルである。つまり、上記データメモリ102では、図4に示すようなエレメンタリファイル内に実データが格納される。言い換えると、上記データメモリ102内では、実データがエレメンタリファイルごとに管理される。従って、実データにアクセスする場合、エレメンタリファイルを選択した状態であることが必要となる。
The elementary files EF1 and EF2 are data files for storing actual data. That is, in the
次に、上記エレメンタリファイル(データファイル)内におけるデータの構成について説明する。
図5Aおよび図5Bは、データファイル内におけるデータの構成例を模式的に示す図である。なお、ここでは、図5Aは、図4に示すエレメンタリファイルEF1におけるデータ1の構成例を示し、図5Bは、図4に示すエレメンタリファイルEF2におけるデータ2の構成例を示しているものと想定する。また、図5A及び図5Bに示すようなエレメンタリファイル(データファイル)は、上記データメモリ102に設けれられたデータ用の記憶領域に記憶されるものである。
Next, the configuration of data in the elementary file (data file) will be described.
FIG. 5A and FIG. 5B are diagrams schematically illustrating a configuration example of data in the data file. Here, FIG. 5A shows a configuration example of data 1 in the elementary file EF1 shown in FIG. 4, and FIG. 5B shows a configuration example of
図5Aに示すエレメンタリファイルEF1および図5Bに示すエレメンタリファイルEF2では、実データがレコード番号「1」〜「254」までの254個のレコードとして格納されている。このように、データがレコードとして格納されるファイル内の構造をレコード構造と称するものとする。
ここで、ICカードの国際標準化規格であるISO/IEC7816−4では、エレメンタリファイル内におけるデータ構造として、以下のような構造が規定されている。
In the elementary file EF1 shown in FIG. 5A and the elementary file EF2 shown in FIG. 5B, actual data is stored as 254 records having record numbers “1” to “254”. In this way, a structure in a file in which data is stored as a record is referred to as a record structure.
Here, ISO / IEC7816-4, which is an international standardization standard for IC cards, defines the following structure as a data structure in an elementary file.
(F1)透過構造(Transparent structure)
(F2)固定長順編成レコード構造(Linear structure with records of fixed size):データファイル内において、固定長のレコードが順に並べられる構造である。このタイプのデータファイルでは、たとえば、固定長のレコードが順に追記される。
(F3)可変長順編成レコード構造(Linear structure with records of variable size):データファイル内において、可変長のレコードが順に並べられる構造である。このタイプのデータファイルでは、たとえば、可変長のレコードが順に追記される。
(F4)固定長循環順編成レコード構造(Cyclic structure with records of fixed size):データファイル内において、固定長のレコードが循環するように並べられる構造である。このタイプのデータファイルでは、たとえば、固定長のレコードが循環するように追記される(書換えられる)。
(F5)TLV構造(TLV structure):データファイル内における各レコードがタグ、レングス、バリューから構成されるものである。
(F1) Transparent structure
(F2) Fixed-length sequential record structure (Linear structure with records of fixed size): A structure in which fixed-length records are arranged in order in a data file. In this type of data file, for example, fixed-length records are added in order.
(F3) Variable length sequential record structure (Linear structure with records of variable size): A structure in which variable length records are arranged in order in a data file. In this type of data file, for example, variable-length records are added in order.
(F4) Cyclic structure with records of fixed size: A structure in which fixed-length records are arranged in a data file so as to circulate. In this type of data file, for example, a fixed-length record is added (rewritten) so as to circulate.
(F5) TLV structure: each record in the data file is composed of a tag, a length, and a value.
上記(F1)は、データの構造がレコード構造でなく透過構造である。上記(F2)〜(F5)は、データの構造がレコード構造である。すなわち、ISO/IEC7816−4では、レコード構造を有するエレメンタリファイル(データファイル)として、上記(F2)〜(F5)のような構造が規定されている。上記(F2)〜(F5)のようなレコード構造のデータファイルでは、実データが各レコードに格納される。ただし、ISO/IEC7816−4では、各データファイル内に格納できるレコード数の上限値が「254」(レコード番号「1」〜「254」)であることが規定されている。このため、図4に示すエレメンタリファイルEF1及びEF2のように、レコード番号「1」〜「254」のレコードが格納されているデータファイルには、新たにレコードを格納することができない(実データを格納するためのレコードを設けることができない)ようになっている。 In the above (F1), the data structure is not a record structure but a transparent structure. In the above (F2) to (F5), the data structure is a record structure. That is, in ISO / IEC7816-4, structures (F2) to (F5) are defined as elementary files (data files) having a record structure. In the data file having the record structure as described above (F2) to (F5), actual data is stored in each record. However, ISO / IEC 7816-4 stipulates that the upper limit value of the number of records that can be stored in each data file is “254” (record numbers “1” to “254”). Therefore, a new record cannot be stored in the data file in which the records with the record numbers “1” to “254” are stored like the elementary files EF1 and EF2 shown in FIG. 4 (actual data). Cannot be provided with a record for storing
次に、上記のようなレコード構造のデータファイルへのアクセスについて説明する。
上述したように、ICカード1は、外部装置からのコマンドに応じて動作するものである。このため、データファイルへのアクセス制御は、コマンドに対する処理として説明することができる。従って、ここでは、レコード構造を有するデータファイルに対したアクセスを要求するコマンドについて説明する。
Next, access to a data file having the above record structure will be described.
As described above, the IC card 1 operates in response to a command from an external device. Therefore, access control to the data file can be described as processing for a command. Therefore, here, a command for requesting access to a data file having a record structure will be described.
たとえば、ISO/IEC7816−4では、レコード構造を有するデータファイルに対してアクセスを要求するコマンドとして、以下のようなコマンドが規定されている。
(C1)READ RECORD(S) Command
(C2)WRITE RECORD Command
(C3)APPEND RECORD Command
(C4)SEARCH RECORD Command
(C5)ERASE RECORD(S) Command
上記した(C1)〜(C5)のコマンドのうち(C3)のAPPEND RECORD Commandを除くコマンドでは、アクセス対象とするレコード番号をコマンドで指定することができるようになっている。ただし、上述したように、ISO/IEC7816−4では、各データファイル内に格納できるレコード数の上限値が「254」個であることを想定している。このため、ISO/IEC7816−4では、上記各コマンドで指定できるレコード番号は、16進数で「01」から「FE」(すなわち、10進数でレコード番号「1」から「254」)までとなっている。
For example, in ISO / IEC7816-4, the following commands are defined as commands for requesting access to a data file having a record structure.
(C1) READ RECORD (S) Command
(C2) WRITE RECORD Command
(C3) APPEND RECORD Command
(C4) SEARCH RECORD Command
(C5) ERASE RECORD (S) Command
Of the commands (C1) to (C5) described above, commands other than the APPEND RECORD Command of (C3) can specify the record number to be accessed by the command. However, as described above, ISO / IEC 7816-4 assumes that the upper limit value of the number of records that can be stored in each data file is “254”. For this reason, in ISO / IEC7816-4, the record numbers that can be specified by the above commands are from "01" to "FE" in hexadecimal (that is, record numbers "1" to "254" in decimal). Yes.
一方、(C3)のAPPEND RECORD Commandでは、アクセス対象とするレコードをレコード番号で指定せずにアクセスを要求できる。このようなAPPEND RECORD Commandでは、特定の種類のデータ(たとえば、一連の処理内容を示す履歴情報)を順次記録することを要求するコマンドとして利用されることが多い。一般には、履歴情報が順次記録されるようなデータファイル(つまり、APPEND RECORD Commandでデータの追記が要求されるようなデータファイル)は、ISO/IEC7816−4で想定しているレコード数の上限値を超えるような状況が起こりうると考えられる。すなわち、APPEND RECORD Commandで順にデータを追記していくようなデータファイルでは、レコード数の上限が拡張できれば、データ管理の効率が向上できるものと考えられる。 On the other hand, in APPEND RECORD Command (C3), access can be requested without specifying the record to be accessed by the record number. In such APPEND RECORD Command, it is often used as a command for sequentially recording a specific type of data (for example, history information indicating a series of processing contents). In general, a data file in which history information is sequentially recorded (that is, a data file in which appending of data is requested by the APPEND RECORD Command) is an upper limit value of the number of records assumed in ISO / IEC7816-4. It is thought that a situation exceeding That is, in a data file in which data is appended in order using the APPEND RECORD Command, if the upper limit of the number of records can be expanded, the efficiency of data management can be improved.
本実施の形態のICカードでは、特定のデータファイルに格納できるレコード数を拡張することができるものである。ここで、上記特定のデータファイルとは、必ずしも物理的に1つのデータファイルであることを示すものではない。上記特定のデータファイルとは、ICカードリーダライタ2などの外部装置に1つのデータファイルと認識される複数のファイルを含むものとしている。たとえば、後述するように、同じファイル識別情報が与えられた2つのデータファイルは、外部装置からは1つのデータファイル(特定のデータファイル)と認識されると考えられる。
In the IC card of this embodiment, the number of records that can be stored in a specific data file can be expanded. Here, the specific data file does not necessarily indicate that it is physically one data file. The specific data file includes a plurality of files that are recognized as one data file by an external device such as the IC card reader /
次に、上記エレメンタリファイルの管理形態について説明する。
図6は、エレメンタリファイルを管理するための定義情報(管理情報)の構成例を示す図である。図6では、図5Aに示すエレメンタリファイルEF1および図5Bに示すエレメンタリファイルEF2のファイル管理情報の例を示している。図6に示すようなファイル管理情報は、上記データメモリ102内に設けられた管理情報用の記憶領域に記憶される。
Next, the management mode of the elementary files will be described.
FIG. 6 is a diagram illustrating a configuration example of definition information (management information) for managing elementary files. FIG. 6 shows an example of file management information of the elementary file EF1 shown in FIG. 5A and the elementary file EF2 shown in FIG. 5B. The file management information as shown in FIG. 6 is stored in a storage area for management information provided in the
図6に示すように、各ファイルのファイル管理情報は、ファイル識別情報(Short EF identifier)、ファイル種別情報、レコード長情報、最大レコード数情報、および、使用順位情報などにより構成されている。上記ファイル識別情報は、ファイルを識別するための識別情報である。各データファイルは、上記ファイル識別情報により特定される。このため、上記ファイル識別情報が同じ複数のファイルについては、上記外部装置は、1つのファイルとして認識する。 As shown in FIG. 6, the file management information of each file includes file identification information (Short EF identifier), file type information, record length information, maximum record number information, usage order information, and the like. The file identification information is identification information for identifying a file. Each data file is specified by the file identification information. Therefore, the external device recognizes a plurality of files having the same file identification information as one file.
上記ファイル種別情報は、当該ファイル内のデータ構造などを示す情報が格納される。たとえば、上記ファイル種別情報では、当該ファイル内のデータ構造がレコード構造である場合、上述した(F2)〜(F5)の何れかを示す情報である。上記レコード長情報は、当該ファイル内における各レコードのサイズを示す情報である。最大レコード数情報は、当該ファイル内に格納できるレコード数の最大数を示す情報である。上記使用順位情報は、当該ファイルの使用順位を示す情報である。上記使用順位情報は、上記ファイル識別情報が同一であるファイルが複数存在する場合に設定される。 The file type information stores information indicating the data structure in the file. For example, the file type information is information indicating any one of (F2) to (F5) described above when the data structure in the file is a record structure. The record length information is information indicating the size of each record in the file. The maximum record number information is information indicating the maximum number of records that can be stored in the file. The use order information is information indicating the use order of the file. The usage order information is set when there are a plurality of files having the same file identification information.
また、本実施の形態では、上記ファイル識別情報が同一である複数のファイルのファイル管理情報では、使用順位情報以外の情報が同一であることを想定する。また、本実施の形態では、上記使用順位情報は、同一のファイル識別情報の各ファイルに対して「1」から順に整数値が設定されるものとする。たとえば、同一のファイル識別情報のファイルが2つ存在する場合、一方のファイルに対する使用順位情報が「1」と設定され、他方のファイルに対する使用順位情報が「2」に設定される。 In the present embodiment, it is assumed that the information other than the usage order information is the same in the file management information of a plurality of files having the same file identification information. In the present embodiment, it is assumed that the use order information is set to an integer value in order from “1” for each file of the same file identification information. For example, when there are two files having the same file identification information, the usage order information for one file is set to “1”, and the usage order information for the other file is set to “2”.
図6に示す例では、エレメンタリファイルEF1のファイル管理情報は、ファイル識別情報が「01」、ファイル種別情報が「可変長順編成レコード構造」、レコード長が「100バイト」、最大レコード数が「254」、使用順位情報が「1」である。また、エレメンタリファイルEF2のファイル管理情報は、ファイル識別情報が「01」、ファイル種別情報が「可変長順編成レコード構造」、レコード長が「100バイト」、最大レコード数が「254」、使用順位情報が「2」である。 In the example illustrated in FIG. 6, the file management information of the elementary file EF1 includes file identification information “01”, file type information “variable-length sequential record structure”, record length “100 bytes”, and the maximum number of records. “254” and the use order information is “1”. The file management information of the elementary file EF2 includes file identification information “01”, file type information “variable length sequential record structure”, record length “100 bytes”, maximum number of records “254”, and usage. The rank information is “2”.
図6に示すように、エレメンタリファイルEF1とエレメンタリファイルEF2とは、使用順位情報のみが異なるファイルである。これらのようなファイルは、物理的には、2つのファイルであるが、論理的には1つのファイルとして扱われる。すなわち、ファイル識別情報が「01」のファイルが選択されている状態では、エレメンタリファイルEF1およびエレメンタリファイルEF2の何れかが使用順位情報で設定される順序で実際のアクセス対象となる。 As shown in FIG. 6, the elementary file EF1 and the elementary file EF2 are files that differ only in use order information. These files are physically two files, but are logically handled as one file. That is, in a state where the file having the file identification information “01” is selected, either the elementary file EF1 or the elementary file EF2 is actually accessed in the order set by the usage order information.
次に、上記のようなICカード1における処理例について説明する。
まず、ICカード1における第1の処理例としてAPPEND RECORD Command(C3)に対する処理の流れについて説明する。
図7は、上記ICカード1におけるAPPEND RECORD Command(C3)に対する処理の流れを説明するためのフローチャートである。なお、以下の説明では、APPEND RECORD Command(C3)でアクセス対象とするファイル(カレントファイル)は、図6に示すようなファイル識別情報「01」を持つ可変長順編成レコード構造を持つエレメンタリファイルであるものとする。また、APPEND RECORD Commandで追記すべきデータ(追記データ)は、ファイル識別情報が「01」のファイルにレコードとして格納することができるサイズであるものとする。さらには、APPEND RECORD Commandでデータを追記するためのセキュリティ条件は必要ないものとする。
Next, a processing example in the IC card 1 as described above will be described.
First, a flow of processing for APPEND RECORD Command (C3) will be described as a first processing example in the IC card 1.
FIG. 7 is a flowchart for explaining the flow of processing for the APPEND RECORD Command (C3) in the IC card 1. In the following description, a file (current file) to be accessed by the APPEND RECORD Command (C3) is an elementary file having a variable length sequential record structure having file identification information “01” as shown in FIG. Suppose that Further, it is assumed that the data (additional data) to be additionally recorded by the APPEND RECORD Command has a size that can be stored as a record in the file having the file identification information “01”. Furthermore, it is assumed that there is no need for a security condition for appending data with the APPEND RECORD Command.
上記ICカード1は、上記ICカードリーダライタ2からの電源供給を受けて活性化される。活性化されたICカード1では、上記ICカードリーダライタ2からのコマンドが受信可能となる。この状態において、上記ICカード1は、上記ICカードリーダライタ2からコマンドを受信する。上記ICカードリーダライタ2からコマンドを受信すると、上記ICカード1のCPU101は、コマンドを判別する処理を行う。この場合、上記CPU101は、コマンドを判別する処理により受信したコマンドがAPPEND RECORD Commandであることを判別する。上記ICカードリーダライタ2から受信したコマンドがAPPEND RECORD Commandであると判定した場合、上記ICカード1のCPU101は、図7に示すような流れの処理を実行する。
The IC card 1 is activated upon receiving power supply from the IC card reader /
すなわち、上記APPEND RECORD Commandを受信すると、上記CPU101は、上記データメモリ102に格納されている複数のファイル管理情報から、現在選択状態となっているファイル(カレントファイル)のファイル識別情報を有するファイル管理情報を検索する(ステップS1)。この検索処理によりカレントファイルのファイル識別情報を有するファイル管理情報が存在しないと判定した場合(ステップS2、NO)、上記CPU101は、当該APPEND RECORD Commandに対する処理結果として、ファイルなしのエラーであることを示すレスポンス(応答)をICカードリーダライタ2へ送信し、当該APPEND RECORD Commandに対する処理をエラー終了とする(ステップS3)。
In other words, when the APPEND RECORD Command is received, the
上記検索処理において現在選択されているファイルのファイル識別情報を有するファイル管理情報が存在すると判定した場合(ステップS2、YES)、上記CPU101では、カレントファイルと同一のファイル識別情報を有するファイル管理情報が複数存在するか否かを判定する(ステップS4)。
この判定によりカレントファイルと同一のファイル識別情報を有するファイル管理情報が複数存在すると判定した場合(ステップS4、YES)、上記CPU101は、それらのファイル管理情報のうち使用順位情報が最上位の使用順位となっているファイル管理情報のファイルをアクセス対象のファイルとして選択する(ステップS5)。また、カレントファイルのファイル識別情報を有するファイル管理情報が1つのみである場合(ステップS4、NO)、上記CPU101は、当該ファイル管理情報のファイルをアクセス対象のファイルとして選択する。
If it is determined that there is file management information having the file identification information of the currently selected file in the search process (step S2, YES), the
If it is determined by this determination that there are a plurality of file management information having the same file identification information as the current file (step S4, YES), the
たとえば、図6に示すように、ファイル識別情報が「01」のファイル管理情報が複数存在する場合、上記CPU101は、選択されているファイルのファイル識別情報が「01」であれば、上記ステップS1〜S5の処理として、ファイル識別情報が「01」で、かつ、使用順位情報が「01」のファイルをアクセス対象のファイルとして選択する。
For example, as shown in FIG. 6, when there are a plurality of file management information having file identification information “01”, the
なお、カレントファイルのファイル識別情報を有するファイル管理情報が1つのみである場合、当該APPEND RECORD Commandがアクセス対象とするファイルとして選択可能なファイルは、1つのみである。この場合、図7に示す処理の流れでは、当該ファイルを使用順位「01」として処理するようにすれば良い。 When there is only one file management information having file identification information of the current file, only one file can be selected as a file to be accessed by the APPEND RECORD Command. In this case, in the processing flow shown in FIG. 7, the file may be processed with the usage order “01”.
上記のような処理によりアクセス対象とするファイルが選択されると、上記CPU101は、選択したファイル内に新たなレコードが追加可能であるか否かを判断する(ステップS6)。言い換えれば、上記ステップS6において、上記CPU101は、選択したファイル内に追記可能な空きのレコード(空き領域)が存在するか否かを判定する処理を行う。
When a file to be accessed is selected by the above process, the
たとえば、1つのファイルに格納可能なレコードの最大数が254個である場合、上記CPU101は、上記ステップS6の処理として、使用順位情報が「01」のファイル内にレコード番号「1」〜「254」の「254」個のレコードが書込み済であるか否かを判定する。
For example, when the maximum number of records that can be stored in one file is 254, the
上記判定により選択したファイルに新たなレコードが追記可能であると判定した場合(ステップS6、YES)、上記CPU101は、受信したAPPEND RECORD Commandで指定されている追記すべきデータ(追記データ)を当該ファイル内の新たなレコードとして書込む処理を行う(ステップS7)。このような追記データのデータ書込み処理が成功した場合(ステップS8、YES)、上記CPU101は、当該APPEND RECORD Commandに対する処理結果として、正常終了を示すレスポンスをICカードリーダライタ2へ送信し、処理を終了する。また、上記追記データのデータ書込みが失敗した場合(ステップS8、NO)、上記CPU101は、当該APPEND RECORD Commandに対する処理結果として、データの書込み失敗を示すレスポンスをICカードリーダライタ2へ送信し、当該APPEND RECORD Commandに対する処理をエラー終了とする(ステップS9)。
When it is determined that a new record can be added to the selected file by the above determination (step S6, YES), the
また、上記判定により選択したファイルに新たなレコードが追記できないと判定した場合(ステップS6、NO)、上記CPU101は、ファイル識別情報が選択したファイルのファイル識別情報と同様で、かつ、使用順位が選択したファイルの次であるファイル管理情報を検索する(ステップS10)。
If it is determined that a new record cannot be added to the selected file by the above determination (step S6, NO), the
たとえば、図6に示すように、ファイル識別情報が「01」のファイル管理情報が複数存在する場合、上記CPU101は、選択されているファイルのファイル識別情報が「01」で、かつ、使用順位情報が「01」あれば、上記ステップS10の処理として、ファイル識別情報が「01」で、かつ、使用順位情報が「02」のファイルをアクセス対象のファイルとして選択する。
For example, as shown in FIG. 6, when there are a plurality of file management information having file identification information “01”, the
上記検索処理により次の使用順位のファイルが存在しないと判定した場合(ステップS11、NO)、上記CPU101は、空きレコードなしのためエラーであることを示すレスポンス(応答)をICカードリーダライタ2へ送信し、エラー終了とする(ステップS12)。上記ステップS12の処理は、選択されたファイル識別情報のファイルには既に最大数のレコードが格納されているため、データの追記(つまり、レコードの追加)ができない状態であることを当該APPEND RECORD Commandの送信元に通知する処理である。
If it is determined by the search process that a file having the next usage order does not exist (step S11, NO), the
また、上記検索処理により次の使用順位のファイルが検出された場合(ステップS11、YES)、上記CPU101は、検出した次の使用順位のファイルをアクセス対象のファイルとして選択し、上記ステップS6と同様に、選択したファイル内に新たなレコードが追加可能であるか否かを判定する(ステップS13)。
When the next usage order file is detected by the search process (step S11, YES), the
上記判定により選択したファイルに新たなレコードが追記可能であると判定した場合(ステップS13、YES)、上記CPU101は、受信したAPPEND RECORD Commandで指定されている追記すべきデータ(追記データ)を当該ファイル内の新たなレコードとして書込む処理を行う(ステップS7)。このような追記データのデータ書込み処理が成功した場合(ステップS8、YES)、上記CPU101は、当該APPEND RECORD Commandに対する処理結果として、正常終了を示すレスポンスをICカードリーダライタ2へ送信し、処理を終了する。また、上記追記データのデータ書込みが失敗した場合(ステップS8、NO)、上記CPU101は、当該APPEND RECORD Commandに対する処理結果として、データの書込み失敗を示すレスポンスをICカードリーダライタ2へ送信し、当該APPEND RECORD Commandに対する処理をエラー終了とする(ステップS9)。
When it is determined that a new record can be added to the selected file by the above determination (step S13, YES), the
また、上記判定により選択したファイルに新たなレコードが追記できないと判定した場合(ステップS13、NO)、上記CPU101は、上記ステップS10へ戻り、上述した処理を繰り返し実行する。たとえば、使用順位情報が「2」のファイル内にも最大数のレコード(レコード番号「1」〜「254」までの全レコード)が格納されている場合、上記CPU101は、ステップS10に戻り、さらに、次の使用順位である使用順位情報が「3」のファイル定義情報を検索する処理を行う。
If it is determined that a new record cannot be added to the file selected by the determination (step S13, NO), the
上記のように、ICカードは、APPEND RECORD Commandを受信した場合、カレントファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報を有するファイル管理情報を検索する。使用順位が第1位のファイル管理情報を検出すると、上記ICカードは、使用順位が第1位のファイル管理情報で定義されているファイルに空きレコードがあるか否かを判定する。この判定により使用順位が第1位のファイルに空きレコードがないと判定した場合、上記ICカードは、使用順位が第2位となる使用順位情報を有するファイル管理情報を再検索する。使用順位が第2位となる使用順位情報を検出すると、上記ICカードは、使用順位が第2位となる使用順位情報で定義されているファイルに空きレコードがあるか否かを判定する。この判定により使用順位が第2位のファイルに空きレコードが存在すると判定した場合、上記ICカードは、使用順位が第2位のファイルにおける空きレコードにデータを書き込む。 As described above, when the IC card receives the APPEND RECORD Command, the IC card searches for file management information having usage order information with the usage order being first among the file management information having file identification information of the current file. When the file management information with the first usage order is detected, the IC card determines whether there is an empty record in the file defined by the file management information with the first usage order. If it is determined that there is no empty record in the file with the first use rank, the IC card re-searches the file management information having the use rank information with the second use rank. When the usage order information with the second usage rank is detected, the IC card determines whether there is an empty record in the file defined by the usage rank information with the second usage rank. If it is determined that there is an empty record in the file with the second highest usage order, the IC card writes data to the empty record in the file with the second highest usage order.
すなわち、APPEND RECORD Commandを受信したICカードは、使用順位が第1位のファイルに空きレコードがない場合、使用順位が第2位のファイルにおける空きレコードにデータを追記する。このような処理により、上記ICカードでは、1つのファイル識別情報でアクセス可能なレコードとして、1つのファイルにおける規定の最大レコード数を超える数のレコードを書き込むことが可能となる。また、同一のファイル識別情報を有する複数のファイルは、コマンドの送信元である外部装置には1つのファイルとして認識される。従って、外部装置からすると、規定のコマンドで、規定の最大レコード数を超えるレコードをICカードのカレントファイルに書き込むことができる。 That is, when there is no empty record in the file with the first usage order, the IC card that has received APPEND RECORD Command appends data to the empty record in the file with the second highest usage order. By such processing, the IC card can write more records than the specified maximum number of records in one file as records accessible by one file identification information. A plurality of files having the same file identification information are recognized as one file by the external device that is the command transmission source. Therefore, from an external device, a record exceeding the specified maximum number of records can be written to the current file of the IC card with a specified command.
次に、ICカード1における第2の処理例としてREAD RECORD Command(C1)に対する処理の流れについて説明する。
図8は、上記ICカード1におけるREAD RECORD Command(C1)に対する処理の流れを説明するためのフローチャートである。
READ RECORD Command(C1)では、レコード構造のデータファイルに対して読み出すべきデータのレコードを指定する方法として、レコード番号を指定する方法と、カレントレコードの前のレコードあるいは次のレコードを指定する方法とがある。なお、カレントレコードを示す情報は、たとえば、RAM103などのメモリに保持され、各レコードへのアクセスに伴って随時更新されるものであるものとする。
Next, a flow of processing for the READ RECORD Command (C1) will be described as a second processing example in the IC card 1.
FIG. 8 is a flowchart for explaining the flow of processing for the READ RECORD Command (C1) in the IC card 1.
In the READ RECORD Command (C1), as a method of designating a record of data to be read out with respect to a data file having a record structure, a method of designating a record number, a method of designating a record before or after the current record, There is. Note that information indicating the current record is held in a memory such as the
以下の説明では、READ RECORD Command(C1)でアクセス対象とするファイル(カレントファイル)は、図6に示すようなファイル識別情報「01」を持つ可変長順編成レコード構造を持つエレメンタリファイルであるものとする。さらに、READ RECORD Commandで読み出すべきデータは、カレントレコードを基準に次のレコードを読み出すことを要求するコマンドであるものとする。なお、使用順位が第1位のファイルにおける指定レコードから最終レコードまでの一括読出を要求する読出コマンド、あるいは、カレントレコードから最終レコードまでの一括読出を要求する読出コマンドに対する処理は、各レコードのデータを読出するための処理として、図8に示すような処理を繰り返し実行することにより実現できるものである。 In the following description, the file (current file) to be accessed in the READ RECORD Command (C1) is an elementary file having a variable-length sequential record structure having file identification information “01” as shown in FIG. Shall. Furthermore, it is assumed that the data to be read by the READ RECORD Command is a command requesting to read the next record based on the current record. The processing for the read command for requesting batch reading from the designated record to the last record in the file having the highest usage order, or the read command for requesting batch reading from the current record to the last record is performed on the data of each record. Can be realized by repeatedly executing a process as shown in FIG.
上記ICカード1は、上記ICカードリーダライタ2からの電源供給を受けて活性化される。活性化されたICカード1では、上記ICカードリーダライタ2からのコマンドが受信可能となる。この状態において、上記ICカード1は、上記ICカードリーダライタ2からコマンドを受信する。上記ICカードリーダライタ2からコマンドを受信すると、上記ICカード1のCPU101は、受信したコマンドを判別する処理を行う。この場合、上記CPU101は、コマンドを判別する処理により受信したコマンドがREAD RECORD Commandであることを判別するものとする。上記ICカードリーダライタ2から受信したコマンドがREAD RECORD Commandであると判定した場合、上記ICカード1のCPU101は、図8に示すような流れの処理を実行する。
The IC card 1 is activated upon receiving power supply from the IC card reader /
すなわち、上記READ RECORD Commandを受信すると、上記CPU101は、上記データメモリ102に格納されている複数のファイル管理情報から、現在選択状態となっているファイル(カレントファイル)のファイル識別情報を有するファイル管理情報を検索する(ステップS21)。この検索処理によりカレントファイルのファイル識別情報を有するファイル管理情報が存在しないと判定した場合(ステップS22、NO)、上記CPU101は、当該READ RECORD Commandに対する処理結果として、ファイルなしのエラーであることを示すレスポンス(応答)をICカードリーダライタ2へ送信し、当該READ RECORD Commandに対する処理をエラー終了とする(ステップS23)。
That is, when the READ RECORD Command is received, the
上記検索処理において現在選択されているファイルのファイル識別情報を有するファイル管理情報が存在すると判定した場合(ステップS22、YES)、上記CPU101では、現在選択状態となっているファイルのファイル識別情報と同一なファイル識別情報のファイル管理情報が複数存在するか否かを判定する(ステップS24)。
この判定によりカレントファイルと同一のファイル識別情報を有するファイル管理情報が複数存在すると判定した場合(ステップS24、YES)、上記CPU101は、それらのファイル管理情報のうち使用順位情報が最上位の使用順位となっているファイル管理情報のファイルをアクセス対象のファイルとして選択する(ステップS25)。また、カレントファイルのファイル識別情報を有するファイル管理情報が1つのみである場合(ステップS24、NO)、上記CPU101は、当該ファイル管理情報のファイルをアクセス対象のファイルとして選択する。
If it is determined in the search process that file management information having file identification information of the currently selected file exists (step S22, YES), the
When it is determined by this determination that there are a plurality of file management information having the same file identification information as the current file (step S24, YES), the
たとえば、図6に示すように、ファイル識別情報が「01」のファイル管理情報が複数存在する場合、上記CPU101は、カレントファイルのファイル識別情報が「01」であれば、上記ステップS21〜S25の処理として、ファイル識別情報が「01」で、かつ、使用順位情報が「01」のファイルをアクセス対象のファイルとして選択する。
For example, as shown in FIG. 6, when there are a plurality of file management information having file identification information “01”, the
なお、カレントファイルのファイル識別情報を有するファイル管理情報が1つのみである場合、当該READ RECORD Commandがアクセス対象とするファイルとして選択可能なファイルは、1つのみである。この場合、図8に示す処理の流れでは、当該ファイルを使用順位「01」として処理するようにすれば良い。 When there is only one file management information having file identification information of the current file, only one file can be selected as a file to be accessed by the READ RECORD Command. In this case, in the processing flow shown in FIG. 8, the file may be processed with the usage order “01”.
上記のような処理によりアクセス対象とするファイルが選択されると、上記CPU101は、カレントレコードを示す情報をRAM103から取得する。上記CPU101は、RAM103から取得したカレントレコードを示す情報に基づいて当該READ RECORD Commandで指定されたレコードのレコード番号を判定する(ステップS26)。すなわち、当該READ RECORD Commandがカレントレコードの次のレコードを指定する場合、上記CPU101は、RAM103から取得したカレントレコードを示す情報に基づいてカレントレコードの次のレコードを特定する。
When a file to be accessed is selected by the processing as described above, the
たとえば、カレントレコードは、各ファイル内におけるレコード番号と各ファイルの使用順位を示す情報との組合せで示すようにしても良いし、各ファイル内の全レコードに通し番号を付与するようにしても良い。ただし、本実施の形態では、所定の規格で規定されている制限内でコマンドを運用(既存のコマンドを仕様を変更せずに使用)することを想定している。このため、コマンドでは、直接的に使用順位情報が「2」以降のファイルにおけるレコードを直接的に指定することはできない。しかし、カレントレコードを示す情報は、ICカード内部で保持する情報であるため、使用順位が「2」以降のファイルにおけるレコードもカレントレコードとして保持することが可能である。たとえば、カレントレコードを示す情報は、使用順位が「n」のファイルにおける各レコードのレコード番号を「1+(各ファイルの最大レコード数)×(n−1)」〜「最大レコード数+(各ファイルの最大レコード数)×(n−1)」と定義することが可能である。この場合、カレントレコードの次のレコードは、レコード番号がカレントレコード番号+1であると判定される。 For example, the current record may be indicated by a combination of a record number in each file and information indicating the usage order of each file, or a serial number may be assigned to all records in each file. However, in the present embodiment, it is assumed that the command is operated within a limit defined by a predetermined standard (an existing command is used without changing the specification). For this reason, in the command, it is not possible to directly specify a record in a file whose usage order information is “2” or later. However, since the information indicating the current record is information held in the IC card, records in files whose usage order is “2” or later can also be held as the current record. For example, the information indicating the current record includes the record number of each record in the file whose usage order is “n” from “1+ (maximum number of records in each file) × (n−1)” to “maximum number of records + (each file The maximum number of records) × (n−1) ”can be defined. In this case, it is determined that the record number next to the current record is the current record number + 1.
当該READ RECORD Commandで指定されたレコード番号(カレントレコードの次のレコード番号)を判定すると、上記CPU101は、現在選択しているファイル(たとえば、ファイル識別番号が「01」で、かつ、使用順位情報が「01」のファイル)内に指定されたレコード番号のレコードが存在するか否かを判定する(ステップS27)。
When determining the record number specified in the READ RECORD Command (the record number next to the current record), the
たとえば、使用順位が「n」のファイルにおける各レコードのレコード番号が「1+254×(n−1)」〜「254+254×(n−1)」と定義される場合、上記CPU101は、レコード番号が255以上であるか否かにより、指定されたレコードが使用順位「1」のファイルに存在するか否かが判定できる。なお、判定したレコード番号が254以下の場合、上記CPU101は、使用順位が「01」のファイル内に指定されたレコード番号が存在するか否かを判定する。
For example, when the record number of each record in the file having the usage order “n” is defined as “1 + 254 × (n−1)” to “254 + 254 × (n−1)”, the
上記判定により選択されているファイルに指定されたレコードが存在すると判定した場合(ステップS27、YES)、上記CPU101は、受信したREAD RECORD Commandで指定されているレコード番号のデータを読み出す処理を行う(ステップS28)。このようなデータの読出処理が成功した場合(ステップS29、YES)、上記CPU101は、当該READ RECORD Commandに対する処理結果として、読出したデータと正常終了を示す情報とをレスポンスとしてICカードリーダライタ2へ送信し、処理を終了する。
When it is determined that the specified record exists in the file selected by the determination (step S27, YES), the
また、上記データの読出し処理が失敗した場合(ステップS29、NO)、上記CPU101は、当該READ RECORD Commandに対する処理結果として、データの読出し失敗を示すレスポンスをICカードリーダライタ2へ送信し、当該READ RECORD Commandに対する処理をエラー終了とする(ステップS30)。
If the data reading process fails (step S29, NO), the
また、上記判定により選択されているファイルに指定されたレコードが存在しないと判定した場合(ステップS27、NO)、上記CPU101は、カレントファイルと同一のファイル識別情報で、かつ、使用順位が次のファイル管理情報を検索する(ステップS31)。
Further, when it is determined that the specified record does not exist in the file selected by the determination (step S27, NO), the
たとえば、図6に示すように、ファイル識別情報が「01」のファイル管理情報が複数存在する場合、上記CPU101は、選択しているファイルのファイル識別情報が「01」で、かつ、使用順位情報が「01」あれば、上記ステップS31の処理として、ファイル識別情報が「01」で、かつ、使用順位情報が「02」のファイルをアクセス対象のファイルとして選択する。
For example, as shown in FIG. 6, when there are a plurality of file management information having file identification information “01”, the
上記検索処理により次の使用順位のファイルが存在しないと判定した場合(ステップS32、NO)、上記CPU101は、指定されたレコードなしのためエラーであることを示すレスポンス(応答)をICカードリーダライタ2へ送信し、エラー終了とする(ステップS33)。上記ステップS33の処理は、選択されたファイルは存在するが、選択されたファイル内に指定されたレコードが存在しないことを示すレスポンスを送信する処理である。
If it is determined by the search process that a file with the next usage order does not exist (step S32, NO), the
また、上記検索処理により次の使用順位のファイルが検出された場合(ステップS32、YES)、上記CPU101は、検出した次の使用順位のファイルをアクセス対象のファイルとして選択し、上記ステップS27と同様に、選択したファイル内に指定されたレコードが存在するか否かを判定する(ステップS34)。
If the next usage order file is detected by the search process (step S32, YES), the
上記判定により選択したファイルに指定されたレコードが存在すると判定した場合(ステップS34、YES)、上記CPU101は、上記ステップS28へ進み、指定されたレコードのデータを読み出す処理を行う。データの読出し処理が成功した場合(ステップS29、YES)、上記CPU101は、読み出したデータと正常終了を示す情報とをレスポンスとしてICカードリーダライタ2へ送信し、処理を終了する。また、データの読出しが失敗した場合(ステップS29、NO)、上記CPU101は、データの読出し失敗を示すレスポンスをICカードリーダライタ2へ送信し、当該READ RECORD Commandに対する処理をエラー終了とする(ステップS30)。
When it is determined that the specified record exists in the file selected by the determination (step S34, YES), the
また、上記判定により選択したファイルに指定されたレコードが存在しないと判定した場合(ステップS34、NO)、上記CPU101は、上記ステップS31へ戻り、上述した処理を繰り返し実行する。これにより、上記CPU101は、使用順位の順番に、カレントファイルと同一のファイル識別情報のファイルから指定されたレコードを検索する処理が可能となる。
If it is determined that the specified record does not exist in the file selected by the determination (step S34, NO), the
上記のように、本実施の形態のICカードは、READ RECORD Commandを受信した場合、カレントファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報を有するファイル管理情報を検索する。使用順位が第1位のファイル管理情報を検出すると、上記ICカードは、使用順位が第1位のファイル管理情報で定義されているファイルに読み出すべきレコードがあるか否かを判定する。この判定により使用順位が第1位のファイルに読み出すべきレコードがないと判定した場合、上記ICカードは、使用順位が第2位となる使用順位情報を有するファイル管理情報を再検索する。使用順位が第2位となる使用順位情報を検出すると、上記ICカードは、使用順位が第2位となる使用順位情報で定義されているファイルに読み出すべきレコードがあるか否かを判定する。この判定により使用順位が第2位のファイルに読み出すべきレコードが存在すると判定した場合、上記ICカードは、使用順位が第2位のファイルにおける読み出すべきレコードのデータを読み出す。 As described above, when the IC card of the present embodiment receives the READ RECORD Command, the file management having the usage order information that uses the first place among the file management information having the file identification information of the current file. Search for information. When the file management information with the first usage order is detected, the IC card determines whether there is a record to be read in the file defined by the file management information with the first usage order. When it is determined by this determination that there is no record to be read in the file with the first usage rank, the IC card re-searches the file management information having the usage rank information with the second usage rank. When the usage order information with the second usage order is detected, the IC card determines whether there is a record to be read in the file defined by the usage order information with the second usage order. If it is determined by this determination that there is a record to be read in the file with the second highest usage order, the IC card reads the data of the record to be read in the second highest priority file.
すなわち、READ RECORD Commandを受信したICカードは、使用順位の順に、各ファイルから読み出すべきレコードがあるか否かを判定することにより、使用順位が第2位以降のファイルにおけるレコードのデータも読み出すことが可能となる。このような処理により、上記ICカードでは、1つのファイル識別情報でアクセス可能なレコードが1つのファイルにおける規定の最大レコード数を超える場合であっても、所望のレコードを読み出すことが可能となる。 In other words, the IC card that has received the READ RECORD Command also reads out the record data in the second and subsequent files by determining whether there is a record to be read from each file in the order of use. Is possible. By such processing, the IC card can read out a desired record even when the record accessible by one file identification information exceeds the prescribed maximum number of records in one file.
また、READ RECORD Commandでは、読出し対象とするレコードを、カレントレコードを基準として指定することが可能である。たとえば、READ RECORD Commandでは、読出し対象とするレコードをカレントレコードの次のレコードと指定することが可能である。また、カレントレコードを示す情報は、ICカード内で保持される情報である。このため、ICカードでは、使用順位が第2位以降のファイルにおけるレコードをカレントレコードとすることも可能である。つまり、ICカード内において同一のファイル識別情報を有する複数のファイルを1つのファイルとして認識する外部装置であっても、カレントレコードを基準に読出し対象とするレコードを指定することにより、所定の規格で規定されたREAD RECORD Commandの仕様を変更することなく、使用順位が第2位以降のファイルにおけるレコードのデータを読出しを要求することが可能である。 In the READ RECORD Command, it is possible to specify a record to be read with reference to the current record. For example, in the READ RECORD Command, it is possible to specify a record to be read as a record next to the current record. Information indicating the current record is information held in the IC card. For this reason, in the IC card, it is possible to set a record in a file whose usage order is second or higher as the current record. In other words, even in an external device that recognizes a plurality of files having the same file identification information in an IC card as one file, by specifying a record to be read based on the current record, a predetermined standard can be used. It is possible to request reading of record data in a file whose usage order is second or higher without changing the specification of the specified READ RECORD Command.
上記のように、本実施の形態では、たとえば、国際標準化規格のISO/IEC7816−4などの所定の規格で規定されたAPPEND RECORD CommandあるいはREAD RECORD Commandの仕様を変更することなく、規格上の最大値であるレコード番号「254」を超えるレコードを1つのファイル識別情報で管理することができる。 As described above, in the present embodiment, for example, the specification of the APPEND RECORD Command or the READ RECORD Command specified in a predetermined standard such as the international standard ISO / IEC7816-4 is not changed, and the maximum in the standard is changed. Records exceeding the record number “254”, which is a value, can be managed with one file identification information.
なお、上述した実施の形態は、使用順位の数、各ファイル内の最大レコード数、ファイル種別などを限定するものではない。すなわち、使用順位だけが異なるファイル管理情報は、任意の数のファイルを定義できる。たとえば、使用順位だけが異なるファイルを10個定義した場合、それらのファイル定義情報では、使用順位情報として、「1」〜「10」の値が順に設定される。また、最大レコード数は、「254」に限らず、任意の数に対して適用できる。また、ファイル種別としては、レコード構造のファイルであれば、上記実施の形態を適用できる。たとえば、可変長順編成レコード構造以外の構造のファイルにも、上記実施の形態を適用できる。 The embodiment described above does not limit the number of usage orders, the maximum number of records in each file, the file type, and the like. That is, any number of files can be defined as file management information that differs only in the order of use. For example, when ten files differing only in the use order are defined, values “1” to “10” are sequentially set as the use order information in the file definition information. Further, the maximum number of records is not limited to “254”, but can be applied to any number. As the file type, any of the above embodiments can be applied as long as the file has a record structure. For example, the above embodiment can be applied to a file having a structure other than the variable length sequential record structure.
1…ICカード(携帯可能電子装置)、2…ICカードリーダライタ(外部装置)、10…ICチップ、M…モジュール、B…本体、11…インターフェース、12…データメモリ、101…CPU、102…データメモリ、103…RAM、104…ROM、106…通信制御部。 DESCRIPTION OF SYMBOLS 1 ... IC card (portable electronic device), 2 ... IC card reader / writer (external device), 10 ... IC chip, M ... Module, B ... Main body, 11 ... Interface, 12 ... Data memory, 101 ... CPU, 102 ... Data memory, 103... RAM, 104... ROM, 106.
Claims (13)
同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報を記憶する第2のメモリと、
外部装置からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定する第1のアクセス判定部と、
前記第1の判定部により前記第1のファイルがアクセス対象とならないと判定された場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定する第2のアクセス判定部と、
前記第1あるいは第2のアクセス判定部によりアクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う処理部と、
を有することを特徴とする携帯可能電子装置。 A first memory for storing file-unit data;
A second memory for storing a plurality of file management information having the same file identification information and different usage order information set;
When the command is given from the external device, the first file defined by the file management information of the usage order information that has the first usage order among the file management information having the file identification information of the file to be accessed A first access determination unit that determines whether or not to be an access target;
When the first determination unit determines that the first file is not an access target, the usage order information indicates that the usage order is second among the file management information having the file identification information of the file to be accessed. A second access determination unit that determines whether or not the second file defined in the file management information is to be accessed;
A processing unit that performs processing according to a command on a file determined to be an access target by the first or second access determination unit;
A portable electronic device comprising:
前記第1のアクセス判定部は、前記第1のファイル内にデータを追記するための空き領域が存在するか否かにより第1のファイルをアクセス対象とするか否かを判定し、
前記第2のアクセス判定部は、前記第2のファイル内にデータを追記するための空き領域が存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項1に記載の携帯可能電子装置。 The command is an additional write command for requesting additional data,
The first access determination unit determines whether or not the first file is to be accessed based on whether or not there is a free area for adding data to the first file,
The second access determination unit determines whether or not the second file is to be accessed depending on whether or not there is a free area for adding data to the second file.
The portable electronic device according to claim 1, wherein the portable electronic device is a portable electronic device.
前記第1のアクセス判定部は、前記第1のファイル内にデータを格納するための空きレコードが存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のアクセス判定部は、前記第2のファイル内にデータを格納するための空きレコードが存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項1に記載の携帯可能電子装置。 The file to be accessed is a file having a record structure,
The first access determination unit determines whether or not the first file is to be accessed according to whether or not there is an empty record for storing data in the first file,
The second access determination unit determines whether or not the second file is to be accessed depending on whether or not there is an empty record for storing data in the second file.
The portable electronic device according to claim 1, wherein the portable electronic device is a portable electronic device.
前記第1のアクセス判定部は、前記第1のファイル内に読み出すべきデータの記憶領域が存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のアクセス判定部は、前記第2のファイル内に読み出すべきデータの記憶領域が存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項1に記載の携帯可能電子装置。 The command is a read command for requesting reading of data,
The first access determination unit determines whether or not the first file is to be accessed according to whether or not a storage area for data to be read exists in the first file,
The second access determination unit determines whether or not the second file is to be accessed depending on whether or not a storage area for data to be read exists in the second file.
The portable electronic device according to claim 1, wherein the portable electronic device is a portable electronic device.
前記第1のアクセス判定部は、前記第1のファイル内に読み出すべきデータが格納されているレコードが存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のアクセス判定部は、前記第2のファイル内に読み出すべきデータが格納されているレコードが存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項1に記載の携帯可能電子装置。 The file to be accessed is a file having a record structure,
The first access determination unit determines whether or not the first file is to be accessed depending on whether or not there is a record storing data to be read in the first file,
The second access determination unit determines whether or not the second file is to be accessed based on whether or not there is a record in which data to be read is stored in the second file.
The portable electronic device according to claim 1, wherein the portable electronic device is a portable electronic device.
前記コマンドは、データを読出すべきレコードがカレントレコードを基準に指定されている読出コマンドであり、
前記第1のアクセス判定部は、前記第3のメモリに記憶されているカレントレコードを基準として前記読出コマンドで指定されたレコードを特定し、その特定したレコードが前記第1のファイル内に存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のアクセス判定部は、前記第3のメモリに記憶されているカレントレコードを基準として前記読出コマンドで指定されたレコードを特定し、その特定したレコードが前記第2のファイル内に存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項5に記載の携帯可能電子装置。 Furthermore, it has the 3rd memory which memorizes the information which shows the current record,
The command is a read command in which a record from which data is to be read is specified based on the current record,
The first access determination unit identifies a record designated by the read command with reference to a current record stored in the third memory, and the identified record exists in the first file. Whether or not the first file is to be accessed according to whether or not
The second access determination unit specifies a record designated by the read command based on a current record stored in the third memory, and the specified record exists in the second file. It is determined whether or not the second file is to be accessed depending on whether or not
The portable electronic device according to claim 5, wherein:
ファイル単位のデータを第1のメモリに記憶しておき、
同一のファイル識別情報で、かつ、異なる使用順位情報が設定される複数のファイル管理情報を第2のメモリに記憶しておき、
外部装置からコマンドが与えられた場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第1位となる使用順位情報のファイル管理情報で定義されている第1のファイルをアクセス対象とするか否かを判定し、
前記第1のファイルがアクセス対象とならないと判定された場合、アクセス対象とするファイルのファイル識別情報を有するファイル管理情報のうち使用順位が第2位となる使用順位情報のファイル管理情報で定義されている第2のファイルをアクセス対象とするか否かを判定し、
前記判定によりアクセス対象とすると判定されたファイルに対してコマンドに応じた処理を行う、
ことを特徴とする携帯可能電子装置のファイル管理方法。 A file management method for a portable electronic device, comprising:
Store file unit data in the first memory,
A plurality of file management information having the same file identification information and different usage order information set is stored in the second memory,
When the command is given from the external device, the first file defined by the file management information of the usage order information that has the first usage order among the file management information having the file identification information of the file to be accessed Whether or not to access
When it is determined that the first file is not to be accessed, it is defined by the file management information of the usage order information in which the usage order is second among the file management information having the file identification information of the file to be accessed. To determine whether the second file is to be accessed,
Processing according to the command is performed on the file determined to be the access target by the determination.
A file management method for a portable electronic device.
前記第1のファイルをアクセス対象するか否かの判定は、前記第1のファイル内にデータを追記するための空き領域が存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のファイルをアクセス対象するか否かの判定は、前記第2のファイル内にデータを追記するための空き領域が存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項7に記載の携帯可能電子装置のファイル管理方法。 The command is an additional write command for requesting additional data,
Whether or not the first file is to be accessed is determined by whether or not the first file is to be accessed depending on whether or not there is a free area in the first file for adding data. Determine whether
Whether or not the second file is to be accessed is determined by whether or not the second file is to be accessed depending on whether or not there is a free area in the second file for adding data. To determine,
The file management method for a portable electronic device according to claim 7, wherein the file management method is a portable electronic device.
前記第1のファイルをアクセス対象とするか否かの判定は、前記第1のファイル内にデータを格納するための空きレコードが存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のファイルをアクセス対象とするか否かの判定は、前記第2のファイル内にデータを格納するための空きレコードが存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項7に記載の携帯可能電子装置のファイル管理方法。 The file to be accessed is a file having a record structure,
Whether the first file is to be accessed is determined based on whether there is an empty record for storing data in the first file. Determine whether or not
Whether the second file is to be accessed is determined based on whether there is an empty record for storing data in the second file or not. Determine whether or not
The file management method for a portable electronic device according to claim 7, wherein the file management method is a portable electronic device.
前記第1のファイルをアクセス対象とするか否かの判定は、前記第1のファイル内に読み出すべきデータの記憶領域が存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のファイルをアクセス対象とするか否かの判定は、前記第2のファイル内に読み出すべきデータの記憶領域が存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項7に記載の携帯可能電子装置のファイル管理方法。 The command is a read command for requesting reading of data,
Whether or not the first file is to be accessed is determined by whether or not the first file is to be accessed depending on whether or not a storage area for data to be read exists in the first file. Determine
Whether or not the second file is to be accessed is determined by whether or not the second file is to be accessed depending on whether or not a storage area for data to be read exists in the second file. Determine
The file management method for a portable electronic device according to claim 7, wherein the file management method is a portable electronic device.
前記第1のファイルをアクセス対象とするか否かの判定は、前記第1のファイル内に読み出すべきデータが格納されているレコードが存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のファイルをアクセス対象とするか否かの判定は、前記第2のファイル内に読み出すべきデータが格納されているレコードが存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する、
ことを特徴とする前記請求項7に記載の携帯可能電子装置のファイル管理方法。 The file to be accessed is a file having a record structure,
Whether or not the first file is to be accessed is determined based on whether or not there is a record storing data to be read in the first file. Whether or not
Whether or not the second file is to be accessed is determined based on whether or not there is a record storing data to be read in the second file. Whether or not
The file management method for a portable electronic device according to claim 7, wherein the file management method is a portable electronic device.
前記コマンドは、データを読出すべきレコードがカレントレコードを基準に指定されている読出コマンドであり、
前記第1のファイルをアクセス対象とするか否かの判定は、前記第3のメモリに記憶されているカレントレコードを基準として前記読出コマンドで指定されたレコードを特定し、その特定したレコードが前記第1のファイル内に存在するか否かにより前記第1のファイルをアクセス対象とするか否かを判定し、
前記第2のファイルをアクセス対象とするか否かの判定は、前記第3のメモリに記憶されているカレントレコードを基準として前記読出コマンドで指定されたレコードを特定し、その特定したレコードが前記第2のファイル内に存在するか否かにより前記第2のファイルをアクセス対象とするか否かを判定する。
ことを特徴とする前記請求項11に記載の携帯可能電子装置のファイル管理方法。 Further, information indicating the current record is stored in the third memory,
The command is a read command in which a record from which data is to be read is specified based on the current record,
Whether the first file is to be accessed is determined by specifying the record specified by the read command based on the current record stored in the third memory, and the specified record is It is determined whether or not the first file is to be accessed according to whether or not it exists in the first file,
The determination as to whether or not the second file is to be accessed is performed by specifying the record specified by the read command based on the current record stored in the third memory, and the specified record is Whether or not the second file is to be accessed is determined based on whether or not it exists in the second file.
The file management method of the portable electronic device according to claim 11, wherein the file management method is a file management method.
前記モジュールを収納した本体と、を有する、
ことを特徴とするICカード。 A command is given from an external device, a first memory that stores data in units of files, a second memory that stores a plurality of file management information having the same file identification information and different usage order information, and If the first file defined in the file management information of the usage order information that has the first usage order among the file management information having the file identification information of the file to be accessed, is the access target? A first access determination unit that determines whether or not the file management information includes file identification information of a file to be accessed when the first determination unit determines that the first file is not an access target The second file defined in the file management information of the usage order information that has the second highest usage order is the access target. A second access determination unit that determines whether or not, and a processing unit that performs a process according to a command on a file determined to be an access target by the first or second access determination unit When,
A main body containing the module,
IC card characterized by that.
Priority Applications (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008170228A JP2009032249A (en) | 2007-07-03 | 2008-06-30 | Portable electronic device, file management method for portable electronic device, and IC card |
| SG200805078-3A SG148989A1 (en) | 2007-07-03 | 2008-07-02 | Portable electronic device and file management method for use in portable electronic device |
| US12/166,606 US20090012975A1 (en) | 2007-07-03 | 2008-07-02 | Portable electronic device and file management method for use in portable electronic device |
| FR0854518A FR2918483A1 (en) | 2007-07-03 | 2008-07-03 | PORTABLE ELECTRONIC DEVICE AND FILE MANAGEMENT METHOD FOR USE IN A PORTABLE ELECTRONIC DEVICE |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007175565 | 2007-07-03 | ||
| JP2008170228A JP2009032249A (en) | 2007-07-03 | 2008-06-30 | Portable electronic device, file management method for portable electronic device, and IC card |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2009032249A true JP2009032249A (en) | 2009-02-12 |
Family
ID=40402643
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008170228A Withdrawn JP2009032249A (en) | 2007-07-03 | 2008-06-30 | Portable electronic device, file management method for portable electronic device, and IC card |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2009032249A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20180022894A (en) * | 2015-06-30 | 2018-03-06 | 아이데미아 프랑스 | Electronic units and methods performed in such electronic devices |
-
2008
- 2008-06-30 JP JP2008170228A patent/JP2009032249A/en not_active Withdrawn
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20180022894A (en) * | 2015-06-30 | 2018-03-06 | 아이데미아 프랑스 | Electronic units and methods performed in such electronic devices |
| KR102593255B1 (en) | 2015-06-30 | 2023-10-25 | 아이데미아 프랑스 | Electronic units and methods performed in these electronic devices |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5329884B2 (en) | Portable electronic device and data processing method in portable electronic device | |
| RU2607622C2 (en) | Recording of data into smart card nonvolatile memory | |
| US20100205149A1 (en) | Mobile electronic apparatus and data management method in mobile electronic apparatus | |
| JP5843674B2 (en) | IC card, portable electronic device, and control method of IC card | |
| EP2278501B1 (en) | Smartcard for portable electronic device | |
| US20090012975A1 (en) | Portable electronic device and file management method for use in portable electronic device | |
| US8977824B2 (en) | Portable electronic apparatus and method of controlling a portable electronic apparatus | |
| EP2128803B1 (en) | Information storage medium and medium processing system | |
| JP2009032249A (en) | Portable electronic device, file management method for portable electronic device, and IC card | |
| JP2010211516A (en) | Portable electronic device and access control method in the same | |
| JP7005934B2 (en) | Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program | |
| US7343452B2 (en) | Apparatus for direct access to only specific lower hierarchy data in a nest structure | |
| JP2011191808A (en) | Mobile electronic apparatus, ic card, and control method for the mobile electronic apparatus | |
| JP6984328B2 (en) | Electronic information storage medium, IC card, external device, data writing method and data writing program | |
| JP7438432B1 (en) | Electronic information storage medium, IC chip, IC card, record writing method, and program | |
| US7346730B2 (en) | Mobile electronic device | |
| JP4738249B2 (en) | Portable electronic device, IC card and IC module | |
| JP2012133656A (en) | Portable electronic apparatus and ic card | |
| JP5957347B2 (en) | IC card and portable electronic device | |
| JP5075404B2 (en) | Portable electronic device, file access method and IC card in portable electronic device | |
| JP6015461B2 (en) | Information recording medium, data read / write method, and data read / write program | |
| JP6039036B2 (en) | IC card, portable electronic device, and control method of IC card | |
| KR101357518B1 (en) | Smartcard for storing file data in transient memory and operating file and file management method thereof | |
| JP2022187935A (en) | Secure element, electronic information storage medium and data update method | |
| JP2014006631A (en) | Ic card and portable electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A300 | Application deemed to be withdrawn because no request for examination was validly filed |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20110906 |