JP3607658B2 - Portable electronic device - Google Patents

Portable electronic device Download PDF

Info

Publication number
JP3607658B2
JP3607658B2 JP2001310061A JP2001310061A JP3607658B2 JP 3607658 B2 JP3607658 B2 JP 3607658B2 JP 2001310061 A JP2001310061 A JP 2001310061A JP 2001310061 A JP2001310061 A JP 2001310061A JP 3607658 B2 JP3607658 B2 JP 3607658B2
Authority
JP
Japan
Prior art keywords
writing
area
commit buffer
buffer area
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2001310061A
Other languages
Japanese (ja)
Other versions
JP2003114831A (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.)
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 JP2001310061A priority Critical patent/JP3607658B2/en
Publication of JP2003114831A publication Critical patent/JP2003114831A/en
Application granted granted Critical
Publication of JP3607658B2 publication Critical patent/JP3607658B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、たとえば、書込み、書換えが可能な不揮発性メモリおよびCPUなどの制御素子を有し、外部からのデータの入出力を行なう手段を備えたICチップを内蔵した、いわゆるICカードと称される携帯可能電子装置に関する。
【0002】
【従来の技術】
この種のICカードにおいて、不揮発性メモリに対するデータの書換えの際に、データの書換え中に不慮の事故(電源断あるいはICカードの抜取りなどの事態の発生を指し、本発明ではこれをティアリングと称する)が発生しても、書込み箇所の内容が書込み以前または書込み後の状態を保証する(本発明ではこの保証をトランザクションアトミシティと称する)方式がある。
【0003】
データの書換えは、コミットバッファと称される不揮発性メモリ内の特定領域に一度実施され、その後、不揮発性メモリの実際の書込み領域へ実施する。これにより、コミットバッファ領域に全ての書込みデータが書かれる以前にティアリングが発生した場合には、実際の書込み領域には書換え以前のデータが残り、コミットバッファ領域に全ての書込みデータが書かれた以降にティアリングが発生した場合には、コミットバッファ領域に書換え後のデータが残る。
【0004】
前者の場合には、ティアリング発生後にICカードを再起動した時点で、書込み箇所のデータが書換え以前であることが保証できる。後者の場合には、ティアリング発生後にICカードを再起動した後、コミットバッファ領域の内容を書込み箇所に反映する(本発明ではこの処理をロールフォワードと称する)ことで、書込み箇所のデータが書換え後であることが保証できる。以上がトランザクションアトミシティの実装である。
【0005】
【発明が解決しようとする課題】
しかしながら、上記のトランザクションアトミシティの技術では、ロールフォワードのタイミングとティアリングが発生したことを通知する手段が明確にされていないため問題となっている。
【0006】
たとえば、複数のアプリケーションプログラムを有するマルチアプリケーションカードにおいて、ティアリングが発生した際に動作していたアプリケーションプログラムと、ティアリング発生後にICカードを再起動した後に動作するアプリケーションプログラムが異なることは充分に有りえる。ICカードの再起動後に別のアプリケーションプログラムが動いている最中にティアリングの発生を通知しても、このアプリケーションプログラムは処置の判断をすることができない。また、このアプリケーションプログラムが動作中にトランザクションアトミシティ機能を使用すると、ティアリング発生時点のコミットバッファ領域の内容が壊されてしまい、ロールフォワードできなくなってしまう。
【0007】
そこで、本発明は、ティアリング発生後、再起動した後にロールフォワードを自動的に実施し、ティアリング発生時点で動作していたアプリケーションプログラムは再起動後に当該アプリケーションプログラムが選択された後ティアリング発生の事実とその際のコミットバッファ領域の内容を知る手段を有することで、外部のシステムも含めたティアリング対策を効果的に構築できる携帯可能電子装置を提供することを目的とする。
【0008】
【課題を解決するための手段】
本発明の携帯可能電子装置は、外部からコマンドが入力されると、このコマンドに対応した所定の処理を実行してその処理結果を外部へ出力する機能を有する携帯可能電子装置において、選択的に実行される複数のアプリケーションプログラムが格納され、かつ、記憶内容が書換え可能な記憶手段と、この記憶手段内に設けられ、トランザクションアトミシティを保証するために書込みデータとこの書込みデータを書込む前記記憶手段の書込み先アドレスとを一時的に保持するコミットバッファ領域と、トランザクションアトミシティを保証する書込みを実施する際、最初に前記コミットバッファ領域への書込みデータの書込みを実施し、その後、前記記憶手段の実際の書込み領域への書込みデータの書込みを実施する第1の手段と、前記コミットバッファ領域への書込み開始、前記記憶手段の実際の書込み領域への書込み開始および終了を判断できる第2の手段と、当該携帯可能電子装置の起動時に外部から始めてのコマンドが入力された際、前記第2の手段において実際の書込み領域への書込み開始状態のままであれば、前記コミットバッファ領域の内容を前記記憶手段の実際の書込み領域に反映する処理を実施する第3の手段と、前記記憶手段内の複数のアプリケーションプログラムの個々に対応して前記コミットバッファ領域への書込み開始、前記記憶手段の実際の書込み領域への書込み開始および終了を判断できる第4の手段とを具備し、前記アプリケーションプログラムが選択された際、前記第4の手段により前回の起動時に当該アプリケーションプログラムが選択され、その際に前記コミットバッファ領域への書込みが開始されたが実際の書込み領域への書込みは終了していないことを当該アプリケーションプログラムが判断できることを特徴とする。
【0010】
また、本発明の携帯可能電子装置は、選択されたアプリケーションプログラムが前記第4の手段により前回の起動時に当該アプリケーションプログラムが選択され、その際に前記コミットバッファ領域への書込みが開始されたが実際の書込み領域への書込みは終了していないことを判断した際、前記コミットバッファ領域を参照することにより前回の起動時に処理がどこまで進んでいたかを判断できることを特徴とする。
【0012】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して説明する。
【0013】
図1は、本実施の形態に係る携帯可能電子装置としてのICカードを取扱うICカードシステムの構成例を示すものである。このICカードシステムでは、ICカード101はカードリーダ・ライタ102を介してパーソナルコンピュータなどの端末装置103と接続され、更に端末装置103と接続されたホストコンピュータ104とも通信可能に構成されている。
【0014】
図2は、ICカード101の構成例を示すもので、制御手段としてのCPUなどの制御素子201、記憶内容が書換え可能な記憶手段としての不揮発性のデータメモリ202、ワーキングメモリ203、プログラムメモリ204、および、カードリーダ・ライタ102との通信を行なうための通信部205によって構成されていて、これらは1つのICチップ(あるいは、複数のICチップ)で構成されている。このICチップはICカード内に埋設されており、接触式の場合にはICカード表面の接点部分を介してカードリーダ・ライタ102と電気的に接続するようになっている。
【0015】
データメモリ202は、各種データの記憶に使用されるもので、たとえば、EEPROMなどの記憶内容が書換え可能な不揮発性メモリで構成されている。
【0016】
ワーキングメモリ203は、制御素子201が処理を行なう際の処理データなどを一時的に保持するための作業用メモリであり、たとえば、RAMなどで構成される。
【0017】
プログラムメモリ204は、たとえば、マスクROMで構成されており、制御素子201の制御プログラムなどを記憶するものである。
【0018】
通信部205は、外部装置であるカードリーダ・ライタ102との通信を行なうためのものである。
【0019】
図3は、データメモリ202のフォーマットを示していて、アプリケーション管理テーブル領域E11およびコミットバッファ領域E12を含むシステム領域E1と、複数のアプリケーションプログラムが格納されるアプリケーション領域E2に2分される。
【0020】
図4は、コミットバッファ領域E12のフォーマットを示すもので、1バイトで表わされるコミットバッファ状態フラグ部E13、および、コミットバッファ本体部E14に2分される。コミットバッファ状態フラグ部E13は、その値により以下の状態が示される。
【0021】
00…コミットバッファ未使用あるいは実際の書込み領域への書込み終了
01…コミットバッファ処理開始
02…実際の書込み領域への書込み開始
コミットバッファ本体部E14は、書込みデータとこの書込みデータを書込むデータメモリ202の書込み先アドレスデータとの対で構成されるブロックが複数登録(記憶)できるように構成されている。
【0022】
図5は、アプリケーション管理テーブル領域E11を示すもので、カード内部に登録されたアプリケーションプログラムの数だけデータが登録される。このデータの中には1バイトで表わされるコミット状態フラグ部E15が含まれる。
【0023】
図4のコミットバッファ状態フラグ部E13が変化する際に同じ値を対応するアプリケーションプログラムのコミット状態フラグ部E15に保持する。ただし、ティアリング発生後のロールフォワード処理により、図4のコミットバッファ状態フラグ部E13は「00」となるが、これはコミット状態フラグ部E15には反映されないようになっている。
【0024】
以下、要部の処理について説明する。
【0025】
[ICカード起動時の処理]
当該ICカードが起動され、第1コマンド(起動後に始めて入力されたコマンド)が受信された際、あるいは、コミットバッファ領域E12の使用を開始する直前にコミットバッファ状態フラグ部E13の値を見て、「02」であればコミットバッファ本体部E14の内容に沿って書込み先アドレスにデータを反映するとともに、コミットバッファ状態フラグ部E13を「00」とするロールフォワード処理を実施する。
【0026】
[通常のトランザクションアトミシティ処理]
アプリケーションプログラムでトランザクションアトミシティ処理が宣言されると、コミットバッファ状態フラグ部E13を「01」として、以降の書込み処理はトランザクションアトミシティ処理終了が宣言されるまでコミットバッファ領域E12に対して実施される。
【0027】
トランザクションアトミシティ処理終了が宣言されると、コミットバッファ状態フラグ部E13を「02」として前述のロールフォワード処理を実施する。処理の最後にコミットバッファ状態フラグ部E13を「00」に戻してトランザクションアトミシティ処理が終了する。
【0028】
[ティアリング通知]
アプリケーションプログラムは、アプリケーション管理テーブルE11の中から対応するアプリケーションプログラムの内容のみを参照できる。これにより、コミット状態フラグ部E13を参照することで、以前に選択された際にティアリングが発生したか否かを判断できる。アプリケーションプログラムは、ティアリング発生を確認した場合には外部と協調してその対応を実施するとともに、このコミット状態フラグ部E13をクリア(00)することができる。
【0029】
次に、全体的な処理の流れについて図6に示すフローチャートを参照して説明する。当該ICカードが起動されると、制御素子201は、カードリーダ・ライタ102に対してアンサー・ツー・リセット(ATR)と称される初期応答データを送信し(ステップS1)、受信待機状態となる(ステップS2)。
【0030】
この状態において、カードリーダ・ライタ102から第1コマンド(起動後の最初のコマンド)を受信すると(ステップS3)、制御素子201は、コミットバッファ状態フラグ部E13の値を参照することにより、コミットバッファ領域E12に未処理データがあるか否かをチェックする(ステップS4)。この場合、コミットバッファ領域E12に未処理データはないので、受信したコマンドに対する処理を開始する(ステップS5)。
【0031】
コマンド処理開始後、当該アプリケーションプログラムでトランザクションアトミシティ処理開始が宣言されると(ステップS6)、制御素子201は、コミットバッファ状態フラグ部E13を「01」として、以降の全てのデータ書込み処理はトランザクションアトミシティ処理終了が宣言されるまでコミットバッファ領域E12に対して実施する(ステップS7)。
【0032】
その後、当該アプリケーションプログラムでトランザクションアトミシティ処理終了が宣言されると(ステップS8)、制御素子201は、コミットバッファ状態フラグ部E13を「02」としてロールフォワード処理を実施する(ステップS9)。処理の最後に、コミットバッファ状態フラグ部E13を「00」に戻してトランザクションアトミシティ処理が終了する。
【0033】
次に、コマンド処理が終了すると(ステップS10)、制御素子201は、そのコマンド処理に対するレスポンスをカードリーダ・ライタ102へ送信し(ステップS11)、受信待機状態となる(ステップS12)。ここで、カードリーダ・ライタ102から第2コマンド(起動後2番目のコマンド)を受信すると(ステップS13)、制御素子201はステップS5に戻り、上記同様な処理を繰り返す。
【0034】
ところで、たとえば、ステップS9のロールフォワード処理、すなわち、コミットバッファ領域E12の内容をデータメモリ202の書込みが指示された領域へ反映する処理を行なっている途中において、ティアリングが発生した場合、その後、当該ICカードが再起動される。再起動されると、制御素子201は、カードリーダ・ライタ102に対してアンサー・ツー・リセット(ATR)と称される初期応答データを送信し(ステップS14)、受信待機状態となる(ステップS15)。
【0035】
この状態において、カードリーダ・ライタ102から第1コマンド(再起動後の最初のコマンド)を受信すると(ステップS16)、制御素子201は、コミットバッファ状態フラグ部E13の値を参照することにより、コミットバッファ領域E12に未処理データがあるか否かをチェックする(ステップS17)。この場合、コミットバッファ領域E12は「02」となっている、すなわち、コミットバッファ領域E12に未処理データが存在するので、コミットバッファ領域E12の未処理データをデータメモリ202の書込みが指示された領域へ反映する処理を行なうとともに、コミットバッファ状態フラグ部E13を「00」とするロールフォワード処理を実施する。
【0036】
ロールフォワード処理が終了すると、制御素子201は、受信したコマンドに対する処理を開始する(ステップS19)。
【0037】
【発明の効果】
以上詳述したように本発明によれば、ティアリング発生後、再起動した後にロールフォワードを自動的に実施し、ティアリング発生時点で動作していたアプリケーションプログラムは再起動後に当該アプリケーションプログラムが選択された後ティアリング発生の事実とその際のコミットバッファ領域の内容を知る手段を有することで、外部のシステムも含めたティアリング対策を効果的に構築できる携帯可能電子装置を提供できる。
【図面の簡単な説明】
【図1】本発明の実施の形態に係るICカードを取扱うICカードシステムの構成例を示すブロック図。
【図2】ICカードの構成例を示すブロック図。
【図3】データメモリのフォーマットを示す図。
【図4】コミットバッファ領域のフォーマットを示す図。
【図5】アプリケーション管理テーブル領域のフォーマットを示す図。
【図6】全体的な処理の流れについて説明するフローチャート。
【符号の説明】
101…ICカード(携帯可能電子装置)、102…カードリーダ・ライタ、103…端末装置、104…ホストコンピュータ、201…制御素子、202…データメモリ(記憶手段)、203…ワーキングメモリ、204…プログラムメモリ、205…通信部、E1…システム領域、E2…アプリケーション領域、E11…アプリケーション管理テーブル領域、E12…コミットバッファ領域、E13…コミットバッファ状態フラグ部、E14…コミットバッファ本体部。
[0001]
BACKGROUND OF THE INVENTION
The present invention is referred to as a so-called IC card having a control element such as a non-volatile memory that can be written and rewritten and a CPU and a means for inputting / outputting data from the outside. The present invention relates to a portable electronic device.
[0002]
[Prior art]
In this type of IC card, when data is rewritten to the non-volatile memory, an unexpected accident occurs during data rewriting (such as a power failure or removal of the IC card, which is referred to as tearing in the present invention). ) Occurs, there is a system in which the content of the writing location guarantees the state before or after writing (in the present invention, this guarantee is called transaction atomicity).
[0003]
Data rewriting is performed once on a specific area in the nonvolatile memory called a commit buffer, and then on the actual writing area of the nonvolatile memory. As a result, if tearing occurs before all the write data is written in the commit buffer area, the data before the rewrite remains in the actual write area, and after all the write data is written in the commit buffer area. When tearing occurs, the rewritten data remains in the commit buffer area.
[0004]
In the former case, when the IC card is restarted after the occurrence of tearing, it can be assured that the data at the writing location is before rewriting. In the latter case, after restarting the IC card after occurrence of tearing, the contents of the commit buffer area are reflected in the writing location (in the present invention, this processing is called roll forward), so that the data at the writing location is rewritten. Can be guaranteed. The above is the implementation of transaction atomicity.
[0005]
[Problems to be solved by the invention]
However, the above-described transaction atomicity technique is problematic because the means for notifying the roll-forward timing and the occurrence of tearing are not clarified.
[0006]
For example, in a multi-application card having a plurality of application programs, the application program that was operating when tearing occurred and the application program that is operated after restarting the IC card after tearing are sufficiently different. Even if the occurrence of tearing is notified while another application program is running after the IC card is restarted, this application program cannot determine the treatment. Also, if the transaction atomicity function is used while this application program is operating, the contents of the commit buffer area at the time of tearing will be destroyed and roll forward will not be possible.
[0007]
Therefore, the present invention automatically performs roll forward after restarting after occurrence of tearing, and the application program that was operating at the time of occurrence of tearing is the fact that tearing occurs after the application program is selected after restarting. It is an object of the present invention to provide a portable electronic device that can effectively construct a countermeasure against tearing including an external system by having means for knowing the contents of the commit buffer area at that time.
[0008]
[Means for Solving the Problems]
Portable electronic device of the present invention, when a command is inputted from the outside, by performing a predetermined process corresponding to the command in the portable electronic apparatus having a function of outputting the processing result to the external, selectively A plurality of application programs to be executed and storage means in which the storage contents can be rewritten , and the storage provided in the storage means for writing the write data and the write data to guarantee transaction atomicity When performing a write that guarantees transaction atomicity and a commit buffer area that temporarily holds a write destination address of the means, a write data is first written to the commit buffer area, and then the storage means A first means for writing the write data to the actual write area of The second means that can determine the start of writing to the memory buffer area, the start and end of writing to the actual writing area of the storage means, and when the first command from the outside is input when the portable electronic device is activated, If the second means remains in the state of starting writing to the actual write area, the third means for executing processing for reflecting the contents of the commit buffer area in the actual write area of the storage means, and the storage And a fourth means capable of judging the start of writing to the commit buffer area and the start and end of writing to the actual write area of the storage means corresponding to each of a plurality of application programs in the means, When a program is selected, the application program is selected at the time of the previous activation by the fourth means. , Where the committed writes writing to the buffer area has been started but the actual to the write area is characterized in that it can be determined that the application program that has not been finished.
[0010]
In the portable electronic device of the present invention, the selected application program is selected by the fourth means at the time of previous activation, and writing to the commit buffer area is started at that time. When it is determined that writing to the write area has not been completed, it is possible to determine how far the processing has progressed at the previous activation by referring to the commit buffer area.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0013]
FIG. 1 shows a configuration example of an IC card system that handles an IC card as a portable electronic device according to the present embodiment. In this IC card system, the IC card 101 is connected to a terminal device 103 such as a personal computer via a card reader / writer 102, and further configured to be able to communicate with a host computer 104 connected to the terminal device 103.
[0014]
FIG. 2 shows a configuration example of the IC card 101. A control element 201 such as a CPU as a control means, a nonvolatile data memory 202 as a storage means capable of rewriting stored contents, a working memory 203, and a program memory 204. , And a communication unit 205 for performing communication with the card reader / writer 102, which are constituted by one IC chip (or a plurality of IC chips). This IC chip is embedded in the IC card, and in the case of a contact type, it is electrically connected to the card reader / writer 102 via a contact portion on the surface of the IC card.
[0015]
The data memory 202 is used for storing various types of data, and is composed of, for example, a nonvolatile memory such as an EEPROM that can rewrite stored contents.
[0016]
The working memory 203 is a working memory for temporarily storing processing data when the control element 201 performs processing, and is configured by, for example, a RAM.
[0017]
The program memory 204 is composed of, for example, a mask ROM, and stores a control program for the control element 201 and the like.
[0018]
The communication unit 205 is for communicating with the card reader / writer 102 which is an external device.
[0019]
FIG. 3 shows the format of the data memory 202, which is divided into a system area E1 including an application management table area E11 and a commit buffer area E12, and an application area E2 in which a plurality of application programs are stored.
[0020]
FIG. 4 shows a format of the commit buffer area E12, which is divided into a commit buffer status flag part E13 represented by 1 byte and a commit buffer body part E14. The commit buffer status flag part E13 indicates the following status depending on its value.
[0021]
00: Commit buffer unused or end of writing to actual write area 01: Start of commit buffer processing 02 ... Start of writing to actual write area The commit buffer main body E14 writes the write data and the data memory 202 for writing the write data. A plurality of blocks composed of pairs with the write destination address data can be registered (stored).
[0022]
FIG. 5 shows an application management table area E11, in which data is registered as many as the number of application programs registered in the card. This data includes a commit state flag portion E15 represented by 1 byte.
[0023]
When the commit buffer state flag part E13 in FIG. 4 changes, the same value is held in the commit state flag part E15 of the corresponding application program. However, due to the roll forward process after the occurrence of tearing, the commit buffer state flag part E13 in FIG. 4 becomes “00”, but this is not reflected in the commit state flag part E15.
[0024]
Hereinafter, processing of the main part will be described.
[0025]
[Process when IC card starts]
When the IC card is activated and the first command (command input for the first time after activation) is received, or immediately before the use of the commit buffer area E12 is started, the value of the commit buffer status flag part E13 is viewed. If it is “02”, the data is reflected in the write destination address along the contents of the commit buffer main body E14, and the roll forward processing for setting the commit buffer status flag part E13 to “00” is performed.
[0026]
[Normal transaction atomicity processing]
When transaction atomicity processing is declared in the application program, the commit buffer state flag portion E13 is set to “01”, and subsequent writing processing is performed on the commit buffer area E12 until the end of transaction atomicity processing is declared. .
[0027]
When the transaction atomicity process end is declared, the above-described roll forward process is performed with the commit buffer status flag part E13 set to “02”. At the end of the process, the commit buffer status flag part E13 is returned to “00”, and the transaction atomicity process ends.
[0028]
[Tearing notification]
The application program can refer only to the contents of the corresponding application program from the application management table E11. Thereby, by referring to the commit state flag part E13, it can be determined whether tearing has occurred or not when it has been selected before. When the occurrence of tearing is confirmed, the application program cooperates with the outside to implement the response and clear (00) the commit state flag part E13.
[0029]
Next, the overall processing flow will be described with reference to the flowchart shown in FIG. When the IC card is activated, the control element 201 transmits initial response data called answer-to-reset (ATR) to the card reader / writer 102 (step S1), and enters a reception standby state. (Step S2).
[0030]
In this state, when the first command (first command after activation) is received from the card reader / writer 102 (step S3), the control element 201 refers to the value of the commit buffer status flag section E13 to thereby determine the commit buffer. It is checked whether or not there is unprocessed data in the area E12 (step S4). In this case, since there is no unprocessed data in the commit buffer area E12, processing for the received command is started (step S5).
[0031]
After the command processing is started, when the transaction atomicity processing start is declared in the application program (step S6), the control element 201 sets the commit buffer status flag section E13 to “01”, and all subsequent data write processing is performed as a transaction. The process is performed on the commit buffer area E12 until the end of the atomicity process is declared (step S7).
[0032]
Thereafter, when the transaction atomicity process end is declared in the application program (step S8), the control element 201 sets the commit buffer state flag part E13 to “02” and performs the roll forward process (step S9). At the end of the process, the commit buffer status flag part E13 is returned to “00”, and the transaction atomicity process ends.
[0033]
Next, when the command processing ends (step S10), the control element 201 transmits a response to the command processing to the card reader / writer 102 (step S11), and enters a reception standby state (step S12). When the second command (second command after activation) is received from the card reader / writer 102 (step S13), the control element 201 returns to step S5 and repeats the same processing as described above.
[0034]
By the way, for example, if tearing occurs during the roll forward process in step S9, that is, the process of reflecting the contents of the commit buffer area E12 to the area instructed to be written to the data memory 202, The IC card is restarted. When restarted, the control element 201 transmits initial response data called answer-to-reset (ATR) to the card reader / writer 102 (step S14), and enters a reception standby state (step S15). ).
[0035]
In this state, when the first command (first command after restart) is received from the card reader / writer 102 (step S16), the control element 201 refers to the value of the commit buffer status flag part E13 to commit the command. It is checked whether or not there is unprocessed data in the buffer area E12 (step S17). In this case, the commit buffer area E12 is “02”, that is, since there is unprocessed data in the commit buffer area E12, the area in which the unprocessed data in the commit buffer area E12 is instructed to be written to the data memory 202. And a roll-forward process for setting the commit buffer state flag part E13 to “00”.
[0036]
When the roll-forward process ends, the control element 201 starts a process for the received command (step S19).
[0037]
【The invention's effect】
As described above in detail, according to the present invention, after the occurrence of tearing, the roll forward is automatically performed after the restart, and the application program that was operating at the time of the occurrence of the tearing is selected after the restart. By having means for knowing the fact that post-tearing has occurred and the contents of the commit buffer area at that time, it is possible to provide a portable electronic device that can effectively construct a countermeasure against tearing including an external system.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration example of an IC card system that handles an IC card according to an embodiment of the present invention.
FIG. 2 is a block diagram illustrating a configuration example of an IC card.
FIG. 3 is a diagram showing a format of a data memory.
FIG. 4 is a diagram showing a format of a commit buffer area.
FIG. 5 is a diagram showing a format of an application management table area.
FIG. 6 is a flowchart for explaining the overall processing flow;
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 101 ... IC card (portable electronic device), 102 ... Card reader / writer, 103 ... Terminal device, 104 ... Host computer, 201 ... Control element, 202 ... Data memory (storage means), 203 ... Working memory, 204 ... Program Memory, 205 ... communication unit, E1 ... system area, E2 ... application area, E11 ... application management table area, E12 ... commit buffer area, E13 ... commit buffer status flag part, E14 ... commit buffer main part.

Claims (2)

外部からコマンドが入力されると、このコマンドに対応した所定の処理を実行してその処理結果を外部へ出力する機能を有する携帯可能電子装置において、
選択的に実行される複数のアプリケーションプログラムが格納され、かつ、記憶内容が書換え可能な記憶手段と、
この記憶手段内に設けられ、トランザクションアトミシティを保証するために書込みデータとこの書込みデータを書込む前記記憶手段の書込み先アドレスとを一時的に保持するコミットバッファ領域と、
トランザクションアトミシティを保証する書込みを実施する際、最初に前記コミットバッファ領域への書込みデータの書込みを実施し、その後、前記記憶手段の実際の書込み領域への書込みデータの書込みを実施する第1の手段と、
前記コミットバッファ領域への書込み開始、前記記憶手段の実際の書込み領域への書込み開始および終了を判断できる第2の手段と、
当該携帯可能電子装置の起動時に外部から始めてのコマンドが入力された際、前記第2の手段において実際の書込み領域への書込み開始状態のままであれば、前記コミットバッファ領域の内容を前記記憶手段の実際の書込み領域に反映する処理を実施する第3の手段と、
前記記憶手段内の複数のアプリケーションプログラムの個々に対応して前記コミットバッファ領域への書込み開始、前記記憶手段の実際の書込み領域への書込み開始および終了を判断できる第4の手段とを具備し、
前記アプリケーションプログラムが選択された際、前記第4の手段により前回の起動時に当該アプリケーションプログラムが選択され、その際に前記コミットバッファ領域への書込みが開始されたが実際の書込み領域への書込みは終了していないことを当該アプリケーションプログラムが判断できることを特徴とする携帯可能電子装置。
When a command is input from the outside, in the portable electronic device having a function of executing a predetermined process corresponding to the command and outputting the processing result to the outside,
A plurality of application programs to be selectively executed, and storage means capable of rewriting stored contents;
A commit buffer area that is provided in the storage means and temporarily holds write data and a write destination address of the storage means for writing the write data in order to guarantee transaction atomicity;
When performing writing that guarantees transaction atomicity, first write data is written to the commit buffer area, and then write data is written to the actual write area of the storage means. Means,
Second means capable of determining the start of writing to the commit buffer area, the start and end of writing to the actual write area of the storage means;
If the first command from the outside is input when the portable electronic device is activated, the storage means stores the contents of the commit buffer area if the second means remains in the write start state to the actual write area A third means for performing a process to be reflected in the actual writing area of
A fourth means capable of determining the start of writing to the commit buffer area and the start and end of writing to the actual write area of the storage means corresponding to each of a plurality of application programs in the storage means;
When the application program is selected, the application program is selected by the fourth means at the previous startup, and writing to the commit buffer area is started at that time, but writing to the actual writing area is completed. A portable electronic device characterized in that the application program can determine that it is not .
選択されたアプリケーションプログラムが前記第4の手段により前回の起動時に当該アプリケーションプログラムが選択され、その際に前記コミットバッファ領域への書込みが開始されたが実際の書込み領域への書込みは終了していないことを判断した際、前記コミットバッファ領域を参照することにより前回の起動時に処理がどこまで進んでいたかを判断できることを特徴とする請求項記載の携帯可能電子装置。The selected application program is selected by the fourth means at the time of previous activation, and writing to the commit buffer area is started at that time, but writing to the actual writing area is not completed. when it is determined that, portable electronic device according to claim 1, characterized in that it can be determined whether or not progressed far processing the last start time by referring to the commit buffer area.
JP2001310061A 2001-10-05 2001-10-05 Portable electronic device Expired - Lifetime JP3607658B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001310061A JP3607658B2 (en) 2001-10-05 2001-10-05 Portable electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001310061A JP3607658B2 (en) 2001-10-05 2001-10-05 Portable electronic device

Publications (2)

Publication Number Publication Date
JP2003114831A JP2003114831A (en) 2003-04-18
JP3607658B2 true JP3607658B2 (en) 2005-01-05

Family

ID=19129108

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001310061A Expired - Lifetime JP3607658B2 (en) 2001-10-05 2001-10-05 Portable electronic device

Country Status (1)

Country Link
JP (1) JP3607658B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2838536B1 (en) * 2002-04-16 2005-06-24 A S K METHOD OF MODIFYING DATA OF A MEMORY CARD DURING A TRANSACTION
JP2005338926A (en) 2004-05-24 2005-12-08 Toshiba Corp Portable electronic device
JP5971713B2 (en) * 2012-09-20 2016-08-17 株式会社東芝 IC card
EP3229147A4 (en) * 2014-12-24 2017-12-27 Huawei Technologies Co., Ltd. Transaction processing method, device and computer system
JPWO2017060941A1 (en) * 2015-10-05 2018-04-19 株式会社日立製作所 Data management system and data management method for maintaining consistency of plural data

Also Published As

Publication number Publication date
JP2003114831A (en) 2003-04-18

Similar Documents

Publication Publication Date Title
US9004349B2 (en) IC card and IC card system having suspend/resume functions
JP4768237B2 (en) Portable electronic device and method for controlling portable electronic device
JP2001283174A (en) Ic card, ic chip, method for guaranteeing data and method for monitoring power source
JP2002123806A (en) Ic card, data update control method, data/message restoration control method, and storage medium with control program recorded thereon
EP0825530A2 (en) Computer apparatus having electrically rewritable nonvolatile memory, and nonvolatile semiconductor memory
TW460836B (en) Microcomputer having built-in nonvolatile memory
US6483746B2 (en) Electronic apparatus
JP3607658B2 (en) Portable electronic device
JP2003216511A (en) Non-volatile memory device, data updating method, data updating program and computer readable recording medium with recorded program
JP6233134B2 (en) Electronic information storage medium, information processing method, and information processing program
JP2009009602A (en) Ic card and ic card program
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
JP4784138B2 (en) IC card and IC card program
JP6281302B2 (en) Information processing apparatus, IC card, and data processing method
JP2004348342A (en) Ic card and method for processing ic card
JP7322923B2 (en) Secure element, transaction control method and device
JP7420179B1 (en) Electronic information storage medium, IC card, issuance processing method, and program
JP2007172301A (en) Ic card having function of protecting data during transaction execution, and ic card program
JP5341947B2 (en) IC card, control method of IC card, and control method of portable electronic device
JP2003331236A (en) Portable electronic device
JP4810108B2 (en) IC card and control method thereof
JP6252341B2 (en) Electronic information storage medium, information processing method, and information processing program
JP2022106442A (en) Electronic information storage medium, patch program writing method, and program
JPH04205291A (en) Ic card and information transmitting system
JP3128817B2 (en) Memory type determination method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040120

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040405

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041007

R151 Written notification of patent or utility model registration

Ref document number: 3607658

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20081015

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20081015

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091015

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101015

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111015

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20111015

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121015

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20131015

Year of fee payment: 9