JP2782908B2 - IC card - Google Patents

IC card

Info

Publication number
JP2782908B2
JP2782908B2 JP2087180A JP8718090A JP2782908B2 JP 2782908 B2 JP2782908 B2 JP 2782908B2 JP 2087180 A JP2087180 A JP 2087180A JP 8718090 A JP8718090 A JP 8718090A JP 2782908 B2 JP2782908 B2 JP 2782908B2
Authority
JP
Japan
Prior art keywords
data
card
area
bytes
data length
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2087180A
Other languages
Japanese (ja)
Other versions
JPH03286276A (en
Inventor
誠治 平野
義一 寄本
茂 杉山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toppan Inc
Original Assignee
Toppan Printing Co 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 Toppan Printing Co Ltd filed Critical Toppan Printing Co Ltd
Priority to JP2087180A priority Critical patent/JP2782908B2/en
Publication of JPH03286276A publication Critical patent/JPH03286276A/en
Application granted granted Critical
Publication of JP2782908B2 publication Critical patent/JP2782908B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 <産業上の利用分野> 本発明はICカードシステムにおけるICカード、詳しく
は送信データ長を上位、下位の2バイトで示す通信フォ
ーマットに則り外部端末機器との間でデータの授受を行
うICカードシステムにおいてそのデータ長に応じて格納
エリアを選択することにより、メモリ効率を高めたICカ
ードに関する。
DETAILED DESCRIPTION OF THE INVENTION <Industrial Application Field> The present invention relates to an IC card in an IC card system, and more particularly, to data exchange with an external terminal device in accordance with a communication format in which a transmission data length is indicated by upper and lower 2 bytes. The present invention relates to an IC card having an improved memory efficiency by selecting a storage area in accordance with the data length in an IC card system that exchanges data.

<従来の技術> 従来から、ICカードシステムにおいては、ホストコン
ピュータ(外部端末機器)とICカードとの通信にあっ
て、所定の通信フォーマットに基づいてデータの授受を
行なっている。
<Conventional Technology> Conventionally, in an IC card system, data is exchanged based on a predetermined communication format in communication between a host computer (external terminal device) and an IC card.

第8図はホストコンピュータとICカードとの間で用い
られる通信フォーマットの構造を示す図である。
FIG. 8 is a diagram showing the structure of a communication format used between the host computer and the IC card.

この図において、1はICカードのユーザデータを読み
出し時、ICカードからホストコンピュータに送信する読
み出しレスポンス用の通信フォーマットである。2はユ
ーザデータの書き込み時、ホストコンピュータからICカ
ードの送信する書き込みリクエスト用の通信フォーマッ
トである。
In this figure, reference numeral 1 denotes a communication format for a read response transmitted from the IC card to the host computer when reading the user data of the IC card. Reference numeral 2 denotes a communication format for a write request transmitted from an IC card from a host computer when writing user data.

読み出しレスボンス用の通信フォーマット1は、読み
出し/書き込みを区別するための1バイトのCOD3と、IC
カードのCPUの状態を示す1バイトのSTS4と、ユーザデ
ータのデータ長を示す2バイトのデータ長さ表示部分5
と、可変長バイトのユーザデータ6と、から構成されて
いる。
Communication format 1 for read response is 1 byte COD3 for distinguishing read / write, and IC
1-byte STS4 indicating the status of the CPU of the card, and 2-byte data length display portion 5 indicating the data length of the user data
And user data 6 of variable length bytes.

一方、書き込みリクエスト用の通信フォーマット2
は、上記COD3と、下記で示すエリアのIDナンバーを指定
するための1バイトのAID7と、ファイル内のレコード番
号を指定するための2バイトのレコードNO格納領域8
と、上記データ長さ表示部分5と、可変長バイトのユー
ザデータ6と、から構成されている。
On the other hand, communication format 2 for a write request
Is the above-mentioned COD3, 1-byte AID7 for specifying the ID number of the area shown below, and 2-byte record NO storage area 8 for specifying the record number in the file.
And the data length display portion 5 and user data 6 of variable length bytes.

これらの通信フォーマット1、2にあって、ユーザデ
ータのデータ長さを表示する部分5は、上位と下位との
2バイト確保されている。そして、1回の通信で送信す
るユーザデータのデータ長は、常に、2バイトのデータ
で表示されることとなる。例えばユーザデータが256バ
イト未満であっても「0000」H〜「00FF」Hとして表示
されるものである。256バイト以上であれば「0100」H
〜「FFFF」Hとしてデータ長さが表示される。
In these communication formats 1 and 2, a portion 5 for indicating the data length of user data has two bytes of upper and lower bytes. Then, the data length of the user data transmitted in one communication is always displayed as 2-byte data. For example, even if the user data is less than 256 bytes, it is displayed as "0000" H to "00FF" H. "0100" H if 256 bytes or more
The data length is displayed as .about. "FFFF" H.

そして、第9図はこのICカードのメモリの階層構造を
示す図である。
FIG. 9 is a diagram showing the hierarchical structure of the memory of the IC card.

この図において、11は関係のある情報を一まとめに格
納した種々のファイルを示している。これらのファイル
11は、ファイル11毎にエリア13を複数有している。これ
らのエリア13は、レコード単位に分割されたメモリフォ
ーマット12を複数個それぞれ有している。
In this figure, reference numeral 11 denotes various files storing related information in a lump. These files
11 has a plurality of areas 13 for each file 11. Each of these areas 13 has a plurality of memory formats 12 divided into record units.

このメモリフォーマット12にあっては、レコードにお
いてユーザデータが格納される領域14、各レコードの先
頭に付与されるデータ長を示す領域15等を有して構成さ
れている。このデータ長表示領域15は、上記通信フォー
マットのデータ長さ表示部分5(2バイト)に準じて、
2バイトで構成されている。
The memory format 12 includes an area 14 for storing user data in a record, an area 15 indicating a data length added to the head of each record, and the like. The data length display area 15 is based on the data length display portion 5 (2 bytes) of the communication format described above.
It is composed of 2 bytes.

更に、16はディレクトリであり、このディレクトリ16
はメモリ内のファイル11を階層的に管理するとともに、
これらのエリア13を種々の情報、例えばレコードNO、レ
コード長(ユーザデータの長さ)等を管理している。
Further, 16 is a directory, and this directory 16
Manages file 11 in memory hierarchically,
The area 13 manages various information such as a record number and a record length (length of user data).

第10図〜第12図は、この従来のICカードシステムでの
外部端末機器との間の通信手順を示すフローチャートで
ある。
FIG. 10 to FIG. 12 are flowcharts showing a communication procedure with an external terminal device in the conventional IC card system.

まず、ホストコンピュータはICカードに対して、読み
出し用または書き込み用の通信フォーマットを送信す
る。
First, the host computer transmits a read or write communication format to the IC card.

ICカードはホストコンピュータからの通信フォーマッ
トを受信すると(ステップS1)、AID7で指定されたエリ
ア13を選択する(S2)。
Upon receiving the communication format from the host computer (step S1), the IC card selects the area 13 specified by the AID 7 (S2).

次に、レコードNOで指定されたレコードを検索すると
ともに(S3)、CODを検索して読み出し処理を実行する
か書き込み処理を実行するかを判断する(S4)。
Next, the record designated by the record NO is searched (S3), and the COD is searched to determine whether to execute the read process or the write process (S4).

そして、読み出し処理(S5)または書き込み処理(S
6)を実行したら、正常に終了したかどうか判断する(S
7)。もし、正常終了(YES)であれば、レスポンスに正
常ステータスをセットした後(S8)、ホストコンピュー
タにこのレスポンスを送信し(S9)、このプログラムを
終了する。
Then, the reading process (S5) or the writing process (S5)
After performing step 6), determine whether the process was completed normally (S
7). If the processing is normally terminated (YES), the response is set to a normal status (S8), and then this response is transmitted to the host computer (S9), and this program is terminated.

一方、終了が異常であった場合(S7でNO)、レスボン
スに異常ステータスをセットした後(S10)、ホストコ
ンピュータにこのレスポンスを送信し(S9)、このプロ
グラムを終了する。
On the other hand, if the termination is abnormal (NO in S7), after setting an abnormal status in the response (S10), this response is transmitted to the host computer (S9), and this program is terminated.

次に、読み出し処理を説明する。まず、当該レコード
のデータ長を確認し(S11)、データ長分のユーザデー
タの読み出しを行なう(S12)。
Next, the reading process will be described. First, the data length of the record is confirmed (S11), and user data corresponding to the data length is read (S12).

そして、読み出しが正常に終了したかどうか判断し
(S13)、読み出しが正常に終了(YES)した場合、所定
の通信フォーマット(第8図にて1で示す)を例えば通
信バッファにおいて作成し(S14)、メインプログラム
に戻る。
Then, it is determined whether the reading has been completed normally (S13). If the reading has been completed normally (YES), a predetermined communication format (indicated by 1 in FIG. 8) is created in, for example, a communication buffer (S14). ), Return to the main program.

一方、読み出しが異常に終了した場合(S13でNO)、
異常ステータスを作成し(S15)、メインプログラムに
戻る。
On the other hand, if the reading ends abnormally (NO in S13),
Create an abnormal status (S15) and return to the main program.

更に、書き込み処理を説明する。まず、当該送信デー
タのデータ長を通信バッファに一旦保持した通信フォー
マット(第8図にて2で示す)において確認し(S2
1)、所定のレコードに対してそのユーザデータの書き
込みを行なう(S22)。
Further, the writing process will be described. First, the data length of the transmission data is checked in a communication format (indicated by 2 in FIG. 8) once held in the communication buffer (S2).
1) The user data is written to a predetermined record (S22).

そして、書き込みが正常に終了したかどうか判断し
(S23)、書き込みが正常に終了(YES)した場合、所定
の通信フォーマット(正常終了ステータスSTSを含むレ
スポンス用フォーマット)を作成し(S24)、メインプ
ログラムに戻る。
Then, it is determined whether or not the writing has been normally completed (S23). If the writing has been normally completed (YES), a predetermined communication format (a response format including a normal completion status STS) is created (S24). Return to the program.

一方、書き込みが異常に終了した場合(S23でNO)、
異常ステータスを作成し(S25)、メインプログラムに
戻る。
On the other hand, if the writing ends abnormally (NO in S23),
Create an abnormal status (S25) and return to the main program.

<発明が解決しようとする課題> しかしながら、このような従来のICカードにあって
は、以下のような課題があった。
<Problem to be Solved by the Invention> However, such a conventional IC card has the following problems.

すなわち、外部端末機器との間でのデータ授受のため
の通信フォーマットにおいて、そのデータ長さ表示部分
のバイト数(2バイト)に合わせて、ICカードではその
ままフォーマットで(ユーザデータ領域とそのデータ長
を示す2バイトのデータ長さ表示領域とを含むフォーマ
ット)所定のレコード(メモリの一単位)にデータを格
納していた。
That is, in the communication format for data transfer between the external terminal device and the IC card, the format (user data area and its data length) is used as it is in the IC card according to the number of bytes (2 bytes) of the data length display portion. (A format including a 2-byte data length display area indicating the above.) Data was stored in a predetermined record (one unit of memory).

そのため、全てのエリアのレコードについて、データ
長さ表示領域を上位および下位の2バイト構成として指
定しなければならなかった(第9図15参照)。例えば、
255バイトまでの長さのユーザデータは、1バイト表示
が可能にも拘らず、「0000」H〜「00FF」Hとして2バ
イトで表示していた。
Therefore, the data length display area has to be specified as a high-order and a low-order 2-byte configuration for the records of all the areas (see FIG. 9). For example,
User data having a length of up to 255 bytes is displayed in two bytes as "0000" H to "00FF" H, although one-byte display is possible.

したがって、ICカードのメモリ領域にあって、各レコ
ードの先頭に付与されるデータ長さを表示する領域を全
て2バイト分だけ確保しなければならなかった。その結
果、特に小容量のメモリ(例えば1Kバイト)を有するIC
カードにあっては、データ長さ表示領域を多く確保する
だけ、ユーザデータを格納するメモリ領域が少なくな
り、全メモリ領域を有効に利用することができなかっ
た。
Therefore, in the memory area of the IC card, an area for indicating the data length added to the head of each record must be all 2 bytes. As a result, especially ICs with small capacity memory (for example, 1K bytes)
In the card, as the data length display area is increased, the memory area for storing user data is reduced, and the entire memory area cannot be used effectively.

そこで、本発明の目的は、ICカードのメモリ領域を有
効に利用することができるICカードを提供することであ
る。
Therefore, an object of the present invention is to provide an IC card that can effectively use the memory area of the IC card.

<課題を解決するための手段> 本発明は、第1図に示すように、256バイト以上の長
さのユーザデータを格納する場合に2バイトのデータ長
さ表示部分を付加する第1のエリア110、256バイト未満
の長さのユーザデータを格納する場合に1バイトのデー
タ長さ表示部分を付加する第2のエリア120、これらの
エリアを識別する識別コードを格納した属性記述部13
0、を有するICカード100と、 このICカード100との間で、1回の通信で送信するユ
ーザデータの長さを2バイトで表示するデータ長さ表示
部分を、その送信するユーザデータに付加した通信フォ
ーマットに基づいてユーザデータの授受を行なう外部端
末機器200と、を備えたICカードの通信システムにおい
て、 データの読み出し時、上記属性記述部130をサーチし
て上記識別コードを判定する読出判定手段140と、 この識別コードが第2のエリア120であるときはこの
読み出しデータのデータ長さ表示部分に上位バイトを付
加して出力する出力手段150と、 上記外部端末機器200から送信されてきたデータのデ
ータ長さ表示部分を識別して、送信されてきたデータの
データ長さが256バイト以上か256バイト未満かを判定す
る書込判定手段160と、 その送信データ256バイト未満の場合はそのデータ長
さ表示部分から上位バイトを削除して第2のエリア120
に格納する格納手段170と、を備えたICカードである。
<Means for Solving the Problems> According to the present invention, as shown in FIG. 1, a first area for adding a 2-byte data length display portion when storing user data having a length of 256 bytes or more is provided. 110, a second area 120 to which a 1-byte data length display portion is added when storing user data having a length of less than 256 bytes, and an attribute description section 13 storing identification codes for identifying these areas.
0, and a data length display portion for displaying the length of user data transmitted in one communication in two bytes between the IC card 100 having the data card and the transmitted user data. In an IC card communication system comprising: an external terminal device 200 that transmits and receives user data based on the communication format obtained, a read determination for searching the attribute description unit 130 to determine the identification code when reading data. Means 140, output means 150 for adding an upper byte to the data length display portion of the read data when the identification code is in the second area 120, and output from the external terminal device 200 A write determining unit 160 that identifies a data length display portion of the data and determines whether the data length of the transmitted data is 256 bytes or more or less than 256 bytes; If the data length is less than 56 bytes, the upper byte is deleted from the data length display portion and the second area 120
And a storage means 170 for storing the information in an IC card.

<作用> 本発明に係るICカードにあっては、データの読み出し
時、識別コードを判定し、識別コードが第2のエリア12
0であるときは、この読み出しデータのデータ長さ表示
部分に上位バイトを付加して出力する。
<Operation> In the IC card according to the present invention, when reading data, the identification code is determined, and the identification code is stored in the second area 12.
If the value is 0, the upper byte is added to the data length display portion of the read data and output.

一方、書き込み時は、外部端末機器200から送信され
てきたデータのデータ長さ表示部分を識別して、送信さ
れてきたデータのデータ長さが256バイト未満の場合
は、そのデータ長さ表示部分から上位バイトを削除して
第2のエリア120に格納する。
On the other hand, at the time of writing, the data length display portion of the data transmitted from the external terminal device 200 is identified, and if the data length of the transmitted data is less than 256 bytes, the data length display portion is , The upper byte is deleted and stored in the second area 120.

<実施例> 以下、本発明の実施例を図面を参照して説明する。<Example> Hereinafter, an example of the present invention will be described with reference to the drawings.

第2図〜第7図は本発明の一実施例を示す図である。 2 to 7 are views showing an embodiment of the present invention.

第2図において、21はICカードであって、22はこのIC
カード21との間で所定の通信プロトコルにしたがってデ
ータの授受を行うCAD(外部端末機器)である。
In FIG. 2, 21 is an IC card, and 22 is this IC card.
It is a CAD (external terminal device) that exchanges data with the card 21 according to a predetermined communication protocol.

すなわち、CAD22からこのICカード21に対しては電源
VCC,クロック信号Clk,接地レベルGND、リセット信号R
STが供給されている。また、これらの間では各通信バッ
ファを介してデータの授受がなされるものである。この
場合の通信データの通信フォーマットとしては、例えば
従来と同じくISO規格によるものが知られている。(第
8図参照)。すなわち、ICカード21からCAD22に対して
データを送信する場合、および、CAD22からICカード21
に対してデータを送信する場合のいずれについても、所
定の長さのユーザデータの先頭に2バイトのデータ長さ
表示部分が付加されている。
That is, the power supply VCC, the clock signal Clk, the ground level GND, the reset signal R
ST is supplied. In addition, data is exchanged between these units via each communication buffer. As a communication format of the communication data in this case, for example, a format based on the ISO standard is known as in the related art. (See FIG. 8). That is, when data is transmitted from the IC card 21 to the CAD 22,
In each case of transmitting data to the user, a 2-byte data length display portion is added to the head of the user data having a predetermined length.

ここで、ICカード21にあっては、データ授受等の制
御、演算を行うMPU31と、このMPU31に対してアドレスバ
スおよびデータバスによって接続されたメモリ(EEPRO
M)32と、を有して構成されている。なお、図示してい
ないがICカード21は、この他にも、MPU31での基本プロ
グラム等を収納するROM、作業用のワークエリアを確保
するためのRAM等を有している。
Here, in the case of the IC card 21, an MPU 31 for controlling and calculating data transfer and the like, and a memory (EEPRO) connected to the MPU 31 by an address bus and a data bus.
M) 32. Although not shown, the IC card 21 further includes a ROM for storing a basic program and the like in the MPU 31, a RAM for securing a work area for work, and the like.

EEPROM32においては、例えばアプリケーションプログ
ラムに対して格別に設けられた複数のファイルとこのフ
ァイル等を管理するためのディレクトリを有している。
これらのファイルのそれぞれには、複数のエリアが形成
されている。これらのエリアは、第3図および第4図に
示すように、それぞれ複数のレコードによって構成され
ている。1のレコードは、任意の長さのユーザデータを
格納するユーザデータ格納領域RUDと、この格納したユ
ーザデータの長さを示すデータ長さ表示領域RDLと、そ
のほかの領域とによって構成されている。
The EEPROM 32 has, for example, a plurality of files specially provided for application programs and a directory for managing the files and the like.
A plurality of areas are formed in each of these files. Each of these areas is constituted by a plurality of records as shown in FIGS. One record is composed of a user data storage area RUD for storing user data of an arbitrary length, a data length display area RDL indicating the length of the stored user data, and other areas.

そして、この実施例にあっては、上記エリアについて
は256バイト未満の長さのユーザデータを単一のレコー
ドに格納することができる第2のエリアと、256バイト
以上の長さのユーザデータを格納することができる第1
のエリアと、を有している。第3図は第1のエリアを、
第4図は第2のエリアを、それぞれ示すものである。
In this embodiment, a second area in which user data having a length of less than 256 bytes can be stored in a single record and a user data having a length of 256 bytes or more are stored in the area. The first that can be stored
And an area. Figure 3 shows the first area,
FIG. 4 shows the second area.

また、これらの図において示すように、ディレクトリ
DRYにはエリア属性を1バイト構成で示おり、その最下
位ビットにはこの各レコードについてデータ長さ表示部
分の構成が1バイトのときは「1」が、2バイトのとき
は「0」が格納されている。すなわち、第1のエリアの
レコードに対しては「0」が、第2のエリアのそれにつ
いては「1」が記憶されているものである。
Also, as shown in these figures, the directory
DRY indicates the area attribute in a 1-byte configuration, and the least significant bit is “1” when the data length display portion of each record is 1 byte, and “0” when it is 2 bytes. Is stored. That is, “0” is stored for the record in the first area, and “1” is stored for the record in the second area.

以上の構成に係るICカード21にあっては、外部端末機
器CAD22との間でデータの授受を以下のようにして行
う。
In the IC card 21 according to the above configuration, data is exchanged with the external terminal device CAD22 as follows.

第5図〜第7図は、本発明のICカードシステムでの外
部端末機器CADとの間の通信手順を示すフローチャート
である。
FIG. 5 to FIG. 7 are flowcharts showing a communication procedure with the external terminal device CAD in the IC card system of the present invention.

まず、CAD22はICカード21に対して、読み出し用また
は書き込み用の通信フォーマットで規定された送信コマ
ンドを送信する。
First, the CAD 22 transmits a transmission command specified in a communication format for reading or writing to the IC card 21.

その後、ICカード21はCAD22からの送信コマンドを受
信すると(S51)、通信フォーマットのAIDで指定された
エリアを選択する(S52)。
Thereafter, when receiving the transmission command from the CAD 22 (S51), the IC card 21 selects the area specified by the AID of the communication format (S52).

次に、同じく通信フォーマットのレコードNOで指定さ
れたレコードを検索するとともに、レコードNOの上位バ
イトが「00」Hかどうか判断する(S53)。
Next, the record specified by the record number of the communication format is searched, and it is determined whether the upper byte of the record number is “00” H (S53).

もし、「00」HであればレコードNOの下位バイト(Lo
wバイト)で指定されたレコードをサーチする(S54)。
If "00" H, the lower byte of record NO (Lo
The record specified by (w bytes) is searched (S54).

もし、「00」Hでない場合はレコードNOの上位および
下位バイト(2バイト)で指定されたレコードをサーチ
する(S55)。
If it is not "00" H, the record specified by the upper and lower bytes (2 bytes) of the record NO is searched (S55).

このようにステップS53でまず上位バイトのみを判断
するのはその処理速度を高めるためである。
The reason for determining only the upper byte first in step S53 is to increase the processing speed.

次に、上記通信フォーマットのCODを検索して読み出
し処理を実行するか、書き込み処理を実行するかを判断
する(S56)。
Next, it is determined whether to execute the read process or the write process by searching for the COD of the communication format (S56).

そして、読み出し処理(S57)または書き込み処理(S
58)を実行したら、正常に終了したかどうか判断する
(S59)。もし、正常の終了(YES)であれば、レスポン
スに正常ステータスをセットした後(S60)、CAD22にこ
のレスポンスを送信し(S61)、このプログラムを終了
する。
Then, the reading process (S57) or the writing process (S57)
After execution of (58), it is determined whether or not the processing has been completed normally (S59). If normal end (YES), a normal status is set in the response (S60), the response is transmitted to the CAD 22 (S61), and the program ends.

一方、異常終了の場合(S59でNO)、レスポンスに異
常ステータスをセットし(S62)、CAD22にこのレスポン
スを送信し(S61)、このプログラムを終了する。
On the other hand, in the case of abnormal termination (NO in S59), an abnormal status is set in the response (S62), this response is transmitted to CAD22 (S61), and this program is terminated.

次に、読み出し処理サブルーチン(S57)を第6図に
より説明する。
Next, the read processing subroutine (S57) will be described with reference to FIG.

まず、データ長を確認し、データ長分のユーザデータ
の読み出しを行なう(S71)。そして、読み出しが正常
に終了したかどうか判断し(S72)、読み出しが正常に
終了(YES)した場合、ディレクトリに対してアクセス
し、当該レコードNOで指定されたレコードが格納されて
いるエリアのエリア属性を判断する(S73)。
First, the data length is confirmed, and user data corresponding to the data length is read (S71). Then, it is determined whether or not the reading has been completed normally (S72). If the reading has been completed normally (YES), the directory is accessed, and the area of the area in which the record specified by the record NO is stored is stored. The attribute is determined (S73).

そして、この判断の結果、エリア属性が第1のエリア
のレコードを示す場合(YES)、データ長さ表示部分RD
Lのデータをそのまま通信フォーマットのデータ長さ表
示部分に格納し(S74)、メインプログラムに戻る。
If the result of this determination indicates that the area attribute indicates a record in the first area (YES), the data length display portion RD
The data of L is stored in the data length display portion of the communication format as it is (S74), and the process returns to the main program.

一方、ステップS73の結果、そのエリア属性が第2の
エリアのレコードを示す場合(S73でNO)、RDLのデー
タが下位バイトになるように、その上位バイトに「00」
Hを付加し、データ長さの表示を2バイトとする(S7
5)。そして、そのデータを通信フォーマットのデータ
長さ表示部分に格納し(S74)、メインプログラムに戻
る。
On the other hand, as a result of step S73, when the area attribute indicates the record of the second area (NO in S73), “00” is added to the upper byte so that the data of RDL becomes the lower byte.
H is added to indicate the data length to 2 bytes (S7
Five). Then, the data is stored in the data length display portion of the communication format (S74), and the process returns to the main program.

また、ステップS72の結果、読み出しが異常に終了し
た場合(S72でNO)、異常ステータスを作成し(S76)、
メインプログラムに戻る。
Also, as a result of step S72, if the reading is abnormally terminated (NO in S72), an abnormal status is created (S76),
Return to the main program.

更に、書き込み処理サブルーチンを説明する。 Further, a write processing subroutine will be described.

まず、当該送信データのデータ長を通信バッファに一
旦保持した通信フォーマットにおいて、データ長の上位
バイトが「00」Hかどうか判断する(第7図、S81)。
First, it is determined whether or not the upper byte of the data length is “00” H in the communication format in which the data length of the transmission data is temporarily stored in the communication buffer (FIG. 7, S81).

そして、その判断の結果、データ長の上位バイトが
「00」Hの場合(YES)は、エリア属性が第2のエリア
を示すかどうか判断する(S82)。そして、第2のエリ
アを示す場合(YES)、上記データ長の上位バイト「0
0」Hを削除することにより、下位バイトのみ、すなわ
ち、データ長の長さ表示を1バイトにする(S83)。
If the upper byte of the data length is “00” H (YES), it is determined whether the area attribute indicates the second area (S82). Then, when indicating the second area (YES), the upper byte “0” of the data length is set.
By deleting "0" H, only the lower byte, that is, the data length is set to 1 byte (S83).

そして、そのデータ長を通信フォーマットのデータ長
さ表示部分に格納し(S84)、データ長分のデータの書
き込みを行なった後に、メインプログラムに戻る。
Then, the data length is stored in the data length display portion of the communication format (S84), and after writing the data corresponding to the data length, the process returns to the main program.

一方、ステップS82の判断の結果、第1のエリアを示
す場合(NO)、そのままのデータ長を通信フォーマット
のデータ長さ表示部分に格納し(S84)、データ長分の
データの書き込みを行なった後に、メインプログラムに
戻る。
On the other hand, if the result of determination in step S82 indicates the first area (NO), the data length as it is is stored in the data length display portion of the communication format (S84), and data for the data length is written. Later, return to the main program.

また、ステップS81の判断の結果、第1のエリアを示
すかどうか判断し(S85)、第1のエリアを示す場合(Y
ES)、そのままのデータ長を通信フォーマットのデータ
長さ表示部分に格納し(S84)、データ長分のデータの
書き込みを行なった後に、メインプログラムに戻る。
Further, as a result of the determination in step S81, it is determined whether or not the first area is indicated (S85).
ES), store the data length as it is in the data length display portion of the communication format (S84), write data for the data length, and then return to the main program.

一方、ステップS85の判断の結果、第1、第2のエリ
アともに示さない場合(NO)、異常ステータスをセット
し、メインプログラムに戻る。
On the other hand, if the result of determination in step S85 is that neither the first nor the second area is indicated (NO), an abnormal status is set and the process returns to the main program.

<効果> 以上説明してきたように、本発明のICカードにあって
は、ICカードのメモリを有効に利用することができる。
<Effects> As described above, in the IC card of the present invention, the memory of the IC card can be used effectively.

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

第1図は本発明に係るICカードの構成を示すブロック
図、第2図は本発明の一実施例のICカードの概略構成を
示すブロック図、第3図および第4図は一実施例に係る
ICカードのメモリエリアの構成を示す概念図、第5図〜
第7図はそれぞれ一実施例に係るICカードシステムでの
外部端末機器との間の通信手順を示すフローチャート、
第8図は外部端末機器とICカードとの間で用いられる通
信フォーマットの構造を示す図、第9図は従来のICカー
ドのメモリの階層構造を示す図、第10図〜第12図はそれ
ぞれ従来のICカードシステムでの外部端末機器との間の
通信手順を示すフローチャートである。 100……ICカード、 110……第1のエリア、 120……第2のエリア、 130……属性記述部、 140……読出判定手段、 150……出力手段、 160……書込判定手段、 170……格納手段、 200……外部端末機器。
FIG. 1 is a block diagram showing a configuration of an IC card according to the present invention, FIG. 2 is a block diagram showing a schematic configuration of an IC card according to an embodiment of the present invention, and FIGS. Pertain
FIG. 5 is a conceptual diagram showing the configuration of the memory area of the IC card.
FIG. 7 is a flowchart showing a communication procedure with an external terminal device in the IC card system according to one embodiment,
FIG. 8 is a diagram showing a structure of a communication format used between an external terminal device and an IC card, FIG. 9 is a diagram showing a hierarchical structure of a memory of a conventional IC card, and FIGS. 9 is a flowchart showing a communication procedure with an external terminal device in a conventional IC card system. 100 IC card 110 First area 120 Second area 130 Attribute description section 140 Read determination means 150 Output means 160 Write determination means 170: storage means, 200: external terminal equipment.

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06K 19/00 G06F 3/08──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 6 , DB name) G06K 19/00 G06F 3/08

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】256バイト以上の長さのユーザデータを格
納する場合に2バイトのデータ長さ表示部分を付加する
第1のエリア、256バイト未満の長さのユーザデータを
格納する場合に1バイトのデータ長さ表示部分を付加す
る第2のエリア、これらのエリアを識別する識別コード
を格納した属性記述部、を有すICカードと、 このICカードとの間で、1回の通信で送信するユーザデ
ータの長さを2バイトで表示するデータ長さ表示部分
を、その送信するユーザデータに付加した通信フォーマ
ットに基づいてユーザデータの授受を行なう外部端末機
器と、を備えたICカードの通信システムにおいて、 データの読み出し時、上記属性記述部をサーチして上記
識別コードを判定する読出判定手段と、 この識別コードが第2のエリアであるときはこの読み出
しデータのデータ長さを表示部分に上位バイトを付加し
て出力する出力手段と、 上記外部端末機器から送信されてきたデータのデータ長
さ表示部分を識別して、送信されてきたデータのデータ
長さが256バイト以上か256バイト未満かを判定する書込
判定手段と、 その送信データが256バイト未満の場合はそのデータ長
さ表示部分から上位バイトを削除して第2のエリアに格
納する格納手段と、を備えたことを特徴とするICカー
ド。
1. A first area to which a 2-byte data length display portion is added when storing user data having a length of 256 bytes or more, and 1 when storing user data having a length of less than 256 bytes. An IC card having a second area to which a byte data length display portion is added, an attribute description section storing identification codes for identifying these areas, and a single communication between the IC card and the IC card. An external terminal device for transmitting and receiving user data based on a communication format added to the user data to be transmitted, and a data length display portion for displaying the length of user data to be transmitted in 2 bytes. In the communication system, at the time of data reading, read determination means for searching the attribute description section to determine the identification code; and when the identification code is in the second area, read the data. Output means for adding a high-order byte to the display portion to output the data length of the data; and identifying the data length display portion of the data transmitted from the external terminal device to determine the data length of the transmitted data. Determination means for determining whether the data length is 256 bytes or more and less than 256 bytes, and when the transmission data is less than 256 bytes, deletes the upper byte from the data length display portion and stores it in the second area And an IC card.
JP2087180A 1990-03-31 1990-03-31 IC card Expired - Lifetime JP2782908B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2087180A JP2782908B2 (en) 1990-03-31 1990-03-31 IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2087180A JP2782908B2 (en) 1990-03-31 1990-03-31 IC card

Publications (2)

Publication Number Publication Date
JPH03286276A JPH03286276A (en) 1991-12-17
JP2782908B2 true JP2782908B2 (en) 1998-08-06

Family

ID=13907792

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2087180A Expired - Lifetime JP2782908B2 (en) 1990-03-31 1990-03-31 IC card

Country Status (1)

Country Link
JP (1) JP2782908B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4594639B2 (en) * 2004-03-31 2010-12-08 株式会社東芝 Portable electronic device

Also Published As

Publication number Publication date
JPH03286276A (en) 1991-12-17

Similar Documents

Publication Publication Date Title
JP3072722B2 (en) Data management device and data management method using flash memory and storage medium using flash memory
JP2537199B2 (en) IC card
US6477616B1 (en) Storage device, storage system, memory management method, recording medium, and computer data signal
KR100209853B1 (en) Flash memory card
US5051895A (en) Apparatus and method for tracking and identifying printed circuit assemblies
JP3028815B2 (en) Transmission method of portable electronic device and portable electronic device
JP3480746B2 (en) Portable electronic devices
US4975872A (en) Dual port memory device with tag bit marking
US5829014A (en) Method of supervising storage of data in a memory card having EEPROM and a memory card system using the same
JP2782908B2 (en) IC card
JP3471842B2 (en) Data management device, data storage device, and data management method
JP2000218044A (en) Portable electronic game equipment
JPH09231113A (en) Ic card
JP3625879B2 (en) Information recording medium with memory check function
JP3718564B2 (en) IC card
JP3117244B2 (en) EEPROM control device
JP2001005928A (en) Ic card
JP2808358B2 (en) IC card
JP2850049B2 (en) IC card
JP3163124B2 (en) Electronic still camera device
JP3641693B2 (en) IC card and method of using the same
JP2999333B2 (en) Vending machines and data loaders
JPH04313882A (en) Record control system for memory card
JP3113267B2 (en) IC card
JPH1074243A (en) Ic card