JP3913128B2 - Memory card - Google Patents

Memory card Download PDF

Info

Publication number
JP3913128B2
JP3913128B2 JP2002194193A JP2002194193A JP3913128B2 JP 3913128 B2 JP3913128 B2 JP 3913128B2 JP 2002194193 A JP2002194193 A JP 2002194193A JP 2002194193 A JP2002194193 A JP 2002194193A JP 3913128 B2 JP3913128 B2 JP 3913128B2
Authority
JP
Japan
Prior art keywords
memory
nonvolatile memory
stored
rewritten
memory card
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002194193A
Other languages
Japanese (ja)
Other versions
JP2003323597A (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 JP2002194193A priority Critical patent/JP3913128B2/en
Publication of JP2003323597A publication Critical patent/JP2003323597A/en
Application granted granted Critical
Publication of JP3913128B2 publication Critical patent/JP3913128B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Description

【0001】
【発明の属する技術分野】
この発明はメモリカードに関し、さらに詳しくは、プログラムデータをダウンロードして不揮発性メモリに格納するメモリカードに関する。
【0002】
【従来の技術および発明が解決しようとする課題】
デジタルカメラ・PDA・携帯型オーディオ・携帯電話・パソコンなどのデジタル機器での情報の書き込み/読み出しにメモリカードが利用されている。メモリカードにはフラッシュメモリとコントローラの2つのチップが搭載されている。近年、メモリカードに搭載されるフラッシュメモリは大容量化しつつあり、これに応じて大規模なデータをフラッシュメモリに格納できるようになりつつある。ところが現状では、メモリカードはデジタル機器とデータのやりとりをするだけである。なお、ICカードにはアプリケーションプログラムをダウンロードして実行可能なものが存在する。しかし、プログラム格納用の不揮発性メモリの容量は、メモリカードに搭載されるフラッシュメモリの容量に比べて非常に小さい。
【0003】
この発明の目的は、回路規模を小さくすることができるメモリカードを提供することである。
【0004】
【課題を解決するための手段および発明の効果】
この発明によるメモリカードは、第1の不揮発性メモリと、第2の不揮発性メモリと、分離部とを備える。第1の不揮発性メモリは所定の消去単位を有する。第2の不揮発性メモリは、第1の不揮発性メモリの消去単位よりも大きい消去単位を有する。分離部は、メモリカードにダウンロードされたプログラムデータのうち少なくとも書き換えが発生する可能性がある部分を分離し、分離した部分を第1の不揮発性メモリへ格納し、残りの部分を第2の不揮発性メモリへ格納する。
【0005】
上記メモリカードでは、ダウンロードしたプログラムの実行処理において、プログラム中のデータの書き換え処理は第2の不揮発性メモリにおいては発生せず第1の不揮発性メモリにおいてのみ発生する。このように、消去単位の小さい第1の不揮発性メモリにおいて変数などの書き換え処理を行うことにより、消去単位の大きい第2の不揮発性メモリにおいて処理を行う場合に比べて、必要なバッファサイズが小さくてよく、回路規模を小さくできる。
【0006】
また、書き換えのために一時的にバッファリングするデータのサイズは第2の不揮発性メモリよりも第1の不揮発性メモリのほうが小さい。したがって、第2の不揮発性メモリにおいて書き換え処理を行う場合に比べて書き換えのためのバッファリング処理時間が少なくてすみ、書き換えに必要な処理時間を少なくできる。
【0007】
また、ダウンロードしたプログラムデータを第1の不揮発性メモリと第2の不揮発性メモリとに分離して格納しているためセキュリティ性が向上する。
【0008】
好ましくは、上記プログラムデータは、関数と変数とから構成される。上記分離部は、上記関数を第2の不揮発性メモリへ格納し、上記変数のうち書き換えが発生する可能性のあるものを第1の不揮発性メモリに格納し、上記変数のうち書き換えが発生する可能性がないものを第2の不揮発性メモリへ格納する。
【0009】
好ましくは、上記プログラムデータは、オブジェクト指向プログラミング言語で記述されたクラスである。上記分離部は、上記クラスの変数を第1の不揮発性メモリへ格納し、上記クラスのメソッドを第2の不揮発性メモリへ格納する。
【0010】
好ましくは、上記プログラムデータは、オブジェクト指向プログラミング言語で記述されたクラスである。上記分離部は、上記クラスの変数のうち書き換えが発生する可能性があるものを第1の不揮発性メモリへ格納し、上記クラスの変数のうち書き換えが発生する可能性がないものおよび上記クラスのメソッドを第2の不揮発性メモリへ格納する。
【0011】
好ましくは、上記メモリカードは暗号処理部をさらに備える。暗号処理部は、第2の不揮発性メモリに格納されるべき上記残りの部分を暗号化する。そして第1の不揮発性メモリ、分離部および暗号処理部は同一チップ上に形成される。
【0012】
上記メモリカードでは、第2の不揮発性メモリに格納するプログラムデータについては暗号処理部において暗号化しているためセキュリティ性がさらに向上する。
【0013】
好ましくは、上記第1の不揮発性メモリはEEPROMであり、上記第2の不揮発性メモリはフラッシュメモリである。
【0014】
【発明の実施の形態】
以下、この発明の実施の形態を図面を参照して詳しく説明する。なお、図中同一または相当部分には同一の符号を付しその説明は繰り返さない。
【0015】
<メモリカードシステムの全体構成>
図1は、この発明の実施の形態によるメモリカードシステムの全体構成を示すブロック図である。図1に示すシステムでは、デジタル機器2(たとえば、デジタルカメラ・PDA・携帯型オーディオ・携帯電話・パソコンなど)のスロット(図示せず)にメモリカード1が挿入され、デジタル機器2からメモリカード1にプログラムデータがダウンロードされる。ダウンロードされたプログラムはメモリカード1内部で実行される。
【0016】
<デジタル機器2>
デジタル機器2は、オブジェクト指向プログラミング言語であるJava(TM)で記述されたソースコードをバイトコードに変換(コンパイル)してメモリカード1へ転送する。
【0017】
<メモリカード1>
メモリカード1は、コントローラチップ100とフラッシュメモリチップ200とを備える。
【0018】
コントローラチップ100は、インターフェース110,140,180と、CPU120と、仮想マシン130と、EEPROM150と、バッファRAM145,160と、暗号処理部170とを含む。
【0019】
インターフェース110は、デジタル機器2とコントローラチップ100との間のインターフェースである。インターフェース110は、デジタル機器2からダウンロードしたクラスファイル(バイトコード)を仮想マシン130へ転送する。
【0020】
仮想マシン130は、インターフェース110より与えられるクラスファイルからstatic変数を分離してインターフェース140に供給し、残り(appletコードおよびstatic final変数)をバッファRAM160に供給する。また仮想マシン130は、EEPROM150およびフラッシュメモリチップ200から読み出されたプログラムデータ(バイトコード)をCPU120が実行可能な形式にインタープリタ方式で変換する。
【0021】
CPU120は、仮想マシン130によって変換されたプログラムを実行する。またCPU120は、コントローラチップ100の動作を制御する。
【0022】
インターフェース140は、仮想マシン130およびCPU120とEEPROM150およびバッファRAM145との間のインターフェースである。インターフェース140は、仮想マシン130からのstatic変数をバッファRAM145を介してEEPROM150に転送する。
【0023】
バッファRAM145は、EEPROM150へ転送するデータおよびEEPROM150から出力されるデータをバッファリングする。またバッファRAM145は、EEPROM150に記録されているデータを書き替える際に当該データを一時的にバッファリングする。
【0024】
EEPROM150は、インターフェース140からのstatic変数を記憶する。EEPROM150は、ワード単位でデータの消去を行う不揮発性メモリである。
【0025】
バッファRAM160は、仮想マシン130からのappletコードおよびstatic final変数を一時的に記憶する。またバッファRAM160は、フラッシュメモリ200から読み出され暗号処理部170で復号されたプログラムデータを一時的に記憶する。
【0026】
暗号処理部170は、バッファRAM160に記憶されたプログラムデータ(appletコードおよびstatic final変数)を暗号化してインターフェース180に供給する。また暗号処理部170は、フラッシュメモリチップ200から読み出されたプログラムデータを復号化する。
【0027】
インターフェース180は、コントローラチップ100とフラッシュメモリチップ200との間のインターフェースである。インターフェース180は、暗号処理部170によって暗号化されたプログラムデータ(appletコードおよびstatic final変数)をフラッシュメモリチップ200に転送する。またインターフェース180は、フラッシュメモリチップ200から読み出されたプログラムデータを暗号処理部170に転送する。
【0028】
フラッシュメモリチップ200は、インターフェース180からの暗号化プログラムデータ(appletコードおよびstatic final変数)を記憶する。フラッシュメモリチップ200は、ブロック単位またはチップ単位でデータの消去を行う不揮発性メモリである。すなわちフラッシュメモリチップ200の消去単位はEEPROM150の消去単位よりも大きい。
【0029】
<プログラムのダウンロード>
次に、図1に示したメモリカードシステムにおけるデジタル機器2からメモリカード1へのプログラムデータのダウンロードについて説明する。
【0030】
ここでは、図2に示すようなソースコードのプログラムデータがダウンロードされる。図2に示すソースコードは、メモリカード1をポイントカードとして利用するためのアプリケーションプログラムであり、Java(TM)で記述されている。このプログラムでは、購入した品目(食品、衣料品、電化製品)ごとに異なるポイント還元率でポイント数が加算されていく。ポイント残高は購入品目ごとに記録される。ポイント残高は商品の購入のたびに更新されるためstatic変数として宣言されている。一方、ポイント還元率は初期設定値のまま不変であるためstatic final変数として宣言されている。
【0031】
Java(TM)で記述されたソースコードはバイトコードに変換(コンパイル)されてデジタル機器2からメモリカード1へダウンロードされる。メモリカード1にダウンロードされたバイトコード(クラスファイル)は仮想マシン130においてstatic変数の部分とAppletコードおよびstatic final変数の部分とに分離される。Appletコードおよびstaticfinal変数の部分はフラッシュメモリ200に格納され、static変数の部分はEEPROM150に格納される。このように、書き換えが発生する可能性がある部分(static変数の部分)はEEPROM150に格納され、書き換えが発生する可能性がない部分(Appletコードおよびstatic final変数の部分)は暗号処理部170で暗号化された後にフラッシュメモリ200に格納される。なお、アプリケーションプログラムをダウンロードして実行可能なICカードでは、図2に示すように、ダウンロードしたバイトコード(クラスファイル)は分離されることなくすべて内部のEEPROMに格納される。
【0032】
次に、仮想メモリ130において行われる分離処理を図3を参照しつつ具体的に説明する。
【0033】
デジタル機器2からメモリカード1にダウンロードされるクラスファイルには、appletコード部(メソッド)と、static final変数と、static変数とが含まれている。appletコード部の先頭1バイトは0x01である。static final変数の先頭1バイトは0x02である。static変数の先頭1バイトは0x03である。このように、デジタル機器2においてコンパイルされたクラスファイルでは、先頭1バイトを判断することによってappletコード部・static final変数・static変数をそれぞれ識別できるようになっている。この判断は、仮想マシン130のアドレス解析部131において行われる。
【0034】
アドレス解析部131の判別結果に応じて格納部132はフラッシュメモリ200またはEEPROM150にプログラムデータを格納する。先頭1バイトが0x01であると判断されたときは、当該プログラムデータ(appletコード部)をフラッシュメモリ200に格納する。先頭1バイトが0x02であると判断されたときは、当該プログラムデータ(static final変数)を(暗号処理部170で暗号化した後に)フラッシュメモリ200に格納する。先頭1バイトが0x03であると判断されたときは、当該プログラムデータ(static変数)をEEPROM150に格納する。
【0035】
以上のような処理の結果、図4に示すように、フラッシュメモリ200にはappletコードおよびstatic final変数が格納され、EEPROM150にはstatic変数が格納される。
【0036】
<ダウンロードしたプログラムの実行>
次に、フラッシュメモリ200およびEEPROM150に分離して格納されたプログラムの実行処理について説明する。ここで実行される処理は、図5(a)のソースコードで示される内容の処理である。以下、図5(b)および(c)を参照しつつ説明する。
【0037】
購入金額(value)と品目種別を示すインデックス(i)とがCPU120に入力されると、仮想マシン130はフラッシュメモリ200上のappletコード部(addPoint)に格納されている”命令”をフェッチし、インタープリタ部において、CPU120が実行可能な形式にインタープリタ方式で変換する。変換された命令がCPU120によって実行される。このようにして以下の処理が行われる。
【0038】
<ステップST51>
_baload・・・フラッシュメモリ200上のkangenritu配列のi番目のデータ(kangenritu[i])を取得する(X)。
【0039】
<ステップST52>
_mul・・・Valueとkangenritu[i]とのかけ算処理を行う。
【0040】
<ステップST53>
_baload・・・EEPROM150上のpoint配列のi番目のデータ(point[i])を取得する(Y)。
【0041】
<ステップST54>
_add・・・ステップST52におけるかけ算処理の結果とステップST53で取得したpoint[i]とを加算する。
【0042】
<ステップST55>
_bastore・・・ステップST54における加算処理の結果をEEPROM150上のpoint[i]に格納する(Z)。すなわち、point[i]の内容を書き換える。
【0043】
<効果>
現在の技術においては、EEPROMの記憶容量はフラッシュメモリに比べて非常に小さい。このため、規模の大きいプログラムの場合にはフラッシュメモリに記憶させることが必要となってくる。
【0044】
通常、プログラムの実行の際には、プログラム中の小さなデータ(変数など)を書き換える処理が発生する。フラッシュメモリに格納したプログラムを実行する場合には消去単位でこの書き換え処理が行われる。しかしながら、フラッシュメモリの消去単位はEEPROMの消去単位と比べると非常に大きい。このため、フラッシュメモリに格納したプログラムを実行する際には、変数の書き換えなどのために巨大なバッファメモリが必要になる。
【0045】
たとえば、
記憶容量:512Mbit
プログラム単位:512byte=1page
消去単位:32page
のNAND型フラッシュメモリの場合には、16kbyteのバッファRAMが必要となる。
【0046】
この発明の実施の形態によるメモリカードシステムでは、デジタル機器2からメモリカード1にダウンロードしたプログラムデータ(クラスファイル)のうち書き換えが発生する可能性がある部分(static変数)をEEPROM150に格納し、書き換えが発生する可能性がない部分(Appletコードおよびstatic final変数)をフラッシュメモリ200に格納している。したがって、プログラム中のデータの書き換え処理はフラッシュメモリ200においては発生せずEEPROM150においてのみ発生する。このように、消去単位の小さいEEPROM150において変数などの書き換え処理を行うため、消去単位の大きいフラッシュメモリ200において処理を行う場合に比べると、書き換え処理に必要なバッファメモリ(バッファRAM145)の容量が小さくてすみ、回路規模を小さくできる。また、書き換えのために一時的にバッファリングするデータのサイズはフラッシュメモリ200よりもEEPROM150のほうが小さい。したがって、フラッシュメモリ200において書き換え処理を行う場合に比べて書き換えのためのバッファリング処理時間が短くてすみ、書き換えに必要な処理時間を短くできる。
【0047】
また、メモリカード1にダウンロードしたプログラムデータをフラッシュメモリ200とEEPROM150とに分離して格納しているためセキュリティ性が向上する。フラッシュメモリチップ200に格納するプログラムデータについては暗号処理部170において暗号化しているためセキュリティ性がさらに向上する。
【0048】
また、EEPROM150に格納されたプログラムデータにアクセスする場合には暗号化/復号化処理を行う必要がないため処理時間が向上される。
【0049】
なお、ここではstatic変数をEEPROM150に格納し、Appletコードおよびstatic final変数をフラッシュメモリ200に格納したが、static変数およびstatic final変数をEEPROM150に格納し、Appletコードをフラッシュメモリ200に格納するようにしてもよい。
【0050】
また、フラッシュメモリ200からの読み出しおよび暗号処理部170による復号処理にかかる時間がEEPROM150からの読み出しにかかる時間よりも長い場合は、CPU120の制御により、フラッシュメモリ200のアクセス回数の多い部分をEEPROM150に書き込んでもよい。
【0051】
また、バッファRAM145とバッファRAM160とを共通の1つのRAMで構成しこのRAMを、EEPROM150の動作時にはEEPROM150用バッファRAMとして動作させ、フラッシュメモリ200の動作時にはフラッシュメモリ200用バッファRAMとして動作させるようにしてもよい。これにより、RAMに必要な回路面積を小さくすることができ、回路規模を小さくできる。
【図面の簡単な説明】
【図1】 この発明の実施の形態によるメモリカードシステムの全体構成を示すブロック図である。
【図2】 デジタル機器からダウンロードしたプログラムデータをメモリカードに格納する様子を示す図である。
【図3】 デジタル機器からダウンロードしたプログラムデータをメモリカードに格納する様子を示す図である。
【図4】 フラッシュメモリおよびEEPROMに格納されるプログラムデータを示す図である。
【図5】 (a)〜(c)は、プログラムの実行手順を説明するための図である。
【符号の説明】
1 メモリカード、100 コントローラチップ、200 フラッシュメモリチップ(第2の不揮発性メモリ)、130 仮想マシン(分離部)、150 EEPROM(第1の不揮発性メモリ)、170 暗号処理部。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a memory card, and more particularly to a memory card that downloads program data and stores it in a nonvolatile memory.
[0002]
[Background Art and Problems to be Solved by the Invention]
Memory cards are used for writing / reading information in digital devices such as digital cameras, PDAs, portable audio devices, cellular phones, and personal computers. The memory card has two chips, a flash memory and a controller. In recent years, the flash memory mounted on a memory card is increasing in capacity, and accordingly, large-scale data can be stored in the flash memory. However, at present, memory cards only exchange data with digital devices. There are IC cards that can download and execute application programs. However, the capacity of the nonvolatile memory for storing the program is very small compared to the capacity of the flash memory mounted on the memory card.
[0003]
An object of the present invention is to provide a memory card capable of reducing the circuit scale.
[0004]
[Means for Solving the Problems and Effects of the Invention]
The memory card according to the present invention includes a first nonvolatile memory, a second nonvolatile memory, and a separation unit. The first nonvolatile memory has a predetermined erase unit. The second nonvolatile memory has an erase unit larger than the erase unit of the first nonvolatile memory. The separation unit separates at least a portion of the program data downloaded to the memory card that may be rewritten, stores the separated portion in the first nonvolatile memory, and stores the remaining portion in the second nonvolatile memory Stored in the memory.
[0005]
In the memory card, in the execution process of the downloaded program, the rewriting process of data in the program does not occur in the second nonvolatile memory but occurs only in the first nonvolatile memory. As described above, the rewriting process of variables or the like is performed in the first non-volatile memory with a small erase unit, so that the required buffer size is smaller than when processing is performed in the second non-volatile memory with a large erase unit. The circuit scale can be reduced.
[0006]
In addition, the size of data temporarily buffered for rewriting is smaller in the first nonvolatile memory than in the second nonvolatile memory. Accordingly, the buffering processing time for rewriting can be reduced compared with the case where the rewriting processing is performed in the second nonvolatile memory, and the processing time required for rewriting can be reduced.
[0007]
Further, since the downloaded program data is stored separately in the first nonvolatile memory and the second nonvolatile memory, the security is improved.
[0008]
Preferably, the program data includes a function and a variable. The separation unit stores the function in a second non-volatile memory, stores in the first non-volatile memory one of the variables that may be rewritten, and rewrites the variable. What is not possible is stored in the second non-volatile memory.
[0009]
Preferably, the program data is a class described in an object-oriented programming language. The separation unit stores the class variable in the first nonvolatile memory, and stores the class method in the second nonvolatile memory.
[0010]
Preferably, the program data is a class described in an object-oriented programming language. The separation unit stores, in the first nonvolatile memory, variables of the class that are likely to be rewritten, and those of the class that are not likely to be rewritten and of the class Store the method in the second non-volatile memory.
[0011]
Preferably, the memory card further includes an encryption processing unit. The encryption processing unit encrypts the remaining portion to be stored in the second nonvolatile memory. The first nonvolatile memory, the separation unit, and the encryption processing unit are formed on the same chip.
[0012]
In the memory card, since the program data stored in the second nonvolatile memory is encrypted by the encryption processing unit, the security is further improved.
[0013]
Preferably, the first nonvolatile memory is an EEPROM, and the second nonvolatile memory is a flash memory.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. In the drawings, the same or corresponding parts are denoted by the same reference numerals, and description thereof will not be repeated.
[0015]
<Overall configuration of memory card system>
FIG. 1 is a block diagram showing an overall configuration of a memory card system according to an embodiment of the present invention. In the system shown in FIG. 1, a memory card 1 is inserted into a slot (not shown) of a digital device 2 (for example, a digital camera, a PDA, a portable audio device, a mobile phone, a personal computer, etc.). Program data is downloaded. The downloaded program is executed inside the memory card 1.
[0016]
<Digital equipment 2>
The digital device 2 converts (compiles) source code described in Java (TM), which is an object-oriented programming language, into byte code and transfers it to the memory card 1.
[0017]
<Memory card 1>
The memory card 1 includes a controller chip 100 and a flash memory chip 200.
[0018]
The controller chip 100 includes interfaces 110, 140 and 180, a CPU 120, a virtual machine 130, an EEPROM 150, buffer RAMs 145 and 160, and an encryption processing unit 170.
[0019]
The interface 110 is an interface between the digital device 2 and the controller chip 100. The interface 110 transfers the class file (byte code) downloaded from the digital device 2 to the virtual machine 130.
[0020]
The virtual machine 130 separates the static variable from the class file given from the interface 110 and supplies the static variable to the interface 140, and supplies the rest (the applet code and the static final variable) to the buffer RAM 160. The virtual machine 130 converts the program data (byte code) read from the EEPROM 150 and the flash memory chip 200 into a format that can be executed by the CPU 120 by an interpreter method.
[0021]
The CPU 120 executes the program converted by the virtual machine 130. The CPU 120 controls the operation of the controller chip 100.
[0022]
The interface 140 is an interface between the virtual machine 130 and the CPU 120, the EEPROM 150, and the buffer RAM 145. The interface 140 transfers the static variable from the virtual machine 130 to the EEPROM 150 via the buffer RAM 145.
[0023]
The buffer RAM 145 buffers data to be transferred to the EEPROM 150 and data output from the EEPROM 150. The buffer RAM 145 temporarily buffers the data when the data recorded in the EEPROM 150 is rewritten.
[0024]
The EEPROM 150 stores a static variable from the interface 140. The EEPROM 150 is a non-volatile memory that erases data in units of words.
[0025]
The buffer RAM 160 temporarily stores the applet code and the static final variable from the virtual machine 130. The buffer RAM 160 temporarily stores program data read from the flash memory 200 and decrypted by the encryption processing unit 170.
[0026]
The encryption processing unit 170 encrypts the program data (apple code and static final variable) stored in the buffer RAM 160 and supplies it to the interface 180. The encryption processing unit 170 decrypts the program data read from the flash memory chip 200.
[0027]
The interface 180 is an interface between the controller chip 100 and the flash memory chip 200. The interface 180 transfers the program data (apple code and static final variable) encrypted by the encryption processing unit 170 to the flash memory chip 200. The interface 180 transfers the program data read from the flash memory chip 200 to the encryption processing unit 170.
[0028]
The flash memory chip 200 stores encrypted program data (apple code and static final variable) from the interface 180. The flash memory chip 200 is a nonvolatile memory that erases data in block units or chip units. That is, the erase unit of the flash memory chip 200 is larger than the erase unit of the EEPROM 150.
[0029]
<Download the program>
Next, downloading of program data from the digital device 2 to the memory card 1 in the memory card system shown in FIG. 1 will be described.
[0030]
Here, the program data of the source code as shown in FIG. 2 is downloaded. The source code shown in FIG. 2 is an application program for using the memory card 1 as a point card, and is written in Java (TM). In this program, points are added at different point return rates for each purchased item (food, clothing, electrical appliances). The point balance is recorded for each purchased item. Since the point balance is updated every time a product is purchased, it is declared as a static variable. On the other hand, since the point reduction rate remains unchanged from the initial setting value, it is declared as a static final variable.
[0031]
The source code described in Java (TM) is converted (compiled) into byte code and downloaded from the digital device 2 to the memory card 1. The byte code (class file) downloaded to the memory card 1 is separated in the virtual machine 130 into a static variable portion, an Applet code, and a static final variable portion. The Apple code and the static final variable part are stored in the flash memory 200, and the static variable part is stored in the EEPROM 150. In this way, a portion where rewriting may occur (static variable portion) is stored in the EEPROM 150, and a portion where rewriting does not occur (Apple code and static final variable portion) is performed by the encryption processing unit 170. After being encrypted, it is stored in the flash memory 200. In an IC card that can download and execute an application program, as shown in FIG. 2, all downloaded byte codes (class files) are stored in an internal EEPROM without being separated.
[0032]
Next, the separation process performed in the virtual memory 130 will be specifically described with reference to FIG.
[0033]
The class file downloaded from the digital device 2 to the memory card 1 includes an applet code part (method), a static final variable, and a static variable. The first byte of the applet code part is 0x01. The first byte of the static final variable is 0x02. The first byte of the static variable is 0x03. As described above, in the class file compiled in the digital device 2, the applet code portion, the static final variable, and the static variable can be identified by determining the first one byte. This determination is performed by the address analysis unit 131 of the virtual machine 130.
[0034]
The storage unit 132 stores program data in the flash memory 200 or the EEPROM 150 according to the determination result of the address analysis unit 131. When it is determined that the first byte is 0x01, the program data (applet code part) is stored in the flash memory 200. When it is determined that the first byte is 0x02, the program data (static final variable) is stored in the flash memory 200 (after being encrypted by the encryption processing unit 170). When it is determined that the first byte is 0x03, the program data (static variable) is stored in the EEPROM 150.
[0035]
As a result of the above processing, as shown in FIG. 4, the applet code and the static final variable are stored in the flash memory 200, and the static variable is stored in the EEPROM 150.
[0036]
<Execution of downloaded program>
Next, an execution process of a program stored separately in the flash memory 200 and the EEPROM 150 will be described. The process executed here is a process having the contents shown in the source code of FIG. Hereinafter, a description will be given with reference to FIGS. 5B and 5C.
[0037]
When the purchase amount (value) and the index (i) indicating the item type are input to the CPU 120, the virtual machine 130 fetches the “instruction” stored in the applet code part (addPoint) on the flash memory 200, In the interpreter unit, the CPU 120 converts the data into an executable format by the interpreter method. The converted instruction is executed by the CPU 120. In this way, the following processing is performed.
[0038]
<Step ST51>
_Balload ... Acquires the i-th data (kangenritu [i]) of the kangenrit array on the flash memory 200 (X).
[0039]
<Step ST52>
_Mul... Multiplying Value and kangenritu [i].
[0040]
<Step ST53>
_Balload ... Acquires the i-th data (point [i]) in the point array on the EEPROM 150 (Y).
[0041]
<Step ST54>
_Add: The result of the multiplication process in step ST52 and the point [i] acquired in step ST53 are added.
[0042]
<Step ST55>
_Basto ... The result of the addition process in step ST54 is stored in point [i] on the EEPROM 150 (Z). That is, the content of point [i] is rewritten.
[0043]
<Effect>
In the current technology, the storage capacity of the EEPROM is much smaller than that of the flash memory. For this reason, in the case of a large-scale program, it is necessary to store it in a flash memory.
[0044]
Normally, when a program is executed, processing for rewriting small data (such as variables) in the program occurs. When executing a program stored in the flash memory, this rewriting process is performed in units of erase. However, the erase unit of flash memory is very large compared to the erase unit of EEPROM. For this reason, when executing a program stored in the flash memory, a huge buffer memory is required for rewriting variables.
[0045]
For example,
Storage capacity: 512Mbit
Program unit: 512 bytes = 1 page
Erase unit: 32 pages
In the case of the NAND type flash memory, a 16 kbyte buffer RAM is required.
[0046]
In the memory card system according to the embodiment of the present invention, a portion (static variable) of program data (class file) downloaded from the digital device 2 to the memory card 1 that may be rewritten is stored in the EEPROM 150 and rewritten. A portion (Applet code and static final variable) in which there is no possibility of occurrence is stored in the flash memory 200. Therefore, the data rewriting process in the program does not occur in the flash memory 200 but only occurs in the EEPROM 150. As described above, since the variables 150 are rewritten in the EEPROM 150 having a small erase unit, the capacity of the buffer memory (buffer RAM 145) necessary for the rewrite process is smaller than in the case of performing the process in the flash memory 200 having a large erase unit. As a result, the circuit scale can be reduced. The size of data temporarily buffered for rewriting is smaller in the EEPROM 150 than in the flash memory 200. Therefore, the buffering processing time for rewriting can be shortened compared with the case of performing rewriting processing in the flash memory 200, and the processing time required for rewriting can be shortened.
[0047]
Further, since the program data downloaded to the memory card 1 is stored separately in the flash memory 200 and the EEPROM 150, the security is improved. Since the program data stored in the flash memory chip 200 is encrypted by the encryption processing unit 170, the security is further improved.
[0048]
Further, when accessing program data stored in the EEPROM 150, it is not necessary to perform encryption / decryption processing, so that the processing time is improved.
[0049]
Here, the static variable is stored in the EEPROM 150 and the Applet code and the static final variable are stored in the flash memory 200. However, the static variable and the static final variable are stored in the EEPROM 150, and the Applet code is stored in the flash memory 200. May be.
[0050]
If the time required for reading from the flash memory 200 and the decrypting process by the encryption processing unit 170 is longer than the time required for reading from the EEPROM 150, the CPU 120 controls the EEPROM 150 to store a part where the flash memory 200 is frequently accessed. You may write.
[0051]
Further, the buffer RAM 145 and the buffer RAM 160 are configured as a common RAM, and this RAM is operated as a buffer RAM for the EEPROM 150 when the EEPROM 150 is operated, and is operated as a buffer RAM for the flash memory 200 when the flash memory 200 is operated. May be. Thereby, the circuit area required for the RAM can be reduced, and the circuit scale can be reduced.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an overall configuration of a memory card system according to an embodiment of the present invention.
FIG. 2 is a diagram showing how program data downloaded from a digital device is stored in a memory card.
FIG. 3 is a diagram illustrating how program data downloaded from a digital device is stored in a memory card.
FIG. 4 is a diagram showing program data stored in a flash memory and an EEPROM.
FIGS. 5A to 5C are diagrams for explaining a program execution procedure; FIG.
[Explanation of symbols]
1 memory card, 100 controller chip, 200 flash memory chip (second non-volatile memory), 130 virtual machine (separating unit), 150 EEPROM (first non-volatile memory), 170 cryptographic processing unit.

Claims (5)

メモリカードであって、
所定の消去単位を有する第1の不揮発性メモリと、
前記第1の不揮発性メモリの消去単位よりも大きい消去単位を有する第2の不揮発性メモリと、
前記メモリカードにダウンロードされたプログラムデータのうち少なくとも書き換えが発生する可能性がある部分を分離し、分離した部分を前記第1の不揮発性メモリへ格納し、残りの部分を前記第2の不揮発性メモリへ格納する分離部とを備え、
前記プログラムデータは、それぞれに識別コードが付与されている関数と変数とから構成され、前記変数については、書き換えが発生する可能性のあるもの、書き換えが発生する可能性がないもの、それぞれに識別コードが付与されており、
前記分離部は、
前記識別コードを判別して、前記関数を前記第2の不揮発性メモリへ格納し、前記変数のうち書き換えが発生する可能性のあるものを前記第1の不揮発性メモリに格納し、前記変数のうち書き換えが発生する可能性がないものを前記第2の不揮発性メモリへ格納することを特徴とするメモリカード。
A memory card,
A first non-volatile memory having a predetermined erase unit;
A second nonvolatile memory having an erase unit larger than the erase unit of the first nonvolatile memory;
Of the program data downloaded to the memory card, at least a portion that may be rewritten is separated, the separated portion is stored in the first nonvolatile memory, and the remaining portion is stored in the second nonvolatile memory. A separation unit for storing in the memory,
The program data is composed of a function and a variable, each of which is assigned an identification code, and the variable is identified as one that may be rewritten or one that may not be rewritten. A code is given,
The separation unit is
The identification code is determined, the function is stored in the second non-volatile memory, and the variable that may be rewritten is stored in the first non-volatile memory. A memory card characterized in that a memory card that is unlikely to be rewritten is stored in the second nonvolatile memory.
メモリカードであって、
所定の消去単位を有する第1の不揮発性メモリと、
前記第1の不揮発性メモリの消去単位よりも大きい消去単位を有する第2の不揮発性メモリと、
前記メモリカードにダウンロードされたプログラムデータのうち少なくとも書き換えが発生する可能性がある部分を分離し、分離した部分を前記第1の不揮発性メモリへ格納し、残りの部分を前記第2の不揮発性メモリへ格納する分離部とを備え、
前記プログラムデータは、オブジェクト指向プログラミング言語で記述されたクラスであり、前記クラスの変数、メソッド、それぞれに識別コードが予め付与されており、
前記分離部は、
前記識別コードを判別して、前記クラスの変数を前記第1の不揮発性メモリへ格納し、前記クラスのメソッドを前記第2の不揮発性メモリへ格納する
ことを特徴とするメモリカード。
A memory card,
A first non-volatile memory having a predetermined erase unit;
A second nonvolatile memory having an erase unit larger than the erase unit of the first nonvolatile memory;
Of the program data downloaded to the memory card, at least a portion that may be rewritten is separated, the separated portion is stored in the first nonvolatile memory, and the remaining portion is stored in the second nonvolatile memory. A separation unit for storing in the memory,
The program data is a class described in an object-oriented programming language, and an identification code is assigned in advance to each of the variables and methods of the class,
The separation unit is
A memory card comprising: discriminating the identification code; storing the class variable in the first nonvolatile memory; and storing the class method in the second nonvolatile memory.
メモリカードであって、
所定の消去単位を有する第1の不揮発性メモリと、
前記第1の不揮発性メモリの消去単位よりも大きい消去単位を有する第2の不揮発性メモリと、
前記メモリカードにダウンロードされたプログラムデータのうち少なくとも書き換えが発生する可能性がある部分を分離し、分離した部分を前記第1の不揮発性メモリへ格納し、残りの部分を前記第2の不揮発性メモリへ格納する分離部とを備え、
前記プログラムデータは、オブジェクト指向プログラミング言語で記述されたクラスであり、前記クラスの変数、メソッド、それぞれに識別コードが予め付与されており、前記変数については、書き換えが発生する可能性のあるもの、書き換えが発生する可能性がないもの、それぞれに識別コードが付与されており、
前記分離部は、
前記識別コードを判別して、前記クラスの変数のうち書き換えが発生する可能性があるものを前記第1の不揮発性メモリへ格納し、前記クラスの変数のうち書き換えが発生する可能性がないものおよび前記クラスのメソッドを前記第2の不揮発性メモリへ格納することを特徴とするメモリカード。
A memory card,
A first non-volatile memory having a predetermined erase unit;
A second nonvolatile memory having an erase unit larger than the erase unit of the first nonvolatile memory;
Of the program data downloaded to the memory card, at least a portion that may be rewritten is separated, the separated portion is stored in the first nonvolatile memory, and the remaining portion is stored in the second nonvolatile memory. A separation unit for storing in the memory,
The program data is a class described in an object-oriented programming language, and an identification code is assigned in advance to each of the variables and methods of the class, and the variables may be rewritten, There is no possibility of rewriting, each has an identification code,
The separation unit is
The identification code is discriminated, the class variable that may be rewritten is stored in the first nonvolatile memory, and the class variable that is not likely to be rewritten And a method of storing the class method in the second nonvolatile memory.
請求項1から3のいずれか1つにおいて、
前記第2の不揮発性メモリに格納されるべき前記残りの部分を暗号化する暗号処理部をさらに備え、
前記第1の不揮発性メモリ、前記分離部および前記暗号処理部は同一チップ上に形成される
ことを特徴とするメモリカード。
In any one of claims 1 to 3,
An encryption processor for encrypting the remaining portion to be stored in the second nonvolatile memory;
The memory card, wherein the first nonvolatile memory, the separation unit, and the encryption processing unit are formed on the same chip.
請求項1から3のいずれか1つにおいて、
前記第1の不揮発性メモリはEEPROMであり、
前記第2の不揮発性メモリはフラッシュメモリである
ことを特徴とするメモリカード。
In any one of claims 1 to 3,
The first nonvolatile memory is an EEPROM;
The memory card, wherein the second nonvolatile memory is a flash memory.
JP2002194193A 2002-02-28 2002-07-03 Memory card Expired - Fee Related JP3913128B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002194193A JP3913128B2 (en) 2002-02-28 2002-07-03 Memory card

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2002-53099 2002-02-28
JP2002053099 2002-02-28
JP2002194193A JP3913128B2 (en) 2002-02-28 2002-07-03 Memory card

Publications (2)

Publication Number Publication Date
JP2003323597A JP2003323597A (en) 2003-11-14
JP3913128B2 true JP3913128B2 (en) 2007-05-09

Family

ID=29552097

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002194193A Expired - Fee Related JP3913128B2 (en) 2002-02-28 2002-07-03 Memory card

Country Status (1)

Country Link
JP (1) JP3913128B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE10357257A1 (en) * 2003-12-08 2005-06-30 Giesecke & Devrient Gmbh Java smart card chip with memory area reserved for global variables
DE102005022019A1 (en) * 2005-05-12 2007-02-01 Giesecke & Devrient Gmbh Secure processing of data
JP5118700B2 (en) * 2006-08-08 2013-01-16 サンディスク テクノロジィース インコーポレイテッド Portable mass storage with virtual machine activation
JP2008065430A (en) * 2006-09-05 2008-03-21 Matsushita Electric Ind Co Ltd Semiconductor device and ic card

Also Published As

Publication number Publication date
JP2003323597A (en) 2003-11-14

Similar Documents

Publication Publication Date Title
US6772955B2 (en) Memory card
US10509734B2 (en) Cryptographic pointer address encoding
US20030163717A1 (en) Memory card
CN109598107B (en) Code conversion method and device based on application installation package file
CN110022558B (en) Method for encrypting and decrypting upgrade package, electronic device and storage medium
CN104318155A (en) Dynamic loading method capable of guarding against reverse APK file
US10762408B2 (en) Smart card
US8745407B2 (en) Virtual machine or hardware processor for IC-card portable electronic devices
US8645624B2 (en) Portable electronic device, smartcard and control method for portable electronic device
JP2005515542A (en) Apparatus and method for writing to NV memory in a controller architecture together with a corresponding computer program and a corresponding computer-readable storage medium
JP4378459B2 (en) Securing downloaded applications, especially on smart cards
JP3913128B2 (en) Memory card
KR20050103448A (en) Semiconductor memory card and computer readable program
CN111931190A (en) Starting method based on XIP processor system
JPH0926875A (en) Storage medium equipped with software unauthorized use preventive function, computer and computer system
CN113220314A (en) APP resource loading and APK generation method, device, equipment and medium
US20070130425A1 (en) Semiconductor memory card
KR20110013197A (en) Method for communicating based on ums, host terminal, and medium recorded program thereof
CN117390702B (en) Split type driving and shell adding method and device, electronic equipment and storage medium
KR20190060181A (en) Apparatus and Method of Providing Security, and Apparatus and Method of Executing Security for Protecting Code of Shared Object
CN109492353B (en) Application reinforcement method, device, electronic equipment and storage medium
US11308160B2 (en) Threaded linking pointer mechanism
Torr et al. Multos and multos application development
JP4883016B2 (en) Vending machine control system
JP6287284B2 (en) IC chip and program encryption method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041216

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061012

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061024

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061218

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: 20070116

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070130

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20100209

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110209

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120209

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130209

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees