JP5050508B2 - Storage device, storage device program, and storage processing method - Google Patents

Storage device, storage device program, and storage processing method Download PDF

Info

Publication number
JP5050508B2
JP5050508B2 JP2006322059A JP2006322059A JP5050508B2 JP 5050508 B2 JP5050508 B2 JP 5050508B2 JP 2006322059 A JP2006322059 A JP 2006322059A JP 2006322059 A JP2006322059 A JP 2006322059A JP 5050508 B2 JP5050508 B2 JP 5050508B2
Authority
JP
Japan
Prior art keywords
target data
writing
written
data
page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2006322059A
Other languages
Japanese (ja)
Other versions
JP2008134945A (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 JP2006322059A priority Critical patent/JP5050508B2/en
Publication of JP2008134945A publication Critical patent/JP2008134945A/en
Application granted granted Critical
Publication of JP5050508B2 publication Critical patent/JP5050508B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、所定のデータを記憶する記憶装置、記憶装置のプログラム及び記憶処理方法に関するものである。   The present invention relates to a storage device that stores predetermined data, a storage device program, and a storage processing method.

ICカードは、その用途から常に電力の瞬断を考慮した作りこみが必要である(例えば、特許文献1)。例えば、ICカードが何らかの処理中に、利用者による引き抜きや、リーダー/ライタとの端子間で接触不良が生じると、処理(データの更新など)の中断が発生し、カード内の大切なデータが破壊される可能性がある。   The IC card needs to be built in consideration of the instantaneous power interruption from the application (for example, Patent Document 1). For example, if the IC card is being pulled out by a user or a contact failure occurs between the terminal with the reader / writer during processing, the processing (data update etc.) will be interrupted and important data in the card will be lost. It can be destroyed.

このため、一般的なICカードは、瞬断によるデータの破壊を防ぐために専用の保護機能を搭載している。
機能の概要は、更新されるデータのバックアップを予め他の領域にコピーした後、実際にデータの更新作業を行う。更新作業が完了した場合は、バックアップ領域に更新が成功した情報を追加する。もし、更新途中に処理が中断されたならば、次にカードが活性化した直後にバックアップ領域の内容を調べ、更新作業が完了していないデータに対して実際のデータ領域に書き戻す。このバックアップ処理は、一時的な使用用途のデータを除き全ての保持されるデータに対して実施されるべきである。
For this reason, a general IC card is equipped with a dedicated protection function in order to prevent destruction of data due to a momentary interruption.
The outline of the function is to actually update the data after copying the backup of the data to be updated to another area in advance. When the update operation is completed, information indicating the successful update is added to the backup area. If the processing is interrupted in the middle of the update, the contents of the backup area are checked immediately after the next activation of the card, and the data that has not been updated is written back to the actual data area. This backup process should be performed on all retained data except for temporary use data.

図6は、従来のICカードのメモリの内容を示す図である。
ICカードは、データ保存領域として一般的に不揮発性メモリが使用されるが、この不揮発性メモリへの書き込みは、通常初期化を行ってから書き込みが行われる。
このとき、一度に初期化される領域を1ページとすると、図6(A)に示すように、更新領域Xが3ページにわたる場合、ページA及びページCに更新データ以外のデータYが含まれる。保証されるべきデータは、このデータYなので、ページA及びページCがバックアップ対象となる。
FIG. 6 is a diagram showing the contents of the memory of a conventional IC card.
An IC card generally uses a non-volatile memory as a data storage area. Writing to the non-volatile memory is usually performed after initialization.
At this time, assuming that the area initialized at one time is one page, as shown in FIG. 6A, when the update area X covers three pages, data A other than the update data is included in page A and page C. . Since the data to be guaranteed is this data Y, page A and page C are to be backed up.

このように、更新領域が複数のページにわたった場合でも、バックアップ時には、保証されるべきデータYが含まれるページのみを保護するので、バックアップ領域は、図6(B)に示すように、最大2ページ必要である。従来の方式では、バックアップ領域は、必要最大数のページ分を確保し、ページ単位でデータを退避させていた。
しかし、不揮発性メモリの大容量化が進む中、初期化単位も128byte、256byteと拡大しており、初期化単位の領域が拡大するに伴い、初期化に要する処理時間も増加している。加えて、初期化する領域が拡大するということは、初期化後の書き込み処理の時間も増加する。コマンド処理の高速化が求められる中、書換え保証のためのバックアップ処理時間の増加は重大な問題となる。
特開平9−54710号公報
As described above, even when the update area extends over a plurality of pages, only the page including the data Y to be guaranteed is protected at the time of backup. Therefore, the backup area has a maximum size as shown in FIG. Two pages are required. In the conventional method, the backup area secures the necessary maximum number of pages and saves data in units of pages.
However, as the capacity of the nonvolatile memory is increased, the initialization unit is also expanded to 128 bytes and 256 bytes, and the processing time required for initialization is increased as the area of the initialization unit is expanded. In addition, if the area to be initialized is enlarged, the time for the writing process after initialization also increases. Along with the demand for high-speed command processing, an increase in backup processing time for rewriting guarantee becomes a serious problem.
Japanese Patent Laid-Open No. 9-54710

本発明の課題は、バックアップの処理時間を短縮させることができる記憶装置、記憶装置のプログラム及び記憶処理方法を提供することである。   An object of the present invention is to provide a storage device, a storage device program, and a storage processing method capable of reducing the backup processing time.

本発明は、以下のような解決手段により、前記課題を解決する。なお、理解を容易にするために、本発明の実施例に対応する符号を付して説明するが、これに限定されるものではない。
請求項1の発明は、揮発性メモリ(13)と、初期化可能な複数のページに区画され、データ領域(15a)及びバックアップ領域(15b)を有する不揮発性メモリ(15)と、前記不揮発性メモリ(15)に書き込む予定の書込み対象データ(A)が、前記データ領域(15a)のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断手段(12a)と、少なくとも、前記判断手段(12a)によって前記書込み対象データ(A)が書き込まれると判断されたページにおける、前記書込み対象データ(A)が書き込まれる部分以外の保護対象データ(C)を前記揮発性メモリ(13)に書き込む第1の書込み手段(12b)と、前記揮発性メモリ(13)に書き込まれた前記保護対象データ(C)を前記バックアップ領域(15b)に書き込む第2の書込み手段(12c)と、前記揮発性メモリ(13)に前記書込み対象データ(A)を書き込む第3の書込み手段(12d)と、前記判断手段(12a)によって前記書込み対象データ(A)が書き込まれると判断されたページを初期化する初期化手段(12e)と、前記揮発性メモリ(13)に書き込まれた前記書込み対象データ(A)及び前記保護対象データ(C)を、前記初期化手段(12e)が初期化した前記データ領域(15a)のページに書き込む第4の書込み手段(12f)と、を備え、前記第2の書込み手段(12c)は、前記保護対象データ(C)が分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるように前記保護対象データ(C)を書き込むこと、を特徴とする記憶装置(10−2)である。
請求項2の発明は、請求項1に記載の記憶装置(10−2)において、前記不揮発性メモリ(15)は、管理領域(15c)を備え、前記保護対象データ(C)の収め方に関する情報を前記管理領域(15c)に記憶して管理するデータ管理手段(12g)を備えること、を特徴とする記憶装置(10−2)である。
請求項3の発明は、揮発性メモリ(13)と、初期化可能な複数のページに区画され、データ領域(15a)及びバックアップ領域(15b)を有する不揮発性メモリ(15)とを備える記憶装置(10)のCPU(12)に実行させる記憶装置のプログラムであって、前記不揮発性メモリ(15)に書き込む予定の書込み対象データ(A)が、前記データ領域(15a)のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断手順(#1、#2)と、少なくとも、前記判断手順(#1、#2)によって前記書込み対象データ(A)が書き込まれると判断されたページにおける、前記書込み対象データ(A)が書き込まれる部分以外の保護対象データ(C)を前記揮発性メモリ(13)に書き込む第1の書込み手順(#3)と、前記揮発性メモリ(13)に書き込まれた前記保護対象データ(C)が分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるようにして、前記保護対象データを前記バックアップ領域(15b)に書き込む第2の書込み手順(#4)と、前記揮発性メモリ(13)に前記書込み対象データ(A)を書き込む第3の書込み手順(#5)と、前記判断手順(#1、#2)によって前記書込み対象データ(A)が書き込まれると判断されたページを初期化する初期化手順(#6)と、前記揮発性メモリ(13)に書き込まれた前記書込み対象データ(A)及び前記保護対象データ(C)を、前記初期化手順(#6)で初期化した前記データ領域(15a)のページに書き込む第4の書込み手順(#7)と、を備える記憶装置のプログラムである。
請求項4の発明は、揮発性メモリ(13)と、初期化可能な複数のページに区画され、データ領域(15a)及びバックアップ領域(15b)を有する不揮発性メモリ(15)とを備える記憶装置(10)に記憶処理を行わせる記憶処理方法であって、前記不揮発性メモリ(15)に書き込む予定の書込み対象データ(A)が、前記データ領域(15a)のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断工程(#1、#2)と、少なくとも、前記判断工程(#1、#2)によって前記書込み対象データ(A)が書き込まれると判断されたページにおける、前記書込み対象データ(A)が書き込まれる部分以外の保護対象データ(C)を前記揮発性メモリ(13)に書き込む第1の書込み工程(#3)と、前記揮発性メモリ(13)に書き込まれた前記保護対象データ(C)が分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるようにして、前記保護対象データを前記バックアップ領域(15b)に書き込む第2の書込み工程(#4)と、前記揮発性メモリ(13)に前記書込み対象データ(A)を書き込む第3の書込み工程(#5)と、前記判断工程(#1、#2)によって前記書込み対象データ(A)が書き込まれると判断されたページを初期化する初期化工程(#6)と、前記揮発性メモリ(13)に書き込まれた前記書込み対象データ(A)及び前記保護対象データ(C)を、前記初期化工程(#6)で初期化した前記データ領域(15a)のページに書き込む第4の書込み工程(#7)と、を備える記憶処理方法である。
The present invention solves the above problems by the following means. In addition, in order to make an understanding easy, although the code | symbol corresponding to the Example of this invention is attached and demonstrated, it is not limited to this.
The invention of claim 1 includes a volatile memory (13), a nonvolatile memory (15) partitioned into a plurality of pages that can be initialized and having a data area (15a) and a backup area (15b), and the nonvolatile memory. A determination means (12a) for determining from which address of which page of the data area (15a) to which address of which page the write target data (A) to be written to the memory (15) is written; At least the protection target data (C) other than the portion where the write target data (A) is written in the page where the write target data (A) is determined to be written by the determination means (12a) is stored in the volatile memory. First writing means (12b) for writing to (13) and the protection target data (12) written to the volatile memory (13) ) In the backup area (15b), third write means (12d) for writing the write target data (A) in the volatile memory (13), and the determination means An initialization unit (12e) for initializing a page on which the write target data (A) is determined to be written by (12a), the write target data (A) written in the volatile memory (13), and the protected data (C), said a fourth writing means for initializing means (12e) is written to the page of the data area is initialized (15a) (12f), Bei example, said second write means (12c) is present is divided the protected data (C) is, if their protected data is distributed across multiple pages, shed the protected de Writing the protected data (C) to fit the minimum number of pages by storing by connecting data, a storage device according to claim (10-2).
The invention of claim 2 is the storage device according to claim 1 (10-2), said non-volatile memory (15) is provided with a management area (15c), about matches how the protected data (C) A storage device (10-2) comprising data management means (12g) for storing and managing information in the management area (15c).
The invention of claim 3 comprises a volatile memory (13) and a non-volatile memory (15) partitioned into a plurality of pages that can be initialized and having a data area (15a) and a backup area (15b). A storage device program to be executed by the CPU (12) of (10), wherein the write target data (A) to be written to the nonvolatile memory (15) is at which address of which page of the data area (15a) To which address of which page is written to which address (# 1, # 2), and at least when the write target data (A) is written by the determination procedure (# 1, # 2) Write the protection target data (C) other than the portion where the write target data (A) is written in the determined page to the volatile memory (13). A first write procedure (# 3), the said written in the volatile memory (13) protected data (C) is present is divided, if their protected data is distributed across multiple pages The second write procedure (# 4) for writing the protection target data in the backup area (15b) so that the divided protection target data is concatenated and stored so that the number of pages can be reduced. ), A third write procedure (# 5) for writing the write target data (A) to the volatile memory (13), and the determination procedure (# 1, # 2), the write target data (A) An initialization procedure (# 6) for initializing a page determined to be written, and the write target data (A) and the protection target data (C) written in the volatile memory (13) And Step fourth write procedure for writing to the page of the data area is initialized with (# 6) (15a) (# 7), a program storage device comprising a.
The invention of claim 4 comprises a volatile memory (13) and a non-volatile memory (15) partitioned into a plurality of pages that can be initialized and having a data area (15a) and a backup area (15b). (10) A storage processing method for performing storage processing, wherein the write target data (A) to be written to the nonvolatile memory (15) is from which address of which page of the data area (15a) It is determined that the write target data (A) is written by the determination step (# 1, # 2) for determining which address of the page is written and at least the determination step (# 1, # 2). A first writing step of writing, in the volatile memory (13), the protection target data (C) other than the portion where the write target data (A) is written in the page # 3) and said volatile memory (13) to the protected data written (C) is present is divided, if their protected data is distributed across multiple pages, it is divided A second writing step (# 4) for writing the protection target data to the backup area (15b) so that the protection target data is concatenated and stored so as to fit in the minimum number of pages; It is determined that the write target data (A) is written by the third write step (# 5) for writing the write target data (A) to the memory (13) and the determination step (# 1, # 2). An initialization step (# 6) for initializing the page, and the write target data (A) and the protection target data (C) written in the volatile memory (13) are converted into the initialization step (# 6). )so And synchronize the fourth write step of writing to the page of the data area (15a) (# 7), a storage processing method comprising.

本発明によれば、以下のような効果がある。
(1)保護対象データをバックアップ領域に書き込む場合には、ページごとに書き込むのではなく、保護されるべきデータのみを書き込むので、書き込み領域を縮小させることができ、バックアップの処理時間を短縮させることができる。
(2)保護対象データが複数のページに分散している場合には、最小限のページ数に収まるように保護対象データを書き込むので、保護対象データを効率よく書き込むことができ、初期化する領域が減少し、バックアップの処理時間をより短縮させることができる。
(3)保護対象データの収め方に関する情報を管理領域に記憶して管理するので、保護対象データを確実に管理することができる。
The present invention has the following effects.
(1) When writing the data to be protected to the backup area, only the data to be protected is written, not for each page, so the write area can be reduced and the backup processing time can be shortened. Can do.
(2) When the protection target data is distributed over a plurality of pages, the protection target data is written so as to fit in the minimum number of pages. Therefore, the protection target data can be efficiently written and initialized. This reduces the backup processing time.
(3) Since the information regarding how to store the protection target data is stored and managed in the management area, the protection target data can be reliably managed.

以下、図面等を参照して、本発明の実施例について、さらに詳しく説明する。   Hereinafter, embodiments of the present invention will be described in more detail with reference to the drawings.

図1は、本発明による記憶装置の実施例1を示す図である。
実施例1のICカード(記憶装置)10は、通信部11と、CPU12と、RAM13と、ROM14と、EEPROM15などとを備える。
FIG. 1 is a diagram showing a first embodiment of a storage device according to the present invention.
The IC card (storage device) 10 according to the first embodiment includes a communication unit 11, a CPU 12, a RAM 13, a ROM 14, an EEPROM 15, and the like.

通信部11は、巻き線コイルなどのアンテナと、変調回路及び復調回路などのI/Oインターフェースとを備え、非接触式でリーダー/ライタ20と通信を行い、CPU12及びリーダー/ライタ20間の通信を媒介する部分である。   The communication unit 11 includes an antenna such as a winding coil and an I / O interface such as a modulation circuit and a demodulation circuit, communicates with the reader / writer 20 in a non-contact manner, and communicates between the CPU 12 and the reader / writer 20. It is a part that mediates.

CPU12は、ICカード10を統括制御する中央処理装置であり、四則演算や論理演算などの算術的な処理を行い、通信部11を介してリーダー/ライタ20から受信するコマンドに応じて、ROM14及びEEPROM15に記憶されている実行コード(プログラム)を実行する部分である。   The CPU 12 is a central processing unit that performs overall control of the IC card 10, performs arithmetic processing such as four arithmetic operations and logical operations, and in accordance with commands received from the reader / writer 20 via the communication unit 11, This is a part for executing an execution code (program) stored in the EEPROM 15.

また、CPU12は、判断手段12aと、第1の書込み手段12bと、第2の書込み手段12cと、第3の書込み手段12dと、初期化手段12eと、第4の書込み手段12fとを備える。
判断手段12aは、EEPROM15に書き込む予定の書込み対象データが、EEPROM15のデータ領域15aのどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する制御部である。
第1の書込み手段12bは、判断手段12aによって書込み対象データが書き込まれると判断されたページにおける、書込み対象データが書き込まれる部分以外の保護対象データをRAM13に書き込む制御部である。
第2の書込み手段12cは、RAM13に書き込まれた保護対象データをバックアップ領域15bに書き込む制御部である。
第3の書込み手段12dは、RAM13に書込み対象データを書き込む制御部である。
初期化手段12eは、判断手段12aによって書込み対象データが書き込まれると判断されたページを初期化する制御部である。
第4の書込み手段12fは、RAM13に書き込まれた書込み対象データ及び保護対象データを、初期化手段12eが初期化したデータ領域15aのページに書き込む制御部で
ある。
Further, the CPU 12 includes a determination unit 12a, a first writing unit 12b, a second writing unit 12c, a third writing unit 12d, an initialization unit 12e, and a fourth writing unit 12f.
The determination unit 12a is a control unit that determines from which address of which page of the data area 15a of the EEPROM 15 to which address of which page the write target data to be written to the EEPROM 15 is written.
The first writing unit 12b is a control unit that writes, in the RAM 13, protection target data other than the portion to which the writing target data is written in the page where the writing target data is determined to be written by the determination unit 12a.
The second writing unit 12c is a control unit that writes the protection target data written in the RAM 13 to the backup area 15b.
The third writing unit 12 d is a control unit that writes write target data to the RAM 13.
The initialization unit 12e is a control unit that initializes a page that is determined by the determination unit 12a to be written with data to be written.
The fourth writing unit 12f is a control unit that writes the write target data and the protection target data written in the RAM 13 to the page of the data area 15a initialized by the initialization unit 12e.

RAM13は、揮発性メモリであり、CPU12が処理を行う作業領域や、リーダー/ライタ20とデータをやり取りするための送受信用のバッファなどとして使用される。
ROM14は、不揮発性の読み出し専用のメモリであり、実行コードや、各種パラメータなどが記憶されている。
EEPROM15は、随時書き換え可能な不揮発性メモリであり、実行コードや固有情報(カード固有の番号、会員番号)などが記憶されている。
また、EEPROM15は、各領域にアドレスが付されており、初期化可能な複数のページに区画され、各種データが記憶されるデータ領域15a、及び、バックアップ時に使用されるバックアップ領域15bを有する。
The RAM 13 is a volatile memory, and is used as a work area where the CPU 12 performs processing, a transmission / reception buffer for exchanging data with the reader / writer 20, and the like.
The ROM 14 is a nonvolatile read-only memory, and stores an execution code, various parameters, and the like.
The EEPROM 15 is a non-volatile memory that can be rewritten as needed, and stores an execution code, unique information (card unique number, membership number), and the like.
The EEPROM 15 has an address assigned to each area, is divided into a plurality of pages that can be initialized, and has a data area 15a in which various data are stored, and a backup area 15b used at the time of backup.

一方、リーダー/ライタ20は、ICカード10と非接触式で通信する装置であり、ICカード10に対して電源やクロックなどを供給し、コマンドやデータを送信する。   On the other hand, the reader / writer 20 is a device that communicates with the IC card 10 in a non-contact manner, and supplies power and a clock to the IC card 10 to transmit commands and data.

図2及び図3は、ICカード10のバックアップ動作について説明する図である。
まず、CPU12(図1参照)は、リーダー/ライタ20から受信したコマンドを解釈し、書込み処理を伴うコマンドであれば、図2(#1)に示すように、EEPROM15に書き込む予定の書込み対象データAが、EEPROM15のデータ領域15aのどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する。
ここでは、図2(#2)の破線部分B、すなわち、データ領域15aの1ページ目と2ページ目とにまたがるように、書込み対象データAが書き込まれると判断したものとする。
2 and 3 are diagrams for explaining the backup operation of the IC card 10.
First, the CPU 12 (see FIG. 1) interprets a command received from the reader / writer 20, and if it is a command accompanied by a writing process, as shown in FIG. 2 (# 1), write target data to be written to the EEPROM 15 A determines from which address of which page of the data area 15a of the EEPROM 15 to which address of which page.
Here, it is assumed that it is determined that the write target data A is written so as to extend across the broken line portion B in FIG. 2 (# 2), that is, the first page and the second page of the data area 15a.

ついで、図2(#3)に示すように、CPU12は、書込み対象データAが書き込まれると判断されたデータ領域15aの1ページ目と2ページ目における、書込み対象データAが書き込まれる部分以外の保護対象データCをRAM13に書き込む。
さらに、図2(#4)に示すように、CPU12は、RAM13に書き込まれた保護対象データCをバックアップ領域15bに書き込む。
Next, as shown in FIG. 2 (# 3), the CPU 12 determines other than the portion where the write target data A is written in the first and second pages of the data area 15a in which the write target data A is determined to be written. Write the protection target data C to the RAM 13.
Further, as shown in FIG. 2 (# 4), the CPU 12 writes the protection target data C written in the RAM 13 into the backup area 15b.

そして、図3(#5)に示すように、CPU12は、RAM13に書込み対象データAを書き込む。
次に、図3(#6)に示すように、CPU12は、書込み対象データAが書き込まれると判断された1ページ目と2ページ目を初期化する。
最後に、図3(#7)に示すように、CPU12は、RAM13に書き込まれた書込み対象データA及び保護対象データCを、初期化手段12eが初期化したデータ領域15aのページに書き込む。
なお、バックアップ領域15bに書き込んだ保護対象データCは、復旧の必要がなくなり次第消去してもよいし、必要に応じて残しておいてもよい。
Then, as shown in FIG. 3 (# 5), the CPU 12 writes the write target data A into the RAM 13.
Next, as shown in FIG. 3 (# 6), the CPU 12 initializes the first and second pages for which it is determined that the write target data A is to be written.
Finally, as shown in FIG. 3 (# 7), the CPU 12 writes the write target data A and the protection target data C written in the RAM 13 into the page of the data area 15a initialized by the initialization unit 12e.
Note that the protection target data C written in the backup area 15b may be deleted as soon as recovery is no longer necessary, or may be left as needed.

このように、実施例1によれば、保護対象データCをバックアップ領域15bに書き込む場合には、ページごとに書き込むのではなく、図2(#4)に示すように、保護されるべきデータのみを書き込むので、書き込み領域を縮小させて書き込み時間を短縮させることができ、結果として、バックアップの処理時間を短縮させることができる。
また、本実施例では、記憶装置をICカード10に適用しているので、コマンド処理の高速化が求められるICカードに最適である。
Thus, according to the first embodiment, when the protection target data C is written to the backup area 15b, only the data to be protected is not written for each page, as shown in FIG. 2 (# 4). Thus, the writing area can be reduced to shorten the writing time, and as a result, the backup processing time can be shortened.
In this embodiment, since the storage device is applied to the IC card 10, it is most suitable for an IC card that requires high-speed command processing.

図4は、本発明による記憶装置の実施例2を示す図であり、図5は、従来の方式と実施例2の方式とを比較するための図である。
なお、前述した実施例1と同様な機能を果たす部分には、同一の符号又は末尾に統一した符号を付して、重複する説明や図面を適宜省略する。
実施例2のICカード10−2は、保護対象データCの書き込み方を改良したものである。実施例1のICカード10と異なる点は、EEPROM15が管理領域15cを備える点と、CPU12がデータ管理手段12gを備える点である。
また、第2の書込み手段12cは、保護対象データCが複数のページに分散している場合には、最小限のページ数に収まるように保護対象データを書き込み、データ管理手段12gは、保護対象データCの収め方に関する管理情報(各データの先頭アドレス及びデータ長など)を管理領域15cに記憶して管理する。これにより、保護すべきデータのみを取り出したものを連結してバックアップ領域15bに格納することができるようになる。
FIG. 4 is a diagram showing a second embodiment of the storage device according to the present invention, and FIG. 5 is a diagram for comparing the conventional scheme and the scheme of the second embodiment.
In addition, the part which fulfill | performs the same function as Example 1 mentioned above attaches | subjects the same code | symbol or the code | symbol unified at the end, and abbreviate | omits duplication description and drawing suitably.
The IC card 10-2 of the second embodiment is an improved version of the method for writing the protection target data C. The difference from the IC card 10 of the first embodiment is that the EEPROM 15 includes a management area 15c and the CPU 12 includes a data management means 12g.
In addition, when the protection target data C is distributed over a plurality of pages, the second writing unit 12c writes the protection target data so that the minimum number of pages can be accommodated, and the data management unit 12g Management information (such as the start address and data length of each data) relating to how data C is stored is stored and managed in the management area 15c. As a result, it is possible to concatenate the data extracted only from the data to be protected and store it in the backup area 15b.

このような構成とすることで、図5(A)に示すように、従来の方式であれば、2ページ分の領域の初期化が必要であったものが、図5(B)に示すように、1ページ分の初期化ですむようになる。したがって、初期化対象ページの減少を図ることができ、書換え保証のためのバックアップの処理時間を短縮させることができる。
また、ICカード10−2が、書換え回数などを管理している管理領域15cを予め備えているような場合には、その領域に管理情報を書き込むだけで簡単に保護対象データCを管理することができる。なお、保護対象データCを復旧させる場合には、管理領域15cの管理情報に基づいて簡単に保護対象データCを復旧させることができる。
By adopting such a configuration, as shown in FIG. 5 (A), as shown in FIG. 5 (B), it is necessary to initialize the area for two pages in the conventional method. In addition, the initialization for one page is sufficient. Therefore, the number of pages to be initialized can be reduced, and the backup processing time for rewriting guarantee can be shortened.
If the IC card 10-2 has a management area 15c for managing the number of times of rewriting in advance, the protection target data C can be managed simply by writing management information in that area. Can do. When the protection target data C is recovered, the protection target data C can be easily recovered based on the management information in the management area 15c.

(変形例)
以上説明した実施例に限定されることなく、種々の変形や変更が可能であって、それらも本発明の均等の範囲内である。
(1)記憶装置は、ICカードの例で説明したが、SIMカード、UIMカード、ICタグ、また、携帯電話、携帯ホルダなどに挿入されるSIMカード又はUIMカードなどの他の記憶装置であってもよい。さらに、パーソナルコンピュータなどの情報処理端末や、PDA(Personal Digital Assistant)などの携帯情報端末であってもよい。
(2)EEPROM15は、フラッシュメモリやFeRAM(FRAM:ラムトロン・インターナショナル・コーポレーションの登録商標)などの他の不揮発性メモリであってもよい。
(Modification)
The present invention is not limited to the embodiments described above, and various modifications and changes are possible, and these are also within the equivalent scope of the present invention.
(1) The storage device is described as an example of an IC card, but is a SIM card, a UIM card, an IC tag, or another storage device such as a SIM card or a UIM card inserted into a mobile phone, a mobile holder, or the like. May be. Furthermore, it may be an information processing terminal such as a personal computer or a portable information terminal such as a PDA (Personal Digital Assistant).
(2) The EEPROM 15 may be another nonvolatile memory such as a flash memory or FeRAM (FRAM: a registered trademark of Ramtron International Corporation).

(3)図2において、CPU12は、RAM13に保護対象データCを書き込み(#3)、その保護対象データCをRAM13からバックアップ領域15bに書き込む(#4)例で説明したが、#3において、データ領域15aの2ページ分のデータを全てRAM13に書き込み、#4において、書き込んだデータの中から保護対象データCのみをバックアップ領域15bに書き込んでもよい。この場合、図3の#5においては、RAM13に書き込んだデータ上に、書込み対象データAを上書きすることになる。
(4)図3において、CPU12は、RAM13に書込み対象データAを書き込んでから(#5)、データ領域15aを初期化する(#6)例で説明したが、これとは逆に、データ領域15aを初期化してから、RAM13に書込み対象データAを書き込んでもよい。
(3) In FIG. 2, the CPU 12 writes the protection target data C to the RAM 13 (# 3), and writes the protection target data C from the RAM 13 to the backup area 15b (# 4). All the data for two pages in the data area 15a may be written in the RAM 13, and only the protection target data C among the written data may be written in the backup area 15b in # 4. In this case, in # 5 of FIG. 3, the write target data A is overwritten on the data written in the RAM 13.
(4) In FIG. 3, the CPU 12 writes the write target data A in the RAM 13 (# 5) and then initializes the data area 15a (# 6). However, in contrast to this, the data area The write target data A may be written into the RAM 13 after initializing 15a.

本発明による記憶装置の実施例1を示す図である。It is a figure which shows Example 1 of the memory | storage device by this invention. ICカード10のバックアップ動作について説明する図である。3 is a diagram for explaining a backup operation of the IC card 10. FIG. ICカード10のバックアップ動作について説明する図である。3 is a diagram for explaining a backup operation of the IC card 10. FIG. 本発明による記憶装置の実施例2を示す図である。It is a figure which shows Example 2 of the memory | storage device by this invention. 従来の方式と実施例2の方式とを比較するための図である。It is a figure for comparing the conventional system and the system of Example 2. FIG. 従来のICカードのメモリの内容を示す図である。It is a figure which shows the content of the memory of the conventional IC card.

符号の説明Explanation of symbols

10、10−2 ICカード(記憶装置)
11 通信部
12 CPU
12a 判断手段
12b 第1の書込み手段
12c 第2の書込み手段
12d 第3の書込み手段
12e 初期化手段
12f 第4の書込み手段
12g データ管理手段
13 RAM
14 ROM
15 EEPROM
15a データ領域
15b バックアップ領域
15c 管理領域
20 リーダー/ライタ
A 書込み対象データ
C 保護対象データ
10, 10-2 IC card (storage device)
11 Communication unit 12 CPU
12a determination means 12b first writing means 12c second writing means 12d third writing means 12e initialization means 12f fourth writing means 12g data management means 13 RAM
14 ROM
15 EEPROM
15a Data area 15b Backup area 15c Management area 20 Reader / Writer A Data to be written C Data to be protected

Claims (4)

揮発性メモリと、
初期化可能な複数のページに区画され、データ領域及びバックアップ領域を有する不揮発性メモリと、
前記不揮発性メモリに書き込む予定の書込み対象データが、前記データ領域のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断手段と、
少なくとも、前記判断手段によって前記書込み対象データが書き込まれると判断されたページにおける、前記書込み対象データが書き込まれる部分以外の保護対象データを前記揮発性メモリに書き込む第1の書込み手段と、
前記揮発性メモリに書き込まれた前記保護対象データを前記バックアップ領域に書き込む第2の書込み手段と、
前記揮発性メモリに前記書込み対象データを書き込む第3の書込み手段と、
前記判断手段によって前記書込み対象データが書き込まれると判断されたページを初期化する初期化手段と、
前記揮発性メモリに書き込まれた前記書込み対象データ及び前記保護対象データを、前記初期化手段が初期化した前記データ領域のページに書き込む第4の書込み手段と、
を備え
前記第2の書込み手段は、前記保護対象データが分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるように前記保護対象データを書き込むこと、
を特徴とする記憶装置。
Volatile memory,
A nonvolatile memory partitioned into a plurality of pages that can be initialized and having a data area and a backup area;
Determining means for determining from which address of which page of the data area to which address of which page the data to be written to be written to the nonvolatile memory is written;
At least a first writing unit that writes, in the volatile memory, protection target data other than a portion in which the writing target data is written in a page in which the writing target data is determined to be written by the determination unit;
A second writing means for writing the protection target data written in the volatile memory to the backup area;
Third writing means for writing the data to be written into the volatile memory;
Initialization means for initializing a page determined by the determination means to write the write target data;
A fourth writing means for writing the data to be written and the data to be protected written to the volatile memory to a page of the data area initialized by the initialization means;
Equipped with a,
The second writing means concatenates and stores the divided protection target data when the protection target data is divided and exists and the protection target data is distributed over a plurality of pages. Writing the protected data so that it fits in a minimum number of pages,
A storage device.
請求項1に記載の記憶装置において、
前記不揮発性メモリは、管理領域を備え、
前記保護対象データの収め方に関する情報を前記管理領域に記憶して管理するデータ管理手段を備えること、
を特徴とする記憶装置。
The storage device according to claim 1 ,
The nonvolatile memory includes a management area,
Comprising data management means for storing and managing information on how to store the protection target data in the management area;
A storage device.
揮発性メモリと、
初期化可能な複数のページに区画され、データ領域及びバックアップ領域を有する不揮発性メモリとを備える記憶装置のCPUに実行させる記憶装置のプログラムであって、
前記不揮発性メモリに書き込む予定の書込み対象データが、前記データ領域のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断手順と、
少なくとも、前記判断手順によって前記書込み対象データが書き込まれると判断されたページにおける、前記書込み対象データが書き込まれる部分以外の保護対象データを前記揮発性メモリに書き込む第1の書込み手順と、
前記揮発性メモリに書き込まれた前記保護対象データが分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるようにして、前記保護対象データを前記バックアップ領域に書き込む第2の書込み手順と、
前記揮発性メモリに前記書込み対象データを書き込む第3の書込み手順と、
前記判断手順によって前記書込み対象データが書き込まれると判断されたページを初期化する初期化手順と、
前記揮発性メモリに書き込まれた前記書込み対象データ及び前記保護対象データを、前記初期化手順で初期化した前記データ領域のページに書き込む第4の書込み手順と、
を備える記憶装置のプログラム。
Volatile memory,
A storage device program that is executed by a CPU of a storage device that is partitioned into a plurality of pages that can be initialized and includes a non-volatile memory having a data area and a backup area,
A determination procedure for determining from which address of which page of the data area to which address of which page the write target data to be written to the nonvolatile memory is written;
At least a first writing procedure for writing, in the volatile memory, protection target data other than a portion to which the writing target data is written in a page in which the writing target data is determined to be written by the determination procedure;
When the protection target data written in the volatile memory is divided and exists, and the protection target data is distributed over a plurality of pages, the divided protection target data is concatenated and stored. A second writing procedure for writing the protection target data to the backup area so that the number of pages is reduced to a minimum number of pages ,
A third write procedure for writing the write target data to the volatile memory;
An initialization procedure for initializing the page determined to be written by the determination procedure;
A fourth write procedure for writing the write target data and the protection target data written in the volatile memory to a page of the data area initialized by the initialization procedure;
A storage device program comprising:
揮発性メモリと、
初期化可能な複数のページに区画され、データ領域及びバックアップ領域を有する不揮発性メモリとを備える記憶装置に記憶処理を行わせる記憶処理方法であって、
前記不揮発性メモリに書き込む予定の書込み対象データが、前記データ領域のどのページのどのアドレスから、どのページのどのアドレスまでに書き込まれるかを判断する判断工程と、
少なくとも、前記判断工程によって前記書込み対象データが書き込まれると判断されたページにおける、前記書込み対象データが書き込まれる部分以外の保護対象データを前記揮発性メモリに書き込む第1の書込み工程と、
前記揮発性メモリに書き込まれた前記保護対象データが分断されて存在し、それらの保護対象データが複数のページに分散している場合には、分断された前記保護対象データを連結して格納することで最小限のページ数に収まるようにして、前記保護対象データを前記バックアップ領域に書き込む第2の書込み工程と、
前記揮発性メモリに前記書込み対象データを書き込む第3の書込み工程と、
前記判断工程によって前記書込み対象データが書き込まれると判断されたページを初期化する初期化工程と、
前記揮発性メモリに書き込まれた前記書込み対象データ及び前記保護対象データを、前記初期化工程で初期化した前記データ領域のページに書き込む第4の書込み工程と、
を備える記憶処理方法。
Volatile memory,
A storage processing method for performing storage processing in a storage device that is partitioned into a plurality of pages that can be initialized and includes a nonvolatile memory having a data area and a backup area,
A determination step of determining from which address of which page of the data area to which address of which page the target data to be written to the nonvolatile memory is written;
At least a first writing step of writing, in the volatile memory, protection target data other than a portion to which the writing target data is written in a page where the writing target data is determined to be written by the determination step;
When the protection target data written in the volatile memory is divided and exists, and the protection target data is distributed over a plurality of pages, the divided protection target data is concatenated and stored. A second writing step of writing the protection target data in the backup area so that the number of pages is kept to a minimum .
A third writing step for writing the data to be written into the volatile memory;
An initialization step of initializing a page determined to be written by the determination step;
A fourth write step of writing the write target data and the protection target data written in the volatile memory to a page of the data area initialized in the initialization step;
A storage processing method comprising:
JP2006322059A 2006-11-29 2006-11-29 Storage device, storage device program, and storage processing method Expired - Fee Related JP5050508B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006322059A JP5050508B2 (en) 2006-11-29 2006-11-29 Storage device, storage device program, and storage processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006322059A JP5050508B2 (en) 2006-11-29 2006-11-29 Storage device, storage device program, and storage processing method

Publications (2)

Publication Number Publication Date
JP2008134945A JP2008134945A (en) 2008-06-12
JP5050508B2 true JP5050508B2 (en) 2012-10-17

Family

ID=39559750

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006322059A Expired - Fee Related JP5050508B2 (en) 2006-11-29 2006-11-29 Storage device, storage device program, and storage processing method

Country Status (1)

Country Link
JP (1) JP5050508B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023085589A1 (en) * 2021-11-10 2023-05-19 삼성전자 주식회사 Method for preserving data in initialization situation of electronic device and electronic device thereof

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2842252B2 (en) * 1994-11-11 1998-12-24 日本電気株式会社 Data writing method to flash memory card in computer system
JPH1069420A (en) * 1996-08-29 1998-03-10 Sony Corp Information recording and reproducing device and information recording and reproducing method
JP4066991B2 (en) * 1999-02-19 2008-03-26 三菱電機株式会社 Information processing device
JP2002196976A (en) * 2000-12-27 2002-07-12 Nippon Telegr & Teleph Corp <Ntt> Memory access control method and device in ic card equipped with flash memory, and program storage medium
JP2003216511A (en) * 2002-01-23 2003-07-31 Matsushita Electric Ind Co Ltd Non-volatile memory device, data updating method, data updating program and computer readable recording medium with recorded program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023085589A1 (en) * 2021-11-10 2023-05-19 삼성전자 주식회사 Method for preserving data in initialization situation of electronic device and electronic device thereof

Also Published As

Publication number Publication date
JP2008134945A (en) 2008-06-12

Similar Documents

Publication Publication Date Title
KR100527609B1 (en) Storage, data processing systems and data recording and reading methods
JP2006011818A (en) Portable electronic device and method for controlling portable electronic device
JP2010182270A (en) Mobile electronic apparatus and data management method in mobile electronic apparatus
JP2005235028A (en) Information processor, information processing method, and computer program
JP4776462B2 (en) Portable electronic device and method for controlling portable electronic device
US7257030B2 (en) Operating a storage component
JP5050508B2 (en) Storage device, storage device program, and storage processing method
JP5104653B2 (en) IC card and IC card program
JP3376331B2 (en) Storage method using flash memory and storage medium storing storage control program
JP4452158B2 (en) Nonvolatile memory system
JP6233134B2 (en) Electronic information storage medium, information processing method, and information processing program
KR100399603B1 (en) Smart card and method for writing/erasing and operating an os program the same
JP3620478B2 (en) Storage device, data processing system using the storage device, and data read method
JP2008310596A (en) Portable electronic equipment and control method for potable electronic equipment
JP4195822B2 (en) IC card and IC card program
US7346730B2 (en) Mobile electronic device
JP7322923B2 (en) Secure element, transaction control method and device
JP2006293706A (en) Multi-application ic card with application updating function
JP4836707B2 (en) Portable electronic device and IC card
CN114115755B (en) Method and device for data writing and storage medium
JP2008047042A (en) Portable electronic device and ic card
JP5341947B2 (en) IC card, control method of IC card, and control method of portable electronic device
JP2005056144A (en) Electronic apparatus loaded with flash memory, its memory data managing method, and program
JP6984328B2 (en) Electronic information storage medium, IC card, external device, data writing method and data writing program
JP4738249B2 (en) Portable electronic device, IC card and IC module

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090915

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120228

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120425

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120709

R150 Certificate of patent or registration of utility model

Ref document number: 5050508

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20150803

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees