JP6252341B2 - Electronic information storage medium, information processing method, and information processing program - Google Patents

Electronic information storage medium, information processing method, and information processing program Download PDF

Info

Publication number
JP6252341B2
JP6252341B2 JP2014092653A JP2014092653A JP6252341B2 JP 6252341 B2 JP6252341 B2 JP 6252341B2 JP 2014092653 A JP2014092653 A JP 2014092653A JP 2014092653 A JP2014092653 A JP 2014092653A JP 6252341 B2 JP6252341 B2 JP 6252341B2
Authority
JP
Japan
Prior art keywords
data
update
record
indicating
storage area
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.)
Active
Application number
JP2014092653A
Other languages
Japanese (ja)
Other versions
JP2015210707A (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 JP2014092653A priority Critical patent/JP6252341B2/en
Publication of JP2015210707A publication Critical patent/JP2015210707A/en
Application granted granted Critical
Publication of JP6252341B2 publication Critical patent/JP6252341B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

TLV構造のレコードを格納するデータ格納領域と書き込み保証用のバッファ領域を有する不揮発性メモリを備えるICチップ等の電子情報記憶媒体の技術分野に関する。   The present invention relates to a technical field of an electronic information storage medium such as an IC chip including a non-volatile memory having a data storage area for storing a record having a TLV structure and a buffer area for writing guarantee.

従来から、ICチップでは、不揮発性メモリへの書き込み処理中の引き抜き等による電源供給の中断に対処するため、トランザクション(Transaction)という仕組みが利用されている。トランザクションとは、特定の一連の処理の開始前もしくは終了後のどちらかの状態のみを取り得る仕組みのことをいう。この仕組みにより、不揮発性メモリのデータ格納領域に格納されるレコードが中途半端な内部状態とならないようにしている。特許文献1には、不揮発性メモリの書き込み先に対してデータの書き込み処理を行なっている途中で、ICカードリーダライターからICカードが引き抜かれたり、また電源瞬断などが発生するなどでデータの書き込み処理が失敗した場合でも、この書き込みデータが破壊されることがないように構成されている。   2. Description of the Related Art Conventionally, in IC chips, a mechanism called “Transaction” has been used to cope with interruption of power supply due to extraction or the like during writing processing to a nonvolatile memory. A transaction refers to a mechanism that can take only a state before or after the start of a specific series of processing. This mechanism prevents the records stored in the data storage area of the nonvolatile memory from being incompletely internal. In Patent Document 1, data is written when an IC card is pulled out from an IC card reader / writer or an instantaneous power interruption occurs while data is being written to a nonvolatile memory write destination. Even if the write process fails, the write data is not destroyed.

ところで、ICチップでは、TLV(タグ(Tag)、データ長(Length)、データ値(Value))構造のレコード(データオブジェクト)を不揮発性メモリに書き込む場合、データの整合性を担保するため、不揮発性メモリに格納されているレコード、及びレコード管理情報(格納済みレコード数、レコードのチェックコードなど)を1回のトランザクションで更新するようになっている。このトランザクションにおける書き込み保証機能では、当該トランザクション中、更新用のレコード(更新後のレコード)を書き込み保証用のバッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするように構成されている。更新用のレコード(不揮発性メモリに書き込むレコード)のデータ長(レコード長)が上記バッファ領域の容量以下の場合、1回のトランザクションで更新が完了し、コミットするまでに更新が中断しても、レコード及びレコード数などの整合性を保証することができる。   By the way, in an IC chip, when a record (data object) having a TLV (tag, tag, data length (length), and data value (value)) structure is written to a nonvolatile memory, a nonvolatile memory is used to ensure data consistency. The records stored in the memory and the record management information (number of stored records, record check code, etc.) are updated in one transaction. In this transaction, the write guarantee function stores the update record (updated record) in the write guarantee buffer area, updates the record in the data storage area, and commits the update during the transaction. It is configured. If the data length (record length) of the record for update (record to be written in the non-volatile memory) is less than the capacity of the buffer area, even if the update is completed in one transaction and the update is interrupted before committing, Consistency such as records and the number of records can be guaranteed.

特開2008−9521号公報Japanese Patent Laid-Open No. 2008-9521

しかしながら、更新用のレコードのデータ長が上記バッファ領域の容量を超える場合、複数回のコミットが行われるため、書き込み処理中の引き抜き等により更新が中断した場合、データの整合性が保証できないことがある。例えば、更新前のデータ値が途中から出力、つまり、意図しないデータ(中途半端なデータ)が外部に出力される可能性がある。   However, if the data length of the record for update exceeds the capacity of the buffer area, multiple commits are performed. Therefore, if the update is interrupted due to extraction during write processing, data consistency cannot be guaranteed. is there. For example, the data value before the update may be output from the middle, that is, unintended data (halfway data) may be output to the outside.

そこで、本発明は、更新用のレコードのデータ長がバッファ領域の容量を超える場合であっても、意図しないデータが外部に出力されることを回避することが可能な電子情報記憶媒体、情報処理方法、及び情報処理プログラムを提供することを目的とする。   Therefore, the present invention provides an electronic information storage medium, information processing capable of avoiding unintended data output to the outside even when the data length of the record for update exceeds the capacity of the buffer area It is an object to provide a method and an information processing program.

上記課題を解決するために、請求項1に記載の発明は、少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、更新用のレコードで前記データ格納領域のレコードを更新する際に、当該更新用のレコードの全部又は一部を前記バッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体において、前記プロセッサは、前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新手段と、前記第1更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新手段と、前記第2更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新手段と、前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新手段と、を備えることを特徴とする。   In order to solve the above problem, the invention according to claim 1 is a data storage area for storing a record including at least data indicating a data value and data indicating a data length of the data value, and a buffer. A non-volatile memory having at least an area, and when updating a record in the data storage area with an update record, the data storage area is stored after all or part of the update record is stored in the buffer area. An electronic information storage medium comprising: a processor that updates the record and commits the update, wherein the processor stores a record in the data storage area when a data length of the record for update exceeds a capacity of the buffer area The data indicating the data length included in is updated to a value indicating that there is no data, and the update is committed After the commit by the first update means and the first update means, data indicating a data value corresponding to the capacity of the buffer area among all data included in the update record and included in the record in the data storage area The second update unit that updates the data other than the data indicating the data length and commits the update, and after the commit by the second update unit, is used for the update among all the data included in the update record. Update the remaining non-updated data included in the record in the data storage area with the remaining data that has not been updated, and update all the data included in the update record to update the update. Data used to indicate the data length included in the update record, the data included in the data storage area record Updating data indicating the, characterized in that it comprises a fourth updating means for committing the update, the.

請求項2に記載の発明は、請求項1に記載の電子情報記憶媒体において、前記データがないことを示す値は0であることを特徴とする。   According to a second aspect of the present invention, in the electronic information storage medium according to the first aspect, a value indicating that there is no data is 0.

請求項3に記載の発明は、請求項1または2に記載の電子情報記憶媒体において、前記第3更新手段は、前記更新用のレコードに含まれるデータ値を示すデータが全てが更新に利用されるまで、更新に利用されていないデータ値を示すデータで、前記データ格納領域のレコードに含まれる更新されていないデータ値を示すデータを更新し、当該更新をコミットすることを繰り返すことを特徴とする。   According to a third aspect of the present invention, in the electronic information storage medium according to the first or second aspect, the third update means uses all the data indicating the data value included in the update record for updating. Until the data indicating the data value not used for updating is updated with the data indicating the data value not updated included in the record of the data storage area, and the update is repeatedly committed. To do.

請求項4に記載の発明は、少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、更新用のレコードで前記データ格納領域のレコードを更新する際に、当該データ格納領域のレコードの全部又は一部を前記バッファ領域にバックアップした後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体において前記プロセッサにより実行される情報処理方法であって、前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新ステップと、前記第1更新ステップによるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新ステップと、前記第2更新ステップによるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新ステップと、前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新ステップと、を含むことを特徴とする。   The invention according to claim 4 is a non-volatile memory having at least a data storage area for storing a record including at least data indicating a data value and data indicating a data length of the data value, and a buffer area And when updating a record in the data storage area with an update record, after all or part of the record in the data storage area is backed up in the buffer area, the record in the data storage area is updated, An information processing method executed by the processor in an electronic information storage medium comprising: a processor that commits an update, wherein a data length of the update record exceeds a capacity of the buffer area; The data indicating the data length included in the record is updated to a value indicating that there is no data. A first update step for committing the update, and data indicating a data value corresponding to the capacity of the buffer area among all data included in the update record after the commit in the first update step, and the data storage area A second update step for updating the data other than the data indicating the data length included in the record, and committing the update; and after the commit in the second update step, all the data included in the update record A third update step of updating the remaining unupdated data included in the record of the data storage area with the remaining data not used for update, and committing the update, and included in the record for update When all the data to be updated is used for updating, the data indicating the data length included in the update record, Updating data indicating the data length included in the record of the data storage area, characterized in that it comprises a fourth updating step of committing the update, the.

請求項5に記載の発明は、少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、更新用のレコードで前記データ格納領域のレコードを更新する際に、当該更新用のレコードの全部又は一部を前記バッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体における前記プロセッサを、前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新手段と、前記第1更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新手段と、前記第2更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新手段と、前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新手段として機能させることを特徴とする。   The invention according to claim 5 is a non-volatile memory having at least a data storage area for storing a record including at least data indicating a data value and data indicating a data length of the data value, and a buffer area When updating the record in the data storage area with the update record, after storing all or a part of the update record in the buffer area, the record in the data storage area is updated and the update is performed. Data indicating the data length included in the record of the data storage area when the data length of the record for update exceeds the capacity of the buffer area, the processor in the electronic information storage medium comprising: Update to a value indicating that there is no data and commit the update, and the first update After the commit by the means, the data indicating the data value for the capacity of the buffer area among all the data included in the update record, and the data other than the data indicating the data length included in the record of the data storage area A second update unit that updates the data and commits the update, and after the commit by the second update unit, the remaining data that is not used for update among all the data included in the update record is stored in the data The third update means for updating the remaining unupdated data included in the record in the area and committing the update, and when all the data included in the update record are used for the update, The data indicating the data length included in the record is updated with the data indicating the data length included in the record, and the data Characterized in that to function as a fourth updating means for committing the new.

本発明によれば、更新用のレコードのデータ長がバッファ領域の容量を超える場合であっても、意図しないデータが外部に出力されることを回避することができる。   According to the present invention, unintended data can be prevented from being output to the outside even when the data length of the update record exceeds the capacity of the buffer area.

ICカード1の概要構成例を示す図である。1 is a diagram illustrating a schematic configuration example of an IC card 1. FIG. CPU10のコマンド受信時の処理の一例を示すフローチャートである。It is a flowchart which shows an example of the process at the time of command reception of CPU10. データ格納領域のレコードの一例と、更新用のレコードの一例とを示す図である。It is a figure which shows an example of the record of a data storage area, and an example of the record for an update. 更新レコード長がバッファ領域の容量を超えている場合に従来の処理が行われた場合に、データ格納領域のデータが更新されていく様子と、コミットの前後で処理が中断した場合において読み出されるレコードとを示す図である。Records that are read when the data in the data storage area is updated when conventional processing is performed when the update record length exceeds the capacity of the buffer area, and when processing is interrupted before and after the commit FIG. 更新レコード長がバッファ領域の容量を超えている場合に本発明の処理が行われた場合に、データ格納領域のデータが更新されていく様子と、コミットの前後で処理が中断した場合において読み出されるレコードとを示す図である。When the processing of the present invention is performed when the update record length exceeds the capacity of the buffer area, data is read in the data storage area and when the process is interrupted before and after the commit. It is a figure which shows a record.

以下、図面を参照して本発明の実施形態について詳細に説明する。以下に説明する実施形態は、ICカードに対して本発明を適用した場合の実施の形態である。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment when the present invention is applied to an IC card.

先ず、図1を参照して、本実施形態に係るICカード1の構成及び機能概要について説明する。図1は、ICカード1の概要構成例を示す図である。なお、ICカード1は、キャッシュカード、クレジットカード、社員カード等として使用される。或いは、ICカード1は、スマートフォンや携帯電話機等の通信機器に組み込まれる。ICチップ1aは通信機器の回路基板上に直接組み込んで構成するようにしてもよい。   First, with reference to FIG. 1, the configuration and functional overview of the IC card 1 according to the present embodiment will be described. FIG. 1 is a diagram illustrating a schematic configuration example of the IC card 1. The IC card 1 is used as a cash card, credit card, employee card or the like. Alternatively, the IC card 1 is incorporated into a communication device such as a smartphone or a mobile phone. The IC chip 1a may be configured by being directly incorporated on a circuit board of a communication device.

ICカード1には、図1に示すように、ICチップ1aが搭載されている。ICチップ1aは、本発明の電子情報記憶媒体の一例である。ICチップ1aは、CPU(Central Processing Unit)10、RAM(Random Access Memory)11、ROM(Read Only Memory)12、不揮発性メモリ13、及びI/O回路14を備えて構成される。なお、I/O回路14は、外部端末2とのインターフェイスを担う。ICカード1が接触ICカードの場合、I/O回路14には、例えばISO/IEC7816によって定められたC1〜C8の8個の端子が設けられている。例えば、C1端子は電源端子、C2端子はリセット端子、C3端子はクロック端子、C5端子はグランド端子、C7端子は外部端末2とのデータ通信を行う端子である。なお、この例では、接触式のICカードの例を示したが、外部端末2に近づくことにより、磁界をエネルギーとして無結線状態で電源供給され(電圧印加され)、動作する非接触式のICカード(アンテナ及び変復調回路を含む)であってもよい。外部端末2の例としては、ICカード発行機、ATM、改札機、認証用ゲート等が挙げられる。或いは、ICカード1が通信機器に組み込まれる場合、外部端末2には通信機器の機能を担うコントローラが該当する。   An IC chip 1a is mounted on the IC card 1 as shown in FIG. The IC chip 1a is an example of an electronic information storage medium of the present invention. The IC chip 1a includes a CPU (Central Processing Unit) 10, a RAM (Random Access Memory) 11, a ROM (Read Only Memory) 12, a nonvolatile memory 13, and an I / O circuit 14. The I / O circuit 14 serves as an interface with the external terminal 2. When the IC card 1 is a contact IC card, the I / O circuit 14 is provided with, for example, eight terminals C1 to C8 defined by ISO / IEC7816. For example, the C1 terminal is a power supply terminal, the C2 terminal is a reset terminal, the C3 terminal is a clock terminal, the C5 terminal is a ground terminal, and the C7 terminal is a terminal that performs data communication with the external terminal 2. In this example, an example of a contact type IC card is shown. However, by approaching the external terminal 2, a non-contact type IC that operates by being supplied with power (voltage is applied) in a non-connected state using a magnetic field as energy. It may be a card (including an antenna and a modem circuit). Examples of the external terminal 2 include an IC card issuing machine, ATM, ticket gate, and authentication gate. Alternatively, when the IC card 1 is incorporated in a communication device, the external terminal 2 corresponds to a controller responsible for the function of the communication device.

CPU10は、ROM12または不揮発性メモリ13に記憶されたプログラム(本発明の情報処理プログラムを含む)を実行するプロセッサ(コンピュータ)である。CPU10は、記憶されたプログラムに従って後述する処理を実行する。不揮発性メモリ13は、例えばフラッシュメモリが適用される。なお、不揮発性メモリ13は、「Electrically Erasable Programmable Read-Only Memory」であっても構わない。不揮発性メモリ13には、データ格納領域、及び書き込み保証用のバッファ領域等を有する。データ格納領域には、例えばISO/IEC7816−4によって定められたMF(Master File)、DF(Dedicated File)、及びEF(Elementary File)などから構成される階層構造を有する複数のファイルが定義される。MFは、データ格納領域におけるファイル構成において最上位に位置し、MFの下位階層にはDF及びEFが位置する。DFは、例えばアプリケーションプログラムごとに設けられる。EFは、例えば、DFに格納されるアプリケーションプログラムで使用される複数のレコード(データオブジェクト)を格納するレコードファイルである。レコードは、レコードの識別子であるタグ(Tag)を示すデータ、データ値(Value)のデータ長(Length)を示すデータ、及びデータ値(Value)を示すデータを含んで構成される。なお、データ格納領域には、レコード管理情報として、ページごとに対応するデータ誤り検出符号(例えば、CRC(Cyclic Redundancy Check))、及びレコード数が格納される。ページとは、データの読み書きが行われる最小単位(例えば128バイト、256バイト、または512バイト)をいう。   The CPU 10 is a processor (computer) that executes a program (including the information processing program of the present invention) stored in the ROM 12 or the nonvolatile memory 13. CPU10 performs the process mentioned later according to the memorize | stored program. As the nonvolatile memory 13, for example, a flash memory is applied. The nonvolatile memory 13 may be “Electrically Erasable Programmable Read-Only Memory”. The nonvolatile memory 13 has a data storage area, a write guarantee buffer area, and the like. In the data storage area, for example, a plurality of files having a hierarchical structure composed of MF (Master File), DF (Dedicated File), EF (Elementary File), etc. defined by ISO / IEC7816-4 are defined. . The MF is positioned at the highest level in the file structure in the data storage area, and the DF and EF are positioned in the lower hierarchy of the MF. The DF is provided for each application program, for example. The EF is a record file that stores a plurality of records (data objects) used in an application program stored in the DF, for example. The record includes data indicating a tag (Tag) which is an identifier of the record, data indicating a data length (Length) of a data value (Value), and data indicating a data value (Value). Note that a data error detection code (for example, CRC (Cyclic Redundancy Check)) corresponding to each page and the number of records are stored in the data storage area as record management information. A page refers to a minimum unit (for example, 128 bytes, 256 bytes, or 512 bytes) in which data is read and written.

CPU10は、例えば外部端末2からI/O回路14を介して受信されたコマンド(例えば、書き込みコマンド)により指定された更新用のレコードでデータ格納領域のレコードを更新する際に、トランザクションにより、当該更新用のレコード(更新後のレコード)の全部又は一部をバッファ領域に格納した後に当該データ格納領域のレコードを更新し、当該更新をコミットすることを前提とする。   When the CPU 10 updates a record in the data storage area with an update record designated by a command (for example, a write command) received from the external terminal 2 via the I / O circuit 14, for example, It is assumed that after all or part of the update record (updated record) is stored in the buffer area, the record in the data storage area is updated and the update is committed.

そして、CPU10は、本発明における第1更新手段、第2更新手段、第3更新手段、及び第4更新手段として機能する。具体的には、CPU10は、コマンドにより指定された更新用のレコード(レコードデータ)のデータ長(以下、「更新レコード長」という)がバッファ領域の容量を超える場合、更新用のレコードに含まれるタグ(Tag)を示すデータで、データ格納領域のレコードに含まれるタグ(Tag)を示すデータを更新し、且つ、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを、データがないことを示す値(例えば、0)に更新し、当該更新をコミット(1回目のコミット)する。   The CPU 10 functions as a first updating unit, a second updating unit, a third updating unit, and a fourth updating unit in the present invention. Specifically, when the data length of the update record (record data) specified by the command (hereinafter referred to as “update record length”) exceeds the capacity of the buffer area, the CPU 10 includes the update record (record data). The data indicating the tag (Tag) included in the data storage area record is updated with the data indicating the tag (Tag), and the data indicating the data length (Length) included in the record in the data storage area is updated. Update to a value (eg, 0) indicating that there is no, and commit the update (first commit).

ここで、コマンドは、例えば、APDU(Application Protocol Data Unit)として外部端末2から送信される。APDUとして送られるコマンドは、CLA部、INS部、P1部、P2部、Lc部、Data部、Le部から構成される。CLA部及びINS部は、コマンドの種類を示す情報を格納する。P1部及びP2部は、コマンド処理におけるパラメータを格納する。Lc部は、Data部のデータ長(本実施形態では、更新レコード長)を格納する。Data部は、更新用のレコード(レコードデータ)を格納する。Le部は、コマンドをチェックするための情報を格納する。また、コミットとは、レコードの更新を確定する処理であり、例えばレコードごとに記憶された更新完了フラグを“1”にセットする処理である。言い換えれば、コミットとは、バッファ領域に格納されたデータをデータ格納領域に反映して、更新完了フラグを“1”にセットする処理ということもできる。   Here, the command is transmitted from the external terminal 2 as, for example, an APDU (Application Protocol Data Unit). A command sent as an APDU includes a CLA part, an INS part, a P1 part, a P2 part, an Lc part, a Data part, and a Le part. The CLA part and the INS part store information indicating the type of command. The P1 part and the P2 part store parameters in command processing. The Lc part stores the data length of the Data part (in this embodiment, the update record length). The Data section stores an update record (record data). The Le part stores information for checking a command. The commit is a process for confirming the update of the record. For example, the commit is a process for setting the update completion flag stored for each record to “1”. In other words, the commit can be said to be a process of reflecting the data stored in the buffer area to the data storage area and setting the update completion flag to “1”.

CPU10は、1回目のコミット後に、更新用のレコードに含まれる全データのうちバッファ領域の容量分のデータ値(Value)を示すデータ(つまり、データ値(Value)を示すデータの一部)で、データ格納領域のレコードに含まれるタグ(Tag)及びデータ長(Length)を示すデータ以外のデータ(例えば、データ値(Value)を示すデータの一部)を更新し、当該更新をコミット(2回目のコミット)する。そして、CPU10は、2回目のコミット後に、更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータ値(Value)を示すデータで、データ格納領域のレコードに含まれる更新されていない残りのデータ値(Value)を示すデータを更新し、当該更新をコミット(3回目のコミット)する。そして、CPU10は、3回目のコミット後に、更新用のレコードに含まれるデータ値(Value)を示すデータの全てが更新に利用された場合、更新用のレコードに含まれるデータ長(Length)を示すデータで、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを更新し、当該更新をコミット(4回目のコミット)する。なお、CPU10は、2回目のコミット後、更新用のレコードに含まれるデータ値(Value)を示すデータの全てが更新に利用されるまで、更新に利用されていないデータ値(Value)を示すデータで、データ格納領域のレコードに含まれる更新されていないデータ値(Value)を示すデータを更新し、当該更新をコミットすることを繰り返すことになる。   After the first commit, the CPU 10 includes data indicating a data value (Value) corresponding to the capacity of the buffer area among all data included in the update record (that is, a part of data indicating the data value (Value)). , Update data other than data indicating the tag (Tag) and data length (Length) included in the record of the data storage area (for example, a part of data indicating the data value (Value)), and commit the update (2 Commit the second time). Then, after the second commit, the CPU 10 is the data indicating the remaining data value (Value) that is not used for the update among all the data included in the update record, and is updated in the record in the data storage area. Data indicating the remaining data value (Value) that has not been updated is updated, and the update is committed (third commit). Then, after the third commit, the CPU 10 indicates the data length (Length) included in the update record when all the data indicating the data value (Value) included in the update record is used for the update. The data is updated with data indicating the data length (Length) included in the record in the data storage area, and the update is committed (fourth commit). Note that after the second commit, the CPU 10 indicates data values (Values) that are not used for updating until all of the data values (Values) included in the update record are used for updating. Thus, updating the data indicating the data value (Value) that has not been updated included in the record in the data storage area and committing the update is repeated.

次に、図2及び図3等を参照して、ICカード1aにおけるCPU10のコマンド受信時の処理の一例について説明する。図2は、CPU10のコマンド受信時の処理の一例を示すフローチャートである。図3は、データ格納領域のレコードの一例と、更新用のレコードの一例とを示す図である。図3の例では、データ格納領域のレコードのデータ長(以下、「格納済みレコード長」という)は25バイトであり(図3(A))、更新用のレコードの更新レコード長は20バイトである(図3(B))。なお、図3の例では、データ格納領域のレコード、及び更新用のレコードそれぞれに含まれるデータを16進数(h)で表している。例えば、データ格納領域のレコードに含まれるデータ長(Length)を示すデータは17(h)となっているが、これは10進数で23である。従って、データ格納領域のレコードに含まれるデータ値(Value)を示すデータのデータ長は23バイトである。一方、更新用のレコードに含まれるデータ長(Length)を示すデータは12(h)となっているが、これは10進数で18である。従って、データ格納領域のレコードに含まれるデータ値(Value)を示すデータのデータ長は18バイトである。   Next, an example of processing when the CPU 10 receives a command in the IC card 1a will be described with reference to FIGS. FIG. 2 is a flowchart showing an example of processing when the CPU 10 receives a command. FIG. 3 is a diagram illustrating an example of a record in the data storage area and an example of an update record. In the example of FIG. 3, the data length of the record in the data storage area (hereinafter referred to as “stored record length”) is 25 bytes (FIG. 3A), and the update record length of the update record is 20 bytes. Yes (FIG. 3B). In the example of FIG. 3, the data included in each of the record in the data storage area and the record for update is represented by a hexadecimal number (h). For example, data indicating the data length (Length) included in the record in the data storage area is 17 (h), which is 23 in decimal. Therefore, the data length of the data indicating the data value (Value) included in the record in the data storage area is 23 bytes. On the other hand, data indicating the data length (Length) included in the update record is 12 (h), which is 18 in decimal. Therefore, the data length of the data indicating the data value (Value) included in the record in the data storage area is 18 bytes.

図2に示す処理は、CPU10が、例えば外部端末2からI/O回路14を介してコマンドを受信することにより開始される。図2に示す処理が開始されると、CPU10は、受信されたコマンドで指定された更新用のレコードの更新レコード長が、バッファ領域の容量を超えているか否か判定する(ステップS1)。CPU10は、更新レコード長がバッファ領域の容量を超えていないと判定した場合(ステップS1:NO)、ステップS2へ進む。なお、ステップS2〜S6の処理は、従来の処理と同様である。一方、CPU10は、更新レコード長がバッファ領域の容量を超えていると判定した場合(ステップS1:YES)、ステップS7へ進む。   The processing shown in FIG. 2 is started when the CPU 10 receives a command from the external terminal 2 via the I / O circuit 14, for example. When the processing shown in FIG. 2 is started, the CPU 10 determines whether or not the update record length of the update record designated by the received command exceeds the capacity of the buffer area (step S1). When the CPU 10 determines that the update record length does not exceed the capacity of the buffer area (step S1: NO), the CPU 10 proceeds to step S2. Note that the processing in steps S2 to S6 is the same as the conventional processing. On the other hand, if the CPU 10 determines that the update record length exceeds the capacity of the buffer area (step S1: YES), the CPU 10 proceeds to step S7.

ステップS2では、CPU10は、トランザクションを開始し、受信されたコマンドが含む更新用のレコードをバッファ領域に格納する。次いで、CPU10は、データ格納領域のレコード(つまり、タグ(Tag)、データ長(Length)、及びデータ値(Value)を示すデータ)を、バッファ領域に格納された更新用のレコードで更新(上書き(データ反映))する(ステップS3)。次いで、CPU10は、レコード管理情報を更新する(ステップS4)。レコード管理情報の更新では、例えば、更新されたレコードのCRCが計算されて格納される。次いで、CPU10は、トランザクションを終了し(ステップS5)、ステップS3及びステップS4での更新をコミットし(ステップS6)、図2に示す処理を終了する。   In step S2, the CPU 10 starts a transaction and stores an update record included in the received command in the buffer area. Next, the CPU 10 updates (overwrites) a record in the data storage area (that is, data indicating a tag (Tag), a data length (Length), and a data value (Value)) with an update record stored in the buffer area. (Data reflection)) (step S3). Next, the CPU 10 updates the record management information (step S4). In updating the record management information, for example, the CRC of the updated record is calculated and stored. Next, the CPU 10 ends the transaction (step S5), commits the update in step S3 and step S4 (step S6), and ends the process shown in FIG.

ここで、更新レコード長がバッファ領域の容量を超えている場合に、従来の処理が行われた場合について説明する。図4は、更新レコード長がバッファ領域の容量を超えている場合に従来の処理が行われた場合、データ格納領域のデータが更新されていく様子と、コミットの前後で処理が中断した場合において読み出されるレコード(読み出しレコード)とを示す図である。なお、図4の例では、不揮発性メモリ13における書き込み保証用のバッファ領域の容量を16バイトとしている。この場合、更新用のレコードに含まれる全データのうち、その先頭からバッファ領域の容量分のデータ(つまり、更新対象のレコードの一部)で、データ格納領域のレコードに含まれる全データのうち、そのデータの先頭からバッファ領域の容量分のデータが更新される(図4(2))。そして、1回目のコミットが行われる(図4(3))。その後、更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータ(つまり、データ値(Value)を示すデータの一部)で、データ格納領域のレコードに含まれる更新されていない残りのデータが更新され(図4(4))、2回目のコミットが行われる(図4(5))。このように、従来の処理が行われる場合において、2回目のコミット完了前に処理が中断した場合の読み出しレコードに含まれるデータは、図4(B)に示すように中途半端なデータとなる。すなわち、当該レコードに含まれるデータ長(Length)を示すデータは12(h)にコミット済であるため、当該レコードに含まれるデータ値(Value)を示すデータは、更新済のデータと更新前のデータとが混在してしまうことになる。このような中途半端なデータは、CRCでは異常判定できないため(CRC計算後にコミットがなされるため)、正しいデータとして出力されてしまうことになる。   Here, a case where the conventional process is performed when the update record length exceeds the capacity of the buffer area will be described. Fig. 4 shows how the data in the data storage area is updated when the conventional processing is performed when the update record length exceeds the capacity of the buffer area, and when the processing is interrupted before and after the commit. It is a figure which shows the record (read record) read. In the example of FIG. 4, the capacity of the write guarantee buffer area in the nonvolatile memory 13 is 16 bytes. In this case, out of all the data included in the record for update, of the data for the capacity of the buffer area from the beginning (that is, a part of the record to be updated), The data corresponding to the capacity of the buffer area is updated from the beginning of the data (FIG. 4 (2)). Then, the first commit is performed (FIG. 4 (3)). After that, of all the data included in the update record, the remaining data that is not used for update (that is, a part of the data indicating the data value (Value)) is updated in the data storage area record. The remaining remaining data is updated (FIG. 4 (4)), and the second commit is performed (FIG. 4 (5)). As described above, when the conventional process is performed, the data included in the read record when the process is interrupted before the completion of the second commit is halfway data as illustrated in FIG. That is, since the data indicating the data length (Length) included in the record has been committed to 12 (h), the data indicating the data value (Value) included in the record is the updated data and the data before the update. Data will be mixed. Such half-finished data cannot be determined abnormally by CRC (since commit is performed after CRC calculation), and therefore, is output as correct data.

一方、図5は、更新レコード長がバッファ領域の容量を超えている場合に本発明の処理が行われた場合に、データ格納領域のデータが更新されていく様子と、コミットの前後で処理が中断した場合において読み出されるレコードとを示す図である。なお、図5の例でも、不揮発性メモリ13における書き込み保証用のバッファ領域の容量を16バイトとしている。この場合、CPU10は、ステップS7において、トランザクションを開始し、受信されたコマンドが含む更新用のレコードに含まれる全データのうち、タグ(Tag)を示すデータ及びデータがないことを示す値(例えば、00(h))(つまり、更新対象のレコードの一部)をバッファ領域に格納する。次いで、CPU10は、バッファ領域に格納されたタグ(Tag)を示すデータで、データ格納領域のレコードに含まれるタグ(Tag)を示すデータを更新し、且つ、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを、例えば00(h)(バッファ領域に格納された「データがないことを示す値」)に更新(00(h)で上書き)する(ステップS8、図5(2))。次いで、CPU10は、トランザクションを終了し(ステップS9)、ステップS8での更新をコミット(1回目のコミット)する(ステップS10、図5(3))。   On the other hand, FIG. 5 shows how data in the data storage area is updated when the process of the present invention is performed when the update record length exceeds the capacity of the buffer area, and the process before and after the commit. It is a figure which shows the record read when interrupted. In the example of FIG. 5 as well, the capacity of the write guarantee buffer area in the nonvolatile memory 13 is 16 bytes. In this case, in step S7, the CPU 10 starts a transaction, and among all data included in the update record included in the received command, data indicating a tag (Tag) and a value indicating that there is no data (for example, , 00 (h)) (that is, a part of the record to be updated) is stored in the buffer area. Next, the CPU 10 updates the data indicating the tag (Tag) included in the data storage area record with the data indicating the tag (Tag) stored in the buffer area, and the data included in the data storage area record. The data indicating the length (Length) is updated (overwritten with 00 (h)) to, for example, 00 (h) (“value indicating no data” stored in the buffer area) (step S8, FIG. 5 (2)). )). Next, the CPU 10 ends the transaction (step S9), and commits the update at step S8 (first commit) (step S10, FIG. 5 (3)).

次いで、CPU10は、未更新のデータ値(Value)を示すデータのデータ長が、バッファ領域の容量を超えているか否かを判定する(ステップS11)。ここで、未更新のデータ値(Value)を示すデータとは、更新用のレコードに含まれるデータ値(Value)を示すデータのうち、更新に利用されていないデータである。CPU10は、未更新のデータ値(Value)を示すデータのデータ長が、バッファ領域の容量を超えていると判定した場合(ステップS11:YES)、ステップS12へ進む。一方、CPU10は、未更新のデータ値(Value)を示すデータのデータ長が、バッファ領域の容量を超えていないと判定した場合(ステップS11:NO)、ステップS16へ進む。   Next, the CPU 10 determines whether or not the data length of the data indicating the unupdated data value (Value) exceeds the capacity of the buffer area (step S11). Here, the data indicating the unupdated data value (Value) is data that is not used for updating among the data indicating the data value (Value) included in the update record. When the CPU 10 determines that the data length of the data indicating the unupdated data value (Value) exceeds the capacity of the buffer area (step S11: YES), the CPU 10 proceeds to step S12. On the other hand, when the CPU 10 determines that the data length of the data indicating the unupdated data value (Value) does not exceed the capacity of the buffer area (step S11: NO), the CPU 10 proceeds to step S16.

ステップS12では、CPU10は、トランザクションを開始し、更新用のレコードに含まれる更新に利用されていないデータ値(Value)を示すデータのうち、バッファ領域の容量分のデータ(つまり、当該データ値(Value)を示すデータの一部)をバッファ領域に格納する。次いで、CPU10は、バッファ領域に格納されたデータ値(Value)を示すデータ(更新に利用されていない残りのデータ)で、データ格納領域のレコードに含まれる更新されていないデータ値(Value)を示すデータを更新する(ステップS13、図5(4))。次いで、CPU10は、トランザクションを終了し(ステップS14)、ステップS13での更新をコミット(2回目のコミット)し(ステップS15、図5(5))、ステップS11に戻る。なお、ステップS11〜S15の処理は、更新用のレコードに含まれるデータ値(Value)を示すデータの全てが更新に利用されるまで、繰り返されることになる。   In step S12, the CPU 10 starts the transaction, and among the data indicating the data value (Value) that is not used for the update included in the update record, the data corresponding to the capacity of the buffer area (that is, the data value ( A part of data indicating Value) is stored in the buffer area. Next, the CPU 10 uses the data indicating the data value (Value) stored in the buffer area (remaining data not used for update), and the unupdated data value (Value) included in the record in the data storage area. The data shown is updated (step S13, FIG. 5 (4)). Next, the CPU 10 ends the transaction (step S14), commits the update in step S13 (second commit) (step S15, FIG. 5 (5)), and returns to step S11. The processes in steps S11 to S15 are repeated until all of the data indicating the data value (Value) included in the update record is used for the update.

ステップS16では、CPU10は、トランザクションを開始し、更新用のレコードに含まれる更新に利用されていないデータ値(Value)を示すデータをバッファ領域に格納する。次いで、CPU10は、バッファ領域に格納された残りのデータ値(Value)を示すデータで、データ格納領域のレコードに含まれる更新されていないデータ値(Value)を示すデータを更新する(ステップS17、図5(6))。次いで、CPU10は、トランザクションを終了し(ステップS18)、ステップS17での更新をコミット(3回目のコミット)する(ステップS19、図5(7))。   In step S <b> 16, the CPU 10 starts a transaction and stores data indicating a data value (Value) that is not used for the update included in the update record in the buffer area. Next, the CPU 10 updates the data indicating the unupdated data value (Value) included in the record of the data storage area with the data indicating the remaining data value (Value) stored in the buffer area (Step S17, FIG. 5 (6)). Next, the CPU 10 ends the transaction (step S18) and commits the update at step S17 (third commit) (step S19, FIG. 5 (7)).

次いで、CPU10は、ステップS20において、トランザクションを開始し、更新用のレコードに含まれるデータ長(Length)を示すデータをバッファ領域に格納する。次いで、CPU10は、バッファ領域に格納されたデータ長(Length)を示すデータで、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを更新する(ステップS21。図5(8))。次いで、CPU10は、上記ステップS4と同様、レコード管理情報を更新する(ステップS22)。次いで、CPU10は、トランザクションを終了し(ステップS23)、ステップS20での更新をコミット(4回目のコミット)する(ステップS24、図5(9))。   Next, in step S20, the CPU 10 starts a transaction and stores data indicating the data length (Length) included in the update record in the buffer area. Next, the CPU 10 updates the data indicating the data length (Length) included in the record of the data storage area with the data indicating the data length (Length) stored in the buffer area (step S21, FIG. 5 (8)). . Next, the CPU 10 updates the record management information as in step S4 (step S22). Next, the CPU 10 ends the transaction (step S23), and commits the update in step S20 (the fourth commit) (step S24, FIG. 5 (9)).

このように、本発明の処理が行われる場合において、4回目のコミット完了前に処理が中断した場合の読み出しレコードに含まれるデータは、図5(B)に示すように、当該レコードに含まれるデータ長(Length)を示すデータは00(h)にコミット済であるため、当該レコードに含まれるデータ値(Value)を示すデータは無となる。そのため、中途半端なデータが出力されない。   As described above, when the processing of the present invention is performed, the data included in the read record when the processing is interrupted before the completion of the fourth commit is included in the record as shown in FIG. Since the data indicating the data length (Length) has been committed at 00 (h), there is no data indicating the data value (Value) included in the record. Therefore, halfway data is not output.

以上説明したように、上記実施形態によれば、更新レコード長がバッファ領域の容量を超える場合、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを、データがないことを示す値(例えば、0)に更新し、当該更新をコミットした後、データ格納領域のレコードに含まれるデータ値(Value)を示すデータを更新及びコミットし、更新用のレコードに含まれるデータ値(Value)を示すデータの全てが更新に利用された場合、更新用のレコードに含まれるデータ長(Length)を示すデータで、データ格納領域のレコードに含まれるデータ長(Length)を示すデータを更新し、当該更新をコミットするように構成したので、更新レコード長がバッファ領域の容量を超える場合であっても、利用者が意図しないデータ(中途半端なデータ)が外部に出力されることを回避することができる。   As described above, according to the above embodiment, when the update record length exceeds the capacity of the buffer area, the data indicating the data length (Length) included in the record in the data storage area is replaced with a value indicating that there is no data. After updating to (for example, 0) and committing the update, the data indicating the data value (Value) included in the record in the data storage area is updated and committed, and the data value (Value) included in the update record is updated. When all of the data indicating is used for updating, the data indicating the data length (Length) included in the record in the data storage area is updated with the data indicating the data length (Length) included in the update record, Since the configuration is such that the update is committed, even if the update record length exceeds the capacity of the buffer area, unintended data (half-finished data) Output) to the outside can be avoided.

1 ICカード
1a ICチップ
2 外部端末
10 CPU
11 RAM
12 ROM
13 不揮発性メモリ
14 I/O回路
1 IC card 1a IC chip 2 external terminal 10 CPU
11 RAM
12 ROM
13 Non-volatile memory 14 I / O circuit

Claims (5)

少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、
更新用のレコードで前記データ格納領域のレコードを更新する際に、当該更新用のレコードの全部又は一部を前記バッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体において、
前記プロセッサは、
前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新手段と、
前記第1更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新手段と、
前記第2更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新手段と、
前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新手段と、
を備えることを特徴とする電子情報記憶媒体。
A non-volatile memory having at least a data storage area for storing a record including data indicating at least a data value and data indicating a data length of the data value, and a buffer area;
When updating a record in the data storage area with an update record, after storing all or part of the update record in the buffer area, update the record in the data storage area and commit the update An electronic information storage medium comprising:
The processor is
If the data length of the record for update exceeds the capacity of the buffer area, the data indicating the data length included in the record in the data storage area is updated to a value indicating no data, and the update is committed First updating means for
Data indicating the data value corresponding to the capacity of the buffer area among all data included in the update record after committing by the first update means, and indicating the data length included in the record in the data storage area A second update means for updating the data other than and committing the update;
After the commit by the second update means, the remaining data not updated in the data storage area is updated with the remaining data not used for updating among all the data included in the update record. A third updating means for committing the update;
When all data included in the update record is used for update, the data indicating the data length included in the record in the data storage area is updated with data indicating the data length included in the update record. A fourth update means for committing the update;
An electronic information storage medium comprising:
前記データがないことを示す値は0であることを特徴とする請求項1に記載の電子情報記憶媒体。   The electronic information storage medium according to claim 1, wherein a value indicating that there is no data is 0. 前記第3更新手段は、前記更新用のレコードに含まれるデータ値を示すデータが全てが更新に利用されるまで、更新に利用されていないデータ値を示すデータで、前記データ格納領域のレコードに含まれる更新されていないデータ値を示すデータを更新し、当該更新をコミットすることを繰り返すことを特徴とする請求項1または2に記載の電子情報記憶媒体。   The third updating means is a data indicating a data value that is not used for updating until all the data indicating the data value included in the update record is used for updating, and is stored in the record of the data storage area. The electronic information storage medium according to claim 1, wherein the data indicating the non-updated data value contained therein is updated and the update is committed repeatedly. 少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、
更新用のレコードで前記データ格納領域のレコードを更新する際に、当該更新用のレコードの全部又は一部を前記バッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体において前記プロセッサにより実行される情報処理方法であって、
前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新ステップと、
前記第1更新ステップによるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新ステップと、
前記第2更新ステップによるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新ステップと、
前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新ステップと、
を含むことを特徴とする情報処理方法。
A non-volatile memory having at least a data storage area for storing a record including data indicating at least a data value and data indicating a data length of the data value, and a buffer area;
When updating a record in the data storage area with an update record, after storing all or part of the update record in the buffer area, update the record in the data storage area and commit the update An information processing method executed by the processor in an electronic information storage medium comprising:
If the data length of the record for update exceeds the capacity of the buffer area, the data indicating the data length included in the record in the data storage area is updated to a value indicating no data, and the update is committed A first updating step,
Data indicating a data value corresponding to the capacity of the buffer area among all data included in the update record after commit in the first update step, and indicating the data length included in the record in the data storage area A second update step of updating the data other than and committing the update;
After the commit in the second update step, the remaining unupdated data included in the record in the data storage area is updated with the remaining data that is not used for update among all the data included in the update record. And a third update step for committing the update,
When all data included in the update record is used for update, the data indicating the data length included in the record in the data storage area is updated with data indicating the data length included in the update record. A fourth update step for committing the update;
An information processing method comprising:
少なくともデータ値を示すデータと当該データ値のデータ長を示すデータとを含んで構成されるレコードを格納するデータ格納領域と、バッファ領域とを少なくとも有する不揮発性メモリと、
更新用のレコードで前記データ格納領域のレコードを更新する際に、当該更新用のレコードの全部又は一部を前記バッファ領域に格納した後に、当該データ格納領域のレコードを更新し、当該更新をコミットするプロセッサと、を備える電子情報記憶媒体における前記プロセッサを、
前記更新用のレコードのデータ長が前記バッファ領域の容量を超える場合、前記データ格納領域のレコードに含まれる前記データ長を示すデータを、データがないことを示す値に更新し、当該更新をコミットする第1更新手段と、
前記第1更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち前記バッファ領域の容量分のデータ値を示すデータで、前記データ格納領域のレコードに含まれる前記データ長を示すデータ以外の前記データを更新し、当該更新をコミットする第2更新手段と、
前記第2更新手段によるコミット後に、前記更新用のレコードに含まれる全データのうち更新に利用されていない残りのデータで、前記データ格納領域のレコードに含まれる更新されていない残りのデータを更新し、当該更新をコミットする第3更新手段と、
前記更新用のレコードに含まれる全データが更新に利用された場合、前記更新用のレコードに含まれるデータ長を示すデータで、前記データ格納領域のレコードに含まれるデータ長を示すデータを更新し、当該更新をコミットする第4更新手段として機能させることを特徴とする情報処理プログラム。
A non-volatile memory having at least a data storage area for storing a record including data indicating at least a data value and data indicating a data length of the data value, and a buffer area;
When updating a record in the data storage area with an update record, after storing all or part of the update record in the buffer area, update the record in the data storage area and commit the update A processor in an electronic information storage medium comprising:
If the data length of the record for update exceeds the capacity of the buffer area, the data indicating the data length included in the record in the data storage area is updated to a value indicating no data, and the update is committed First updating means for
Data indicating the data value corresponding to the capacity of the buffer area among all data included in the update record after committing by the first update means, and indicating the data length included in the record in the data storage area A second update means for updating the data other than and committing the update;
After the commit by the second update means, the remaining data not updated in the data storage area is updated with the remaining data not used for updating among all the data included in the update record. A third updating means for committing the update;
When all data included in the update record is used for update, the data indicating the data length included in the record in the data storage area is updated with data indicating the data length included in the update record. And an information processing program that functions as fourth update means for committing the update.
JP2014092653A 2014-04-28 2014-04-28 Electronic information storage medium, information processing method, and information processing program Active JP6252341B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014092653A JP6252341B2 (en) 2014-04-28 2014-04-28 Electronic information storage medium, information processing method, and information processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014092653A JP6252341B2 (en) 2014-04-28 2014-04-28 Electronic information storage medium, information processing method, and information processing program

Publications (2)

Publication Number Publication Date
JP2015210707A JP2015210707A (en) 2015-11-24
JP6252341B2 true JP6252341B2 (en) 2017-12-27

Family

ID=54612827

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014092653A Active JP6252341B2 (en) 2014-04-28 2014-04-28 Electronic information storage medium, information processing method, and information processing program

Country Status (1)

Country Link
JP (1) JP6252341B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002007178A (en) * 2000-06-22 2002-01-11 Mitsubishi Electric Corp Device for setting buffer size
US6823417B2 (en) * 2001-10-01 2004-11-23 Hewlett-Packard Development Company, L.P. Memory controller for memory card manages file allocation table
JP4208079B2 (en) * 2004-05-14 2009-01-14 インターナショナル・ビジネス・マシーンズ・コーポレーション Database server, program, recording medium, and control method
JP5214291B2 (en) * 2008-03-19 2013-06-19 株式会社東芝 IC card and IC card control method
SG151197A1 (en) * 2007-09-20 2009-04-30 Toshiba Kk Portable electronic apparatus and control method for portable electronic apparatus

Also Published As

Publication number Publication date
JP2015210707A (en) 2015-11-24

Similar Documents

Publication Publication Date Title
RU2146399C1 (en) Method for data storage in non-volatile memory unit, method for using integral circuit device, and integral circuit device
US7017825B2 (en) IC card and data processing method therefor
EP2102748B1 (en) System and method for recovery of memory transactions
JP6252341B2 (en) Electronic information storage medium, information processing method, and information processing program
JP2008027070A (en) Portable electronic apparatus and control method of portable electronic apparatus
JP6233134B2 (en) Electronic information storage medium, information processing method, and information processing program
EP3023925B1 (en) Secure element with applications
JP7322923B2 (en) Secure element, transaction control method and device
US7346730B2 (en) Mobile electronic device
JP2006293706A (en) Multi-application ic card with application updating function
JP5983349B2 (en) IC card, data read / write method, and data read / write program
CN112698785B (en) Data updating method of storage device
JP7021465B2 (en) Electronic information storage device, IC card, data recovery method, and data recovery program
JP5708228B2 (en) IC card and IC card refresh method
JP2016153945A (en) Electronic information storage medium, counter rewriting method and counter rewriting program
JP6015461B2 (en) Information recording medium, data read / write method, and data read / write program
JP6915437B2 (en) Update method and update program using electronic information storage medium, IC card, electronic information storage medium
EP4024254A1 (en) Method and device for updating data
JP6281302B2 (en) Information processing apparatus, IC card, and data processing method
JP2007034434A (en) Ic card, method for writing data to ic card, and ic card program
JP7068603B2 (en) Update method and update program using electronic information storage medium, IC card, electronic information storage medium
JP2008047042A (en) Portable electronic device and ic card
JP2008305263A (en) Nonvolatile semiconductor storage device and memory management method
JP2013003831A (en) Ic chip, processing program for ic chip, and writing processing method in ic chip
JP5853559B2 (en) IC chip, processing method in IC chip, IC chip processing program, and IC card

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170227

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171113

R150 Certificate of patent or registration of utility model

Ref document number: 6252341

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150