JPH06282702A - Information recording medium with built-in cpu - Google Patents

Information recording medium with built-in cpu

Info

Publication number
JPH06282702A
JPH06282702A JP5089329A JP8932993A JPH06282702A JP H06282702 A JPH06282702 A JP H06282702A JP 5089329 A JP5089329 A JP 5089329A JP 8932993 A JP8932993 A JP 8932993A JP H06282702 A JPH06282702 A JP H06282702A
Authority
JP
Japan
Prior art keywords
directory
file
recorded
eeprom
address
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
JP5089329A
Other languages
Japanese (ja)
Inventor
Kazuyoshi Irisawa
和義 入澤
Hirotsugu Harima
博嗣 針間
Teruaki Jo
輝明 城
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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon 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 Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP5089329A priority Critical patent/JPH06282702A/en
Publication of JPH06282702A publication Critical patent/JPH06282702A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide an IC card which can more efficiently deal with error generation. CONSTITUTION:Inside an EEPROM 15 of the IC card, files A and B and directories (a) and (b) for accessing these files are recorded, and an allocation pointer AP showing an address to record the new file and a directory pointer DP showing an address to record the new directory are recorded. When any error is generated at the DP, the DP is recovered by searching a first non-recorded area by executing a first recovery command (1). When any error is generated at the AP, the AP is recovered based on the contents of the final directory (b) by executing a second recovery command (2). When any error is generated at the directory (a), invalid information is written (3).

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、CPUを内蔵した情報
記録媒体、特に、EEPROM内に複数のファイル記録
領域を定義してデータをファイルごとに分類して記録す
るようにし、各ファイルをアクセスするために必要なア
ドレス情報をもったディレクトリを各ファイルごとに用
意する情報記録媒体に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information recording medium having a built-in CPU, and in particular, a plurality of file recording areas are defined in an EEPROM so that data is classified and recorded for each file and each file is accessed. The present invention relates to an information recording medium that prepares a directory having address information necessary for each file for each file.

【0002】[0002]

【従来の技術】磁気カードに代わる新しい情報記録媒体
として、ICカードが注目を集めている。特に、CPU
を内蔵したICカードは、高度なセキュリティを有する
ため、種々の分野での利用が期待されている。一般にI
Cカードは、RAM,ROM,EEPROMといった3
種類のメモリを内蔵しており、いずれも内蔵CPUによ
ってアクセスされる。ICカードに対するデータの授受
は、リーダライタ装置によって行われる。リーダライタ
装置からICカードに対して所定の命令を与えると、こ
の命令はICカード内のCPUによって実行される。た
とえば、データの書込命令であれば、リーダライタ装置
からICカードへ与えたデータがICカード内のメモリ
に書き込まれ、データの読出命令であれば、ICカード
内のメモリから読み出されたデータがリーダライタ装置
へ転送される。
2. Description of the Related Art IC cards have attracted attention as a new information recording medium replacing magnetic cards. Especially CPU
Since the IC card having a built-in card has a high degree of security, it is expected to be used in various fields. Generally I
C card has 3 such as RAM, ROM, EEPROM
It has built-in types of memory, both of which are accessed by the built-in CPU. The reader / writer device exchanges data with the IC card. When a given command is given from the reader / writer device to the IC card, this command is executed by the CPU in the IC card. For example, in the case of a data write command, the data given to the IC card from the reader / writer device is written in the memory in the IC card, and in the case of a data read command, the data read from the memory in the IC card. Is transferred to the reader / writer device.

【0003】ICカードに記録すべきユーザデータは、
EEPROM内に書き込まれる。通常は、EEPROM
内に複数のファイル記録領域を定義してデータをファイ
ルごとに分類して記録することになる。この場合、各フ
ァイルをアクセスするために必要なアドレス情報をもっ
たディレクトリが各ファイルごとに作成され、このディ
レクトリもEEPROM内に記録される。特定のデータ
ファイルをアクセスする場合には、まずこのファイルの
アクセスに必要な情報をもったディレクトリを読み出
し、このディレクトリの内容に基づいてデータファイル
のアクセスが行われることになる。
The user data to be recorded in the IC card is
Written in EEPROM. Usually EEPROM
A plurality of file recording areas are defined in the file, and data is classified and recorded for each file. In this case, a directory having the address information necessary for accessing each file is created for each file, and this directory is also recorded in the EEPROM. When accessing a specific data file, first, a directory having information necessary for accessing this file is read, and the data file is accessed based on the contents of this directory.

【0004】このように、EEPROM内には、複数の
データファイルと、複数のディレクトリとが書き込まれ
る。このため、新たなデータファイルおよび新たなディ
レクトリを追加書き込みする場合には、所定のアドレス
に順序良く書き込んでゆく必要がある。そこで、通常
は、新たなファイルデータを記録すべきアドレスを示す
割り当てポインタと、新たなディレクトリを記録すべき
アドレスを示すディレクトリポインタと、を用意し、こ
れらのポインタを逐次更新しながら、新たな書き込み処
理の管理を行っている。
As described above, a plurality of data files and a plurality of directories are written in the EEPROM. For this reason, when additionally writing a new data file and a new directory, it is necessary to sequentially write at a predetermined address. Therefore, normally, an allocation pointer indicating an address at which new file data should be recorded and a directory pointer at an address at which a new directory should be recorded are prepared, and new writing is performed while these pointers are sequentially updated. It manages processing.

【0005】[0005]

【発明が解決しようとする課題】上述した割り当てポイ
ンタおよびディレクトリポインタは、新たなデータファ
イルやディレクトリを書き込む処理を行う場合に重要な
役割を果たす。これらのポインタの内容に誤りが生じる
と、既存のデータファイルやディレクトリが書き込まれ
た領域に、新たなデータファイルやディレクトリを重ね
書きしてしまうような事故が発生することになる。とこ
ろが、ICカードなどの携帯用の情報記録媒体は、一般
的な設置型の情報記録媒体に比べて、粗雑な環境におい
て使用されることが多く、メモリに記録した内容にエラ
ーが生じる可能性が高い。このため、従来は、上記ポイ
ンタの内容を複数箇所に記録して冗長性をもたせるなど
の方法により、エラー発生時に対処している。しかしな
がら、このような方法では、冗長性を増せば増すほどメ
モリの使用効率が低下してしまう。
The above-mentioned allocation pointer and directory pointer play an important role when writing a new data file or directory. If the contents of these pointers are incorrect, an accident will occur in which a new data file or directory is overwritten in the area where the existing data file or directory has been written. However, a portable information recording medium such as an IC card is often used in a rough environment as compared with a general stationary information recording medium, and an error may occur in the contents recorded in the memory. high. Therefore, conventionally, when the error occurs, it is dealt with by a method of recording the contents of the pointer at a plurality of places to provide redundancy. However, in such a method, the more the redundancy increases, the less the memory usage efficiency decreases.

【0006】そこで本発明は、エラー発生に対して、よ
り効率的な対処を行うことのできるCPUを内蔵した情
報記録媒体を提供することを目的とする。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide an information recording medium having a built-in CPU capable of more efficiently coping with the occurrence of an error.

【0007】[0007]

【課題を解決するための手段】[Means for Solving the Problems]

(1) 本願第1の発明は、少なくともRAM,ROM,
EEPROMの3種類のメモリと、このメモリをアクセ
スする機能をもったCPUと、を内蔵し、EEPROM
内に複数のファイル記録領域を定義してデータをファイ
ルごとに分類して記録するようにし、各ファイルをアク
セスするために必要なアドレス情報をもったディレクト
リを各ファイルごとに用意し、このディレクトリをEE
PROM内に記録するようにした情報記録媒体におい
て、新たなディレクトリを記録すべきアドレスを示すデ
ィレクトリポインタを、所定のエラーチェックコードと
ともにEEPROM内に設けられた制御情報領域に書き
込むようにし、このエラーチェックコードを用いたチェ
ックにより異常が認識され、かつ、外部から所定のリカ
バリコマンドが与えられたときに、EEPROM内のデ
ィレクトリ記録領域を先頭から順に探索し、最初の未書
込領域のアドレスを正しいディレクトリポインタとして
書き込む処理を行うようにしたものである。
(1) At least a RAM, a ROM,
The EEPROM has three built-in memories and a CPU having a function of accessing this memory.
Multiple file recording areas are defined in the file so that the data can be classified and recorded for each file, and a directory with the address information required to access each file is prepared for each file. EE
In the information recording medium recorded in the PROM, a directory pointer indicating an address for recording a new directory is written in a control information area provided in the EEPROM together with a predetermined error check code, and this error check is performed. When the abnormality is recognized by the check using the code and a predetermined recovery command is given from the outside, the directory recording areas in the EEPROM are searched in order from the beginning, and the address of the first unwritten area is set to the correct directory. The writing process is performed as a pointer.

【0008】(2) 本願第2の発明は、少なくともRA
M,ROM,EEPROMの3種類のメモリと、このメ
モリをアクセスする機能をもったCPUと、を内蔵し、
EEPROM内に複数のファイル記録領域を定義してデ
ータをファイルごとに分類して記録するようにし、各フ
ァイルをアクセスするために必要なアドレス情報をもっ
たディレクトリを各ファイルごとに用意し、このディレ
クトリをEEPROM内に記録するようにした情報記録
媒体において、新たなファイルデータを記録すべきアド
レスを示す割り当てポインタを、所定のエラーチェック
コードとともにEEPROM内に設けられた制御情報領
域に書き込むようにし、このエラーチェックコードを用
いたチェックにより異常が認識され、かつ、外部から所
定のリカバリコマンドが与えられたときに、EEPRO
M内に記録された最終ディレクトリに記述されたアドレ
ス情報に基づいて、割り当てポインタを正しいものに書
き換える処理を行うようにしたものである。
(2) The second invention of the present application is at least RA.
Incorporates three types of memory, M, ROM, and EEPROM, and a CPU having a function of accessing this memory,
A plurality of file recording areas are defined in the EEPROM so that data is classified and recorded for each file, and a directory having address information necessary for accessing each file is prepared for each file. In an information recording medium in which is recorded in the EEPROM, an allocation pointer indicating an address at which new file data should be recorded is written in a control information area provided in the EEPROM together with a predetermined error check code. When the abnormality is recognized by the check using the error check code and a predetermined recovery command is given from the outside, EEPRO
This is a process for rewriting the allocation pointer to a correct one based on the address information described in the final directory recorded in M.

【0009】(3) 本願第3の発明は、少なくともRA
M,ROM,EEPROMの3種類のメモリと、このメ
モリをアクセスする機能をもったCPUと、を内蔵し、
EEPROM内に複数のファイル記録領域を定義してデ
ータをファイルごとに分類して記録するようにし、各フ
ァイルをアクセスするために必要なアドレス情報をもっ
たディレクトリを各ファイルごとに用意し、このディレ
クトリをEEPROM内に記録するようにした情報記録
媒体において、各ディレクトリを所定のエラーチェック
コードとともに書き込むようにし、このエラーチェック
コードを用いたチェックにより異常が認識され、かつ、
外部から所定のリカバリコマンドが与えられたときに、
異常が認識されたディレクトリを、そのディレクトリが
無効であることを示す情報を含んだディレクトリに書き
換える処理を行うようにしたものである。
(3) The third invention of the present application is at least RA
Incorporates three types of memory, M, ROM, and EEPROM, and a CPU having a function of accessing this memory,
A plurality of file recording areas are defined in the EEPROM so that data is classified and recorded for each file, and a directory having address information necessary for accessing each file is prepared for each file. Is recorded in the EEPROM, each directory is written together with a predetermined error check code, and an abnormality is recognized by the check using this error check code, and
When a predetermined recovery command is given from the outside,
The process is performed such that the directory in which the abnormality is recognized is rewritten to the directory containing the information indicating that the directory is invalid.

【0010】[0010]

【作 用】本発明に係る情報記録媒体では、ディレクト
リポインタ、割り当てポインタ、およびディレクトリ
が、エラーチェックコードとともに記録され、このエラ
ーチェックコードを用いたチェックにより、エラー発生
時には異常を認識することができる。異常が認識された
場合には、所定のリカバリコマンドを与えることによ
り、エラーに対する処置を行うことが可能である。すな
わち、ディレクトリポインタに対するリカバリコマンド
を与えると、EEPROM内のディレクトリ記録領域を
先頭から順に探索し、最初の未書込領域のアドレスを正
しいディレクトリポインタとして認識し、エラーの修正
を行う。また、割り当てポインタに対するリカバリコマ
ンドを与えると、EEPROM内に記録された最終ディ
レクトリに記述されたアドレス情報に基づいて、エラー
の修正を行う。更に、エラーの発生したディレクトリに
対するリカバリコマンドを与えると、そのディレクトリ
が無効であることを示す情報の書き込みが行われ、以
後、そのディレクトリによるデータファイルのアクセス
を無効化することができる。
[Operation] In the information recording medium according to the present invention, a directory pointer, an allocation pointer, and a directory are recorded together with an error check code, and an abnormality can be recognized when an error occurs by checking using this error check code. . When an abnormality is recognized, it is possible to deal with the error by giving a predetermined recovery command. That is, when a recovery command is given to the directory pointer, the directory recording area in the EEPROM is searched in order from the beginning, and the address of the first unwritten area is recognized as the correct directory pointer, and the error is corrected. Further, when a recovery command is given to the allocation pointer, the error is corrected based on the address information written in the final directory recorded in the EEPROM. Furthermore, when a recovery command is given to the directory in which the error has occurred, information indicating that the directory is invalid is written, and thereafter, access to the data file by the directory can be invalidated.

【0011】[0011]

【実施例】以下、本発明を図示する実施例に基づいて説
明する。図1は一般的なICカード10をリーダライタ
装置20に接続した状態を示すブロック図である。IC
カード10内には、リーダライタ装置20と接続するた
めのI/O装置11と、CPU12と、RAM13と、
ROM14と、EEPROM15と、が内蔵されてい
る。CPU12は、I/O装置11を介してリーダライ
タ装置20から与えられる命令を受け取り、これを実行
する。3種類のメモリのうち、RAM13は揮発性のメ
モリであって、CPU12のワークエリアとして利用さ
れる。ROM14およびEEPROM15は、いずれも
不揮発性のメモリであるが、ROM14は読出し専用で
あるのに対し、EEPROMは随時書き換えを行うこと
ができる。このため、ROM14には、CPU12に実
行させるプログラムが用意され、EEPROM15に
は、ユーザデータがファイルごとに記録される。図2
は、このEEPROM15に定義された2つの領域を示
す図である。制御情報領域15aには、割り当てポイン
タAP、ディレクトリポインタDP、その他の制御情報
が書き込まれ、ファイル/ディレクトリ領域15bに
は、ユーザデータがファイル単位で書き込まれることに
なる。
The present invention will be described below based on illustrated embodiments. FIG. 1 is a block diagram showing a state in which a general IC card 10 is connected to a reader / writer device 20. IC
In the card 10, an I / O device 11 for connecting to the reader / writer device 20, a CPU 12, a RAM 13,
The ROM 14 and the EEPROM 15 are built in. The CPU 12 receives an instruction given from the reader / writer device 20 via the I / O device 11 and executes it. Of the three types of memories, the RAM 13 is a volatile memory and is used as a work area for the CPU 12. The ROM 14 and the EEPROM 15 are both non-volatile memories, but the ROM 14 is read-only, whereas the EEPROM can be rewritten at any time. Therefore, a program to be executed by the CPU 12 is prepared in the ROM 14, and user data is recorded in the EEPROM 15 for each file. Figure 2
FIG. 3 is a diagram showing two areas defined in the EEPROM 15. The allocation pointer AP, the directory pointer DP and other control information are written in the control information area 15a, and the user data is written in file units in the file / directory area 15b.

【0012】図3は、本発明の一実施例に係るICカー
ドにおけるEEPROM15のメモリマップである。こ
こに示す例では、ファイル/ディレクトリ領域15bに
は、ファイルA,ファイルBという2組のユーザデータ
と、これらのファイルをアクセスするために必要な情報
をもったディレクトリa,ディレクトリbという2組の
ディレクトリとが既に書き込まれている。ディレクトリ
aはファイルAをアクセスするために必要な情報を有
し、ディレクトリbはファイルBをアクセスするために
必要な情報を有する。具体的には、各ディレクトリに
は、対応するファイルのファイル名、先頭アドレス、全
データ長、アクセスするために必要なキーに関する情
報、などが記録されることになる。このように、データ
ファイルもディレクトリも、いずれもファイル/ディレ
クトリ領域15bに書き込まれることになるが、この実
施例では、データファイルについては、図の上端から下
へ向かって順に書き込みが行われ、ディレクトリについ
ては、図の下端から上へ向かって順に書き込みが行われ
ることになる。
FIG. 3 is a memory map of the EEPROM 15 in the IC card according to the embodiment of the present invention. In the example shown here, in the file / directory area 15b, there are two sets of user data, file A and file B, and two sets of directory a and directory b, which have information necessary to access these files. The directories and have already been written. The directory a has information necessary to access the file A, and the directory b has information necessary to access the file B. Specifically, in each directory, the file name of the corresponding file, the start address, the total data length, information regarding the key required for access, and the like are recorded. As described above, both the data file and the directory are written in the file / directory area 15b. In this embodiment, the data files are sequentially written from the upper end to the bottom of the figure, and the directory With respect to, the writing is performed in order from the lower end to the upper part of the drawing.

【0013】一方、制御情報領域15aには、割り当て
ポインタAPおよびディレクトリポインタDPが記録さ
れている。ここで、割り当てポインタAPは、新たなフ
ァイルを記録すべきアドレスを示すポインタであり、こ
こに示す例では、ファイルBの最終アドレス(図におけ
るファイルBの最下部)の次のアドレスを指している。
したがって、たとえば新たなデータファイルCを追加書
き込みする場合には、この割り当てポインタAPが指し
ているアドレスから、図の下方のアドレスに向かって書
き込みが行われることになる。これに対し、ディレクト
リポインタDPは、新たなディレクトリを記録すべきア
ドレスを示すポインタであり、ここに示す例では、ディ
レクトリbの最終アドレス(図におけるディレクトリb
の最上部)の次のアドレスを指している。したがって、
新たなディレクトリcを追加書き込みする場合には、こ
のディレクトリポインタDPが指しているアドレスか
ら、図の上方のアドレスに向かって書き込みが行われる
ことになる。
On the other hand, an allocation pointer AP and a directory pointer DP are recorded in the control information area 15a. Here, the allocation pointer AP is a pointer indicating an address at which a new file should be recorded, and in the example shown here, indicates an address next to the final address of the file B (the bottommost part of the file B in the figure). .
Therefore, for example, when additionally writing a new data file C, the writing is performed from the address pointed to by the allocation pointer AP toward the lower address in the figure. On the other hand, the directory pointer DP is a pointer indicating the address at which a new directory should be recorded. In the example shown here, the final address of the directory b (the directory b in the figure).
Point to the next address). Therefore,
When additionally writing a new directory c, the writing is performed from the address pointed to by the directory pointer DP toward the upper address in the figure.

【0014】図3に示されているように、各ディレクト
リa,bは、エラーチェックコードCRCが付加された
状態で記録されている。また、割り当てポインタAPお
よびディレクトリポインタDPも、エラーチェックコー
ドCRCが付加された状態で記録されている。更に、図
には示されていないが、各ファイルA,B内のデータ
も、一定のデータ長ごとにエラーチェックコードCRC
が付加された状態で記録されている。これらエラーチェ
ックコードCRCに基づくチェックを行うことにより、
各記録内容にエラーが発生しているか否かを認識するこ
とができる。
As shown in FIG. 3, the directories a and b are recorded with the error check code CRC added. The allocation pointer AP and the directory pointer DP are also recorded with the error check code CRC added. Further, although not shown in the figure, the data in each of the files A and B also has an error check code CRC for each fixed data length.
Is recorded in the state where is added. By checking based on these error check code CRC,
It is possible to recognize whether or not an error has occurred in each recorded content.

【0015】割り当てポインタAPおよびディレクトリ
ポインタDPは、新たなデータファイルやディレクトリ
を追加書き込みする上で重要な役割を果し、これらのポ
インタの内容にエラーが発生すると、重大な支障を来た
すことになる。図4は、これらのポインタの内容にエラ
ーが発生し、ポインタが誤ったアドレスを指している状
態を示す。この例では、割り当てポインタAPはファイ
ルA内のアドレスを指しており、このままの状態で新た
なデータファイルCの追加書き込みを行うと、ファイル
Aの上に重ねてデータの記録が行われてしまうため、フ
ァイルAの内容が失われることになる。また、ディレク
トリポインタDPはファイルB内のアドレスを指してお
り、このままの状態で新たなディレクトリCの追加書き
込みを行うと、ファイルBの上に重ねてディレクトリの
記録が行われてしまうため、ファイルBの内容が失われ
ることになる。
The allocation pointer AP and the directory pointer DP play an important role in additionally writing a new data file or directory, and if an error occurs in the contents of these pointers, it causes a serious trouble. . FIG. 4 shows a situation where an error has occurred in the contents of these pointers and the pointers point to the wrong address. In this example, the allocation pointer AP points to an address in the file A, and if additional writing of a new data file C is performed in this state, data will be recorded over the file A. , The contents of file A will be lost. Further, the directory pointer DP points to an address in the file B, and if additional writing of a new directory C is performed in this state, the directory is recorded over the file B. Will be lost.

【0016】そこで、EEPROM15に記録された種
々の情報にエラーが生じた場合に対処できるように、こ
の実施例のICカードには、自己診断ルーチンが設けら
れている。すなわち、図5の流れ図に示す手順による診
断を行うための診断プログラムがROM14内に記述さ
れており、CPU12はリセットがかかるたびにこの診
断プログラムを実行する。まず、ステップS1におい
て、割り当てポインタAPおよびディレクトリポインタ
DPのCRCチェックが行われる。すなわち、制御情報
領域15aから、ポインタAPおよびDPをそれぞれの
エラーチェックコードCRCとともに読み出し、エラー
チェックコードが正常であるかを認識する。異常が発見
されたら、ステップS2からステップS3へと分岐し、
制御情報の異常ステータスをセットする。続いて、ステ
ップS4において、各ディレクトリのCRCチェックが
行われる。すなわち、ファイル/ディレクトリ領域15
bから、各ディレクトリa,bをそれぞれのエラーチェ
ックコードCRCとともに読み出し、エラーチェックコ
ードが正常であるかを認識する。異常が発見されたら、
ステップS5からステップS6へと分岐し、ディレクト
リの異常ステータスをセットする。更に、ステップS7
において、各データファイルのCRCチェックが行われ
る。すなわち、ファイル/ディレクトリ領域15bか
ら、各ファイルデータA,Bをそれぞれのエラーチェッ
クコードCRCとともに読み出し、エラーチェックコー
ドが正常であるかを認識する。異常が発見されたら、ス
テップS8からステップS9へと分岐し、ファイル内デ
ータの異常ステータスをセットする。こうしてエラーチ
ェックが完了したら、最後にステップS10において、
ステータス通知処理が行われる。これは、リーダライタ
装置20に対して、各異常ステータスがセットされてい
るか否かを通知する処理である。結局、CPU12に対
してリセットをかけるたびに、ステータスが通知される
ことになる。具体的には、リーダライタ装置20に接続
されたディスプレイ装置などの画面に、エラーメッセー
ジの形式で表示が行われることになる。なお、この自己
診断ルーチンは、CPU12をリセットした場合だけで
なく、リーダライタ装置20から所定の診断コマンドを
与えることによっても実行させることができる。
Therefore, the IC card of this embodiment is provided with a self-diagnosis routine so as to be able to cope with an error in various information recorded in the EEPROM 15. That is, a diagnostic program for performing diagnosis according to the procedure shown in the flowchart of FIG. 5 is described in the ROM 14, and the CPU 12 executes this diagnostic program each time reset is applied. First, in step S1, a CRC check of the allocation pointer AP and the directory pointer DP is performed. That is, the pointers AP and DP are read out from the control information area 15a together with their respective error check codes CRC, and it is recognized whether the error check codes are normal. If an abnormality is found, the process branches from step S2 to step S3,
Set the abnormal status of control information. Then, in step S4, the CRC check of each directory is performed. That is, the file / directory area 15
The directories a and b are read from b together with their respective error check codes CRC to recognize whether the error check codes are normal. If an abnormality is found,
The process branches from step S5 to step S6 to set the abnormal status of the directory. Further, step S7
At, the CRC check of each data file is performed. That is, each file data A and B is read from the file / directory area 15b together with the respective error check code CRC, and it is recognized whether the error check code is normal. If an abnormality is found, the process branches from step S8 to step S9 to set the abnormality status of the data in the file. When the error check is completed in this way, finally in step S10,
Status notification processing is performed. This is a process of notifying the reader / writer device 20 whether or not each abnormal status is set. After all, the status is notified each time the CPU 12 is reset. Specifically, the error message format is displayed on the screen of a display device or the like connected to the reader / writer device 20. The self-diagnosis routine can be executed not only when the CPU 12 is reset, but also by giving a predetermined diagnosis command from the reader / writer device 20.

【0017】本発明の特徴は、このような自己診断の結
果、エラーの発生が認められた場合に、エラーに対する
適切な処置を行うためのリカバリコマンドを用意した点
にある。別言すれば、リーダライタ装置20からこのリ
カバリコマンドが与えられた場合に、後述する処理を行
うためのリカバリ処理プログラムがROM14内に用意
されていることになる。この実施例のICカードには、
以下に説明する3種類のリカバリコマンドが用意されて
いる。
The feature of the present invention resides in that a recovery command is provided for taking appropriate measures against the error when the occurrence of the error is recognized as a result of such self-diagnosis. In other words, when this recovery command is given from the reader / writer device 20, a recovery processing program for performing the processing described later is prepared in the ROM 14. The IC card of this embodiment includes
There are three types of recovery commands described below.

【0018】第1のリカバリコマンドは、ディレクトリ
ポインタDPを回復させるためのコマンドである。上述
の自己診断の結果、ディレクトリポインタDPにエラー
が発生している旨のエラーメッセージが表示されたら、
オペレータは、この第1のリカバリコマンドを示す文字
列(たとえば、RECOVERY DP)をリーダライ
タ装置20から入力する。CPU12は、この第1のリ
カバリコマンドを受けとったら、次のような処理を行
う。まず、図6の矢印に示すように、ファイル/ディ
レクトリ領域15bにおけるディレクトリ記録領域の先
頭アドレス(図における最下部)から順に(図における
上方へ向かって)、各アドレスに記録されたデータの内
容を読み込んでゆき、最初の未書込領域の探索を行う。
そして、最初の未書込領域が発見されたら、そのアドレ
スを正しいディレクトリポインタDPの値として、制御
情報領域15a内に書き込むのである。この処理によ
り、ディレクトリポインタDPは回復する。
The first recovery command is a command for recovering the directory pointer DP. As a result of the above self-diagnosis, if an error message indicating that an error has occurred in the directory pointer DP is displayed,
The operator inputs a character string (for example, RECOVERY DP) indicating the first recovery command from the reader / writer device 20. Upon receiving the first recovery command, the CPU 12 performs the following processing. First, as shown by the arrows in FIG. 6, the contents of the data recorded at the respective addresses are sequentially (from the top in the drawing) to the top address (the bottom in the drawing) of the directory recording area in the file / directory area 15b. After reading, the first unwritten area is searched.
When the first unwritten area is found, the address is written in the control information area 15a as the correct value of the directory pointer DP. By this processing, the directory pointer DP is restored.

【0019】なお、未書込領域か否かの判断は、たとえ
ば、次のような方法によって行うことができる。すなわ
ち、このICカードを発行した時点において、EEPR
OM15のすべてのバイトを「FF」に設定しておく。
そして、ディレクトリあるいはファイルデータとして書
き込むデータとしては、「FF」以外のデータを用いる
ように決めておく。こうすれば、書き込みが行われた領
域のバイトは、必ず「FF」以外の値を示すことにな
る。したがって、最初に「FF」の値をもったバイトが
発見されたら、そこが「最初の未書込領域」ということ
になる。より好ましくは、「FF」の値をもったバイト
が最初に発見できたら、そこから先の数バイト分も探索
を進め、いずれも「FF」の値をもったバイトであるか
否かを確認するとよい。このような確認を行っておけ
ば、たまたま1バイトだけ「FF」に化けてしまったよ
うな事態が生じても、未書込領域の確実な認識が可能に
なる。
The judgment as to whether or not the area is an unwritten area can be made, for example, by the following method. That is, at the time of issuing this IC card, the EEPR
All bytes of OM15 are set to "FF".
Then, as the data to be written as the directory or file data, it is decided to use data other than "FF". In this way, the byte in the written area always shows a value other than "FF". Therefore, when the byte having the value of "FF" is first discovered, that is the "first unwritten area". More preferably, when the byte with the value of "FF" is found first, the search is advanced for several bytes beyond that, and it is confirmed whether or not the byte has the value of "FF". Good to do. By making such a confirmation, even if it happens that only one byte is changed to "FF", the unwritten area can be surely recognized.

【0020】第2のリカバリコマンドは、割り当てポイ
ンタAPを回復させるためのコマンドである。上述の自
己診断の結果、割り当てポインタAPにエラーが発生し
ている旨のエラーメッセージが表示されたら、オペレー
タは、この第2のリカバリコマンドを示す文字列(たと
えば、RECOVERY AP)をリーダライタ装置2
0から入力する。CPU12は、この第2のリカバリコ
マンドを受けとったら、次のような処理を行う。まず、
ファイル/ディレクトリ領域15bにおけるディレクト
リ記録領域に記録された最終ディレクトリ(図6の例で
は、ディレクトリb)を読み込む。そして、このディレ
クトリbに記録されているファイルBの先頭アドレスお
よび全データ長Lを読み取り、これらの和に基づいて、
ファイルBの最終アドレスの次のアドレス(図6の矢印
に示されているアドレス)を求め、このアドレスを正
しい割り当てポインタAPの値として、制御情報領域1
5a内に書き込むのである。この処理により、割り当て
ポインタDPは回復する。
The second recovery command is a command for recovering the allocation pointer AP. As a result of the self-diagnosis described above, when an error message indicating that an error has occurred in the allocation pointer AP is displayed, the operator sends a character string (for example, RECOVERY AP) indicating the second recovery command to the reader / writer device 2.
Enter from 0. Upon receiving the second recovery command, the CPU 12 performs the following processing. First,
The final directory (directory b in the example of FIG. 6) recorded in the directory recording area in the file / directory area 15b is read. Then, the start address and the total data length L of the file B recorded in the directory b are read, and based on the sum of these,
The address next to the final address of the file B (address indicated by the arrow in FIG. 6) is obtained, and this address is set as the correct value of the allocation pointer AP, and the control information area 1
Write in 5a. By this processing, the allocation pointer DP is restored.

【0021】第3のリカバリコマンドは、特定のディレ
クトリにエラーが生じた場合の対処を行うためのコマン
ドである。上述の自己診断の結果、たとえば、ディレク
トリaにエラーが発生している旨のエラーメッセージが
表示されたら、オペレータは、この第3のリカバリコマ
ンドをディレクトリaに対して実行することを示す文字
列(たとえば、RECOVERY DIR:a)をリー
ダライタ装置20から入力する。CPU12は、この第
3のリカバリコマンドを受けとったら、次のような処理
を行う。すなわち、図6の矢印に示されているよう
に、ファイル/ディレクトリ領域15bに記録されてい
るディレクトリaに対して、無効情報の書込みを行うの
である。この無効情報は、たとえば、「ディレクトリの
nバイト目の値が『00』である場合には、そのディレ
クトリは無効である」というような取決めをしておけ
ば、ディレクトリaのnバイト目に「00」を書込むだ
けの処理でよい。以後、このディレクトリaについて
は、無効として取り扱われることになる。この第3のリ
カバリコマンドは、エラーを回復させる機能は有しな
い。したがって、上述の例のように、ディレクトリaに
エラーが発生した場合は、もはやファイルAをアクセス
することはできなくなる。ただ、ディレクトリaを無効
化しておくことにより、誤ったディレクトリを用いて誤
ったファイルアクセスが行われることは防ぐことができ
る。
The third recovery command is a command for dealing with a case where an error occurs in a specific directory. As a result of the self-diagnosis described above, for example, when an error message indicating that an error has occurred in the directory a is displayed, the operator uses a character string () that indicates that the third recovery command is executed for the directory a. For example, RECOVERY DIR: a) is input from the reader / writer device 20. Upon receiving the third recovery command, the CPU 12 performs the following processing. That is, as shown by the arrow in FIG. 6, invalid information is written in the directory a recorded in the file / directory area 15b. This invalid information is, for example, "if the value of the n-th byte of the directory is" 00 ", the directory is invalid", and the invalid information is "n-th byte of the directory a". All that is necessary is to write "00". After that, the directory a will be treated as invalid. This third recovery command does not have a function of recovering an error. Therefore, as in the above example, when an error occurs in the directory a, the file A can no longer be accessed. However, by invalidating the directory a, it is possible to prevent erroneous file access using the wrong directory.

【0022】以上、3種類のリカバリコマンドについて
説明したが、本発明の特徴は、これらのリカバリコマン
ドの入力によって、ICカード内部でエラーに対する処
置を行わせるようにした点にある。別言すれば、リーダ
ライタ装置20に接続されたディスプレイ装置の画面上
に、何らかのエラーの発生を報知するメッセージが現れ
たとしても、オペレータがこれに対して何らかのリカバ
リコマンドを入力しない限り、CPU12はエラーに対
する処理を行わないのである。もちろん、図5に示す自
己診断ルーチンの実施によりエラーが認識されたら、リ
ーダライタ装置20からのリカバリコマンドの入力を待
たずに、このエラーに対する処理を自動的に行うように
プログラムしておくこともできる。しかしながら、一般
に、ICカードに内蔵されたEEPROM内のデータが
破壊される一番の原因は、電磁的なノイズ等の外乱によ
るものである。したがって、このようなノイズが依然と
して残っている環境において、自動的にエラーの回復処
理を行うことは危険である。本発明では、リカバリコマ
ンドを入力することによって、はじめてエラーの回復処
理が実行される。オペレータは、ノイズ等の外乱が存在
しない環境を確認した上で、リカバリコマンドの入力を
行えばよい。
Although three types of recovery commands have been described above, the feature of the present invention resides in that the input of these recovery commands causes the IC card to take measures against the error. In other words, even if a message notifying that an error has occurred appears on the screen of the display device connected to the reader / writer device 20, unless the operator inputs a recovery command for the message, the CPU 12 It does not process the error. Of course, if an error is recognized by executing the self-diagnosis routine shown in FIG. 5, it is possible to program the processing for this error automatically without waiting for the input of the recovery command from the reader / writer device 20. it can. However, generally, the main cause of destroying the data in the EEPROM incorporated in the IC card is the disturbance such as electromagnetic noise. Therefore, in an environment where such noise still remains, it is dangerous to automatically perform error recovery processing. In the present invention, an error recovery process is first executed by inputting a recovery command. The operator may confirm the environment where no disturbance such as noise exists and then input the recovery command.

【0023】以上、本発明を図示する実施例に基づいて
説明したが、本発明はこの実施例のみに限定されるもの
ではなく、この他にも種々の態様で実施可能である。た
とえば、上述の実施例は、ICカードに本発明を適用し
た例であるが、本発明は、CPUを内蔵した情報記録媒
体に広く適用可能である。
The present invention has been described above based on the illustrated embodiment, but the present invention is not limited to this embodiment and can be implemented in various modes other than this. For example, the above-described embodiment is an example in which the present invention is applied to an IC card, but the present invention can be widely applied to an information recording medium having a built-in CPU.

【0024】[0024]

【発明の効果】以上のとおり本発明に係る情報記録媒体
によれば、内蔵したEEPROM内のデータに対してエ
ラーが発生した場合に、所定のリカバリコマンドの入力
により、このエラーに対する処理を実行できるようにし
たため、エラー発生に対して、より効率的な対処を行う
ことができるようになる。たとえば、事故直後にカード
内部で自動的にリカバリを行うことは、事故原因となっ
た外乱がまだ残っている可能性があるため好ましくな
い。本発明では、事故発生からある程度の時間をおい
て、外乱が低減した時期を見計ってリカバリコマンドを
入力することが可能であり、外乱の影響を受けないエラ
ー処理を実現できる可能性が高くなる。
As described above, according to the information recording medium of the present invention, when an error occurs in the data in the built-in EEPROM, a predetermined recovery command can be input to execute the process for the error. As a result, it becomes possible to deal with the error occurrence more efficiently. For example, it is not preferable to automatically perform recovery inside the card immediately after the accident because the disturbance causing the accident may still remain. According to the present invention, it is possible to input a recovery command after a certain amount of time from the occurrence of an accident in anticipation of the time when the disturbance is reduced, and it is highly possible to realize error processing that is not affected by the disturbance. .

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

【図1】一般的なICカード10をリーダライタ装置2
0に接続した状態を示すブロック図である。
FIG. 1 illustrates a general IC card 10 and a reader / writer device 2
It is a block diagram which shows the state connected to 0.

【図2】図1に示すICカード10に内蔵されたEEP
ROM15に定義された領域を示す図である。
FIG. 2 is an EEP incorporated in the IC card 10 shown in FIG.
It is a figure which shows the area | region defined in ROM15.

【図3】本発明の一実施例に係るICカードにおけるE
EPROM15のメモリマップである。
FIG. 3 is an E of an IC card according to an embodiment of the present invention.
3 is a memory map of EPROM 15.

【図4】図3に示すEEPROM15における割り当て
ポインタAPおよびディレクトリポインタDPにエラー
が発生した状態を示す図である。
4 is a diagram showing a state where an error occurs in an allocation pointer AP and a directory pointer DP in the EEPROM 15 shown in FIG.

【図5】本発明の一実施例に係るICカードに用意され
た自己診断ルーチンの処理手順を示す流れ図である。
FIG. 5 is a flowchart showing a processing procedure of a self-diagnosis routine prepared in the IC card according to the embodiment of the present invention.

【図6】図4に示すエラーに対して行われる3種類のリ
カバリコマンドによる回復処理を説明する図である。
FIG. 6 is a diagram illustrating recovery processing by three types of recovery commands performed for the error shown in FIG.

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

10…ICカード 11…I/O装置 12…CPU 13…RAM 14…ROM 15…EEPROM 15a…制御情報領域 15b…ファイル/ディレクトリ領域 20…リーダライタ装置 10 ... IC card 11 ... I / O device 12 ... CPU 13 ... RAM 14 ... ROM 15 ... EEPROM 15a ... Control information area 15b ... File / directory area 20 ... Reader / writer device

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 少なくともRAM,ROM,EEPRO
Mの3種類のメモリと、このメモリをアクセスする機能
をもったCPUと、を内蔵し、前記EEPROM内に複
数のファイル記録領域を定義してデータをファイルごと
に分類して記録するようにし、各ファイルをアクセスす
るために必要なアドレス情報をもったディレクトリを各
ファイルごとに用意し、このディレクトリを前記EEP
ROM内に記録するようにした情報記録媒体において、 新たなディレクトリを記録すべきアドレスを示すディレ
クトリポインタを、所定のエラーチェックコードととも
に前記EEPROM内に設けられた制御情報領域に書き
込むようにし、前記エラーチェックコードを用いたチェ
ックにより異常が認識され、かつ、外部から所定のリカ
バリコマンドが与えられたときに、前記EEPROM内
のディレクトリ記録領域を先頭から順に探索し、最初の
未書込領域のアドレスを正しいディレクトリポインタと
して書き込む処理を行うことを特徴とするCPUを内蔵
した情報記録媒体。
1. At least RAM, ROM, EEPRO
Incorporating three types of memory M, and a CPU having a function of accessing this memory, a plurality of file recording areas are defined in the EEPROM so that data is classified and recorded for each file. A directory having address information required to access each file is prepared for each file, and this directory is used as the EEP.
In the information recording medium recorded in the ROM, a directory pointer indicating an address for recording a new directory is written in a control information area provided in the EEPROM together with a predetermined error check code, and the error is recorded. When the abnormality is recognized by the check using the check code and a predetermined recovery command is given from the outside, the directory recording area in the EEPROM is searched in order from the beginning, and the address of the first unwritten area is searched. An information recording medium having a built-in CPU, which is characterized by performing a writing process as a correct directory pointer.
【請求項2】 少なくともRAM,ROM,EEPRO
Mの3種類のメモリと、このメモリをアクセスする機能
をもったCPUと、を内蔵し、前記EEPROM内に複
数のファイル記録領域を定義してデータをファイルごと
に分類して記録するようにし、各ファイルをアクセスす
るために必要なアドレス情報をもったディレクトリを各
ファイルごとに用意し、このディレクトリを前記EEP
ROM内に記録するようにした情報記録媒体において、 新たなファイルデータを記録すべきアドレスを示す割り
当てポインタを、所定のエラーチェックコードとともに
前記EEPROM内に設けられた制御情報領域に書き込
むようにし、前記エラーチェックコードを用いたチェッ
クにより異常が認識され、かつ、外部から所定のリカバ
リコマンドが与えられたときに、前記EEPROM内に
記録された最終ディレクトリに記述されたアドレス情報
に基づいて、前記割り当てポインタを正しいものに書き
換える処理を行うことを特徴とするCPUを内蔵した情
報記録媒体。
2. At least RAM, ROM, EEPRO
Incorporating three types of memory M, and a CPU having a function of accessing this memory, a plurality of file recording areas are defined in the EEPROM so that data is classified and recorded for each file. A directory having address information required to access each file is prepared for each file, and this directory is used as the EEP.
In an information recording medium adapted to be recorded in a ROM, an allocation pointer indicating an address at which new file data should be recorded is written in a control information area provided in the EEPROM together with a predetermined error check code, When an abnormality is recognized by the check using the error check code and a predetermined recovery command is given from the outside, the allocation pointer is based on the address information described in the final directory recorded in the EEPROM. An information recording medium having a built-in CPU, which is characterized by performing the process of rewriting
【請求項3】 少なくともRAM,ROM,EEPRO
Mの3種類のメモリと、このメモリをアクセスする機能
をもったCPUと、を内蔵し、前記EEPROM内に複
数のファイル記録領域を定義してデータをファイルごと
に分類して記録するようにし、各ファイルをアクセスす
るために必要なアドレス情報をもったディレクトリを各
ファイルごとに用意し、このディレクトリを前記EEP
ROM内に記録するようにした情報記録媒体において、 各ディレクトリを所定のエラーチェックコードとともに
書き込むようにし、このエラーチェックコードを用いた
チェックにより異常が認識され、かつ、外部から所定の
リカバリコマンドが与えられたときに、異常が認識され
たディレクトリを、そのディレクトリが無効であること
を示す情報を含んだディレクトリに書き換える処理を行
うことを特徴とするCPUを内蔵した情報記録媒体。
3. At least RAM, ROM, EEPRO
Incorporating three types of memory M, and a CPU having a function of accessing this memory, a plurality of file recording areas are defined in the EEPROM so that data is classified and recorded for each file. A directory having address information required to access each file is prepared for each file, and this directory is used as the EEP.
In the information recording medium recorded in the ROM, each directory is written together with a predetermined error check code, an abnormality is recognized by the check using this error check code, and a predetermined recovery command is given from the outside. An information recording medium having a built-in CPU, which performs a process of rewriting a directory in which an abnormality is recognized to a directory containing information indicating that the directory is invalid when the information is recorded.
JP5089329A 1993-03-24 1993-03-24 Information recording medium with built-in cpu Pending JPH06282702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5089329A JPH06282702A (en) 1993-03-24 1993-03-24 Information recording medium with built-in cpu

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5089329A JPH06282702A (en) 1993-03-24 1993-03-24 Information recording medium with built-in cpu

Publications (1)

Publication Number Publication Date
JPH06282702A true JPH06282702A (en) 1994-10-07

Family

ID=13967647

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5089329A Pending JPH06282702A (en) 1993-03-24 1993-03-24 Information recording medium with built-in cpu

Country Status (1)

Country Link
JP (1) JPH06282702A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007179546A (en) * 2005-12-27 2007-07-12 Samsung Electronics Co Ltd Storage device using nonvolatile memory as cache, and operation method therefor
JP2008305518A (en) * 2007-06-11 2008-12-18 Sony Corp Recorder and recording method
US7610442B2 (en) 2002-12-24 2009-10-27 Lg Electronics Inc. Dual journaling store method and storage medium thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS603082A (en) * 1983-06-18 1985-01-09 Dainippon Printing Co Ltd Ic card
JPH03192436A (en) * 1989-12-22 1991-08-22 Hitachi Ltd Information recording and reproducing system
JPH04153792A (en) * 1990-10-17 1992-05-27 Dainippon Printing Co Ltd Ic card
JPH052536A (en) * 1991-07-25 1993-01-08 Dainippon Printing Co Ltd Ic card

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS603082A (en) * 1983-06-18 1985-01-09 Dainippon Printing Co Ltd Ic card
JPH03192436A (en) * 1989-12-22 1991-08-22 Hitachi Ltd Information recording and reproducing system
JPH04153792A (en) * 1990-10-17 1992-05-27 Dainippon Printing Co Ltd Ic card
JPH052536A (en) * 1991-07-25 1993-01-08 Dainippon Printing Co Ltd Ic card

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7610442B2 (en) 2002-12-24 2009-10-27 Lg Electronics Inc. Dual journaling store method and storage medium thereof
JP2007179546A (en) * 2005-12-27 2007-07-12 Samsung Electronics Co Ltd Storage device using nonvolatile memory as cache, and operation method therefor
JP4531742B2 (en) * 2005-12-27 2010-08-25 三星電子株式会社 Storage device using nonvolatile memory as cache and operation method thereof
JP2008305518A (en) * 2007-06-11 2008-12-18 Sony Corp Recorder and recording method

Similar Documents

Publication Publication Date Title
RU2146399C1 (en) Method for data storage in non-volatile memory unit, method for using integral circuit device, and integral circuit device
JPH0793203A (en) File managing system
JP3472008B2 (en) Flash memory management method
JPH08235028A (en) Data management method for flash memory and data processor using the data management method
US6286757B1 (en) Portable electronic apparatus
JPH06282702A (en) Information recording medium with built-in cpu
JPS63118951A (en) Single chip microcomputer
US6585155B2 (en) IC card, IC card issuing apparatus, IC card issuing system and IC card issuing method
JPS5977699A (en) Integrated circuit card
JPH09231113A (en) Ic card
JP2000357216A (en) Ic card
JPS5998362A (en) Discriminating device of memory cassette
JPH06180674A (en) Data storage device
JPS5998395A (en) Ic card
JPH04153792A (en) Ic card
JPH06259609A (en) Management method for ic card issue process
JP3480957B2 (en) Memory programming equipment
JP3231448B2 (en) IC card
JPH04152488A (en) Ic card
JP3274152B2 (en) Portable electronic devices
JPH0612251A (en) Program starting device
JPH04165487A (en) Error checking method for ic card
CN116302681A (en) File management method, device, equipment and medium of in-vitro diagnosis equipment
JPS62221754A (en) Data securing system for identification card
JPH07210640A (en) Inspection method for memory incorporated in ic card