JPH0652545B2 - IC card having data management means - Google Patents

IC card having data management means

Info

Publication number
JPH0652545B2
JPH0652545B2 JP60297591A JP29759185A JPH0652545B2 JP H0652545 B2 JPH0652545 B2 JP H0652545B2 JP 60297591 A JP60297591 A JP 60297591A JP 29759185 A JP29759185 A JP 29759185A JP H0652545 B2 JPH0652545 B2 JP H0652545B2
Authority
JP
Japan
Prior art keywords
data
record
written
storage area
card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP60297591A
Other languages
Japanese (ja)
Other versions
JPS62154083A (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 Edge Inc
Original Assignee
Toppan Moore 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 Moore Co Ltd filed Critical Toppan Moore Co Ltd
Priority to JP60297591A priority Critical patent/JPH0652545B2/en
Publication of JPS62154083A publication Critical patent/JPS62154083A/en
Publication of JPH0652545B2 publication Critical patent/JPH0652545B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Credit Cards Or The Like (AREA)

Description

【発明の詳細な説明】 (産業上の利用分野) この発明はICカードにおけるデータ管理装置に係り、
時にICカードに内蔵されたメモリに新たなデータを逐
次に記憶させ、必要に応じて適宜にデータを読み出しう
るようにしたデータ管理手段を有するICカードに関す
るものである。
TECHNICAL FIELD The present invention relates to a data management device in an IC card,
The present invention relates to an IC card having a data management means that allows new data to be sequentially stored in a memory built in the IC card and the data can be read out as needed.

(従来の技術) この種の従来技術によれば、一定のプログラムに従つて
データを処理するCPUと、暗証番号エリアと索引エリ
ア群と記憶エリア群を含むメモリとを備えており、記憶
エリア群は複数個の記憶エリアからなり、各記憶エリア
はそれぞれ特定種類のデータを逐次に記憶してゆく複数
個のレコードを含んでいる。暗証番号と共にデータが入
力されると、暗証番号が正しい事を確認した後、対応索
引エリアを読み出し、その読み出された索引エリアで指
定された記憶エリアの次に書き込まれるべきレコードに
入力データを書き込む。対応記憶エリアの全てのレコー
ドがデータ書込済みとなつた時は、それ以降にデータが
入力されてもその記憶エリアにはデータ書込を行うこと
ができないことになる。
(Prior Art) According to a conventional art of this kind, a CPU for processing data according to a certain program, a memory including a personal identification number area, an index area group, and a storage area group are provided. Is composed of a plurality of storage areas, and each storage area contains a plurality of records for sequentially storing a particular type of data. When the data is entered together with the personal identification number, after confirming that the personal identification number is correct, the corresponding index area is read, and the input data is written to the record to be written next to the storage area designated by the read index area. Write. When all the records in the corresponding storage area have been written, the data cannot be written in that storage area even if data is input thereafter.

(発明が解決しようとする問題点) 以上の様な従来技術によれば、各記憶エリアは予めデー
タの入力回数を予測して必要と思われる容量のエリアが
割り当てられるわけであるが、その予測を上回る回数の
データが入力されると新たなデータの記憶が不能となつ
たり、データの記憶操作が煩雑となる等の不都合が生ず
る。
(Problems to be Solved by the Invention) According to the conventional techniques as described above, each storage area is assigned an area having a capacity that is considered necessary by predicting the number of times data is input in advance. If the data is input more times than this, there arises inconveniences such as the inability to store new data and the complicated data storage operation.

この場合、各記憶エリアの最終書込順位のレコードにデ
ータを書き込んだ後は再び最先書込順位のレコードにデ
ータを書込みできるようにするようにして、データを循
環的に何度でも書き換えるようにすることも考えられる
が、常に循環書き換えができるようにすると、消去する
と困るような古いデータも消去してしまうという不都合
を生ずる。
In this case, after writing the data in the record of the last write order in each storage area, the data can be written again in the record of the first write order so that the data can be rewritten cyclically as many times as possible. However, if the cyclic rewriting is always enabled, old data that would be a problem when erasing may be erased.

この発明の目的は、データの書換が頻繁に行われる場合
とか、新たなデータが書き込まれたために古いデータが
不要となる様なデータを記憶する記憶エリアへの書き込
みの場合には、循環書き換えができるようにし、古いデ
ータを消去すると不都合を生ずるおそれのあるデータを
記憶する記憶エリアへの書き込みの場合は循環書込がで
きないようにしたデータ管理手段を有するICカードを
提供することにある。
An object of the present invention is to perform cyclic rewriting when data is rewritten frequently or when data is written to a storage area that stores data such that old data is unnecessary because new data is written. It is an object of the present invention to provide an IC card having a data managing means that enables circular writing in the case of writing to a storage area for storing data that may cause inconvenience when old data is erased.

(問題点を解決するための手段) この発明によるデータ管理手段を有するICカードによ
れば、少なくともCPUとデータの書換が可能なメモリ
とを備え、該メモリは複数個のレコードを有する複数個
の記憶エリアを備えており、データを逐次にそれらレコ
ードに書き込みまたは書込データを読み出すようにした
データ管理手段を有するICカードであって、次に入力
されるデータを書き込むべきレコードのアドレスを指定
するレコード・ポインタ手段と、最終書込順位のレコー
ドにデータが書き込まれたか否かを判断する手段と、該
判断手段が最終書込順位のレコードにデータが書き込ま
れていないと判断したときは前記レコード・ポインタ手
段に最後に書き込まれたレコードの次の書込順位のレコ
ードのアドレスの指定を行わせる手段と、当該記憶エリ
アがレコードにデータを逐次に循環して書き込まれるべ
き循環モードであるか否かを設定する手段と、 前記判断手段が最終書込順位のレコードにデータが書き
込まれたと判断したときは該設定手段が循環モードに設
定されているときのみ前記レコード・ポインタ手段に最
先書込順位のレコードのアドレスの指定を行わせる手段
と、を備えている。
(Means for Solving Problems) According to the IC card having the data management means according to the present invention, at least a CPU and a memory capable of rewriting data are provided, and the memory has a plurality of records. An IC card having a storage area and having a data management means for sequentially writing data to these records or reading the written data, and designating the address of the record to which the next input data is to be written. Record pointer means, means for determining whether or not data has been written in the record in the final write order, and the record if the determination means determines that no data has been written in the record in the final write order .Means for causing the pointer means to specify the address of the record having the next write order of the record last written , Means for setting whether or not the storage area is in a circulation mode in which data should be sequentially circulated and written in the record, and when the determining means determines that the data has been written in the record in the final writing order, Means for causing the record pointer means to specify the address of the record in the highest write order only when the setting means is set in the circulation mode.

(作用) 書込データが入力されると、レコード・ポインタ手段で
指定されたレコードにその入力データは記憶される。こ
れと同時に、判断手段で今書き込まれたレコードが最終
書込順位のものであるか否かが判断され、最終書込順位
のものではないと判断されたときは、レコード・ポイン
タ手段に次の書込順位のレコードのアドレスを指定さ
せ、また、判断手段で今書き込まれたレコードが最終書
込順位のものであると判断されたときは、当該記憶エリ
アが循環モードに設定されている時のみレコード・ポイ
ンタ手段に最先書込順位のレコードのアドレスを指定さ
せるようにして、全てのレコードが書込済みとなった後
においても、再び最先書込順位のレコードからデータの
書換を可能にしている。
(Operation) When write data is input, the input data is stored in the record designated by the record pointer means. At the same time, the judging means judges whether or not the record just written is in the final writing order. When it is judged that the record is not in the final writing order, the record pointer means When the address of the record in the write order is specified, and when the determination means determines that the record just written is in the final write order, only when the storage area is set to the circulation mode By making the record pointer means specify the address of the record with the highest write order, it is possible to rewrite data from the record with the highest write order even after all the records have been written. ing.

(発明の効果) この様な構成および作用を有するこの発明によれば、循
環モードに設定された記憶エリアに対してはデータを循
環的に何度でも書き換えることができるので、全レコー
ドにデータが書込済みとなっても、古い不要なデータを
消去してこれに代り新しいデータを書き込むことがで
き、メモリの効率的、経済的な利用が可能となる。そし
て、循環モードの設定がされていない記憶エリアに対し
てはデータを循環的に書き換えすることができようにし
て、消去されては困る古いデータは消去されることなく
そのまま記憶が保持される。更にこの発明によれば、レ
コード・ポインタ手段により新たな書込データの書込位
置および最新データの書込位置を特定することができる
ので、データの読出・書込の際のデータ管理を正しく実
行することができる。
(Effect of the Invention) According to the present invention having such a configuration and operation, data can be rewritten in a storage area set to the circulation mode repeatedly as many times as possible, so that data is stored in all records. Even if it has been written, old unnecessary data can be erased and new data can be written in its place, so that the memory can be used efficiently and economically. Then, the data can be cyclically rewritten to the storage area in which the circulation mode is not set, and the old data which is troublesome to be erased is retained as it is without being erased. Further, according to the present invention, since the write position of the new write data and the write position of the latest data can be specified by the record pointer means, the data management at the time of reading / writing the data is correctly executed. can do.

(実施例) この発明の実施例を図面を参照しながら以下に説明す
る。
Embodiment An embodiment of the present invention will be described below with reference to the drawings.

第1図はこの発明の回路構成を示す図である。ICカー
ド1にはCPUチツプ40とメモリチツプ41が搭載さ
れている。ICカード1には5個の接点端子5が設けら
れ、外部回路との電気的接続を行いうるようになつてい
る。CPUチツプ40には、プログラムに基づき計算制
御を行うCPU401と、そのプログラムなどを記憶す
るROM402と、プログラムの実行中におけるデータ
等を一時的に記憶するRAM403とが含まれている。
メモリチツプ41は電気的にデータを何度でも消去した
り書き込んだりすることができるEEPROM411を
含んでいる。
FIG. 1 is a diagram showing a circuit configuration of the present invention. A CPU chip 40 and a memory chip 41 are mounted on the IC card 1. The IC card 1 is provided with five contact terminals 5 so that it can be electrically connected to an external circuit. The CPU chip 40 includes a CPU 401 that performs calculation control based on a program, a ROM 402 that stores the program and the like, and a RAM 403 that temporarily stores data and the like during execution of the program.
The memory chip 41 includes an EEPROM 411 that can electrically erase and write data any number of times.

ICカードは、第2図に示すようなICカード・リーダ
ー・ライタを介して、ホストコンピユータに接続して使
用される。キーボードは暗証番号や読出あるいは書込等
の種々の命令(コマンド)やデータ(情報)を入力する
ためのもので、ホストコンピユータないしはリーダ・ラ
イタに接続される。リーダ・ライタとホストコンピユー
タ及びキーボードは一体に作られてもよく、個別の装置
にしてその間を通信手段で結んでもよい。
The IC card is used by being connected to a host computer via an IC card reader / writer as shown in FIG. The keyboard is for inputting various commands (commands) such as a personal identification number, reading or writing, and data (information), and is connected to a host computer or a reader / writer. The reader / writer, the host computer, and the keyboard may be integrally formed, or they may be formed as separate devices and connected to each other by communication means.

第3図にこの発明の実施例におけるEEPROM411
の構成を示す。このEEPROMは、ICカード全体を
管理するための情報を格納するためシステム・エリア
と、実際に記録されるべきデータとそのデータを管理す
る情報を記憶するレーザ・エリアとから成る。システム
・エリアには、このICカードで使用される暗証番号が
記憶される暗証番号エリアと暗証番号の誤り入力を管理
するキーロツク・エリアが設けられている。暗証番号に
はカード使用者個人が特定する暗証番号である個人キー
と、事業体のカード管理者を特定する管理キーと、デー
タ(あるいは記憶エリア)と事業体との関係を特定する
事業体キーと、ICカードの発行元を特定する発行者キ
ーなどがある。
FIG. 3 shows the EEPROM 411 according to the embodiment of the present invention.
Shows the configuration of. This EEPROM comprises a system area for storing information for managing the entire IC card, and a laser area for storing data to be actually recorded and information for managing the data. The system area is provided with a personal identification number area in which the personal identification number used in this IC card is stored and a key lock area for managing erroneous input of the personal identification number. The personal identification number is a personal identification number that is unique to the card user, a management key that identifies the card administrator of the business entity, and a business entity key that identifies the relationship between the data (or storage area) and the business entity. And an issuer key for identifying the issuer of the IC card.

一方、ユーザ・エリアは複数個(X個)の記憶エリアか
ら成る記憶エリア群と、それら各記憶エリアにそれぞれ
1対1に対応して設けられた同数の索引エリアから成る
索引エリア群から成る。個個の索引エリアは第3図の右
側に、 No.n索引エリアで例示している様に、対応する
記憶エリア( No.n索引エリアは No.n記憶エリアと対
応する。)の記憶エリア定義情報と記憶エリア管理情報
とに区分される。これについては第4図で改めて説明す
る。個々の記憶エリアは、第3図に No.n記憶エリアで
例示している様に、第1回から第m回(mは任意に設定
可能)までのm個のレコードに区分され、1つのレコー
ドには1つのデータが格納されるようになつている。
On the other hand, the user area includes a storage area group including a plurality (X) of storage areas and an index area group including the same number of index areas provided in a one-to-one correspondence with each of the storage areas. The individual index areas are the storage areas of the corresponding storage areas (the No. n index areas correspond to the No. n storage areas) as illustrated in the No. n index areas on the right side of FIG. It is divided into definition information and storage area management information. This will be described again with reference to FIG. Each storage area is divided into m records from the 1st to the mth (m can be set arbitrarily), as illustrated in No. n storage area in FIG. One data is stored in the record.

第4図は第3図のユーザ・エリア中の No.n記憶エリア
に対応する No.n索引エリアの構成をさらに詳細に示し
たものである。先づ第4図の記憶エリア定義情報につい
て説明する。第1および第2バイトには記憶エリア・ス
タート・アドレスが定義されている。これは No.n記憶
エリアの先頭番地を示したものである。次に第3バイト
には、書込の場合のセキユリテイ・レベルW.S.L.
(Write Seculity Level.)と、読出の場合のセキユリ
テイ・レベルR.S.L.(Read Seculity Level )が
定義される。セキユリテイ・レベルは、情報の内容に応
じて機密性に差を与え、その機密性に応じてアクセスす
るのに必要な暗証番号の種類を選択して設定したもので
ある。すなわち、この記憶エリアの情報はどれとどれの
暗証番号があればアクセスできるかを定義する。本実施
例におけるセキユリテイ・レベルの定義は4ビツトで行
い、最上位ビツトで事業体キーの要、不要を、下位3ビ
ツトで個人キー、管理キー及び発行者キーの要、不要を
設定する。第4および第5バイトではそれぞれ書込と読
出の場合における必要な事業体キーの種類が定義されて
いる。本実施例においては、8ビットで定義しているの
で、8種類の事業体を定義できる。すなわち、複合IC
カードでは事業体8社が参加できることになる。この事
業体キーレベルは情報の内容に応じて読出と書込とで異
なる定義が可能である。第6バイトでは、対応する記憶
エリアのレコードの長さが定義されている。
FIG. 4 shows the structure of the No. n index area corresponding to the No. n storage area in the user area of FIG. 3 in more detail. First, the storage area definition information of FIG. 4 will be described. A storage area start address is defined in the first and second bytes. This shows the start address of the No. n storage area. Next, in the third byte, the security level W. S. L.
(Write Seculity Level.) And security level R. S. L. (Read Seculity Level) is defined. The security level gives a difference in confidentiality depending on the content of information, and is set by selecting the type of personal identification number required for access according to the confidentiality. That is, the information in this storage area defines which and which personal identification number can be accessed. In the present embodiment, the security level is defined by 4 bits, and the business entity key is required / unnecessary in the highest bit and the private key, management key and issuer key are required / unnecessary in the lower 3 bits. The 4th and 5th bytes define the type of business entity key required for writing and reading, respectively. In the present embodiment, since it is defined by 8 bits, 8 kinds of business entities can be defined. That is, composite IC
Eight business companies can participate in the card. This business entity key level can be defined differently for reading and writing depending on the content of information. The sixth byte defines the record length of the corresponding storage area.

第7バイトではその記憶エリアで使用可能なレコード数
(第3図のm)が定義される。
The seventh byte defines the number of records that can be used in the storage area (m in FIG. 3).

第8バイトでは対応する記憶エリアのモードが定義され
るが、その詳細は第5図に基づいて後述される。第9お
よび第10バイトは他の処理機能を付加することができ
るようにした予備のバイトである。
The 8th byte defines the mode of the corresponding storage area, the details of which will be described later with reference to FIG. The 9th and 10th bytes are spare bytes to which other processing functions can be added.

次に記憶エリア管理情報について説明する。第11およ
び第12バイトの下位2ビツトにはそれぞれ書込時およ
び読出時における暗証番号の誤入力回数が書き込まれ
る。第13バイトではデータの書込処理過程で次に書き
込むレコードのアドレスを指定するアドレス・ポインタ
の役割が果され、この発明の重要な要素をなしている。
第14バイトは記憶エリア・ステイタス・バイトであ
り、ここには第11または第12バイトのキーエラー回
数が3回に達すると、その記憶エリアへのアクセスを禁
止するための記憶エリア・ロツク・ビツトと、その記憶
エリアへのアクセスを永久にロツクするパーマネント・
ロツク・ビツトと、対応記憶エリアの全レコードが記録
済みとなつたことを示す最上位の満杯ビツトFとが定義
されている。いずれのロツク・ビツトも読出及び書込の
両方の場合のアクセスについて定義される。なお、第1
1および第12バイトの上位5ビツトは、それぞれ第1
4バイトの記憶エリア・ロツク・ビツトを解除(アンロ
ツク)した回数を書き込むもので書込時のロツクと読出
時のロツクとを別個に書き込める。記憶エリア・ロツク
・ビツトの解除は、だれでもが自由に出来るという訳に
はゆかず、所定の暗証番号とコマンドを入力しないと出
来ない様にされる。このアンロツクは正当なカード使用
者あるいは事業体側の過失による暗証番号の誤入力によ
るロツクに対する救済手段である。但し、このアンロツ
クが31回繰り返され、その後、その記憶エリアがロツ
ク状態となつた場合には、その記憶エリアは永久にロツ
ク解除できなくなるようにする。その場合前述の第14
バイトの記憶エリア・ステイタス中のパーマネント・ロ
ツク・ビツトが書き込まれる。なお、第15および第1
6バイトは予備バイトである。
Next, the storage area management information will be described. The lower two bits of the 11th and 12th bytes are written with the number of incorrect input of the personal identification number during writing and reading, respectively. The thirteenth byte plays the role of an address pointer for designating the address of the record to be written next in the process of writing data, which is an important element of the present invention.
The 14th byte is a storage area status byte. When the number of key errors in the 11th or 12th byte reaches 3, the storage area lock bit for prohibiting access to the storage area is written. And a permanent that permanently locks access to that storage area.
A lock bit and the highest full bit F indicating that all the records in the corresponding storage area have been recorded are defined. Both lock bits are defined for access for both read and write. The first
The upper 5 bits of the 1st and 12th bytes are the first
Since the number of times the 4-byte storage area lock bit is released (unlocked) is written, the write lock and the read lock can be written separately. It is not possible for anyone to unlock the memory area, lock, and bit, and it will not be possible without entering the specified PIN and command. This unlock is a remedy for the lock caused by the mistaken input of the personal identification number due to the negligence of the legitimate card user or the business entity. However, if this unlock is repeated 31 times and then the storage area becomes the locked state, the storage area cannot be permanently unlocked. In that case, the above-mentioned 14th
The permanent lock bit in the byte storage area status is written. The fifteenth and first
The 6 bytes are spare bytes.

第5図は第4図に示す記憶エリア定義情報の第8バイト
の記憶エリア・モードの詳細を示すものである。このバ
イトの第0ビツトはレコード書込モードを記憶するもの
で、このビツト“0”が記録されると、対応記憶エリア
の全レコードが書込済みとなつていても、何度でも繰返
し所定の書込順序で各レコードのデータの書換をするこ
とができる循環モードを表わし、またこのビツトに
“1”が記録されると、全レコードが一通り書込済みと
なるとそれ以上にデータの書換ができないようにするフ
ル・ストツプ・モードを表わす。また、このバイトの第
1ビツトには、対応記憶エリアの各レコードにそのレコ
ードの属性等を表わすレコード・ステータス・バイトが
付属しているか否かを表わす符号(“0”の時は無、
“1”の時は有)が記録される。第2ビツトには、各レ
コードに誤り検出用のチエツク符号を有するチエツク・
バイトが付属しているか否かを表わす符号(“0”時は
無、“1”の時は有)が記録される。このバイトの上位
5ビツトは未使用である。
FIG. 5 shows details of the storage area mode of the 8th byte of the storage area definition information shown in FIG. The 0th bit of this byte stores the record write mode. When this bit "0" is recorded, a predetermined number of times is repeated even if all the records in the corresponding storage area have been written. It represents a circular mode in which the data of each record can be rewritten in the writing order. When "1" is recorded in this bit, the data will be rewritten further after all records have been written. Represents a full stop mode that disables. Also, the first bit of this byte is a code indicating whether or not each record in the corresponding storage area is accompanied by a record status byte indicating the attribute of the record (when it is "0", there is no
If "1", it is recorded. The second bit has a check code that has a check code for error detection in each record.
A code indicating whether or not a byte is attached is recorded (“0” means nothing, “1” means yes). The upper 5 bits of this byte are unused.

以下、この発明に係るデータ管理装置の動作について説
明する。
The operation of the data management device according to the present invention will be described below.

第6図は第1図に示すICカードが第2図に示すICカ
ード・リーダ・ライタに接続されたときの基本的な動作
フローを示すものである。ICカード・リーダ・ライタ
はカード挿入部(図示せず)を備えていて、カードが挿
入部に差し込まれるとカードの電気接点5とリーダ・ラ
イタに設けられた接点とが接触する。なおカードとカー
ド・リーダ・ライタとの接続は金属導体の様な金属接点
のみに限るものではなく、信号がカードとカード・リー
ダ・ライタとの間を伝送できるものであれば光学的接続
手段や音響的接続手段あるいは電磁誘導的接続手段等種
々の信号伝送手段を利用し得る。ICカードがICカー
ド・リーダ・ライタに挿入され接続が行われると、ステ
ツプ60でICカードに電源が供給され、さらにクロツ
クパルス等がカードへ送られ始める。これによりICカ
ードは電力の供給を受け、クロツクパルスが入力され、
動作可能な状態にリセツトされる。ICカードはステツ
プ61でアンサ・トウ・リセツト・バイトを出力し、コ
マンド入力の待機状態になる。リーダ・ライタはアンサ
・トウ・リセツト・バイトをステツプ62で受信した
後、ステツプ63でコマンドを出力する。コマンドには
暗証番号の入力、読出あるいは書込の命令等があり、個
々のコマンド毎に以下のステツプが実行される。
FIG. 6 shows a basic operation flow when the IC card shown in FIG. 1 is connected to the IC card reader / writer shown in FIG. The IC card reader / writer has a card insertion portion (not shown), and when the card is inserted into the insertion portion, the electrical contact 5 of the card and the contact provided on the reader / writer come into contact with each other. It should be noted that the connection between the card and the card reader / writer is not limited to only metal contacts such as metal conductors, but optical connection means or optical connection means may be used as long as signals can be transmitted between the card and the card reader / writer. Various signal transmission means such as acoustic connection means or electromagnetic induction connection means can be used. When the IC card is inserted into the IC card reader / writer and connected, the power is supplied to the IC card in step 60, and a clock pulse or the like starts to be sent to the card. As a result, the IC card receives power supply and clock pulse is input,
It is reset to the operable state. The IC card outputs the answer to reset byte at step 61, and enters the standby state for command input. The reader / writer receives the answer to reset byte at step 62 and then outputs the command at step 63. The command includes a command to input, read or write a personal identification number, and the following steps are executed for each command.

ICカードはステツプ64でコマンドを受け取ると、そ
のコマンドをステツプ65で実行し、ステツプ66でコ
マンドを実行した結果をリーダ・ライタに転送して再び
ステツプ64に戻る。リーダ・ライタはステツプ67で
コマンドが実行された結果を受け取ると、ステツプ68
で次のコマンドがあるか否かをチエツクし、あればステ
ツプ63に戻り、上述の手順を繰り返す。すべてのコマ
ンドの処理が終了した旨のコマンドに基づきステツプ6
8は“NO”と判断してステツプ69に進み、ここでリ
ーダ・ライタはカードへの電源の供給等を停止しICカ
ードの動作を終了させ、処理が終つた事を表示する等の
必要な動作を行う。
When the IC card receives the command in step 64, the command is executed in step 65, the result of executing the command in step 66 is transferred to the reader / writer, and the process returns to step 64 again. When the reader / writer receives the result of executing the command in step 67, step 68
Check whether there is a next command, and if there is, return to step 63 and repeat the above procedure. Step 6 based on the command that all command processing has been completed
8 judges "NO" and proceeds to step 69, where the reader / writer stops the supply of power to the card, terminates the operation of the IC card, and displays necessary processing such as displaying that processing has been completed. Take action.

第7図はこの発明に係るICカードの読出及び書込動作
の手順を示したもので第6図のステツプ64から66の
閉ループフローに対応するものである。
FIG. 7 shows the procedure of the reading and writing operations of the IC card according to the present invention, and corresponds to the closed loop flow of steps 64 to 66 of FIG.

まずステツプ71で初期設定が行われる。これは第6図
のステツプ60,61及び62に対応するものである。
次にステツプ72でコマンド及びデータが入力される。
これには必要な暗証番号の入力、読出命令及び読み出す
記憶エリアの指定、下記命令及び書き込むべき記憶エリ
アの指定並びに書込データ等の入力がある。読出命令に
は、当該記憶エリアに記録されたデータを全部読み出す
履歴続出命令と、最新データのみを読み出す更新読出命
令とがある。ステツプ73では暗証番号(キー)が入力
されたかどうかチエツクされる。暗証番号が入力されて
いればその暗証番号が使用禁止(キーロツク)のものか
どうかステツプ74でチエツクされる。キーロツクは、
暗証番号の不正使用を防止するために設けられたもので
あり、記憶エリアのアクセスを禁止するもの(第4図の
記憶エリア・ステイタス・バイト)とは異り、暗証番号
そのものの使用を禁止するものである。すなわち個人キ
ー、管理キー、発行者キー、及び事業体キー(複数)が
それぞれ連続15回正しい暗証番号と不一致の場合はそ
の暗証番号は使えなく(キーロツク)するものである。
キーロツクの場合は前述の第3図のシステム・エリアに
キーロツク・エリアを各暗証番号毎に設け、その暗証番
号の不一致が15回に達すると、キーロツクであること
が書き込まれる。ステツプ74ではシステム・エリアの
キーロツク・エリアを読み出し、入力された暗証番号が
キーロツクされてるかどうかチエツクする。キーロツク
であれば、その暗証番号ではカードの処理はできないの
でステツプ75でリーダ・ライタへエラー通知をし、次
の新たなコマンドを待つ。キーロツクされてなければ、
ステツプ76でシステム・エリアを読み出し暗証番号の
照合をし、ステツプ77で照合結果(一致か不一致か)
をRAM403に記憶させて照合終了通知をし、ステツ
プ72にもどる。次にステツプ72で、例えば読出命令
と読出記憶エリアの指定からなる読出コマンドが入る
と、ステツプ73ではキー入力ではないのでステツプ7
8へ移る。ステツプ78では読出コマンドが否かがチエ
ツクされる。今は読出コマンドであるのでステツプ79
へ移り、コマンドで指定された記憶エリアに対応する記
憶エリア・ステイタス・バイト(第4図、第14バイ
ト)を読み出して、ステツプ80で記憶エリア・ロツク
またはパーマネントロツクの状態にセツトされているか
否かをチエツクする。ロツク状態であればステツプ81
でリーダ・ライタへエラー通知をし、別のコマンド待ち
状態となる。ロツク状態でなければ、ステツプ82でキ
ーチエツクを行う。これはステツプ77でRAM403
に記憶されたキー照合結果が一致か不一致かをチエツク
する。チエツク結果が不一致のときはステツプ83でエ
ラー通知をして次のコマンド待ち状態となる。キーチエ
ツク結果がOKであれば、ステツプ84で指定記憶エリ
アの読出が実行される。この詳細は後述する。ステツプ
72でのコマンドが書込命令と書込記憶エリアの指定と
書込データとから成る書込コマンドの場合は、ステツプ
86からステツプ87へ移る。読出コマンドでも書込コ
マンドでもない場合はステツプ88でその他の処理がな
されて、ステツプ72へ戻る。ステツプ87ではコマン
ドで指定された記憶エリアに対応する記憶エリア・ステ
イタス・バイトを読み出し、ステツプ89で記憶エリア
・ロツクおよびパーマネント・ロツクのチエツクをす
る。ロツク状態であればステツプ90でエラー通知を
し、別のコマンド待ち状態となる。ロツク状態でなけれ
ば、ステツプ91でキーチエツクを行う。キーチエツク
結果が不一致であればステツプ92でエラー通知をし、
一致であればステツプ93でデータが指定された記憶エ
リアに書き込まれる。この詳細は後述する。
First, in step 71, initial setting is performed. This corresponds to steps 60, 61 and 62 of FIG.
Next, at step 72, commands and data are input.
This includes input of a necessary personal identification number, a read instruction and designation of a storage area to be read, the following instruction and designation of a storage area to be written, and input of write data. The read command includes a history continuation command that reads all the data recorded in the storage area and an update read command that reads only the latest data. At step 73, it is checked whether the personal identification number (key) has been input. If the personal identification number has been input, it is checked at step 74 whether the personal identification number is prohibited (key lock). The keylock is
This is provided to prevent unauthorized use of the PIN, and unlike the one that prohibits access to the storage area (storage area status byte in Fig. 4), prohibits the use of the PIN itself. It is a thing. That is, when the personal key, the management key, the issuer key, and the business entity key (plurality) do not match the correct personal identification number 15 times in succession, the personal identification number cannot be used (key lock).
In the case of a keylock, a keylock area is provided for each personal identification number in the system area shown in FIG. 3, and when the number of discrepancies in the personal identification number reaches 15, the keylock is written. At step 74, the key-lock area of the system area is read and it is checked whether or not the inputted personal identification number is key-locked. If it is a key lock, the card cannot be processed with the personal identification number, so an error notification is sent to the reader / writer at step 75 and the next new command is waited for. If not locked
In step 76, the system area is read out and the password is collated. In step 77, the collation result (whether it matches or not)
Is stored in the RAM 403 to notify the end of collation, and the process returns to step 72. Next, at step 72, when a read command consisting of a read command and designation of a read storage area is input, step 73 does not indicate key input, so step 7
Go to 8. At step 78, it is checked whether or not the read command is issued. Since it is a read command now, step 79
Then, the storage area status byte (FIG. 4, byte 14) corresponding to the storage area designated by the command is read out, and at step 80, whether the storage area lock or permanent lock has been set. Check out. If it is locked, step 81
Then, the error notification is sent to the reader / writer, and it waits for another command. If it is not in the locked state, step 82 performs the key check. This is the RAM 403 in step 77.
Check whether the key matching result stored in is a match or a mismatch. If the check results do not match, an error is notified in step 83 and the next command wait state is entered. If the result of the check check is OK, the designated storage area is read at step 84. The details will be described later. If the command in step 72 is a write command consisting of a write command, a designation of a write storage area, and write data, the process moves from step 86 to step 87. If it is neither a read command nor a write command, other processing is performed in step 88 and the process returns to step 72. In step 87, the storage area status byte corresponding to the storage area designated by the command is read out, and in step 89 the storage area lock and the permanent lock are checked. If it is in the locked state, an error notification is given in step 90, and another command waiting state is entered. If it is not in the locked state, the key check is performed in step 91. If the key check results do not match, an error is notified in step 92,
If they match, the data is written in the designated storage area in step 93. The details will be described later.

第8図は第7図におけるステツプ93のデータ書込を更
に詳細に示したフロー図である。同図において、先ずス
テツプ95で循環書込か否かが第4図に示す記憶エリア
・モードの第0ビツト(第5図参照)の内容に基づき判
断される。ここで、“NO”と判断されればフル・スト
ツプ・モードであるから、ステツプ96で第4図の記憶
エリア・ステイタス(第14バイト)中の最上位の満杯
ビツトFにより対応記憶エリアのレコードが全て記録済
みであるか否かが判断され、ここで“YES”と判断さ
れればそれ以上のデータの書込はできないので、ステツ
プ97で記憶エリアが満杯である旨の通知をし終了す
る。ステツプ96で“NO”と判断すれば、ステツプ9
8に進む。ステツプ95で循環書込と判断されたときも
ステツプ98に進む。ステツプ98では、第4図のレコ
ード・アドレス・バイト(第13バイト)の内容をRA
M403中のレコード・ポインタに読み出し、ステツプ
99でレコード・ポインタで指定されたレコードにデー
タおよびチエツク・バイトを書き込む。次いで、ステツ
プ100でレコード・ポインタの内容を1だけインクリ
メントして、次に入力されるデータの記録されるアドレ
スを指定する。そのインクリメントの結果が当該記憶エ
リアのレコード数に対応する順位のレコードであるか否
かをステツプ101でチエツクする。ここで、“NO”
と判断されたときはステツプ102に進み、レコード・
ポインタの内容を対応索引エリア中のレコード・アドレ
ス・バイト(第4図、第13バイト)に書き込み、ステ
ツプ103で書込結果を出力する。
FIG. 8 is a flow chart showing the data writing in step 93 in FIG. 7 in more detail. In the figure, first, in step 95, it is judged whether or not the cyclic writing is performed based on the contents of the 0th bit (see FIG. 5) in the storage area mode shown in FIG. If "NO" is determined here, the full stop mode is in effect, so at step 96, the record of the corresponding storage area is made by the highest full bit F in the storage area status (14th byte) of FIG. Has been recorded, and if "YES" is determined here, no more data can be written. Therefore, in step 97, a notification that the storage area is full is issued and the processing ends. . If step 96 determines “NO”, step 9
Go to 8. When it is determined in step 95 that the cyclic writing is performed, the process also proceeds to step 98. At step 98, the contents of the record address byte (13th byte) shown in FIG.
The data is read to the record pointer in M403, and the data and the check byte are written in the record designated by the record pointer in step 99. Then, in step 100, the content of the record pointer is incremented by 1 to specify the address at which the next input data is recorded. At step 101, it is checked whether or not the result of the increment is a record having a rank corresponding to the number of records in the storage area. Where "NO"
If it is determined that the record
The contents of the pointer are written into the record address byte (FIG. 4, 13th byte) in the corresponding index area, and the write result is output in step 103.

ステツプ101で“YES”と判断されたときは、対応
記憶エリアの全レコードが書込済みになつたことを意味
するので、ステツプ105でレコード・アドレス・バイ
トに当該記憶エリアの最先書込順位のレコードのアドレ
スを書き込み、次いでステツプ106で第4図の記憶エ
リア・ステイタス・バイト(第14バイト)中の最上位
の満杯ビツトFに記憶エリア満杯を表わすフラグを立
て、ステツプ103で書込結果を出力して終了する。
If "YES" is determined in the step 101, it means that all the records in the corresponding storage area have been written. Therefore, in the step 105, the record address byte is written to the first write order of the storage area. The address of the record is written, then at step 106, the flag indicating the full storage area is set to the highest full bit F in the storage area status byte (14th byte) in FIG. 4, and the write result is obtained at step 103. And output.

第9図は第7図中のステツプ84のデータ読出の内容を
より詳細に示したフロー図である。同図において、先づ
ステツプ109で更新読出命令であるか否かを判断す
る。更新読乱命令と判断されたときは、ステツプ110
で最新のデータのみを読み出すべくレコード・ポインタ
に、レコード・アドレス・バイト(第4図、第13バイ
ト)から1だけデクレメントした最終書込データの記録
されたレコードのアドレスを記憶させ、ステツプ111
で最新データを読み出し、ステツプ112で誤りがない
かをチエツク・バイトで照合した後、ステツプ113で
対応する最新情報を出力して終了する。
FIG. 9 is a flow chart showing in more detail the contents of the data read at step 84 in FIG. In the figure, first, in step 109, it is judged whether or not it is an update read command. When it is judged that the update read / write instruction is executed, step 110 is executed.
In order to read out only the latest data, the record pointer stores the address of the record in which the final write data is decremented by 1 from the record address byte (FIG. 4, 13th byte), and step 111
In step 112, the latest data is read out, and in step 112, the check byte is used to check if there is any error. After that, in step 113, the corresponding latest information is output, and the process ends.

一方、ステツプ109で“NO”と判断されたときは履
歴読出命令であることを意味し、先ずステツプ115へ
進む。ステツプ115では、記憶エリア・ステイタス・
バイト(第4図、第14バイト)の最上位の満杯ビツト
Fにより全レコードの書込が一巡したか否かをチエツク
する。ここで、“YES”と判断されれば、レコード・
アドレス・バイトの内容は最も古いデータの記録された
レコードのアドレスを表わすことになるから、ステツプ
116でそのバイトの内容がレコード・ポインタにセツ
トされる。ステツプ115で“NO”と判断されたとき
は、レコードへの書込が未だ一巡していないので、最も
古いデータは最先書込順位のレコードに記録されている
から、ステツプ117で最先書込順位のレコード・アド
レスがレコード・ポインタにセツトされる。次いで、ス
テツプ118でレコード・ポインタで指定されたレコー
ドのデータを読み出し、ステツプ119でチエツク・バ
イト照合をしてステツプ120でデータを出力する。引
き続き、ステツプ121でレコード・ポインタを1だけ
インクリメントをし、ステツプ122でレコード・ポイ
ンタで指定するレコードの順位がレコード数に等しいか
否かは判断する。ここで“YES”と判断されれば、最
終書込順位のレコードが今読み出されたばかりであるこ
とを意味するステツプ123でレコード・ポインタの内
容を最先書込順位レコードのアドレスにしてステツプ1
24に進む。ステツプ122で“NO”と判断されたと
きもステツプ124へ進む。ステツプ124ではアドレ
ス・ポインタが次に入力されるデータを書き込むべきレ
コードのアドレス(レコード・アドレス・バイトの内
容)と等しいか否かを判断する、ここで“YES”と判
断されると、履歴読出は全て終了したことになるのでこ
のフローを終了する。ステツプ124で“NO”と判断
されれば次のレコードのデータを読み出すべくステツプ
118へ戻る。
On the other hand, if "NO" is determined in the step 109, it means that the instruction is a history read command, and the process proceeds to the step 115 first. In step 115, the storage area, status,
A check is made as to whether or not writing of all records has been completed by the highest full bit F of bytes (FIG. 4, FIG. 14). If “YES” is determined here, the record /
Since the content of the address byte will represent the address of the record in which the oldest data was recorded, at step 116 the content of that byte is set in the record pointer. If "NO" is determined in the step 115, since the writing to the record has not been completed yet, the oldest data is recorded in the record of the first writing order. Therefore, the first writing is performed in the step 117. The record address of the priority order is set in the record pointer. Next, in step 118, the data of the record designated by the record pointer is read out, in step 119, the check / byte collation is performed, and in step 120 the data is output. Then, in step 121, the record pointer is incremented by 1, and in step 122, it is judged whether or not the rank of the record designated by the record pointer is equal to the number of records. If "YES" is determined here, the contents of the record pointer are set to the address of the first write order record in step 123, which means that the record of the last write order is just read out.
Proceed to 24. Even if it is determined to be "NO" in step 122, the process also proceeds to step 124. In step 124, it is judged whether or not the address pointer is equal to the address (record address byte content) of the record to which the data to be inputted next is written. If "YES" is judged here, the history reading is carried out. Since all have ended, this flow ends. If "NO" is determined in the step 124, the process returns to the step 118 to read the data of the next record.

なお、以上の説明ではレコード・アドレス・バイト(第
4図、第13バイト)にはレコードのアドレスを記録す
るものとして説明したが、この方法とは別に、対応記憶
エリアのレコード番号により、該当レコードをアクセス
してもよい。
In the above description, the address of the record is recorded in the record address byte (FIG. 4, 13th byte). However, apart from this method, the record number in the corresponding storage area causes the corresponding record to be recorded. May be accessed.

【図面の簡単な説明】 第1図はこの発明に係るICカードの回路構成を示すブ
ロツク図、第2図はICカードを挿着するICカード・
リーダ・ライタとホストコンピユータとキーボードの関
係を示す図、第3図は第1図に示すEEPROMのエリ
ア構成を示す図、第4図は第3図の索引エリア群の中の
一つの索引を示す構成図、第5図は第4図の記憶エリア
・モードの詳細を示す図、第6図はICカードとICカ
ード・リーダ・ライタの全体の相互動作関係を示すフロ
ー図、第7図は第6図におけるICカードの主要動作部
のフロー図、第8図は書込動作のフロー図、第9図は読
出動作のフロー図である。
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a circuit configuration of an IC card according to the present invention, and FIG. 2 is an IC card for inserting an IC card.
FIG. 3 is a diagram showing the relationship between the reader / writer, the host computer and the keyboard, FIG. 3 is a diagram showing the area structure of the EEPROM shown in FIG. 1, and FIG. 4 is one index in the index area group of FIG. FIG. 5 is a configuration diagram, FIG. 5 is a diagram showing details of the storage area mode in FIG. 4, FIG. 6 is a flowchart showing the mutual operation relationship of the IC card and the IC card reader / writer, and FIG. FIG. 6 is a flow chart of the main operation part of the IC card in FIG. 6, FIG. 8 is a flow chart of a write operation, and FIG. 9 is a flow chart of a read operation.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】少なくともCPUとデータの書換が可能な
メモリとを備え、該メモリは複数個のレコードを有する
複数個の記憶エリアを備えており、データを逐次にそれ
らレコードに書き込みまたは書込データを読み出すよう
にしたデータ管理手段を有するICカードであって、 次に入力されるデータを書き込むべきレコードのアドレ
スを指定するレコード・ポインタ手段と、 最終書込順位のレコードにデータが書き込まれたか否か
を判断する手段と、 該判断手段が最終書込順位のレコードにデータが書き込
まれていないと判断したときは前記レコード・ポインタ
手段に最後に書き込まれたレコードの次の書込順位のレ
コードのアドレスの指定を行わせる手段と、 当該記憶エリアがレコードにデータを逐次に循環して書
き込まれるべき循環モードであるか否かを設定する手段
と、 前記判断手段が最終書込順位のレコードにデータが書き
込まれたと判断したときは該設定手段が循環モードに設
定されているときのみ前記レコード・ポインタ手段に最
先書込順位のレコードのアドレスの指定を行わせる手段
と、 を備えたことを特徴とするデータ管理手段を有するIC
カード。
1. At least a CPU and a memory capable of rewriting data are provided, and the memory has a plurality of storage areas having a plurality of records, and data is sequentially written in the records or written data. It is an IC card having a data management means for reading data, and a record pointer means for designating an address of a record to which the next input data is to be written, and whether or not the data is written in the record of the final writing order. And a means for determining whether or not data has not been written in the record in the final write order, the record pointer means determines whether the record in the write order next to the record last written in the record pointer means. The means for specifying the address and the circulation mode in which the storage area is to be written by sequentially circulating the data in the record. And a record pointer only when the setting means is set to the circulation mode when the determining means determines that the data is written in the record of the final writing order. An IC having a data management means, characterized in that the means includes means for designating the address of the record in the highest writing order.
card.
JP60297591A 1985-12-26 1985-12-26 IC card having data management means Expired - Lifetime JPH0652545B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60297591A JPH0652545B2 (en) 1985-12-26 1985-12-26 IC card having data management means

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60297591A JPH0652545B2 (en) 1985-12-26 1985-12-26 IC card having data management means

Publications (2)

Publication Number Publication Date
JPS62154083A JPS62154083A (en) 1987-07-09
JPH0652545B2 true JPH0652545B2 (en) 1994-07-06

Family

ID=17848535

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60297591A Expired - Lifetime JPH0652545B2 (en) 1985-12-26 1985-12-26 IC card having data management means

Country Status (1)

Country Link
JP (1) JPH0652545B2 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6491291A (en) * 1987-09-30 1989-04-10 Casio Computer Co Ltd Card read write device
JPH0212581A (en) * 1988-06-30 1990-01-17 Toppan Printing Co Ltd Ic card
JP4051510B2 (en) 1998-07-16 2008-02-27 ソニー株式会社 Data storage device and data storage method
WO2004039008A1 (en) * 2002-10-22 2004-05-06 Logitec Corporation Data communication system
CN100445963C (en) * 2007-02-15 2008-12-24 华为技术有限公司 Method and apparatus for realizing high-reliability chain list
US10868679B1 (en) * 2019-07-25 2020-12-15 Cypress Semiconductor Corporation Nonvolatile memory device with regions having separately programmable secure access features and related methods and systems

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2401459A1 (en) * 1977-08-26 1979-03-23 Cii Honeywell Bull PORTABLE INFORMATION MEDIA EQUIPPED WITH A MICROPROCESSOR AND A PROGRAMMABLE DEAD MEMORY
JPS56101331A (en) * 1980-01-14 1981-08-13 Meidensha Electric Mfg Co Ltd Device for treating digital relay

Also Published As

Publication number Publication date
JPS62154083A (en) 1987-07-09

Similar Documents

Publication Publication Date Title
KR900008768B1 (en) Portable electronic device
US4849614A (en) Composite IC card
KR900002070B1 (en) Portable electronic device
US4734568A (en) IC card which can set security level for every memory area
KR900002071B1 (en) Portable electronic device
JP2623332B2 (en) IC card and its operation program writing method
JPH0758500B2 (en) Portable electronic device
KR910002256B1 (en) Portable electronic device
JPS63788A (en) Portable electronic equipment
KR100948120B1 (en) Portable information recording medium
JPH03503220A (en) Method and mobile device for checking message integrity
EP1372291A1 (en) Portable information storage medium and its authentification method
JPH0793203A (en) File managing system
JPS62190584A (en) Portable electronic device
JPH0652545B2 (en) IC card having data management means
JP2677589B2 (en) Portable electronic device and IC chip
JPH10198776A (en) Portable information recording medium, and its information writing and reading method
JP2532063B2 (en) IC card
JPS5977699A (en) Integrated circuit card
JPH0685158B2 (en) IC card
JPS62231352A (en) Ic card
JP2609645B2 (en) Portable electronic devices
US5901285A (en) Hierarchical erasure key protection for computer system data
JP2534984B2 (en) IC card
JP2537200B2 (en) Portable electronic devices