JPH09179787A - Portable information storage medium - Google Patents

Portable information storage medium

Info

Publication number
JPH09179787A
JPH09179787A JP7335538A JP33553895A JPH09179787A JP H09179787 A JPH09179787 A JP H09179787A JP 7335538 A JP7335538 A JP 7335538A JP 33553895 A JP33553895 A JP 33553895A JP H09179787 A JPH09179787 A JP H09179787A
Authority
JP
Japan
Prior art keywords
information
area
backup
data
wef
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.)
Granted
Application number
JP7335538A
Other languages
Japanese (ja)
Other versions
JP3775697B2 (en
Inventor
Kazuyoshi Irisawa
和義 入澤
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 JP33553895A priority Critical patent/JP3775697B2/en
Publication of JPH09179787A publication Critical patent/JPH09179787A/en
Application granted granted Critical
Publication of JP3775697B2 publication Critical patent/JP3775697B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent information from being lost and damaged at the time of rewriting it by judging the normality/abnormality of rewrite based on management information and recovering the information of a backup area to a job information area in the case of being abnormal. SOLUTION: An anti-tearing processing part performs so-called backup for copying the data of WEF present in a file storage area to the backup area corresponding to the instruction of a main storage part. A data backup part backs up the WEF before a main processing part rewrites the WEF. Also, a backup information clearing part resets backup information present in a system area after the main processing part rewrites the WEF. A tearing check part copies the data present in the backup area to an original position present in the file storage area based on a backup start page and a page number recorded inside the backup information and recovers the data of the WEF.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、不揮発性の記憶部
を有する携帯可能情報記録媒体に関し、特に、記憶部の
情報書き換え時における情報の欠損を防止可能な携帯可
能情報記録媒体に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a portable information recording medium having a non-volatile storage unit, and more particularly to a portable information recording medium capable of preventing loss of information when rewriting information in the storage unit. .

【0002】[0002]

【従来の技術】ICカードは、磁気カードに代わる次世
代の媒体として注目を集めており、最近では、半導体集
積回路の小型化、低コスト化のための技術革新により、
実社会の種々のシステムにおいて実用されるに至ってい
る。特に、CPUを内蔵したICカードは、単なる情報
記録媒体としての機能だけではなく、情報処理機能を有
するため、高度なセキュリティを必要とする情報処理シ
ステムへの利用が期待されている。このようなICカー
ドでは、データ保存用のメモリとして一般にEEPRO
Mが使用されている。EEPROMは、電気的に記憶情
報の消去が可能な不揮発性メモリであり、反復書き換え
が可能であるというICカードでの利用に適した特性を
有している。
2. Description of the Related Art IC cards have attracted attention as next-generation media replacing magnetic cards, and recently, due to technological innovations for miniaturization and cost reduction of semiconductor integrated circuits,
It has come to be used in various systems in the real world. In particular, since an IC card having a built-in CPU has not only a function as an information recording medium but also an information processing function, it is expected to be used for an information processing system requiring high security. In such an IC card, EEPRO is generally used as a memory for data storage.
M is used. The EEPROM is a non-volatile memory capable of electrically erasing stored information, and has a characteristic that it can be repeatedly rewritten and is suitable for use in an IC card.

【0003】[0003]

【発明が解決しようとする課題】しかし、上述したEE
PROMでは、データの書き換えを行う場合は、はじめ
に旧データを消去し、その後に新たなデータの書き込み
を行う。このために、システム制御系にノイズが加わり
電源が落ちる、又はICカードをそれが接続されている
リーダ・ライタ等から引き抜くいわゆるティアリング等
に起因して、データの書き換えが中断されると、記憶部
内の情報、すなわち旧データ・新データがともに失われ
てしまう場合があるという問題があった。そこで、本発
明は、上記問題を解決して、記憶部のデータ書き換え時
に不慮の事態が発生した場合であっても、データの欠損
を防止可能な携帯可能情報記録媒体を提供することを課
題としている。
However, the above-mentioned EE
In the PROM, when rewriting data, the old data is first erased, and then new data is written. For this reason, if the power supply is shut down due to noise being added to the system control system, or the rewriting of data is interrupted due to so-called tearing or the like of pulling out the IC card from the reader / writer to which it is connected, the storage unit However, there is a problem that the information, that is, both the old data and the new data may be lost. Therefore, it is an object of the present invention to solve the above problems and provide a portable information recording medium capable of preventing loss of data even when an unexpected situation occurs when rewriting data in a storage unit. There is.

【0004】[0004]

【課題を解決するための手段】前記課題を解決するため
に、請求項1に係る発明は、システム領域と、バックア
ップ領域と、業務情報領域とを有する不揮発性の記憶部
と、前記記憶部に対し情報の書き込み又は読み出しを行
う制御部とを有し、選択的に外部接続装置との間で情報
の授受を行う携帯可能情報記録媒体であって、前記制御
部が前記業務情報領域に格納されている情報の書き換え
を行う場合に、書き換え前の情報を前記バックアップ領
域に複写するとともに、前記書き換え前の情報に関する
管理情報を前記システム領域に記録する複写手段と、前
記業務情報領域の書き換えが正常に終了した場合に、前
記管理情報を無効にする複写無効手段と、リセット後で
あって、第一コマンド実行前に、前記管理情報に基づい
て書き換えの正常/異常を判断し、異常である場合は前
記バックアップ領域の情報を前記業務情報領域に復帰さ
せる情報復帰手段とを備えることを特徴とする。
In order to solve the above problems, the invention according to claim 1 provides a nonvolatile storage unit having a system area, a backup area, and a business information area, and the storage unit. A portable information recording medium having a control unit for writing or reading information to and from the external connection device, wherein the control unit is stored in the business information area. When rewriting the existing information, the pre-rewriting information is copied to the backup area and the copying means for recording the management information related to the pre-rewriting information in the system area, and the rewriting of the business information area is normal. Copy invalidation means for invalidating the management information when it ends, and normal rewriting based on the management information after reset and before execution of the first command. Determining an abnormality, if an abnormality is characterized by having an information returning means for returning the information of the backup area to the business information area.

【0005】請求項2に係る発明は、請求項1に記載の
携帯可能情報記憶媒体において、前記情報復帰手段が前
記書き換えが異常であると判断した場合に、外部接続装
置に対し警告を送信する警告手段を備えることを特徴と
する。
According to a second aspect of the present invention, in the portable information storage medium according to the first aspect, when the information restoring means determines that the rewriting is abnormal, a warning is transmitted to the external connection device. A warning means is provided.

【0006】[0006]

【発明の実施の形態】以下、図面等を参照して、本発明
に係る実施形態について、さらに詳しく説明する。図1
は、本実施形態に係るICカード10がリーダ・ライタ
装置20に接続されている様子を示すブロック図であ
る。ICカード10には、I/Oインタフェース11、
CPU12、ROM13、RAM14、EEPROM1
5が内蔵されている。I/Oインタフェース11は、I
/Oライン30を介してデータを送受するための入出力
回路であり、CPU12はこのI/Oインタフェース1
1を介して、リーダ・ライタ装置20と交信する。RO
M13内には、CPU12によって実行されるべきプロ
グラムが記憶されており、CPU12はこのプログラム
に基いて、ICカード10を統括制御する機能を有す
る。RAM14は、CPU12がこのような統括制御を
行う上での作業領域として使用されるメモリである。一
方、EEPROM15は、このICカード10に記録す
べき本来のデータを格納するメモリである。
Embodiments of the present invention will be described below in more detail with reference to the drawings. FIG.
FIG. 3 is a block diagram showing how the IC card 10 according to the present embodiment is connected to the reader / writer device 20. The IC card 10 has an I / O interface 11,
CPU12, ROM13, RAM14, EEPROM1
5 is built-in. The I / O interface 11 is an I
The I / O interface 1 is an input / output circuit for transmitting / receiving data via the I / O line 30.
1 to communicate with the reader / writer device 20. RO
A program to be executed by the CPU 12 is stored in the M13, and the CPU 12 has a function of centrally controlling the IC card 10 based on this program. The RAM 14 is a memory used as a work area when the CPU 12 performs such general control. On the other hand, the EEPROM 15 is a memory for storing original data to be recorded in the IC card 10.

【0007】このICカード10に対しては、外部のリ
ーダ・ライタ装置20から電源やクロックが供給され
る。したがって、ICカード10がリーダ・ライタ装置
20と切り離されると、ICカード10への電源および
クロックの供給は停止する。しかしながら、EEPRO
M15は不揮発性メモリであるため、電源供給が停止し
た後もその記録内容はそのまま保持される。ただし、R
AM14内のデータについては、電源供給の停止により
すべて失われる。
Power and clock are supplied to the IC card 10 from an external reader / writer device 20. Therefore, when the IC card 10 is separated from the reader / writer device 20, the supply of power and clock to the IC card 10 is stopped. However, EEPRO
Since M15 is a non-volatile memory, its recorded content is retained as it is even after the power supply is stopped. Where R
All the data in the AM 14 is lost due to the stop of power supply.

【0008】ICカード10内の各メモリ13、14、
15へのアクセスは、すべてCPU12を介して行わ
れ、外部からこれらメモリを直接アクセスすることはで
きない。すなわち、リーダ・ライタ装置20からCPU
12に対して所定の「コマンド」を与えると、CPU1
2はこの「コマンド」を解釈実行し、その結果を、リー
ダ・ライタ装置20に対して「レスポンス」として返送
することになる。
Each memory 13, 14 in the IC card 10,
All access to 15 is performed via the CPU 12, and these memories cannot be directly accessed from the outside. That is, from the reader / writer device 20 to the CPU
When a predetermined “command” is given to 12, the CPU 1
2 interprets and executes this "command" and returns the result to the reader / writer device 20 as a "response".

【0009】たとえば、EEPROM15内の所定のフ
ァイルに書き込みを行う場合には、「書込コマンド」と
ともに、書込対象となるデータをCPU12に与え、C
PU12による「書込コマンド」の実行という形式で書
込処理が行われることになる。逆に、EEPROM15
内の所定のファイルからデータの読み出しを行う場合に
は、所定の「読出コマンド」をCPU12に与え、CP
U12による「読出コマンド」の実行という形式によっ
て読出処理が行われることになる。このように、ICカ
ード10内において「コマンド」の実行が終了すると、
実行した「コマンド」に対する「レスポンス」が外部に
対して返送される。たとえば、「書込コマンド」を与え
た場合には、書込処理が支障なく実行されたか否かを示
す「レスポンス」が返送され、「読出コマンド」を与え
た場合には、読出対象となったデータがレスポンスとい
う形で返送されることになる。ただし、EEPROM1
5へのアクセスは、無条件で行われるわけではなく、所
定のアクセス条件が満足されることが前提となる。この
アクセス条件は、例えば個々のファイルごとに設定され
る。
For example, when writing to a predetermined file in the EEPROM 15, data to be written is given to the CPU 12 along with the "write command", and C
The writing process is performed in the form of execution of the “write command” by the PU 12. Conversely, EEPROM15
When reading data from a predetermined file in the above, a predetermined "read command" is given to the CPU 12 and the CP
The reading process is performed in the form of executing the "read command" by U12. Thus, when the execution of the “command” in the IC card 10 is completed,
A "response" to the executed "command" is returned to the outside. For example, when a "write command" is given, a "response" indicating whether or not the writing process has been executed without any trouble is returned, and when a "read command" is given, it becomes the read target. The data will be returned in the form of a response. However, EEPROM1
Access to 5 is not performed unconditionally, but it is premised that a predetermined access condition is satisfied. This access condition is set, for example, for each file.

【0010】図2は、EEPROM15の内部構成を示
す図である。本実施形態では、EEPROM15のユー
ザーエリアがファイル格納エリアとバックアップエリア
に分割されていることを特徴としている。ファイル格納
エリアは、アプリケーションが使用するデータのための
基礎ファイルであるWEF等を格納する領域である。図
に示されるように、WEFのディレクトリは”WEF
DIR”エリアに、データは”WEF DATA”エリ
アにそれぞれ格納される。一方、バックアップエリア
は、上記”WEF DIR”エリア、及び”WEF D
ATA”エリア内のデータを複写・保存するための領域
である。したがって、バックアップエリアの大きさは、
そのバイト数がシステムが取り扱うデータの最大バイト
数となるように設定される。
FIG. 2 is a diagram showing the internal structure of the EEPROM 15. The present embodiment is characterized in that the user area of the EEPROM 15 is divided into a file storage area and a backup area. The file storage area is an area for storing WEF, which is a basic file for data used by an application. As shown in the figure, the WEF directory is "WEF
Data is stored in the "DIR" area and data is stored in the "WEF DATA" area, while the backup area is stored in the "WEF DIR" area and the "WEF D" area.
This is an area for copying and saving data in the ATA "area. Therefore, the size of the backup area is
The number of bytes is set to be the maximum number of bytes of data handled by the system.

【0011】図3は、CPU12の機能を示すブロック
図である。本実施形態のCPU12は、主処理部とティ
アリング処理部という2つの処理部から構成される。主
処理部は、I/Oインターフェイスを介してリーダ・ラ
イタと通信を行う、又はメモリー管理を行うなど、従来
のICカードの有する一般的機能を実現する処理部であ
る。一方、アンチティアリング処理部は、主処理部の指
示に従い、ファイル格納エリアにある当該WEFのデー
タをバックアップエリアに複写する、いわゆるバックア
ップを行うことにより、データの消失・欠損を防止する
機能を果たす処理部である。なお、WEFのデータと
は、”WEF DIR”エリア及び”WEF DAT
A”エリアに格納されているデータを意味する。
FIG. 3 is a block diagram showing the functions of the CPU 12. The CPU 12 of this embodiment is composed of two processing units, a main processing unit and a tearing processing unit. The main processing unit is a processing unit that realizes general functions of a conventional IC card, such as performing communication with a reader / writer via an I / O interface or performing memory management. On the other hand, the anti-tearing processing unit performs a function of preventing data loss / loss by copying the data of the WEF in the file storage area to a backup area according to an instruction of the main processing unit, so-called backup. It is a department. In addition, the WEF data means "WEF DIR" area and "WEF DAT".
It means the data stored in the A "area.

【0012】アンチティアリング処理部は、さらに3つ
の処理部より構成されている。第1の処理部は、主処理
部がWEFの書き換えを行う前に当該WEFのバックア
ップを行うデータバックアップ部である。第2の処理部
は、主処理部がWEFの書き換えを行った後に、システ
ムエリアにあるバックアップ情報をリセットするバック
アップ情報クリア部である。また、第3の処理部は、主
処理部が各コマンドの先頭ブロックを受信したときに、
そのコマンドがICカードリセット後の第一コマンドで
あるか否かを判断し、第一コマンドであった場合にバッ
クアップ情報を確認し、WEFの書き換え異常の検知、
及びデータの復帰を行うティアリングチェック部であ
る。
The anti-tearing processing section is further composed of three processing sections. The first processing unit is a data backup unit that backs up the WEF before the main processing unit rewrites the WEF. The second processing unit is a backup information clearing unit that resets the backup information in the system area after the main processing unit rewrites the WEF. The third processing unit, when the main processing unit receives the first block of each command,
It is determined whether or not the command is the first command after the IC card reset, and if it is the first command, the backup information is confirmed, and the WEF rewriting abnormality is detected.
And a tearing check unit that restores data.

【0013】図4は、本実施形態において、「書込コマ
ンド」が実行されるときのCPU12の動作を説明する
図である。主処理部は、リーダ・ライタ装置20よりコ
マンドを受信すると、はじめにそのコマンドのパラメー
タをチェックし、コマンドが「書込コマンド」であるこ
とを認めると、アンチティアリング処理部に対しデータ
バックアップを行うことを指示する(S400)。アン
チティアリング処理部では、上記主処理部からの指示に
従い、当該WEFの書き換え前のデータをバックアップ
する(S410)。バックアップが終了すると、主処理
部は、フィアル格納エリアにある当該WEFのデータを
消去し、その後に新しいデータを書き込む(S42
0)。一つのデータブロックの書き込みが終了すると、
主処理部は、リーダ・ライタ装置20に対し、さらに書
き込むべきデータブロックの存在の有無を問い合わせ
(S430)、次ブロックがあれば、それを受信して
(S440)、当該WEFに書き込む(S420)。全
てのデータブロックの書き込みが終了すると、アンチテ
ィアリング処理部は、主処理部からの指示に従い、バッ
クアップ情報クリア部を動作させ、システムエリアのバ
ックアップ情報をクリアする(S450)。最後に、主
処理部は、リーダ・ライタ装置20に対して、レスポン
スの送信等を行い(S460)、一連の書き換え動作が
終了する。
FIG. 4 is a diagram for explaining the operation of the CPU 12 when the "write command" is executed in this embodiment. When the main processing unit receives a command from the reader / writer device 20, it first checks the parameters of the command, and if it recognizes that the command is a "write command", it backs up data to the anti-tearing processing unit. Is instructed (S400). The anti-tearing processing unit backs up the data before rewriting of the WEF according to the instruction from the main processing unit (S410). When the backup is completed, the main processing unit erases the data of the WEF in the final storage area, and then writes new data (S42).
0). After writing one data block,
The main processing unit inquires of the reader / writer device 20 whether there is a data block to be further written (S430), and if there is a next block, receives it (S440) and writes it in the WEF (S420). . When the writing of all data blocks is completed, the anti-tearing processing unit operates the backup information clearing unit according to the instruction from the main processing unit to clear the backup information of the system area (S450). Finally, the main processing unit transmits a response to the reader / writer device 20 (S460), and the series of rewriting operations is completed.

【0014】図5は、データバックアップ部の動作を説
明する図である。データバックアップ部は、はじめに主
処理部から書き込むべきデータの書き込み開始アドレス
及び書き込みバイト数を受信し(S500)、それらよ
り主処理部の書き込みぺ一ジ数を算出する(S51
0)。次に、得られた書き込みぺ一ジ数は、バックアッ
プエリアのバイト数と比較される(S520)。比較の
結果、バックアップエリアの方が小さい場合は、取り扱
うべきデータ量(バイト数)に異常があるとみなし、バ
ックアップを実行せずにその動作を終了する(S53
0)。逆に、バックアップエリアの方が大きい場合は、
動作を続行し、ファイル格納エリアの書き込み開始アド
レスを含むぺ一ジから、最終書き込みぺ一ジまでの内容
をぺ一ジ単位でバックアップエリアに複写する(S54
0)。また、バックアップエリアへの書き込み時には、
その都度書き込みが正常に行われたか否かの確認を行い
(S550)、その結果ライト・アフター・ベリファイ
エラーが発生した場合には、ベリファイエラー・ステー
タスを送信バッファーにセットして動作を終了する(S
553、S555)。一方、バックアップエリアに正常
に複写ができた場合には、フィアル格納エリア内のコピ
ー元となっているWEFの開始ぺ一ジ番号及びぺ一ジ数
をシステムエリアにバックアップ情報として保存すると
ともに、そのバックアップ情報にはCRC(Cyclic Red
undancy Check )コードをも付記する(S560)。ま
た、この場合にも、システムエリアヘの書き込みが正常
に行われたか否かの確認がなされ(S570)、ベリフ
ァイエラーが発生した場合には、ベリファイエラー・ス
テータスを送信バッファーにセットして動作を終了し
(S573、S575)、エラーが発生しなければ、そ
のまま動作を終了する(S580)。
FIG. 5 is a diagram for explaining the operation of the data backup unit. The data backup unit first receives the write start address and the number of write bytes of the data to be written from the main processing unit (S500), and calculates the number of write pages of the main processing unit from them (S51).
0). Next, the obtained number of write pages is compared with the number of bytes in the backup area (S520). As a result of the comparison, if the backup area is smaller, it is considered that the amount of data (the number of bytes) to be handled is abnormal, and the operation is terminated without executing the backup (S53).
0). Conversely, if the backup area is larger,
The operation is continued, and the contents from the page including the write start address of the file storage area to the final write page are copied to the backup area in page units (S54).
0). Also, when writing to the backup area,
Each time, it is confirmed whether or not the writing is normally performed (S550), and if a write after verify error occurs as a result, the verify error status is set in the transmission buffer and the operation ends ( S
553, S555). On the other hand, when the copy can be normally performed in the backup area, the starting page number and the number of pages of the WEF which is the copy source in the file storage area are stored in the system area as backup information and CRC (Cyclic Red) is included in the backup information.
undancy Check) code is also added (S560). Also in this case, it is confirmed whether or not the writing to the system area is normally performed (S570), and if a verify error occurs, the verify error status is set in the transmission buffer to operate. When the process ends (S573, S575) and no error occurs, the operation ends (S580).

【0015】図6は、バックアップ情報クリア部の動作
を説明する図である。図に示すように、バックアップ情
報クリア部は、データバックアップ部がシステムエリア
に書き込んだコピー開始ページ番号を”0”に変更する
ことによりバックアップ情報をクリアする。
FIG. 6 is a diagram for explaining the operation of the backup information clearing unit. As shown in the figure, the backup information clearing unit clears the backup information by changing the copy start page number written in the system area by the data backup unit to "0".

【0016】図7は、ICカード10がリーダ・ライタ
装置20に接続されて、最初のコマンドを実行するまで
のCPU12の動作を説明する図である。ICカード1
0がリーダ・ライタ装置20に接続されると、CPU1
2に電源が供給され、これによりCPU12のリセット
と(610)、内部チェックが行われる(S620)。
次に、リーダ・ライタ装置20からのコマンドが受信さ
れる(S630)。受信されたコマンドは、それがリセ
ット後の第1コマンドであるか否かが判断され(S64
0)、第1コマンドであった場合は、ティアリング処理
部においてティアリングチェックが実行される(S65
0)。したがって、第1コマンドの実行とそれに伴うレ
スポンスの送信は、ティアリングチェックが終了した後
にはじめて行われる(S660)。
FIG. 7 is a diagram for explaining the operation of the CPU 12 until the IC card 10 is connected to the reader / writer device 20 and the first command is executed. IC card 1
When 0 is connected to the reader / writer device 20, the CPU 1
2, the CPU 12 is reset, the CPU 12 is reset (610), and an internal check is performed (S620).
Next, the command from the reader / writer device 20 is received (S630). It is determined whether the received command is the first command after reset (S64).
0), if it is the first command, a tearing check is executed in the tearing processing unit (S65).
0). Therefore, the execution of the first command and the transmission of the response accompanying it are performed only after the tearing check is completed (S660).

【0017】図8は、ティアリングチェック部の動作を
説明する図である。ティアリングチェック部は、はじめ
にシステムエリアにおけるバックアップ情報が格納され
ているページのCRCチェックを行い(S600)、チ
ェックの結果、エラーが検出された場合には動作を終了
する(S610)。エラーが検出されなかった場合に
は、バックアップ開始ページの値を確認する(S62
0)。バックアップ開始ページが”0”である場合に
は、図4に示した動作説明図において、S420〜S4
40におけるファイル格納エリアへのデータ書き込みが
全て正常に行われ、最後にS450のバックアップ情報
のクリアがなされたことを意味する。したがって、この
場合には、バックアップされている情報をファイル格納
エリアに復帰させる必要はなく、ティアリングチェック
部は、そのまま動作を終了する(625)。
FIG. 8 is a diagram for explaining the operation of the tearing check unit. The tearing check unit first performs a CRC check on the page in which the backup information in the system area is stored (S600), and ends the operation if an error is detected as a result of the check (S610). If no error is detected, the value of the backup start page is confirmed (S62).
0). When the backup start page is "0", S420 to S4 in the operation explanatory diagram shown in FIG.
This means that all the data writing to the file storage area in 40 was normally performed, and finally the backup information in S450 was cleared. Therefore, in this case, it is not necessary to restore the backed up information to the file storage area, and the tearing check unit ends the operation as it is (625).

【0018】逆に、バックアップ開始ページが”0”で
ない場合には、上記ファイル格納エリアへの書き込みが
正常に終了されおらず、該当するエリアにおいて正規の
データが失われていることを意味する。よって、ティア
リングチェック部は、警告ステータスを送信バッファー
にセットする。これにより、この後に主処理部がS46
0(図4参照)を実行するときに、リーダ・ライタ装置
20に対して、ファイル格納エリアの書き込み状態が異
常であった旨の警告が送信される。次に、ティアリング
チェック部は、バックアップ情報内に記録されているバ
ックアップ開始ページ及びページ数に基づいてバックア
ップエリアにあるデータをファイル格納エリアの元の位
置に複写し、当該WEFのデータを復帰させる(S64
0)。さらに、コピーの終了後に、バックアップ情報内
のバックアップ開始ぺ一ジを”0”に書き換え(S65
0)、その動作を終了する(S660)。
On the contrary, when the backup start page is not "0", it means that the writing to the file storage area has not been normally completed and the normal data is lost in the corresponding area. Therefore, the tearing check unit sets the warning status in the transmission buffer. As a result, after this, the main processing unit executes S46.
When 0 (see FIG. 4) is executed, a warning that the writing state of the file storage area is abnormal is transmitted to the reader / writer device 20. Next, the tearing check unit copies the data in the backup area to the original position of the file storage area based on the backup start page and the number of pages recorded in the backup information, and restores the data of the WEF ( S64
0). Further, after the copy is completed, the backup start page in the backup information is rewritten to "0" (S65
0), the operation ends (S660).

【0019】以上説明したように、本実施形態では、E
EPROMのユーザーエリアをフィアル格納エリア及び
バックアップエリアに分割し、フィアル格納エリアにあ
るWEFを書き換える場合には、予めそのWEFの有す
るデータのバックアップを行ってから、新たなデータを
当該WEFに書き込むこととしている。これにより、E
EPROMへデータの書き込みを行っている途中で、ノ
イズの影響を受けて書き込みが中断する事故が発生した
場合、又はICカードをリーダ・ライタ装置から引く抜
く等の不正行為がなされた場合であっても、EEPRO
Mに格納されているデータの消失・欠損を防止すること
が可能である。さらに、本実施形態では、WEFへの書
き込みの異常が検知された場合に、その旨をリーダ・ラ
イタ装置へ警告することとしている。これにより、アプ
リケーション提供者は、例えば当該ICカードについて
比較的短期間に同警告が複数回なされていれば、その書
き込み異常を単なる偶発的事故から識別し、ティアリン
グ等の不正行為がなされた可能性について察知すること
が可能である。
As described above, in this embodiment, E
When the user area of the EPROM is divided into a physical storage area and a backup area and the WEF in the physical storage area is rewritten, the data contained in the WEF is backed up in advance and new data is written to the WEF. There is. This gives E
When an accident occurs that the writing is interrupted due to the influence of noise while writing data to the EPROM, or when an illegal act such as pulling out the IC card from the reader / writer device is performed. EEPRO
It is possible to prevent the data stored in M from being lost or lost. Furthermore, in the present embodiment, when an abnormality in writing to the WEF is detected, the fact is notified to the reader / writer device. Accordingly, if the same warning is issued a plurality of times for the IC card in a relatively short period of time, for example, the application provider may discriminate the writing abnormality from a mere accidental accident and perform an illegal act such as tearing. It is possible to detect.

【0020】[0020]

【発明の効果】以上詳しく説明したように、請求項1に
係る発明によれば、複写手段は、制御部が業務情報領域
に格納されている情報の書き換えを行う場合に、書き換
え前の情報をバックアップ領域に複写するとともに、書
き換え前の情報に関する管理情報をシステム領域に記録
し、複写無効手段は、業務情報領域の書き換えが正常に
終了した場合に、管理情報を無効にし、情報復帰手段
は、リセット後であって、第一コマンド実行前に、管理
情報に基づいて書き換えの正常/異常を判断し、異常で
ある場合はバックアップ領域の情報を業務情報領域に復
帰させることとしたので、業務情報領域に格納されてい
る情報が書き換え時に消失・欠損することを防止するこ
とが可能となった。また、請求項2に係る発明によれ
ば、警告手段は、情報復帰手段が書き換えが異常である
と判断した場合に、外部接続装置に対し警告を送信する
こととしたので、アプリケーション提供者に異常を察知
させることが可能となった。
As described in detail above, according to the first aspect of the invention, when the control section rewrites the information stored in the business information area, the copying section rewrites the information before rewriting. While copying to the backup area, the management information related to the information before rewriting is recorded in the system area, the copy invalidating means invalidates the management information when the rewriting of the business information area is completed normally, and the information restoring means, After the reset and before executing the first command, it is judged whether the rewriting is normal or abnormal based on the management information, and if it is abnormal, the information in the backup area is restored to the business information area. It has become possible to prevent the information stored in the area from being lost or lost during rewriting. According to the second aspect of the present invention, the warning means sends a warning to the external connection device when the information restoration means determines that the rewriting is abnormal. It has become possible to detect.

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

【図1】本発明に係るICカードがリーダ・ライタ装置
に接続されている様子を示すブロック図である。
FIG. 1 is a block diagram showing a state in which an IC card according to the present invention is connected to a reader / writer device.

【図2】本発明におけるEEPROMの内部構成を示す
図である。
FIG. 2 is a diagram showing an internal configuration of an EEPROM according to the present invention.

【図3】本発明におけるCPUの機能を示すブロック図
である。
FIG. 3 is a block diagram showing functions of a CPU in the present invention.

【図4】本発明において、「書込コマンド」が実行され
るときのCPUの動作を説明する図である。
FIG. 4 is a diagram illustrating an operation of the CPU when a “write command” is executed in the present invention.

【図5】本発明におけるデータバックアップ部の動作を
説明する図である。
FIG. 5 is a diagram illustrating an operation of a data backup unit according to the present invention.

【図6】本発明におけるバックアップ情報クリア部の動
作を説明する図である。
FIG. 6 is a diagram illustrating an operation of a backup information clearing unit according to the present invention.

【図7】本発明において、リセット後であって、第一コ
マンドを実行するまでのCPUの動作を説明する図であ
る。
FIG. 7 is a diagram illustrating the operation of the CPU after resetting and before executing the first command in the present invention.

【図8】本発明において、ティアリングチェック部の動
作を説明する図である。
FIG. 8 is a diagram illustrating the operation of the tearing check unit in the present invention.

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

10 ICカード 11 I/Oインターフェース 12 CPU 13 ROM 14 RAM 15 EEPROM 20 リーダ・ライタ装置 30 I/Oライン 10 IC Card 11 I / O Interface 12 CPU 13 ROM 14 RAM 15 EEPROM 20 Reader / Writer Device 30 I / O Line

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 システム領域と、バックアップ領域と、
業務情報領域とを有する不揮発性の記憶部と、 前記記憶部に対し情報の書き込み又は読み出しを行う制
御部と、 を有し、選択的に外部接続装置との間で情報の授受を行
う携帯可能情報記録媒体であって、 前記制御部が前記業務情報領域に格納されている情報の
書き換えを行う場合に、書き換え前の情報を前記バック
アップ領域に複写するとともに、前記書き換え前の情報
に関する管理情報を前記システム領域に記録する複写手
段と、 前記業務情報領域の書き換えが正常に終了した場合に、
前記管理情報を無効にする複写無効手段と、 リセット後であって、第一コマンド実行前に、前記管理
情報に基づいて書き換えの正常/異常を判断し、異常で
ある場合は前記バックアップ領域の情報を前記業務情報
領域に復帰させる情報復帰手段と、 を備えることを特徴とする携帯可能情報記憶媒体。
1. A system area, a backup area,
A portable storage device that has a non-volatile storage unit having a business information area and a control unit that writes or reads information to or from the storage unit, and selectively exchanges information with an external connection device. In the information recording medium, when the control unit rewrites the information stored in the business information area, the pre-rewriting information is copied to the backup area and the management information related to the pre-rewriting information is stored. Copying means for recording in the system area, and when rewriting of the business information area is normally completed,
Copy invalidating means for invalidating the management information, and after resetting, before execution of the first command, judge normality / abnormality of rewriting based on the management information, and if abnormal, information of the backup area A portable information storage medium, comprising: an information restoring means for restoring the information to the business information area.
【請求項2】 請求項1に記載の携帯可能情報記憶媒体
において、 前記情報復帰手段が前記書き換えが異常であると判断し
た場合に、外部接続装置に対し警告を送信する警告手
段、 を備えることを特徴とする携帯可能情報記録媒体。
2. The portable information storage medium according to claim 1, further comprising warning means for transmitting a warning to an external connection device when the information restoration means determines that the rewriting is abnormal. A portable information recording medium characterized by:
JP33553895A 1995-12-22 1995-12-22 Portable information storage media Expired - Lifetime JP3775697B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33553895A JP3775697B2 (en) 1995-12-22 1995-12-22 Portable information storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33553895A JP3775697B2 (en) 1995-12-22 1995-12-22 Portable information storage media

Publications (2)

Publication Number Publication Date
JPH09179787A true JPH09179787A (en) 1997-07-11
JP3775697B2 JP3775697B2 (en) 2006-05-17

Family

ID=18289701

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33553895A Expired - Lifetime JP3775697B2 (en) 1995-12-22 1995-12-22 Portable information storage media

Country Status (1)

Country Link
JP (1) JP3775697B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008537192A (en) * 2005-01-31 2008-09-11 サンディスク アイエル リミテッド How to manage copy operations in flash memory
WO2014119591A1 (en) * 2013-01-29 2014-08-07 オムロン株式会社 Communication device, rfid system, and recordable medium having data writing program recorded thereon

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008537192A (en) * 2005-01-31 2008-09-11 サンディスク アイエル リミテッド How to manage copy operations in flash memory
WO2014119591A1 (en) * 2013-01-29 2014-08-07 オムロン株式会社 Communication device, rfid system, and recordable medium having data writing program recorded thereon
JP2014146160A (en) * 2013-01-29 2014-08-14 Omron Corp Communication device, rfid system and data writing program

Also Published As

Publication number Publication date
JP3775697B2 (en) 2006-05-17

Similar Documents

Publication Publication Date Title
CN100377120C (en) Non-volatile storage device control method
KR100343377B1 (en) Data writing to non-volatile memory
JP2788590B2 (en) Memory protection device and address generation method
CN102163133B (en) Method and apparatus for using a one-time or few-time programmable memory with a host device designed for erasable/rewriteable memory
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
JP4146006B2 (en) Electronic device having flash memory
KR100986884B1 (en) External connection device, host device, and data communication system
US20020027508A1 (en) Power failure managing device and method for managing a power failure
JP4661369B2 (en) Memory controller
WO2006051692A1 (en) Nonvolatile memory system
JP3775697B2 (en) Portable information storage media
JP2001005928A (en) Ic card
EP1246201A2 (en) Semiconductor memory
JP2000357216A (en) Ic card
CN100524239C (en) Method for protecting data of memory mechanism
JPH0778231A (en) Memory card
JPH06180674A (en) Data storage device
JPH10161942A (en) Method, device for storing information, and information processor
JP2004334745A (en) Ic card
JP2003150441A (en) Data management method, device thereof, data management program, and storage medium storing data management program
JP2915909B2 (en) Data communication device and data writing method thereof
JPH10240633A (en) Memory system and memory card
JPH08171621A (en) Ic card
AU640442B2 (en) Method and apparatus for controlling writing to memory
JP3789994B2 (en) IC card

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050707

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050719

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050916

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060217

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100303

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100303

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110303

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110303

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120303

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130303

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130303

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140303

Year of fee payment: 8

EXPY Cancellation because of completion of term