JPS62251992A - File control system for ic card - Google Patents

File control system for ic card

Info

Publication number
JPS62251992A
JPS62251992A JP61096163A JP9616386A JPS62251992A JP S62251992 A JPS62251992 A JP S62251992A JP 61096163 A JP61096163 A JP 61096163A JP 9616386 A JP9616386 A JP 9616386A JP S62251992 A JPS62251992 A JP S62251992A
Authority
JP
Japan
Prior art keywords
file
record
memory
area
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
JP61096163A
Other languages
Japanese (ja)
Inventor
Junji Seki
関 順二
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP61096163A priority Critical patent/JPS62251992A/en
Publication of JPS62251992A publication Critical patent/JPS62251992A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To obtain an IC card for which cyclical use of the file in a memory is made possible by providing a business area that stores the file in a memory, a directory for controlling the area of the file and controlling information in the directory. CONSTITUTION:An IC card has an incorporated CPU 1 and a memory 2, and the memory 2 has a business area ZA that stores a file and a directory ZD for controlling the file. The file 21 for physically (n) pieces of records of the area ZA is used cyclically, and by cyclical use of a file consisting of (n) pieces of records of fixed length, it appears as a file consisting of 65535 records when number of bytes allotted to logical record number is 2 bytes. Accordingly, though physically active record storing area is (n), it is possible to handle as if a memory space is expanded logically, and logical record number can be used up to 65535 against physical record number (n). In this constitution, recycle information 20 is given to the memory in the IC card and controlled by the CPU, and accordingly, an accessing device 3 can access in logical track number.

Description

【発明の詳細な説明】 〔目次〕 概要 産業上の利用分野 従来の技術 発明が解決しようとする問題点 問題点を解決するための手段(第1図)作用 実施例 (al−実施例の構成の説明 (第2図、第3図、第4図) (bl−実施例の動作の説明 (第5図、第6図、第7図、第8図) (C1他の実施例の説明 発明の効果 ((既要〕 プロセッサとメモリを内蔵したICカードにおいて、メ
モリにファイルを格納する業務領域と、ファイルの領域
管理のためのディレクトリを設けるとともに、ディレク
トリにファイルを循環使用するための制御情報を設ける
ことにより、メモリ内のファイルを循環使用するように
したものである。
[Detailed Description of the Invention] [Table of Contents] Overview Industrial Application Fields Conventional Technology Problems to be Solved by the Invention Means for Solving the Problems (Fig. 1) Working Examples (al-Configuration of Examples) (Fig. 2, Fig. 3, Fig. 4) (bl-Explanation of operation of embodiments (Fig. 5, Fig. 6, Fig. 7, Fig. 8)) (C1 Description of other embodiments Invention Effects ((Required)) In an IC card with a built-in processor and memory, a business area for storing files in memory and a directory for file area management are provided, and control information for circulating files in the directory is provided. By providing this, files in memory can be used cyclically.

〔産業上の利用分野〕[Industrial application field]

本発明は、プロセッサとメモリを内蔵したICカードに
おいて、メモリ内の履歴ファイル等のファイルを循環使
用できるようにしたファイル制御方式に関し、特にIC
カードのプロセッサによって循環使用制御できるように
したICカードのファイル制御方式に関する。
The present invention relates to a file control method that allows files such as history files in the memory to be used cyclically in an IC card that has a built-in processor and memory, and in particular to an IC card that has a built-in processor and memory.
The present invention relates to a file control method for an IC card that enables cyclic use to be controlled by the card's processor.

利用者が種々のサービスを受けるためのカードとして広
く磁気ストライブ付カードが用いられており、銀行カー
ド、クレジットカード等として利用されている。
2. Description of the Related Art Cards with magnetic stripes are widely used as cards for users to receive various services, and are used as bank cards, credit cards, and the like.

このような磁気ストライブ付カードでは、格納情報量が
少なく且つセキュリティの面でも十分でないことから、
近年IC化されたプロセッサとメモリを内蔵したICカ
ードが注目を浴びている。
Such cards with magnetic stripes store only a small amount of information and are not secure enough.
In recent years, IC cards with built-in IC processors and memory have been attracting attention.

このようなIcカードでは、IC化されたメモリによっ
て複数のサービスのための情報ファイルを格納でき、マ
ルチサービス用多機能カードとしての利用が回持されて
いる。
Such an IC card can store information files for a plurality of services using an IC memory, and is often used as a multi-function card for multi-services.

特に、ICカードのメモリ容量には限りがあり、多数の
ファイルを収容すると、そのファイル容量にも限りがあ
るから、係るファイルの有効利用が望まれている。
In particular, the memory capacity of an IC card is limited, and when a large number of files are stored, the file capacity is also limited, so it is desired to make effective use of such files.

〔従来の技術〕[Conventional technology]

ICカードは、第9図に示す如く、プロセッサ(CPU
)1とメモリ2を内蔵し、ICカードリーダ/ライタを
含むアクセス装W3にコンタクト等で接続され、アクセ
ス装置3との間でCPU1を介しデータのやりとりを行
う。
The IC card has a processor (CPU) as shown in Figure 9.
) 1 and a memory 2, and is connected to an access device W3 including an IC card reader/writer via contacts or the like, and exchanges data with the access device 3 via the CPU 1.

このICカードのメモリ2の格納領域は、単一サービス
のみの単機能カードでは、レイアウトフリーの固定フォ
ーマットのものが用いられていたが、アクセス装置3は
メモリ2の絶対アドレスを指定する必要がある他に、多
機能カードとして用いるには、レイアウトを予め固定的
に定めておく必要があるため、拡張性に欠けるという欠
点があった。これを解決するため、メモリ2の領域管理
を行うものが提案されている。
The storage area of the memory 2 of this IC card used a layout-free fixed format in single-function cards with only a single service, but the access device 3 needs to specify the absolute address of the memory 2. In addition, in order to use it as a multifunctional card, it is necessary to fix the layout in advance, so there is a drawback that it lacks expandability. In order to solve this problem, a method for managing the area of the memory 2 has been proposed.

この従来の提案においては、メモリ2のフォーマットと
して、PIN(個人識別番号)等システムに必要なデー
タを格納するシステムゾーンZSと、領域管理のための
ディレクトリゾーンZDと、業務情報ファイルの格納の
ための業務情報エリアZCと、H層情報ファイルの格納
のための履歴情報エリアZTとに分割されており、ディ
レクトリゾーンZDは全体領域管理部と、ZCjiJ¥
域管理部と、Z′F領域管理部とが設けられていた。
In this conventional proposal, the format of the memory 2 is a system zone ZS for storing data necessary for the system such as PIN (Personal Identification Number), a directory zone ZD for area management, and a system zone ZD for storing business information files. The directory zone ZD is divided into a business information area ZC and a history information area ZT for storing H-layer information files.
An area management department and a Z'F area management department were provided.

例えば、銀行POSアプリケーション(サービス)■に
対しては、銀行名、所有音名、口座番号等のサービスに
必要な業務情報は、業務エリアZCのファイルZCIに
、サービスを行った使用履歴(金額、使用日付等)は履
歴エリアZTのファイルZTIに格納され、以下クレジ
ットアプリ゛ケーション(サービス)■、ファーム・バ
ンキングアプリケーション(サービス)◎についても、
エリアZCのファイルZC3とエリアZTのファイルZ
T3が、エリアZCのファイルZC4とエリアZTのフ
ァイルZT4が対応付けされ、この対応は各々ディレク
トリゾーンZDのZC領域管理部とZ T 領域管理部
で管理するようにしていた。
For example, for a bank POS application (service) ■, the business information necessary for the service such as the bank name, ownership name, account number, etc. is stored in the file ZCI of the business area ZC. date of use, etc.) are stored in the file ZTI of the history area ZT, and also for the following credit application (service) ■ and firm banking application (service) ◎.
File ZC3 in area ZC and file Z in area ZT
T3, file ZC4 in area ZC, and file ZT4 in area ZT are associated with each other, and this correspondence is managed by the ZC area management unit and the Z T area management unit of the directory zone ZD, respectively.

このような領域管理を行えば、センターやターミナルの
アクセス装置3はメモリ2の物理(絶対)アドレスを意
識せずに、ファイルアクセスが可能となり、多機能サー
ビスが容易となり、システムの拡張性にも対応できると
いう利点があり、多機能サービスを行い易くなる。
If such area management is performed, the access device 3 of the center or terminal will be able to access files without being aware of the physical (absolute) address of the memory 2, facilitating multi-functional services and improving system expandability. This has the advantage of being compatible with other systems, making it easier to provide multi-functional services.

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

このようにメモリの領域管理を行えば、メモリ内のファ
イルの大きさは自由に設定出来、アプリケーションの要
求に応じてファイルの大きさを決定でき、柔軟性を持た
せることができる。
If the memory area is managed in this way, the size of the file in the memory can be set freely, and the file size can be determined according to the requirements of the application, providing flexibility.

しかしながら、多機能カードとして用いるには、多数の
ファイルをメモリに収容する必要があり、従って自ずと
ファイルの大きさも制限される。例えば、ファイルが第
10図に示す如く物理的にロケのレコードを収容出来る
大きさに設定される。
However, in order to use it as a multifunctional card, it is necessary to store a large number of files in the memory, which naturally limits the file size. For example, the file is set to a size that can physically accommodate location records as shown in FIG.

このようなファイル、特に使用履歴ファイルには、IC
カードでオフラインのクレジット取引や銀行PO3取引
毎にその使用履歴が順次レコードとして書込まれる。
Such files, especially usage history files, are
The usage history of each offline credit transaction or bank PO3 transaction with the card is sequentially written as a record.

従って、ロケのレコードが書込まれると、そのファイル
への書込みができなくなり、係るICカードを利用した
クレジット取引等ができなくなるという問題が生じてい
た。
Therefore, once a location record is written, it is no longer possible to write to the file, resulting in a problem that credit transactions using the IC card are no longer possible.

本発明は、係る問題点に鑑み、ICカードのプロセッサ
の制御によってメモリ内のファイルを循環使用すること
のできるICカードのファイル制御方式を提供すること
を目的とする。
SUMMARY OF THE INVENTION In view of the above problems, it is an object of the present invention to provide a file control method for an IC card that allows files in a memory to be used cyclically under the control of a processor of the IC card.

〔問題点を解決するだめの手段〕[Failure to solve the problem]

第1図は本発明の原理説明図である。 FIG. 1 is a diagram explaining the principle of the present invention.

第1図(A)中、第9図で示したものと同一のものは同
一の記号で示してあり、ZAは業務領域であり、必要に
応じて創成されたファイル21を格納しておくもの、2
0はリリ・イクル制御情報であり、ブイレフI−IJ 
Z Dにファイルを循@(リサイクル)使用するために
設定されるものである。
In FIG. 1(A), the same parts as those shown in FIG. 9 are indicated by the same symbols, and ZA is a business area, which stores files 21 created as necessary. ,2
0 is Lily cycle control information,
This is set to recycle files in ZD.

又、CP U 1は、係るディレクトリZDのリサイク
ル制1ffl情報20を用いて業務領域ZAのファイル
21をリサイクル制御するように構成されている。
Further, the CPU 1 is configured to control the recycling of the files 21 in the business area ZA using the recycling system 1ffl information 20 of the directory ZD.

〔作用〕[Effect]

本発明では、第1図(B)に示す物理的にnレコード分
のファイル21を矢印に示す如く循環利用するようにし
ている。即ち、物理的には、ロケの固定長レコードから
成るファイル21をwX環して使うことにより、論理的
には第1図(C)に示す如<、65535  (論理レ
コード番号に割当てられたバイト数が2バイトの場合)
レコードから成るファイルに見せるようにしている。
In the present invention, the file 21 physically containing n records shown in FIG. 1(B) is recycled as shown by the arrow. That is, physically, by using the file 21 consisting of fixed-length records of the location as a wX ring, logically, as shown in Figure 1 (C), 65535 (bytes assigned to the logical record number) (If the number is 2 bytes)
I'm trying to make it look like a file consisting of records.

従って、論理的にもアクティブなレコード格納域はnで
あるが、論理的にはメモリ空間が拡大された様に取扱え
、従って物理的レコード番号nに対し、論理レコード番
号は65535まで用いることができる。
Therefore, although the logically active record storage area is n, logically it can be handled as if the memory space has been expanded, and therefore logical record numbers up to 65535 can be used for physical record number n. can.

このようなファイルのリサイクル使用自体は、コンピュ
ータ分野では知られているが、本発明では、ICカード
内のメモリにリサイクル制御悄幸侵20を持たせ、IC
カードのcputがリサイクル制御するようにしている
。このため、利用者が携帯して、種々のアクセス装置3
にセットされるICカードに係るファイルリサイクルa
能を持たせているので、アクセス装置3側でファイルリ
サイクル制御を行う必要がなく、アクセス装置3は、フ
ァイル容量を意識せずに論理トランク番号でアクセスで
きる。
Such file recycling itself is known in the computer field, but in the present invention, the memory in the IC card is provided with a recycling control mechanism 20, and the IC card is
The card's cput controls recycling. Therefore, users can carry various access devices 3.
File recycling a related to the IC card set in
Therefore, there is no need to perform file recycling control on the access device 3 side, and the access device 3 can access the file using the logical trunk number without being aware of the file capacity.

〔実施例〕〔Example〕

(al−実施例の構成の説明 第2図は本発明の一実施例構成図、第3図はディレクト
リの詳細構成図、第4図はリサイクル制御情報の説明図
である。
(Description of the structure of an embodiment) FIG. 2 is a block diagram of an embodiment of the present invention, FIG. 3 is a detailed block diagram of a directory, and FIG. 4 is an explanatory diagram of recycling control information.

図中、第1図及び第9図で示したものと同一のものは同
一の記号で示してあり、4はプログラムメモリであり、
PIN照合等のセキュリティプログラムを格納する他に
、ライト処理プログラム(第5図)、リード処理プログ
ラム(第7図)、デリート処理プログラム(第6図)を
有するアクセス処理プログラムを格納しておくもの、5
はバスであり、CPUIとメモリ2、プログラムメモリ
4及びアクセス装置3との間でコマンド/データのやり
とりを行うものである。
In the figure, the same parts as shown in FIGS. 1 and 9 are indicated by the same symbols, and 4 is a program memory;
In addition to storing security programs such as PIN verification, access processing programs including a write processing program (Fig. 5), a read processing program (Fig. 7), and a delete processing program (Fig. 6) are stored. 5
is a bus that exchanges commands/data between the CPUI, memory 2, program memory 4, and access device 3.

メモリ2は、システムゾーンZSとディレクトリゾーン
ZDと業務ゾーンZAとが設定されており、システムゾ
ーンZSには、メーカ製造情報と、システム域(PIN
データ領域先頭アドレス、発行者−ID先頭領域アドレ
ス、ZD領域先頭アドレスを保有)と、PINデータと
、発行者ID(SecreL No)とが格納され、こ
れらはカード発行元で作成され、セットされる。
Memory 2 has a system zone ZS, a directory zone ZD, and a business zone ZA set up, and the system zone ZS contains manufacturer manufacturing information and a system area (PIN
Data area start address, issuer-ID start area address, ZD area start address), PIN data, and issuer ID (SecreL No.) are stored, and these are created and set by the card issuer. .

一方、ディレクトリゾーンZDは、全体管理部と創成さ
れた各ファイルに対応する領域管理セル(以下セルと称
す)l−nが格納される。
On the other hand, the directory zone ZD stores an overall management section and area management cells (hereinafter referred to as cells) ln corresponding to each created file.

又、業務ゾーンZAは、メモリ2のシステムゾーンZS
とディレクトリゾーンZDを除いたエリアが割り当てら
れ、例えばファイルをnヶ収容しうる。
Also, the business zone ZA is the system zone ZS of memory 2.
An area excluding the directory zone ZD is allocated and can accommodate, for example, n files.

この実施例では、業務ゾーンZAが第9図の従来例と相
違して、業務情報ファイルと履歴情報ファイルとの共通
格納領域として設けられているので、第9図の如く領域
分割していないから、メモリの有効利用が図れるととも
に、ファイルアクセスも簡単となる。
In this embodiment, unlike the conventional example shown in FIG. 9, the business zone ZA is provided as a common storage area for the business information file and the history information file, so the area is not divided as shown in FIG. , memory can be used more effectively and file access can be made easier.

ディレクトリゾーンZDの全体管理部のフォーマットは
、第3図(A)に示す如く、ディレクトリゾーンZDの
全体サイズを示すZD全体サすズZDSと、次の登録セ
ルを格納すべき先頭アドレスをディレクトリの先頭から
のバイト数で示す先頭アドレスNCへと、業務ゾーンZ
Aの先頭アドレスを示す先頭アドレスZAAと、業務ゾ
ーンZAの全体サイズを示す2Δ全体サイズZASとぐ
業務ゾーンZAにおける次の登録ファイルの先頭アドレ
スを業務ゾーンZAの先頭からのバイト数で示すファイ
ル先頭アドレスN F八と、これらのためのリザーブ領
域と、CRC千ニック用データCRCが含まれている。
As shown in Figure 3 (A), the format of the overall management section of the directory zone ZD is as follows. Business zone Z to the start address NC indicated by the number of bytes from the start.
Start address ZAA indicating the start address of A and 2Δ total size ZAS indicating the overall size of business zone ZA. File start indicating the start address of the next registered file in business zone ZA as the number of bytes from the beginning of business zone ZA. It includes addresses NF8, a reserved area for these addresses, and data CRC for 1,000 nicks.

従って、全体管理部は、第3図に示す如く、ディレクト
リゾーンZDの管理のため、ZD全体サすズZDS、次
登録セル先頭アドレスNCAを有し、これらによってフ
ァイル創成のためのセルの登録を行い、ZA4Jll域
先頭アドレスZAΔ、ZA全体サすズZAS及び次登録
ファイル先頭アドレスNFAによって、業務ゾーンZA
に創成ファイルを割当てる。
Therefore, as shown in FIG. 3, the overall management section has the entire ZD size ZDS and the next registration cell start address NCA for managing the directory zone ZD, and uses these to register cells for file creation. Then, the business zone ZA is set using the ZA4Jll area start address ZAΔ, ZA entire search ZAS, and next registered file start address NFA.
Assign the creation file to .

一方、ディレクトリゾーンZDの各セルのフォーマント
は、第3図(13)に示す如く、対応するファイルのフ
ァイル番号と、業務ゾーンZAにおける当該ファイルの
開始相対アドレスF S Aと、当該ファイルのナイス
をハイド数で示すファイルサイズFと、循環編成ファイ
ルか否かを示すファイル編成と、ファイルのレコード形
式と、ファイルの各レコードのレコードirと、最旧レ
コード格納アドレスへと、次登録レコード格納アドレス
Bと、最旧レコード相対レコード番号Cと、格納済レコ
ード件数りと、これらのリザーブ領域と、CRCチェッ
ク用データCRCが含まれる。従って、セルは業務ゾー
ンZAに創成されたファイルの領域管理のために設けら
れ、開始相対アドレスFSΔとファイルサイズFとによ
って業務ゾーンZAにおけるファイルの開始位置と大き
さを示し、又ファイル編成によって当該ファイルが循環
(リサイクル)編成ファイルか否かを示し、更にそのフ
ァイルのリサイクル制御情報として最旧レコード格納ア
ドレスA、次登録格納アドレスB、脹旧しコード相対レ
コード番号C1格納済レコード件数りが設けられている
On the other hand, the formant of each cell in the directory zone ZD, as shown in FIG. The file size F as a hide number, the file organization indicating whether it is a circular organization file, the record format of the file, the record IR of each record of the file, the storage address of the next registered record from the oldest record storage address, B, the oldest record relative record number C, the number of stored records, a reserve area for these, and CRC check data CRC. Therefore, cells are provided for area management of files created in the business zone ZA, and indicate the starting position and size of the file in the business zone ZA by the start relative address FSΔ and file size F, and by the file organization. Indicates whether the file is a circular (recycle) organization file, and further includes the oldest record storage address A, next registered storage address B, obsolete code relative record number C1, and the number of stored records as recycling control information for the file. It is being

このリサイクル制御情報を第4図により説明すると、最
旧レコード格納アドレスAは、ファイルに最も以前に書
き込まれたレコードの先頭アドレスを、ファイル領域の
先頭からの相対アドレスで示したものであり、第1図(
C)のアクティブ域の先頭アドレスである。又、次登録
レコード格納アドレスBは、次にレコードを書き込むフ
ァイル内のアドレスを、ファイル領域の先頭からの相対
アドレスで示し、最旧レコード相対レコード番号Cは、
最も以前に書き込まれたレコードの論理相対レコード番
号を示し、格納済レコード件数は、ファイルに格納され
たレコードの件数を示す。
To explain this recycling control information with reference to FIG. 4, the oldest record storage address A is the first address of the record written earliest in the file, expressed as a relative address from the beginning of the file area. Figure 1 (
This is the start address of the active area of C). Further, the next registered record storage address B indicates the address in the file where the next record will be written as a relative address from the beginning of the file area, and the oldest record relative record number C is
Indicates the logical relative record number of the record written most recently, and the number of stored records indicates the number of records stored in the file.

(bl−実施例の動作の説明 第5図はライト処理フロー図、第6図はデリート処理フ
ロー図、第7図はリード処理)lコー図、第8図はこれ
らによるファイルリサイクル動作説明図である。
(Explanation of the operation of the BL-Example. Figure 5 is a write process flow diagram, Figure 6 is a delete process flow diagram, and Figure 7 is a read process). be.

先づ、第5図によってライト処理について説明する。First, write processing will be explained with reference to FIG.

ここで、ファイルの物理レコード数nとし、ライトのた
めアクセス装置3から、ライトコマンド、ファイル番号
、ライトレコードが与えられるものとし、CPUIはフ
ァイル番号でディレクトリゾーンZDをアクセスし、言
亥当セルを見イ寸けたものとする。
Here, the number of physical records of the file is n, and the access device 3 gives a write command, file number, and write record for writing, and the CPU accesses the directory zone ZD with the file number and selects the current cell. It is assumed that the image is close to the actual size.

■先づ、CPU 1は当該セルの最旧レコード相対レコ
ード番号Cを読出し、“0”か否か定める。
(1) First, the CPU 1 reads the oldest record relative record number C of the cell and determines whether it is "0" or not.

C−0ということは、第8図(八)の如く対応ファイル
に1つもレコードが格納されていないことを示し、従っ
て、当該レコードが最旧レコードとなるがら、Cを(C
+1)に更新する。
C-0 indicates that no record is stored in the corresponding file as shown in Figure 8 (8). Therefore, although this record is the oldest record,
+1).

■次に、CPUIは、最旧レコード格納アドレスへと次
登録レコード格納アドレスBとを続出し、比較する。A
=8の場合は、第8図(A)のレコードが1つも格納さ
れてないか、又は空きレコードなしの場合であるから、
次にCPUIは格納法レコード件数りを調べる。D≠0
でなければ、空きレコードがないから、CPtJlは空
きレコードなしのエラーをアクセス装置3に通知する。
(2) Next, the CPUI sequentially outputs the next registered record storage address B to the oldest record storage address and compares them. A
If =8, it means that none of the records in FIG. 8(A) are stored or there are no empty records.
Next, the CPUI checks the storage method record count. D≠0
Otherwise, since there are no free records, CPtJl notifies the access device 3 of an error that there are no free records.

アクセス装置3は、これによっても、データをライトし
たい場合には、第6図の如くデリートコマンドを送って
最旧レコードをデリートした後、再びライトコマンドを
発行してライトさせる。
If the access device 3 also wants to write data, it sends a delete command to delete the oldest record as shown in FIG. 6, and then issues a write command again to write the data.

■一方、CPU1は、A≠B又はD=Oと判定すると、
ファイルに空きレコードが有るから2、与えられたデー
タを次登録レコード格納アドレスBから書込む。
■On the other hand, if CPU1 determines that A≠B or D=O,
Since there is an empty record in the file, 2, the given data is written from the next registered record storage address B.

更に、CPUIは、次登録レコード格納アドレスBを(
B+r(レコード長))に更新し、格納法レコード件数
りを(D+1.)に更新する。
Furthermore, the CPUI sets the next registration record storage address B to (
B+r (record length)), and the storage method record count is updated to (D+1.).

0次に、CPUIは、次登録レコード格納アドレスBが
ファイルサイズFに等しくなったかを調べ、即ち、ファ
イルにnレコード格納されたかを調べ、B=Fなら、リ
サイクルのためBをアドレス“0”に更新して終了し、
Bf−Fでなければ、nレコードまで格納されてないの
で終了する。
0 Next, the CPU checks whether the next registered record storage address B is equal to the file size F, that is, checks whether n records have been stored in the file, and if B=F, sets B to address “0” for recycling. Update to and exit.
If it is not Bf-F, the process ends because up to n records have not been stored.

この動作を第8図(A)〜(C)によって説明すると、
ファイル創成直後は、Δ=B=C=D=0であり、第8
図(A)に示す如くアクティブレコード域は論理相対レ
コードのルーコード目からnレコード目であり、全レコ
ードが空きレコードである。
This operation will be explained with reference to FIGS. 8(A) to 8(C).
Immediately after file creation, Δ=B=C=D=0, and the 8th
As shown in Figure (A), the active record area is the logical relative record from the roux code to the nth record, and all records are empty records.

この状態で第8図(B)に示す如く、P個(P〈n)の
レコードをライトすると、アクティブレコード域は1〜
nレコード目のままで、最旧レコードは1″ (従って
、A=0、C=1)、最新レコードはP (従って、B
はレコードP+1の相対アドレス)、格納法レコード件
数りはPとなる。この時空きレコードは(P+1) レ
コード目からnレコード目である。
In this state, as shown in FIG. 8(B), when P records (P〈n) are written, the active record area is 1 to 1.
As the nth record remains, the oldest record is 1'' (therefore, A=0, C=1), and the latest record is P (therefore, B
is the relative address of record P+1), and the number of storage method records is P. At this time, the empty records are the (P+1)th record to the nth record.

次に、第8図(B)の状態から更にq個(P+q>n)
のレコードをライトすると、リサイクルされ、第8図(
C)の如くアクティブレコード域は、 (P+q−n+
1)  レコード目から(P+q)レコード目となる。
Next, q more (P+q>n) from the state in Figure 8 (B)
When you write a record, it will be recycled and shown in Figure 8 (
As shown in C), the active record area is (P+q-n+
1) From the record number to the (P+q) record number.

この時、最旧レコードは(P+q−n+1)レコード目
(従って、Aは係るレコードの相対アドレス、C=P+
q−n+1) 、最新レコードは(1)+(1) レコ
ード目(従って、Bは(q−n)レコードの相対アドレ
ス)となり、格納法レコード件数りはnで、空きレコー
ドは零となる。
At this time, the oldest record is the (P+q-n+1)th record (therefore, A is the relative address of the record, C=P+
q-n+1), the latest record is the (1)+(1)th record (therefore, B is the relative address of the (q-n) record), the number of storage method records is n, and the number of empty records is zero.

次に、第6図によってデリート処理について説明する。Next, the delete process will be explained with reference to FIG.

デリートに当っては、デリートコマンドとファイル番号
とデリートすべき相対レコード番号lがアクセス装置3
から与えられる。
When deleting, the delete command, file number, and relative record number l to be deleted are stored in the access device 3.
given from.

■先づ、CPU lはファイル番号該当のセルから格納
法レコード件数りを読み出し、D=0なら、第8図(A
)の如(1つのレコードも格納されておらず、デリート
すべきレコードがないから、有効レコードなしエラーを
アクセス装置3に通知する。
■First, CPU l reads the number of storage method records from the cell corresponding to the file number, and if D=0,
) (Since not a single record is stored and there is no record to be deleted, the access device 3 is notified of a no valid record error.

■一方、CPUIはD≠0なら、レコードが格納されて
いるから、次に指定相対レコード番号aと最旧レコード
相対レコード番号Cとを比較する。
(2) On the other hand, if D≠0, then the CPUI compares the designated relative record number a with the oldest record relative record number C, since the record is stored.

これは最旧レコードからプリー1−させていくためであ
り、途中のレコードをデリートしてファイルが両法は状
態となることを防ぐためである。
This is to start the file from the oldest record, and to prevent the file from becoming in a state where intermediate records are deleted.

従って、cputは、l≠Cであれば、最旧レコードの
デリート指定でないため、アクセス装置3に指定レコー
ドが最旧レコードでない旨のエラーを通知する。
Therefore, if l≠C, cput does not designate deletion of the oldest record, and therefore notifies the access device 3 of an error that the designated record is not the oldest record.

■一方、CPUIは、X=Cであれば最旧レコードのデ
リートのため、最旧レコード相対レコード番号Cを(C
+1)に更新し、更に、格納法レコード件数りを(D−
1)に更新する。
■On the other hand, if X=C, in order to delete the oldest record, the CPUI deletes the oldest record relative record number C (C
+1) and further update the storage method record count to (D-
Update to 1).

従って、レコード番号pの領域が解放される。Therefore, the area of record number p is released.

■次に、CI) U 1は最旧レコード相対レコード番
号Cがオーバフロー、即ち、割り当てられた論理相対レ
コード番号の最大値(第8図では“65535′)を越
えているか調べ、越えていれば、Cを1に更新する。
■Next, CI) U1 checks whether the oldest record relative record number C has overflowed, that is, exceeds the maximum value of the allocated logical relative record numbers (“65535′ in Figure 8), and if it has exceeded it, , C is updated to 1.

■更に、cpu tは、最旧レコード格納アドレスへを
(Δ十「 (レコード長))に更新し、次に係るアドレ
スAとファイルサイズFとを比較する。
(2) Furthermore, the CPU t updates the oldest record storage address to (Δ1' (record length)), and compares the next address A with the file size F.

CP[JlはA=Fなら、最旧レコード格納アドレスへ
をファイルの先頭に戻すべく八−〇として終了し、八≠
Fなら、そのまま終了する。
If CP[Jl is A=F, it ends as 8-0 to return the oldest record storage address to the beginning of the file, and 8≠
If it is F, just exit.

この動作を第8図(D)によって説明すると、第8図(
C)の状態で最旧レコードから1個(r<n)のレコー
ドをデリートすると、アクティブレコード域はrレコー
ド分だけ先に進んで、(P+q−n+l+r)  レコ
ード口から(p+q+r)レコード口となる。
This operation will be explained with reference to FIG. 8(D).
If one record (r<n) is deleted from the oldest record in state C), the active record area advances by r records, and becomes the (P+q-n+l+r) record opening to the (p+q+r) record opening. .

この時、最旧レコードは(P+Q−n+1±「)目(即
ち、C=P+q−n+1+r) 、最新レコードは第8
図(C)と変わらず、(+’+q)レコード口となり、
格納済レコード件数りは(n−r)であり、空きレコー
ドは(P+14−1)  レコード口から(P+q+r
)  レコード口までのrレコードとなる。
At this time, the oldest record is the (P+Q-n+1±")th record (that is, C=P+q-n+1+r), and the latest record is the 8th record.
Same as figure (C), it becomes (+'+q) record opening,
The number of stored records is (n-r), and the number of empty records is (P+14-1).
) It becomes an r record up to the record opening.

更に、第7図によってリード処理について説明する。Furthermore, read processing will be explained with reference to FIG.

リードに当っては、アクセス装置3からリードコマンド
、ファイル番号、リード相対レコード番号mが与えられ
る。
For reading, the access device 3 gives a read command, a file number, and a read relative record number m.

■先づ、CPU1は、ファイル番号対応のセルから格納
済レコード件数りを読出し、零か否かを調べる。D=0
であれば、第8図(A)の如く1件の有効レコードも格
納されておらず、リードすべき有効レコードがないから
、cpu tはアクセス装置3に空きレコード措定の旨
のエラーを通知する。
(1) First, the CPU 1 reads the number of stored records from the cell corresponding to the file number and checks whether it is zero. D=0
If so, as shown in FIG. 8(A), not a single valid record is stored and there is no valid record to read, so CPU t notifies the access device 3 of an error stating that it is an empty record. .

■一方、CPUIは、D≠0と判定すると、アクティブ
レコード域の最新レコード番号Cr、即ち次登録レコー
ド格納アドレスBに示すレコードの1つ前のレコード番
号を次式より求める。
(2) On the other hand, if the CPU determines that D≠0, it calculates the latest record number Cr in the active record area, that is, the record number immediately before the record indicated at the next registered record storage address B, using the following formula.

即ち、次登録レコード格納アドレスBと最旧レコード格
納アドレスAとを比較し、B〉八なら、C’=C+((
[3−A)/r−1)    ・−=−<1)より、 B≦Aなら、 C’ =C+ ((B−A+F)/r−N−=−(21
より、最新のレコードのレコード番号C′を求める。
That is, the next registered record storage address B and the oldest record storage address A are compared, and if B>8, C'=C+((
[3-A)/r-1) ・-=-<1) If B≦A, then C' = C+ ((B-A+F)/r-N-=-(21
From this, the record number C' of the latest record is determined.

■この最新レコード番号C′と最旧レコード相対レコー
ド番号Cとの間が有効レコードであるから、cpuiは
与えられたリード相対レコード番号mと比較する。
(2) Since the area between the latest record number C' and the oldest record relative record number C is a valid record, CPUI compares it with the given read relative record number m.

CPUIは、C≦m≦C′でないと判定すると、アクテ
ィブ域外の相対レコード番号又は空きレコードが指定さ
れたものとして、アクセス装置3にその旨のエラーを通
知する。
If the CPUI determines that C≦m≦C', it assumes that a relative record number outside the active area or an empty record has been specified, and notifies the access device 3 of this error.

■一方、CPUIは、C≦m≦C′と判定すると、有効
レコードのレコード番号指定と判定し・、該当レコード
番号mの相対アドレスMを次式で求める。
(2) On the other hand, if the CPU determines that C≦m≦C', it determines that the record number of a valid record is specified, and calculates the relative address M of the corresponding record number m using the following formula.

M= ((m−1)Xr/r)       −・・−
(3)そし′ζ、CPU 1は求めた相対アドレスMか
らルコード分のデータを読出し、アクセス装置3ヘレス
ポンスとして送信して、リード処理を終了する。
M= ((m-1)Xr/r) −・・−
(3) Then,'ζ, the CPU 1 reads the data corresponding to the code from the obtained relative address M, transmits it to the access device 3 as a response, and completes the read process.

このようなリサイクル制御は、第2図及び第3図のセル
のファイル編成が循環形を指定しているものについて行
われ、例えば、第2図のファイル1〜5の業務情報のフ
ァイルの如く、一旦書込まれたレコードをデリート(消
去)しておくことが好ましくないファイルに対しては係
る循環形が指定されず、従ってファイルのva環使用は
行われない。
Such recycling control is performed for files in which the file organization of cells in FIGS. 2 and 3 specifies a circular format, such as the business information files 1 to 5 in FIG. For files in which it is not desirable to delete (erase) records once they have been written, such a circular form is not specified, and therefore, the VA ring of the file is not used.

一方、第2図のファイル6〜nの如くのM歴ファイルに
対しては、’dfi 1W形を指定しておくことによっ
て、ファイルの循環使用が行われ、CPU1はコマンド
アクセス処理に当って、ファイル番号対応セルのファイ
ル編成欄を調べて、これらを判断する。従って、業務ゾ
ーン2Δにva環形ファイルと非循環形ファイルとを混
在させることができる。
On the other hand, for M history files such as files 6 to n in FIG. 2, by specifying the 'dfi 1W type, files are used cyclically, and the CPU 1 performs command access processing by These are determined by checking the file organization column of the cell corresponding to the file number. Therefore, VA circular files and non-circular files can coexist in the business zone 2Δ.

このようにして、ディレクトリゾーンZDのリサイクル
制御情報A、T3.C,DによってwJ環編成を指定さ
れたファイルを循環使用でき、又、ライト処理では、格
納済レコード件数りによって、空きレコード有、無、即
ちライト可否が判定でき、更にデリート処理では、最旧
レコードから削除して、レコードの歯抜けを防ぎ、物理
的なファイルエリアを有効に利用できる。
In this way, the recycling control information A, T3 . Files with wJ ring organization specified by C and D can be used cyclically, and in write processing, it is possible to determine whether there are empty records by counting the number of stored records, that is, whether or not they can be written.Furthermore, in delete processing, the oldest By deleting it from the record, you can prevent missing records and make effective use of the physical file area.

(C1他の実施例の説明 上述の実施例では、ディレクトリを第3図の如く構成し
ているが、他の構成であってもよく、又履歴用のファイ
ルを循環形に使用しているが他の用途のファイルを必要
に応じて循環形に使用してもよい。
(C1 Description of other embodiments In the above embodiment, the directory is structured as shown in Figure 3, but other structures may be used, and history files are used in a circular manner. Files for other purposes may be used in a circular manner as needed.

以上本発明を実施例により説明したが、本発明は本発明
の主旨に従い種々の変形が可能であり、本発明からこれ
らを排除するものではない。  ゛〔発明の効果〕 以上説明した様に、本発明によれば、ICカード内のメ
モリに創成されたファイルを循環利用出来るから、物理
的に容量制限されたファイルを論理的に拡張して利用出
来るという効果を奏し、係るファイルを有効に利用出来
る。
Although the present invention has been described above using examples, the present invention can be modified in various ways according to the gist of the present invention, and these are not excluded from the present invention. [Effects of the Invention] As explained above, according to the present invention, files created in the memory of an IC card can be reused, so files whose capacity is physically limited can be logically expanded and used. This has the effect of making it possible to use the file effectively.

又、ICカード内にリサイクル制御情報を持ら、ICカ
ード内のプロセッサがファイルをリサイクル制御してい
るので、アクセス装置3はファイルの物理容量を意識し
ないでファイルアクセスが可能となるという効果を奏し
、特にICカードの如き、アクセス装置3に固定されず
、利用者が携帯し、利用者の必要に応じて種々のアクセ
ス装置3にセットされて利用されるものにおいては、ア
クセス装置3に負担をかけずにファイルリサイクル使用
でき且ついかなるアクセス装置3にも利用出来、ICカ
ードの利用範囲を大幅に広げることができる。
In addition, since the IC card has recycling control information and the processor in the IC card controls file recycling, the access device 3 has the effect of being able to access files without being aware of the physical capacity of the file. In particular, IC cards, which are not fixed to the access device 3 but are carried by the user and set in various access devices 3 according to the user's needs, place a burden on the access device 3. The IC card can be used for file recycling without any cost and can be used with any access device 3, greatly expanding the usage range of the IC card.

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

第1図は本発明の原理説明図、 第2図は本発明の一実施例構成図、 第3図は第2図構成のディレクトリの詳細構成図、 第4図は第3図構成のリサイクル制御情報の説明図、 第5図は第2図構成のライト処理フロー図、第6図は第
2図構成のデリート処理フロー図、第7図は第2図構成
のリード処理フロー図、第8図は本発明によるファイル
リサイクル動作説明図、 第9図は従来技術の説明図、 第10図は従来技術の問題点説明図である。 図中、1−プロセッサ、 2−・メモリ、 3−アクセス装置、 ZΔ・・・業務領域、 ZD・・・ディレクトリ、 20・−・リサイクル制御情報、 21−ファイル。
Figure 1 is a diagram explaining the principle of the present invention, Figure 2 is a configuration diagram of an embodiment of the invention, Figure 3 is a detailed configuration diagram of the directory configured in Figure 2, and Figure 4 is recycling control configured in Figure 3. An explanatory diagram of the information, FIG. 5 is a write processing flow diagram for the configuration in FIG. 2, FIG. 6 is a delete processing flow diagram for the configuration in FIG. 2, FIG. 7 is a read processing flow diagram for the configuration in FIG. 2, and FIG. 8 9 is an explanatory diagram of the file recycling operation according to the present invention, FIG. 9 is an explanatory diagram of the prior art, and FIG. 10 is an explanatory diagram of the problems of the prior art. In the figure, 1-processor, 2-memory, 3-access device, ZΔ...business area, ZD...directory, 20--recycling control information, 21-file.

Claims (1)

【特許請求の範囲】 プロセッサ(1)とメモリ(2)とを内蔵し、アクセス
装置(3)にセットされ、該アクセス装置(3)との間
でデータの入出力を行うICカードにおいて、 該メモリ(2)にファイルを格納するための業務領域(
ZA)と、 該ファイルの領域管理のためのディレクトリ(ZD)と
を設けるとともに、 該ディレクトリ(ZD)に該ファイルを循環して使用す
るための制御情報を設け、 該プロセッサ(1)が物理的にnヶのレコードを格納す
る該ファイルを該制御情報を用いて循環使用することを 特徴とするICカードのファイル制御方式。
[Claims] An IC card that includes a processor (1) and a memory (2), is set in an access device (3), and inputs and outputs data to and from the access device (3), comprising: Business area (for storing files in memory (2)
ZA) and a directory (ZD) for area management of the file, and control information for circulating and using the file is provided in the directory (ZD), and the processor (1) physically A file control method for an IC card, characterized in that the file storing n records is used cyclically using the control information.
JP61096163A 1986-04-25 1986-04-25 File control system for ic card Pending JPS62251992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61096163A JPS62251992A (en) 1986-04-25 1986-04-25 File control system for ic card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61096163A JPS62251992A (en) 1986-04-25 1986-04-25 File control system for ic card

Publications (1)

Publication Number Publication Date
JPS62251992A true JPS62251992A (en) 1987-11-02

Family

ID=14157672

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61096163A Pending JPS62251992A (en) 1986-04-25 1986-04-25 File control system for ic card

Country Status (1)

Country Link
JP (1) JPS62251992A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04111086A (en) * 1990-08-30 1992-04-13 Toppan Printing Co Ltd Ic card
JPH0589303A (en) * 1991-02-14 1993-04-09 Toppan Printing Co Ltd Ic card

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04111086A (en) * 1990-08-30 1992-04-13 Toppan Printing Co Ltd Ic card
JPH0589303A (en) * 1991-02-14 1993-04-09 Toppan Printing Co Ltd Ic card

Similar Documents

Publication Publication Date Title
EP0985202B1 (en) Multi-application ic card with delegation feature
US6480935B1 (en) Smart card memory management system and method
US6539453B1 (en) Storage system including means for management of a memory with anti-attrition, and process of anti-attrition management of a memory
JPS63204493A (en) Portable electronic device
KR970006646B1 (en) Portable electronic apparatus
JP2854636B2 (en) Apparatus and method for issuing portable medium
JPH021090A (en) Ic card and method for writing its operation program
TWI259365B (en) Microprocessor circuit for data carriers and method for organizing access to data stored in a memory
US4224665A (en) Bus-organized computer system with independent execution control
JPS62251992A (en) File control system for ic card
JP4486828B2 (en) Semiconductor memory card, computer readable program
JP2608319B2 (en) IC card system
JPS62251991A (en) File accessing system for ic card
JPH09114741A (en) Portable information recording medium
JP2544722B2 (en) Information storage control method and information storage device equipped with the method
JP2609645B2 (en) Portable electronic devices
JP2598056B2 (en) Portable electronic devices
JP2505003B2 (en) IC card with auxiliary memory
JP2809761B2 (en) IC card terminal device
JP2007531926A (en) Method of writing data and application to identification media
EP0488780A2 (en) Portable storage device
JPS63229542A (en) Electronic card
JP5853559B2 (en) IC chip, processing method in IC chip, IC chip processing program, and IC card
JP5853590B2 (en) IC chip, IC chip processing method, IC chip processing program, IC card, etc.
JPS63286990A (en) Ic card information processing system