[go: up one dir, main page]

JP3901976B2 - Non-contact IC card, response method, and program thereof - Google Patents

Non-contact IC card, response method, and program thereof Download PDF

Info

Publication number
JP3901976B2
JP3901976B2 JP2001307109A JP2001307109A JP3901976B2 JP 3901976 B2 JP3901976 B2 JP 3901976B2 JP 2001307109 A JP2001307109 A JP 2001307109A JP 2001307109 A JP2001307109 A JP 2001307109A JP 3901976 B2 JP3901976 B2 JP 3901976B2
Authority
JP
Japan
Prior art keywords
random number
temporary
request
card
writer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2001307109A
Other languages
Japanese (ja)
Other versions
JP2002203219A (en
Inventor
中部  太志
忠勝 正木
眞二 川野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2001307109A priority Critical patent/JP3901976B2/en
Publication of JP2002203219A publication Critical patent/JP2002203219A/en
Application granted granted Critical
Publication of JP3901976B2 publication Critical patent/JP3901976B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Credit Cards Or The Like (AREA)
  • Time-Division Multiplex Systems (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、非接触ICカード、応答方法、及びそのプログラムに関し、詳しくは、リーダライタより送信されるリクエストに対して乱数に基づいて算出される値を用いて応答する非接触ICカード、応答方法、及びそのプログラムに関する。
【0002】
【従来の技術】
従来、電磁誘導方式等を用いてデータの授受を行なう非接触ICカードと当該非接触ICカードを認識するリーダライタとの間の通信には、タイムスロット方式が採用されている。これは、複数の非接触ICカードが同時にリーダライタの通信可能エリア内に存在し、リーダライタからのポーリングに対して複数の非接触ICカードが同時に応答した場合、当該応答に用いられる各レスポンス信号が衝突して何れの非接触ICカードもリーダライタと正常に通信することができなくなるためである。
【0003】
上記タイムスロット方式の通信方法を以下に説明する。
【0004】
(1)まずリーダライタは非接触ICカードの存在を確認するために、リクエストとして初期応答リクエストコマンドを非接触ICカードに送信する。上記初期応答リクエストコマンドには、非接触ICカードが行なう初期応答のタイミングの制御に必要な「スロット数」、又は「スロット数」を計算する為に必要な値が含まれる。
【0005】
(2)上記非接触ICカードは、上記初期応答リクエストコマンドを受信後、特定時間から設けられるタイムスロット(1〜「スロット数」)へ上記初期応答を返す。応答に用いるタイムスロット、即ちタイミングは、非接触ICカード自身が乱数で決定する。
【0006】
(3)上記リーダライタは、複数の非接触ICカードが同一のタイムスロットを選択した際に起こる初期応答の衝突を検出した場合、再度上記初期応答リクエストを送信する。ここで通常、再度送信された初期応答リクエストに設けられるタイムスロットの数は、先に設けられたタイムスロットの数よりも多数である。
【0007】
(4)上記リーダライタは、すべての非接触ICカードからの初期応答を正常に受信することですべての非接触ICカードの認識をし、当該カードの識別のためのシーケンスを完了する。
【0008】
このようなシステムとして、無線式識別装置(特開平9−6934号公報)が開示されている。
【0009】
尚、上記タイムスロット方式に類似の方法として、スロットマーカ方式がある。当該スロットマーカ方式では、リーダライタが上記タイムスロット方式における初期応答リクエストを送信後、さらに当該リーダライタが各スロット開始のタイミング毎にスロットの開始を示すスロットマーカコマンドを送信する方式である。
【0010】
【発明が解決しようとする課題】
上記無線式識別装置(特開平9−6934号公報)では、識別カード(非接触ICカード)が送受信デコーダ(リーダライタ)よりポーリングを受けてからレスポンス信号(応答)を送信するまでの遅延時間を、上述したように乱数で決定する必要がある。
【0011】
ここで、上記乱数に質の悪い乱数、即ち複数回乱数を発生した際に偏った乱数を発生させるシステムにより生成された乱数、を用いた場合には、複数の非接触ICカードで同じ乱数を発生させることが多くなる。このため、上記初期応答の衝突が多発し、リーダライタによるカード識別のシーケンス終了が遅れるばかりか、最悪、非接触ICカードが同じ乱数を発生し続けると、カード識別のシーケンスが終了しないといった問題を有する。特に電車の改札機等のように、立ち止まることなく利用者が非接触ICカードをリーダライタに認識させる必要があるシステムにて利用した場合、上記カード識別が遅れることにより当該システムの利用に障害が生じることになる。
【0012】
従って、上記質の悪い乱数の使用を避け、良質の乱数、即ち複数回乱数を発生した際に偏らない乱数を発生させるシステムにより生成された乱数、を使用する必要がある。
【0013】
しかしながら、上記良質の乱数を得る為には、上記質の悪い乱数を得るよりも複雑な計算を行なう必要がある。このため、上記良質の乱数をソフトウェアにて生成する場合には、高速処理が可能なCPU(Central Processing Unit)を用いる必要があるが、当該高速処理が可能なCPUを利用するには大量の電力を必要とする。ここで、一般的に非接触ICカードのような電磁誘導方式の給電方式では、CPUで単位時間当りに使用できる電力は小さく、良質の乱数を生成するための十分な電力を給電することができない。従って、利用可能な電力で良質な乱数を得る為の計算を行なうと長時間かかってしまい、乱数の計算が終了する前にタイムスロットが終了するため初期応答ができないといった問題が起こる。
【0014】
又、上記良質の乱数をハードウェアにて生成することにより、ソフトウェアにて生成するよりも一般的に短時間で提供可能であるが、この場合には乱数発生のためだけに特別な回路を必要とし、装置が複雑化してコストが高くなるといった問題が生じる。特に非接触ICカードはサイズに制限があると共に、ある程度柔軟性が必要なために、上記ハードウェアでの乱数の提供は障害が大きいといえる。
【0015】
本発明は、良質な乱数を簡単な構成にて提供することにより、初期応答の衝突を最小限にとどめる非接触ICカード、応答方法、及びそのプログラムを提供することを目的とする。
【0016】
【課題を解決するための手段】
本発明は、上記目的を達成するために以下の手段を採用している。即ち、本発明はリーダライタより送信されるリクエストに対して乱数を用いて応答する非接触ICカードを前提としている。ここで、仮乱数生成手段は、上記リーダライタよりリクエストを受信する前に乱数の発生に用いる演算のうち一部の演算によって得られる仮乱数を生成する。乱数生成手段により上記リクエストに含まれるスロット数と、上記仮乱数生成手段により生成された仮乱数とを用いて算出される応答タイミングである乱数が生成される。また、自己送信タイミング判定手段は、自らが応答すべきタイミングまでに所定の時間があるか否かを判定する。上記仮乱数生成手段は、上記自己応答タイミング判定手段により、応答タイミングまでに所定の時間があると判定された場合に上記仮乱数を生成する。
【0017】
以上のように、自らが応答すべきタイミングまでに所定の時間があるか否かを判定することで、自らには関係ない、実質的に待ち時間であるスロットにて仮乱数を生成することが可能となる。
【0018】
又、乱数発生用のハードウェアを用いることなく、ソフトウェアにて良質の乱数を得ることが可能となるため非接触ICカードのコストを下げることが可能となる。さらにハードウェアを用いることにより生じる設計、強度等の問題も発生しない。
【0019】
尚、上記仮乱数の生成ための演算は、上記リクエストに関連しない演算とし、上記乱数の生成のための演算は、上記リクエストに基づいて決定される演算とすることができる。
【0020】
さらに、上記構成に加え上記仮乱数記憶手段を備えると共に、リーダライタからのリクエストに対して記憶した複数の仮乱数を順次用いて応答を行なう構成がある。
【0021】
この構成では、一度生成した仮乱数を再度最初から順次使用することが可能となり、リーダライタからリクエストが連続してきた場合にも即座に乱数を生成できるため、常に良質の乱数を用いて初期応答を行なうことが可能となる。
【0022】
さらに上記仮乱数記憶手段を不揮発性とし、上記仮乱数生成手段は、通信処理終了時に上記仮乱数を生成して上記不揮発性の仮乱数記憶手段に記憶し、上記乱数生成手段は、上記リクエストを受信した際に上記不揮発性の仮乱数記憶手段に記憶された仮乱数から乱数を生成する構成がある。
【0023】
この構成では、非接触ICカードがリーダライタと通信を終了した後であって、上記リーダライタとの通信可能範囲内にある場合には電力の供給を受けることが可能であるため、予め仮乱数を生成することが可能となる。また、当該生成された仮乱数は不揮発性の仮乱数記憶手段に記憶されるため、次にリーダライタとの通信可能範囲に入った場合には即時良質の乱数を発生することが可能となる。
【0024】
さらに仮乱数の生成中に上記リーダライタからのリクエストを受信した際に当該仮乱数の生成を中断することを示す仮乱数中断フラグと、リクエストに対する応答が終了した後に上記仮乱数の生成を開始すべき個所を示す仮乱数処理中フラグを備え、上記仮乱数中断フラグ及び仮乱数処理中フラグに基づいて、仮乱数の生成の中断・開始を行なう構成がある。
【0025】
この構成では、仮乱数生成中にリーダライタからの初期応答リクエストが行なわれた場合でも、仮乱数の生成を途中で中断することにより、初期応答を行なうことができ、その後、仮乱数の生成を再開することができる。これにより、例えばプログラム起動時等の処理を軽減することができる。
【0026】
さらに特定スロット番号保持手段が所定の値を保持し、上記仮乱数の生成中に上記リクエストを受信した際に当該仮乱数の生成を中断し、上記特定スロット番号保持手段が保持している値を用いて応答する構成がある。
【0027】
この構成では、仮乱数記憶手段に有効な仮乱数が記憶されていない場合であってもリクエストに対して所定の時間内に応答を返すことが可能になる。
【0028】
【発明の実施の形態】
以下、添付図面を参照して、本発明の実施の形態につき説明し、本発明の理解に供する。尚、以下の実施の形態は、本発明を具体化した一例であって、本発明の技術的範囲を限定する性格のものではない。
【0029】
まず、図1〜図3を用いて、近接型非接触ICカードの国際規格ISO/IEC14443に適応した場合の非接触ICカードの処理について簡単に説明する。
【0030】
ISO/IEC14443は例えば、非接触テレホンカードなどに適応できる。さらに具体的に、図1に示すように、公衆電話として機能するリーダライタ100にテレホンカードとしての機能を有する非接触ICカード200、300を同時に差し込んだ(近接させた)場合を想定する。
【0031】
ISO/IEC14443の非接触ICカードの認識システムにおいては、以下の手順で非接触ICカードの認識が行われる。
【0032】
まず、公衆電話であるリーダライタ100が初期応答リクエスト(リクエスト)を送信する。当該初期応答リクエストは、図3に示されるフォーマットになっており、初期応答リクエスト301を構成するPARAM302内の8bitのうち、bit1〜bit3の3bit303を用いてタイムスロット数(N)を非接触ICカードに通知する。尚、APf304は、初期要求コマンドを示すヘッダであり、AFI305は非接触ICカードの適応クラスを示す。又、CRC(Cyclic Redundancy Check)306はAPf〜PARAMまでのCRCである。
【0033】
尚、非接触ICカードは1〜NまでのN個のスロットで応答するが、今回の説明ではタイムスロット数(N)を4として説明を行なう。即ち、初期応答リクエストに対して非接触ICカード200及び300は、1〜4までのタイムスロットのうち一つを選択し、初期応答を行なう。
【0034】
図2で示す一回目のカード識別処理201において、まずリーダライタ100から初期応答リクエストR1〔REQB〕(202)を送信する。当該初期応答リクエストR1(202)に対して非接触ICカード200及び300が、乱数としてそれぞれ「1」を生成したときには、タイムスロット1(204)内の初期応答〔ATQB〕A21、A31でそれぞれ応答する。この場合、上記非接触ICカード200、300共同一のタイミングで初期応答を応答するため、リーダライタ100は、非接触ICカードの衝突を検出する。したがって、再度、識別処理を再開する。
【0035】
二回目の識別処理207において、リーダライタ100から初期応答リクエストR2(203)を送信する。初期応答リクエストに対して非接触ICカード200及び300が、乱数として「3」、および「2」を生成したときには、タイムスロット3(205)内のパケットA22、およびタイムスロット2(206)内のパケットA32で応答する。この場合、リーダライタ100は衝突を検出しないため、すべての非接触ICカードの識別を行なうことができ、識別処理を完了する。以上がISO/IEC14443の規定に従った、非接触ICカードのカード識別処理である。尚、ISO/IEC14443の規定では、初期応答リクエストコマンドを受け取ってから、非接触ICカードがタイムスロット1で応答する場合の時間を302μsecと規定し、また、1つのタイムスロットの期間(時間)は2266μsecと規定している。リーダライタ100から初期応答リクエストを受信して、初期応答を送信するまでのタイミング(μsec)は、以下の計算式(式1)により与えられる。
【0036】
タイミング(μsec)=302μsec+2266μsec×(スロット数(N)−1) :(式1)
(実施の形態1)
以下、本発明にかかる実施の形態1におけるリーダライタ100及び、複数の非接触ICカード200、300、…よりなる非接触ICカードシステムについて説明する。なお、非接触ICカード200,300の構成は同一であるため、以下、主に非接触ICカード200を用いて説明する。
【0037】
図4(a)は、実施の形態1におけるリーダライタ100の構成を示す図である。リーダライタ100は、アンテナ401、送受信回路402、CPU403、リーダライタを制御するためのプログラムが格納されているROM(Read Only Memory)404、プログラム実行時に例えばワークエリアとして使用されるRAM(Random Access Memory)405より構成されている。
【0038】
又、図4(b)に示すのは非接触ICカード200の構成を示す機能ブロック図である。上記非接触ICカード200は、アンテナ406、送受信回路407、各プログラムを実行するCPU408、リーダライタ100からのコマンドを処理するための制御プログラム等が格納されるROM409、プログラム実行時に例えばワークエリアとして使用されるRAM410より構成される。ここで上記非接触ICカード200は、上記リーダライタ100等の通信可能エリアに入ると、上記リーダライタ100からの電磁波より誘導される電力にて動作する。このため、大量の電力の供給を受けることができないのは上述したとおりである。
【0039】
次に、上記図4(b)における非接触ICカード200を機能ブロック図として示したのが図5である。即ち、上記非接触ICカード200は、アンテナ手段501、送受信手段502、制御手段503、良質の乱数を生成するための仮乱数生成手段504、仮乱数を記憶する仮乱数記憶手段505、受信した初期要求コマンドからスロット数を取得するスロット数取得手段506、仮乱数記憶手段505に記憶される仮乱数から乱数を生成する乱数生成手段507を備える。尚、例えば上記仮乱数生成手段504、スロット数取得手段506、乱数生成手段507は、図4(b)に示したROM409に格納され、必要に応じてCPU408に読み出されて実行される。
【0040】
次に、図6を用いて本実施の形態1に係る非接触ICカードの処理について説明する。尚、図6は非接触ICカード200の実行する通信処理のフローチャートである。
【0041】
まず、非接触ICカード200を構成する仮乱数生成手段504は、例えばプログラム起動時等の所定のタイミングで、良質の乱数を生成する為の仮乱数(r)を予め生成しておく(図6:S601)。ここで上記仮乱数とは、乱数の生成に必要な複数ステップの演算のうち、所定のステップ数の演算にて得られる値を指す。例えば上記乱数の生成に必要なステップが100ステップである場合に、当該必要ステップの前段90ステップにて導き出される値等が仮乱数である。言い換えれば、後述するステップ数(N)(リクエスト)に関連しない演算を仮乱数の生成ステップとすることができる。また、上記プログラム起動時とは、上記リーダライタ100等の通信可能エリアに入ることで、上記リーダライタ100からの電磁波より電力を誘導した場合等である。
【0042】
尚、上記乱数は充分に良質の乱数とするための方法を用いるのが好ましく、例えば乱数生成方法(特願平11−177913号公報)等にその具体例が示されている。但し、良質の乱数発生のためのアルゴリズムは当該発明には直接関係しないため詳細は省略する。
【0043】
上記仮乱数生成手段504にて生成された仮乱数(r)は、例えばRAM410内に設けられた仮乱数記憶手段505に記憶される(図6:S602)。
【0044】
次に、リーダライタ100から初期応答リクエスト(リクエスト)が送信されてくるのを待機する(図6:S603NO)。上記アンテナ手段501が上記リーダライタ100からの電磁波を受信し、当該電磁波に上記初期応答リクエストが含まれていた場合、当該初期応答リクエストは送受信手段502を会して制御手段503にて受信される。続いて、制御手段503は上記初期応答リクエストをスロット数取得手段506に送信し、当該スロット数取得手段506は初期応答リクエストの中からスロット数を取得する(図6:S603YES−S604)。上記スロット数は、図3に示したPARAM302のBit1〜Bit3で指定されており、数値2を、このbitに指定される値回数乗じた値となる。以下にスロット数の計算式(式2)を示す。
【0045】
スロット数(N)=2^n:(式2)
(nはBit1〜Bit3であらわされる0から4までの値)
上記スロット数取得手段506にて取得(計算)されたスロット数(N)は、上記制御手段503に送信される。
【0046】
続いて上記制御手段503がスロット数(N)を取得すると、当該スロット数(N)と共に上記仮乱数記憶手段505に記憶した仮乱数(r)を乱数生成手段507に送信する。
【0047】
上記スロット数(N)、及び仮乱数(r)を受信した乱数生成手段507は、当該2つの値に基づいて乱数(本乱数)(R)を生成する(図6:S605)。ここで、仮乱数(r)から乱数を生成する処理は、上記乱数の生成に必要な複数ステップの演算のうち、仮乱数の生成時に処理された所定のステップ以外の、残りのステップを実行(演算)するのみである。ここで、当該残りのステップは、上記スロット数(N)がわからないと処理できない、即ち上記スロット数(N)(リクエスト)が関連するステップとすることができる。
【0048】
以下に乱数(R)の計算式の一例(式3)を示す。
【0049】
乱数(R)=仮乱数(r)%スロット数(N)+1 :(式3)
(%は剰余演算)
上記計算式(式3)は、タイムスロットの応答時間の規定を満たすものであれば他の演算式を用いてもかまわない。
【0050】
上記乱数生成手段507にて生成された乱数は、上記制御手段503に送信される。
【0051】
以上により、非接触ICカード200は、所望の乱数(1〜スロット数(N))を得ることができる。以後、上記乱数に基づいたタイミング(スロット)を利用して、上記リーダライタ100に対して初期応答を行なう(図6:S606)。上記初期応答完了後、再度、仮乱数(r)を生成するステップS601へもどり、一連の初期応答を完了する。
【0052】
以上のように、乱数の生成処理を分割し、初期応答リクエストを受信した後に乱数(R)を生成するための演算の負荷が小さい演算とすることで、ISO/IEC14443におけるタイムスロットの時間的規定を満たす事が可能である。しかも、乱数の生成には、演算量の多大な、即ち良質の乱数を生成可能な処理を適用することが可能である為、質の悪い乱数により生じる問題を解決することが可能となる。
【0053】
又、良質の乱数を生成するための単位時間当り十分な電力を給電することができない非接触ICカードにおいても、乱数発生用のハードウェアを用いることなく、ソフトウェアにて良質の乱数を得ることが可能となるため非接触ICカードのコストを下げることが可能となる。さらにハードウェアを用いることにより生じる設計、強度等の問題も発生しない。
【0054】
尚、本実施の形態1では、乱数の生成にソフトウェアを利用しているが、ハードウェアにより良質の乱数を生成してもよい。ソフトウェアよりも高速に乱数を生成することが可能であるハードウェアを利用する為、さらに多大なステップを必要とする、良質の乱数の生成方法を利用する事が可能になる。この場合、非接触ICカード200は、仮乱数発生手段にハードウェア回路を適用した構成となる。
【0055】
(実施の形態2)
続いて、本発明に係る実施の形態2について説明する。尚、図7は、請求項2の非接触ICカード200が実行する通信処理のフローチャートである。
【0056】
上記実施の形態1における非接触ICカードでは、初期応答リクエストに対する応答が完了してすぐに再度リーダライタから初期応答リクエストが送信された際に、当該非接触ICカードが仮乱数生成中であった場合には、初期応答ができない問題点がある。本実施の形態2では、この問題を解決するための手段を提供する。尚、本実施の形態2における非接触ICカードは、上記実施の形態1における非接触ICカードとほぼ同様の構成を有する為、異なる点のみ説明を行なう。
【0057】
まず、上記非接触ICカード200を構成する仮乱数生成手段504は例えばプログラム起動時等の所定のタイミングで、仮乱数(r(n))を生成する(図7:S701)。ここで(r(n))は、n番目に生成された仮乱数を意味し、1から仮乱数生成規定回数までの値をとる。尚、仮乱数規定回数とは、仮乱数をいくつ生成するかを決定する値であり、例えばプログラム的に決定される定数や、RAM410やROM409に格納される変数等で与えられる。
【0058】
また、仮乱数の生成は、良質の乱数とするための方法を用いるのは上記実施の形態1と同様である。
【0059】
上記仮乱数生成手段504にて生成された仮乱数(r(n))は、制御手段503を介して仮乱数記憶手段505に記憶される(図7:S702)。尚、この際に、本実施の形態2における非接触ICカード200は、上記仮乱数記憶手段505を複数備えており、例えば上記生成された仮乱数(r(n))は仮乱数記憶手段505(n)に記憶されるものとする。
【0060】
上記仮乱数記憶手段505(n)に仮乱数が記憶された後、上記制御手段503は、乱数生成カウンタを用いて仮乱数の生成回数を確認する(図7:S703)。ここに乱数生成カウンタは、生成した仮乱数(r(n))の番号を記憶するための変数で、非接触ICカード200のRAM410に実装される。
【0061】
ここで、仮乱数の生成回数が上記仮乱数生成規定回数に達しなかった場合、上記仮乱数生成手段504は、上記制御手段503からの指示に基づいて再度仮乱数を生成する(図7:S703NO−S701)。
【0062】
尚、仮乱数の生成回数が上記仮乱数生成規定回数に達した場合、乱数使用カウンタを1で初期化する(図7:S703YES−S704)。ここに乱数使用カウンタは、次回の乱数生成時に使用する仮乱数(r(n))の番号を記憶するための変数で、非接触ICカード200のRAM410に実装される。
【0063】
以上の処理により、複数の仮乱数が生成され、仮乱数記憶手段505にそれぞれ格納される。
【0064】
次に、上記非接触ICカード200は、リーダライタ100から初期応答リクエストが送信されてくるのを待機する(図7:S705NO)。上記アンテナ手段501が上記リーダライタ100からの電磁波を受信し、当該電磁波に上記初期応答リクエストが含まれていた場合、当該初期応答リクエストは送受信手段502を介して制御手段503にて受信され、制御手段503は上記初期応答リクエストをスロット数取得手段506に送信し、当該スロット数取得手段506が初期応答リクエストの中からスロット数を取得するのは上記実施の形態1と同様である(図7:S705YES−S706)。
【0065】
続いて、上記制御手段503がスロット数(N)を取得すると、当該スロット数(N)と共に上記仮乱数記憶手段505に記憶した仮乱数(r(n))を乱数生成手段に送信する。但し、ここで使用される仮乱数(r(n))は、上記乱数使用カウンタに基づく仮乱数であって、ここでは仮乱数(r(1))となる。
【0066】
上記スロット数(N)、及び仮乱数(r(1))を受信した乱数生成手段507は、当該2つの値に基づいて乱数(本乱数)(R)を生成する(図7:S708)。
【0067】
以下に乱数(R)の計算式の一例(式4)を示す。
【0068】
本乱数(R)=仮乱数(r(n))%スロット数(N)+1:(式4)
(%は剰余演算、nは仮乱数使用カウンタの値)
上記計算式(式4)は、タイムスロットの応答時間の規定を満たすものであれば他の演算式を用いてもかまわない。
【0069】
以上により、非接触ICカード200は、所望の乱数(1〜スロット数(N))を得ることができる。以後、上記乱数に基づいたタイミング(スロット)を利用して、上記リーダライタ100に対して初期応答を行なう(図7:S709)。
【0070】
上記初期応答の完了後上記制御手段503は、乱数使用カウンタの値をインクリメント(+1)する(図7:S710)。
【0071】
ここで、上記乱数使用カウンタの値が乱数生成規定回数に達しない場合、再度リーダライタ100から初期応答リクエストが送信されてくるのを待機する(図7:S711NO−S705)。
【0072】
尚、上記乱数使用カウンタの値が上記乱数生成規定回数に達した場合、乱数使用カウンタを1に初期化し、再度初期応答リクエスト待ちのステップS504へ戻る(図7:S711YES−S712−S705)。
【0073】
以上の動作により、一度生成した仮乱数を再度最初から順次使用することが可能となり、リーダライタ100から初期応答リクエストが連続してきた場合にも即座に乱数を生成できる為、常に良質の乱数を用いて初期応答を行なうことが可能となる。
【0074】
(実施の形態3)
続いて、本発明に係る実施の形態3について説明する。
【0075】
図8は、実施の形態3における、非接触ICカード200の実行する通信処理のフローチャートである。
【0076】
上記実施の形態1における非接触ICカードでは、初期応答リクエストに対する応答が完了してすぐに再度リーダライタから初期応答リクエストが送信された際に、当該非接触ICカードが仮乱数生成中であった場合には、初期応答ができない問題点がある点は既に述べたとおりである。又、上記実施の形態2では、仮乱数を複数生成するための処理時間が必要で、初期応答リクエストを受けつけるまでの時間がかかるという問題がある。本実施の形態3では、この問題を解決するために、さらに自己応答タイミング判定手段520を備える。尚、本実施の形態3における非接触ICカードは、上記実施の形態1、2における非接触ICカードとほぼ同様の構成を有する為、異なる点のみ説明を行なう。
【0077】
まず、非接触ICカード200を構成する仮乱数生成手段504は、例えばプログラム起動時等の所定のタイミングで、仮乱数(r)を生成する(図8:S801)。
【0078】
上記仮乱数生成手段504において生成された仮乱数(r)は、仮乱数記憶手段505に記憶される(図8:S802)。
【0079】
次に、リーダライタ100から初期応答リクエストが送信されてくるのを待機する(図8:S803NO)。
【0080】
ここで、上記初期応答リクエストを受信した場合、スロット数取得手段506にて当該初期応答リクエストの中からスロット数を取得する(図8:S803YES−S804)。
【0081】
次に、乱数生成手段507は、上記スロット数(N)と仮乱数記憶手段にて記憶している仮乱数(r)から乱数(R)を生成する(図8:S805)。
【0082】
以上により、非接触ICカード200は、所望の乱数(1〜スロット数(N))を得ることができる。以上の処理は実施の形態1とほぼ同様である。
【0083】
続いて、非接触ICカード200は、自己応答タイミング判定手段520により応答のタイミング(スロット)を判定する。即ち上記自己応答タイミング判定手段520は、当該非接触ICカード200が応答すべきタイミングを、初期応答リクエストを受信した時刻と上記生成された乱数(R)とに基づいて算出し、上記非接触ICカード200が応答すべきタイミングまでに十分な時間(所定の時間)があるか否かを判定する(図8:S806)。尚、上記十分な時間とは、上記仮乱数の生成及び記憶に必要な時間である。
【0084】
ここで、上記判定にて十分な時間があると判定された場合、上記制御手段503は仮乱数生成手段504に対し仮乱数(r)を生成する指示を出すと共に、生成された仮乱数を仮乱数記憶手段505に記憶する(図8:S806NO−S807−S808)。
【0085】
尚、上記判定にて十分な時間が無いと判定された場合、上記制御手段503は上記生成された乱数(R)に基づくスロットを利用して初期応答を行なう(図8:S806YES−S809)。
【0086】
上記初期応答完了、または仮乱数生成完了後、上記制御手段503はタイムスロット期間の終了判定を行なう。ここにタイムスロット期間とは、最初のタイムスロットが開始され、最後のタイムスロットが終了するまでの期間であり、上記リーダライタ100から与えられたスロット数により決定する期間である。
【0087】
ここでタイムスロット期間内であれば、上記自己応答タイミング判定手段520による判定から繰り返す(図8:S810YES−S806)。
【0088】
尚、タイムスロット期間内ではない場合、初期応答リクエスト待ち処理に戻り初期応答リクエストにそなえる(図8:S810NO−S803)。
【0089】
以上のように、自らが応答すべきタイミングまでに所定の時間があるか否かを判定することで、自らには関係ない、実質的に待ち時間であるスロットにて仮乱数を生成することが可能となる。
【0090】
又、上記仮乱数記憶手段に不揮発性メモリを利用することで、例えば上記プログラム起動時から初期応答要求リクエストを受信するまでに仮乱数を生成する時間的な余裕がない場合であっても、既に仮乱数は準備されているので良質の乱数を用いて応答することが可能となる。
【0091】
尚、本実施の形態3における技術は、上記実施の形態2における、複数の仮乱数記憶手段を設けた場合にも適用できることは言うまでもない。
【0092】
(実施の形態4)
続いて、本発明に係る実施の形態4について説明する。
【0093】
図9は、実施の形態4における、非接触ICカード200の実行する通信処理のフローチャートである。
【0094】
上記実施の形態1における非接触ICカードでは、初期応答リクエストに対する応答が完了してすぐに再度リーダライタから初期応答リクエストが送信された際に、当該非接触ICカードが仮乱数生成中であった場合には、初期応答ができない問題点がある点は既に述べたとおりである。又、上記実施の形態2では、仮乱数を複数生成するための処理時間が必要で、初期応答リクエストを受けつけるまでに時間がかかるという問題がある。本実施の形態4では、この問題を解決するために、不揮発性メモリにより構成される仮乱数記憶手段505を備える。尚、本実施の形態4における非接触ICカードは、上記実施の形態1、2、3における非接触ICカードとほぼ同様の構成を有する為、異なる点のみ説明を行なう。
【0095】
まず、制御手段503は、乱数使用カウンタを1に初期化する(図9:S901)。
【0096】
次に、初期応答リクエストを受信した場合、上記スロット番号演算手段508は、当該初期応答リクエストの中からスロット数を取得する(図9:S902YES−S903)。
【0097】
続いて上記制御手段503は、不揮発性の仮乱数記憶手段505に記憶される乱数使用カウンタ番目の仮乱数(r(n))を取り出し、乱数生成手段507が当該仮乱数(r(n))と上記スロット数(N)から乱数(R)を生成する(図9:S904−S905)。尚、上記仮乱数(r(n))を格納する手順は後述する。
【0098】
以上により、非接触ICカード200は、所望の乱数(1〜スロット数(N))を得ることができる。以後、上記乱数に基づいたタイミング(スロット)を利用して上記リーダライタ100に対して初期応答を行なう(図9:S906)。
【0099】
上記初期応答の完了後、上記制御手段503は、乱数使用カウンタの値をインクリメント(+1)する(図9:S907)。
【0100】
ここで、上記乱数使用カウンタの値が乱数生成規定回数以下の場合、再度初期応答リクエスト受信の為待機する(図9:S908NO−S902)。
【0101】
尚、上記乱数使用カウンタの値が乱数生成規定回数になった場合、乱数使用カウンタを1に初期化し、再度初期応答リクエスト受信の為待機する(図9:S908YES−S909−S902)。
【0102】
上述した処理は、上記実施の形態2におけるS704〜S702の処理と同様である。
【0103】
さて、上記制御手段503が、乱数使用カウンタを1に初期化した後、初期応答リクエストを受信しなかった場合、通信終了リクエスト1001を受信したかを判定する(図9:S902NO−S910)。ここに、通信終了リクエスト1001とは、図10に示されるフォーマットを有し、リーダライタ100と非接触ICカード200との通信の終了時に上記リーダライタ100より送信される情報である。上記通信終了リクエスト1001は、S−BLOCK1002、CID(カードID)1003、CRC1004の各フィールドを有し、上記S−BLOCK1002にはシステムコマンドの(通信終了)が、CID1003には、当該非接触ICカード200のカードIDが、CRC1004にはS−BLOCK1002とCID1003のCRCが格納されている。
【0104】
ここで、上記リーダライタ100から上記通信終了リクエストを受信しなかった場合、初期応答リクエスト、(又はその他のリクエスト:図9に示さず)の受信待ちを行なう(図9:S910NO−S902)。
【0105】
但し、通信終了リクエストを受信した場合、上記リーダライタ100と非接触ICカード200との通信が終了したことを示すため、仮乱数生成手段504は、上記仮乱数(r(n))を生成する(図9:S911)。ここで、“n”はn番目の仮乱数生成回数を示し、1から仮乱数生成規定回数までの値をとるのは上記実施の形態2と同様である。上記仮乱数生成手段504にて生成された仮乱数(r(n))は、不揮発性の仮乱数記憶手段505に記憶される(図9:S912)。
【0106】
次に、制御手段503は、仮乱数の生成回数が仮乱数生成規定回数に達しているか否かを判定する。
【0107】
ここで仮乱数の生成回数が仮乱数生成規定回数に達していない場合、再度仮乱数生成手段504により、仮乱数の生成を行なう(図9:S913NO−S911)。
【0108】
尚、仮乱数の生成回数が仮乱数生成規定回数に達した場合、システムの停止を行なう(処理を終了する)。
【0109】
以上のように、非接触ICカードがリーダライタと通信を終了した後であって、上記リーダライタとの通信可能範囲内にある場合には電力の供給を受けることが可能であるため、予め仮乱数を生成することが可能となる。また、当該生成された仮乱数は不揮発性記憶手段に記憶されるため、次にリーダライタとの通信可能範囲に入った場合には即時良質の乱数を発生することが可能となる。よって、例えばプログラム起動時等の処理を軽減することができる。これにより、初期応答リクエスト待ちになるまでの時間をさらに短縮することができる。
【0110】
(実施の形態5)
続いて、本発明に係る実施の形態5について説明する。
【0111】
ここに、図11(a)は非接触ICカード200の初期化時の処理、図11(b)は非接触ICカード200の割り込み時の処理、図12は仮乱数生成処理を示す。
【0112】
実施の形態5に係る非接触ICカードは、初期応答方法に関しては上記実施の形態1〜4と同様の処理を行なうが、ここでは、仮乱数生成の中断を可能とする。言い換えれば、当該実施の形態5に示した技術を上記実施の形態1〜4と組み合わせることで、仮乱数生成の中断、開始を自由に行なうことが可能となる。
【0113】
まず、制御手段503は、例えばプログラム起動時等の所定のタイミングで非接触ICカード200の初期化処理を行なう。当該初期化処理とは、仮乱数処理中Flagに“1”を設定する処理、及び仮乱数中断Flagに“0”を設定する処理である(図11(a):S1101−S1102)。
【0114】
上記仮乱数処理中Flagとは、仮乱数の生成中の状態を示す変数で、3段階ある生成演算(生成演算1、生成演算2、生成演算3)の生成過程の状態を示している。即ち、仮乱数処理中Flagが1の場合は生成演算1、仮乱数処理中Flagが2の場合は生成演算2、仮乱数処理中Flagが3の場合は生成演算3を行なうことを示す。尚、上記生成演算1〜3とは、仮乱数(r)の生成に必要な処理を、中断可能な3つの処理に分割したものであり、ここでは3つとしたが、2以上であればいくつでもよい。
【0115】
また、上記仮乱数中断Flagとは、制御手段503への割り込みにより変更される変数で、“0”の場合は、仮乱数の生成を中断する必要がない状態で、“0”以外の場合は、仮乱数の生成を中断する必要があることを示す。上記仮乱数処理中Flag、仮乱数中断Flagともに非接触ICカード200のRAM505内に設けられる。
【0116】
以上が仮乱数の生成処理の中断に必要な準備である。
【0117】
続いて、上記リーダライタから要求(命令)が送信された場合、上記制御手段503は当該要求(命令)の内容を判定する(図11(b):S1110)。尚、通常、上記要求は随時送信されるため、割込処理にて処理される。
【0118】
ここで上記要求(命令)が、初期応答リクエストである場合、上記制御手段503は仮乱数中断Flagに1を設定する(図11(b):S1110YES−S1111)。
【0119】
また、上記要求(命令)が、初期応答リクエストでない場合、仮乱数中断Flagに0を設定する(図11(b):S1110NO−S1112)。
【0120】
以上が、割り込みがあった際に行なわれる処理である。
【0121】
続いて、例えば上記実施の形態1〜4での仮乱数生成手段504による仮乱数の生成時における処理を説明する。
【0122】
まず、仮乱数生成手段504による仮乱数の生成時に、当該処理の中断を行なうかを仮乱数中断Flagにより判定する(図12:S1201)。
【0123】
ここで、上記仮乱数中断Flagが“1”の場合、初期応答リクエストを受信した後の処理であるため仮乱数の生成処理を中断する(図12:1201YES−仮乱数生成終了)。
【0124】
ここで、仮乱数中断Flagが“0”の場合、初期応答リクエストを受信しておらず、仮乱数生成手段504が仮乱数の生成処理を行なう(図12:1201NO−S1202)。
【0125】
次に、仮乱数生成処理の演算は3つの演算に分かれており、上記制御手段503は、仮乱数処理中Flagに基づいて当該3つの演算のどの演算を行なうかを判定する(図12:1202)。
【0126】
ここで、仮乱数処理中Flagが“1”の場合、1番目の仮乱数生成演算1を行ない、演算終了後、2番目の仮乱数演算を行なうことを記憶するため仮乱数処理中Flagの値をインクリメント(+1)する(図12:1202(1)−S1203−S1204)。以下同様に、仮乱数生成演算2(図12:1202(2)−S1205−S1206)、仮乱数生成演算3(図12:1202(3)−S1207)を行ない、仮乱数生成演算3終了後、仮乱数処理中Flagの値を初期化、即ち、仮乱数処理中Flagに1を代入し、仮乱数の生成を完了する(図12:S1208)。
【0127】
以上のように、仮乱数生成手段による仮乱数生成処理を複数の中断可能な演算に分割し、仮乱数中断Flag及び仮乱数処理中Flagに基づいて上記仮乱数の生成処理を中断・開始することで、仮乱数生成中にリーダライタからの初期応答リクエストが行なわれた場合でも、仮乱数の生成を途中で中断することにより、初期応答を行なうことができ、その後、仮乱数の生成を再開することができる。これにより、例えばプログラム起動時等の処理を軽減することができる。
【0128】
また、リーダライタから電力を供給されており、且つ他の処理を行なう必要がない即ち待ち時間には、常時仮乱数生成処理を行なうことも可能になる。
【0129】
尚、上記実施の形態1〜5に記載した技術であって、予め仮乱数を生成して不揮発性メモリに記憶しておくケースでは、当該非接触ICカード200を最初に使用した場合には、上記仮乱数が無い状態が起こりうる。また、初期応答リクエストまでに上記仮乱数を生成する場合であって、リーダライタの通信可能範囲に入った直後に上記初期応答リクエストを受信する場合もある。このような場合には、最初の初期応答リクエストに応答することができない。
【0130】
そこで、以下のような対応が考えられる。即ち、上述したような場合に対応するために予め上記ROM409又はRAM410内に、特定スロット番号保持手段を設け、当該特定スロット番号保持手段内に所定のスロット番号を記憶しておく。当該スロット番号は、何ら計算を必要としない値でよい。
【0131】
次に、上記仮乱数を生成中にリーダライタからの初期応答リクエストを受信した場合であって、仮乱数記憶手段505に有効な仮乱数が何ら記憶されていないと上記制御手段503が判断した場合、当該制御手段503は、上記特定スロット番号保持手段に格納されている値のスロットを用いて応答する。
【0132】
以上により、仮乱数記憶手段に有効な仮乱数が記憶されていない場合であっても初期応答リクエストに対して所定の時間内に応答を返すことが可能になる。尚、上記初期応答リクエストを受信した場合に上記仮乱数生成手段が仮乱数生成の処理を中断できるように、上記仮乱数中断Flag及び仮乱数処理中Flagを用いて仮乱数生成の処理を中断することが望ましい。
【0133】
またさらに、上記特定スロット番号保持手段に記憶する値を“1”とすることで、Slot1にて初期応答を行なうため、残りのスロット(例えばSlot2〜4)を仮乱数の計算に使用することが可能となる。このため、初回の初期応答リクエストにて他の非接触ICカードのレスポンス信号が衝突した場合であっても、2回目の初期応答リクエストに対して十分に応答できるだけの仮乱数生成時間を確保することが可能となる。
【0134】
尚、上述した実施の形態1〜5は、タイムスロット方式を採用した場合を仮定して説明を行ったが、前記スロットマーカ方式に対して適用することも可能である。
【発明の効果】
【0135】
以上のように、乱数の生成処理を分割し、リクエストを受信した後に乱数を生成するための演算の負荷を小さい演算とすることで、タイムスロットの時間的規定を満たす事が可能である。しかも、乱数の生成には、演算量の多大な、即ち良質の乱数を生成可能な処理を適用することが可能であるため、質の悪い乱数により生じる問題を解決することが可能となる。
【0136】
又、乱数発生用のハードウェアを用いることなく、ソフトウェアにて良質の乱数を得ることが可能となるため非接触ICカードのコストを下げることが可能となる。さらにハードウェアを用いることにより生じる設計、強度等の問題も発生しない。
【図面の簡単な説明】
【図1】 本発明の非接触ICカードの使用形態例を示す図
【図2】 非接触ICカードのリーダライタ及び非接触ICカードの通信状態を示すタイムチャート
【図3】 本実施の形態における初期応答リクエストのフォーマット図
【図4】 非接触ICカードの認識システムを構成するリーダライタ及び非接触ICカードの構成を示す図
【図5】 非接触ICカードの構成を示す機能ブロック図
【図6】 実施の形態1における非接触ICカードの実行する初期応答処理のフローチャート
【図7】 実施の形態2における非接触ICカードの実行する初期応答処理のフローチャート
【図8】 実施の形態3における非接触ICカードの実行する初期応答処理のフローチャート
【図9】 実施の形態4における非接触ICカードの実行する初期応答処理のフローチャート
【図10】 通信終了リクエストのフォーマット図
【図11】 実施の形態5における非接触ICカードの初期化の処理、及び割り込み処理のフローチャート
【図12】 実施の形態5における仮乱数生成処理処理のフローチャート
【符号の説明】
200 非接触ICカード
409 ROM
410 RAM
501 アンテナ手段
502 送受信手段
503 制御手段
504 仮乱数生成手段
505 仮乱数記憶手段
506 スロット数取得手段
507 乱数生成手段
520 自己応答タイミング判定手段
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to a non-contact IC card, a response method, and a program thereof, and more specifically, a non-contact IC card that responds to a request transmitted from a reader / writer using a value calculated based on a random number, and a response method And the program.
[0002]
[Prior art]
  Conventionally, a time slot method has been adopted for communication between a non-contact IC card that exchanges data using an electromagnetic induction method or the like and a reader / writer that recognizes the non-contact IC card. This is because when a plurality of non-contact IC cards are simultaneously present in the communicable area of the reader / writer and a plurality of non-contact IC cards respond simultaneously to polling from the reader / writer, each response signal used for the response This is because no contactless IC card can normally communicate with the reader / writer due to the collision.
[0003]
  The time slot communication method will be described below.
[0004]
  (1) First, the reader / writer transmits an initial response request command as a request to the non-contact IC card in order to confirm the presence of the non-contact IC card. The initial response request command includes a “slot number” or a value necessary for calculating the “slot number” necessary for controlling the timing of the initial response performed by the non-contact IC card.
[0005]
  (2) After receiving the initial response request command, the non-contact IC card returns the initial response to a time slot (1 to “slot number”) provided from a specific time. The time slot used for the response, that is, the timing, is determined by the non-contact IC card itself with a random number.
[0006]
  (3) When the reader / writer detects a collision of initial responses that occurs when a plurality of contactless IC cards select the same time slot, the reader / writer transmits the initial response request again. Here, normally, the number of time slots provided in the initial response request transmitted again is larger than the number of time slots provided in advance.
[0007]
  (4) The reader / writer recognizes all the non-contact IC cards by receiving the initial responses from all the non-contact IC cards normally, and completes the sequence for identifying the cards.
[0008]
  As such a system, a wireless identification device (Japanese Patent Laid-Open No. 9-6934) is disclosed.
[0009]
  As a method similar to the time slot method, there is a slot marker method. In the slot marker method, after the reader / writer transmits the initial response request in the time slot method, the reader / writer further transmits a slot marker command indicating the start of the slot at each slot start timing.
[0010]
[Problems to be solved by the invention]
  In the wireless identification device (Japanese Patent Laid-Open No. 9-6934), the delay time from when the identification card (non-contact IC card) is polled by the transmission / reception decoder (reader / writer) until the response signal (response) is transmitted is set. As described above, it is necessary to determine with a random number.
[0011]
  Here, when the random number is a bad random number, that is, a random number generated by a system that generates a biased random number when a random number is generated a plurality of times, the same random number is used with a plurality of contactless IC cards. It is often generated. For this reason, the above-mentioned initial response collision occurs frequently, and not only the end of the card identification sequence by the reader / writer is delayed, but the worst case is that the non-contact IC card continues to generate the same random number and the card identification sequence does not end. Have. Especially when the system is used in a system that requires the reader / writer to recognize the contactless IC card without stopping, such as a ticket gate of a train, the use of the system is hindered due to the delayed card identification. Will occur.
[0012]
  Therefore, it is necessary to avoid the use of bad random numbers and to use high-quality random numbers, that is, random numbers generated by a system that generates random numbers that are not biased when generating random numbers a plurality of times.
[0013]
  However, in order to obtain the above-mentioned good quality random numbers, it is necessary to perform a more complicated calculation than to obtain the above poor quality random numbers. For this reason, when generating the above-mentioned high-quality random numbers by software, it is necessary to use a CPU (Central Processing Unit) capable of high-speed processing, but a large amount of power is required to use the CPU capable of high-speed processing. Need. Here, in general, in an electromagnetic induction type power supply method such as a non-contact IC card, the power that can be used per unit time by the CPU is small, and sufficient power for generating high-quality random numbers cannot be supplied. . Therefore, if a calculation for obtaining a good random number with available power is performed, it takes a long time, and a problem arises that an initial response cannot be made because the time slot ends before the random number calculation ends.
[0014]
  In addition, the above-mentioned high-quality random numbers can be provided by hardware in a shorter time than by software. In this case, a special circuit is required only for generating random numbers. As a result, there is a problem that the apparatus becomes complicated and the cost becomes high. In particular, non-contact IC cards are limited in size and need some flexibility, so it can be said that the provision of random numbers by the hardware is a major obstacle.
[0015]
  An object of the present invention is to provide a non-contact IC card, a response method, and a program therefor that minimize the collision of initial responses by providing high-quality random numbers with a simple configuration.
[0016]
[Means for Solving the Problems]
  The present invention employs the following means in order to achieve the above object. That is, the present invention is premised on a non-contact IC card that responds to a request transmitted from a reader / writer using a random number. Here, the provisional random number generation means generates provisional random numbers obtained by a part of the operations used for generating random numbers before receiving a request from the reader / writer. By random number generatorIt is a response timing calculated using the number of slots included in the request and the temporary random number generated by the temporary random number generation means.A random number is generated.Further, the self-transmission timing determination means determines whether or not there is a predetermined time before the timing at which it should respond. The temporary random number generating means generates the temporary random number when the self-response timing determining means determines that there is a predetermined time before the response timing.
[0017]
  As aboveBy determining whether or not there is a predetermined time before the timing at which it should respond, it is possible to generate a temporary random number in a slot that is not related to itself and that is substantially a waiting time.
[0018]
  In addition, since it is possible to obtain high-quality random numbers with software without using hardware for generating random numbers, it is possible to reduce the cost of a non-contact IC card. Furthermore, problems such as design and strength caused by using hardware do not occur.
[0019]
  The operation for generating the temporary random number may be an operation not related to the request, and the operation for generating the random number may be an operation determined based on the request.
[0020]
  Further, in addition to the above configuration, there is a configuration in which the provisional random number storage means is provided and a response is made by sequentially using a plurality of provisional random numbers stored in response to a request from the reader / writer.
[0021]
  In this configuration, once generated temporary random numbers can be used sequentially again from the beginning, and even when requests are continuously received from the reader / writer, random numbers can be generated immediately. Can be performed.
[0022]
  Further, the temporary random number storage means is nonvolatile, and the temporary random number generation means generates the temporary random number at the end of communication processing and stores the temporary random number storage means in the nonvolatile temporary random number storage means. There is a configuration in which a random number is generated from a temporary random number stored in the nonvolatile temporary random number storage means when received.
[0023]
  In this configuration, after the contactless IC card has finished communicating with the reader / writer and is within the communicable range with the reader / writer, power can be supplied. Can be generated. Further, since the generated temporary random number is stored in the nonvolatile temporary random number storage means, it is possible to generate a high-quality random number immediately when the communication range with the reader / writer is entered next.
[0024]
  Furthermore, when a request from the reader / writer is received during generation of the temporary random number, a temporary random number interruption flag indicating that generation of the temporary random number is interrupted, and generation of the temporary random number is started after the response to the request is completed. There is a configuration in which a provisional random number processing flag indicating a power point is provided, and generation of provisional random numbers is suspended and started based on the provisional random number interruption flag and the provisional random number processing flag.
[0025]
  In this configuration, even when an initial response request from the reader / writer is made during temporary random number generation, the initial response can be made by interrupting the temporary random number generation halfway, and then the temporary random number generation is performed. You can resume. Thereby, for example, processing at the time of starting the program can be reduced.
[0026]
  Further, the specific slot number holding unit holds a predetermined value, and when the request is received during the generation of the temporary random number, the generation of the temporary random number is interrupted, and the value held by the specific slot number holding unit is changed. There is a configuration that uses and responds.
[0027]
  In this configuration, even if a temporary random number that is effective is not stored in the temporary random number storage unit, a response to the request can be returned within a predetermined time.
[0028]
DETAILED DESCRIPTION OF THE INVENTION
  Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings for understanding of the present invention. In addition, the following embodiment is an example which actualized this invention, Comprising: It is not the thing of the character which limits the technical scope of this invention.
[0029]
  First, the processing of a non-contact IC card when applied to the international standard ISO / IEC14443 of a proximity non-contact IC card will be briefly described with reference to FIGS.
[0030]
  ISO / IEC14443 can be applied to, for example, a non-contact telephone card. More specifically, as shown in FIG. 1, a case is assumed where non-contact IC cards 200 and 300 having a function as a telephone card are simultaneously inserted (adjacent) to a reader / writer 100 that functions as a public telephone.
[0031]
  In the ISO / IEC14443 contactless IC card recognition system, the contactless IC card is recognized by the following procedure.
[0032]
  First, the reader / writer 100, which is a public telephone, transmits an initial response request (request). The initial response request has the format shown in FIG. 3, and among the 8 bits in the PARAM 302 constituting the initial response request 301, the number of time slots (N) is set using a non-contact IC card by using 3 bits 303 of bit1 to bit3. Notify APf 304 is a header indicating an initial request command, and AFI 305 indicates an adaptation class of a non-contact IC card. A CRC (Cyclic Redundancy Check) 306 is a CRC from APf to PARAM.
[0033]
  The non-contact IC card responds with N slots 1 to N. In this explanation, the number of time slots (N) is assumed to be 4. That is, the non-contact IC cards 200 and 300 select one of the time slots 1 to 4 and make an initial response to the initial response request.
[0034]
  In the first card identification processing 201 shown in FIG. 2, first, the reader / writer 100 transmits an initial response request R1 [REQB] (202). When the non-contact IC cards 200 and 300 generate “1” as random numbers in response to the initial response request R1 (202), they respond with initial responses [ATQB] A21 and A31 in the time slot 1 (204), respectively. To do. In this case, the reader / writer 100 detects a collision of the non-contact IC card in order to respond with an initial response at the same timing of the non-contact IC cards 200 and 300. Therefore, the identification process is resumed.
[0035]
  In the second identification processing 207, an initial response request R2 (203) is transmitted from the reader / writer 100. When the contactless IC cards 200 and 300 generate “3” and “2” as random numbers in response to the initial response request, the packet A22 in the time slot 3 (205) and the time slot 2 (206) Reply with packet A32. In this case, since the reader / writer 100 does not detect a collision, all the non-contact IC cards can be identified, and the identification process is completed. The above is the card identification processing of the non-contact IC card in accordance with ISO / IEC14443. In ISO / IEC14443, the time when the contactless IC card responds in time slot 1 after receiving the initial response request command is defined as 302 μsec, and the period (time) of one time slot is 2266 μsec. The timing (μsec) from when the initial response request is received from the reader / writer 100 to when the initial response is transmitted is given by the following calculation formula (Formula 1).
[0036]
  Timing (μsec) = 302 μsec + 2266 μsec × (number of slots (N) −1): (Formula 1)
  (Embodiment 1)
  Hereinafter, a non-contact IC card system including the reader / writer 100 and a plurality of non-contact IC cards 200, 300,... According to the first embodiment of the present invention will be described. In addition, since the structure of the non-contact IC cards 200 and 300 is the same, the following description will be made mainly using the non-contact IC card 200.
[0037]
  FIG. 4A is a diagram illustrating a configuration of the reader / writer 100 according to the first embodiment. The reader / writer 100 includes an antenna 401, a transmission / reception circuit 402, a CPU 403, a ROM (Read Only Memory) 404 storing a program for controlling the reader / writer, and a RAM (Random Access Memory) used as a work area when executing the program. 405.
[0038]
  FIG. 4B is a functional block diagram showing the configuration of the non-contact IC card 200. The non-contact IC card 200 includes an antenna 406, a transmission / reception circuit 407, a CPU 408 that executes each program, a ROM 409 that stores a control program for processing commands from the reader / writer 100, and is used as, for example, a work area when the program is executed. The RAM 410 is configured. When the non-contact IC card 200 enters a communicable area such as the reader / writer 100, the non-contact IC card 200 operates with electric power induced by electromagnetic waves from the reader / writer 100. For this reason, as described above, a large amount of power cannot be supplied.
[0039]
  Next, FIG. 5 shows the non-contact IC card 200 in FIG. 4B as a functional block diagram. That is, the non-contact IC card 200 includes an antenna unit 501, a transmission / reception unit 502, a control unit 503, a temporary random number generation unit 504 for generating high-quality random numbers, a temporary random number storage unit 505 for storing temporary random numbers, and an initial received A slot number acquisition unit 506 that acquires the slot number from the request command, and a random number generation unit 507 that generates a random number from the temporary random number stored in the temporary random number storage unit 505 are provided. For example, the temporary random number generation unit 504, the slot number acquisition unit 506, and the random number generation unit 507 are stored in the ROM 409 shown in FIG. 4B, and are read and executed by the CPU 408 as necessary.
[0040]
  Next, processing of the non-contact IC card according to the first embodiment will be described with reference to FIG. FIG. 6 is a flowchart of communication processing executed by the non-contact IC card 200.
[0041]
  First, the temporary random number generation means 504 constituting the non-contact IC card 200 generates in advance a temporary random number (r) for generating a high-quality random number at a predetermined timing such as when a program is started (FIG. 6). : S601). Here, the provisional random number refers to a value obtained by calculating a predetermined number of steps among a plurality of steps required for generating a random number. For example, when the number of steps necessary for generating the random number is 100, the value derived in the preceding 90 steps of the necessary step is a temporary random number. In other words, an operation that is not related to the number of steps (N) (request) described later can be used as a provisional random number generation step. The time when the program is started is when power is induced from electromagnetic waves from the reader / writer 100 by entering a communicable area such as the reader / writer 100.
[0042]
  Note that it is preferable to use a method for obtaining a sufficiently high quality random number, and a specific example is shown in, for example, a random number generation method (Japanese Patent Application No. 11-177913). However, since the algorithm for generating a good random number is not directly related to the present invention, the details are omitted.
[0043]
  The temporary random number (r) generated by the temporary random number generation means 504 is stored in, for example, the temporary random number storage means 505 provided in the RAM 410 (FIG. 6: S602).
[0044]
  Next, it waits for an initial response request (request) to be transmitted from the reader / writer 100 (FIG. 6: S603 NO). When the antenna unit 501 receives an electromagnetic wave from the reader / writer 100 and the electromagnetic wave includes the initial response request, the initial response request is received by the control unit 503 by meeting the transmission / reception unit 502. . Subsequently, the control unit 503 transmits the initial response request to the slot number acquisition unit 506, and the slot number acquisition unit 506 acquires the slot number from the initial response request (FIG. 6: S603 YES-S604). The number of slots is specified by Bit 1 to Bit 3 of the PARAM 302 shown in FIG. 3, and is a value obtained by multiplying the numerical value 2 by the number of times specified by this bit. The formula for calculating the number of slots (Formula 2) is shown below.
[0045]
  Number of slots (N) = 2 ^ n: (Formula 2)
(N is a value from 0 to 4 represented by Bit1 to Bit3)
  The slot number (N) acquired (calculated) by the slot number acquisition unit 506 is transmitted to the control unit 503.
[0046]
  Subsequently, when the control unit 503 obtains the slot number (N), the temporary random number (r) stored in the temporary random number storage unit 505 is transmitted to the random number generation unit 507 together with the slot number (N).
[0047]
  The random number generation means 507 that receives the number of slots (N) and the provisional random number (r) generates a random number (real random number) (R) based on the two values (FIG. 6: S605). Here, the process of generating a random number from the temporary random number (r) executes the remaining steps other than the predetermined step processed at the time of generating the temporary random number, among the plurality of steps necessary for generating the random number ( Only the operation). Here, the remaining steps can be processed without knowing the number of slots (N), that is, the steps related to the number of slots (N) (request).
[0048]
  An example (Formula 3) of the calculation formula of the random number (R) is shown below.
[0049]
  Random number (R) = provisional random number (r)% number of slots (N) +1: (formula 3)
(% Is remainder calculation)
  As for the calculation formula (Formula 3), other arithmetic formulas may be used as long as they satisfy the definition of the response time of the time slot.
[0050]
  The random number generated by the random number generation unit 507 is transmitted to the control unit 503.
[0051]
  As described above, the non-contact IC card 200 can obtain a desired random number (1 to the number of slots (N)). Thereafter, using the timing (slot) based on the random number, an initial response is made to the reader / writer 100 (FIG. 6: S606). After the initial response is completed, the process returns to step S601 for generating the temporary random number (r) again, and a series of initial responses are completed.
[0052]
  As described above, by dividing the random number generation processing and calculating the random load (R) after receiving the initial response request, the time rule of the time slot in ISO / IEC14443 is reduced. It is possible to satisfy. In addition, since it is possible to apply a large amount of calculation, that is, a process capable of generating a high-quality random number, to generate a random number, it is possible to solve a problem caused by a poor-quality random number.
[0053]
  Even in a non-contact IC card that cannot supply sufficient power per unit time for generating high-quality random numbers, high-quality random numbers can be obtained by software without using hardware for generating random numbers. Therefore, the cost of the non-contact IC card can be reduced. Furthermore, problems such as design and strength caused by using hardware do not occur.
[0054]
  In the first embodiment, software is used for generating random numbers, but high-quality random numbers may be generated by hardware. Since hardware that can generate random numbers faster than software is used, it is possible to use a high-quality random number generation method that requires much more steps. In this case, the non-contact IC card 200 has a configuration in which a hardware circuit is applied to provisional random number generation means.
[0055]
  (Embodiment 2)
  Next, a second embodiment according to the present invention will be described. FIG. 7 is a flowchart of communication processing executed by the non-contact IC card 200 of claim 2.
[0056]
  In the contactless IC card in the first embodiment, when the initial response request is transmitted again from the reader / writer immediately after the response to the initial response request is completed, the contactless IC card is generating a temporary random number. In some cases, there is a problem that the initial response cannot be made. The second embodiment provides means for solving this problem. Note that the non-contact IC card in the second embodiment has substantially the same configuration as the non-contact IC card in the first embodiment, and therefore only the differences will be described.
[0057]
  First, the temporary random number generation means 504 constituting the non-contact IC card 200 generates a temporary random number (r (n)) at a predetermined timing such as when a program is started (FIG. 7: S701). Here, (r (n)) means the temporary random number generated n-th, and takes a value from 1 to the provisional random number generation specified number. The provisional random number prescribed number is a value that determines how many provisional random numbers are generated, and is given by, for example, a constant determined programmatically, a variable stored in the RAM 410 or the ROM 409, or the like.
[0058]
  In addition, the generation of temporary random numbers is the same as in the first embodiment using a method for obtaining high-quality random numbers.
[0059]
  The temporary random number (r (n)) generated by the temporary random number generation unit 504 is stored in the temporary random number storage unit 505 via the control unit 503 (FIG. 7: S702). At this time, the contactless IC card 200 according to the second embodiment includes a plurality of temporary random number storage means 505. For example, the generated temporary random number (r (n)) is the temporary random number storage means 505. It is assumed that (n) is stored.
[0060]
  After the temporary random number is stored in the temporary random number storage unit 505 (n), the control unit 503 checks the number of generations of the temporary random number using a random number generation counter (FIG. 7: S703). Here, the random number generation counter is a variable for storing the number of the generated temporary random number (r (n)) and is mounted on the RAM 410 of the non-contact IC card 200.
[0061]
  Here, if the provisional random number generation count does not reach the provisional random number generation prescribed number, the provisional random number generation unit 504 generates the provisional random number again based on an instruction from the control unit 503 (FIG. 7: S703NO). -S701).
[0062]
  When the provisional random number generation number reaches the provisional random number generation prescribed number, the random number use counter is initialized with 1 (FIG. 7: S703 YES-S704). Here, the random number use counter is a variable for storing a temporary random number (r (n)) number used in the next random number generation, and is mounted in the RAM 410 of the non-contact IC card 200.
[0063]
  Through the above processing, a plurality of temporary random numbers are generated and stored in the temporary random number storage means 505, respectively.
[0064]
  Next, the non-contact IC card 200 waits for an initial response request to be transmitted from the reader / writer 100 (FIG. 7: S705 NO). When the antenna unit 501 receives an electromagnetic wave from the reader / writer 100 and the electromagnetic wave includes the initial response request, the initial response request is received by the control unit 503 via the transmission / reception unit 502 and controlled. The means 503 transmits the initial response request to the slot number acquisition means 506, and the slot number acquisition means 506 acquires the slot number from the initial response request as in the first embodiment (FIG. 7: S705 YES-S706).
[0065]
  Subsequently, when the control unit 503 obtains the slot number (N), the temporary random number (r (n)) stored in the temporary random number storage unit 505 is transmitted to the random number generation unit together with the slot number (N). However, the temporary random number (r (n)) used here is a temporary random number based on the random number use counter, and is a temporary random number (r (1)) here.
[0066]
  The random number generation means 507 that has received the number of slots (N) and the provisional random number (r (1)) generates a random number (real random number) (R) based on the two values (FIG. 7: S708).
[0067]
  An example (Formula 4) of the calculation formula of the random number (R) is shown below.
[0068]
  Real random number (R) = provisional random number (r (n))% number of slots (N) +1: (formula 4)
(% Is the remainder calculation, n is the value of the temporary random number use counter)
  As the above calculation formula (Formula 4), other calculation formulas may be used as long as they satisfy the definition of the response time of the time slot.
[0069]
  As described above, the non-contact IC card 200 can obtain a desired random number (1 to the number of slots (N)). Thereafter, using the timing (slot) based on the random number, an initial response is made to the reader / writer 100 (FIG. 7: S709).
[0070]
  After completion of the initial response, the control means 503 increments (+1) the value of the random number use counter (FIG. 7: S710).
[0071]
  Here, when the value of the random number use counter does not reach the specified number of random number generations, it waits for the initial response request to be transmitted again from the reader / writer 100 (FIG. 7: S711 NO-S705).
[0072]
  When the value of the random number use counter reaches the specified random number generation number, the random number use counter is initialized to 1, and the process returns to step S504 waiting for the initial response request again (FIG. 7: S711 YES-S712-S705).
[0073]
  With the above operation, once generated temporary random numbers can be used again sequentially from the beginning, and random numbers can be generated immediately even when initial response requests from the reader / writer 100 continue, so always use good quality random numbers. Thus, an initial response can be performed.
[0074]
  (Embodiment 3)
  Next, a third embodiment according to the present invention will be described.
[0075]
  FIG. 8 is a flowchart of communication processing executed by the non-contact IC card 200 in the third embodiment.
[0076]
  In the contactless IC card in the first embodiment, when the initial response request is transmitted again from the reader / writer immediately after the response to the initial response request is completed, the contactless IC card is generating a temporary random number. In some cases, there is a problem that the initial response cannot be made as described above. Further, in the second embodiment, there is a problem that a processing time for generating a plurality of temporary random numbers is required and it takes a long time to accept an initial response request. In the third embodiment, in order to solve this problem, a self-response timing determination unit 520 is further provided. The non-contact IC card according to the third embodiment has substantially the same configuration as the non-contact IC card according to the first and second embodiments, and therefore only different points will be described.
[0077]
  First, the temporary random number generation means 504 constituting the non-contact IC card 200 generates a temporary random number (r) at a predetermined timing such as when a program is started (FIG. 8: S801).
[0078]
  The temporary random number (r) generated by the temporary random number generation unit 504 is stored in the temporary random number storage unit 505 (FIG. 8: S802).
[0079]
  Next, it waits for the initial response request to be transmitted from the reader / writer 100 (FIG. 8: S803 NO).
[0080]
  When the initial response request is received, the slot number acquisition unit 506 acquires the slot number from the initial response request (FIG. 8: S803 YES-S804).
[0081]
  Next, the random number generation means 507 generates a random number (R) from the number of slots (N) and the temporary random number (r) stored in the temporary random number storage means (FIG. 8: S805).
[0082]
  As described above, the non-contact IC card 200 can obtain a desired random number (1 to the number of slots (N)). The above processing is almost the same as in the first embodiment.
[0083]
  Subsequently, the non-contact IC card 200 determines the response timing (slot) by the self-response timing determination means 520. That is, the self-response timing determination unit 520 calculates the timing at which the non-contact IC card 200 should respond based on the time when the initial response request is received and the generated random number (R), and the non-contact IC It is determined whether or not there is sufficient time (predetermined time) until the timing at which the card 200 should respond (FIG. 8: S806). The sufficient time is a time required for generating and storing the temporary random number.
[0084]
  Here, when it is determined that there is sufficient time in the above determination, the control unit 503 instructs the temporary random number generation unit 504 to generate the temporary random number (r), and the generated temporary random number is temporarily stored. It memorize | stores in the random-number memory | storage means 505 (FIG. 8: S806NO-S807-S808).
[0085]
  If it is determined in the above determination that there is not enough time, the control means 503 makes an initial response using the slot based on the generated random number (R) (FIG. 8: S806 YES-S809).
[0086]
  After completion of the initial response or generation of the temporary random number, the control unit 503 determines whether the time slot period has ended. Here, the time slot period is a period from the start of the first time slot to the end of the last time slot, which is determined by the number of slots given from the reader / writer 100.
[0087]
  If it is within the time slot period, the determination by the self-response timing determination means 520 is repeated (FIG. 8: S810 YES-S806).
[0088]
  If it is not within the time slot period, the process returns to the initial response request wait process to prepare for the initial response request (FIG. 8: S810 NO-S803).
[0089]
  As described above, by determining whether or not there is a predetermined time before the timing at which it should respond, it is possible to generate a temporary random number in a slot that is substantially unrelated to the waiting time. It becomes possible.
[0090]
  Further, by using a non-volatile memory as the temporary random number storage means, for example, even when there is no time for generating temporary random numbers from the time of starting the program until the initial response request request is received, Since provisional random numbers are prepared, it is possible to respond using high-quality random numbers.
[0091]
  Needless to say, the technique according to the third embodiment can also be applied to the case where a plurality of provisional random number storage means are provided according to the second embodiment.
[0092]
  (Embodiment 4)
  Next, a fourth embodiment according to the present invention will be described.
[0093]
  FIG. 9 is a flowchart of communication processing executed by the non-contact IC card 200 in the fourth embodiment.
[0094]
  In the contactless IC card in the first embodiment, when the initial response request is transmitted again from the reader / writer immediately after the response to the initial response request is completed, the contactless IC card is generating a temporary random number. In some cases, there is a problem that the initial response cannot be made as described above. Further, in the second embodiment, there is a problem that a processing time for generating a plurality of temporary random numbers is required and it takes time to receive an initial response request. In the fourth embodiment, in order to solve this problem, provisional random number storage means 505 configured by a nonvolatile memory is provided. Note that the non-contact IC card in the fourth embodiment has substantially the same configuration as the non-contact IC card in the first, second, and third embodiments, and therefore only different points will be described.
[0095]
  First, the control means 503 initializes the random number use counter to 1 (FIG. 9: S901).
[0096]
  Next, when an initial response request is received, the slot number calculating means 508 acquires the number of slots from the initial response request (FIG. 9: S902 YES-S903).
[0097]
  Subsequently, the control means 503 takes out the random number use counter-th provisional random number (r (n)) stored in the nonvolatile provisional random number storage means 505, and the random number generation means 507 outputs the provisional random number (r (n)). Then, a random number (R) is generated from the number of slots (N) (FIG. 9: S904-S905). The procedure for storing the temporary random number (r (n)) will be described later.
[0098]
  As described above, the non-contact IC card 200 can obtain a desired random number (1 to the number of slots (N)). Thereafter, an initial response is made to the reader / writer 100 using the timing (slot) based on the random number (FIG. 9: S906).
[0099]
  After completion of the initial response, the control means 503 increments (+1) the value of the random number use counter (FIG. 9: S907).
[0100]
  Here, when the value of the random number use counter is equal to or less than the predetermined number of times of random number generation, it waits for receiving the initial response request again (FIG. 9: S908 NO-S902).
[0101]
  When the value of the random number use counter reaches the specified number of random number generations, the random number use counter is initialized to 1 and waits for receiving an initial response request again (FIG. 9: S908 YES-S909-S902).
[0102]
  The processing described above is the same as the processing of S704 to S702 in the second embodiment.
[0103]
  When the control unit 503 does not receive the initial response request after initializing the random number use counter to 1, it determines whether the communication end request 1001 has been received (FIG. 9: S902 NO-S910). Here, the communication end request 1001 is information transmitted from the reader / writer 100 at the end of communication between the reader / writer 100 and the non-contact IC card 200 having the format shown in FIG. The communication end request 1001 has fields of S-BLOCK 1002, CID (card ID) 1003, and CRC 1004. The S-BLOCK 1002 includes a system command (communication end), and CID 1003 includes the contactless IC card. The card ID of 200 is stored in the CRC 1004, and the CRC of the S-BLOCK 1002 and the CID 1003 is stored.
[0104]
  Here, when the communication end request is not received from the reader / writer 100, an initial response request (or other request: not shown in FIG. 9) is waited for (FIG. 9: S910 NO-S902).
[0105]
  However, when a communication end request is received, the temporary random number generation means 504 generates the temporary random number (r (n)) to indicate that the communication between the reader / writer 100 and the non-contact IC card 200 has ended. (FIG. 9: S911). Here, “n” indicates the n-th provisional random number generation number, and the value from 1 to the provisional random number generation specified number is the same as in the second embodiment. The temporary random number (r (n)) generated by the temporary random number generation unit 504 is stored in the nonvolatile temporary random number storage unit 505 (FIG. 9: S912).
[0106]
  Next, the control means 503 determines whether or not the number of provisional random number generations has reached the provisional random number generation prescribed number.
[0107]
  If the number of generations of temporary random numbers does not reach the provisional random number generation specified number, temporary random numbers are generated again by the temporary random number generation means 504 (FIG. 9: S913 NO-S911).
[0108]
  When the provisional random number generation count reaches the provisional random number generation prescribed count, the system is stopped (the process is terminated).
[0109]
  As described above, if the contactless IC card has finished communication with the reader / writer and is within the communicable range with the reader / writer, power can be supplied. A random number can be generated. Further, since the generated temporary random number is stored in the non-volatile storage means, it is possible to generate a high-quality random number immediately when the communication range with the reader / writer is entered next. Therefore, for example, processing at the time of starting the program can be reduced. Thereby, it is possible to further shorten the time until the initial response request is waited.
[0110]
  (Embodiment 5)
  Next, a fifth embodiment according to the present invention will be described.
[0111]
  Here, FIG. 11A shows processing at the time of initialization of the non-contact IC card 200, FIG. 11B shows processing at the time of interruption of the non-contact IC card 200, and FIG. 12 shows temporary random number generation processing.
[0112]
  The non-contact IC card according to the fifth embodiment performs the same processing as in the first to fourth embodiments with respect to the initial response method, but here, the provisional random number generation can be interrupted. In other words, by combining the technique shown in the fifth embodiment with the first to fourth embodiments, it is possible to freely interrupt and start the provisional random number generation.
[0113]
  First, the control means 503 performs initialization processing of the non-contact IC card 200 at a predetermined timing such as when a program is started. The initialization process is a process of setting “1” to the temporary random number processing flag, and a process of setting “0” to the temporary random number interruption flag (FIG. 11A: S1101 to S1102).
[0114]
  The temporary random number processing flag is a variable indicating a state in which a temporary random number is being generated, and indicates a state of a generation process of three generation generation operations (generation operation 1, generation operation 2, and generation operation 3). That is, when the temporary random number processing flag is 1, the generation operation 1 is performed, when the temporary random number processing flag is 2, the generation operation 2 is performed, and when the temporary random number processing flag is 3, the generation operation 3 is performed. The generation operations 1 to 3 are obtained by dividing the process necessary for generating the temporary random number (r) into three processes that can be interrupted. But you can.
[0115]
  The temporary random number interruption flag is a variable that is changed by an interruption to the control unit 503. When it is “0”, it is not necessary to interrupt generation of the temporary random number, and when it is other than “0”. , Indicates that the generation of temporary random numbers needs to be interrupted. Both the temporary random number processing flag and the temporary random number interruption flag are provided in the RAM 505 of the non-contact IC card 200.
[0116]
  The above is the preparation necessary for interrupting the temporary random number generation process.
[0117]
  Subsequently, when a request (command) is transmitted from the reader / writer, the control means 503 determines the content of the request (command) (FIG. 11 (b): S1110). Normally, the request is transmitted at any time, so that it is processed by an interrupt process.
[0118]
  If the request (command) is an initial response request, the control means 503 sets 1 to the temporary random number interruption Flag (FIG. 11 (b): S1110YES-S1111).
[0119]
  If the request (command) is not an initial response request, 0 is set to the temporary random number interruption Flag (FIG. 11 (b): S1110NO-S1112).
[0120]
  The above is the processing performed when an interrupt occurs.
[0121]
  Next, for example, a process at the time of temporary random number generation by the temporary random number generation unit 504 in the first to fourth embodiments will be described.
[0122]
  First, when the provisional random number is generated by the provisional random number generation means 504, it is determined by the provisional random number interruption Flag whether the process is to be interrupted (FIG. 12: S1201).
[0123]
  Here, when the temporary random number interruption Flag is “1”, the temporary random number generation process is interrupted because it is a process after receiving the initial response request (FIG. 12: 1201 YES—provisional random number generation end).
[0124]
  Here, when the temporary random number interruption Flag is “0”, the initial response request is not received, and the temporary random number generation unit 504 performs a temporary random number generation process (FIG. 12: 1201 NO-S1202).
[0125]
  Next, the operation of the temporary random number generation process is divided into three operations, and the control unit 503 determines which of the three operations is performed based on the temporary random number processing flag (FIG. 12: 1202). ).
[0126]
  Here, when the temporary random number processing flag is “1”, the value of the temporary random number processing flag is stored in order to store that the first temporary random number generation calculation 1 is performed and the second temporary random number calculation is performed after the calculation is completed. Is incremented (+1) (FIG. 12: 1202 (1) -S1203-S1204). Similarly, provisional random number generation calculation 2 (FIG. 12: 1202 (2) -S1205-S1206) and provisional random number generation calculation 3 (FIG. 12: 1202 (3) -S1207) are performed. The value of the flag during temporary random number processing is initialized, that is, 1 is substituted into the flag during temporary random number processing to complete generation of the temporary random number (FIG. 12: S1208).
[0127]
  As described above, the provisional random number generation processing by the provisional random number generation means is divided into a plurality of interruptable operations, and the provisional random number generation processing is interrupted and started based on the provisional random number interruption flag and the provisional random number processing flag. Thus, even when an initial response request from the reader / writer is made during temporary random number generation, the initial response can be made by interrupting the temporary random number generation, and then the temporary random number generation is resumed. be able to. Thereby, for example, processing at the time of starting the program can be reduced.
[0128]
  In addition, it is possible to always perform provisional random number generation processing during waiting time when power is supplied from the reader / writer and no other processing is required.
[0129]
  In the case of the technology described in the first to fifth embodiments, in the case where a temporary random number is generated in advance and stored in the nonvolatile memory, when the contactless IC card 200 is used for the first time, A state without the provisional random number may occur. Further, the temporary random number may be generated before the initial response request, and the initial response request may be received immediately after entering the communicable range of the reader / writer. In such a case, it is not possible to respond to the initial initial response request.
[0130]
  Therefore, the following measures can be considered. That is, in order to cope with the above-described case, specific slot number holding means is provided in the ROM 409 or RAM 410 in advance, and a predetermined slot number is stored in the specific slot number holding means. The slot number may be a value that does not require any calculation.
[0131]
  Next, when the initial response request from the reader / writer is received while the temporary random number is being generated, and the control unit 503 determines that no temporary temporary random number is stored in the temporary random number storage unit 505 The control unit 503 responds by using the value slot stored in the specific slot number holding unit.
[0132]
  As described above, it is possible to return a response to the initial response request within a predetermined time even when a valid temporary random number is not stored in the temporary random number storage means. The temporary random number generation process is interrupted using the temporary random number interruption flag and the temporary random number processing flag so that the temporary random number generation means can interrupt the temporary random number generation process when the initial response request is received. It is desirable.
[0133]
  Furthermore, by setting the value stored in the specific slot number holding means to “1”, an initial response is made at Slot 1, so that the remaining slots (for example, Slots 2 to 4) can be used for calculating temporary random numbers. It becomes possible. For this reason, even if the response signal of another non-contact IC card collides in the initial initial response request, a provisional random number generation time that can sufficiently respond to the second initial response request is secured. Is possible.
[0134]
  In addition, although Embodiment 1-5 mentioned above demonstrated the case where the time slot system was employ | adopted, it is also possible to apply with respect to the said slot marker system.
【The invention's effect】
[0135]
  As described above, by dividing the random number generation process and reducing the calculation load for generating the random number after receiving the request, it is possible to satisfy the time rule of the time slot. Moreover, since it is possible to apply a large amount of computation, that is, a process capable of generating a high-quality random number, to generate a random number, it is possible to solve a problem caused by a poor-quality random number.
[0136]
  In addition, since it is possible to obtain high-quality random numbers with software without using hardware for generating random numbers, it is possible to reduce the cost of a non-contact IC card. Furthermore, problems such as design and strength caused by using hardware do not occur.
[Brief description of the drawings]
FIG. 1 is a diagram showing a usage example of a non-contact IC card according to the present invention.
FIG. 2 is a time chart showing a communication state of a non-contact IC card reader / writer and a non-contact IC card.
FIG. 3 is a format diagram of an initial response request in the present embodiment.
FIG. 4 is a diagram showing a configuration of a reader / writer and a non-contact IC card constituting a non-contact IC card recognition system.
FIG. 5 is a functional block diagram showing the configuration of a contactless IC card.
FIG. 6 is a flowchart of initial response processing executed by the non-contact IC card in the first embodiment.
FIG. 7 is a flowchart of initial response processing executed by the non-contact IC card according to the second embodiment.
FIG. 8 is a flowchart of initial response processing executed by the non-contact IC card in the third embodiment.
FIG. 9 is a flowchart of initial response processing executed by the non-contact IC card in the fourth embodiment.
FIG. 10 is a format diagram of a communication end request.
FIG. 11 is a flowchart of initialization processing and interrupt processing of a non-contact IC card in the fifth embodiment
FIG. 12 is a flowchart of temporary random number generation processing according to the fifth embodiment.
[Explanation of symbols]
  200 Contactless IC card
  409 ROM
  410 RAM
  501 Antenna means
  502 Transmission / reception means
  503 control means
  504 Provisional random number generation means
  505 provisional random number storage means
  506 Slot number acquisition means
  507 Random number generation means
  520 Self-response timing determination means

Claims (9)

リーダライタより送信されるリクエストに対して乱数を用いて応答する非接触ICカードにおいて、
上記リーダライタよりリクエストを受信する前に乱数の発生に用いる演算のうち一部の演算によって得られる仮乱数を生成する仮乱数生成手段と、
上記リーダライタより上記リクエストを受信した際に、上記リクエストに含まれるスロット数と、上記仮乱数生成手段により生成された仮乱数とを用いて算出される応答タイミングである乱数を生成する乱数生成手段と
自らが応答すべきタイミングまでに所定の時間があるか否かを判定する自己送信タイミング判定手段とを備え、
上記仮乱数生成手段は、上記自己応答タイミング判定手段により、応答タイミングまでに所定の時間があると判定された場合に上記仮乱数を生成する非接触ICカード。
In a non-contact IC card that responds to a request transmitted from a reader / writer using a random number,
Provisional random number generation means for generating provisional random numbers obtained by a part of operations used for generating random numbers before receiving a request from the reader / writer;
When receiving the request from the reader / writer , random number generation means for generating a random number which is a response timing calculated using the number of slots included in the request and the temporary random number generated by the temporary random number generation means and,
Self-transmission timing determination means for determining whether or not there is a predetermined time until the timing at which the user should respond,
The temporary random number generation means is a non-contact IC card that generates the temporary random number when the self-response timing determination means determines that there is a predetermined time before the response timing .
上記仮乱数の生成のための演算は、上記リクエストに関連しない演算であると共に、
上記乱数の生成のための演算は、上記リクエストに基づいて決定される演算である請求項1に記載の非接触ICカード。
The operation for generating the temporary random number is an operation not related to the request,
The contactless IC card according to claim 1, wherein the calculation for generating the random number is a calculation determined based on the request.
さらに上記仮乱数生成手段により生成された仮乱数を記憶する複数の仮乱数記憶手段を備え、
上記リーダライタからのリクエストに対して記憶した複数の仮乱数を順次用いて上記応答を行う請求項に記載の非接触ICカード。
And a plurality of provisional random number storage means for storing provisional random numbers generated by the provisional random number generation means,
The contactless IC card according to claim 1 , wherein the response is performed by sequentially using a plurality of temporary random numbers stored in response to a request from the reader / writer.
さらに不揮発性である上記仮乱数記憶手段を備え、
上記仮乱数生成手段は、通信終了時に上記仮乱数を生成して上記不揮発性の仮乱数記憶手段に記憶し、
上記乱数生成手段は、上記リクエストを受信した際に上記不揮発性の仮乱数記憶手段に記憶された仮乱数から乱数を生成する請求項に記載の非接触ICカード。
Furthermore, the provisional random number storage means is nonvolatile,
The temporary random number generation means generates the temporary random number at the end of communication and stores it in the nonvolatile temporary random number storage means,
The contactless IC card according to claim 1 , wherein the random number generation unit generates a random number from a temporary random number stored in the nonvolatile temporary random number storage unit when the request is received.
さらに仮乱数の生成中に上記リーダライタからのリクエストを受信した際に当該仮乱数の生成を中断することを示す仮乱数中断フラグと、
上記リクエストに対する応答が終了した後に上記仮乱数の生成を開始すべき箇所を示す仮乱数処理中フラグを備え、
上記仮乱数中断フラグ及び仮乱数処理中フラグに基づいて、仮乱数の生成の中断・開始を行う請求項に記載の非接触ICカード。
Furthermore, a temporary random number interruption flag indicating that generation of the temporary random number is interrupted when a request from the reader / writer is received during generation of the temporary random number;
A provisional random number processing flag indicating a position where generation of the provisional random number should start after the response to the request is completed,
The temporary random number based on the interruption flag and the temporary random number processing flag, the non-contact IC card according to claim 1 for suspension and start of the creation of the temporary random numbers.
さらに所定の値を保持する特定スロット番号保持手段を備え、
上記仮乱数の生成中に上記リクエストを受信した際に、当該仮乱数の生成を中断し、上記特定スロット番号保持手段が保持している値を用いて応答する請求項に記載の非接触ICカード。
Furthermore, a specific slot number holding means for holding a predetermined value is provided,
6. The contactless IC according to claim 5 , wherein when the request is received during the generation of the temporary random number, the generation of the temporary random number is interrupted and a response is made using the value held by the specific slot number holding means. card.
リーダライタより送信されるリクエストに対して乱数を用いて応答する非接触ICカードの応答方法であって、
上記リーダライタよりリクエストを受信する前に乱数の発生に用いる演算のうち一部の演算によって得られる仮乱数を生成する仮乱数生成ステップと、
上記リーダライタより上記リクエストを受信した際に、上記リクエストに含まれるスロット数と、上記仮乱数生成手段により生成された仮乱数とを用いて算出される応答タイミングである乱数を生成する乱数生成ステップと
自らが応答すべきタイミングまでに所定の時間があるか否かを判定する自己送信タイミング判定ステップとを備え、
上記仮乱数生成ステップは、上記自己応答タイミング判定ステップにより、応答タイミングまでに所定の時間があると判定された場合に上記仮乱数を生成する非接触ICカードの応答方法。
A non-contact IC card response method for responding to a request transmitted from a reader / writer using a random number,
A provisional random number generation step for generating a provisional random number obtained by a part of the operations used to generate a random number before receiving a request from the reader / writer;
A random number generation step of generating a random number which is a response timing calculated using the number of slots included in the request and the temporary random number generated by the temporary random number generation means when the request is received from the reader / writer and,
A self-transmission timing determination step for determining whether or not there is a predetermined time until a timing at which the user should respond,
The temporary random number generation step is a non-contact IC card response method that generates the temporary random number when it is determined by the self-response timing determination step that there is a predetermined time before the response timing .
リーダライタより送信されるリクエストに対して乱数を用いて応答する非接触ICカードに、
上記リーダライタよりリクエストを受信する前に乱数の発生に用いる演算のうち一部の演算によって得られる仮乱数を生成する仮乱数生成ステップと、
上記リーダライタより上記リクエストを受信した際に、上記リクエストに含まれるスロット数と、上記仮乱数生成手段により生成された仮乱数とを用いて算出される応答タイミングである乱数を生成する乱数生成ステップと
自らが応答すべきタイミングまでに所定の時間があるか否かを判定する自己送信タイミング判定ステップとを備え、
上記仮乱数生成ステップは、上記自己応答タイミング判定ステップにより、応答タイミングまでに所定の時間があると判定された場合に上記仮乱数を生成するように実行させることを特徴とするプログラム。
To a non-contact IC card that responds using a random number to the request sent from the reader / writer,
A provisional random number generation step for generating a provisional random number obtained by a part of the operations used to generate a random number before receiving a request from the reader / writer;
A random number generation step of generating a random number which is a response timing calculated using the number of slots included in the request and the temporary random number generated by the temporary random number generation means when the request is received from the reader / writer and,
A self-transmission timing determination step for determining whether or not there is a predetermined time until a timing at which the user should respond,
The temporary random number generation step is executed to generate the temporary random number when it is determined by the self-response timing determination step that there is a predetermined time before the response timing .
リーダライタより送信されるリクエストに対して乱数を用いて応答する非接触ICカードに、
上記リーダライタよりリクエストを受信する前に乱数の発生に用いる演算のうち一部の演算によって得られる仮乱数を生成する仮乱数生成ステップと、
上記リーダライタより上記リクエストを受信した際に、上記リクエストに含まれるスロット数と、上記仮乱数生成手段により生成された仮乱数とを用いて算出される応答タイミングである乱数を生成する乱数生成ステップと
自らが応答すべきタイミングまでに所定の時間があるか否かを判定する自己送信タイミング判定ステップとを備え、
上記仮乱数生成ステップは、上記自己応答タイミング判定ステップにより、応答タイミングまでに所定の時間があると判定された場合に上記仮乱数を生成するように実行させるプログラムを記憶したコンピュータ読み取り可能な記録媒体。
To a non-contact IC card that responds using a random number to the request sent from the reader / writer,
A provisional random number generation step for generating a provisional random number obtained by a part of the operations used to generate a random number before receiving a request from the reader / writer;
A random number generation step of generating a random number which is a response timing calculated using the number of slots included in the request and the temporary random number generated by the temporary random number generation means when the request is received from the reader / writer and,
A self-transmission timing determination step for determining whether or not there is a predetermined time until a timing at which the user should respond,
The temporary random number generation step stores a computer-readable recording medium storing a program executed to generate the temporary random number when it is determined by the self-response timing determination step that there is a predetermined time until the response timing .
JP2001307109A 2000-10-13 2001-10-03 Non-contact IC card, response method, and program thereof Expired - Lifetime JP3901976B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001307109A JP3901976B2 (en) 2000-10-13 2001-10-03 Non-contact IC card, response method, and program thereof

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2000313150 2000-10-13
JP2000-313150 2000-10-13
JP2001307109A JP3901976B2 (en) 2000-10-13 2001-10-03 Non-contact IC card, response method, and program thereof

Publications (2)

Publication Number Publication Date
JP2002203219A JP2002203219A (en) 2002-07-19
JP3901976B2 true JP3901976B2 (en) 2007-04-04

Family

ID=26602030

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001307109A Expired - Lifetime JP3901976B2 (en) 2000-10-13 2001-10-03 Non-contact IC card, response method, and program thereof

Country Status (1)

Country Link
JP (1) JP3901976B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1873683A3 (en) * 2002-09-11 2008-06-25 Nxp B.V. Method of reading a plurality of non-contact data carriers, including an anti-collision scheme
KR20050074948A (en) * 2002-11-19 2005-07-19 마쯔시다덴기산교 가부시키가이샤 Contactless ic card
KR100795577B1 (en) 2006-03-23 2008-01-21 주식회사 케이티 Electronic tag recognition device and method, and data processing method of electronic tag
JP2010061695A (en) * 2009-12-16 2010-03-18 Toshiba Corp Information processor
JP5726700B2 (en) * 2011-09-30 2015-06-03 株式会社東芝 IC card and IC card processing method

Also Published As

Publication number Publication date
JP2002203219A (en) 2002-07-19

Similar Documents

Publication Publication Date Title
EP1197909B1 (en) Contactless ic card, responding method, and program therefor
JP2004046824A (en) Collision prevention method for non-contact electronic module and non-contact electronic module
US6923380B2 (en) Contactless IC card, responding method, and program therefor
US9413427B2 (en) Emulation of multiple devices in an NFC device
CN101753267A (en) Communication device, communication method, computer program and computer system
EP2958056B1 (en) Radiofrequency transponder circuit
US10085268B2 (en) Communications device and communications system
JP3901976B2 (en) Non-contact IC card, response method, and program thereof
EP1563445B1 (en) Contactless ic card
KR100562505B1 (en) Integrated circuit card that can automatically transmit null byte information without intervention from the central processing unit
EP2717193B1 (en) IC card, portable electronic device, and reader/ writer
JP2006073034A (en) IC card reader / writer, identification method, program, and recording medium therefor
CN104994463B (en) A kind of NFC intelligent identifying systems
JPWO2011002030A1 (en) Portable electronic device and method for controlling portable electronic device
JP4134143B2 (en) Non-contact IC card, response method, and program thereof
JPH06111085A (en) Noncontact storage medium
JP2543861B2 (en) Data transmission method
CN114742084A (en) Anti-collision method for contactless communication, radio frequency identification card and card reader
JP2002366906A (en) Non-contact communication method for portable information processing device
JP2000209121A (en) Mobile object identification device
CN117687946A (en) Communication method and device of integrated circuit card, electronic equipment and storage medium
CN119690896A (en) Method and system for SPI data transmission, slave device, and master device
Arjona et al. Hardware based analysis of RFID anti-collision protocols based on the standard EPCglobal Class-1 Generation-2
JP2000155813A (en) Non-contact ic card/reader
JP2000148931A (en) Improvement of card identifying method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040706

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060418

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060425

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060623

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060929

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061128

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20061205

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061227

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061227

R150 Certificate of patent or registration of utility model

Ref document number: 3901976

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110112

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110112

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120112

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130112

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20130112

Year of fee payment: 6