JPH1139450A - IC card - Google Patents
IC cardInfo
- Publication number
- JPH1139450A JPH1139450A JP9198305A JP19830597A JPH1139450A JP H1139450 A JPH1139450 A JP H1139450A JP 9198305 A JP9198305 A JP 9198305A JP 19830597 A JP19830597 A JP 19830597A JP H1139450 A JPH1139450 A JP H1139450A
- Authority
- JP
- Japan
- Prior art keywords
- data
- page
- write
- read
- area
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K19/00—Record carriers for use with machines and with at least a part designed to carry digital markings
- G06K19/06—Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
- G06K19/067—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components
- G06K19/07—Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Credit Cards Or The Like (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
(57)【要約】
【課題】 ICカードにおいて高速にアクセスできるリ
ングバッファを実現する。
【解決手段】 下記のコラムリードコマンドを用意す
る。リーダライタからコラムリードコマンドが発行され
ると、コマンドで指定される読出対象バッファ領域の先
頭ページをICカード内のPAレジスタに設定する。次
に、PAレジスタの示すページの所定位置の例えば1バ
イトデータをICカード内のメモリ(EEPROM)か
ら読み出すためのアドレスを生成し、それを用いてデー
タを読み出す。PAレジスタの値をインクリメントしつ
つこのような読み出し動作を繰り返し、前記バッファ領
域の最後のページまで読み出すと、読み出した全データ
をリーダライタに対し送信する。リーダライタは、この
コラムリードコマンドによりリングバッファの全ページ
のステータス情報を1度に読み出して最新書込ページを
検出し、それに基づきリングバッファに対する読出/書
込を行う。
(57) [Summary] [PROBLEMS] To realize a ring buffer that can be accessed at high speed in an IC card. SOLUTION: The following column read command is prepared. When a column read command is issued from the reader / writer, the first page of the buffer area to be read specified by the command is set in the PA register in the IC card. Next, an address for reading, for example, 1-byte data at a predetermined position of the page indicated by the PA register from the memory (EEPROM) in the IC card is generated, and the data is read using the generated address. When such a read operation is repeated while incrementing the value of the PA register and reading is performed up to the last page of the buffer area, all the read data is transmitted to the reader / writer. The reader / writer reads out the status information of all pages of the ring buffer at once by this column read command, detects the latest write page, and reads / writes the ring buffer based on the page.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、データ読出/書込
装置との間でデータの授受を行うICカードに関する。The present invention relates to an IC card for exchanging data with a data reading / writing device.
【0002】[0002]
【従来の技術】ICカードは、データ読出/書込装置と
の間でデータの授受を行うものであり、例えば各種の取
引に利用することができる。この場合、取引等の履歴情
報をICカードに記憶させることが多い。このような履
歴情報をICカードに記憶させていく過程において、履
歴情報を格納する領域としてICカードのメモリ内に用
意された記憶領域が満杯になると、その記憶領域内の最
古のデータを消去し、その消去した領域に最新のデータ
を書き込むことになる。したがって、ICカードに取引
等の履歴情報を記憶させる場合には、ICカードにおい
てリングバッファを実現する必要がある。2. Description of the Related Art An IC card exchanges data with a data reading / writing device, and can be used for various transactions, for example. In this case, history information of transactions and the like is often stored in an IC card. In the process of storing such history information in the IC card, if the storage area prepared in the memory of the IC card as the area for storing the history information becomes full, the oldest data in the storage area is erased. Then, the latest data is written in the erased area. Therefore, when history information such as transactions is stored in the IC card, it is necessary to realize a ring buffer in the IC card.
【0003】ICカードでは、データを記憶するための
メモリとして、通常、EEPROM(Electrically Eras
able Programmable Read Only Memory)(電気的消去書
込可能型ROM)が使用されている。EEPROMは、
書き込みに時間を要し、ページと呼ばれる所定サイズ
(例えば16バイト)を単位として書き込みが行われる
場合が多い。一方、ICカードの応用面から見たデータ
の単位はファイルと呼ばれ、通常、ファイルのサイズは
ページのサイズと等しくなるように設定される場合が多
い。このようなICカードにおいてリングバッファを実
現して取引の履歴情報を記憶させる場合、図15(a)
に示すように、ICカードのメモリにおいてリングバッ
ファ領域として用意された複数ページから成る所定領域
に対し、最初のページ1から順に、履歴情報1、履歴情
報2、…、履歴情報nというように書き込みが行われて
いく。そして、最後のページnまで書き込みが行われた
後に更に書き込み要求が生じると、最古の履歴情報1が
書き込まれている最初のページ1に最新の履歴情報n+
1が上書きされる(図15(b)(c)参照)。In an IC card, an EEPROM (Electrically Eras) is usually used as a memory for storing data.
A programmable programmable read only memory (electrically erasable and writable ROM) is used. EEPROM is
Writing takes time, and writing is often performed in units of a predetermined size called a page (for example, 16 bytes). On the other hand, the data unit viewed from the application of the IC card is called a file, and the file size is usually set to be equal to the page size in many cases. When a ring buffer is realized in such an IC card to store transaction history information, FIG.
As shown in (1), history information 1, history information 2,..., History information n are written in order from the first page 1 into a predetermined area composed of a plurality of pages prepared as a ring buffer area in the memory of the IC card. Is going on. Then, when a write request is further generated after writing to the last page n is performed, the latest history information n + is added to the first page 1 where the oldest history information 1 is written.
1 is overwritten (see FIGS. 15B and 15C).
【0004】リングバッファの実現に際しては、通常、
リングバッファにおける読み出すべき位置を指すリード
ポインタと、書き込むべき位置を指すライトポインタと
が用意されるが、ICカードにおいて取引等の履歴情報
の記憶させる場合、リードポインタは最新に書き込まれ
たページを指すようになっている。したがって、ライト
ポイントは常にリードポインタの次のページを指すこと
になる。その結果、リングバッファに対する読み出しお
よび書き込みのいずれにおいても、実質的には、最新に
履歴情報を書き込んだページ(最新書込ページ)を指す
ポインタ(以下「最新書込ポインタ」という)さえ獲得
できればよいことになる。In realizing a ring buffer, usually,
A read pointer indicating a position to be read in the ring buffer and a write pointer indicating a position to be written are prepared. When storing history information such as a transaction in an IC card, the read pointer indicates a page that has been written most recently. It has become. Therefore, the write point always points to the page next to the read pointer. As a result, in both reading and writing with respect to the ring buffer, substantially, only a pointer (hereinafter, referred to as a “latest write pointer”) that points to a page (latest write page) in which history information is written most recently may be obtained. Will be.
【0005】上記のように、所定領域をリングバッファ
として使用するメモリを内蔵したICカードに対しデー
タ読出/書込装置(以下「リーダライタ」という)が履
歴情報の読み出し又は書き込みを行う際には、ICカー
ドに電源供給が開始された後にリングバッファにおける
最新書込ポインタの値を得る必要がある。これに対し、
リングバッファが実現された従来のICカードでは、リ
ングバッファを構成する各ページの内容を調べて最新書
込ページを探すか(以下、この方法を採用したICカー
ドを「従来例1」という)、または、最新書込ポインタ
を格納する領域をICカードのメモリ(EEPROM等
の不揮発性メモリ)内に別途設けていた(以下、この方
法を採用したICカードを「従来例2」という)。な
お、ICカードには、CPU(Central Processing Uni
t)(中央処理装置)等を内蔵し情報処理機能を有するも
のと、読み出し/書き込み機能のみを有するものとがあ
り、情報処理機能を有するICカードの場合は、外部の
リーダ/ライタから履歴情報の読み出し又は書き込みを
行う際に、ICカード内部で、リングバッファを構成す
る各ページの内容を調べて最新書込ページを探すか、ま
たは、最新書込ポインタの格納用領域(以下「ポインタ
領域」という)に格納されている値を読み出すことによ
り、最新書込ポインタの値を得ていた。一方、読み出し
/書き込み機能のみを有するICカードの場合は、外部
のリーダ/ライタが、ICカードからリングバッファの
領域のデータを読み出して最新書込ページを探し出すこ
とにより、またはICカードにおけるポインタ領域から
最新書込ポインタを読み出すことにより、最新書込ポイ
ンタの値を得ていた。As described above, when a data reading / writing device (hereinafter referred to as a "reader / writer") reads or writes history information for an IC card having a built-in memory that uses a predetermined area as a ring buffer. It is necessary to obtain the value of the latest write pointer in the ring buffer after the power supply to the IC card is started. In contrast,
In a conventional IC card in which a ring buffer is realized, the contents of each page constituting the ring buffer are checked to find the latest write page (hereinafter, an IC card employing this method is referred to as "conventional example 1"). Alternatively, an area for storing the latest write pointer is separately provided in a memory (a non-volatile memory such as an EEPROM) of the IC card (hereinafter, an IC card employing this method is referred to as “conventional example 2”). The IC card has a CPU (Central Processing Uniform).
t) Some have a built-in (central processing unit) etc. and have an information processing function, while others have only a read / write function. In the case of an IC card having an information processing function, history information is obtained from an external reader / writer. When reading or writing data, the contents of each page constituting the ring buffer are searched inside the IC card to search for the latest write page, or the latest write pointer storage area (hereinafter referred to as “pointer area”). The value of the latest write pointer has been obtained by reading the value stored in the On the other hand, in the case of an IC card having only a read / write function, an external reader / writer reads data in the area of the ring buffer from the IC card and searches for the latest write page, or from a pointer area in the IC card. The value of the latest write pointer has been obtained by reading the latest write pointer.
【0006】[0006]
【発明が解決しようとする課題】従来のICカードは、
データをページ単位(例えば横1列16バイト)でしか
読み出し又は書き込みができなくなっており、最新書込
ポインタのための領域をメモリ内に設けない場合は、最
新書込ページを探し出すために、リングバッファに割り
当てた記憶領域のデータをページ単位で全て読み出さな
ければならなかった。その結果、リングバッファへのア
クセスに多くの時間を要していた。A conventional IC card is:
If data can be read or written only in page units (for example, 16 bytes in a horizontal row) and an area for the latest write pointer is not provided in the memory, a ring is searched for the latest write page. All data in the storage area allocated to the buffer had to be read in page units. As a result, it took a lot of time to access the ring buffer.
【0007】一方、ポインタ領域をメモリ内に設ける場
合には、履歴情報を書き込む毎に、最新書込ポインタの
更新のためにポインタ領域に対し書き込みを行わなけれ
ばならず、このポインタ領域は不揮発性メモリ(通常、
EEPROM)内に設けられるため、その書き込みには
時間を要する。その結果、履歴情報の書き込み処理に長
時間を要していた。また、EEPROM等にポインタ領
域を設けた場合は、ポインタ領域の書き換えの回数が多
いことによるEEPROMの劣化も問題となる。そこで
本発明では、ポインタ領域を不揮発性メモリ内に設ける
ことなく、高速にアクセスが可能なリングバッファを実
現したICカードを提供することを目的とする。On the other hand, when the pointer area is provided in the memory, every time the history information is written, it is necessary to perform writing to the pointer area in order to update the latest write pointer. Memory (usually,
Since it is provided in an EEPROM, it takes time to write the data. As a result, it took a long time to write the history information. When a pointer area is provided in an EEPROM or the like, deterioration of the EEPROM due to a large number of rewrites of the pointer area also poses a problem. Accordingly, an object of the present invention is to provide an IC card that realizes a ring buffer that can be accessed at high speed without providing a pointer area in a nonvolatile memory.
【0008】[0008]
【課題を解決するための手段】上記課題を解決するため
に成された本発明に係る第1のICカードは、データ読
出/書込装置からコマンドを受け取り、受け取ったコマ
ンドに基づき前記データ読出/書込装置との間でデータ
の授受を行うICカードにおいて、前記データ読出/書
込装置からコマンドを含むデータを受け取る受信手段
と、前記データ読出/書込装置へデータを送り出す送信
手段と、前記データ読出/書込装置から受け取ったデー
タを格納するためのデータ領域と該データ領域への書き
込みを示すステータス情報を格納するためのステータス
領域とを含むページを複数集めて構成される記憶領域で
あってリングバッファとして使用される記憶領域を有す
る記憶手段と、前記データ読出/書込装置から受け取っ
たデータを前記データ領域に書き込んだときに、該デー
タを書き込んだ前記データ領域を含むページのステータ
ス領域に該書込を示すステータス情報を書き込む書込制
御手段と、前記データ読出/書込装置からのデータとし
て受信手段により所定のコマンドを受け取ると、前記記
憶領域内の全てのページにつき、ステータス領域に格納
されたステータス情報を順次読み出し、読み出したステ
ータス情報を送信手段によりデータ読出/書込装置へ送
出する読出制御手段と、を備えたことを特徴としてい
る。According to a first aspect of the present invention, there is provided a first IC card for receiving a command from a data read / write device, and executing the data read / write based on the received command. In an IC card for exchanging data with a writing device, receiving means for receiving data including a command from the data reading / writing device, transmitting means for sending data to the data reading / writing device, A storage area configured by collecting a plurality of pages including a data area for storing data received from the data read / write device and a status area for storing status information indicating writing to the data area. A storage unit having a storage area used as a ring buffer, and storing data received from the data reading / writing device. Writing control means for writing status information indicating the writing to a status area of a page including the data area where the data has been written, and receiving means as data from the data reading / writing device When a predetermined command is received, status information stored in the status area is sequentially read for all pages in the storage area, and the read status information is transmitted to the data reading / writing device by the transmission means. And, it is characterized by having.
【0009】本発明に係る第2のICカードは、データ
読出/書込装置からコマンドを受け取り、受け取ったコ
マンドに基づき前記データ読出/書込装置との間でデー
タの授受を行うICカードにおいて、前記データ読出/
書込装置からコマンドを含むデータを受け取る受信手段
と、前記データ読出/書込装置へデータを送り出す送信
手段と、前記データ読出/書込装置から受け取ったデー
タを格納するためのデータ領域と該データ領域への書き
込みを示すステータス情報を格納するためのステータス
領域とを含むページを複数集めて構成される記憶領域で
あってリングバッファとして使用される記憶領域を有す
る記憶手段と、前記記憶領域を構成する全てのページの
ステータス情報を同一の値に予め初期化しておき、前記
データ読出/書込装置から受け取ったデータを前記デー
タ領域に書き込んだときに、該データを書き込んだ前記
データ領域を含むページのステータス情報を構成するビ
ットの値を反転させる書込制御手段と、前記記憶領域内
の各ページのステータス情報を順次読み出し、読み出し
たステータス情報の値が直前に読み出したステータス情
報の値と異なる場合に、該直前に読み出したステータス
情報が格納されていたページをデータ領域に最新に書き
込みが行われた最新書込ページとし、読み出したステー
タス情報の値が前記記憶領域内の全ページにわたって同
一の場合に、最後に読み出したステータス情報が格納さ
れていたページを最新書込ページとして、該最新書込ペ
ージに基づき、リングバッファとして使用される前記記
憶領域に対するデータの読み出しおよび書き込みを制御
するリングバッファ制御手段と、を備えることを特徴と
している。A second IC card according to the present invention is an IC card for receiving a command from a data reading / writing device and transmitting / receiving data to / from the data reading / writing device based on the received command. Data read /
Receiving means for receiving data including a command from a writing device; transmitting means for sending data to the data reading / writing device; a data area for storing data received from the data reading / writing device; A storage unit having a storage area configured by collecting a plurality of pages including a status area for storing status information indicating writing to the area and being used as a ring buffer; and configuring the storage area. The status information of all pages to be written is initialized to the same value in advance, and when data received from the data read / write device is written to the data area, the page including the data area to which the data is written is written. Write control means for inverting the value of a bit constituting status information of each page, and the status of each page in the storage area. Status information is sequentially read out, and when the value of the status information read out is different from the value of the status information read out immediately before, the page in which the status information read out immediately before was stored was written to the data area latest. If the value of the read status information is the same as the latest write page and the value of the read status information is the same over all pages in the storage area, the page in which the status information read last is stored is the latest write page, and Ring buffer control means for controlling the reading and writing of data from and to the storage area used as a ring buffer based on the above.
【0010】本発明に係る第3のICカードは、上記第
2のICカードにおいて、前記ステータス情報は1ビッ
トから成ることを特徴としている。A third IC card according to the present invention is characterized in that, in the second IC card, the status information comprises one bit.
【0011】本発明に係る第4のICカードは、上記第
2のICカードにおいて、前記ステータス情報は奇数個
のビットから成り、前記書込制御手段は、前記ステータ
ス情報を構成する前記奇数個のビットの値が全て同一と
なるように初期化し、前記リングバッファ制御手段は、
読み出したステータス情報に対する多数決演算により値
の異なるビットを含まないステータス情報を生成し、読
み出したステータス情報に代えて該多数決演算によって
生成したステータス情報を用いることにより、最新書込
ページを検出する、ことを特徴としている。In a fourth IC card according to the present invention, in the second IC card, the status information is composed of an odd number of bits, and the writing control means is configured to control the odd number of bits constituting the status information. Initializing the bit values so that they are all the same, the ring buffer control means:
Detecting the latest written page by generating status information that does not include a bit having a different value by a majority operation on the read status information and using the status information generated by the majority operation in place of the read status information. It is characterized by.
【0012】本発明に係る第5のICカードは、データ
読出/書込装置からコマンドを受け取り、受け取ったコ
マンドに基づき前記データ読出/書込装置との間でデー
タの授受を行うICカードにおいて、前記データ読出/
書込装置からコマンドを含むデータを受け取る受信手段
と、前記データ読出/書込装置へデータを送り出す送信
手段と、前記データ読出/書込装置から受け取ったデー
タを格納するための領域を含むページを複数集めて構成
される記憶領域であってリングバッファとして使用され
る記憶領域を有する記憶手段と、前記記憶領域をリング
バッファとして使用するための読み出し位置または書き
込み位置を示すページの値を、当該ICカードに電源供
給が開始された後、前記データ読出/書込装置からコマ
ンドを受け取る前に検出するリングバッファ制御手段
と、を備えることを特徴としている。A fifth IC card according to the present invention is an IC card which receives a command from a data reading / writing device and transmits / receives data to / from the data reading / writing device based on the received command. Data read /
Receiving means for receiving data including a command from the writing device; transmitting means for sending data to the data reading / writing device; and a page including an area for storing the data received from the data reading / writing device. A storage unit having a storage area configured as a plurality of storage areas and used as a ring buffer; and a value of a page indicating a read position or a write position for using the storage area as a ring buffer. And ring buffer control means for detecting after the power supply to the card is started and before receiving a command from the data read / write device.
【0013】本発明に係る第6のICカードは、上記第
2ないし第4のICカードのいずれかのICカードにお
いて、前記リングバッファ制御手段は、当該ICカード
に電源供給が開始された後、前記データ読出/書込装置
からコマンドを受け取る前に、前記最新書込ページを検
出することを特徴としている。A sixth IC card according to the present invention is the IC card according to any one of the second to fourth IC cards, wherein the ring buffer control means comprises: Before receiving a command from the data read / write device, the latest write page is detected.
【0014】本発明に係る第7のICカードは、上記第
2のICカードにおいて、前記記憶領域内の各ページの
ステータス領域のサイズが整数バイトであり、該ステー
タス領域内にステータス情報の格納に使用される領域以
外の領域として書込確認用データ領域を設け、前記書込
制御手段は、前記データ読出/書込装置から受け取った
データを前記データ領域に書き込んだときに、該データ
を書き込んだ前記データ領域を含むページのステータス
情報を構成するビットの値を反転させるとともに、該ペ
ージのステータス領域内の書込確認用データ領域に、該
データが前記データ領域に正しく書き込まれたか否かを
確認するためのデータを書き込む、ことを特徴としてい
る。In a seventh IC card according to the present invention, in the second IC card, the size of the status area of each page in the storage area is an integer byte, and the status information is stored in the status area. A write confirmation data area is provided as an area other than an area used, and the write control means writes the data received from the data read / write device when writing the data in the data area. Invert the values of the bits constituting the status information of the page including the data area, and check whether or not the data has been correctly written to the data area in the write confirmation data area in the status area of the page. For writing data to be performed.
【0015】本発明に係る第8のICカードは、上記第
7のICカードにおいて、前記リングバッファ制御手段
は、 i)前記記憶領域内の各ページのステータス情報の読み
出しにより最新書込ページが検出されたときに、該最新
書込ページの書込確認用データを読み出して、該書込確
認用データにより該最新書込ページのデータ領域に正し
くデータが書き込まれていたか否かを判定する判定手段
と、 ii)該最新書込ページのデータ領域に正しくデータが書
き込まれていないと判定された場合に、該最新書込ペー
ジの直前のページを改めて最新書込ページとする最新書
込ページ変更手段と、を含むことを特徴としている。In an eighth IC card according to the present invention, in the above-mentioned seventh IC card, the ring buffer control means includes: i) detecting a latest write page by reading status information of each page in the storage area; Determining means for reading the write confirmation data of the latest write page and determining whether data has been correctly written in the data area of the latest write page based on the write confirmation data. And ii) a latest write page changing means for renewing a page immediately before the latest write page as a latest write page when it is determined that data is not correctly written in the data area of the latest write page. And is characterized by including.
【0016】[0016]
【発明の実施の形態】以下、添付の図面を参照しつつ本
発明の実施の形態について説明する。 実施の形態1. <1.1 ハードウェア構成>図1は、本発明の実施の
形態1であるICカードの概略構成を示すブロック図で
ある。このICカード100は、電波によりリーダライ
タ200との間でデータの授受を行う非接触型のICカ
ードであって、アンテナ10と、変復調回路12と、入
出力回路14と、制御回路16と、メモリ18とを備
え、入出力回路14と制御回路16とメモリ18とはバ
ス20で接続されている。この他、ICカード100
は、上記各部に電源を供給するための電源回路(図示せ
ず)を備えている。Embodiments of the present invention will be described below with reference to the accompanying drawings. Embodiment 1 FIG. <1.1 Hardware Configuration> FIG. 1 is a block diagram showing a schematic configuration of an IC card according to the first embodiment of the present invention. The IC card 100 is a non-contact type IC card that transmits and receives data to and from a reader / writer 200 by radio waves, and includes an antenna 10, a modulation / demodulation circuit 12, an input / output circuit 14, a control circuit 16, The input / output circuit 14, the control circuit 16, and the memory 18 are connected by a bus 20. In addition, IC card 100
Is provided with a power supply circuit (not shown) for supplying power to the above-described units.
【0017】上記構成のICカード100において、ア
ンテナ10、変復調回路12および入出力回路14は、
リーダライタ200からコマンドを含むデータを受け取
るための受信手段として機能するとともに、ICカード
100からリーダライタ200へデータを渡すための送
信手段として機能する。メモリ18は、EEPROMに
より構成された不揮発性の記憶手段であり、リーダライ
タ200から受け取ったデータ等を格納する。制御回路
16は、CPUと所定のプログラム等を格納するメモリ
とを用いて構成されており、CPUがプログラムを実行
することにより、入出力回路14およびメモリ18等の
動作を制御する。In the IC card 100 having the above configuration, the antenna 10, the modulation / demodulation circuit 12, and the input / output circuit 14
In addition to functioning as a receiving unit for receiving data including a command from the reader / writer 200, it functions as a transmitting unit for transferring data from the IC card 100 to the reader / writer 200. The memory 18 is a non-volatile storage unit composed of an EEPROM, and stores data and the like received from the reader / writer 200. The control circuit 16 is configured using a CPU and a memory for storing a predetermined program and the like, and controls operations of the input / output circuit 14 and the memory 18 and the like by the CPU executing the program.
【0018】上記ICカード100とデータの授受を行
うリーダライタ200は、常時、電波を発信しており、
ICカード100は、このリーダライタ200からの電
波を受信できる所定範囲内で動作することができる(こ
の所定範囲は「動作エリア」と呼ばれる)。The reader / writer 200 that exchanges data with the IC card 100 constantly transmits radio waves.
The IC card 100 can operate within a predetermined range in which radio waves from the reader / writer 200 can be received (this predetermined range is called an “operation area”).
【0019】ICカード100は、動作エリア内に入る
と、リーダライタ200からの電波をアンテナ10によ
り受信して電気信号に変換し、その電気信号を変復調回
路12および電源回路(図示せず)に供給する。電源回
路は、その電気信号を整流して各部に供給することによ
り電源供給を行う。なお、リーダライタ200は、IC
カード100にデータを送信しない場合は、無変調の電
波を発信しており、データを送信する場合は、そのデー
タを搬送波に変調させて含ませた電波を発信する。When the IC card 100 enters the operation area, the radio wave from the reader / writer 200 is received by the antenna 10 and converted into an electric signal, and the electric signal is transmitted to the modulation / demodulation circuit 12 and the power supply circuit (not shown). Supply. The power supply circuit supplies power by rectifying the electric signal and supplying it to each unit. The reader / writer 200 is an IC
When data is not transmitted to the card 100, an unmodulated radio wave is transmitted. When data is transmitted, a radio wave in which the data is modulated and included in a carrier is transmitted.
【0020】<1.2 動作の概略>リーダライタ20
0からICカード100にデータが送信された場合、変
復調回路12は、アンテナ10から供給される電気信号
を復調してデータを抽出し、これをシリアルデータとし
て入出力回路14へ入力する。入出力回路14は、変復
調回路12から入力されたシリアルデータをパラレルデ
ータに変換してバス20に出力する。制御回路16は、
リーダライタ200から受け取ったデータに含まれるコ
マンドに従って動作し、入出力回路14やメモリ18を
制御する。<1.2 Outline of Operation> Reader / Writer 20
When data is transmitted from 0 to the IC card 100, the modulation and demodulation circuit 12 extracts the data by demodulating the electric signal supplied from the antenna 10 and inputs the data to the input / output circuit 14 as serial data. The input / output circuit 14 converts serial data input from the modulation / demodulation circuit 12 into parallel data and outputs the parallel data to the bus 20. The control circuit 16
It operates according to commands included in the data received from the reader / writer 200, and controls the input / output circuit 14 and the memory 18.
【0021】このような動作により、ICカード100
は、リーダライタ200からデータを受け取ってメモリ
18に格納し、また、メモリ18に格納されているデー
タをリーダライタ200に送る。前述のようにメモリ1
8は、EEPROMにより構成されており、書き込みは
ページ単位で行われ、本実施の形態では、1ページは1
6バイトである。これに合わせて、リーダライタ200
からICカード100内のメモリ18に対するデータの
読み出しおよび書き込みは、ページ単位となっている。By such an operation, the IC card 100
Receives the data from the reader / writer 200 and stores it in the memory 18, and sends the data stored in the memory 18 to the reader / writer 200. Memory 1 as described above
Reference numeral 8 denotes an EEPROM, and writing is performed in page units. In the present embodiment, one page corresponds to one page.
6 bytes. In accordance with this, reader / writer 200
Reading and writing of data from and to the memory 18 in the IC card 100 are performed in page units.
【0022】すなわち、リーダライタ200からデータ
書き込みを要求するコマンド(以下「ライトコマンド」
という)を受け取った場合は、制御回路16が、そのラ
イトコマンドに従い、そのライトコマンドとともに送ら
れてくる1ページ分のデータ(16バイトデータ)をメ
モリ18に書き込む。このときのメモリ18への書き込
み位置を示すページアドレスは、そのライトコマンドで
指定される。That is, a command requesting data writing from the reader / writer 200 (hereinafter, a “write command”)
Is received, the control circuit 16 writes one page of data (16-byte data) sent together with the write command into the memory 18 in accordance with the write command. The page address indicating the writing position to the memory 18 at this time is specified by the write command.
【0023】一方、リーダライタ200からデータ読み
出しを要求するコマンド(以下「リードコマンド」とい
う)を受け取った場合は、制御回路16が、そのリード
コマンドに従い、メモリ18から所望の1ページ分のデ
ータを読み出す。このときのメモリ18からの読み出し
位置を示すページアドレスは、そのリードコマンドで指
定される。制御回路16は、読み出したデータをバス2
0を介して入出力回路14にパラレルデータとして転送
し、入出力回路14は、このパラレルデータをシリアル
データに変換する。変復調回路12は、そのシリアルデ
ータを搬送波に変調させて含ませた信号を生成し、アン
テナ10は、その信号を電波にして送信する。On the other hand, when a command requesting data reading (hereinafter referred to as a “read command”) is received from the reader / writer 200, the control circuit 16 transmits a desired page of data from the memory 18 in accordance with the read command. read out. The page address indicating the read position from the memory 18 at this time is specified by the read command. The control circuit 16 transmits the read data to the bus 2
The input / output circuit 14 transfers the parallel data to the input / output circuit 14 as serial data. The modulation and demodulation circuit 12 generates a signal in which the serial data is modulated and included in a carrier wave, and the antenna 10 transmits the signal as a radio wave.
【0024】<1.3 リングバッファの実現>上記の
ようなICカード100を各種の取引に利用し、取引等
の履歴情報をICカード100に記憶させるためには、
既述のように、リングバッファを実現する必要がある
(図15参照)。このために本実施の形態では、メモリ
18内において連続する複数ページから成る記憶領域を
バッファ領域として確保し、このバッファ領域を、リー
ダライタ200との間でページ単位で読み出しおよび書
き込みを行うデータを格納するための領域とする。バッ
ファ領域内の各ページは、図2に示すように、履歴情報
を格納するためのデータ領域a2と、データ領域a2へ
の履歴情報の書き込みを示すステータス情報を格納する
ステータス領域a1とから成る。そして、最新に書き込
みが行われたページ(最新書込ページ)の値であるペー
ジアドレスをリードポインタとし、最新書込ページの次
のページをライトポインタとして(ただし、最新書込ペ
ージがバッファ領域の最後のページであった場合、バッ
ファ領域の先頭のページアドレスをライトポインタとす
る)、バッファ領域に対する書き込みおよび読み出しを
行う。これにより、バッファ領域がリングバッファとし
て使用されることになる。<1.3 Realization of Ring Buffer> In order to use the above-described IC card 100 for various transactions and to store history information of transactions and the like in the IC card 100,
As described above, it is necessary to realize a ring buffer (see FIG. 15). For this reason, in the present embodiment, a storage area consisting of a plurality of continuous pages in the memory 18 is secured as a buffer area, and this buffer area is used to store data to be read and written with the reader / writer 200 in page units. It is an area for storing. As shown in FIG. 2, each page in the buffer area includes a data area a2 for storing history information, and a status area a1 for storing status information indicating writing of history information to the data area a2. Then, the page address which is the value of the page on which the latest writing was performed (the latest writing page) is used as a read pointer, and the page next to the latest writing page is used as a write pointer (where the latest writing page is the buffer area). If it is the last page, the first page address of the buffer area is used as a write pointer), and writing and reading to and from the buffer area are performed. As a result, the buffer area is used as a ring buffer.
【0025】具体的には、リーダライタ200が、リー
ドコマンドにおける読み出しページアドレスとしてリー
ドポインタを指定し、ライトコマンドにおける書き込み
ページアドレスとしてライトポインタを指定することに
より、バッファ領域がリングバッファとして使用され
る。しかし、このためには、リーダライタ200は、リ
ードコマンドまたはライトコマンドを発行する前に、バ
ッファ領域における最新書込ページを検出し、これに基
づきリードポインタとライトポインタを得る必要があ
る。そこで本実施の形態では、バッファ領域における各
ページへの書き込みを示すステータス情報を1度で読み
出すために、コラムリードコマンドが用意されている。
ここにいうコラムリードコマンドとは、そのコマンドで
指定される所定範囲の記憶領域における各ページの所定
位置のデータ(例えば1バイト目の値)を1回のコマン
ド発行でICカード100から読み出すことを要求する
コマンドである。すなわち、従来のリードコマンドは
「横方向」に16バイト(1ページ分)ずつしかデータ
を読み出すことができなかったが、コラムリードコマン
ドによれば、連続する複数ページにおける所定位置(例
えば各ページの1バイト目)のデータを「縦方向(コラ
ム方向)」に読み出せることになる。More specifically, when the reader / writer 200 designates a read pointer as a read page address in a read command and designates a write pointer as a write page address in a write command, the buffer area is used as a ring buffer. . However, for this purpose, it is necessary for the reader / writer 200 to detect the latest write page in the buffer area before issuing a read command or a write command, and obtain a read pointer and a write pointer based on this. Therefore, in the present embodiment, a column read command is prepared to read out status information indicating writing to each page in the buffer area at once.
The column read command mentioned here means that data (for example, the value of the first byte) at a predetermined position of each page in a storage area of a predetermined range specified by the command is read from the IC card 100 by issuing a single command. The command to request. That is, the conventional read command can read only 16 bytes (one page) of data in the "horizontal direction", but according to the column read command, a predetermined position in a plurality of continuous pages (for example, The data of the (first byte) can be read in the “vertical direction (column direction)”.
【0026】<1.4 コマンド実行処理>上記のよう
に、ライトコマンドおよびリードコマンドに加えてコラ
ムリードコマンドが用意された本実施形態のICカード
100の動作を、図3に示すフローチャートを参照しつ
つ説明する。なお本実施形態では、コラムリードコマン
ドではコラムリードの対象となるバッファ領域がページ
値によって指定されると共に、そのバッファ領域内の各
ページにおけるリード対象の位置(例えば各ページの1
バイト目)が指定されているものとする。また、ライト
コマンドでは書き込み対象のページの値(例えばライト
ポインタ)が、リードコマンドでは読み出し対象のペー
ジの値(例えばリードポインタ)が、それぞれ指定され
るものとする。<1.4 Command Execution Processing> As described above, the operation of the IC card 100 of the present embodiment in which a column read command is prepared in addition to a write command and a read command will be described with reference to a flowchart shown in FIG. I will explain it. In the present embodiment, in the column read command, the buffer area to be subjected to the column read is specified by the page value, and the position of the read target in each page in the buffer area (for example, 1 of each page)
Byte) is specified. It is also assumed that the value of the page to be written (for example, a write pointer) is specified in the write command, and the value of the page to be read (for example, the read pointer) is specified in the read command.
【0027】ICカード100が動作エリアに入ってリ
ーダライタ200からの電波を受信し、ICカード10
0の各部に対する電源供給が開始されると、まず、初期
設定が行われ(ステップS10)、これによりICカー
ド100は、リーダライタ200からのコマンドを受け
付けることができる状態となる。初期設定後は、リーダ
ライタ200からコマンドが送られてくるのを待機する
状態となり(ステップS12)、リーダライタ200か
らコマンドが発行され、それが電波として発信される
と、ICカード100は、これをアンテナ10で受信
し、変復調回路12および入出力回路14を介して制御
回路16へ転送する。制御回路16は、そのコマンドを
解釈し(ステップS14)、そのコマンドの種類に応じ
て、コラムリードコマンドの実行処理(ステップS1
6)、ライトコマンドの実行処理(S18)、リードコ
マンドの実行処理(ステップS20)のいずれかを行
う。When the IC card 100 enters the operation area and receives radio waves from the reader / writer 200, the IC card 10
When the power supply to each unit of “0” is started, first, an initial setting is performed (step S10), and thereby the IC card 100 is ready to receive a command from the reader / writer 200. After the initial setting, the system waits for a command to be sent from the reader / writer 200 (step S12). When the command is issued from the reader / writer 200 and transmitted as a radio wave, the IC card 100 Is received by the antenna 10 and transferred to the control circuit 16 via the modulation / demodulation circuit 12 and the input / output circuit 14. The control circuit 16 interprets the command (step S14), and executes a column read command execution process (step S1) according to the type of the command.
6), one of the write command execution processing (S18) and the read command execution processing (Step S20).
【0028】<1.4.1 コラムリードコマンド>図4
は、コラムリードコマンドの実行処理(図3のステップ
S16)の手順を示すフローチャートである。制御回路
16は、コラムリードコマンドを認識すると、まず、そ
のコラムリードコマンドで指定されたバッファ領域の先
頭ページの値を制御回路16に設けられた所定レジスタ
(以下「PAレジスタ」という)に設定し(ステップS
100)、このPAレジスタの値を用いて、バッファ領
域の先頭ページのうちコラムリードコマンドで指定され
るリード対象位置にアクセスするためのアドレス(以下
「コラムアドレス」という)を生成する(ステップS1
02)。例えばステータス領域a1が各ページの1バイ
ト目であって各ページのステータス情報を読み出したい
場合には、PAレジスタで示されるページの1バイト目
のアドレスをコラムアドレスとして生成する。コラムア
ドレスが生成されると、これを用いて、先頭ページのリ
ード対象位置のデータ(以下「コラムリードデータ」と
いう)をメモリ18から読み出し、読み出したコラムリ
ードデータを制御回路16内で一時的に蓄える(ステッ
プS104)。次に、PAレジスタの値がコラムリード
コマンドで指定されたバッファ領域の最後のページ値か
否か、すなわち、そのバッファ領域の最後のページのコ
ラムリードデータまで読み出したか否かを判定する(ス
テップS106)。PAレジスタの値が上記バッファ領
域の最後のページ値でない場合は、PAレジスタの値を
1だけインクリメントした後(ステップS108)、ス
テップS102へ戻る。<1.4.1 Column Read Command> FIG.
9 is a flowchart showing a procedure of a column read command execution process (step S16 in FIG. 3). When recognizing the column read command, the control circuit 16 first sets the value of the first page of the buffer area specified by the column read command in a predetermined register (hereinafter, referred to as a “PA register”) provided in the control circuit 16. (Step S
100), by using the value of the PA register, an address (hereinafter referred to as a “column address”) for accessing a read target position designated by a column read command in the first page of the buffer area is generated (step S1).
02). For example, when the status area a1 is the first byte of each page and it is desired to read the status information of each page, the address of the first byte of the page indicated by the PA register is generated as a column address. When the column address is generated, the data of the read target position of the first page (hereinafter referred to as “column read data”) is read from the memory 18 using the generated column address, and the read column read data is temporarily stored in the control circuit 16. It is stored (step S104). Next, it is determined whether the value of the PA register is the last page value of the buffer area specified by the column read command, that is, whether or not the column read data of the last page of the buffer area has been read (step S106). ). If the value of the PA register is not the last page value of the buffer area, the value of the PA register is incremented by 1 (step S108), and the process returns to step S102.
【0029】以降、同様にして、ステップS102→S
104→S106→S108を繰り返し実行することに
より、コラムリードコマンドで指定されたバッファ領域
の各ページのコラムリードデータを順次読み出して制御
回路16内に蓄えていく。この間に、ステップS106
でPAレジスタの値が前記バッファ領域の最後のページ
値であると判定されると、すなわち、最後のページのコ
ラムリードデータまで読み出したと判定されると、ステ
ップS110へ進む。この時点では、制御回路16内
に、前記バッファ領域の全てのページのコラムリードデ
ータ、すなわち前記バッファ領域をコラム方向に読み出
したデータが蓄えられており、ステップS22では、こ
れらのデータをコラムリードコマンドに対するレスポン
スとしてリーダライタ200に送出するために入出力回
路14へ転送し、これにより、コラムリードコマンドに
対する制御回路16の処理が終了する。コラムリードコ
マンドで例えばリングバッファとして使用するバッファ
領域全体を指定し、リード対象位置としてステータス領
域a1の位置(例えば1バイト目)を指定すると、上記
処理により、リングバッファを構成する各ページのステ
ータス情報が得られることになる。Thereafter, in the same manner, steps S102 → S
By repeatedly executing 104 → S106 → S108, the column read data of each page in the buffer area designated by the column read command is sequentially read and stored in the control circuit 16. During this time, step S106
If it is determined that the value of the PA register is the last page value of the buffer area, that is, if it is determined that the column read data of the last page has been read, the process proceeds to step S110. At this point, column read data of all pages in the buffer area, that is, data obtained by reading the buffer area in the column direction is stored in the control circuit 16. At step S22, these data are stored in a column read command. Is transferred to the input / output circuit 14 for transmission to the reader / writer 200 as a response to the command, thereby ending the processing of the control circuit 16 for the column read command. When the entire buffer area used as the ring buffer is specified by the column read command, and the position (for example, the first byte) of the status area a1 is specified as the read target position, the status information of each page constituting the ring buffer is obtained by the above processing. Is obtained.
【0030】入出力回路14に転送されたレスポンス
は、変復調回路12およびアンテナ10を介して電波と
してリーダライタ200に向けて送出される。The response transferred to the input / output circuit 14 is transmitted to the reader / writer 200 as a radio wave via the modulation / demodulation circuit 12 and the antenna 10.
【0031】<1.4.2 ライトコマンド>図5は、リ
ングバッファに履歴情報を書き込むためのライトコマン
ドの実行処理(図3のステップS18)の手順を示すフ
ローチャートである。この場合、ライトコマンドでは、
書込対象のページとしてリングバッファに対するライト
ポインタが指定され、履歴情報が書込データとしてライ
トコマンドと共にリーダライタ200から送られてく
る。制御回路16は、ライトコマンドを認識すると、ま
ず、そのライトコマンドで指定されたページ値であるラ
イトポインタを制御回路16に設けられたPAレジスタ
に設定し(ステップS120)、このPAレジスタの値
を用いて、メモリ18に書き込むためのアドレスを生成
する(ステップS122)。そしてこのアドレスを用い
て、ライトコマンドとともにリーダライタ200から送
られた履歴情報をメモリ18におけるリングバッファに
書き込む(ステップS124)。このとき書き込みによ
り、PAレジスタで指定されるページすなわちライトポ
インタの指すページにおけるステータス情報の更新も行
われる。その後、このライトコマンドに対するレスポン
スをリーダライタ200に向けて送信する(ステップS
126)。これにより、ライトコマンドの実行が終了す
る。<1.4.2 Write Command> FIG. 5 is a flowchart showing a procedure of a write command execution process (step S18 in FIG. 3) for writing history information in the ring buffer. In this case, the write command
A write pointer to the ring buffer is specified as a page to be written, and history information is sent from the reader / writer 200 as write data together with a write command. When recognizing the write command, the control circuit 16 first sets a write pointer, which is a page value specified by the write command, in a PA register provided in the control circuit 16 (step S120), and stores the value of the PA register in the PA register. Then, an address for writing to the memory 18 is generated (step S122). Using this address, the history information sent from the reader / writer 200 together with the write command is written to the ring buffer in the memory 18 (step S124). At this time, the status information in the page specified by the PA register, that is, the page indicated by the write pointer is also updated by the writing. After that, a response to the write command is transmitted to the reader / writer 200 (step S
126). Thus, the execution of the write command ends.
【0032】<1.4.3 リードコマンド>図6は、リ
ングバッファから履歴情報を読み出すためのリードコマ
ンドの実行処理(図3のステップS20)の手順を示す
フローチャートである。この場合、リードコマンドにお
いて読出対象のページとしてリングバッファに対するリ
ードポインタが指定される。制御回路16は、リードコ
マンドを認識すると、まず、そのリードコマンドで指定
されたページ値であるリードポインタを制御回路16に
設けられたPAレジスタに設定し(ステップS13
0)、このPAレジスタの値を用いて、メモリ18から
データを読み出すためのアドレスを生成する(ステップ
S132)。次に、このアドレスを用いて、メモリ18
におけるリングバッファから履歴情報を読み出す(ステ
ップS134)。そして、読み出した履歴情報をリーダ
ライタ200に向けて送信する(ステップS136)。
これにより、リードコマンドの実行が終了する。<1.4.3 Read Command> FIG. 6 is a flowchart showing the procedure of a read command execution process (step S20 in FIG. 3) for reading history information from the ring buffer. In this case, a read pointer to the ring buffer is specified as a page to be read in the read command. When recognizing the read command, the control circuit 16 first sets a read pointer, which is a page value specified by the read command, in a PA register provided in the control circuit 16 (step S13).
0), an address for reading data from the memory 18 is generated using the value of the PA register (step S132). Next, using this address, the memory 18
The history information is read from the ring buffer in (step S134). Then, the read history information is transmitted to the reader / writer 200 (step S136).
Thus, the execution of the read command ends.
【0033】<1.5 制御回路の他の構成>上述の動
作を行う本実施形態の制御回路16は、CPUと所定の
プログラム等を格納するメモリから構成されており、C
PUがプログラムを実行することにより、コラムリード
コマンドに対する上述の動作を含む、メモリ18および
入出力回路14に対する制御動作が実現される。しか
し、以上の説明からわかるように、制御回路16が実現
すべき機能は、リーダライタ200から発行されるコマ
ンドの解釈と、そのコマンドに従って、メモリ16への
アクセスのためのアドレスを生成したり、メモリ16お
よび入出力回路14に所望の動作をさせるための制御信
号を生成したりすることであり、これらの機能は、ハー
ドウェアによっても容易に実現できる。したがって、現
時点で入手可能なCPUチップのコストや消費電力等と
制御回路16に要求される機能や性能とを比較考量し、
CPUによる実現に代えて専用のハードウェアで制御回
路16を実現してもよい。<1.5 Other Configurations of Control Circuit> The control circuit 16 of the present embodiment for performing the above-described operation is constituted by a CPU and a memory for storing a predetermined program and the like.
When the PU executes the program, a control operation for the memory 18 and the input / output circuit 14 including the above-described operation for the column read command is realized. However, as can be seen from the above description, the functions to be realized by the control circuit 16 are to interpret a command issued from the reader / writer 200 and generate an address for accessing the memory 16 in accordance with the command, It is to generate a control signal for causing the memory 16 and the input / output circuit 14 to perform a desired operation, and these functions can be easily realized by hardware. Therefore, by comparing the cost and power consumption of the currently available CPU chip with the functions and performance required for the control circuit 16,
The control circuit 16 may be realized by dedicated hardware instead of the CPU.
【0034】<1.6 効果>以上において説明した本
実施の形態のICカード100によれば、リーダライタ
200は、コラムリードコマンドを発行することによ
り、バッファ領域の各ページのステータス情報を1度に
得ることができ、これから最新書込ページを検出するこ
とができる。そして、検出した最新書込ページからバッ
ファ領域に対するライトポインタおよびリードポインタ
を獲得し、これを用いてライトコマンドやリードコマン
ドを発行することにより、ICカード内のバッファ領域
をリングバッファとしてアクセスすることができる。し
たがって、最新書込ページを検出するためにバッファ領
域の全ページを読み出していた従来例や、最新書込ペー
ジを示すポインタをEEPROM(図1におけるメモリ
18に相当)に格納していた従来例に比べ、リングバッ
ファに対する履歴情報の読み出しや書き込みが高速化さ
れる。<1.6 Effects> According to the IC card 100 of the present embodiment described above, the reader / writer 200 issues the column read command, and thereby, once, obtains the status information of each page in the buffer area once. The latest written page can be detected from this. Then, a write pointer and a read pointer to the buffer area are obtained from the detected latest write page, and a write command or a read command is issued using the obtained pointer, so that the buffer area in the IC card can be accessed as a ring buffer. it can. Therefore, in the conventional example in which all pages in the buffer area are read in order to detect the latest write page, and in the conventional example in which a pointer indicating the latest write page is stored in an EEPROM (corresponding to the memory 18 in FIG. 1). In comparison, reading and writing of history information to and from the ring buffer is speeded up.
【0035】なお上記では非接触型のICカードを例に
とって説明したが、接触型のICカードにおいても、受
信手段や送信手段など、リーダライタ200とのインタ
フェースが異なるが、上記と同様にしてコラムリードコ
マンドを実現することが可能であり、同様の効果が得ら
れる。Although the non-contact type IC card has been described above as an example, the contact type IC card also has a different interface with the reader / writer 200 such as a receiving unit and a transmitting unit. A read command can be realized, and a similar effect can be obtained.
【0036】<1.7 変形例>上記実施の形態1のI
Cカード100は、読み出し/書き込み機能しか有して
いないが、制御回路16がCPUを用いて実現されてい
る場合には、CPUにより、バッファ領域内の最新書込
ページを検出し、リードポインタおよびライトポインタ
をICカード100内(制御回路16内)で保持するこ
とも可能である。この場合、リーダライタ200は、リ
ードポインタを指定せずにリードコマンドを発行し、ま
た、ライトコマンドを指定せずにライトコマンドを発行
することにより、ICカード100内のバッファ領域を
リングバッファとして使用することができる。また、こ
の場合、ICカード100は、動作エリア内に入って電
源供給が開始されてからリーダライタ200よりリード
コマンドまたはライトコマンドが発行されるまでに、最
新書込ページを検出してリードポインタおよびライトポ
インタを設定することが望ましい。非接触型ICカード
等のようにアナログ回路を含むICカードの場合には、
特に、このような構成が有効である。非接触型のICカ
ードでは、電源供給が開始されデジタル回路が動作可能
となってもアナログ回路の動作が安定するまで待機する
必要があり、この待機期間にデジタル回路によりリード
ポインタおよびライトポインタの設定を行えば、時間を
有効に利用でき、結果として、ICカードにおけるリン
グバッファに対する読み出しや書き込みが実質的に高速
化されることになるからである。<1.7 Modified Example> I of the First Embodiment
The C card 100 has only a read / write function, but when the control circuit 16 is realized by using a CPU, the CPU detects the latest write page in the buffer area, and reads the read pointer and the read pointer. The write pointer can be held in the IC card 100 (in the control circuit 16). In this case, the reader / writer 200 issues a read command without designating a read pointer and issues a write command without designating a write command, thereby using the buffer area in the IC card 100 as a ring buffer. can do. Further, in this case, the IC card 100 detects the latest write page and reads the read pointer and the read pointer from when the power supply is started and the read command or the write command is issued from the reader / writer 200 after entering the operation area. It is desirable to set a write pointer. In the case of an IC card including an analog circuit such as a non-contact type IC card,
In particular, such a configuration is effective. In the non-contact type IC card, it is necessary to wait until the operation of the analog circuit becomes stable even when the power supply is started and the digital circuit becomes operable. During this waiting period, the digital circuit sets the read pointer and the write pointer. Is performed, time can be used effectively, and as a result, reading and writing to and from the ring buffer in the IC card can be substantially speeded up.
【0037】実施の形態2. <2.1 全体の構成および動作>次に、本発明の実施
の形態2であるICカードについて説明する。このIC
カードの概略構成は実施の形態1と同様であって図1に
示す通りであり、本実施形態についても図1を参照しつ
つ説明する。Embodiment 2 <2.1 Overall Configuration and Operation> Next, an IC card according to a second embodiment of the present invention will be described. This IC
The schematic configuration of the card is the same as that of the first embodiment and is as shown in FIG. 1, and this embodiment will also be described with reference to FIG.
【0038】本実施の形態のICカード100では、図
7に示すように、メモリ18内のリングバッファとして
使用するバッファ領域を構成する各ページは、1ビット
のステータス情報(以下「ステータスビット」という)
を格納するためのステータス領域a1と、履歴情報を格
納するためのデータ領域a2から成る。そしてステータ
スビットの設定はICカード100内において制御回路
16により行われ、このバッファ領域をリングバッファ
として使用するためのリードポインタおよびライトポイ
ンタの設定も制御回路16により行われる。本実施の形
態の制御回路16の構成も実施の形態1と同様であっ
て、CPUと所定のプログラム等を格納するメモリから
構成されており、CPUがそのプログラムを実行するこ
とによりメモリ18や入出力回路14に対する制御動作
が実現される。In the IC card 100 of the present embodiment, as shown in FIG. 7, each page constituting a buffer area used as a ring buffer in the memory 18 has 1-bit status information (hereinafter referred to as "status bits"). )
And a data area a2 for storing history information. The setting of the status bit is performed by the control circuit 16 in the IC card 100, and the setting of the read pointer and the write pointer for using this buffer area as a ring buffer is also performed by the control circuit 16. The configuration of the control circuit 16 of the present embodiment is also the same as that of the first embodiment, and includes a CPU and a memory for storing a predetermined program, and the like. The control operation for the output circuit 14 is realized.
【0039】<2.2 要部の詳細動作>本実施の形態
ではバッファ領域における各ページのステータスビット
は「0」に予め初期化されており、リーダライタ200
からライトコマンドを受け取って履歴情報がバッファ領
域に書き込まれるときに、その履歴情報が書き込まれる
ページのステータスビットが反転される(これがステー
タス情報の更新に相当する)。すなわち、或るページの
データ領域a2に最初に履歴情報が書き込まれると、そ
のページのステータスビットは「1」に設定され、その
後、履歴情報の書き込みが続きリングバッファを一巡し
て再びそのページに履歴情報が書き込まれると、そのペ
ージのステータスビットは「0」に設定される。本実施
の形態では、ICカード内において制御回路16が、上
記のように設定される各ページのステータスビットを参
照して最新書込ページを検出し、検出した最新書込ペー
ジに基づきバッファ領域に対するリードポインタおよび
ライトポインタを制御回路16内に設定し保持する。前
述のように、本実施の形態のような非接触のICカード
の場合には、ICカードが動作エリアに入って電源の供
給が開始されてからリーダライタ200よりリードコマ
ンドまたはライトコマンドが発行されるまでに、リード
ポインタおよびライトポインタを設定することが望まし
い。そこで本実施形態では、ICカード100に電源の
供給が開始された後、制御回路16が図8のフローチャ
ートに示すように動作することにより、リードポインタ
およびライトポインタが設定される。<2.2 Detailed Operation of Main Part> In this embodiment, the status bit of each page in the buffer area is initialized to “0” in advance, and the reader / writer 200
When the history information is written to the buffer area upon receiving a write command from the CPU, the status bit of the page to which the history information is written is inverted (this corresponds to the update of the status information). That is, when the history information is first written into the data area a2 of a certain page, the status bit of the page is set to "1", and thereafter, the writing of the history information continues, the loop goes around the ring buffer, and the page is returned to the page again. When the history information is written, the status bit of the page is set to “0”. In the present embodiment, the control circuit 16 in the IC card detects the latest written page by referring to the status bits of each page set as described above, and based on the detected latest written page, The read pointer and the write pointer are set and held in the control circuit 16. As described above, in the case of a non-contact IC card as in the present embodiment, a read command or a write command is issued from the reader / writer 200 after the IC card enters the operation area and power supply is started. By the time, it is desirable to set the read pointer and the write pointer. Therefore, in the present embodiment, after the supply of power to the IC card 100 is started, the control circuit 16 operates as shown in the flowchart of FIG. 8 to set the read pointer and the write pointer.
【0040】すなわち、まずリングバッファとして使用
するバッファ領域の先頭ページであるページ1のステー
タスビットを読み出してこれをSTAaとする(ステッ
プS30)。次にページ番号を示す変数kを2とした後
(ステップS32)、ページkのステータスビットを読
み出してこれをSTAbとする。そして、連続する2つ
のページのステータスビットであるSTAaとSTAb
が等しいか否かを判定する(ステップS36)。STA
aとSTAbが等しければステップS38へ進み、ペー
ジkは、リングバッファとして使用するバッファ領域の
最後のページか否かを判定する。その結果、最後のペー
ジでなければ、kの値を1だけインクリメントし(ステ
ップS40)、STAaの値をSTAbの値で置き換え
た後(ステップS42)、ステップS34へ戻る。以
降、連続する2つのページのステータスビットであるS
TAaとSTAbが等しく、かつページkが前記バッフ
ァ領域の最後のページでない限り、ステップS34→S
36→S38→S40→S42というループが繰り返し
実行される。That is, first, the status bit of page 1, which is the first page of the buffer area used as the ring buffer, is read and set as STAa (step S30). Next, after setting the variable k indicating the page number to 2 (step S32), the status bit of the page k is read out and set as STAb. Then, STAa and STAb, which are the status bits of two consecutive pages,
It is determined whether or not are equal (step S36). STA
If a and STAb are equal, the process proceeds to step S38, and it is determined whether page k is the last page of the buffer area used as the ring buffer. As a result, if it is not the last page, the value of k is incremented by 1 (step S40), the value of STAa is replaced with the value of STAb (step S42), and the process returns to step S34. Thereafter, S, which is the status bit of two consecutive pages,
Unless TAa and STAb are equal and page k is not the last page of the buffer area, steps S34 → S
The loop of 36 → S38 → S40 → S42 is repeatedly executed.
【0041】このループの実行中に、STAaとSTA
bが異なればステップS44へ進む。この場合、ステー
タスビットSTAaを含むページk−1が最新書込ペー
ジであるので、リードポインタRptrをk−1に設定
し、ライトポインタWptrをkに設定する(図7(a)
参照)。During the execution of this loop, STAa and STA
If b is different, the process proceeds to step S44. In this case, since the page k-1 including the status bit STAa is the latest write page, the read pointer Rptr is set to k-1 and the write pointer Wptr is set to k (FIG. 7A).
reference).
【0042】上記ループの実行中に、ステップS38に
おいてページkが最後のページであると判定された場
合、すなわち、前記バッファ領域の全てのページのステ
ータスビットが同一の場合は、ステップS46へ進む。
この場合、リードポインタRptrをkに設定し、ライト
ポインタWptrを1に設定する(図7(b)参照)。If it is determined in step S38 that page k is the last page during the execution of the above loop, that is, if the status bits of all pages in the buffer area are the same, the process proceeds to step S46.
In this case, the read pointer Rptr is set to k, and the write pointer Wptr is set to 1 (see FIG. 7B).
【0043】<2.3 効果>以上のように本実施形態
によれば、各ページに設けられた1ビットのステータス
で最新書込ページが検出されるため、メモリ容量が少な
くて済む。また、ライトポインタとリードポインタの設
定処理を行う制御回路16は、CPUとそのCPUが実
行するプログラムを格納するためのメモリなどから構成
されているが、上記設定処理を専用のハードウェアによ
り実現することもできる。この場合、各ページに設けら
れた1ビットのステータスで最新書込ページが検出され
ることから、その専用ハードウェアの構成が簡単になる
という利点がある。<2.3 Effects> As described above, according to the present embodiment, the latest write page is detected by the 1-bit status provided for each page, so that the memory capacity can be reduced. The control circuit 16 for setting the write pointer and the read pointer includes a CPU and a memory for storing a program to be executed by the CPU. The setting process is realized by dedicated hardware. You can also. In this case, since the latest write page is detected based on the 1-bit status provided for each page, there is an advantage that the configuration of the dedicated hardware is simplified.
【0044】<2.4 その他>なお本実施形態におけ
るライトコマンドおよびリードコマンドの実行処理は、
実施形態1の場合と基本的に同様である(図5および図
6参照)。ただし本実施形態では、リングバッファに対
し履歴情報の書き込みまたは読み出しを行う場合には、
その書き込みまたは読み出しの対象となるページは、ラ
イトコマンドまたはリードコマンドによっては指定され
ず、ICカード100の制御回路16内に格納されてい
るライトポインタまたはリードポインタによって指定さ
れる。したがって、この場合、メモリ18にアクセスす
るためのアドレスの生成にはPAレジスタは使用され
ず、ライトポインタまたはリードポインタが使用される<2.4 Others> The write command and the read command in the present embodiment are executed in the following manner.
This is basically the same as the case of the first embodiment (see FIGS. 5 and 6). However, in this embodiment, when writing or reading history information to or from the ring buffer,
The page to be written or read is not specified by a write command or a read command, but is specified by a write pointer or a read pointer stored in the control circuit 16 of the IC card 100. Therefore, in this case, the PA register is not used for generating an address for accessing the memory 18, and the write pointer or the read pointer is used.
【0045】実施の形態3. <3.1 全体の構成および動作>次に、本発明の実施
の形態3であるICカードについて説明する。このIC
カードは、メモリ18内のリングバッファとして使用す
るバッファ領域の各ページのステータスビットは3ビッ
トから成り、ライトポインタ及びリードポインタの設定
のために最新書込ページを検出する際に多数決処理を行
う点が上記実施の形態2と相違し、他の点については、
上記実施の形態2と同様である。そこで、以下では、本
実施形態におけるライトポインタおよびリードポインタ
の設定のための制御回路16の動作についてのみ、図1
1のフローチャートを参照しつつ説明する。Embodiment 3 <3.1 Overall Configuration and Operation> Next, an IC card according to a third embodiment of the present invention will be described. This IC
In the card, the status bit of each page of the buffer area used as a ring buffer in the memory 18 is composed of three bits, and a majority decision process is performed when the latest written page is detected for setting the write pointer and the read pointer. Is different from the second embodiment.
This is the same as in the second embodiment. Therefore, hereinafter, only the operation of the control circuit 16 for setting the write pointer and the read pointer in the present embodiment will be described with reference to FIG.
This will be described with reference to the flowchart of FIG.
【0046】<3.2 要部の詳細動作>図11のフロ
ーチャートは、実施の形態2における図8のフローチャ
ートに対応するものである。両フローチャートを比較す
ればわかるように、連続する2つのページのステータス
ビットを示すSTAaとSTAbを設定する際に、本実
施形態では、多数決処理後の値(3ビット値)を設定し
(ステップS50、S54)、その多数決処理後の3ビ
ットのステータスビットSTAaとSTAbを比較する
ことにより最新書込ページを検出している(ステップS
36)。<3.2 Detailed Operation of Principal Part> The flowchart of FIG. 11 corresponds to the flowchart of FIG. 8 in the second embodiment. As can be seen by comparing the two flowcharts, when setting STAa and STAb indicating the status bits of two consecutive pages, in the present embodiment, the value after the majority processing (3-bit value) is set (step S50). , S54), the latest written page is detected by comparing the three-bit status bits STAa and STAb after the majority processing (step S).
36).
【0047】本実施形態におけるリングバッファとして
使用するバッファ領域の各ページのステータスビットは
「000」か「111」のいずれかの値であり、ページ
に書込を行う毎にそのページのステータスビットの値は
この2つの間で交互に切り替わる。ところが、メモリ1
8への書込エラー等によりこれらの2種類以外の値がス
テータスビットとして書き込まれる場合があり、例えば
図9(a)に示すようになる場合がある。本実施の形態
によれば、このような場合であっても、多数決処理後の
ステータスビットを用いて最新書込ページが検出され
る。すなわち「101」は「111」として、「00
1」は「000」として最新書込ページが検出され、そ
の結果に応じてライトポインタWptrおよびリードポイ
ンタRptrが設定される(図9(b)参照)。したがっ
て、或る程度のメモリ書込エラー等が発生してもライト
ポインタWptrおよびリードポインタRptrが正しく設定
され、リングバッファに対する書き込みや読み出しの動
作の信頼性が向上する。The status bit of each page of the buffer area used as the ring buffer in this embodiment is either "000" or "111", and each time a page is written, the status bit of the page is changed. The value alternates between the two. However, memory 1
In some cases, values other than these two types are written as status bits due to a write error to 8 or the like, for example, as shown in FIG. 9A. According to the present embodiment, even in such a case, the most recently written page is detected using the status bits after the majority processing. That is, “101” becomes “111” and “00”
"1" is detected as "000", the latest write page is detected, and a write pointer Wptr and a read pointer Rptr are set in accordance with the result (see FIG. 9B). Therefore, even if a certain degree of memory write error or the like occurs, the write pointer Wptr and the read pointer Rptr are set correctly, and the reliability of the writing and reading operations for the ring buffer is improved.
【0048】実施の形態4. <4.1 全体の構成および動作>次に、本発明の実施
の形態4であるICカードについて説明する。このIC
カードは、メモリ18内のリングバッファとして使用す
るバッファ領域の各ページにおけるステータス領域a1
が1バイトで構成され、図10に示すように、そのうち
3ビットの領域には上記実施の形態3と同様にステータ
スビットが格納されるが、残りの5ビットの領域には書
込確認データが格納される。すなわち、リングバッファ
への書き込みを行う毎に、その書き込み対象のページに
予め決められた5ビットデータ(例えば「10101」
という固定ビットパターン)を書込確認データとして書
き込んでおき、その後、リングバッファにおける最新書
込ページの検出に基づくライトポインタやリードポイン
タの設定の際や、リングバッファからのデータの読み出
しの際などに、リングバッファの各ページや読出対象ペ
ージの書込確認データを読み出し、読み出した書込確認
データに基づきそのページに書き込まれているデータ
(履歴情報)が正しいか否かを判断する。Embodiment 4 <4.1 Overall Configuration and Operation> Next, an IC card according to a fourth embodiment of the present invention will be described. This IC
The card has a status area a1 in each page of a buffer area used as a ring buffer in the memory 18.
Is composed of 1 byte. As shown in FIG. 10, the status bits are stored in the 3-bit area as in the third embodiment, but the write confirmation data is stored in the remaining 5-bit area. Is stored. That is, every time data is written to the ring buffer, predetermined 5-bit data (for example, “10101”) is stored in the page to be written.
Fixed bit pattern) is written as write confirmation data, and then, when setting the write pointer or read pointer based on the detection of the latest write page in the ring buffer, or when reading data from the ring buffer, etc. Then, the write confirmation data of each page of the ring buffer and the page to be read is read, and it is determined whether the data (history information) written to the page is correct based on the read write confirmation data.
【0049】本実施形態のICカードのハードウェア構
成や各コマンドの実行処理などは、基本的には上記実施
の形態3と同様である(図1、図9、図11参照)。し
かし、本実施形態では、書込確認データの導入による上
記特徴から、リングバッファのライトポインタおよびリ
ードポインタの設定のための制御回路16の動作などが
若干相違する。以下、この相違点を中心に本実施形態の
ICカードの動作を説明する。The hardware configuration of the IC card of this embodiment and the execution processing of each command are basically the same as those of the third embodiment (see FIGS. 1, 9 and 11). However, in the present embodiment, the operation of the control circuit 16 for setting the write pointer and the read pointer of the ring buffer and the like are slightly different due to the above-described characteristics due to the introduction of the write confirmation data. Hereinafter, the operation of the IC card of the present embodiment will be described focusing on this difference.
【0050】<4.2 要部の詳細動作> <4.2.1 ポインタの設定>本実施形態におけるリン
グバッファのライトポインタおよびリードポインタの設
定のための処理では、上記実施の形態3と同様、3ビッ
トのステータスビットを用いて多数決処理を利用しつつ
最新書込ページを検出する(図11のステップS50〜
S62参照)。しかし、検出された最新書込ページに基
づいてリードポインタRptrおよびライトポインタWptr
を設定するための処理内容が相違する。すなわち、図1
1におけるステップS64の代わりに図12(a)に示
す処理(以下「ポインタ設定処理A」という)が行わ
れ、図11おけるステップS66の代わりに図12
(b)に示す処理(以下「ポインタ設定処理B」とい
う)が行われる。<4.2 Detailed Operation of Main Part><4.2.1 Setting of Pointer> The processing for setting the write pointer and the read pointer of the ring buffer in this embodiment is the same as that of the third embodiment. The latest written page is detected using the majority decision processing using the three status bits (steps S50 to S50 in FIG. 11).
See S62). However, the read pointer Rptr and the write pointer Wptr are determined based on the detected latest write page.
Are different in the contents of the processing for setting. That is, FIG.
12 is performed instead of step S64 in FIG. 1 (hereinafter, referred to as “pointer setting process A”), and FIG. 12 is replaced with step S66 in FIG.
The processing shown in (b) (hereinafter referred to as “pointer setting processing B”) is performed.
【0051】図12(a)のポインタ設定処理Aは、リ
ングバッファにおいて連続する2つのページであるペー
ジk−1とkとでステータスビットの値(多数決処理後
の値)が相違する場合の処理である。この場合、ページ
k−1におけるステータス領域a1から書込確認データ
を読み出し(ステップS150)、読み出した書込確認
データが予め決められた値に等しいか否かを判定する
(ステップS152)。その結果、予め決められた値に
等しければ、そのページk−1には正しくデータが書き
込まれているとし、ページk−1が最新書込ページであ
るとして、リードポインタRptrをk−1に設定し、ラ
イトポインタWptrをkに設定する(ステップS16
0)。The pointer setting process A in FIG. 12A is a process performed when the status bit values (values after majority processing) are different between pages k-1 and k, which are two consecutive pages in the ring buffer. It is. In this case, the write confirmation data is read from the status area a1 in the page k-1 (step S150), and it is determined whether the read write confirmation data is equal to a predetermined value (step S152). As a result, if the value is equal to a predetermined value, it is determined that the data has been correctly written to the page k-1, the page k-1 is determined to be the latest write page, and the read pointer Rptr is set to k-1. Then, the write pointer Wptr is set to k (step S16).
0).
【0052】ステップS152において、ページk−1
から読み出した書込確認データが予め決められた値に等
しくないと判定された場合は、そのページk−1にデー
タが正しく書き込まれていないものと判断する。この場
合、ページk−1の一つ前のページが最新書込ページで
あるとしてポインタの設定を行う。すなわち、この場
合、ステップS154へ進んでページ番号kが2か否か
を判定し(ステップS154)、kが2でなければ、ペ
ージk−2が最新書込ページであるとして、リードポイ
ンタRptrをk−2に設定し、ライトポインタWptrをk
−1に設定する(ステップS162)。kが2であれ
ば、バッファ領域の最終ページNを最新書込ページであ
るとして、リードポインタRptrを最終ページNに設定
し、ライトポインタWptrを1に設定する(ステップS
156)。In step S152, page k-1
When it is determined that the write confirmation data read from the page is not equal to the predetermined value, it is determined that the data is not correctly written in the page k-1. In this case, the pointer is set assuming that the page immediately before the page k-1 is the latest write page. That is, in this case, the process proceeds to step S154 to determine whether the page number k is 2 (step S154). If k is not 2, it is determined that page k-2 is the latest write page and the read pointer Rptr is set. set to k-2 and set the write pointer Wptr to k
It is set to -1 (step S162). If k is 2, the last page N of the buffer area is determined to be the latest write page, the read pointer Rptr is set to the last page N, and the write pointer Wptr is set to 1 (step S).
156).
【0053】図12(b)のポインタ設定処理Bは、リ
ングバッファにおける各ページのステータスビットの値
(多数決処理後の値)が全て同一である場合の処理であ
る。この場合、ページkすなわち最終ページNにおける
ステータス領域a1から書込確認データを読み出し(ス
テップS170)、読み出した書込確認データが予め決
められた値に等しいか否かを判定する(ステップS17
2)。その結果、予め決められた値に等しければ、その
ページkには正しくデータが書き込まれているとする。
この場合、リングバッファの全てのページのステータス
ビットが同一の値であって、そのページkが最新書込ペ
ージであるとして、リードポインタRptrをk(最終ペ
ージN)に設定し、ライトポインタWptrを1に設定す
る(ステップS176)。The pointer setting process B shown in FIG. 12B is a process in the case where the status bit values (values after the majority decision process) of each page in the ring buffer are all the same. In this case, the write confirmation data is read from the status area a1 in the page k, that is, the last page N (step S170), and it is determined whether the read write confirmation data is equal to a predetermined value (step S17).
2). As a result, if the value is equal to the predetermined value, it is determined that the data is correctly written in the page k.
In this case, assuming that the status bits of all pages in the ring buffer are the same value and that page k is the latest write page, the read pointer Rptr is set to k (the last page N), and the write pointer Wptr is set to It is set to 1 (step S176).
【0054】ステップS172において、ページkから
読み出した書込確認データが予め決められた値に等しく
ないと判定された場合は、そのページk(最終ページ
N)にデータが正しく書き込まれていないと判断する。
この場合は、ページkの一つ前のページk−1が最新書
込ページであるとして、リードポインタRptrをk−1
に設定し、ライトポインタWptrをkに設定する(ステ
ップS174)。If it is determined in step S172 that the write confirmation data read from page k is not equal to the predetermined value, it is determined that the data is not correctly written on page k (the last page N). I do.
In this case, assuming that the page k-1 immediately before the page k is the latest write page, the read pointer Rptr is set to k-1.
Is set, and the write pointer Wptr is set to k (step S174).
【0055】<4.2.2 ライトコマンド実行処理>図
13は、本実施形態において、リングバッファに履歴情
報を書き込むためのライトコマンドの実行処理(図3の
ステップS18)の手順を示すフローチャートである。
この場合、上記のポインタ設定処理(図12等)により
得られるリードポインタRptrおよびライトポインタWp
trを予め制御回路16が保持しており、ライトコマンド
では書込対象のページは指定されず、履歴情報が書込デ
ータとしてライトコマンドと共にリーダライタ200か
ら送られてくる。制御回路16は、ライトコマンドを認
識すると、制御回路16内に保持されたリードポインタ
RptrおよびライトポインタWptrを用いて、メモリ18
に対する読み出しおよび書き込みを行うためのアドレス
を生成する(ステップS220)。次に、生成されたア
ドレスを用いて、リードポインタRptrの指すページの
ステータスビットを読み出した後(ステップS22
2)、ライトコマンドとともにリーダライタ200から
送られた履歴情報をメモリ18におけるリングバッファ
に書き込む(ステップS224)。このとき、EEPR
OMであるメモリ18に対して、その履歴情報を含む1
ページ分のデータが書き込まれ、そのページのステータ
ス領域a1には、ステータスビットとしてステップS2
22で読み出したステータスビットの値が書き込まれ
る。ただし、全ページのステータスビットが同じ場合
(図7(b)に示すようにリードポインタRptrがバッ
ファ領域の最後のページを指している場合)には、ステ
ップS222で読み出したステータスビットの反転値が
書き込まれる。このような書き込みにより、ライトポイ
ンタWptrが指すページのステータスビットの値が反転
することになる。また、ライトポインタWptrの指すペ
ージのステータス領域a1には、書込確認データとして
予め決められたデータ(例えば「10101」という固
定ビットパターン)が書き込まれる。以上により、ライ
トポインタWptrが指すページのステータスビットが更
新されたことになるとともに、後で、このページの今回
の書き込みが正しくなされたか否かのチェックが可能と
なる。ライトポインタWptrの指すページへの書き込み
が終了すると、このライトコマンドに対するレスポンス
をリーダライタ200に向けて送信し(ステップS22
6)。これにより、ライトコマンドの実行が終了する。<4.2.2 Write Command Execution Process> FIG. 13 is a flowchart showing the procedure of a write command execution process (step S18 in FIG. 3) for writing history information to the ring buffer in the present embodiment. is there.
In this case, the read pointer Rptr and the write pointer Wp obtained by the above-described pointer setting process (FIG. 12, etc.)
The control circuit 16 holds tr in advance, and the page to be written is not specified by the write command, and the history information is sent from the reader / writer 200 together with the write command as write data. When recognizing the write command, the control circuit 16 uses the read pointer Rptr and the write pointer Wptr held in the control circuit 16 to store the data in the memory 18.
Then, an address for performing reading and writing for is generated (step S220). Next, after reading the status bit of the page indicated by the read pointer Rptr using the generated address (step S22).
2) Write the history information sent from the reader / writer 200 together with the write command to the ring buffer in the memory 18 (step S224). At this time, EEPR
For the memory 18 which is an OM, 1
The data for the page is written, and the status area a1 of the page is set as a status bit in step S2.
The value of the status bit read at 22 is written. However, when the status bits of all pages are the same (when the read pointer Rptr points to the last page of the buffer area as shown in FIG. 7B), the inverted value of the status bits read in step S222 is Written. By such writing, the value of the status bit of the page indicated by the write pointer Wptr is inverted. Further, predetermined data (for example, a fixed bit pattern “10101”) is written as write confirmation data in the status area a1 of the page pointed to by the write pointer Wptr. As described above, the status bit of the page indicated by the write pointer Wptr is updated, and it is possible to check later whether or not the current writing of this page has been correctly performed. When writing to the page indicated by the write pointer Wptr is completed, a response to the write command is transmitted to the reader / writer 200 (step S22).
6). Thus, the execution of the write command ends.
【0056】<4.2.3 リードコマンド実行処理>図
14は、リングバッファから履歴情報を読み出すための
リードコマンドの実行処理(図3のステップS20)の
手順を示すフローチャートである。この場合、上記のポ
インタ設定処理(図12等)により得られるリードポイ
ンタRptrを予め制御回路16が保持しており、リード
コマンドでは読出対象のページは指定されない。制御回
路16は、リードコマンドを認識すると、制御回路16
内に保持されたリードポインタRptrを用いて、メモリ
18からデータを読み出すためのアドレスを生成する
(ステップS230)。次に、このアドレスを用いて、
メモリ18におけるリングバッファから履歴情報を読み
出す(ステップS232)。そして、読み出した履歴情
報をリーダライタ200に向けて送信する(ステップS
234)。これにより、リードコマンドの実行が終了す
る。<4.2.3 Read Command Execution Processing> FIG. 14 is a flowchart showing the procedure of a read command execution processing (step S20 in FIG. 3) for reading history information from the ring buffer. In this case, the control circuit 16 previously holds the read pointer Rptr obtained by the above-described pointer setting process (FIG. 12, etc.), and the read command does not specify the page to be read. When the control circuit 16 recognizes the read command, the control circuit 16
An address for reading data from the memory 18 is generated using the read pointer Rptr stored in the memory (step S230). Next, using this address,
The history information is read from the ring buffer in the memory 18 (Step S232). Then, the read history information is transmitted to the reader / writer 200 (step S
234). Thus, the execution of the read command ends.
【0057】<4.3 効果>本実施形態によれば、I
Cカード100のリングバッファへ履歴情報を書き込む
毎に書込確認データも書き込まれる(図13のステップ
S224参照)。その後にリングバッファに対する読み
出しまたは書き込みを行うためにICカードが動作エリ
アに入ってライトポインタWptrおよびリードポインタ
Rptrを設定する際に、最新書込ページとして検出され
たページの書込確認データがチェックされる。このチェ
ックにより、そのページへの書き込みが正しく行われて
いたか否かが調べられ(図12のステップS152、S
172参照)、正しく書き込みが行われていなかった場
合には、そのページの一つ前のページが最新書込ページ
であるとして、リングバッファのライトポインタWptr
およびリードポインタRptrが設定される(図12のス
テップS156、S162、S174、S176)。し
たがって、例えば、データの書込途中のICカードが動
作エリアから外れた場合、そのデータの書込が正しく行
われないことになるが、上記の書込確認データを利用し
たポインタ設定処理(図12)において、このようなI
Cカードへの書込不良のページが認識され、その書込不
良のデータを除去した形でリングバッファのライトポイ
ンタWptrおよびリードポインタRptrが設定される。そ
の結果、その後のリングバッファへのアクセスは正しく
行われることになる。<4.3 Effect> According to the present embodiment, I
Each time the history information is written to the ring buffer of the C card 100, the write confirmation data is also written (see step S224 in FIG. 13). Thereafter, when the IC card enters the operation area and sets the write pointer Wptr and the read pointer Rptr for reading or writing to the ring buffer, the write confirmation data of the page detected as the latest write page is checked. You. By this check, it is checked whether or not writing to the page has been performed correctly (steps S152 and S152 in FIG. 12).
172), if the writing has not been correctly performed, the page immediately before that page is determined to be the latest written page, and the write pointer Wptr of the ring buffer is determined.
And the read pointer Rptr are set (steps S156, S162, S174, S176 in FIG. 12). Therefore, for example, if the IC card in the middle of writing data comes out of the operation area, the writing of the data will not be performed correctly. However, the pointer setting process using the write confirmation data (FIG. 12) )), Such an I
The page of the write failure to the C card is recognized, and the write pointer Wptr and read pointer Rptr of the ring buffer are set in a form in which the data of the write failure is removed. As a result, subsequent access to the ring buffer is performed correctly.
【0058】なお、上記実施例では、リードコマンドの
実行処理(図14)の前に必ずリングバッファのポイン
タ設定処理(図12)が実行される場合を想定している
ため、リングバッファからの読み出しにおいて書込確認
データのチェックを行う必要はない。しかし、上記以外
の場合を考慮して、リードコマンドの実行処理において
も、書込確認データのチェックにより、読出対象のペー
ジの履歴情報などが正しく書き込まれていたか否かを判
定するようにしてもよい。In the above embodiment, it is assumed that the ring buffer pointer setting process (FIG. 12) is always executed before the read command execution process (FIG. 14). Need not check the write confirmation data. However, in consideration of cases other than the above, even in the execution process of the read command, it may be determined whether or not the history information of the page to be read has been correctly written by checking the write confirmation data. Good.
【0059】<4.4 変形例>上記実施の形態4で
は、予め決められた固定のビットパターンを書込確認デ
ータとして使用するものとし、書込確認データはそれが
格納されるページのステータス情報以外のデータとは無
関係であるが、そのページのステータス情報以外の他の
データ(履歴情報など)と関連づけたもの、例えば誤り
検出コード等を書込確認データとしてもよい。<4.4 Modification> In the fourth embodiment, it is assumed that a predetermined fixed bit pattern is used as write confirmation data, and the write confirmation data is status information of a page in which it is stored. Although it is irrelevant to other data, the data associated with other data (such as history information) other than the status information of the page, for example, an error detection code or the like may be used as the write confirmation data.
【0060】また上記実施の形態4では、各ページにお
ける1バイトのステータス領域a1のうち3ビットのス
テータスビットを除いた5ビットを書込確認データのた
めの領域としているが(図10参照)、ステータス領域
a1を1バイトまたはそれ以上拡張し(メモリ18への
アクセスの都合上、拡張バイト数は整数バイトとするの
が好ましい)、拡張した領域をも書込確認データの格納
領域としてもよい。このようにして書込確認データのビ
ット数を増やすと、前述の書込不良をより正確に検出
し、その検出結果に基づいて書込不良に対する対処が可
能であるため、ICカードにおけるリングバッファに対
する書き込みや読み出しの動作の信頼性を更に向上させ
ることができる。In the fourth embodiment, five bits excluding the three status bits in the one-byte status area a1 in each page are used as areas for write confirmation data (see FIG. 10). The status area a1 may be extended by one or more bytes (the number of extended bytes is preferably an integer for convenience of access to the memory 18), and the extended area may be used as a storage area for the write confirmation data. When the number of bits of the write confirmation data is increased in this manner, the above-described write failure can be more accurately detected, and the write failure can be dealt with based on the detection result. The reliability of the writing and reading operations can be further improved.
【0061】[0061]
【発明の効果】本発明に係る第1のICカードによれ
ば、リングバッファとして使用される記憶領域を構成す
る各ページにはそのページへのデータ領域への書込を示
すステータス情報が格納され、外部のデータ読出/書込
装置から所定のコマンドが発行されると、上記記憶領域
の各ページのステータス情報が読み出され、データ読出
/書込装置に送られる。したがって、データ読出/書込
装置は、所定のコマンドを1回発行するだけで、ICカ
ードにおいて実現されているリングバッファの全ページ
のステータス情報を得て、これに基づき最新書込ページ
を検出し、この最新書込ページからリングバッファに対
するライトポインタ及びリードポインタを獲得すること
ができる。よって、最新書込ページを検出するためにバ
ッファ領域の全ページを読み出していた従来例や、最新
書込ページを示すポインタをEEPROM(不揮発性メ
モリ)に格納していた従来例に比べ、リングバッファに
対する読み出しや書き込みが高速化される。なお、最新
書込ページを示すポインタをEEPROMに格納してい
た従来例では、ポインタ領域の書き換えの回数が多いこ
とによるEEPROMの劣化が問題となるが、本ICカ
ードによればそのような問題も解消される。According to the first IC card of the present invention, each page constituting a storage area used as a ring buffer stores status information indicating writing to a data area on the page. When a predetermined command is issued from an external data read / write device, status information of each page in the storage area is read and sent to the data read / write device. Therefore, the data read / write device obtains status information of all pages of the ring buffer realized in the IC card by issuing a predetermined command only once, and detects the latest write page based on the status information. The write pointer and the read pointer for the ring buffer can be obtained from the latest write page. Therefore, in comparison with the conventional example in which all pages in the buffer area are read in order to detect the latest write page and the conventional example in which a pointer indicating the latest write page is stored in an EEPROM (nonvolatile memory), The reading and writing of the data are speeded up. In the conventional example in which the pointer indicating the latest write page is stored in the EEPROM, the problem of deterioration of the EEPROM due to a large number of rewrites of the pointer area is a problem. Will be resolved.
【0062】本発明に係る第2のICカードによれば、
リングバッファとして使用される記憶領域を構成する各
ページのステータス領域に格納されるステータス情報は
予め同一の値に初期化されており、リングバッファに対
して書き込みが行われると、その書き込み対象のページ
のステータス情報を構成するビットの値が反転される。
そして、このような各ページのステータス情報を順次読
み出し、連続する2つのページのステータス情報を比較
することにより、リングバッファにおける最新書込ペー
ジが検出され、その最新書込ページに基づいてリングバ
ッファに対する読み出しや書き込みが行われる。したが
って、本ICカードによれば、ICカード内においてリ
ングバッファに対するライトポインタおよびリードポイ
ンタを短時間で獲得することができ、上記第1のICカ
ードと同様、最新書込ページを検出するためにバッファ
領域の全ページを読み出していた従来例や、最新書込ペ
ージを示すポインタをEEPROMに格納していた従来
例に比べ、リングバッファに対する読み出しや書き込み
が高速化される。According to the second IC card of the present invention,
The status information stored in the status area of each page constituting the storage area used as the ring buffer is initialized to the same value in advance, and when writing is performed on the ring buffer, the page to be written is Are inverted.
Then, the status information of each such page is sequentially read, and the status information of two consecutive pages is compared to detect the latest write page in the ring buffer. Reading and writing are performed. Therefore, according to the present IC card, the write pointer and the read pointer for the ring buffer can be acquired in the IC card in a short time, and the buffer for detecting the latest write page can be obtained similarly to the first IC card. Compared to the conventional example in which all pages in the area are read, or the conventional example in which a pointer indicating the latest write page is stored in the EEPROM, reading and writing to the ring buffer are speeded up.
【0063】本発明に係る第3のICカードによれば、
上記第2のICカードと同様の動作が行われるが、リン
グバッファの各ページのステータス情報が1ビットで構
成されるため、ICカード内のメモリが効率よく利用さ
れ、メモリ容量の低減に寄与する。また、そのステータ
ス情報からリングバッファにおける最新書込ページを検
出するためのハードウェア量も低減される。According to the third IC card of the present invention,
The same operation as that of the second IC card is performed, but since the status information of each page of the ring buffer is composed of one bit, the memory in the IC card is efficiently used, and the memory capacity is reduced. . Further, the amount of hardware for detecting the latest written page in the ring buffer from the status information is reduced.
【0064】本発明に係る第4のICカードによれば、
上記第2のICカードの構成において、ステータス情報
が奇数個のビットから成り、その奇数個のビットが全て
同一値となるように初期化され、通常、リングバッファ
への書き込みに伴うステータス情報の更新後においても
そのステータス情報を構成するビットは全て同一値とな
るが、リングバッファの最新書込ページを検出する際に
は、各ページから読み出されたステータス情報に対する
多数決演算後の値が使用される。したがって、メモリへ
の書き込みエラー等により各ステータス情報を構成する
ビットが全て同一でなくても、各ステータス情報のビッ
ト数の過半数が同一の値であれば、最新書込ページが正
しく検出される。これにより、リングバッファに対する
読み出しおよび書き込みの信頼性が向上する。According to the fourth IC card of the present invention,
In the configuration of the second IC card, the status information is composed of an odd number of bits, the odd number of bits are initialized so as to have the same value, and usually, the status information is updated along with writing to the ring buffer. All bits constituting the status information will have the same value later, but when detecting the latest write page of the ring buffer, the value after majority operation on the status information read from each page is used. You. Therefore, even if all bits constituting each status information are not the same due to a write error to the memory or the like, if the majority of the number of bits of each status information is the same value, the latest written page is correctly detected. As a result, the reliability of reading from and writing to the ring buffer is improved.
【0065】本発明に係る第5のICカードによれば、
そのICカードに電源供給が開始された後、データ読出
/書込装置からコマンドを受け取る前に、リングバッフ
ァに対する読み出し位置を示すページ値(リードポイン
タ)および書き込み位置を示すページ値(ライトポイン
タ)が得られる。したがって、非接触ICカードのよう
にアナログ回路を有するICカードの場合には、電源供
給開始後そのアナログ回路の動作が安定するまでの間の
待機時間を利用して、デジタル回路によりリードポイン
タおよびライトポインタが設定されることになる。これ
により時間が有効利用され、結果として、ICカードの
リングバッファに対する読み出しや書き込みが実質的に
高速化されることになる。According to the fifth IC card of the present invention,
After the power supply to the IC card is started and before a command is received from the data reading / writing device, a page value (read pointer) indicating a reading position with respect to the ring buffer and a page value (write pointer) indicating a writing position are set. can get. Therefore, in the case of an IC card having an analog circuit such as a non-contact IC card, the read pointer and the write operation are performed by the digital circuit by utilizing the standby time from the start of power supply until the operation of the analog circuit is stabilized. The pointer will be set. As a result, time is effectively used, and as a result, reading and writing to and from the ring buffer of the IC card is substantially speeded up.
【0066】本発明に係る第6のICカードによれば、
上記第2ないし第4のICカードのいずれかのICカー
ドにおいて、電源供給が開始された後、データ読出/書
込装置からコマンドを受け取る前に、リングバッファに
おける最新書込ページが検出され、その後に、この最新
書込ページに基づいてリングバッファに対する読み出し
または書き込みが行われる。したがって、上記第5のI
Cカードと同様、非接触ICカードのようにアナログ回
路を有するICカードの場合には、電源供給開始後その
アナログ回路の動作が安定するまでの間の待機時間を利
用して、デジタル回路により最新書込ページが検出さ
れ、これにより、ICカードのリングバッファに対する
読み出しや書き込みが実質的に高速化される。According to the sixth IC card of the present invention,
In any one of the second to fourth IC cards, after power supply is started and before a command is received from the data read / write device, the latest write page in the ring buffer is detected. Then, reading or writing to the ring buffer is performed based on the latest write page. Therefore, the fifth I
Like the C card, in the case of an IC card having an analog circuit such as a non-contact IC card, the digital circuit uses the latest wait time until the operation of the analog circuit is stabilized after the power supply is started. A write page is detected, thereby substantially speeding up reading and writing to the ring buffer of the IC card.
【0067】本発明に係る第7のICカードによれば、
リングバッファの各ページのステータス領域の中にステ
ータス情報の他に書込確認データを格納するための領域
が設けられ、リングバッファへの書込時にここに格納さ
れる書込確認データにより、リングバッファへの書込が
正しく行われたか否かを判定することができる。この判
定結果に基づき書き込み不良に対処できるため、リング
バッファに対する読み出しや書き込みの信頼性を向上さ
せることができる。According to the seventh IC card of the present invention,
An area for storing write confirmation data in addition to the status information is provided in the status area of each page of the ring buffer, and the write buffer stores the write confirmation data when writing to the ring buffer. It can be determined whether or not the writing to has been performed correctly. Since a write failure can be dealt with based on this determination result, the reliability of reading and writing to the ring buffer can be improved.
【0068】本発明に係る第8のICカードによれば、
上記第7のICカードと同様の書込確認データが導入さ
れており、リングバッファの各ページのステータス情報
を順次読み出すことにより最新書込ページが検出された
とき、その最新書込ページのデータが正しく書き込まれ
ていなかった場合は、その最新書込ページの書込確認デ
ータに基づき、その最新書込ページの直前のページが改
めて最新書込ページとされる。これにより、書き込み不
良のページを除去した形で、その後のリングバッファへ
のアクセスを正しく行うことができる。According to the eighth IC card of the present invention,
The same write confirmation data as that of the seventh IC card is introduced. When the latest write page is detected by sequentially reading the status information of each page of the ring buffer, the data of the latest write page is deleted. If the data has not been correctly written, the page immediately before the latest written page is set as the latest written page again based on the write confirmation data of the latest written page. As a result, the subsequent access to the ring buffer can be correctly performed in a form in which the page with the write failure has been removed.
【図1】 本発明の実施の形態1であるICカードの概
略構成を示すブロック図。FIG. 1 is a block diagram showing a schematic configuration of an IC card according to a first embodiment of the present invention.
【図2】 リングバッファとして使用するバッファ領域
の構成を示す図。FIG. 2 is a diagram showing a configuration of a buffer area used as a ring buffer.
【図3】 前記実施の形態1における全体動作を示すフ
ローチャート。FIG. 3 is a flowchart showing an overall operation in the first embodiment.
【図4】 前記実施の形態1におけるコラムリードコマ
ンドの実行を示すフローチャート。FIG. 4 is a flowchart showing execution of a column read command according to the first embodiment.
【図5】 前記実施の形態1におけるライトコマンドの
実行を示すフローチャート。FIG. 5 is a flowchart showing execution of a write command according to the first embodiment.
【図6】 前記実施の形態1におけるリードコマンドの
実行を示すフローチャート。FIG. 6 is a flowchart showing execution of a read command according to the first embodiment.
【図7】 本発明の実施の形態2におけるバッファ領域
の構成を示す図。FIG. 7 is a diagram showing a configuration of a buffer area according to the second embodiment of the present invention.
【図8】 前記実施の形態2におけるリードポインタR
ptrおよびライトポインタWptrの設定を示すフローチャ
ート。FIG. 8 shows a read pointer R according to the second embodiment.
9 is a flowchart showing the setting of a ptr and a write pointer Wptr.
【図9】 本発明の実施の形態3におけるバッファ領域
の構成を示す図。FIG. 9 is a diagram showing a configuration of a buffer area according to a third embodiment of the present invention.
【図10】 本発明の実施の形態4におけるステータス
領域の構成を示す図。FIG. 10 is a diagram showing a configuration of a status area according to a fourth embodiment of the present invention.
【図11】 前記実施の形態3におけるリードポインタ
RptrおよびライトポインタWptrの設定を示すフローチ
ャート。FIG. 11 is a flowchart showing setting of a read pointer Rptr and a write pointer Wptr in the third embodiment.
【図12】 前記実施の形態4におけるリードポインタ
RptrおよびライトポインタWptrの設定の要部を示すフ
ローチャート。FIG. 12 is a flowchart showing a main part of setting a read pointer Rptr and a write pointer Wptr in the fourth embodiment.
【図13】 前記実施の形態4におけるライトコマンド
の実行を示すフローチャート。FIG. 13 is a flowchart showing execution of a write command according to the fourth embodiment.
【図14】 前記実施の形態4におけるリードコマンド
の実行を示すフローチャート。FIG. 14 is a flowchart showing execution of a read command according to the fourth embodiment.
【図15】 ICカードにおけるリングバッファの実現
を説明するための図。FIG. 15 is a view for explaining the realization of a ring buffer in an IC card.
100…ICカード 200…リーダライタ 10 …アンテナ 12 …変復調回路 14 …入出力回路 16 …制御回路 18 …メモリ(EEPROM) REFERENCE SIGNS LIST 100 IC card 200 Reader / writer 10 Antenna 12 Modulation / demodulation circuit 14 Input / output circuit 16 Control circuit 18 Memory (EEPROM)
Claims (8)
け取り、受け取ったコマンドに基づき前記データ読出/
書込装置との間でデータの授受を行うICカードにおい
て、 前記データ読出/書込装置からコマンドを含むデータを
受け取る受信手段と、 前記データ読出/書込装置へデータを送り出す送信手段
と、 前記データ読出/書込装置から受け取ったデータを格納
するためのデータ領域と該データ領域への書き込みを示
すステータス情報を格納するためのステータス領域とを
含むページを複数集めて構成される記憶領域であってリ
ングバッファとして使用される記憶領域を有する記憶手
段と、 前記データ読出/書込装置から受け取ったデータを前記
データ領域に書き込んだときに、該データを書き込んだ
前記データ領域を含むページのステータス領域に該書込
を示すステータス情報を書き込む書込制御手段と、 前記データ読出/書込装置からのデータとして受信手段
により所定のコマンドを受け取ると、前記記憶領域内の
全てのページにつき、ステータス領域に格納されたステ
ータス情報を順次読み出し、読み出したステータス情報
を送信手段によりデータ読出/書込装置へ送出する読出
制御手段と、を備えることを特徴とするICカード。A command is received from a data read / write device, and the data read / write is performed based on the received command.
An IC card for exchanging data with a writing device, a receiving unit for receiving data including a command from the data reading / writing device, a transmitting unit for sending data to the data reading / writing device, A storage area configured by collecting a plurality of pages including a data area for storing data received from the data read / write device and a status area for storing status information indicating writing to the data area. Storage means having a storage area used as a ring buffer, and when data received from the data read / write device is written to the data area, a status area of a page including the data area to which the data is written Writing control means for writing status information indicating the writing to the data read / write device; When a predetermined command is received by the receiving means as the data, the status information stored in the status area is sequentially read for all pages in the storage area, and the read status information is transmitted to the data reading / writing device by the transmitting means. An IC card comprising:
け取り、受け取ったコマンドに基づき前記データ読出/
書込装置との間でデータの授受を行うICカードにおい
て、 前記データ読出/書込装置からコマンドを含むデータを
受け取る受信手段と、 前記データ読出/書込装置へデータを送り出す送信手段
と、 前記データ読出/書込装置から受け取ったデータを格納
するためのデータ領域と該データ領域への書き込みを示
すステータス情報を格納するためのステータス領域とを
含むページを複数集めて構成される記憶領域であってリ
ングバッファとして使用される記憶領域を有する記憶手
段と、 前記記憶領域を構成する全てのページのステータス情報
を同一の値に予め初期化しておき、前記データ読出/書
込装置から受け取ったデータを前記データ領域に書き込
んだときに、該データを書き込んだ前記データ領域を含
むページのステータス情報を構成するビットの値を反転
させる書込制御手段と、 前記記憶領域内の各ページのステータス情報を順次読み
出し、読み出したステータス情報の値が直前に読み出し
たステータス情報の値と異なる場合に、該直前に読み出
したステータス情報が格納されていたページをデータ領
域に最新に書き込みが行われた最新書込ページとし、読
み出したステータス情報の値が前記記憶領域内の全ペー
ジにわたって同一の場合に、最後に読み出したステータ
ス情報が格納されていたページを最新書込ページとし
て、該最新書込ページに基づき、リングバッファとして
使用される前記記憶領域に対するデータの読み出しおよ
び書き込みを制御するリングバッファ制御手段と、を備
えることを特徴とするICカード。2. A data read / write device receives a command from a data read / write device, and receives the data read / write device based on the received command.
An IC card for exchanging data with a writing device, a receiving unit for receiving data including a command from the data reading / writing device, a transmitting unit for sending data to the data reading / writing device, A storage area configured by collecting a plurality of pages including a data area for storing data received from the data read / write device and a status area for storing status information indicating writing to the data area. Storage means having a storage area used as a ring buffer, and status information of all pages constituting the storage area are initialized to the same value in advance, and data received from the data read / write device is stored in the storage means. When writing to the data area, status information of a page including the data area to which the data is written is configured. Writing control means for inverting the value of the bit to be read, and sequentially reading status information of each page in the storage area, and when the value of the read status information is different from the value of the status information read immediately before, The page in which the read status information is stored is the latest write page in which the latest write has been performed in the data area. If the read status information value is the same for all pages in the storage area, the page is read last. And a ring buffer control unit that controls reading and writing of data to and from the storage area used as a ring buffer on the basis of the page in which the status information is stored as a latest written page based on the latest written page. An IC card, characterized in that:
るICカード。3. The IC card according to claim 2, wherein said status information comprises one bit.
記奇数個のビットの値が全て同一となるように初期化
し、 前記リングバッファ制御手段は、読み出したステータス
情報に対する多数決演算により値の異なるビットを含ま
ないステータス情報を生成し、読み出したステータス情
報に代えて該多数決演算によって生成したステータス情
報を用いることにより、最新書込ページを検出する、こ
とを特徴とするICカード。4. The IC card according to claim 2, wherein the status information includes an odd number of bits, and the write control unit determines that all of the values of the odd number of bits forming the status information are the same. The ring buffer control unit generates status information not including bits having different values by majority operation on the read status information, and replaces the read status information with status information generated by the majority operation. An IC card for detecting a latest write page by using the IC card.
け取り、受け取ったコマンドに基づき前記データ読出/
書込装置との間でデータの授受を行うICカードにおい
て、 前記データ読出/書込装置からコマンドを含むデータを
受け取る受信手段と、 前記データ読出/書込装置へデータを送り出す送信手段
と、 前記データ読出/書込装置から受け取ったデータを格納
するための領域を含むページを複数集めて構成される記
憶領域であってリングバッファとして使用される記憶領
域を有する記憶手段と、 前記記憶領域をリングバッファとして使用するための読
み出し位置または書き込み位置を示すページの値を、当
該ICカードに電源供給が開始された後、前記データ読
出/書込装置からコマンドを受け取る前に検出するリン
グバッファ制御手段と、を備えることを特徴とするIC
カード。5. A data read / write device receives a command from a data read / write device, and reads the data read / write device based on the received command.
An IC card for exchanging data with a writing device, a receiving unit for receiving data including a command from the data reading / writing device, a transmitting unit for sending data to the data reading / writing device, Storage means having a storage area configured by collecting a plurality of pages including an area for storing data received from the data read / write device and being used as a ring buffer; A ring buffer control means for detecting a page value indicating a read position or a write position for use as a buffer after power supply to the IC card is started and before receiving a command from the data read / write device; IC comprising:
card.
載のICカードにおいて、 前記リングバッファ制御手段は、当該ICカードに電源
供給が開始された後、前記データ読出/書込装置からコ
マンドを受け取る前に、前記最新書込ページを検出する
ことを特徴とするICカード。6. The IC card according to claim 2, wherein said ring buffer control means issues a command from said data read / write device after power supply to said IC card is started. Detecting the latest write page before receiving the IC card.
整数バイトであり、該ステータス領域内にステータス情
報の格納に使用される領域以外の領域として書込確認用
データ領域を設け、 前記書込制御手段は、前記データ読出/書込装置から受
け取ったデータを前記データ領域に書き込んだときに、
該データを書き込んだ前記データ領域を含むページのス
テータス情報を構成するビットの値を反転させるととも
に、該ページのステータス領域内の書込確認用データ領
域に、該データが前記データ領域に正しく書き込まれた
か否かを確認するためのデータを書き込む、ことを特徴
とするICカード。7. The IC card according to claim 2, wherein a size of a status area of each page in the storage area is an integer byte, and an area other than an area used for storing status information in the status area. A write confirmation data area, wherein the write control means writes data received from the data read / write device into the data area,
The value of the bit forming the status information of the page including the data area in which the data is written is inverted, and the data is correctly written in the data area in the write confirmation data area in the status area of the page. An IC card for writing data for confirming whether or not the IC card has been activated.
出しにより最新書込ページが検出されたときに、該最新
書込ページの書込確認用データを読み出して、該書込確
認用データにより該最新書込ページのデータ領域に正し
くデータが書き込まれていたか否かを判定する判定手段
と、 ii)該最新書込ページのデータ領域に正しくデータが書
き込まれていないと判定された場合に、該最新書込ペー
ジの直前のページを改めて最新書込ページとする最新書
込ページ変更手段と、を含むことを特徴とするICカー
ド。8. The IC card according to claim 7, wherein said ring buffer control means: i) when a latest write page is detected by reading status information of each page in said storage area, Determining means for reading the write confirmation data of the write page and determining whether or not data has been correctly written in the data area of the latest write page based on the write confirmation data; ii) the latest book And a latest write page changing unit that, when it is determined that data is not correctly written in the data area of the new write page, sets a page immediately before the latest write page as a new write page. IC card.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9198305A JPH1139450A (en) | 1997-07-24 | 1997-07-24 | IC card |
| KR1019980007230A KR100273614B1 (en) | 1997-07-24 | 1998-03-05 | Ic card |
| TW087103189A TW366473B (en) | 1997-07-24 | 1998-03-05 | IC card |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP9198305A JPH1139450A (en) | 1997-07-24 | 1997-07-24 | IC card |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH1139450A true JPH1139450A (en) | 1999-02-12 |
Family
ID=16388931
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP9198305A Pending JPH1139450A (en) | 1997-07-24 | 1997-07-24 | IC card |
Country Status (3)
| Country | Link |
|---|---|
| JP (1) | JPH1139450A (en) |
| KR (1) | KR100273614B1 (en) |
| TW (1) | TW366473B (en) |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2004012085A1 (en) * | 2002-07-25 | 2004-02-05 | Sanyo Electric Co., Ltd. | Data storage device capable of storing multiple SETS of history information on input/output processing of security data without duplication |
| US7555629B2 (en) | 2005-05-24 | 2009-06-30 | Samsung Electronics Co., Ltd. | Memory card providing hardware acceleration for read operations |
| JP2009163339A (en) * | 2007-12-28 | 2009-07-23 | Toppan Printing Co Ltd | Ic medium, ic medium control program, history information reading method |
| US7716746B2 (en) | 2002-03-05 | 2010-05-11 | Sanyo Electric Co., Ltd. | Data storing device for classified data |
| US7752461B2 (en) | 2002-01-15 | 2010-07-06 | Sanyo Electric Co., Ltd. | Storage apparatus that can properly recommence input and output of classified data |
| JP2017111078A (en) * | 2015-12-18 | 2017-06-22 | 株式会社東芝 | Water leakage detection device |
| US10568839B2 (en) | 2011-01-11 | 2020-02-25 | Capsugel Belgium Nv | Hard capsules |
| US11319566B2 (en) | 2017-04-14 | 2022-05-03 | Capsugel Belgium Nv | Process for making pullulan |
| US11576870B2 (en) | 2017-04-14 | 2023-02-14 | Capsugel Belgium Nv | Pullulan capsules |
-
1997
- 1997-07-24 JP JP9198305A patent/JPH1139450A/en active Pending
-
1998
- 1998-03-05 TW TW087103189A patent/TW366473B/en not_active IP Right Cessation
- 1998-03-05 KR KR1019980007230A patent/KR100273614B1/en not_active Expired - Fee Related
Cited By (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7752461B2 (en) | 2002-01-15 | 2010-07-06 | Sanyo Electric Co., Ltd. | Storage apparatus that can properly recommence input and output of classified data |
| US7716746B2 (en) | 2002-03-05 | 2010-05-11 | Sanyo Electric Co., Ltd. | Data storing device for classified data |
| WO2004012085A1 (en) * | 2002-07-25 | 2004-02-05 | Sanyo Electric Co., Ltd. | Data storage device capable of storing multiple SETS of history information on input/output processing of security data without duplication |
| US7650328B2 (en) | 2002-07-25 | 2010-01-19 | Sanyo Electric Co., Ltd. | Data storage device capable of storing multiple sets of history information on input/output processing of security data without duplication |
| US7555629B2 (en) | 2005-05-24 | 2009-06-30 | Samsung Electronics Co., Ltd. | Memory card providing hardware acceleration for read operations |
| JP2009163339A (en) * | 2007-12-28 | 2009-07-23 | Toppan Printing Co Ltd | Ic medium, ic medium control program, history information reading method |
| US10568839B2 (en) | 2011-01-11 | 2020-02-25 | Capsugel Belgium Nv | Hard capsules |
| JP2017111078A (en) * | 2015-12-18 | 2017-06-22 | 株式会社東芝 | Water leakage detection device |
| US11319566B2 (en) | 2017-04-14 | 2022-05-03 | Capsugel Belgium Nv | Process for making pullulan |
| US11576870B2 (en) | 2017-04-14 | 2023-02-14 | Capsugel Belgium Nv | Pullulan capsules |
| US11878079B2 (en) | 2017-04-14 | 2024-01-23 | Capsugel Belgium Nv | Pullulan capsules |
Also Published As
| Publication number | Publication date |
|---|---|
| KR100273614B1 (en) | 2000-12-15 |
| TW366473B (en) | 1999-08-11 |
| KR19990013323A (en) | 1999-02-25 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11789521B2 (en) | Card and host apparatus | |
| US8756384B2 (en) | Information processing device and information processing method for data recovery after failure | |
| CN1773559B (en) | Data processing method and device | |
| US9418224B2 (en) | Portable electronic device and control method of portable electronic device | |
| EP0220718A2 (en) | IC card | |
| CN101807262B (en) | Apparatus and method for data processing | |
| JPH1139450A (en) | IC card | |
| CN100356382C (en) | Non-contact IC card | |
| KR20020036717A (en) | Microcomputer and method for controlling the same | |
| JP5202230B2 (en) | Data operation device, data operation system, computer program, and data operation method | |
| JP7366765B2 (en) | Control program for IC cards, IC card processing systems, and IC card processing devices | |
| US6811089B2 (en) | Portable electronic medium issuing system and issuing method and portable electronic medium | |
| KR100399603B1 (en) | Smart card and method for writing/erasing and operating an os program the same | |
| JP2001005928A (en) | IC card | |
| JP4318494B2 (en) | IC card and IC card program | |
| US7346730B2 (en) | Mobile electronic device | |
| JPH1027225A (en) | Non-contact IC card memory management system | |
| JP4790308B2 (en) | Information processing system, information processing apparatus, information processing method, and computer program | |
| JP3243591B2 (en) | Contactless data carrier | |
| JP2018147345A (en) | Electronic equipment | |
| JP2009032249A (en) | Portable electronic device, file management method for portable electronic device, and IC card | |
| HK1080960B (en) | Information processing device and information processing method | |
| JP2013191116A (en) | Ic chip, atr response processing program, and atr response method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040427 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060223 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060314 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060808 |