JP2014063345A - Ic card, portable electronic device, and information processing method - Google Patents

Ic card, portable electronic device, and information processing method Download PDF

Info

Publication number
JP2014063345A
JP2014063345A JP2012207973A JP2012207973A JP2014063345A JP 2014063345 A JP2014063345 A JP 2014063345A JP 2012207973 A JP2012207973 A JP 2012207973A JP 2012207973 A JP2012207973 A JP 2012207973A JP 2014063345 A JP2014063345 A JP 2014063345A
Authority
JP
Japan
Prior art keywords
command
program
card
volatile storage
storage means
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2012207973A
Other languages
Japanese (ja)
Inventor
Yoshihiko Nagafune
善彦 長船
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2012207973A priority Critical patent/JP2014063345A/en
Publication of JP2014063345A publication Critical patent/JP2014063345A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an IC card capable of improving reduction in use efficiency of a memory which is caused by keeping a program stored.SOLUTION: An IC card includes communication means, nonvolatile storage means, volatile storage means, and information processing means. The communication means receives a command from an external device and transmits a response to the external device. The nonvolatile storage means stores a first program for interpreting a first command. The information processing means interprets the first command, which is received via the communication means, by the first program; executes write processing of a second program to the volatile storage means, which is instructed by the first command; interprets a second command that is received via the communication means, by the second program; and executes processing that is instructed by the second command.

Description

本発明の実施形態は、ICカード、携帯可能電子装置、及び情報処理方法に関する。   Embodiments described herein relate generally to an IC card, a portable electronic device, and an information processing method.

近年、ICカード(携帯可能電子装置)の普及が目覚ましい。例えば、ICカードは、クレジットカード、定期券、旅券、免許証、その他の商取引の決済に使われるだけでなく、社員証、会員証、保険証などのIDカードとしても様々な分野で使用されている。   In recent years, the spread of IC cards (portable electronic devices) has been remarkable. For example, IC cards are used not only for settlement of credit cards, commuter passes, passports, licenses, and other commercial transactions, but also in various fields as ID cards for employee cards, membership cards, insurance cards, etc. Yes.

ICカードは、不揮発性のプログラムメモリ(ROMなど)、揮発性のワーキングメモリ(RAMなど)、不揮発性のデータメモリ(EEPROMなど)、及び制御素子(CPUなど)を有するIC(集積回路)チップを内蔵する。また、ICカードリーダライタ等のICカード処理装置は、ICカードに対してリードコマンドを送信しICカードからデータを読み出したり、ICカードに対してライトコマンドを送信しICカードに対してデータを書き込んだりする。   An IC card includes an IC (integrated circuit) chip having a non-volatile program memory (such as ROM), a volatile working memory (such as RAM), a non-volatile data memory (such as EEPROM), and a control element (such as a CPU). Built in. Also, an IC card processing device such as an IC card reader / writer transmits a read command to the IC card and reads data from the IC card, or transmits a write command to the IC card and writes data to the IC card. Sloppy.

例えば、ICカードのROMは、ICカード内部で実行する情報処理用プログラムを記憶している。また、JAVA(登録商標)カードのように、ICカードのEEPROMが、ダウンロードされた情報処理用プログラムを記憶するカードも存在する。   For example, the ROM of the IC card stores an information processing program executed inside the IC card. There is also a card such as a JAVA (registered trademark) card in which an EEPROM of an IC card stores a downloaded information processing program.

特開2012−33197号公報JP 2012-33197 A

プログラムの高機能化を実現し、多くの機能を実装するためには、より大きな容量のプログラムメモリを必要とする。ICカード運用時の高機能化が進み、運用時に使用されるプログラム容量が大きくなり、より大きなサイズの記憶領域がプログラムメモリで必要となっている。そこで、製造時に使用され運用時に使用されない情報処理用プログラムによるメモリ占有率の低減が求められている。   In order to realize high-functionality programs and implement many functions, a program memory having a larger capacity is required. As the functionality of IC cards has been increased, the capacity of programs used during operations has increased, and a larger storage area is required for program memories. Therefore, there is a demand for a reduction in memory occupancy by an information processing program that is used during manufacture and not used during operation.

本発明の目的は、プログラムが保存され続けることによるメモリ使用効率の低下を改善することができるICカード、携帯可能電子装置、及び情報処理方法を提供することである。   An object of the present invention is to provide an IC card, a portable electronic device, and an information processing method that can improve a decrease in memory usage efficiency due to a program being continuously stored.

実施形態のICカードは、通信手段と、不揮発性記憶手段と、揮発性記憶手段と、情報処理手段とを備える。前記通信手段は、外部装置からのコマンドを受信し、前記外部装置に対してレスポンスを送信する。前記不揮発性記憶手段は、第1のコマンドを解釈するための第1のプログラムを記憶する。前記情報処理手段は、前記通信手段を介して受信された前記第1のコマンドを前記第1のプログラムで解釈し、前記第1のコマンドにより命じられる前記揮発性記憶手段に対する第2のプログラムの書き込み処理を実行し、前記通信手段を介して受信された第2のコマンドを前記第2のプログラムで解釈し、前記第2のコマンドにより命じられる処理を実行する。   The IC card of the embodiment includes communication means, nonvolatile storage means, volatile storage means, and information processing means. The communication means receives a command from an external device and transmits a response to the external device. The non-volatile storage means stores a first program for interpreting a first command. The information processing means interprets the first command received via the communication means by the first program, and writes the second program to the volatile storage means commanded by the first command. A process is executed, a second command received via the communication means is interpreted by the second program, and a process commanded by the second command is executed.

実施形態に係るICカードの構成の一例を示すブロック図である。It is a block diagram which shows an example of a structure of the IC card which concerns on embodiment. 制御用プログラムを格納したワーキングメモリの一例を示す概略図である。It is the schematic which shows an example of the working memory which stored the program for control. ライフサイクルフラグを格納したデータメモリの一例を示す概略図である。It is the schematic which shows an example of the data memory which stored the life cycle flag. ICカードの動作の第1例を説明するための図である。It is a figure for demonstrating the 1st example of operation | movement of an IC card. ICカードの動作の第1例を説明するための図である。It is a figure for demonstrating the 1st example of operation | movement of an IC card. ICカードの動作の第2例を説明するための図である。It is a figure for demonstrating the 2nd example of operation | movement of an IC card. ICカードの動作の第2例を説明するための図である。It is a figure for demonstrating the 2nd example of operation | movement of an IC card.

以下、実施形態について図面を参照して説明する。   Hereinafter, embodiments will be described with reference to the drawings.

図1は、実施形態に係るICカード(携帯可能電子装置)の構成の一例を示すブロック図である。   FIG. 1 is a block diagram illustrating an example of a configuration of an IC card (portable electronic device) according to an embodiment.

例えば、ICカード1は、接触式通信機能をサポートするICカードである。ICカード1は、本体2と本体2内に内蔵されたICモジュール3とを備える。ICモジュール3は、1つまたは複数のICチップ4と通信部5とを備える。ICチップ4と、通信部5とは、互いに接続された状態でICモジュール3として形成されている。   For example, the IC card 1 is an IC card that supports a contact communication function. The IC card 1 includes a main body 2 and an IC module 3 built in the main body 2. The IC module 3 includes one or a plurality of IC chips 4 and a communication unit 5. The IC chip 4 and the communication unit 5 are formed as an IC module 3 while being connected to each other.

ICチップ4は、データバス10、通信部5、CPU6、プログラムメモリ7、ワーキングメモリ8、データメモリ9などを備える。通信部5、CPU6、プログラムメモリ7、ワーキングメモリ8、データメモリ9はデータバス10を介して互いに接続されている。上記のプログラムメモリ7、ワーキングメモリ8、データメモリ9には、アドレスが設定されている。   The IC chip 4 includes a data bus 10, a communication unit 5, a CPU 6, a program memory 7, a working memory 8, a data memory 9, and the like. The communication unit 5, CPU 6, program memory 7, working memory 8, and data memory 9 are connected to each other via a data bus 10. Addresses are set in the program memory 7, working memory 8, and data memory 9.

通信部5は、外部装置(ICカードリーダライタ)との間で通信をおこなう。CPU6は、外部装置から受信した命令に応じた処理をおこなう。例えば、CPU6は、ワーキングメモリ8へ書き込み用のデータ領域を確保し、受信したデータをワーキングメモリ8上のデータ領域へ書き込む。また、CPU6は、ワーキングメモリ8上のデータを読み込み、読み込んだデータをプログラムとして実行する。   The communication unit 5 communicates with an external device (IC card reader / writer). The CPU 6 performs processing according to the command received from the external device. For example, the CPU 6 secures a data area for writing in the working memory 8 and writes the received data in the data area on the working memory 8. The CPU 6 reads data on the working memory 8 and executes the read data as a program.

プログラムメモリ7は、あらかじめ制御用プログラム及び制御用データなどを記憶する、例えばROMなどの不揮発性メモリである。   The program memory 7 is a non-volatile memory such as a ROM that stores a control program and control data in advance.

ワーキングメモリ8は、通信部5を介して外部から受信したデータを一時的に格納したり、CPU6が実行するプログラムを一時的に格納する、例えばRAMなどの揮発性メモリである。   The working memory 8 is a volatile memory such as a RAM that temporarily stores data received from the outside via the communication unit 5 or temporarily stores a program executed by the CPU 6.

データメモリ9は、ICカード1の運用状態に応じて制御プログラム、アプリケーション、および種々のデータを格納する、例えばEEPROM、FRAM(登録商標)などの不揮発性メモリである。   The data memory 9 is a non-volatile memory such as an EEPROM or FRAM (registered trademark) that stores a control program, an application, and various data in accordance with the operating state of the IC card 1.

図2は、制御用プログラム8aを格納したワーキングメモリ8の一例を示す概略図である。   FIG. 2 is a schematic diagram showing an example of the working memory 8 that stores the control program 8a.

例えば、プログラムメモリ7は、第1のコマンドを解釈するための第1のプログラムを記憶する。通信部5が、第1のコマンドを受信すると、CPU6は、第1のプログラムに基づき第1のコマンドを解釈し、第1のコマンドで命じられた処理を実行する。例えば、第1のコマンドは、書き込みデータとして第2のプログラム(制御用プログラム8a)を含み、ワーキングメモリ8へ書き込みデータを書き込む命令を含む。従って、CPU6は、第1のコマンドを解釈し、第2のプログラム(制御用プログラム8a)をワーキングメモリ8へ書き込む。   For example, the program memory 7 stores a first program for interpreting the first command. When the communication unit 5 receives the first command, the CPU 6 interprets the first command based on the first program and executes the process commanded by the first command. For example, the first command includes a second program (control program 8 a) as write data and an instruction to write the write data to the working memory 8. Accordingly, the CPU 6 interprets the first command and writes the second program (control program 8a) to the working memory 8.

上記したように、CPU6は、プログラムメモリ7に記憶されたプログラムに従い動作するが、同様に、CPU6は、ワーキングメモリ8に記憶されたプログラム(制御用プログラム8a)に従い動作する。   As described above, the CPU 6 operates in accordance with the program stored in the program memory 7. Similarly, the CPU 6 operates in accordance with the program (control program 8 a) stored in the working memory 8.

図3は、ライフサイクルフラグ9aを格納したデータメモリ9の一例を示す概略図である。   FIG. 3 is a schematic diagram showing an example of the data memory 9 storing the life cycle flag 9a.

ライフサイクルフラグ9aは、データメモリ9に記憶されるデータであり、ICカードのライフサイクルを示す。CPU6は、ライフサイクルの遷移に対応し、ライフサイクルフラグ9aを書き換える。例えば、ライフサイクルフラグ9aにより発行フェーズ(製造フェーズ)または運用フェーズが示され、ライフサイクルが発行フェーズであれば、ライフサイクルフラグ9aは発行フェーズを示し、ライフサイクルが発行フェーズから運用フェーズへ遷移すると、CPU6は、発行フェーズを示すライフサイクルフラグ9aを運用フェーズを示すライフサイクルフラグ9aへ書き換える。   The life cycle flag 9a is data stored in the data memory 9, and indicates the life cycle of the IC card. The CPU 6 rewrites the life cycle flag 9a in response to the life cycle transition. For example, if the life cycle flag 9a indicates an issuance phase (manufacturing phase) or an operation phase and the life cycle is an issuance phase, the life cycle flag 9a indicates an issuance phase, and the life cycle transitions from the issuance phase to the operation phase. The CPU 6 rewrites the life cycle flag 9a indicating the issue phase to the life cycle flag 9a indicating the operation phase.

次に図4、図5のフローチャートを用いて、ICカードの動作の第1例を説明する。   Next, a first example of the operation of the IC card will be described with reference to the flowcharts of FIGS.

前提として、ICカード1のプログラムメモリ7は、制御プログラム(第1のプログラム)を記憶している。例えば、第1のプログラムは、ワーキングメモリ8に対して制御プログラム8a(第2のプログラム)を書き込むコマンド(第1のコマンド)を解釈するためのプログラムである。例えば、第1のプログラムは、第1のコマンド及び第1のコマンドにより実行すべき処理(ワーキングメモリ8に対して第2のプログラムを書き込む処理)を含む。第1のコマンドは、書き込み対象となる第2のプログラムを有する。   As a premise, the program memory 7 of the IC card 1 stores a control program (first program). For example, the first program is a program for interpreting a command (first command) for writing the control program 8 a (second program) to the working memory 8. For example, the first program includes a first command and a process to be executed by the first command (a process for writing the second program to the working memory 8). The first command has a second program to be written.

(ステップS1)
ICカード1の通信部5は、外部装置(ICカードリーダライタなど)から第2のプログラムをワーキングメモリ8(RAM)へ書き込む第1のコマンドを受信すると、ICカード1のCPU6は、以下のような判定・処理をおこなう。
(Step S1)
When the communication unit 5 of the IC card 1 receives the first command for writing the second program to the working memory 8 (RAM) from an external device (IC card reader / writer, etc.), the CPU 6 of the IC card 1 Make proper judgments and processing.

(ステップS2)
ICカード1のCPU6は、プログラムメモリ7から、受信した第1のコマンドを含むプログラムを検索する。この場合、CPU6は、受信した第1のコマンドを含む第1のプログラムを検索することができる。さらに、CPU6は、検索された第1のプログラムに基づき、受信した第1のコマンドを解釈する。即ち、検索された第1のプログラムに含まれた、第1のコマンドにより実行すべき処理を解釈する。例えば、CPU6は、プログラムメモリ7に記憶された第1のプログラムに基づき、第1のコマンドの種別等も判定することができる。
(Step S2)
The CPU 6 of the IC card 1 searches the program memory 7 for a program that includes the received first command. In this case, the CPU 6 can search for the first program including the received first command. Further, the CPU 6 interprets the received first command based on the searched first program. In other words, the process to be executed by the first command included in the searched first program is interpreted. For example, the CPU 6 can determine the type of the first command and the like based on the first program stored in the program memory 7.

(ステップS3)
プログラムメモリ7に記憶された第1のプログラムにより、受信した第1のコマンドが、第2のプログラムをワーキングメモリ8へ書き込むコマンドであることが判明すると、ステップS4へ進む。
(Step S3)
If the first program stored in the program memory 7 determines that the received first command is a command for writing the second program to the working memory 8, the process proceeds to step S4.

(ステップS4)
CPU6は、第1のコマンドに連結された第2のプログラムをワーキングメモリ8へ転送する。CPU6は、第2のプログラムをワーキングメモリ8上で動作する制御プログラムとして設定する。CPU6は、通信部5を介して、転送の実行結果を出力し、ステップS5へ進む。例えば、第2のプログラムは、第2のコマンド及び第2のコマンドにより実行すべき処理を含む。
(Step S4)
The CPU 6 transfers the second program connected to the first command to the working memory 8. The CPU 6 sets the second program as a control program that operates on the working memory 8. The CPU 6 outputs the transfer execution result via the communication unit 5, and proceeds to step S5. For example, the second program includes a second command and a process to be executed by the second command.

(ステップS5)
CPU6は、第1のコマンドの実行結果を判定し、正常終了であれば、ステップS6へ進む。
(Step S5)
The CPU 6 determines the execution result of the first command.

(ステップS6)
CPU6は、外部装置に対して、正常終了ステータスをレスポンスデータとして応答する。ステップS1に戻り、次のコマンドを受信する。
(Step S6)
The CPU 6 responds to the external device with a normal end status as response data. Returning to step S1, the next command is received.

(ステップS7)
CPU6は、コマンドの実行結果が、正常終了でない場合、外部装置に対して、エラーステータスをレスポンスデータとして応答する。ステップS1に戻り、次のコマンドを受信する。
(Step S7)
If the execution result of the command is not a normal end, the CPU 6 responds to the external device with an error status as response data. Returning to step S1, the next command is received.

(ステップS8)
例えば、ICカード1の通信部5は、外部装置(ICカードリーダライタなど)から第2のコマンドを受信すると(ステップS1)、ワーキングメモリ8に記憶された第2のプログラムに基づき、第2のコマンドを解釈する(ステップS2)。受信した第2のコマンドが、ワーキングメモリ8に記憶された第2のプログラムを実行するコマンドと判定した場合は、ステップS9へ進む。
(Step S8)
For example, when the communication unit 5 of the IC card 1 receives a second command from an external device (such as an IC card reader / writer) (step S1), the communication unit 5 performs a second program based on the second program stored in the working memory 8. The command is interpreted (step S2). If it is determined that the received second command is a command for executing the second program stored in the working memory 8, the process proceeds to step S9.

(ステップS9)
CPU6は、ワーキングメモリ8に記憶された第2のプログラムに基づき、第2のコマンドを実行する。即ち、ワーキングメモリ8に記憶された第2のプログラムを実行する。CPU6は、通信部5を介して、第2のプログラムの実行結果に応じて、正常終了時は正常終了ステータスを外部装置へ応答し、正常終了以外の時はエラーステータスを外部装置へ応答する。
(Step S9)
The CPU 6 executes the second command based on the second program stored in the working memory 8. That is, the second program stored in the working memory 8 is executed. The CPU 6 responds to the external device with a normal end status at the normal end and responds with an error status to the external device at a time other than the normal end according to the execution result of the second program via the communication unit 5.

ステップS8において、CPU6が、別のコマンドと判定した場合は、ステップS7へ移行し、通信部5を介して、エラーステータスを外部装置へ応答する。   In step S8, if the CPU 6 determines that the command is another command, the process proceeds to step S7, and the error status is returned to the external device via the communication unit 5.

なお、上記説明では、プログラムメモリ7が、第1のプログラムを記憶し、ワーキングメモリ8が、第2のプログラムを記憶するケースについて説明したが、さらに、プログラムメモリ7が、第3のプログラムを記憶してもよい。例えば、第3のプログラムは、第3のコマンド及び第3のコマンドにより実行すべき処理を含む。例えば、第3のコマンドは、第2のコマンドに対応する処理を実行した後で、外部装置から送信されるコマンドである。つまり、第1のコマンドは、プログラムメモリ7に記憶された第1のプログラムで解釈され、第1のコマンドの後続で送信される第2のコマンドは、ワーキングメモリ8に記憶された第2のプログラムで解釈され、第2のコマンドの後続で送信される第3のコマンドは、プログラムメモリ7に記憶された第3のプログラムで解釈される。   In the above description, the case where the program memory 7 stores the first program and the working memory 8 stores the second program has been described. Further, the program memory 7 stores the third program. May be. For example, the third program includes a third command and a process to be executed by the third command. For example, the third command is a command transmitted from an external device after executing processing corresponding to the second command. That is, the first command is interpreted by the first program stored in the program memory 7, and the second command transmitted after the first command is the second program stored in the working memory 8. The third command transmitted after the second command is interpreted by the third program stored in the program memory 7.

上記処理により、ROMに記憶されたプログラムに従いコマンドに対応する処理を実行したり、RAMに記憶されたプログラムに従いコマンドに対応する処理を実行したりすることができる。つまり、プログラムをROMとRAMに分散して記憶することができる。言い換えれば、ROMだけに全てのプログラムを記憶しなくて済み、ROMに替えてRAMに一部のプログラムを書き込むことにより、ROMの記憶資源を有効活用することができる。さらに、RAMに書き込まれたプログラムは、RAMへの電力供給が途絶えると、消去されるため、プログラムのセキュリティ対策にもなる。   With the above processing, processing corresponding to the command can be executed according to the program stored in the ROM, or processing corresponding to the command can be executed according to the program stored in the RAM. That is, the program can be distributed and stored in the ROM and RAM. In other words, it is not necessary to store all the programs only in the ROM, and it is possible to effectively use the storage resources of the ROM by writing some programs in the RAM instead of the ROM. Furthermore, since the program written in the RAM is deleted when the power supply to the RAM is interrupted, it becomes a security measure for the program.

次に図6、図7のフローチャートを用いて、ICカードの動作の第2例を説明する。   Next, a second example of the operation of the IC card will be described with reference to the flowcharts of FIGS.

前提として、ICカード1のプログラムメモリ7は、制御プログラム(第1のプログラム)を記憶している。例えば、第1のプログラムは、ワーキングメモリ8に対して制御プログラム8a(第2のプログラム)を書き込むコマンド(第1のコマンド)を解釈するためのプログラムである。例えば、第1のプログラムは、第1のコマンド及び第1のコマンドにより実行すべき処理(ワーキングメモリ8に対して第2のプログラムを書き込む処理)を含み、発行フェーズ(製造フェーズ)で使用されるプログラムである。第1のコマンドは、書き込み対象となる第2のプログラムを有する。例えば、第2のプログラムは、第2のコマンド及び第2のコマンドにより実行すべき処理を含む、発行フェーズ(製造フェーズ)で使用されるプログラムである。   As a premise, the program memory 7 of the IC card 1 stores a control program (first program). For example, the first program is a program for interpreting a command (first command) for writing the control program 8 a (second program) to the working memory 8. For example, the first program includes a first command and a process to be executed by the first command (a process for writing the second program to the working memory 8), and is used in the issue phase (manufacturing phase). It is a program. The first command has a second program to be written. For example, the second program is a program used in an issue phase (manufacturing phase) including a second command and a process to be executed by the second command.

(ステップS11)
ICカード1の通信部5は、外部装置から第2のプログラムをワーキングメモリ8(RAM)へ書き込む第1のコマンドを受信すると、ICカードのCPU6は、以下のような判定・処理をおこなう。
(Step S11)
When the communication unit 5 of the IC card 1 receives the first command for writing the second program to the working memory 8 (RAM) from the external device, the CPU 6 of the IC card performs the following determination and processing.

(ステップS12)
ICカード1のCPU6は、プログラムメモリ7から、受信した第1のコマンドを含むプログラムを検索する。この場合、CPU6は、受信した第1のコマンドを含む第1のプログラムを検索することができる。さらに、CPU6は、検索された第1のプログラムに基づき、受信した第1のコマンドを解釈する。即ち、検索された第1のプログラムに含まれた、第1のコマンドにより実行すべき処理を解釈する。例えば、CPU6は、プログラムメモリ7に記憶された第1のプログラムに基づき、第1のコマンドの種別等も判定することができる。
(Step S12)
The CPU 6 of the IC card 1 searches the program memory 7 for a program that includes the received first command. In this case, the CPU 6 can search for the first program including the received first command. Further, the CPU 6 interprets the received first command based on the searched first program. In other words, the process to be executed by the first command included in the searched first program is interpreted. For example, the CPU 6 can determine the type of the first command and the like based on the first program stored in the program memory 7.

(ステップS13)
プログラムメモリ7に記憶された第1のプログラムにより、受信した第1のコマンドが、第2のプログラムをワーキングメモリ8へ書き込むコマンドであることが判明すると、ステップS14へ進む。
(Step S13)
If it is determined by the first program stored in the program memory 7 that the received first command is a command for writing the second program to the working memory 8, the process proceeds to step S14.

(ステップS14)
CPU6は、データメモリ9に記憶されたライフサイクルフラグ9aを参照し、ライフサイクルフラグ9aが発行フェーズを示す場合、ステップS15へ進む。
(Step S14)
The CPU 6 refers to the life cycle flag 9a stored in the data memory 9, and proceeds to step S15 when the life cycle flag 9a indicates the issue phase.

(ステップS15)
CPU6は、第1のコマンドに連結された第2のプログラムをワーキングメモリ8へ転送する。CPU6は、第2のプログラムをワーキングメモリ8上で動作する制御プログラムとして設定する。CPU6は、通信部5を介して、転送の実行結果を出力し、ステップS16へ進む。例えば、第2のプログラムは、第2のコマンド及び第2のコマンドにより実行すべき処理を含む。
(Step S15)
The CPU 6 transfers the second program connected to the first command to the working memory 8. The CPU 6 sets the second program as a control program that operates on the working memory 8. The CPU 6 outputs the transfer execution result via the communication unit 5, and proceeds to step S16. For example, the second program includes a second command and a process to be executed by the second command.

(ステップS16)
CPU6は、第1のコマンドの実行結果を判定し、正常終了であれば、ステップS17へ進む。
(Step S16)
The CPU 6 determines the execution result of the first command, and proceeds to step S17 if successful completion.

(ステップS17)
CPU6は、外部装置に対して、正常終了ステータスをレスポンスデータとして応答する。ステップS11に戻り、次のコマンドを受信する。
(Step S17)
The CPU 6 responds to the external device with a normal end status as response data. Returning to step S11, the next command is received.

(ステップS18)
CPU6は、コマンドの実行結果が、正常終了でない場合、外部装置に対して、エラーステータスをレスポンスデータとして応答する。ステップS11に戻り、次のコマンドを受信する。
(Step S18)
If the execution result of the command is not a normal end, the CPU 6 responds to the external device with an error status as response data. Returning to step S11, the next command is received.

(ステップS19)
例えば、ICカード1の通信部5は、外部装置(ICカードリーダライタなど)から第2のコマンドを受信すると(ステップS11)、ワーキングメモリ8に記憶された第2のプログラムに基づき、第2のコマンドを解釈する(ステップS12)。受信した第2のコマンドが、ワーキングメモリ8に記憶された第2のプログラムを実行するコマンドと判定した場合は、ステップS20へ進む。
(Step S19)
For example, when the communication unit 5 of the IC card 1 receives the second command from the external device (IC card reader / writer or the like) (step S11), the communication unit 5 performs the second program based on the second program stored in the working memory 8. The command is interpreted (step S12). When it is determined that the received second command is a command for executing the second program stored in the working memory 8, the process proceeds to step S20.

(ステップS20)
CPU6は、データメモリ9に記憶されたライフサイクルフラグ9aを参照し、ライフサイクルフラグ9aが発行フェーズを示す場合、ステップS21へ進む。
(Step S20)
The CPU 6 refers to the life cycle flag 9a stored in the data memory 9, and proceeds to step S21 when the life cycle flag 9a indicates the issue phase.

(ステップS21)
CPU6は、ワーキングメモリ8に記憶された第2のプログラムに基づき、第2のコマンドを実行する。即ち、ワーキングメモリ8に記憶された第2のプログラムを実行する。CPU6は、通信部5を介して、第2のプログラムの実行結果に応じて、正常終了時は正常終了ステータスを外部装置へ応答し、正常終了以外の時はエラーステータスを外部装置へ応答する。
(Step S21)
The CPU 6 executes the second command based on the second program stored in the working memory 8. That is, the second program stored in the working memory 8 is executed. The CPU 6 responds to the external device with a normal end status at the normal end and responds with an error status to the external device at a time other than the normal end according to the execution result of the second program via the communication unit 5.

ステップS19において、CPU6が、別のコマンドと判定した場合は、ステップS18へ移行し、通信部5を介して、エラーステータスを外部装置へ応答する。   If the CPU 6 determines that the command is another command in step S19, the process proceeds to step S18, and the error status is returned to the external device via the communication unit 5.

CPU6は、ステップ14とステップ20において、データメモリ9に記憶されたライフサイクルフラグ9aを参照し、ライフサイクルフラグ9aが運用フェーズを示す場合は、ステップS18へ移行し、エラーステータスを外部装置へ応答する。   In step 14 and step 20, the CPU 6 refers to the life cycle flag 9a stored in the data memory 9. If the life cycle flag 9a indicates the operation phase, the CPU 6 proceeds to step S18 and returns an error status to the external device. To do.

なお、上記説明では、プログラムメモリ7が、発行フェーズで使用される第1のプログラムを記憶し、ワーキングメモリ8が、発行フェーズで使用される第2のプログラムを記憶するケースについて説明したが、さらに、プログラムメモリ7が、運用フェーズで使用される第3のプログラムを記憶してもよい。例えば、第3のプログラムは、第3のコマンド及び第3のコマンドにより実行すべき処理を含む。例えば、第3のコマンドは、第2のコマンドに対応する処理を実行した後で、外部装置から送信されるコマンド(運用フェーズで利用されるコマンド)である。つまり、第1のコマンドは、プログラムメモリ7に記憶された第1のプログラムで解釈され、第1のコマンドの後続で送信される第2のコマンドは、ワーキングメモリ8に記憶された第2のプログラムで解釈され、第2のコマンドの後続で送信される第3のコマンドは、プログラムメモリ7に記憶された第3のプログラムで解釈される。   In the above description, the case where the program memory 7 stores the first program used in the issue phase and the working memory 8 stores the second program used in the issue phase has been described. The program memory 7 may store a third program used in the operation phase. For example, the third program includes a third command and a process to be executed by the third command. For example, the third command is a command (command used in the operation phase) transmitted from an external device after executing processing corresponding to the second command. That is, the first command is interpreted by the first program stored in the program memory 7, and the second command transmitted after the first command is the second program stored in the working memory 8. The third command transmitted after the second command is interpreted by the third program stored in the program memory 7.

上記処理により、ROMに記憶されたプログラムに従いコマンドに対応する処理を実行したり、RAMに記憶されたプログラムに従いコマンドに対応する処理を実行したりすることができる。つまり、プログラムをROMとRAMに分散して記憶することができる。言い換えれば、ROMだけに全てのプログラムを記憶しなくて済み、ROMに替えてRAMに一部のプログラムを書き込むことにより、ROMの記憶資源を有効活用することができる。さらに、RAMに書き込まれたプログラムは、RAMへの電力供給が途絶えると、消去されるため、プログラムのセキュリティ対策にもなる。   With the above processing, processing corresponding to the command can be executed according to the program stored in the ROM, or processing corresponding to the command can be executed according to the program stored in the RAM. That is, the program can be distributed and stored in the ROM and RAM. In other words, it is not necessary to store all the programs only in the ROM, and it is possible to effectively use the storage resources of the ROM by writing some programs in the RAM instead of the ROM. Furthermore, since the program written in the RAM is deleted when the power supply to the RAM is interrupted, it becomes a security measure for the program.

以下、本実施形態の構成についてまとめる。   The configuration of this embodiment will be summarized below.

(1)ICカードは、通信手段、揮発性記憶手段、不揮発性記憶手段、情報処理手段で構成され、外部から送信される命令を前記通信手段で受信し、これを前記情報処理手段で解釈し、前記不揮発性記憶手段に記憶された制御用プログラムを選択・実行し、その結果を前記通信手段で外部に返信する。さらに、ICカードは、外部から受信した命令1に連結された制御用プログラムを前記揮発性記憶手段へ記憶し、その結果を前記通信手段で返信し、続けて外部から受信した命令2を解釈し、前記揮発性記憶手段に記憶された制御用プログラムを選択、実行し、プログラムの実行結果を返信する。   (1) The IC card is composed of communication means, volatile storage means, nonvolatile storage means, and information processing means. The communication means receives an instruction transmitted from the outside, and interprets it by the information processing means. The control program stored in the nonvolatile storage means is selected and executed, and the result is returned to the outside by the communication means. Further, the IC card stores the control program linked to the instruction 1 received from the outside in the volatile storage means, returns the result by the communication means, and subsequently interprets the instruction 2 received from the outside. The control program stored in the volatile storage means is selected and executed, and the execution result of the program is returned.

(2)さらに、ICカードは、外部から受信した命令2を解釈し、不揮発性記憶手段に記憶されたライフサイクルデータがアプリケーション発行フェーズであることを条件として、前記揮発性記憶手段に記憶された制御用プログラムを選択、実行し、プログラムの実行結果を返信する。   (2) Further, the IC card interprets the instruction 2 received from the outside, and is stored in the volatile storage means on condition that the life cycle data stored in the nonvolatile storage means is in the application issue phase. Select and execute the control program, and return the execution result of the program.

以下、本実施形態の作用効果についてまとめる。   Hereinafter, the effects of the present embodiment will be summarized.

本実施形態によれば、運用時に使用するコマンド用のプログラムは不揮発性メモリへ記憶し、ICカード製造時(ICカード発行時)に使用するコマンド用のプログラムの一部は不揮発性メモリへ記憶し、残りは揮発性メモリへ記憶する。これにより、ICカード製造時に使用されるコマンド用の大部分のプログラム(大きな容量のプログラム)を不揮発性メモリで記憶することができる。   According to the present embodiment, a command program used at the time of operation is stored in the nonvolatile memory, and a part of the command program used at the time of IC card manufacturing (IC card issuance) is stored in the nonvolatile memory. The rest is stored in volatile memory. This makes it possible to store most of the command programs (large capacity programs) used in the manufacture of the IC card in the nonvolatile memory.

ICカード製造時に使用されるコマンド用の大部分のプログラムを揮発性メモリ上に記録することで、揮発性メモリに対する電源供給遮断によりプログラムの消去が確実となり、製造フェーズから運用フェーズへの切り替え忘れ(切り替えエラー)などが生じても、上記したICカード製造時に使用されるコマンド用の大部分のプログラムが実行されてしまうこと、及び盗用されてしまうことなどを防ぐことができる。   By recording most of the program for commands used in IC card manufacturing on the volatile memory, the power supply to the volatile memory is cut off to ensure the program is erased, and forget to switch from the manufacturing phase to the operation phase ( Even if a switching error or the like occurs, it is possible to prevent the majority of the command program used at the time of manufacturing the IC card from being executed and stolen.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。   Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and the equivalents thereof.

1…ICカード、2…本体、3…ICモジュール、4…ICチップ、5…通信部、6…CPU、7…プログラムメモリ、8…ワーキングメモリ、9…データメモリ、10…データバス DESCRIPTION OF SYMBOLS 1 ... IC card, 2 ... Main body, 3 ... IC module, 4 ... IC chip, 5 ... Communication part, 6 ... CPU, 7 ... Program memory, 8 ... Working memory, 9 ... Data memory, 10 ... Data bus

Claims (7)

外部装置からのコマンドを受信し、前記外部装置に対してレスポンスを送信する通信手段と、
不揮発性記憶手段と、
揮発性記憶手段と、
情報処理手段と、を備え、
前記不揮発性記憶手段は、第1のコマンドを解釈するための第1のプログラムを記憶し、
前記情報処理手段は、前記通信手段を介して受信された前記第1のコマンドを前記第1のプログラムで解釈し、前記第1のコマンドにより命じられる前記揮発性記憶手段に対する第2のプログラムの書き込み処理を実行し、前記通信手段を介して受信された第2のコマンドを前記第2のプログラムで解釈し、前記第2のコマンドにより命じられる処理を実行するICカード。
Communication means for receiving a command from an external device and transmitting a response to the external device;
Non-volatile storage means;
Volatile storage means;
An information processing means,
The nonvolatile memory means stores a first program for interpreting a first command,
The information processing means interprets the first command received via the communication means by the first program, and writes the second program to the volatile storage means commanded by the first command. An IC card that executes a process, interprets a second command received via the communication means by the second program, and executes a process commanded by the second command.
前記情報処理手段は、製造フェーズにおいて送信される前記第1及び第2のコマンドにより命じられる処理を実行する請求項1のICカード。   2. The IC card according to claim 1, wherein the information processing means executes processing instructed by the first and second commands transmitted in a manufacturing phase. 前記揮発性記憶手段は、製造フェーズにおいて送信される前記第2のコマンドを解釈するための前記第2のプログラムを記憶する請求項1又は2のICカード。   3. The IC card according to claim 1, wherein the volatile storage unit stores the second program for interpreting the second command transmitted in a manufacturing phase. 前記不揮発性記憶手段は、前記製造フェーズの後続の運用フェーズにおいて送信される第3のコマンドを解釈するための第3のプログラムを記憶する請求項1乃至3の何れか1つのICカード。   4. The IC card according to claim 1, wherein the nonvolatile storage unit stores a third program for interpreting a third command transmitted in an operation phase subsequent to the manufacturing phase. 前記揮発性記憶手段に記憶されたデータが消去された請求項1乃至4の何れか1つのICカード。   The IC card according to any one of claims 1 to 4, wherein data stored in the volatile storage means is erased. 外部装置からのコマンドを受信し、前記外部装置に対してレスポンスを送信する通信手段と、
不揮発性記憶手段と、
揮発性記憶手段と、
情報処理手段と、を備え、
前記不揮発性記憶手段は、第1のコマンドを解釈するための第1のプログラムを記憶し、
前記情報処理手段は、前記通信手段を介して受信された前記第1のコマンドを前記第1のプログラムで解釈し、前記第1のコマンドにより命じられる前記揮発性記憶手段に対する第2のプログラムの書き込み処理を実行し、前記通信手段を介して受信された第2のコマンドを前記第2のプログラムで解釈し、前記第2のコマンドにより命じられる処理を実行する携帯可能電子装置。
Communication means for receiving a command from an external device and transmitting a response to the external device;
Non-volatile storage means;
Volatile storage means;
An information processing means,
The nonvolatile memory means stores a first program for interpreting a first command,
The information processing means interprets the first command received via the communication means by the first program, and writes the second program to the volatile storage means commanded by the first command. A portable electronic device that executes a process, interprets a second command received via the communication means by the second program, and executes a process commanded by the second command.
第1のコマンドを解釈するための第1のプログラムを記憶した不揮発性記憶手段を備えたICカードは、
前記第1のコマンドを受信し、
前記第1のコマンドを前記第1のプログラムで解釈し、
前記第1のコマンドにより命じられる揮発性記憶手段に対する第2のプログラムの書き込み処理に従い、前記揮発性記憶手段に対して前記第2のプログラムを書き込み、
第2のコマンドを受信し、
前記第2のコマンドを前記第2のプログラムで解釈し、
前記第2のコマンドにより命じられる処理を実行する情報処理方法。
An IC card provided with a non-volatile storage means storing a first program for interpreting the first command is:
Receiving the first command;
Interpreting the first command with the first program;
According to the writing process of the second program to the volatile storage means commanded by the first command, the second program is written to the volatile storage means,
Receiving the second command,
Interpreting the second command with the second program;
An information processing method for executing a process commanded by the second command.
JP2012207973A 2012-09-21 2012-09-21 Ic card, portable electronic device, and information processing method Pending JP2014063345A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012207973A JP2014063345A (en) 2012-09-21 2012-09-21 Ic card, portable electronic device, and information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012207973A JP2014063345A (en) 2012-09-21 2012-09-21 Ic card, portable electronic device, and information processing method

Publications (1)

Publication Number Publication Date
JP2014063345A true JP2014063345A (en) 2014-04-10

Family

ID=50618521

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012207973A Pending JP2014063345A (en) 2012-09-21 2012-09-21 Ic card, portable electronic device, and information processing method

Country Status (1)

Country Link
JP (1) JP2014063345A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63159993A (en) * 1986-12-24 1988-07-02 Mitsubishi Electric Corp Ic card
JPH01223586A (en) * 1988-03-03 1989-09-06 Hitachi Maxell Ltd Ic card testing system
JP2000305799A (en) * 1999-04-23 2000-11-02 Sharp Corp Microcomputer with built-in non-volatile memory and its inspection system and ic card on which the same microcomputer is loaded and its inspection system
JP2003022425A (en) * 2001-07-09 2003-01-24 Dainippon Printing Co Ltd Ic card self-diagnostic device and diagnostic method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63159993A (en) * 1986-12-24 1988-07-02 Mitsubishi Electric Corp Ic card
JPH01223586A (en) * 1988-03-03 1989-09-06 Hitachi Maxell Ltd Ic card testing system
JP2000305799A (en) * 1999-04-23 2000-11-02 Sharp Corp Microcomputer with built-in non-volatile memory and its inspection system and ic card on which the same microcomputer is loaded and its inspection system
JP2003022425A (en) * 2001-07-09 2003-01-24 Dainippon Printing Co Ltd Ic card self-diagnostic device and diagnostic method

Similar Documents

Publication Publication Date Title
US9183400B2 (en) IC card and IC card control method
KR20070037311A (en) Portable electronic device and ic card
JP2006236200A (en) Card type storage device and host device thereof
US20120235796A1 (en) Ic card, portable electronic device, ic card issuing apparatus, and communication method
US20110227708A1 (en) Portable electronic device, communication device, and command processing method
JP2014063345A (en) Ic card, portable electronic device, and information processing method
JP4590201B2 (en) Data carrier and data carrier program
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
US8870079B2 (en) IC card, portable electronic device, IC card issuing apparatus, and command execution method
EP2782019A2 (en) IC card and portable electronic device
JP4836707B2 (en) Portable electronic device and IC card
JP5417355B2 (en) Portable electronic device, information processing method, and IC card
JP5957347B2 (en) IC card and portable electronic device
JP4868979B2 (en) Portable electronic device and IC card
JP6758910B2 (en) IC card
JP2012133656A (en) Portable electronic apparatus and ic card
JP5075549B2 (en) IC card and operation control method
JP5728323B2 (en) IC card and portable electronic device
JP6984328B2 (en) Electronic information storage medium, IC card, external device, data writing method and data writing program
JP2006302130A (en) Ic card and program for ic card
JP2013171394A (en) Ic card, manufacturing method of ic card, issuance method of ic card, and information processing method
JP5075404B2 (en) Portable electronic device, file access method and IC card in portable electronic device
JP5492172B2 (en) Portable electronic device, IC card and IC module
JP2011198107A (en) Portable electronic device
JP5259541B2 (en) Portable electronic device, method for controlling portable electronic device, and IC card

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20140109

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150306

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160119

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160209

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20160816