JP4863058B2 - IC card and application writing method - Google Patents

IC card and application writing method Download PDF

Info

Publication number
JP4863058B2
JP4863058B2 JP2006075845A JP2006075845A JP4863058B2 JP 4863058 B2 JP4863058 B2 JP 4863058B2 JP 2006075845 A JP2006075845 A JP 2006075845A JP 2006075845 A JP2006075845 A JP 2006075845A JP 4863058 B2 JP4863058 B2 JP 4863058B2
Authority
JP
Japan
Prior art keywords
data
application
area
pattern
value
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
JP2006075845A
Other languages
Japanese (ja)
Other versions
JP2007249881A (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.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2006075845A priority Critical patent/JP4863058B2/en
Publication of JP2007249881A publication Critical patent/JP2007249881A/en
Application granted granted Critical
Publication of JP4863058B2 publication Critical patent/JP4863058B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装されたICカード、および、アプリケーションの書き込み方法に関するものである。   The present invention relates to an IC card on which a virtual machine having an interpretation / execution function of a high-level programming language is mounted, and an application writing method.

ICカード用ICチップの高速化・記憶容量の大容量化を受け、Java(登録商標)に代表される高級プログラミング言語の解釈・実行機能を備えた仮想マシンをICカードに実装することが可能となった(例えば、特許文献1)。   With the increase in the speed and storage capacity of IC chips for IC cards, it is possible to mount virtual machines equipped with functions for interpreting and executing high-level programming languages represented by Java (registered trademark) on IC cards. (For example, Patent Document 1).

ICカードが仮想マシンを備えることで、ICカードに実装するアプリケーションを高級プログラミング言語で効率よく開発できるばかりか、1枚のICカードに複数のアプリケーションの実装が可能となり、ICカードの利便性を高めることができる。   By providing a virtual machine with an IC card, not only can an application to be mounted on the IC card be efficiently developed in a high-level programming language, but also multiple applications can be mounted on a single IC card, improving the convenience of the IC card. be able to.

このようにICカード用ICチップの高速化・記憶容量の増加は、ICカードへの仮想マシンの実装を可能とするが、その一方、アプリケーションに対する要求も高機能化し、ICカードに実装するアプリケーションの容量を増加させる。   As described above, the increase in the speed and the increase in storage capacity of the IC card IC chip enables the mounting of a virtual machine on the IC card. Increase capacity.

仮想マシンを備えたICカードにアプリケーションを実装するためには、ICカードの電気的に書換え可能な不揮発性メモリにアプリケーションを書き込まなければならないが、アプリケーションの容量が増加するにつれて、アプリケーションの書き込み時間も増加してしまう。   In order to mount an application on an IC card equipped with a virtual machine, the application must be written into the electrically rewritable nonvolatile memory of the IC card. However, as the application capacity increases, the application writing time also increases. It will increase.

アプリケーションの書き込み時間の増加は、大量にICカードを発行するICカード製造者にとっては、ICカード製造時のネックとなるため、容量の大きいアプリケーションの書込み時間の短縮がICカード製造者にとって一つの課題となっている。
特開2003−141488号公報 特開2003−162699号公報
An increase in application writing time is a bottleneck in IC card manufacturing for IC card manufacturers who issue a large number of IC cards, so shortening the writing time for large-capacity applications is one issue for IC card manufacturers. It has become.
JP 2003-141488 A JP 2003-162699 A

仮想マシンを備えたICカードへのアプリケーションの書込み時間を短縮する一つの発明として、ICカードに実装するアプリケーションのプログラムコードの一部或いはすべてを予めROMに実装しておくことで、ICカードへ書き込む容量を減らし、アプリケーションの書込み時間を短縮する発明が特許文献2で開示されている。   As one invention for shortening the writing time of an application to an IC card equipped with a virtual machine, a part or all of the program code of the application to be mounted on the IC card is mounted in the ROM in advance to write to the IC card. An invention for reducing the capacity and shortening the writing time of the application is disclosed in Patent Document 2.

しかしながら、特許文献2で開示されている発明は、ICカードに実装されるアプリケーションに含まれるプログラムコードに着目した発明で、プログラムコードに対応するデータを効率よく書き込める発明ではない。   However, the invention disclosed in Patent Document 2 focuses on a program code included in an application mounted on an IC card, and is not an invention in which data corresponding to the program code can be efficiently written.

実際、アプリケーションには、プログラムコード以外に、プログラムコードのパラメータとして扱われるデータや、プログラムコードで操作されるファイルなど、多くのデータが含まれ、アプリケーションの容量が増加するにつれ、アプリケーションのデータの容量も増加する。   In fact, in addition to the program code, the application contains a lot of data such as data handled as parameters of the program code and files operated by the program code, and the capacity of the application data increases as the application capacity increases. Will also increase.

そこで、本発明は、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装されたICカードにおいて、アプリケーションに含まれるデータを効率よく書き込むことができるICカード、および、アプリケーションに含まれるデータを効率よく書き込むことができるアプリケーションの書込み方法を提供することを目的とする。   Therefore, the present invention provides an IC card in which data included in an application can be efficiently written in an IC card on which a virtual machine having an interpretation / execution function of a high-level programming language is mounted, and data included in the application. An object of the present invention is to provide an application writing method capable of efficiently writing.

上述した課題を解決する第1の発明は、電気的に書換え可能な不揮発性メモリを備え、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装された携帯型情報処理装置であって、前記不揮発性メモリには、互いに異なる値でパディングされた複数のパターン領域が設けられ、前記仮想マシンは、前記携帯型情報処理装置にアプリケーションを実装するときに、前記不揮発性メモリに書き込む前記アプリケーションが使用するそれぞれデータの初期値と前記パターン領域をパディングしている値であるパターン値とを比較し、前記データの初期値と前記パターン値が一致する前記パターン領域がある場合は、前記パターン値が初期値と一致する前記パターン領域に前記データを割当て、前記データの初期値と前記パターン値が一致する前記パターン領域がない場合は、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割当て、前記データを割当てた領域を前記データの初期値でパディングすることを特徴とする。   A first invention that solves the above-described problem is a portable information processing device that includes an electrically rewritable non-volatile memory and is mounted with a virtual machine having a high-level programming language interpretation and execution function. The nonvolatile memory is provided with a plurality of pattern areas padded with different values from each other, and when the virtual machine implements an application in the portable information processing apparatus, the application that writes to the nonvolatile memory is The initial value of each data to be used is compared with the pattern value that is the value padding the pattern area. If there is the pattern area where the initial value of the data and the pattern value match, the pattern value is The data is assigned to the pattern area that matches the initial value, and the initial value of the data and the pattern value are the same. If there is no the pattern area to, assign the data to the area of the non-volatile memory other than the pattern region, wherein the padding area allocated to the data in the initial value of the data.

第1の発明に記載の携帯型情報処理装置において、前記携帯型情報処理装置は、前記データを前記パターン領域に割当てる前に、割当てる前記パターン領域の残容量を確認し、前記データを割当てる前記パターン領域に前記データを記憶する残容量がないときには、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割り当て、前記データを割当てた領域を前記データの初期値でパディングすることが望ましい。   In the portable information processing device according to the first aspect, the portable information processing device confirms a remaining capacity of the pattern area to be allocated and allocates the data before allocating the data to the pattern area. When there is no remaining capacity for storing the data in the area, it is preferable that the data is assigned to an area of the nonvolatile memory other than the pattern area, and the area to which the data is assigned is padded with an initial value of the data.

更に、第1の発明に記載の携帯型情報処理装置において、電気的に書換え可能な前記不揮発性メモリに書き込んだ前記アプリケーションを削除するときに、削除する前記アプリケーションの前記データが記憶されている前記パディング領域の箇所を、前記パディング領域の前記パターン値に戻すことが望ましい。   Furthermore, in the portable information processing device according to the first aspect, when the application written in the electrically rewritable nonvolatile memory is deleted, the data of the application to be deleted is stored. It is desirable to return the position of the padding area to the pattern value of the padding area.

また、第2の発明は、電気的に書換え可能な不揮発性メモリを備え、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装された携帯型情報処理装置へアプリケーションを実装する方法であって、
前記携帯型情報処理装置にアプリケーションを書き込む前に、互いに異なる値でパディングされた複数のパターン領域を前記不揮発性メモリに形成し、
前記携帯型情報処理装置へアプリケーションを書き込むときは、
ステップa:前記不揮発性メモリに書き込む前記アプリケーションが使用するそれぞれデータの初期値と前記パターン領域をパディングしている値であるパターン値とを比較するステップ、
ステップb:前記データの初期値と前記パターン値が一致する前記パターン領域がある場合は、前記パターン値が初期値と一致する前記パターン領域に前記データを割当て、一致する前記パターン領域がない場合は、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割当て、前記データを割当てた領域を前記データの初期値でパディングするステップ、
が順に実行されることを特徴とする。
The second invention is a method of mounting an application on a portable information processing apparatus including a non-volatile memory that can be electrically rewritten and mounted with a virtual machine having a high-level programming language interpretation / execution function. And
Before writing an application to the portable information processing device, a plurality of pattern areas padded with different values are formed in the nonvolatile memory,
When writing an application to the portable information processing device,
Step a: comparing an initial value of each data used by the application to be written to the nonvolatile memory with a pattern value which is a value padding the pattern area;
Step b: When there is the pattern area where the initial value of the data matches the pattern value, the data is allocated to the pattern area where the pattern value matches the initial value, and when there is no matching pattern area Allocating the data to an area of the non-volatile memory other than the pattern area, and padding the allocated area with the initial value of the data;
Are sequentially executed.

第2の発明に記載のアプリケーションの実装方法において、前記アプリケーションの実装方法の前記ステップbは、前記データを前記パターン領域に割当てる前に、この前記パターン領域の残容量を確認し、前記データを割当てる前記パターン領域に前記データを記憶する残容量がないときは、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割り当て、前記データを割当てた領域を、前記データの初期値でパディングするステップであることが望ましい。   In the application mounting method according to the second invention, the step b of the application mounting method confirms a remaining capacity of the pattern area and allocates the data before allocating the data to the pattern area. When there is no remaining capacity for storing the data in the pattern area, the data is allocated to an area of the nonvolatile memory other than the pattern area, and the area to which the data is allocated is padded with an initial value of the data It is desirable that

更に、第2の発明に記載のアプリケーションの実装方法において、前記アプリケーションの実装方法は、前記携帯型情報処理装置に実装されたアプリケーションを削除するときに実行され、削除する前記アプリケーションの前記データを前記パディング領域内に割当てているときに、削除する前記アプリケーションの前記データを割当てている前記パディング領域の箇所を、前記パディング領域の前記パターン値に戻すステップcを備えることが望ましい。   Further, in the application mounting method according to the second invention, the application mounting method is executed when deleting an application mounted on the portable information processing apparatus, and the data of the application to be deleted is stored in the data. It is preferable to include a step c of returning the location of the padding area to which the data of the application to be deleted is assigned to the pattern value of the padding area when allocating in the padding area.

なお、本発明において携帯型情報処理装置とは、ICカードやSIM(Subscriber Identity Module)などを意味している。   In the present invention, the portable information processing apparatus means an IC card, a SIM (Subscriber Identity Module), or the like.

上述した本発明によれば、予め、アプリケーションを書き込む前に、データの初期値として利用される可能性の高い値でパディングした領域を不揮発性メモリに設けておくことで、アプリケーションを書き込む時間を短縮できる。実際には、アプリケーションのデータの初期値は数パターンに限定されることが多いため、予め、パターン領域を設けておくことは有用である。   According to the above-described present invention, before the application is written, the time for writing the application can be shortened by providing the non-volatile memory with an area padded with a value that is likely to be used as an initial value of data. it can. Actually, since the initial value of application data is often limited to several patterns, it is useful to provide a pattern area in advance.

更に、前記パターン領域に前記データを割当てる前に、前記パターン領域の容量を確認することで、前記パターン領域の容量が足りないにも関わらず、前記パターン領域に前記データを割当てられることを防止できる。   Further, by confirming the capacity of the pattern area before assigning the data to the pattern area, it is possible to prevent the data from being assigned to the pattern area even though the capacity of the pattern area is insufficient. .

更に、前記携帯型情報処理装置に実装された前記アプリケーションを削除するときに、削除する前記アプリケーションの前記データを割当てている前記パディング領域の箇所を、前記パディング領域の前記パターン値に戻すことで、前記アプリケーションを削除した後でも、前記アプリケーションの書込み時間を短縮できる。   Further, when deleting the application mounted on the portable information processing device, by returning the position of the padding area to which the data of the application to be deleted is returned to the pattern value of the padding area, Even after the application is deleted, the writing time of the application can be shortened.

ここから、前記携帯型情報処理装置をICカードとしたときの実施の形態ついて、図を参照しながら詳細に説明する。図1は、ICカード1を説明する図である。   From here, an embodiment in which the portable information processing apparatus is an IC card will be described in detail with reference to the drawings. FIG. 1 is a diagram for explaining an IC card 1.

図1に示したICカード1は、電気的に書き換え可能な不揮発性メモリとしてEEPROMを有し、Java(登録商標)やMULTOS(登録商標)などに代表される仮想マシンが実装されたICカードで、仮想マシンで解釈実行される中間コードで記述された複数のアプリケーションを、ICカード1のEEPROMに登録/削除できる。   The IC card 1 shown in FIG. 1 has an EEPROM as an electrically rewritable nonvolatile memory, and is an IC card on which a virtual machine represented by Java (registered trademark) or MULTIS (registered trademark) is mounted. A plurality of applications described in the intermediate code interpreted and executed by the virtual machine can be registered / deleted in the EEPROM of the IC card 1.

アプリケーションのデータの初期値として利用される可能性が高い値をパターン値とし、本発明に係るICカード1のEEPROMには、互いに異なるパターン値でパディングされた複数のパターン領域が形成されている。   A pattern value is a value that is highly likely to be used as an initial value of application data, and a plurality of pattern areas padded with different pattern values are formed in the EEPROM of the IC card 1 according to the present invention.

そして、ICカード1へアプリケーションを書き込むときは、アプリケーションのデータの初期値と同じパターン値でパディングされているパターン領域にデータを割当てることで、アプリケーションの書込み時間を短縮する。   When writing an application to the IC card 1, the application writing time is shortened by assigning data to the pattern area padded with the same pattern value as the initial value of the application data.

図2は、図1で示したICカード1に実装されるICチップ2の構成図で、図3は、ICカード1に実装されるソフトウェアを説明する図である。   2 is a block diagram of the IC chip 2 mounted on the IC card 1 shown in FIG. 1, and FIG. 3 is a diagram for explaining software mounted on the IC card 1. As shown in FIG.

図2に示したようにICカード1のICチップ2には、演算機能およびICチップ2が具備するデバイスを制御する機能を備えた中央演算装置20(CPU:Central Processing Unit)、読み出し専用の不揮発性メモリ23(ROM:Read Only Memory、)、電気的に書換え可能な不揮発性メモリとしてEEPROM22(EEPROM:Electrically Erasable Programmable Read-Only Memoryの略)、揮発性メモリとしてランダムアクセスメモリ21(RAM:Random Access Memory)、および、外部の端末装置とデータ通信するための通信I/F回路24とを少なくとも備なえている。   As shown in FIG. 2, an IC chip 2 of the IC card 1 includes a central processing unit 20 (CPU: Central Processing Unit) having a calculation function and a function for controlling a device included in the IC chip 2, a read-only nonvolatile memory. Memory 23 (ROM: Read Only Memory), EEPROM 22 (EEPROM: Electrically Erasable Programmable Read-Only Memory) as electrically rewritable nonvolatile memory, and Random Access Memory 21 (RAM: Random Access) as volatile memory Memory) and a communication I / F circuit 24 for data communication with an external terminal device.

本発明は、ICカード1に実装されるICチップ2の仕様をなんら限定するものではなく、ICカード1の用途に適した仕様のICチップ2を選択することができる。例えば、ROM23およびEEPROM22の容量については限定しないし、書換え可能な不揮発性メモリはフラッシュメモリ等であっても構わない。またICチップ2は乱数を生成する乱数生成回路等の図示していない他のデバイスを備えていても構わない。   The present invention does not limit the specifications of the IC chip 2 mounted on the IC card 1, and the IC chip 2 having specifications suitable for the application of the IC card 1 can be selected. For example, the capacities of the ROM 23 and the EEPROM 22 are not limited, and the rewritable nonvolatile memory may be a flash memory or the like. The IC chip 2 may include other devices (not shown) such as a random number generation circuit that generates random numbers.

なお、図1においては、ICカード1を接触ICカードとして図示しているが、本発明は何らICカード1の通信方式に依存するものではなく、無線でデータ通信する非接触ICカード、または、接触データ通信と非接触データ通信の2つの通信機能を備えたデュアルインターフェースICカードであってもよい。加えて、ICカード1は、ICチップ2の近辺を短冊状に切り取った形状をしているSIM(Subscriber Identity Module)であってもよい。   In FIG. 1, the IC card 1 is illustrated as a contact IC card, but the present invention does not depend on the communication method of the IC card 1, and is a non-contact IC card for wireless data communication, or A dual interface IC card having two communication functions of contact data communication and non-contact data communication may be used. In addition, the IC card 1 may be a SIM (Subscriber Identity Module) having a shape obtained by cutting the vicinity of the IC chip 2 into a strip shape.

図3で示したように、ICカード1の不揮発性メモリであるROM23には、ICカード1に実装されるICチップ2ごとの仕様差分を吸収するためのプログラムであるカードOS10上に、高級プログラミング言語の解釈・実行機能を備えた仮想マシン11が実装されている。   As shown in FIG. 3, the ROM 23, which is a non-volatile memory of the IC card 1, stores high-level programming on the card OS 10 that is a program for absorbing specification differences for each IC chip 2 mounted on the IC card 1. A virtual machine 11 having a language interpretation / execution function is implemented.

更に、ICカード1の電気的に書換え可能な不揮発性メモリであるEEPROM22は、カードOS10および仮想マシン11が利用するシステム領域220と、アプリケーション12を実装するための領域であるアプリケーション領域221に論理的に分割され、アプリケーション領域221には少なくとも一つのアプリケーション12が実装され、システム領域220には、アプリケーションがEEPROM22に書き込まれた情報を記憶するために、アプリケーション用のエントリテーブル13が設けらる。   Furthermore, the EEPROM 22 which is an electrically rewritable nonvolatile memory of the IC card 1 is logically divided into a system area 220 used by the card OS 10 and the virtual machine 11 and an application area 221 which is an area for mounting the application 12. At least one application 12 is installed in the application area 221, and an application entry table 13 is provided in the system area 220 in order to store information written in the EEPROM 22 by the application.

アプリケーション領域221に実装される一つのアプリケーション12は、複数のオブジェクトを有し、アプリケーション12が有するオブジェクトには、アプリケーション12に要求される機能を実現するためプログラムコードと、プログラムコードによって操作されるデータが含まれる。   One application 12 implemented in the application area 221 has a plurality of objects, and the object included in the application 12 includes a program code for realizing a function required for the application 12 and data operated by the program code. Is included.

ここで、アプリケーション12のデータとは、プログラムコードで宣言される変数を意味し、例えば、プログラムコードが実行するときに利用するパラメータ、または、プログラムコードが操作するファイルなどを意味している。   Here, the data of the application 12 means a variable declared by the program code, for example, a parameter used when the program code is executed, or a file operated by the program code.

すでに、上述しているように、ICカード1のEEPROM22の大容量化が進むにつれて、アプリケーション12の容量、すなわち、プログラムコードの容量およびデータの容量も増加する傾向にあり、ICカード1を大量に発行するICカード製造会社などでは、アプリケーション12の書込み時間が問題になってしまう。   As described above, as the capacity of the EEPROM 22 of the IC card 1 is increased, the capacity of the application 12, that is, the capacity of the program code and the capacity of data tends to increase. In the IC card manufacturing company that issues, the writing time of the application 12 becomes a problem.

そこで、本発明では、アプリケーション12のデータの初期値は数パターンに限定されることが多いことに着目し、予め、アプリケーションを書き込む前に、データの初期値として利用される可能性の高い値をパターン値とし、互いに異なるパターン値でパディングした複数のパターン領域をEEPROM22に設けておくことで、アプリケーション12の書込み時間を短縮する。   Therefore, in the present invention, it is noted that the initial value of the data of the application 12 is often limited to several patterns, and a value that is likely to be used as the initial value of the data before the application is written in advance. The writing time of the application 12 is shortened by providing the EEPROM 22 with a plurality of pattern areas padded with different pattern values as pattern values.

図4は、EEPROM12に設けられたパターン領域222を説明する図である。図に示したように、アプリケーション領域221の一部の領域には、アプリケーションのデータを記憶する領域である複数のパターン領域222が設けられ、それぞれのパターン領域222は互いに異なるパターン値でパディングされている。   FIG. 4 is a diagram for explaining the pattern area 222 provided in the EEPROM 12. As shown in the figure, a part of the application area 221 is provided with a plurality of pattern areas 222 that are areas for storing application data, and each pattern area 222 is padded with different pattern values. Yes.

パターン領域222へのパディングは、アプリケーション12をEEPROM22に書き込む前に実施されていることが望ましく、例えば、カードOS10または仮想マシン11に備えられた書込みコマンドでパターン領域222にパターン値をパディングしておくとよい。   The padding into the pattern area 222 is preferably performed before the application 12 is written in the EEPROM 22. For example, the pattern value is padded in the pattern area 222 with a write command provided in the card OS 10 or the virtual machine 11. Good.

アプリケーションのデータの初期値として利用される可能性の高い値をパターン値として、それぞれのパターン領域222を一括してパターン値でパディングしておくことで、アプリケーション12を書き込むときに、EEPROM22にデータを書き込む量が減るため、アプリケーションの書き込む時間を短縮できる効果を得ることができる。   By using the pattern value as a value that is highly likely to be used as the initial value of the application data, each pattern area 222 is collectively padded with the pattern value, so that the data is stored in the EEPROM 22 when the application 12 is written. Since the amount of writing is reduced, an effect of shortening the writing time of the application can be obtained.

また、パターン領域222をパターン値でパディングする時間は無駄な時間に思われるかも知れないが、データの初期値を個別にEEPROM22に書き込むときよりも、パターン領域222に一括でパターン値を書き込むの方が効率よく書き込めるため、パターン領域222をパターン値でパディングする時間を考慮しても、EEPROM22に書き込む時間を短縮できる効果は期待できる。   Also, it may seem that the time to pad the pattern area 222 with the pattern value is wasted time, but it is more convenient to write the pattern values to the pattern area 222 in a lump than to write the initial values of the data to the EEPROM 22 individually. Therefore, even if the time for padding the pattern area 222 with the pattern value is taken into consideration, the effect of shortening the time for writing to the EEPROM 22 can be expected.

図5は、アプリケーション12が有するデータの一例を示した図で、図6は、EEPROM22のパターン領域222の一例を示した図である。   FIG. 5 is a diagram illustrating an example of data included in the application 12, and FIG. 6 is a diagram illustrating an example of the pattern area 222 of the EEPROM 22.

図5において、アプリケーション(JCApplet)は、データとして、bField、sField、barray、iFieldそしてbContextの5つの異なる変数を有している。図5において、bFieldおよびiFieldの初期値は宣言されていないが、Java(登録商標)では、初期値が宣言されていない変数については、変数の型宣言で示される長さすべてを0x00(0xは16進表記)でパディングすることが定められている。   In FIG. 5, the application (JCApplet) has five different variables, bField, sField, barray, iField, and bContext, as data. In FIG. 5, the initial values of bField and iField are not declared. However, in Java (registered trademark), all the lengths indicated by the variable type declaration are set to 0x00 (where 0x is Padding in hexadecimal notation).

また、図6に示したように、EEPROM22には、パターン領域222として、0x00でパディングされたパターン領域222a、0x01でパディングされたパターン領域222b、0x0Fでパディングされたパターン領域222c、0xFFでパディングされたパターン領域222dそして他の値パディングされたパターン領域222eとが設けられている。   As shown in FIG. 6, the EEPROM 22 is padded with a pattern area 222a padded with 0x00, a pattern area 222b padded with 0x01, a pattern area 222c padded with 0x0F, and a pattern area 222c padded with 0xFF. Pattern area 222d and another value-padded pattern area 222e are provided.

図5で示されたアプリケーション12の変数をEEPOM12に書き込むときは、仮想マシン11は、それぞれの変数の初期値を参照し、初期値と同じパターン値でパディングされているパターン領域222に変数を割当て、変数を識別する情報に関連付けて、それぞれの変数を割当てたアドレスを、アプリケーション12用のエントリーテーブル13に記憶する。   When writing the variables of the application 12 shown in FIG. 5 to the EEPOM 12, the virtual machine 11 refers to the initial values of the variables and assigns the variables to the pattern area 222 padded with the same pattern values as the initial values. The address assigned to each variable is stored in the entry table 13 for the application 12 in association with the information for identifying the variable.

例えば、変数のbFieldおよびiFieldは初期値が宣言されていないため、0x00でパディングされたパターン領域222aに割り当てられ、また、変数のsFieldの初期値は0x01であるため、0x01でパディングされたパターン領域222bに割り当てられる。   For example, since the initial values of the variables bField and iField are not declared, they are allocated to the pattern area 222a padded with 0x00, and since the initial value of the variable sField is 0x01, the pattern area padded with 0x01 222b.

ここから、図を参照しながら、仮想マシン11がアプリケーション12のデータをEEPROM22に書き込む一連の手順と、仮想マシン11がアプリケーション12のデータをEEPROM22から削除するときの手順について説明する。図7は、仮想マシン11がデータをEEPROM22に書き込む一連の手順を示したフロー図である。   From here, a series of procedures in which the virtual machine 11 writes the data of the application 12 to the EEPROM 22 and a procedure when the virtual machine 11 deletes the data of the application 12 from the EEPROM 22 will be described with reference to the drawings. FIG. 7 is a flowchart showing a series of procedures in which the virtual machine 11 writes data to the EEPROM 22.

この手順の最初のステップS1は、仮想マシン11がデータをEEPROM22に書込み開始するステップである。   The first step S1 of this procedure is a step in which the virtual machine 11 starts writing data to the EEPROM 22.

このステップでは、アプリケーション12をEEPROM22に書き込むコマンドAPDUをカードOS10が受信し、受信したコマンドAPDUがRAM21を介して仮想マシン11に引渡される。そして、引渡されたコマンドAPDUを仮想マシン11が解釈実行し、コマンドAPDUに含まれるアプリケーション12のデータをEEPROM22にそれぞれ書き込むときに、これ以降のステップが実行される。   In this step, the card OS 10 receives a command APDU for writing the application 12 to the EEPROM 22, and the received command APDU is delivered to the virtual machine 11 via the RAM 21. Then, when the virtual machine 11 interprets and executes the delivered command APDU and writes the data of the application 12 included in the command APDU to the EEPROM 22, the subsequent steps are executed.

次のステップS2は、仮想マシン11がデータの初期値を確認するステップである。このステップでは、仮想マシン11はデータの初期値を確認し、EEPROM22のデータの初期値でパディングされたパターン領域222がEEPROM22にあればステップS3に進み、なければステップS5に進む。   The next step S2 is a step in which the virtual machine 11 confirms the initial data value. In this step, the virtual machine 11 confirms the initial value of the data, and if the pattern area 222 padded with the initial value of the data in the EEPROM 22 is in the EEPROM 22, the process proceeds to step S3, and if not, the process proceeds to step S5.

ステップS3では、パターン領域222の残容量を確認するステップである。このステップでは、仮想マシン11は、パターン領域222に割当てるデータの容量と、データを割当てるパターン領域222の中で未使用の領域の容量(残容量)とを比較し、パターン領域222にデータを割当てることができる残容量がある場合は、ステップS4に進み、残容量がなければステップS5に進む。   In step S3, the remaining capacity of the pattern area 222 is confirmed. In this step, the virtual machine 11 compares the capacity of data allocated to the pattern area 222 with the capacity of the unused area (remaining capacity) in the pattern area 222 to which data is allocated, and allocates data to the pattern area 222. If there is a remaining capacity, the process proceeds to step S4, and if there is no remaining capacity, the process proceeds to step S5.

ステップS4では、データの初期値と同じパターン値でパディングされたパターン領域222にデータを割当て、ステップS5では、パターン領域222以外のEEPROM22の領域にデータを割当てる。そして、ステップS4またはステップS5が実行された後はステップS6に進む。   In step S4, data is allocated to the pattern area 222 padded with the same pattern value as the initial value of the data, and in step S5, data is allocated to the area of the EEPROM 22 other than the pattern area 222. And after step S4 or step S5 is performed, it progresses to step S6.

ステップS4またはステップS5の後に実行されるステップS6では、データを割当てたアドレスを含み、ステップS4またはステップS5でデータを割当てた内容をエントリテーブル13に記憶するステップである。この手順をもって、仮想マシン11がデータをEEPROM22に書き込む一連の手順は終了する。   In step S6 executed after step S4 or step S5, the contents including the address to which the data is allocated and the data allocated in step S4 or step S5 are stored in the entry table 13. With this procedure, a series of procedures in which the virtual machine 11 writes data to the EEPROM 22 is completed.

次に、仮想マシン11がアプリケーション12のデータをEEPROM22から削除するときの手順について説明する。図8は、仮想マシン11がアプリケーション12をEEPROM22から削除するときの手順を示したフロー図である。   Next, a procedure when the virtual machine 11 deletes the data of the application 12 from the EEPROM 22 will be described. FIG. 8 is a flowchart showing a procedure when the virtual machine 11 deletes the application 12 from the EEPROM 22.

この手順は、アプリケーション12用のエントリテーブル13で示されるデータの数だけ繰り返し実行される処理で、繰り返し実行される処理の内容はループ1で定義される。このループ1で最初に実行されるステップS10は、エントリーテーブル13から、データが割り当てられている内容を取得するステップである。データが割り当てられている内容には、少なくとも、データが記憶しているアドレスが含まれる。   This procedure is a process that is repeatedly executed as many times as the number of data indicated in the entry table 13 for the application 12, and the contents of the repeatedly executed process are defined by the loop 1. Step S10 that is first executed in the loop 1 is a step of acquiring the contents to which data is assigned from the entry table 13. The content to which data is assigned includes at least an address where the data is stored.

次のステップS11は、データが記憶されているアドレスがパターン領域222であるか確認するステップである。仮想マシン11は、データが記憶されているアドレスがパターン領域222であればステップS12に進み、パターン領域222外であればステップS13に進む。   The next step S <b> 11 is a step of confirming whether the address where the data is stored is the pattern area 222. If the address where the data is stored is the pattern area 222, the virtual machine 11 proceeds to step S12. If the address is outside the pattern area 222, the virtual machine 11 proceeds to step S13.

ステップS12は、仮想マシン11は、データが記憶されていたパターン領域222の箇所を、パターン領域222のパターン値に戻すステップである。また、ステップ13は、データ記憶されていたEEPROM22の領域を乱数値などでパディングするステップである。   Step S <b> 12 is a step in which the virtual machine 11 returns the pattern area 222 where the data is stored to the pattern value of the pattern area 222. Step 13 is a step of padding the area of the EEPROM 22 in which data has been stored with a random number value or the like.

ステップS12またはステップS13が終了した後、アプリケーション12用のエントリテーブル13で示されるデータすべてについて、ループ1で定義される処理を実施したときにこの手順は終了し、未処理のデータがある場合は、そのデータについてループ1で定義される処理が実施される。   After step S12 or step S13 is completed, this procedure ends when the processing defined in loop 1 is performed for all the data indicated in the entry table 13 for the application 12. If there is unprocessed data, The process defined in loop 1 is performed for the data.

ICカードを説明する図。The figure explaining an IC card. ICカードに実装されるICチップの構成図。The block diagram of the IC chip mounted in an IC card. ICカードに実装されるソフトウェアを説明する図。The figure explaining the software mounted in an IC card. パターン領域を説明する図。The figure explaining a pattern area | region. アプリケーションが有するデータの一例を示した図。The figure which showed an example of the data which an application has. パターン領域の一例を示した図。The figure which showed an example of the pattern area | region. 仮想マシンがデータをEEPROMに書き込む手順を示したフロー図。The flowchart which showed the procedure in which a virtual machine writes data in EEPROM. 仮想マシンがデータをEEPROMから削除する手順を示したフロー図。The flowchart which showed the procedure in which a virtual machine deletes data from EEPROM.

符号の説明Explanation of symbols

1 ICカード
11 仮想マシン
12 アプリケーション
2 ICチップ
22 EEPROM
221 アプリケーション領域
222 パターン領域

1 IC card 11 Virtual machine 12 Application 2 IC chip 22 EEPROM
221 Application area 222 Pattern area

Claims (6)

電気的に書換え可能な不揮発性メモリを備え、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装された携帯型情報処理装置であって、前記不揮発性メモリには、互いに異なる値でパディングされた複数のパターン領域が設けられ、前記仮想マシンは、前記携帯型情報処理装置にアプリケーションを実装するときに、前記不揮発性メモリに書き込む前記アプリケーションが使用するそれぞれデータの初期値と前記パターン領域をパディングしている値であるパターン値とを比較し、前記データの初期値と前記パターン値が一致する前記パターン領域がある場合は、前記パターン値が初期値と一致する前記パターン領域に前記データを割当て、前記データの初期値と前記パターン値が一致する前記パターン領域がない場合は、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割当て、、前記データを割当てた領域を前記データの初期値でパディングすることを特徴とする携帯型情報処理装置。   A portable information processing apparatus equipped with a virtual machine having an electrically rewritable nonvolatile memory and a high-level programming language interpretation / execution function, wherein the nonvolatile memory is padded with different values. When the virtual machine implements an application in the portable information processing apparatus, the virtual machine stores the initial value of the data and the pattern area used by the application to be written in the nonvolatile memory. A pattern value that is a padding value is compared, and if there is the pattern area where the initial value of the data matches the pattern value, the data is placed in the pattern area where the pattern value matches the initial value. Allocation, if there is no pattern area where the initial value of the data and the pattern value match, Portable information processing apparatus, characterized in that the padding area allocated allocation ,, the data the data to the area of the non-volatile memory other than the serial pattern area at the initial value of the data. 請求項1に記載の携帯型情報処理装置において、前記携帯型情報処理装置は、前記データを前記パターン領域に割当てる前に、割当てる前記パターン領域の残容量を確認し、前記データを割当てる前記パターン領域に前記データを記憶する残容量がないときには、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割り当て、前記データを割当てた領域を前記データの初期値でパディングすること特徴とする携帯型情報処理装置。   2. The portable information processing apparatus according to claim 1, wherein the portable information processing apparatus confirms a remaining capacity of the pattern area to be allocated and allocates the data before allocating the data to the pattern area. When there is no remaining capacity for storing the data, the data is allocated to an area of the nonvolatile memory other than the pattern area, and the area to which the data is allocated is padded with an initial value of the data Information processing device. 請求項1または請求項2に記載の携帯型情報処理装置において、前記携帯型情報処理装置は、電気的に書換え可能な前記不揮発性メモリに書き込んだ前記アプリケーションを削除するときに、削除する前記アプリケーションの前記データが記憶されている前記パディング領域の箇所を、前記パディング領域の前記パターン値に戻すことを特徴とする携帯型情報処理装置。   3. The portable information processing device according to claim 1, wherein the portable information processing device deletes the application written in the electrically rewritable nonvolatile memory when the application is deleted. A portable information processing apparatus that returns the position of the padding area in which the data is stored to the pattern value of the padding area. 電気的に書換え可能な不揮発性メモリを備え、高級プログラミング言語の解釈・実行機能を備えた仮想マシンが実装された携帯型情報処理装置へアプリケーションを実装する方法であって、
前記携帯型情報処理装置にアプリケーションを書き込む前に、互いに異なる値でパディングされた複数のパターン領域を前記不揮発性メモリに形成し、
前記携帯型情報処理装置へアプリケーションを書き込むときは、
ステップa:前記不揮発性メモリに書き込む前記アプリケーションが使用するそれぞれデータの初期値と前記パターン領域をパディングしている値であるパターン値とを比較するステップ、
ステップb:前記データの初期値と前記パターン値が一致する前記パターン領域がある場合は、前記パターン値が初期値と一致する前記パターン領域に前記データを割当て、一致する前記パターン領域がない場合は、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割当て、前記データを割当てた領域を前記データの初期値でパディングするステップ、
が順に実行されることを特徴とするアプリケーションの実装方法。
A method of mounting an application on a portable information processing apparatus having a virtual machine having an electrically rewritable non-volatile memory and having a high-level programming language interpretation / execution function,
Before writing an application to the portable information processing device, a plurality of pattern areas padded with different values are formed in the nonvolatile memory,
When writing an application to the portable information processing device,
Step a: comparing an initial value of each data used by the application to be written to the nonvolatile memory with a pattern value which is a value padding the pattern area;
Step b: When there is the pattern area where the initial value of the data matches the pattern value, the data is allocated to the pattern area where the pattern value matches the initial value, and when there is no matching pattern area Allocating the data to an area of the non-volatile memory other than the pattern area, and padding the allocated area with the initial value of the data;
An application mounting method characterized in that the processes are executed in order.
請求項4に記載のアプリケーションの実装方法において、前記アプリケーションの実装方法の前記ステップbは、前記データを前記パターン領域に割当てる前に、この前記パターン領域の残容量を確認し、前記データを割当てる前記パターン領域に前記データを記憶する残容量がないときは、前記パターン領域以外の前記不揮発性メモリの領域に前記データを割り当て、前記データを割当てた領域を、前記データの初期値でパディングするステップであることを特徴とするアプリケーションの実装方法。   5. The application mounting method according to claim 4, wherein the step b of the application mounting method confirms a remaining capacity of the pattern area and allocates the data before allocating the data to the pattern area. When there is no remaining capacity for storing the data in the pattern area, the data is allocated to an area of the non-volatile memory other than the pattern area, and the area to which the data is allocated is padded with an initial value of the data. How to implement an application characterized by being. 請求項4または請求項5に記載のアプリケーションの実装方法において、前記アプリケーションの実装方法は、前記携帯型情報処理装置に実装されたアプリケーションを削除するときに実行され、削除する前記アプリケーションの前記データを前記パディング領域内に割当てているときに、削除する前記アプリケーションの前記データを割当てている前記パディング領域の箇所を、前記パディング領域の前記パターン値に戻すステップcを備えることを特徴とするアプリケーションの実装方法。

6. The application mounting method according to claim 4, wherein the application mounting method is executed when an application mounted on the portable information processing apparatus is deleted, and the data of the application to be deleted is stored. Implementation of an application comprising the step c of returning the location of the padding area to which the data of the application to be deleted is assigned to the pattern value of the padding area when allocating in the padding area Method.

JP2006075845A 2006-03-20 2006-03-20 IC card and application writing method Expired - Fee Related JP4863058B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006075845A JP4863058B2 (en) 2006-03-20 2006-03-20 IC card and application writing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006075845A JP4863058B2 (en) 2006-03-20 2006-03-20 IC card and application writing method

Publications (2)

Publication Number Publication Date
JP2007249881A JP2007249881A (en) 2007-09-27
JP4863058B2 true JP4863058B2 (en) 2012-01-25

Family

ID=38594050

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006075845A Expired - Fee Related JP4863058B2 (en) 2006-03-20 2006-03-20 IC card and application writing method

Country Status (1)

Country Link
JP (1) JP4863058B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5235764B2 (en) * 2009-04-16 2013-07-10 株式会社日立製作所 IC chip and information processing apparatus equipped with the same
EP2256658A1 (en) * 2009-05-26 2010-12-01 Gemalto SA Method of executing an application embedded in a portable electronic device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001067210A (en) * 1999-08-30 2001-03-16 Toshiba Corp Ic card, and method for installation of application on ic card
JP3911153B2 (en) * 2001-11-27 2007-05-09 大日本印刷株式会社 Multi-application IC card and writing method thereof
JP4185715B2 (en) * 2002-06-28 2008-11-26 大日本印刷株式会社 IC card and IC card program

Also Published As

Publication number Publication date
JP2007249881A (en) 2007-09-27

Similar Documents

Publication Publication Date Title
JP3110035B2 (en) Portable electronic devices
JP5895565B2 (en) IC card and program
JP4863058B2 (en) IC card and application writing method
JP2010146410A (en) Portable electronic device
JP2007122289A (en) Ic card having a plurality of operating systems, and ic card program
JP4896842B2 (en) Portable electronic device
JP2007087120A (en) Ic card mounted with multiple os (operating system) and issue consignment method
JP2008123203A (en) Portable electronic device and method for controlling portable electronic device
JP2009080673A (en) Portable electronic apparatus and command processing method thereof
EP3023925B1 (en) Secure element with applications
JP2006293706A (en) Multi-application ic card with application updating function
US20100235393A1 (en) Portable electronic device and access control method in portable electronic device
JP7005934B2 (en) Electronic information storage medium, IC card, data transmission method, data writing method, data transmission program and data writing program
EP1384197B1 (en) Method of manufacturing smart cards
JP2001167236A (en) Portable electronic device
JP2004348234A (en) Portable electronic medium, issuing apparatus of portable electronic medium, issuing system of portable electronic medium, and issuing method of portable electronic medium
CN112230941A (en) Java Card package and application program installation method and tool
JP7322923B2 (en) Secure element, transaction control method and device
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP2008146343A (en) Ic card, and method for calling update program
JP2007034434A (en) Ic card, method for writing data to ic card, and ic card program
JP2007114979A (en) Ic card and ic card program for sharing data file
JP7397402B2 (en) Electronic information storage medium, data transmission method, and program
JP2012133656A (en) Portable electronic apparatus and ic card
JP2018014014A (en) Electronic information storage medium, information processing method, and information processing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111007

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20111026

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

Free format text: PAYMENT UNTIL: 20141118

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4863058

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees