Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7613276B2 - Secure element, device and method for managing non-volatile memory - Google Patents
[go: Go Back, main page]

JP7613276B2 - Secure element, device and method for managing non-volatile memory - Google Patents

Secure element, device and method for managing non-volatile memory Download PDF

Info

Publication number
JP7613276B2
JP7613276B2 JP2021092105A JP2021092105A JP7613276B2 JP 7613276 B2 JP7613276 B2 JP 7613276B2 JP 2021092105 A JP2021092105 A JP 2021092105A JP 2021092105 A JP2021092105 A JP 2021092105A JP 7613276 B2 JP7613276 B2 JP 7613276B2
Authority
JP
Japan
Prior art keywords
page
data
volatile memory
written
secure element
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
JP2021092105A
Other languages
Japanese (ja)
Other versions
JP2022184327A (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 JP2021092105A priority Critical patent/JP7613276B2/en
Publication of JP2022184327A publication Critical patent/JP2022184327A/en
Application granted granted Critical
Publication of JP7613276B2 publication Critical patent/JP7613276B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)
  • Read Only Memory (AREA)

Description

本発明は,セキュアエレメントが有する不揮発性メモリのメモリ寿命を延ばす技術に関する。 The present invention relates to technology for extending the memory life of non-volatile memory contained in a secure element.

外部からの解析攻撃に対する強固な耐タンパー性を持つ半導体製品であるセキュアエレメントは,様々なデバイス(例えば,ICカード)に搭載されている。セキュアエレメントを搭載したデバイスの主用途はセキュリティ用途(例えば,金融決済用途)になる。 Secure elements, which are semiconductor products with strong tamper resistance against external analysis attacks, are installed in various devices (e.g., IC cards). The main use of devices equipped with secure elements is for security purposes (e.g., financial settlement purposes).

セキュリティ用途で用いられるデバイスに実装するセキュアエレメントは,データを記憶するメモリとして,電気的に書き換え可能な不揮発性メモリを備える。これ以降,不揮発性メモリとは,電気的に書き換え可能な不揮発性メモリを意味する。 A secure element implemented in a device used for security purposes has electrically rewritable non-volatile memory as the memory for storing data. Hereinafter, non-volatile memory means electrically rewritable non-volatile memory.

セキュアエレメントが備える不揮発性メモリは,ページと呼ばれる単位で管理される。不揮発性メモリでは,データの消去単位はページ単位になる。このため,データを格納した不揮発性メモリのページにデータを書き込む処理では,データを書き込むページのページデータ(ページの全体データを意味する)を消去した後,所定のアドレスにデータを書き込んだページデータを,ページデータを消去したページに書き込まなければならない。 The non-volatile memory in a secure element is managed in units called pages. In non-volatile memory, data is erased in units of pages. For this reason, when writing data to a page of non-volatile memory that stores data, the page data (meaning the entire data of the page) of the page to which the data is to be written must first be erased, and then the page data with the data written to a specified address must be written to the page from which the page data was erased.

不揮発性メモリを構成する記録素子の構造上,不揮発性メモリの更新回数(消去回数)には上限がある。不揮発性メモリに設けられた更新限度回数は,不揮発性メモリの種類によって異なる。例えば,不揮発性メモリの更新限度回数は10万回である。 Due to the structure of the recording elements that make up nonvolatile memory, there is a limit to the number of times the nonvolatile memory can be updated (erased). The update limit set for nonvolatile memory varies depending on the type of nonvolatile memory. For example, the update limit for nonvolatile memory is 100,000 times.

近年,セキュアエレメントに格納するデータのサイズが増加したことにより,セキュアエレメントが備える不揮発性メモリの容量が増加し,不揮発性メモリのページサイズも増加傾向にある。 In recent years, the size of data stored in secure elements has increased, leading to an increase in the capacity of the non-volatile memory in secure elements and a trend toward an increase in the page size of the non-volatile memory.

ページサイズが大きくなると,サイズが大きいデータを扱う場合,データを書き込むページが少なくて済むなどの利点が生じる。しかし,サイズが小さいデータを取り扱う場合,1つのページに含まれるデータの数が多くなるため,書き換え頻度が高い複数のデータが1つページに格納されていると,このページの更新回数が増え,不揮発性メモリのメモリ寿命が短くなる問題が生じる。よって,書き換え頻度の高いデータが存在しても,不揮発性メモリのメモリ寿命が短くならない工夫が必要になる。 When the page size is large, there are advantages such as the fact that fewer pages need to be written to the data when handling large data. However, when handling small data, the amount of data contained in one page increases, and if multiple pieces of data that are frequently rewritten are stored in one page, the number of updates to this page increases, resulting in a problem of shortening the memory lifespan of the non-volatile memory. Therefore, it is necessary to devise a way to prevent the memory lifespan of non-volatile memory from being shortened even when data that is frequently rewritten exists.

不揮発性メモリのメモリ寿命を延ばす工夫に,ウェアレベリング処理を用いるのが一般的になっている(例えば,特許文献1)。ウェアレベリング処理とは,書き換えが行われる記憶素子が特定のものに偏らないように分散することで,特定のデータについて繰り返し書き換えが発生した場合でも不揮発性メモリの全体として記憶素子の消耗を平均化する技術である。 The use of wear leveling has become common as a way to extend the memory life of non-volatile memory (for example, see Patent Document 1). Wear leveling is a technique that distributes memory elements that are rewritten so that they are not biased toward specific ones, thereby averaging out the wear of memory elements in the non-volatile memory as a whole, even if specific data is repeatedly rewritten.

特開2019-128905号公報JP 2019-128905 A

ウェアレベリング処理により不揮発性メモリのメモリ寿命を延ばすと,不揮発性メモリのメモリ寿命を延ばすための処理が複雑になる問題がある。特に,書き換え頻度が高くサイズが小さいデータが一つのページに複数点在すると,それぞれのデータを考慮してウェアレベリング処理を行わなければならず,不揮発性メモリのメモリ寿命を延ばすための処理がより複雑になる。 When wear leveling is used to extend the memory life of non-volatile memory, the process of extending the memory life of non-volatile memory becomes complicated. In particular, when multiple small pieces of data that are frequently rewritten are scattered across a single page, wear leveling must be performed taking into account each piece of data, making the process of extending the memory life of non-volatile memory even more complicated.

そこで,本発明は,複雑にならない比較的単純な処理で,セキュアエレメントに実装された不揮発性メモリのメモリ寿命を延ばせることを目的とする。 The present invention aims to extend the memory life of non-volatile memory implemented in a secure element using relatively simple processing that is not complicated.

上述した課題を解決する第1発明は, データを格納したページの代替に利用するスペア領域を設けた電気的に書き換え可能な不揮発性メモリと,論理ページ番号に関連付けて論理ページ番号に対応させたページのエントリ情報を管理するメモリ管理手段を備え,前記メモリ管理手段は,データを書き込む処理を実行するごとに,データを書き込んだページの更新回数を記録し,データを書き込んだページの更新回数が閾値に達すると,データを書き込んだページのページデータを前記スペア領域に含まれる一つのページに複写し,データを書き込んだページが対応している論理ページ番号に関連付けられているエントリ情報を,前記ページデータを複写した前記スペア領域のページのエントリ情報に書き換える処理を実行することを特徴とするセキュアエレメントである。 The first invention for solving the above-mentioned problems is a secure element that includes an electrically rewritable non-volatile memory provided with a spare area used to replace a page that stores data, and a memory management means for managing entry information of a page that corresponds to the logical page number in association with the logical page number, the memory management means recording the number of updates of the page to which data is written each time data is written, and when the number of updates of the page to which data is written reaches a threshold value, copying the page data of the page to which data is written to one page included in the spare area, and rewriting the entry information associated with the logical page number to which the page to which data is written corresponds to the entry information of the page of the spare area to which the page data is copied.

更に,第2発明は,第1発明に記載したセキュアエレメントを実装したデバイスである。 Furthermore, the second invention is a device that implements the secure element described in the first invention.

更に,第3発明は,データを格納したページの代替に利用するスペア領域を電気的に書き換え可能な不揮発性メモリに設け,論理ページ番号に関連付けて論理ページ番号に対応させたページのエントリ情報を管理するメモリ管理手段が,データを書き込む処理を実行するごとに,データを書き込んだページの更新回数を記録するステップ,前記メモリ管理手段が,データを書き込んだページの更新回数が閾値に達すると,データを書き込んだページのページデータを前記スペア領域に含まれる一つのページに複写し,データを書き込んだページが対応している論理ページ番号に関連付けられているエントリ情報を,前記ページデータを複写した前記スペア領域のページのエントリ情報に書き換えるステップを実行することを特徴とするセキュアエレメントの不揮発性メモリ管理方法である。 The third invention is a non-volatile memory management method for a secure element, characterized in that a spare area used to replace a page storing data is provided in an electrically rewritable non-volatile memory, and a memory management means for managing entry information of a page corresponding to the logical page number in association with a logical page number records the number of updates of the page to which data is written each time a data write process is executed, and when the number of updates of the page to which data is written reaches a threshold value, the memory management means executes a step of copying the page data of the page to which data is written to one page included in the spare area, and rewriting the entry information associated with the logical page number to which the page to which data is written corresponds to the entry information of the page of the spare area to which the page data is copied.

本発明では,更新回数が更新限度回数に近づいた不揮発性メモリのページを他のページで代替するだけの比較的単純な処理で,不揮発性メモリのメモリ寿命を延ばすことができる。 In this invention, the memory life of non-volatile memory can be extended by a relatively simple process of replacing a page of non-volatile memory whose update count is approaching the update limit with another page.

セキュアエレメントを搭載したデバイスの一例を説明する図。FIG. 1 is a diagram illustrating an example of a device equipped with a secure element. セキュアエレメントが備えるハードウェアを説明する図。FIG. 2 is a diagram for explaining hardware included in a secure element. セキュアエレメントの構成を説明する図。FIG. 2 is a diagram for explaining the configuration of a secure element. 不揮発性メモリの構造を説明する図。FIG. 2 is a diagram illustrating a structure of a nonvolatile memory. ページテーブルを説明する図。FIG. 2 is a diagram for explaining a page table. セキュアエレメントが備えるメモリ管理手段の動作を説明する図。FIG. 4 is a diagram for explaining the operation of a memory management means included in the secure element. 更新回数が閾値に達したページを代替する処理を説明する図。11A and 11B are diagrams illustrating a process of replacing a page whose update count has reached a threshold value.

ここから,本発明に係る実施形態について記載する。本実施形態は,本発明の理解を容易にするためのものであり,本発明は,本実施形態に限定されるものではない。また,特に断りのない限り,図面は,本発明の理解を容易にするために描かれた模式的な図である。 From here, an embodiment of the present invention will be described. This embodiment is intended to facilitate understanding of the present invention, and the present invention is not limited to this embodiment. Furthermore, unless otherwise specified, the drawings are schematic diagrams drawn to facilitate understanding of the present invention.

図1は,セキュアエレメント1を搭載したデバイス2の一例を説明する図である。図1では,セキュアエレメント1を搭載したデバイス2を,ISO7816に準拠した接触通信により外部端末と通信する接触型ICカードとして図示している。 Figure 1 is a diagram for explaining an example of a device 2 equipped with a secure element 1. In Figure 1, the device 2 equipped with a secure element 1 is illustrated as a contact-type IC card that communicates with an external terminal by contact communication conforming to ISO 7816.

図1において,デバイス2はクレジットカードの形状にしているが,セキュアエレメント1を搭載したデバイス2の形状は,クレジットカードの形状に限定されない。セキュアエレメント1を搭載したデバイス2は,スマートフォンなどに装着するSIM(Subscriber Identity Module)でもよく,または,スマートフォンなどの基板に実装するeSIM(embedded Subscriber Identity Module)でもよい。 In FIG. 1, the device 2 is shaped like a credit card, but the shape of the device 2 equipped with the secure element 1 is not limited to that of a credit card. The device 2 equipped with the secure element 1 may be a SIM (Subscriber Identity Module) that is attached to a smartphone or the like, or an eSIM (embedded Subscriber Identity Module) that is mounted on a board of a smartphone or the like.

図1で図示したデバイス2において,セキュアエレメント1は外部端子の裏側に樹脂モールドされている。セキュアエレメント1は,外部端子20を介して図外の外部装置(例えば,リーダライタ)と接触通信する。なお,セキュアエレメント1が対応する通信方式は,ISO7816に準拠した接触通信に限定されない。セキュアエレメント1が対応する通信方式は,ISO14443に準拠した非接触通信でもよく,コンピュータ内部で用いられる通信方式(例えば,SPI,Serial Peripheral Interface)でもよい。 In the device 2 shown in FIG. 1, the secure element 1 is resin molded on the back side of the external terminal. The secure element 1 communicates by contact with an external device (e.g., a reader/writer) not shown in the figure via the external terminal 20. Note that the communication method supported by the secure element 1 is not limited to contact communication compliant with ISO 7816. The communication method supported by the secure element 1 may be contactless communication compliant with ISO 14443, or a communication method used inside a computer (e.g., SPI, Serial Peripheral Interface).

図2は,セキュアエレメント1が備えるハードウェアを説明する図である。本実施形態に係るセキュアエレメント1は,ハードウェアとして,接触通信インタフェース101,CPU100(Central Processing Unit),RAM102(Random Access Memory),ROM103(Read Only Memory),不揮発性メモリ104,コプロセッサ105(Coprocessor),乱数生成器106(RNG: Random Number Generator),および,電力供給回路107を備えている。当然のことながら,セキュアエレメント1に集積する回路は,これらの回路に限定されない。 Figure 2 is a diagram explaining the hardware of the secure element 1. The secure element 1 according to this embodiment includes, as hardware, a contact communication interface 101, a CPU 100 (Central Processing Unit), a RAM 102 (Random Access Memory), a ROM 103 (Read Only Memory), a non-volatile memory 104, a coprocessor 105, a random number generator 106 (RNG: Random Number Generator), and a power supply circuit 107. Naturally, the circuits integrated in the secure element 1 are not limited to these circuits.

本実施形態において,セキュアエレメント1のCPU100は,メモリに格納されたプログラムコードを解釈して,所定の処理を実行する回路である。電力供給回路107は,デバイス2の表面にある外部端子20(VCC端子)と接続し,外部端末から供給された電力を他の回路(例えば,CPU100)に供給する回路である。接触通信インタフェース101は,デバイス2の表面にある外部端子20(I/O端子)と接続し,外部端末と接触通信を行う回路である。コプロセッサ105は,暗号鍵を用いた暗号演算を高速に処理できるように構成された回路である。乱数生成器106は,乱数を生成する回路である。 In this embodiment, the CPU 100 of the secure element 1 is a circuit that interprets program code stored in memory and executes a predetermined process. The power supply circuit 107 is a circuit that connects to the external terminal 20 (VCC terminal) on the surface of the device 2, and supplies power supplied from the external terminal to other circuits (e.g., the CPU 100). The contact communication interface 101 is a circuit that connects to the external terminal 20 (I/O terminal) on the surface of the device 2, and performs contact communication with the external terminal. The coprocessor 105 is a circuit configured to be able to process cryptographic operations using an encryption key at high speed. The random number generator 106 is a circuit that generates random numbers.

RAM102,ROM103および不揮発性メモリ104は,セキュアエレメント1が備えるメモリになる。RAM102は,電気的な書き換え可能な揮発性メモリである。ROM103は,電気的に書き換えできない読取り専用のメモリである。不揮発性メモリ104は,電気的に書き換え可能な不揮発性のメモリである。 RAM 102, ROM 103, and non-volatile memory 104 are memories provided in the secure element 1. RAM 102 is an electrically rewritable volatile memory. ROM 103 is a read-only memory that cannot be electrically rewritable. Non-volatile memory 104 is an electrically rewritable non-volatile memory.

図3は,セキュアエレメント1の構成を説明する図である。セキュアエレメント1が備える不揮発性メモリ104は,データの書き込み対象となるメモリである。セキュアエレメント1に実装されたオペレーティングシステム10(以下,「OS10」と記す。OSは,Operating Systemの略)は,不揮発性メモリ104を管理する機能を有する。 Figure 3 is a diagram explaining the configuration of the secure element 1. The non-volatile memory 104 provided in the secure element 1 is a memory to which data is written. The operating system 10 (hereinafter referred to as "OS 10"; OS is an abbreviation for Operating System) implemented in the secure element 1 has a function of managing the non-volatile memory 104.

アプリケーション12は,不揮発性メモリ104にデータを書き込む処理を必要とするコマンドを有する。このコマンドには,書き込み系コマンドのみならず認証系コマンドなども含まれる。認証系コマンドでは,認証の中断または失敗した回数をカウントするリトライカウンタが少なくとも必要となる。リトライカウンタは不揮発性メモリ104に格納されるデータである。認証系コマンドが実行されるごとに,不揮発性メモリ104に格納されたリトライカウンタの値は一つ減算した値に書き換えられ,認証系コマンドに対応した認証に成功すると,不揮発性メモリ104に格納されたリトライカウンタの値はリトライカウンタの最大値に書き換えられる。 The application 12 has a command that requires a process of writing data to the non-volatile memory 104. This command includes not only write-related commands but also authentication-related commands. Authentication-related commands require at least a retry counter that counts the number of times authentication is interrupted or fails. The retry counter is data stored in the non-volatile memory 104. Each time an authentication-related command is executed, the value of the retry counter stored in the non-volatile memory 104 is rewritten to a value that is decremented by one, and when authentication corresponding to the authentication-related command is successful, the value of the retry counter stored in the non-volatile memory 104 is rewritten to the maximum value of the retry counter.

図4は,不揮発性メモリ104の構造を説明する図である。図4で図示したごとく,セキュアエレメント1が備える不揮発性メモリ104は,セキュアエレメント1に実装されたOS10により,ページ13と呼ばれる単位に分割されて管理される。ページ13とは,具体的に,所定のページサイズの連続したアドレス範囲になる。容量が比較的小さい不揮発性メモリ104の場合,ページサイズは数十バイト程度であるが,容量が比較的大きい不揮発性メモリ104の場合,ページサイズは,128バイト,256バイトまたは512バイトなどになる。 Figure 4 is a diagram explaining the structure of the non-volatile memory 104. As shown in Figure 4, the non-volatile memory 104 provided in the secure element 1 is divided into units called pages 13 and managed by the OS 10 implemented in the secure element 1. Specifically, a page 13 is a continuous address range of a predetermined page size. In the case of a non-volatile memory 104 with a relatively small capacity, the page size is about several tens of bytes, but in the case of a non-volatile memory 104 with a relatively large capacity, the page size is 128 bytes, 256 bytes, 512 bytes, or the like.

セキュアエレメント1が備える不揮発性メモリ104はデータ格納領域1040およびスペア領域1043を含んでいる。データ格納領域1040は,OS10に割り当てられた領域であるOS領域1041と,セキュアエレメント1に実装されたアプリケーション12に割り当てられた領域であるアプリケーション領域1042を含む。OS領域1041に含まれるページ13には,OS10が使用するデータを少なくとも格納する。OS10のプログラムコードの本体はROM103に記憶される。アプリケーション領域1042に含まれるページ13には,アプリケーション12のプログラムコード,および,アプリケーション12が使用するデータを格納する。 The non-volatile memory 104 provided in the secure element 1 includes a data storage area 1040 and a spare area 1043. The data storage area 1040 includes an OS area 1041, which is an area allocated to the OS 10, and an application area 1042, which is an area allocated to an application 12 implemented in the secure element 1. Pages 13 included in the OS area 1041 store at least the data used by the OS 10. The main body of the program code of the OS 10 is stored in the ROM 103. Pages 13 included in the application area 1042 store the program code of the application 12 and the data used by the application 12.

スペア領域1043は,データ格納領域1040に含まれるページ13の代替に用いるページ13を確保するための領域である。スペア領域1043のページ13で代替するデータ格納領域1040のページ13は,更新回数が不揮発性メモリ104の更新限度回数に近くなったページ13になる。なお,データ格納領域1040のページ13の代替に使用されたスペア領域1043のページ13は,スペア領域1043からデータ格納領域1040に移行する。スペア領域1043の一つのページ13が代替に使用されると,スペア領域1043に含まれるページ数は一つ減るが,データ格納領域1040に含まれるページ数は変わらない。 The spare area 1043 is an area for securing a page 13 to be used as a replacement for a page 13 contained in the data storage area 1040. The page 13 of the data storage area 1040 that is replaced by the page 13 in the spare area 1043 is a page 13 whose number of updates is approaching the update limit of the non-volatile memory 104. Note that the page 13 of the spare area 1043 that has been used to replace the page 13 of the data storage area 1040 is transferred from the spare area 1043 to the data storage area 1040. When one page 13 of the spare area 1043 is used as a replacement, the number of pages contained in the spare area 1043 decreases by one, but the number of pages contained in the data storage area 1040 does not change.

セキュアエレメント1に実装されたOS10は,不揮発性メモリ104を管理する機能としてメモリ管理手段11を備えている。 The OS 10 implemented in the secure element 1 has a memory management means 11 as a function for managing the non-volatile memory 104.

メモリ管理手段11は,セキュアエレメント1に実装されている不揮発性メモリ104のページ13を管理するためのデータテーブルとして,論理ページ番号とこれに対応させる不揮発性メモリ104のページ13に係るエントリ情報を記したページテーブル130を有している。 The memory management means 11 has a page table 130 that contains logical page numbers and corresponding entry information relating to pages 13 of the non-volatile memory 104 as a data table for managing pages 13 of the non-volatile memory 104 implemented in the secure element 1.

論理ページ番号は,不揮発性メモリ104の論理的なページ番号で,コンピュータプログラムがアドレスの指定に使用するページ番号である。論理ページ番号を用いて不揮発性メモリ104のページ13を管理することで,コンピュータプログラムは,コンピュータプログラムがアクセスするデータの物理アドレスを意識することなく,所定のデータにアクセスできる。 The logical page number is the logical page number of the non-volatile memory 104, and is the page number that a computer program uses to specify an address. By using the logical page number to manage pages 13 of the non-volatile memory 104, the computer program can access specific data without being aware of the physical address of the data that the computer program is accessing.

図5は,ページテーブル130を説明する図である。ページテーブル130には,論理ページ番号の総数に応じたレコードが設けられる。本実施形態において,論理ページ番号の総数は,不揮発性メモリ104の総ページになる。図5では,論理ページ番号は降順で並んでいる。一つのレコードには,レコードに対応する論理ページ番号と,論理ページ番号に対応させるページ属性と,論理ページ番号に対応させるページ13のエントリ情報が記される。 Figure 5 is a diagram explaining the page table 130. The page table 130 has records according to the total number of logical page numbers. In this embodiment, the total number of logical page numbers is the total number of pages in the non-volatile memory 104. In Figure 5, the logical page numbers are arranged in descending order. Each record contains the logical page number corresponding to the record, the page attribute to be associated with the logical page number, and the entry information of the page 13 to be associated with the logical page number.

ページ属性は,論理ページ番号に対応させる不揮発性メモリ104のページ13の属性を示す情報である。本実施形態では,ページ属性は,データ格納領域1040またはスペア領域1043のいずれかを示す情報である。ページ属性をスペア領域1043に設定する論理ページ番号の数は予め決まっている。図5では,ページ属性をスペア領域1043に設定した論理ページ番号は,ページテーブル130の下位最末端に配置されている。図5において,ページ属性をスペア領域1043に設定しない論理ページ番号のページ属性はすべてデータ格納領域1040に設定されている。 The page attribute is information indicating the attribute of the page 13 of the non-volatile memory 104 that corresponds to the logical page number. In this embodiment, the page attribute is information indicating either the data storage area 1040 or the spare area 1043. The number of logical page numbers for which the page attribute is set to the spare area 1043 is predetermined. In FIG. 5, the logical page numbers for which the page attribute is set to the spare area 1043 are placed at the bottom end of the page table 130. In FIG. 5, the page attributes of all logical page numbers for which the page attribute is not set to the spare area 1043 are set to the data storage area 1040.

不揮発性メモリ104のページ13のエントリ情報は,不揮発性メモリ104のページ13にアクセスするための情報を含んでいる。本実施形態のエントリ情報は,ページ13の開始アドレスを含んでいる。開始アドレスは,ページ13に対応する領域の先頭になる不揮発性メモリ104のアドレスである。ページテーブル130に記されたエントリ情報を利用することで,論理ページ番号に対応する不揮発性メモリ104のページ13にアクセスできる。 The entry information for page 13 of non-volatile memory 104 includes information for accessing page 13 of non-volatile memory 104. In this embodiment, the entry information includes the start address of page 13. The start address is the address of non-volatile memory 104 that is the beginning of the area corresponding to page 13. By using the entry information recorded in page table 130, it is possible to access page 13 of non-volatile memory 104 that corresponds to the logical page number.

メモリ管理手段11は,ページ13の更新回数をページ13ごと管理できるように構成されている。ページ13の更新回数はページテーブル130に記憶させることができるが,ページ13の更新回数をページテーブル130に記憶させると,ページテーブル130を格納したページ13の更新回数が最も高くなってしまう。なぜなら,データを書き込むページ13にかかわらず,データを書き込む処理を実行するごとに,ページテーブル130を格納したページ13の更新が必ず必要になるからである。 The memory management means 11 is configured to be able to manage the number of updates for each page 13. The number of updates for a page 13 can be stored in the page table 130, but if the number of updates for a page 13 is stored in the page table 130, the number of updates for the page 13 that stores the page table 130 will be the highest. This is because, regardless of the page 13 to which data is written, it is always necessary to update the page 13 that stores the page table 130 each time a data write process is executed.

そこで,本実施形態では,ページ13ごとに記憶させるデータであるページ管理情報131にページ13の更新回数を記憶させている。ページ管理情報131には,更新回数以外に,ページ13の管理に係る他のデータを含ませることができる。例えば,ページデータの誤り検出符号をページ管理情報131に含ませることができる。データの書き込みはページ単位で行われるため,ページ13にデータを書き込む際,データを書き込むページ13のページ管理情報131に含まれる更新回数も同時に更新すれば,ページ13の更新回数を記録するためだけにページ13を更新する必要はなくなる。 Therefore, in this embodiment, the number of updates for page 13 is stored in page management information 131, which is data stored for each page 13. In addition to the number of updates, the page management information 131 can contain other data related to the management of the page 13. For example, an error detection code for the page data can be included in the page management information 131. Since data is written on a page-by-page basis, when data is written to page 13, if the number of updates contained in the page management information 131 of the page 13 to which the data is written is also updated at the same time, it will no longer be necessary to update the page 13 just to record the number of updates for page 13.

本実施形態に係るメモリ管理手段11が,ページ13の更新回数をページ13ごとに管理するのは,ページ13の更新回数が更新限度回数に近づいたページ13をスペア領域1043のページ13で代替できるようにするためである。メモリ管理手段11がこの機能を備えることにより,更新回数が更新限度回数に近づいたページ13を他のページ13で代替するだけの比較的単純な処理で,不揮発性メモリ104のメモリ寿命を延ばすことができる。また,書き換え頻度の高いページ13のページ数に合わせてスペア領域1043に含ませるページ数の初期値を決定すれば,不揮発性メモリ104のメモリ寿命を延ばすために必要な不揮発性メモリ104のページ数を少なくできる。 The memory management means 11 according to this embodiment manages the number of updates of each page 13 in order to allow a page 13 whose update count is approaching the update limit to be replaced by a page 13 in the spare area 1043. By providing this function to the memory management means 11, the memory life of the non-volatile memory 104 can be extended by a relatively simple process of simply replacing a page 13 whose update count is approaching the update limit with another page 13. Furthermore, by determining the initial value of the number of pages to be included in the spare area 1043 according to the number of pages 13 that are frequently rewritten, the number of pages of the non-volatile memory 104 required to extend the memory life of the non-volatile memory 104 can be reduced.

ここから,本実施形態に係るセキュアエレメント1が備えるメモリ管理手段11の動作について詳細に説明する。図6は,セキュアエレメント1が備えるメモリ管理手段11の動作を説明する図である。図6の説明は、本発明に係る不揮発性メモリ管理方法の説明も兼ねる。 From here, the operation of the memory management means 11 provided in the secure element 1 according to this embodiment will be described in detail. Figure 6 is a diagram explaining the operation of the memory management means 11 provided in the secure element 1. The explanation of Figure 6 also includes an explanation of the non-volatile memory management method according to the present invention.

図6のステップS1において,メモリ管理手段11は,不揮発性メモリ104へのデータ書き込み要求を受ける。不揮発性メモリ104へのデータ書き込み要求をメモリ管理手段11に行う主体はアプリケーション12などのコンピュータプログラムになる。不揮発性メモリ104へのデータ書き込み要求では,不揮発性メモリ104に書き込むデータとこのデータを書き込む書き込み先アドレスがメモリ管理手段11に引き渡される。なお,書き込み先アドレスの指定には,論理ページ番号が少なくとも用いられる。具体的には,アドレスは,論理ページ番号とページ内オフセットによって記述される。 In step S1 of FIG. 6, the memory management means 11 receives a request to write data to the non-volatile memory 104. A computer program such as an application 12 issues a request to the memory management means 11 to write data to the non-volatile memory 104. In the request to write data to the non-volatile memory 104, the data to be written to the non-volatile memory 104 and the destination address to which this data is to be written are passed to the memory management means 11. Note that at least the logical page number is used to specify the destination address. Specifically, the address is described by the logical page number and an offset within the page.

図6のステップS2おいて,メモリ管理手段11は,データ書き込み要求に含まれる書き込み先アドレスから,データ書き込み要求に含まれるデータを書き込む処理を実行する。図6のステップS3において,メモリ管理手段11は,データを書き込んだ不揮発性メモリ104のページ13(データ格納領域1040に含まれるページ13になる)の更新回数を記録する処理を行う。図6のステップS4において,メモリ管理手段11は,データを書き込んだ不揮発性メモリ104のページ13の更新回数を確認する。データを書き込んだ不揮発性メモリ104のページ13の更新回数が閾値に達していない場合,メモリ管理手段11は,不揮発性メモリ104のページ13の代替に係る処理を実行することなく,図6の手順を終了する。 In step S2 of FIG. 6, the memory management means 11 executes a process of writing the data included in the data write request from the write destination address included in the data write request. In step S3 of FIG. 6, the memory management means 11 executes a process of recording the number of updates of page 13 of the non-volatile memory 104 to which the data has been written (which becomes page 13 included in the data storage area 1040). In step S4 of FIG. 6, the memory management means 11 checks the number of updates of page 13 of the non-volatile memory 104 to which the data has been written. If the number of updates of page 13 of the non-volatile memory 104 to which the data has been written does not reach the threshold value, the memory management means 11 ends the procedure of FIG. 6 without executing a process related to replacing page 13 of the non-volatile memory 104.

データを書き込んだ不揮発性メモリ104のページ13の更新回数が閾値に達した場合,メモリ管理手段11は,データを書き込んだ不揮発性メモリ104のページ13を代替する処理を実行する。 When the number of updates to page 13 of non-volatile memory 104 in which data has been written reaches a threshold value, memory management means 11 executes a process to replace page 13 of non-volatile memory 104 in which data has been written.

更新回数が閾値に達した不揮発性メモリ104のページ13を代替する際,まず,メモリ管理手段11は,図6のステップS5において,ページ属性がスペア領域1043で,スペア領域1043のページ13のエントリ情報を関連付けている論理ページ番号をページテーブル130から一つ選択する。 When replacing page 13 of non-volatile memory 104 whose number of updates has reached a threshold, first, in step S5 of FIG. 6, memory management means 11 selects from page table 130 a logical page number whose page attribute is spare area 1043 and to which entry information of page 13 of spare area 1043 is associated.

次に,メモリ管理手段11は,図6のステップS6において,更新回数が閾値に達した不揮発性メモリ104のページ13の更新回数を初期化する。なお,更新回数が閾値に達した不揮発性メモリ104のページ13は,データ書き込み要求の書き込み先アドレスに含まれる論理ページ番号に対応するページ13になる。 Next, in step S6 of FIG. 6, the memory management means 11 initializes the update count of the page 13 of the non-volatile memory 104 whose update count has reached the threshold value. Note that the page 13 of the non-volatile memory 104 whose update count has reached the threshold value becomes the page 13 corresponding to the logical page number included in the write destination address of the data write request.

次に,メモリ管理手段11は,図6のステップS7において,更新回数が閾値に達した不揮発性メモリ104のページ13を,図6のステップS5で選択した論理ページ番号に対応するスペア領域1043のページ13で代替する処理を実行して,図6の手順は終了する。 Next, in step S7 of FIG. 6, the memory management means 11 executes a process of replacing page 13 of the non-volatile memory 104, whose number of updates has reached a threshold value, with page 13 of the spare area 1043 corresponding to the logical page number selected in step S5 of FIG. 6, and the procedure in FIG. 6 ends.

図6のステップS4において,ページ13の更新回数を記録する処理の具体的な内容は,ページ13の更新回数の記録場所で異なる。ページ管理情報131にページ13の更新回数を記録する場合,データの書き込みと共にページ管理情報131の更新回数も更新される。 In step S4 of FIG. 6, the specific content of the process for recording the number of updates for page 13 differs depending on the location where the number of updates for page 13 is recorded. When the number of updates for page 13 is recorded in page management information 131, the number of updates for page management information 131 is also updated when data is written.

図6のステップS7において,更新回数の判定に用いる閾値の決め方は任意である。例えば,閾値は,不揮発性メモリ104に設けられた更新限度回数の95%の値にできる。 In step S7 of FIG. 6, the threshold value used to determine the number of updates can be determined in any way. For example, the threshold value can be set to 95% of the update limit set in the non-volatile memory 104.

図7は,更新回数が閾値に達したページ13を代替する処理を説明する図である。図6のステップS7において,更新回数が閾値に達したデータ格納領域1040のページ13をスペア領域1043のページ13で代替する処理は,図7で図示した処理になる。 Figure 7 is a diagram explaining the process of replacing page 13 whose update count has reached a threshold value. In step S7 of Figure 6, the process of replacing page 13 in data storage area 1040 whose update count has reached a threshold value with page 13 in spare area 1043 is the process illustrated in Figure 7.

図7のステップS10において,メモリ管理手段11は,更新回数が閾値に達したページ13のページデータを,図6のステップS5で選択した論理ページ番号に対応するスペア領域1043のページ13に複写する。更新回数が閾値に達したページ13にアクセスするためのエントリ情報は,ページテーブル130において,データ書き込み要求の書き込み先アドレスに含まれる論理ページ番号に関連付けられているエントリ情報になる。代替に用いるスペア領域1043のページ13にアクセスするためのエントリ情報は,図6のステップS5で選択した論理ページ番号に関連付けられているエントリ情報になる。 In step S10 of FIG. 7, the memory management means 11 copies the page data of page 13 whose update count has reached the threshold to page 13 in the spare area 1043 corresponding to the logical page number selected in step S5 of FIG. 6. The entry information for accessing page 13 whose update count has reached the threshold is the entry information associated with the logical page number included in the write destination address of the data write request in the page table 130. The entry information for accessing page 13 in the spare area 1043 to be used as a replacement is the entry information associated with the logical page number selected in step S5 of FIG. 6.

次に,図7のステップS11において,メモリ管理手段11は,ページテーブル130において,更新回数が閾値に達したページ13に対応している論理ページ番号に関連付けられたエントリ情報を,図6のステップS5で選択した論理ページ番号に関連付けられているエントリ情報,すなわち,ページデータを複写したスペア領域1043のページ13のエントリ情報に書き換える。これにより,更新回数が閾値に達した不揮発性メモリ104のページ13は,図6のステップS5で選択した論理ページ番号が対応しているスペア領域1043のページ13で代替される。また,更新回数が閾値に達したページ13のエントリ情報はページテーブル130から消えるため,更新回数が閾値に達したページ13は利用できない。 7, the memory management means 11 rewrites the entry information associated with the logical page number corresponding to the page 13 whose update count has reached the threshold in the page table 130 to the entry information associated with the logical page number selected in step S5 of FIG. 6, i.e., the entry information of the page 13 in the spare area 1043 to which the page data has been copied. As a result, the page 13 in the non-volatile memory 104 whose update count has reached the threshold is replaced with the page 13 in the spare area 1043 corresponding to the logical page number selected in step S5 of FIG. 6. In addition, the entry information of the page 13 whose update count has reached the threshold is erased from the page table 130, and therefore the page 13 whose update count has reached the threshold cannot be used.

次に,図7のステップS12において,メモリ管理手段11は,更新回数が閾値に達したページ13の代替に使用したスペア領域1043のページ13に対応している論理ページ番号のエントリ情報,すなわち,図6のステップS5で選択した論理ページ番号に関連付けられているエントリ情報を消去し,図7の手順は終了する。図6のステップS5で選択した論理ページ番号に関連付けられているエントリ情報を消去することで,データ格納領域1040のページ13の代替に使用したスペア領域1043のページ13はページ13の代替に使用できなくなる。 Next, in step S12 of FIG. 7, the memory management means 11 erases the entry information of the logical page number corresponding to page 13 of the spare area 1043 used to replace page 13 whose update count has reached the threshold value, i.e., the entry information associated with the logical page number selected in step S5 of FIG. 6, and the procedure in FIG. 7 ends. By erasing the entry information associated with the logical page number selected in step S5 of FIG. 6, page 13 of the spare area 1043 used to replace page 13 of the data storage area 1040 can no longer be used to replace page 13.

1 セキュアエレメント
10 オペレーティングシステム
11 メモリ管理手段
12 アプリケーション
104 不揮発性メモリ
1040 データ格納領域
1043 スペア領域
13 ページ
130 ページテーブル
1300 エントリ情報
131 ページ管理情報
REFERENCE SIGNS LIST 1 Secure element 10 Operating system 11 Memory management means 12 Application 104 Non-volatile memory 1040 Data storage area 1043 Spare area 13 Page 130 Page table 1300 Entry information 131 Page management information

Claims (3)

データを格納したページの代替に利用するスペア領域を設けた電気的に書き換え可能な不揮発性メモリと,論理ページ番号に関連付けて論理ページ番号に対応させたページのエントリ情報を管理するメモリ管理手段を備え,
前記メモリ管理手段は,データを書き込む処理を実行するごとに,データを書き込んだページの更新回数を記録し,データを書き込んだページの更新回数が閾値に達すると,データを書き込んだページのページデータを前記スペア領域に含まれる一つのページに複写し,データを書き込んだページが対応している論理ページ番号に関連付けられているエントリ情報を,前記ページデータを複写した前記スペア領域のページのエントリ情報に書き換える処理を実行する,
ことを特徴とするセキュアエレメント。
The memory management unit is provided with an electrically rewritable non-volatile memory having a spare area to be used as a replacement for a page storing data, and a memory management unit that manages entry information of a page corresponding to the logical page number in association with the logical page number,
the memory management means records the number of updates of the page into which the data is written each time a data write process is executed, and when the number of updates of the page into which the data is written reaches a threshold value, executes a process of copying page data of the page into which the data is written to one page included in the spare area, and rewriting entry information associated with a logical page number corresponding to the page into which the data is written to entry information of the page in the spare area into which the page data is copied;
A secure element characterized by:
請求項1に記載したセキュアエレメントを実装したデバイス。 A device incorporating the secure element described in claim 1. データを格納したページの代替に利用するスペア領域を電気的に書き換え可能な不揮発性メモリに設け,論理ページ番号に関連付けて論理ページ番号に対応させたページのエントリ情報を管理するメモリ管理手段が,データを書き込む処理を実行するごとに,データを書き込んだページの更新回数を記録するステップ,前記メモリ管理手段が,データを書き込んだページの更新回数が閾値に達すると,データを書き込んだページのページデータを前記スペア領域に含まれる一つのページに複写し,データを書き込んだページが対応している論理ページ番号に関連付けられているエントリ情報を,前記ページデータを複写した前記スペア領域のページのエントリ情報に書き換えるステップを実行する,
ことを特徴とするセキュアエレメントの不揮発性メモリ管理方法。
a step of providing a spare area used as a replacement for a page storing data in an electrically rewritable non-volatile memory, a memory management means for managing entry information of a page corresponding to the logical page number in association with a logical page number, recording the number of updates of the page to which data has been written each time a data write process is executed, and when the number of updates of the page to which data has been written reaches a threshold value, the memory management means executes a step of copying page data of the page to which data has been written to one page included in the spare area, and rewriting entry information associated with the logical page number to which the page to which data has been written corresponds to entry information of the page in the spare area to which the page data has been copied;
13. A method for managing non-volatile memory of a secure element, comprising:
JP2021092105A 2021-06-01 2021-06-01 Secure element, device and method for managing non-volatile memory Active JP7613276B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021092105A JP7613276B2 (en) 2021-06-01 2021-06-01 Secure element, device and method for managing non-volatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021092105A JP7613276B2 (en) 2021-06-01 2021-06-01 Secure element, device and method for managing non-volatile memory

Publications (2)

Publication Number Publication Date
JP2022184327A JP2022184327A (en) 2022-12-13
JP7613276B2 true JP7613276B2 (en) 2025-01-15

Family

ID=84437525

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021092105A Active JP7613276B2 (en) 2021-06-01 2021-06-01 Secure element, device and method for managing non-volatile memory

Country Status (1)

Country Link
JP (1) JP7613276B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003141880A (en) 2001-11-02 2003-05-16 Matsushita Electric Ind Co Ltd Nonvolatile semiconductor memory device
JP2010186477A (en) 2009-02-10 2010-08-26 Samsung Electronics Co Ltd Memory system and wear level management method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4096660B2 (en) * 2002-08-22 2008-06-04 カシオ計算機株式会社 Data recording control device and program
JP2016085677A (en) * 2014-10-28 2016-05-19 富士通株式会社 Memory management method, memory management program, and information processing device
JP6984328B2 (en) * 2017-11-06 2021-12-17 大日本印刷株式会社 Electronic information storage medium, IC card, external device, data writing method and data writing program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003141880A (en) 2001-11-02 2003-05-16 Matsushita Electric Ind Co Ltd Nonvolatile semiconductor memory device
JP2010186477A (en) 2009-02-10 2010-08-26 Samsung Electronics Co Ltd Memory system and wear level management method thereof

Also Published As

Publication number Publication date
JP2022184327A (en) 2022-12-13

Similar Documents

Publication Publication Date Title
US11741016B2 (en) Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device
US7006383B2 (en) Nonvolatile semiconductor memory for management of a number of data writer/erase times
JP5329884B2 (en) Portable electronic device and data processing method in portable electronic device
US9235534B2 (en) Data protecting method, memory controller and memory storage apparatus
JP3576625B2 (en) Data management method for flash memory card and data processing device using the data management method
US9772937B2 (en) Data processing method, memory controller and memory storage apparatus
US20110055430A1 (en) Method for establishing a communication channel between a host device and a memory device, associated memory device and controller thereof, and associated host device and host device application
CN109685190B (en) Power-down protection method and device for IC card
JP7613276B2 (en) Secure element, device and method for managing non-volatile memory
CN112711378B (en) Data storage method and read-write equipment
US11347433B2 (en) Method for performing sudden power off recovery management, associated memory device and controller thereof, and associated electronic device
JP4100160B2 (en) IC card and IC card data management method
JP4460850B2 (en) IC card and IC card processing method
JP2019049876A (en) Electronic information storage medium, IC card, table management method using electronic information storage medium, and table management program
KR100445134B1 (en) Host equipped with stabilizing function for flash memory and the method thereof
JP7322923B2 (en) Secure element, transaction control method and device
JP7043886B2 (en) Information processing method and OS using electronic information storage medium, IC card, electronic information storage medium
JP7438432B1 (en) Electronic information storage medium, IC chip, IC card, record writing method, and program
JP2022187935A (en) Secure element, electronic information storage medium and data update method
US20090083273A1 (en) Portable electronic apparatus and control method for portable electronic apparatus
JP6758910B2 (en) IC card
US7346730B2 (en) Mobile electronic device
JP2024139134A (en) Electronic information storage medium, IC chip, method for writing issuance data, and program
KR101149539B1 (en) Smart card and method for processing transaction of smart card
JPS63200399A (en) data processing system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20240412

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20241119

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20241209

R150 Certificate of patent or registration of utility model

Ref document number: 7613276

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150