Electronic information storage medium, IC chip, IC card, terminal device, data rewriting method, data transmission method, medium program, and terminal program
The IC card optimizes flash memory usage by temporarily storing data in volatile memory and strategically rewriting it to non-volatile memory, addressing inefficiencies in rewrite cycles and improving memory utilization.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-09-17
- Publication Date
- 2026-03-30
AI Technical Summary
Flash memory in IC cards faces inefficiencies due to limited rewrite times when handling data smaller than page size, leading to increased rewrite cycles, and inefficient usage when handling one data per page.
An IC card with both volatile and non-volatile memory that temporarily stores data from non-volatile memory in volatile memory, updates the data, and then rewrites it back to non-volatile memory only when necessary, optimizing data management through page-based updates.
This approach improves the utilization efficiency of non-volatile memory by reducing the number of rewrite cycles while maintaining data integrity and efficiency.
Smart Images

Figure 2026054830000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of an IC (Integrated Circuit) card or the like having a non-volatile memory in which writing and reading of file data are performed in page units.
Background Art
[0002] Conventionally, as disclosed in Patent Document 1 for example, an IC card capable of reducing the processing time until all the write data is written into a non-volatile memory such as a flash memory by reducing the number of reception times of a write command received from an external device is known. Usually, the page size of the flash memory adopted in an IC card is about 512 bytes. On the other hand, many of the data mainly handled by the IC card are smaller than the page size of the flash memory.
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] By the way, a flash memory in which writing and reading of file data are performed in page units has a limit on the number of rewrite times. For example, when a plurality of data smaller than the page size are arranged in the same page of the flash memory, it is necessary to rewrite the data in the flash memory every time the data is updated by an update command from an external device, and the number of rewrite times of the flash memory increases. On the other hand, when only one data per page of the flash memory is arranged for each data handled by the IC card, the number of rewrite times can be suppressed, but the usage efficiency of the flash memory deteriorates.
[0005] Therefore, the present invention has been made in view of these points and aims to provide an electronic information storage medium, an IC chip, an IC card, a terminal device, a data rewriting method, a data transmission method, a medium program, and a terminal program that can improve the utilization efficiency of non-volatile memory while reducing the number of rewrite cycles of non-volatile memory. [Means for solving the problem]
[0006] To solve the above problems, the invention described in claim 1 is an electronic information storage medium comprising a volatile memory and a non-volatile memory in which file data is written and read on a page-by-page basis, and which receives an update command from a terminal device that includes data of a file to be updated and identification information of the file to be updated, wherein when a first update command is received from the terminal device, a first identification means identifies a page corresponding to the file to be updated based on the identification information of the file to be updated included in the first update command; a storage means reads the data of each of a plurality of files included in the page identified by the first identification means from the non-volatile memory and temporarily stores it in the volatile memory; a first update means updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the file to be updated included in the first update command with the data of the file to be updated; and a second update command received from the terminal device following the first update command. When the aforementioned update command is received, the system includes: a second identification means for identifying a page corresponding to the update target file based on the identification information of the update target file included in the second update command; a first determination means for determining whether the page identified by the first identification means includes the page identified by the second identification means; a second update means for updating the data of each of the plurality of files temporarily stored in the volatile memory, which corresponds to the data of the update target file included in the second update command, with the data of the update target file, when the first determination means determines that the page is included; and a rewrite means for rewriting the data of each of the plurality of files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory when the data of each of the plurality of files temporarily stored in the volatile memory is updated.
[0007] The invention described in claim 2 is an electronic information storage medium according to claim 1, further comprising: a third identification means for identifying a page corresponding to the update target file based on identification information of the update target file included in the third update command when a third update command is received from the terminal device following the second update command; and a second determination means for determining whether the page identified by the third identification means is included in the pages corresponding to data temporarily stored in the volatile memory, wherein the rewriting means, when the second determination means determines that the identified page is included, rewrites the data of each of the plurality of files in the non-volatile memory with the updated data temporarily stored in the volatile memory, assuming that the data of each of the plurality of files has been updated.
[0008] The invention described in claim 3 is further characterized in that, in the electronic information storage medium described in claim 2, when the second determination means determines that the specified page is included, the third update means updates the data of each of the plurality of files temporarily stored in the volatile memory, which corresponds to the data of the file to be updated included in the third update command, with the data of the file to be updated.
[0009] The invention described in claim 4 is characterized in that, in the electronic information storage medium described in claim 1, when a command other than the update command is received from the terminal device following the second update command, the data of each of the plurality of files is considered to have been updated, and the data of each of the plurality of files is rewritten in the non-volatile memory with the updated data temporarily stored in the volatile memory.
[0010] The invention described in claim 5 is characterized in that, in the electronic information storage medium described in claim 1, the electronic information storage medium further comprises a transmission means for transmitting page arrangement information to the terminal device, which indicates the correspondence between the page in the non-volatile memory and a plurality of files contained in the page, page by page, before the first update command is received.
[0011] The invention described in claim 6 is characterized in that, in the electronic information storage medium described in claim 5, the page arrangement information includes information indicating the arrangement order of each file on the page.
[0012] The invention described in claim 7 is an IC chip comprising a volatile memory and a non-volatile memory on which file data is written and read in page units, and which receives an update command from a terminal device that includes data of a file to be updated and identification information of the file to be updated, wherein when a first update command is received from the terminal device, a first identification means identifies a page corresponding to the file to be updated based on the identification information of the file to be updated included in the first update command; a storage means reads the data of each of a plurality of files included in the page identified by the first identification means from the non-volatile memory and temporarily stores it in the volatile memory; a first update means updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the file to be updated included in the first update command with the data of the file to be updated; and a second update command is received from the terminal device following the first update command. The system is characterized by comprising: a second identification means that, when a command is received, identifies a page corresponding to the update target file based on the identification information of the update target file included in the second update command; a first determination means that determines whether the page identified by the first identification means includes the page identified by the second identification means; a second update means that, when the first determination means determines that the page is included, updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the update target file included in the second update command with the data of the update target file; and a rewrite means that, when the data of each of the plurality of files temporarily stored in the volatile memory is updated, rewrites the data of each of the plurality of files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory.
[0013] The invention described in claim 8 is an IC card comprising a volatile memory and a non-volatile memory on which file data is written and read in page units, and which receives an update command from a terminal device that includes data of a file to be updated and identification information of the file to be updated, wherein when a first update command is received from the terminal device, a first identification means identifies a page corresponding to the file to be updated based on the identification information of the file to be updated included in the first update command; a storage means reads the data of each of a plurality of files included in the page identified by the first identification means from the non-volatile memory and temporarily stores it in the volatile memory; a first update means updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the file to be updated included in the first update command with the data of the file to be updated; and a second update command is received from the terminal device following the first update command. The system is characterized by comprising: a second identification means that, when a command is received, identifies a page corresponding to the update target file based on the identification information of the update target file included in the second update command; a first determination means that determines whether the page identified by the first identification means includes the page identified by the second identification means; a second update means that, when the first determination means determines that the page is included, updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the update target file included in the second update command with the data of the update target file; and a rewrite means that, when the data of each of the plurality of files temporarily stored in the volatile memory is updated, rewrites the data of each of the plurality of files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory.
[0014] The invention described in claim 9 is a data rewriting method performed by an electronic information storage medium that includes a volatile memory and a non-volatile memory on which file data is written and read in page units, and which receives an update command from a terminal device that includes data of a file to be updated and identification information of the file to be updated, the method comprising: a first identification step of identifying a page corresponding to the file to be updated based on the identification information of the file to be updated included in the first update command when a first update command is received from the terminal device; a step of reading the data of each of a plurality of files included in the page identified in the first identification step from the non-volatile memory and temporarily storing it in the volatile memory; a step of updating the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the file to be updated included in the first update command with the data of the file to be updated; and a second update command received from the terminal device following the first update command. When the aforementioned update command is received, the device includes: a second identification step of identifying a page corresponding to the update target file based on the identification information of the update target file included in the second update command; a determination step of determining whether the page identified in the first identification step includes the page identified in the second identification step; if it is determined in the determination step that the page is included, a step of updating the data of each of the plurality of files temporarily stored in the volatile memory, which corresponds to the data of the update target file included in the second update command, with the data of the update target file; and if the data of each of the plurality of files temporarily stored in the volatile memory is updated, a step of rewriting the data of each of the plurality of files included in the page identified in the first identification step in the non-volatile memory with the updated data temporarily stored in the volatile memory.
[0015] The invention described in claim 10 is a computer included in an electronic information storage medium that includes a volatile memory and a non-volatile memory in which file data is written and read in page units, and which receives an update command from a terminal device that includes data of a file to be updated and identification information of the file to be updated, and when a first update command is received from the terminal device, a first identification means identifies the page corresponding to the file to be updated based on the identification information of the file to be updated included in the first update command, a storage means reads the data of each of a plurality of files included in the page identified by the first identification means from the non-volatile memory and temporarily stores it in the volatile memory, a first update means updates the data of each of the plurality of files temporarily stored in the volatile memory that corresponds to the data of the file to be updated included in the first update command with the data of the file to be updated, and a second update command is received from the terminal device following the first update command. The system is characterized by comprising: a second identification means that, when an update command is received, identifies a page corresponding to the update target file based on the identification information of the update target file included in the second update command; a first determination means that determines whether the page identified by the first identification means includes the page identified by the second identification means; a second update means that, when the first determination means determines that the page is included, updates the data of each of the multiple files temporarily stored in the volatile memory that corresponds to the data of the update target file included in the second update command, using the data of the update target file; and a rewrite means that, when the data of each of the multiple files temporarily stored in the volatile memory is updated, rewrites the data of each of the multiple files included in the page identified by the first identification means in the non-volatile memory using the updated data temporarily stored in the volatile memory.
[0016] The invention described in claim 11 is a terminal device capable of communicating with an electronic information storage medium comprising a volatile memory and a non-volatile memory on which file data is written and read on a page-by-page basis, the terminal device comprising: a receiving means for receiving page arrangement information from the electronic information storage medium that indicates the correspondence between a page in the non-volatile memory and a plurality of files contained in that page for each page; a determining means for determining the transmission order of each of the plurality of files based on the page arrangement information; and a transmitting means for sequentially transmitting update commands containing the data of the files and identification information of the files to the electronic information storage medium according to the transmission order determined by the determining means.
[0017] The invention described in claim 12 is characterized in that, in the terminal device described in claim 11, the page arrangement information includes information indicating the arrangement order of each file on the page, and the determination means determines the transmission order of the files according to the arrangement order of the files.
[0018] The invention described in claim 13 is characterized in that, in the terminal device described in claim 12, if any one of the multiple files included in the 1 page is also included in the other pages, the determination means determines the transmission order of the 1 file among the multiple files included in the 1 page before the transmission order of the files other than the 1 file among the multiple files, regardless of the arrangement order of the files.
[0019] The invention described in claim 14 is a data transmission method performed by a terminal device capable of communicating with an electronic information storage medium comprising a volatile memory and a non-volatile memory on which file data is written and read on a page-by-page basis, the method comprising: receiving page arrangement information from the electronic information storage medium that indicates the correspondence between a page in the non-volatile memory and a plurality of files contained in the page, page by page; determining the transmission order of each of a plurality of files to be updated based on the page arrangement information; and sequentially transmitting update commands containing the data of the files to be updated and identification information of the files to be updated to the electronic information storage medium according to the determined transmission order.
[0020] The invention described in claim 15 is characterized in that a computer included in a terminal device capable of communicating with an electronic information storage medium comprising a volatile memory and a non-volatile memory on which file data is written and read in page units is configured to function as a receiving means for receiving page arrangement information from the electronic information storage medium that shows the correspondence between pages in the non-volatile memory and a plurality of files contained in said pages for each page; a determining means for determining the transmission order of each of a plurality of files to be updated based on the page arrangement information; and a transmitting means for sequentially transmitting update commands containing the data of the files to be updated and identification information of said files to the electronic information storage medium according to the transmission order determined by the determining means. [Effects of the Invention]
[0021] According to the present invention, it is possible to improve the utilization efficiency of non-volatile memory, in which file data is written and read in page units, while reducing the number of times the non-volatile memory is rewritten. [Brief explanation of the drawing]
[0022] [Figure 1] This figure shows an example of the general configuration of IC chip 1. [Figure 2]It is a conceptual diagram showing an example of the arrangement of pages and EF in NVM13. [Figure 3] It is a diagram showing an example of the schematic configuration of the terminal device 2. [Figure 4] It is a diagram showing a comparison example between the processing procedure of the conventional terminal device X and the processing procedure of the terminal device 2 of the present embodiment. [Figure 5] It is a sequence diagram showing the flow of processing performed between the IC chip 1 and the terminal device 2. [Figure 6] It is a flowchart showing the data rewrite processing (Example 1) executed by the CPU 15 of the IC chip 1. [Figure 7] It is a flowchart showing the data rewrite processing (Example 2) executed by the CPU 15 of the IC chip 1. [Embodiments for Carrying Out the Invention]
[0023] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0024] [1. Configuration and Functions of IC Chip 1] First, referring to FIG. 1, the configuration and functions of the IC chip 1 according to the present embodiment will be described. The IC chip 1 is an example of the electronic information storage medium of the present invention. The IC chip 1 is mounted on, for example, an IC card such as a credit card, a debit card, or a my number card, or a mobile device such as a smartphone. In the case of a mobile device such as a smartphone, the IC chip 1 may be mounted on a small IC card that can be attached to and detached from the mobile device, or may be mounted on an embedded substrate so that it cannot be easily removed or replaced from the mobile device as an eUICC (Embedded Universal Integrated Circuit Card).
[0025] Figure 1 shows an example of the general configuration of IC chip 1. As shown in Figure 1, IC chip 1 includes an I / O circuit 11, RAM (Random Access Memory) 12, NVM (Nonvolatile Memory) 13, ROM (Read Only Memory) 14, CPU (Central Processing Unit) 15 (an example of a computer), and a coprocessor 16 that performs cryptographic calculations, etc. The I / O circuit 11 serves as the interface with terminal device 2. Communication between IC chip 1 and terminal device 2 may be contactless or contactless. In the case of contactless communication, communication between IC chip 1 and terminal device 2 is performed via, for example, an antenna (not shown) mounted on an IC card or mobile device. Examples of terminal device 2 include an issuance terminal at a factory before the IC chip 1 is shipped, and a store terminal at a store after the IC chip 1 has been shipped. RAM 12 is used as volatile memory for work.
[0026] NVM13 or ROM14 stores programs such as the OS (Operating System) and applications (including the media program of the present invention). Examples of applications include payment applications used for settling transactions and authentication applications used to operate equipment, etc. NVM13 is a non-volatile memory in which file data (in other words, data stored in files) is written and read on a page-by-page basis. For example, NAND flash memory is used as NVM13. In NAND flash memory, NAND circuits are arranged as cells in a grid, and one page is composed of multiple of these cells. Each page in NVM13 is assigned a unique page number. Also, one or more files are contained (in other words, arranged) on one page.
[0027] In this embodiment, an EF (Elementary File) is used as an example of a file. In NVM13, an EF is located in a lower hierarchy below an MF (Master File) or a DF (Dedicated File). An EF is composed of, for example, a BER-TLV (Tag, Length, Value) format. The Tag (tag value) represents the identification information of the EF (e.g., SFI (Short File Identifier)), the Length (length value) represents the data size of the EF, and the Value (value) represents the content of the EF (i.e., the data). One or more data items are stored in a single EF. Such data is also called a record to which a record number is assigned in NVM13. Examples of such data include personal information of application users, configuration data that determines the operation of the application, key data necessary for cryptographic and decryption operations, and certificate data.
[0028] Figure 2 is a conceptual diagram showing an example of page and EF placement in NVM13. In Figure 2, EF1, EF4, and EF6 are placed in the order shown in the diagram on page A, EF2 and EF5 are placed in the order shown on page B, and EF3 and EF5 are placed in the order shown on page C. Here, EF5 is placed across pages B and C because the size of the data stored in it is large (for example, it exceeds the threshold set for each page). Such placement is managed by the OS, for example. The numbers (1-6) to the right of the EFs indicate, for example, the order of the EF management numbers (or registration numbers).
[0029] The CPU 15 (an example of a computer) executes a media program stored in the NVM 13, functioning as the first identification means, second identification means, third identification means, storage means, first update means, second update means, third update means, first determination means, second determination means, rewriting means, and transmission means in this invention, and performs data rewriting processing. Specifically, the CPU 15 continuously receives update commands containing the data of the EF to be updated (i.e., data stored in the EF to be updated) and identification information of the EF to be updated from the terminal device 2 via the I / O circuit 11 multiple times. Here, the EF to be updated corresponds to the EF located on a page in the NVM 13. It is desirable that one update command contains the data of one EF. Therefore, in the example in Figure 2, it is preferable that six update commands corresponding to EF1 to EF6 are sequentially transmitted from the terminal device 2 to the IC chip 1.
[0030] In the following explanation, the first update command sent will be referred to as the first update command, and subsequent update commands will be referred to as the second update command, the third update command, and so on. Here, the update command can be, for example, a WRITE RECORD, APPEND RECORD, or UPDATE RECORD command APDU (Application Protocol Data Unit) as defined in ISO / IEC 7816. The update command consists of a header section consisting of, for example, a CLA indicating the command class, an INS indicating the command code, and P1 and P2 indicating the command parameters, and a body section consisting of Lc and Data. For example, P1 or P2 contains identification information of the EF to be updated. In addition, Lc contains the size of the EF to be updated, and Data contains the data of the EF to be updated. Furthermore, each time processing corresponding to the update command is executed, a response to that update command (including the status word SW) is sent to the terminal device 2 via the I / O circuit 11.
[0031] Before the first update command is received, the CPU 15 may send a response to the terminal device 2 via the I / O circuit 11, containing page arrangement information that shows the correspondence between pages in the NVM 13 and multiple EFs placed on that page, page by page, in response to the acquisition command from the terminal device 2. Such page arrangement information may include information indicating the arrangement order of each EF on each page. Here, the acquisition command can be, for example, the GET DATA command APDU specified in ISO / IEC 7816. The acquisition command consists of a header section consisting of, for example, CLA, INS, P1, and P2. For example, P1 or P2 is set to an identifier for acquiring the arrangement status of EFs on each page of the IC chip 1. Alternatively, the SELECT command APDU for selecting MF or DF may be used as the acquisition command.
[0032] When the CPU 15 receives a first update command from the terminal device 2, it identifies the page corresponding to the EF to be updated (for example, by page number) based on the identification information of the EF to be updated included in the first update command. In the example in Figure 2, if the EF to be updated is EF1, then page A where EF1 is located will be identified. The CPU 15 reads the data of one or more EFs located on the identified page (for example, EF1, EF4, and EF6 located on page A) from the NVM 13 (i.e., reads them page by page) and temporarily stores them in RAM 12 (for example, stores them in BER-TLV format). In the example in Figure 2, if the EF to be updated is EF5, then pages B and C (i.e., multiple pages) where EF5 is located will be identified, and the data of EF2, EF5, and EF3 contained in pages B and C will be read from the NVM 13 and temporarily stored in RAM 12.
[0033] Then, the CPU 15 updates the data of the EF to be updated included in the first update command (for example, the data of EF1 included in page A) from among the data of one or more EFs temporarily stored in RAM 12 with the data of the EF to be updated. For example, the data of EF1 temporarily stored in RAM 12 "A00F10943267B C ...(h)" is the data for the EF1 to be updated, "A00F10943267B 1 ...(h)" is overwritten. Here, the storage location (storage location on RAM12) of the data corresponding to the data of the EF to be updated should be identified based on the identification information and data size of the EF to be updated. Note that updating the data of an EF may involve changing all of the data stored in that EF, or changing only a portion of the data stored in that EF (for example, only the configuration data).
[0034] Next, when the CPU 15 receives a second update command from the terminal device 2 following the first update command, it identifies the page corresponding to the EF to be updated based on the identification information of the EF to be updated included in the second update command. In the example in Figure 2, if the EF to be updated is EF4, then page A where EF4 is located will be identified. The CPU 15 determines whether the page identified when the second update command was received is included in the page corresponding to the data temporarily stored in RAM 12 (for example, the page identified when the first update command was received) (for example, whether they match). Here, the page corresponding to the data temporarily stored in RAM 12 is the page where the EF that stores the stored data is located. If the CPU 15 determines that the identified page is included, it updates the data of the EF to be updated included in the second update command (for example, the data of EF4) from the data of one or more EFs temporarily stored in RAM 12 with the data of the EF to be updated.
[0035] Next, when the CPU 15 receives a third update command from the terminal device 2 following the second update command, it identifies the page corresponding to the EF to be updated based on the identification information of the EF to be updated included in the third update command. In the example in Figure 2, if the EF to be updated is EF6, then page A where EF6 is located will be identified. The CPU 15 determines whether the page identified when the third update command was received is included in the pages corresponding to the data temporarily stored in RAM 12. If the CPU 15 determines that the identified page is included, it updates the data of the EF to be updated included in the third update command (for example, the data of EF6) among the data of one or more EFs temporarily stored in RAM 12 with the data of the EF to be updated.
[0036] In the example in Figure 2, if EP6 is not located on page A (for example, if EF1 and EF4 are located on page A and EF6 is located on page B), the CPU 15 determines that page A, which corresponds to the data temporarily stored in RAM 12, does not include page B, which was identified when the third update command was received. It then assumes that all the data for one or more EFs has been updated and overwrites the data for each EF in NVM 13 with the updated data temporarily stored in RAM 12. In other words, when all the data for one or more EFs temporarily stored in RAM 12 has been updated, the data for each EF is overwritten in NVM 13 with the updated data temporarily stored in RAM 12. As a result, for example, the data for EF1 and EF4 located on page A will be updated in NVM 13.
[0037] Furthermore, if the CPU 15 receives a command other than an update command (for example, a SELECT command APDU for selecting an application) from the terminal device 2 following the second update command, it may consider that all the data of one or more EFs located on the target page has been updated, and may rewrite the data of each of those EFs in the NVM 13 with the updated data temporarily stored in RAM 12.
[0038] [2. Configuration and Functions of Terminal Device 2] Next, the configuration and functions of the terminal device 2 according to this embodiment will be described with reference to Figure 3. Figure 3 is a diagram showing an example of the schematic configuration of the terminal device 2. As shown in Figure 3, the terminal device 2 includes a reader / writer 21, a storage unit 22, and a control unit 23 (an example of a computer), etc. The reader / writer 21 controls contact or contactless communication with the IC chip 1. The storage unit 22 stores programs such as the OS and applications (including the terminal program of the present invention), etc.
[0039] The control unit 23 is equipped with RAM, ROM, and a CPU, and by executing a terminal program stored in the storage unit 22, it functions as a receiving means, a determining means, and a transmitting means in this invention, and performs data transmission processing. Specifically, the control unit 23 first sends an acquisition command to the IC chip 1 via the reader / writer 21, as described above, in order to acquire the arrangement status of EFs on each page of the IC chip 1. When the control unit 23 receives a response from the IC chip 1 via the reader / writer 21 in response to the acquisition command, which includes the page arrangement information described above, it determines the transmission order of each of the multiple EFs to be updated based on the page arrangement information. Then, according to the determined transmission order, the control unit 23 sequentially transmits update commands containing the data of the EFs to be updated and the identification information of the EFs to be updated to the IC chip 1 via the reader / writer 21 (that is, sequentially transmits them with responses from the IC chip 1 in between).
[0040] Figure 4 shows a comparison of the processing procedure of a conventional terminal device X and the processing procedure of terminal device 2 of this embodiment. Note that Figure 4 assumes the EF arrangement shown in Figure 2. In the example in Figure 4, in both the conventional and this embodiment, a reset (reset signal) is sent to IC chip 1 when communication starts. In response to this reset, when an initial response is received from IC chip 1, in the conventional case, as shown in Figure 4, update commands are sent sequentially in the order of EF1→EF2→EF3→EF4→EF5→EF6 (for example, in order of management number). On the other hand, in this embodiment, when an initial response is received from IC chip 1, as shown in Figure 4, an acquisition command is sent to IC chip 1, and update commands are sent sequentially in the order of EF1→EF4→EF6→EF5→EF2→EF3, which is determined based on the page arrangement information sent from IC chip 1. As a result, the number of rewrites of the NVM13 in IC chip 1 is reduced from a total of 7 times (3 times for page A, 2 times for page B, and 2 times for page C) in the conventional case to a total of 3 times (1 time for page A, 1 time for page B, and 1 time for page C) in the embodiment. Therefore, according to this embodiment, the rewrite timing of the NVM13 can be improved from a command-based system to a page-based system in the NVM13, thus reducing the number of rewrites of the NVM13 compared to the conventional system.
[0041] By the way, according to page B shown in Figure 2, the arrangement order is EF2 → EF5, but in the example in Figure 4, the order in which the update commands are sent is EF5 → EF2. This is because if the order in which the update commands are sent is EF2 → EF5, EF5 is arranged across page B and page C, making the data rewriting process in IC chip 1 more complex than if the order were EF5 → EF2. Therefore, based on the above page arrangement information, if the control unit 23 determines that one of the multiple update target EFs included in one page (page B in the example of Figure 2) (EF5 in the example of Figure 2) is also included in another page (page C in the example of Figure 2), it determines the transmission order of that one update target EF (EF5 in the example of Figure 2) before the transmission order of the other update target EFs among the multiple update target EFs included in that page, regardless of the arrangement order of the EFs on the page. This simplifies the data rewriting process in IC chip 1.
[0042] Furthermore, since terminal device 2 knows that EF data is temporarily stored in RAM12, if processing is interrupted before writing to NVM13 (for example, if the IC card is removed from terminal device 2), it can determine which EF update command to send to resume processing.
[0043] [3. Operation of IC chip 1 and terminal device 2] Next, the operation of the IC chip 1 and terminal device 2 according to this embodiment will be described with reference to Figures 5 to 7. Figure 5 is a sequence diagram showing the flow of processing performed between the IC chip 1 and the terminal device 2. Figures 6 and 7 are flowcharts showing the data rewriting process (Examples 1 and 2) executed by the CPU 15 of the IC chip 1 (for example, executed according to the OS).
[0044] In Figure 5, when communication between IC chip 1 and terminal device 2 begins, terminal device 2 sends a reset to IC chip 1 (step S1). Then, upon receiving the reset from terminal device 2, IC chip 1 sends an initial response to terminal device 2 (step S2).
[0045] Next, when terminal device 2 receives an initial response from IC chip 1, it sends an acquisition command to IC chip 1 (step S3). Here, the acquisition command may be, for example, a GET DATA command APDU. However, if, for example, after receiving the initial response from IC chip 1, a SELECT command APDU to select MF or DF needs to be sent to IC chip 1, terminal device 2 may send the SELECT command APDU without sending the GET DATA command APDU. This improves processing efficiency by including page placement information in the response to the SELECT command APDU. Note that if the placement status of EF on each page of IC chip 1 is entered into terminal device 2 by, for example, an operator, an acquisition command does not need to be sent to IC chip 1.
[0046] Next, when IC chip 1 receives an acquisition command from terminal device 2, it acquires page placement information and sends a response containing said page placement information to terminal device 2 (step S4). Next, IC chip initializes the page being updated information, which indicates the page being updated (step S5). Here, the page being updated information is stored in, for example, RAM 12 or NVM 13, and is rewritten to an initial value (for example, FFFF(h)) upon initialization. Note that the initialization of the page being updated information may be performed before the response containing the page placement information is sent to terminal device 2.
[0047] Next, when terminal device 2 receives a response from IC chip 1 containing page placement information, it determines the transmission order of each of the multiple update target EFs based on the page placement information (step S6). Next, terminal device 2 sends an update command containing the data of the update target EF and the identification information of the update target EF to IC chip 1 according to the transmission order determined in step S6 (step S7). Next, when IC chip 1 receives the update command from terminal device 2, it performs the data rewriting process shown in Figure 6, as described later (step S8), and sends a response to the update command to terminal device 2 (step S9).
[0048] Next, when terminal device 2 receives a response from IC chip 1, it determines whether the most recently transmitted update command is the last update command (step S10). If it is determined that the most recently transmitted update command is not the last update command (step S10: NO), the next update command is transmitted from terminal device 2 to IC chip 1. On the other hand, if it is determined that the most recently transmitted update command is the last update command (step S10: YES), a command other than an update command is transmitted from terminal device 2 to IC chip 1 (step S11). In this case as well, the data rewriting process shown in Figure 6 is executed, and a response to the command other than the update command is transmitted to terminal device 2 (step S12).
[0049] In the data rewriting process shown in Figure 6, IC chip 1 determines whether the command received from terminal device 2 is an update command (step S81). If it is determined to be an update command (step S81: YES), the process proceeds to step S82. On the other hand, if it is determined not to be an update command (step S81: NO), the process proceeds to step S89.
[0050] In step S82, IC chip 1 identifies the page corresponding to the EF to be updated as the page to be updated, based on the identification information of the EF to be updated included in the received update command. Next, IC chip 1 determines whether the page being updated information is at its initial value (step S83). If it is determined that the page being updated information is at its initial value (step S83: YES), the process proceeds to step S84. On the other hand, if it is determined that the page being updated information is not at its initial value (in other words, the page number of the page being updated is stored) (step S83: NO), the process proceeds to step S87.
[0051] In step S84, IC chip 1 sets the page being updated information to the page to be updated identified in step S82. For example, the page being updated information is overwritten with the page number of the page to be updated. Next, IC chip 1 reads the EF data (for example, the data for each of multiple EFs) located on the page to be updated identified in step S82 from NVM 13 and temporarily stores it in RAM 12 (step S85). Next, IC chip 1 updates the data corresponding to the data of the EF to be updated included in the received update command from the EF data temporarily stored in RAM 12 with the data of the EF to be updated (step S86), and terminates the data rewriting process shown in Figure 6. Then, a response to the update command is sent to terminal device 2 (step S9).
[0052] In step S87, IC chip 1 determines whether the page being updated (i.e., the page where data is temporarily stored in RAM 12) contains the page to be updated identified in step S82 in response to the most recent update command. For example, if the page number indicated by the page being updated information contains the page number of the page to be updated identified in step S82 in response to the most recent update command, it is determined that the page being updated contains the page to be updated (step S87: YES), and the process proceeds to step S86, where the data corresponding to the data of the EF to be updated is updated.
[0053] On the other hand, if it is determined that the page being updated does not contain the page to be updated (step S87: NO), it can be assumed that all EF data placed on the page being updated (for example, the data of each of multiple EFs) has been updated, and the process proceeds to step S88. In step S88, IC chip 1 writes the updated EF data (for example, the data of each of multiple updated EFs) temporarily stored in RAM 12 to the original storage location in NVM 13, thereby rewriting the EF data placed on the page being updated in NVM 13. Then, IC chip 1 moves to step S84, where it sets the page being updated information to the page to be updated identified in step S82 in response to the most recent update command (i.e., sets the update) (step S84), and executes the processes in steps S85 and S86.
[0054] Furthermore, in the case of an IC chip configured so that no EFs that span multiple pages, such as EF5 shown in Figure 2, exist within the NVM13, in step S87, it is sufficient to determine whether the page being updated matches the page to be updated identified in step S82 in response to the most recent update command. In this case, for example, if the page number indicated by the page being updated information matches the page number of the page to be updated identified in step S82 in response to the most recent update command, it is determined that the page being updated matches the page to be updated (step S87: YES), and the process proceeds to step S86.
[0055] On the other hand, in step S89, IC chip 1 determines whether the page information being updated is at its initial value, similar to step S83. If it is determined that the page information being updated is at its initial value (step S89: YES), the data rewriting process shown in Figure 6 is terminated. On the other hand, if it is determined that the page information being updated is not at its initial value (step S89: NO), the process proceeds to step S90.
[0056] In step S90, IC chip 1, similar to step S88, rewrites the data of the updated EF located on the page being updated in NVM 13 by writing the data of each updated EF temporarily stored in RAM 12 to its original storage location in NVM 13. Next, IC chip 1 initializes the page being updated information (step S91), similar to step S5, and terminates the data rewriting process shown in Figure 6. Subsequently, a response to a command other than the update command is sent to terminal device 2.
[0057] Here, if the transmission order determined in step S6 shown in Figure 5 is EF1→EF4→EF6→EF5→EF2→EF3 as shown in Figure 2, and after the data rewriting process is executed in response to the update command of EF6 (at this time, the page being updated is page A), and then the update commands are sent to IC chip 1 in the order of EF5→EF2→EF3, then applying this to the data rewriting process shown in Figure 6 results in the following.
[0058] (1) Processing when an EF5 update command is received ~Step S82: Identify pages B and C to be updated → ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determined that the page being updated does not include the page to be updated (NO). ~Step S88: Write the updated EF1, EF4, and EF6 data stored in RAM12 to the memory location corresponding to page A in NVM13. ~Step S84: Page being updated → Set to Pages B and C Step S85: Read the data for EF2, EF5, and EF3 located on pages B and C from NVM13 and save it to RAM12. ~Step S86: Update the EF5 data stored in RAM12 (corresponding to the data on pages B and C).
[0059] (2) Processing when an EF2 update command is received ~Step S82: Identify the page to be updated → Page B ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determine that the page being updated contains the page to be updated (YES). ~Step S86: Update the EF2 data stored in RAM12.
[0060] (3) Processing when an EF3 update command is received ~Step S82: Identify the page to be updated → Page C ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determine that the page being updated contains the page to be updated (YES). ~Step S86: Update the EF3 data stored in RAM12.
[0061] By the way, if the transmission order determined in step S6 shown in Figure 5 is in the order of EF1→EF4→EF6→EF2→EF5→EF3 shown in Figure 2, then in the processing when receiving the update command for EF5, it is determined in step S87 that the page being updated does not include the pages B and C to be updated. Therefore, instead of immediately proceeding to step S88, it is necessary to insert the processing steps S871 to S873 as shown in Figure 7. Note that in the data rewriting process shown in Figure 7, the same reference numerals are used for steps that are the same as those in the data rewriting process shown in Figure 6.
[0062] In step S87 shown in Figure 7, if it is determined that the page being updated does not contain the page to be updated (step S87: NO), IC chip 1, conversely to step S87, determines whether the page being updated is included in the page to be updated identified in step S82 in response to the most recent update command (step S871). If it is determined that the page being updated is included in the page to be updated (step S871: YES), the process proceeds to step S872. On the other hand, if it is determined that the page being updated is not included in the page to be updated (step S871: YES), the process proceeds to step S88. In step S872, IC chip 1 sets the page being updated information to the page to be updated identified in step S82. Next, IC chip 1 reads the data of the EF (which may be multiple EFs) placed in the page to be updated that is not saved in RAM 12 (i.e., the EF data is not saved) from NVM 13 and temporarily adds it to RAM 12 (step S873), and proceeds to step S86.
[0063] When the transmission order determined in step S6 shown in Figure 5 is EF1→EF4→EF6→EF2→EF5→EF3 as shown in Figure 2, and after the data rewriting process is executed in response to the update command of EF6 (at this time, the page being updated is page A), the case in which update commands are sent to IC chip 1 in the order of EF2→EF5→EF3 is applied to the data rewriting process shown in Figure 7 as follows.
[0064] (1) Processing when an EF2 update command is received ~Step S82: Identify the page to be updated → Page B ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determined that the page being updated does not include the page to be updated (NO). Step S871: Determined that the page being updated is not included in the list of pages to be updated (NO). ~Step S88: Write the updated EF1, EF4, and EF6 data stored in RAM12 to the memory location corresponding to page A in NVM13. ~Step S84: Set the page being updated to page B. Step S85: Read the data for EF2 and EF5, which are located on page B, from NVM13 and save them to RAM12. ~Step S86: Update the EF2 data stored in RAM12.
[0065] (2) Processing when an EF5 update command is received ~Step S82: Identify pages B and C to be updated → ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determined that the page being updated does not include the page to be updated (NO). Step S871: Determined that the page being updated is included in the page to be updated (YES) ~Step S872: Page being updated → Set to Pages B and C Step S873: Read the data from EF3 located on page C from NVM13 and save it to RAM12. ~Step S86: Update the EF5 data stored in RAM12 (corresponding to the data on pages B and C).
[0066] (3) Processing when an EF3 update command is received ~Step S82: Identify the page to be updated → Page C ~Step S83: Determine that the information of the page being updated is not the initial value (NO). Step S87: Determine that the page being updated contains the page to be updated (YES). ~Step S86: Update the EF3 data stored in RAM12.
[0067] As described above, if EF2 and EF5 are arranged on page B in the order EF2 → EF5, and EF5 is also arranged on page C (i.e., EF5 is arranged across multiple pages), then by configuring terminal device 2 to determine the transmission order EF5 → EF2, the data rewriting process shown in Figure 6 can be adopted in IC chip 1, thereby simplifying the data rewriting process in IC chip 1.
[0068] As described above, according to the above embodiment, when the IC chip 1 receives a first update command from the terminal device 2, it identifies the page corresponding to the EF to be updated included in the first update command, reads the data of multiple EFs included in the identified page from the NVM 13 and stores it in the RAM 12, updates the data of the EF to be updated included in the first update command from among the data of multiple EFs stored in the RAM 12 with the data of the EF to be updated, and then, when a second update command is received, it identifies the page corresponding to the EF to be updated included in the second update command, determines whether the page identified when the second update command was received is included in the page corresponding to the data stored in the RAM 12, and if it determines that the identified page is included, updates the data of the EF to be updated included in the second update command from among the data of multiple EFs stored in the RAM 12 with the data of the EF to be updated. Next, when the third update command is received, the IC chip 1 identifies the page corresponding to the EF to be updated based on the identification information of the EF to be updated included in the third update command, and determines whether the page identified when the third update command was received is included in the pages corresponding to the data stored in RAM 12. If it is determined that the identified page is not included, the IC chip 1 is configured to rewrite the data of multiple EFs in NVM 13 with the updated data stored in RAM 12. This improves the efficiency of using NVM 13, where file data is written and read on a page-by-page basis, while also reducing the number of times NVM 13 is rewritten. [Explanation of symbols]
[0069] 1 IC chip 2 Terminal devices 11 I / O circuit 12 RAM( 13 NVM 14 ROM 15 CPU 16 coprocessors 21 Reader / Writer 22 Memory section 23 Control Unit
Claims
1. An electronic information storage medium comprising volatile memory and non-volatile memory in which file data is written and read on a page-by-page basis, which receives update commands containing data of a file to be updated and identification information of the file to be updated from a terminal device, When a first update command is received from the terminal device, a first identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the first update command, A storage means for reading data from each of the multiple files included in the page identified by the first identification means from the non-volatile memory and temporarily storing it in the volatile memory, A first update means updates the data of each of the plurality of files temporarily stored in the volatile memory, the data corresponding to the data of the file to be updated included in the first update command, with the data of the file to be updated; When a second update command is received from the terminal device following the first update command, a second identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the second update command, A first determination means for determining whether the page identified by the first identification means includes the page identified by the second identification means, If the first determination means determines that the page is included, the second update means updates the data of each of the multiple files temporarily stored in the volatile memory, corresponding to the data of the file to be updated included in the second update command, with the data of the file to be updated. When the data of each of the multiple files temporarily stored in the volatile memory is updated, a rewrite means rewrites the data of each of the multiple files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory. An electronic information storage medium characterized by comprising the following features.
2. When a third update command is received from the terminal device following the second update command, a third identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the third update command, A second determination means for determining whether the page corresponding to the data temporarily stored in the volatile memory includes the page identified by the third identification means, Furthermore, The electronic information storage medium according to claim 1, characterized in that, when the second determination means determines that the identified page is included, the data of each of the plurality of files is updated, and the data of each of the plurality of files is rewritten in the non-volatile memory with the updated data temporarily stored in the volatile memory.
3. The electronic information storage medium according to claim 2, further comprising a third update means that, when the second determination means determines that the identified page is included, updates the data of each of the plurality of files temporarily stored in the volatile memory, which corresponds to the data of the update target file included in the third update command, with the data of the update target file.
4. The electronic information storage medium according to claim 1, characterized in that, when a command other than the update command is received from the terminal device following the second update command, the data of each of the plurality of files is considered to have been updated, and the data of each of the plurality of files is rewritten in the non-volatile memory with the updated data temporarily stored in the volatile memory.
5. The electronic information storage medium according to claim 1, further comprising a transmission means for transmitting to the terminal device page arrangement information indicating the correspondence between the page in the non-volatile memory and a plurality of files contained in the page, page by page, before the first update command is received.
6. The electronic information storage medium according to claim 5, characterized in that the page arrangement information includes information indicating the arrangement order of each file on the page.
7. An IC chip comprising volatile memory and non-volatile memory in which file data is written and read on a page-by-page basis, which receives an update command from a terminal device containing the data of the file to be updated and identification information of the file to be updated, When a first update command is received from the terminal device, a first identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the first update command, A storage means for reading data from each of the multiple files included in the page identified by the first identification means from the non-volatile memory and temporarily storing it in the volatile memory, A first update means updates the data of each of the plurality of files temporarily stored in the volatile memory, the data corresponding to the data of the file to be updated included in the first update command, with the data of the file to be updated; When a second update command is received from the terminal device following the first update command, a second identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the second update command, A first determination means for determining whether the page identified by the first identification means includes the page identified by the second identification means, If the first determination means determines that the page is included, the second update means updates the data of each of the multiple files temporarily stored in the volatile memory, corresponding to the data of the file to be updated included in the second update command, with the data of the file to be updated. When the data of each of the multiple files temporarily stored in the volatile memory is updated, a rewrite means rewrites the data of each of the multiple files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory. An IC chip characterized by having the following features.
8. An IC card comprising volatile memory and non-volatile memory in which file data is written and read on a page-by-page basis, which receives an update command from a terminal device containing the data of the file to be updated and identification information of the file to be updated, When a first update command is received from the terminal device, a first identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the first update command, A storage means for reading data from each of the multiple files included in the page identified by the first identification means from the non-volatile memory and temporarily storing it in the volatile memory, A first update means updates the data of each of the plurality of files temporarily stored in the volatile memory, the data corresponding to the data of the file to be updated included in the first update command, with the data of the file to be updated; When a second update command is received from the terminal device following the first update command, a second identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the second update command, A first determination means for determining whether the page identified by the first identification means includes the page identified by the second identification means, If the first determination means determines that the page is included, the second update means updates the data of each of the multiple files temporarily stored in the volatile memory, corresponding to the data of the file to be updated included in the second update command, with the data of the file to be updated. When the data of each of the multiple files temporarily stored in the volatile memory is updated, a rewrite means rewrites the data of each of the multiple files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory. An IC card characterized by having the following features.
9. A data rewriting method is performed by an electronic information storage medium that includes volatile memory and non-volatile memory in which file data is written and read on a page-by-page basis, and which receives an update command containing the data of the file to be updated and identification information of the file to be updated from a terminal device, When a first update command is received from the terminal device, a first identification step is performed to identify the page corresponding to the update target file based on the identification information of the update target file included in the first update command, The steps include reading the data of each of the multiple files included in the page identified in the first identification step from the non-volatile memory and temporarily storing it in the volatile memory, The steps include updating the data of each of the plurality of files temporarily stored in the volatile memory, the data corresponding to the data of the file to be updated included in the first update command, with the data of the file to be updated; When a second update command is received from the terminal device following the first update command, a second identification step is performed to identify the page corresponding to the update target file based on the identification information of the update target file included in the second update command, A determination step to determine whether the page identified in the first identification step includes the page identified in the second identification step, If it is determined in the determination step that the page is included, the step of updating the data of the file to be updated included in the second update command, among the data of each of the multiple files temporarily stored in the volatile memory, with the data of the file to be updated, When the data of each of the multiple files temporarily stored in the volatile memory is updated, the step of rewriting the data of each of the multiple files included in the page identified in the first identification step in the non-volatile memory with the updated data temporarily stored in the volatile memory, A data rewriting method characterized by including the following.
10. A computer contained in an electronic information storage medium comprises volatile memory and non-volatile memory in which file data is written and read in page units, and receives update commands containing data of the file to be updated and identification information of the file to be updated from a terminal device. When a first update command is received from the terminal device, a first identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the first update command, A storage means for reading data from each of the multiple files included in the page identified by the first identification means from the non-volatile memory and temporarily storing it in the volatile memory, A first update means updates the data of each of the plurality of files temporarily stored in the volatile memory, the data corresponding to the data of the file to be updated included in the first update command, with the data of the file to be updated; When a second update command is received from the terminal device following the first update command, a second identification means identifies the page corresponding to the update target file based on the identification information of the update target file included in the second update command, A first determination means for determining whether the page identified by the first identification means includes the page identified by the second identification means, If the first determination means determines that the page is included, the second update means updates the data of each of the multiple files temporarily stored in the volatile memory, corresponding to the data of the file to be updated included in the second update command, with the data of the file to be updated. A media program characterized in that, when the data of each of the multiple files temporarily stored in the volatile memory is updated, it functions as a rewrite means that rewrites the data of each of the multiple files included in the page identified by the first identification means in the non-volatile memory with the updated data temporarily stored in the volatile memory.
11. A terminal device capable of communicating with an electronic information storage medium comprising volatile memory and non-volatile memory in which file data is written and read in page units, Receiving means for receiving page arrangement information from the electronic information storage medium, which indicates the correspondence between a page in the non-volatile memory and multiple files contained in that page, for each page. A determination means for determining the transmission order of each of the multiple files based on the page arrangement information, A transmission means that sequentially transmits update commands containing the data of the file and the identification information of the file to the electronic information storage medium in accordance with the transmission order determined by the determination means, A terminal device characterized by being equipped with the following features.
12. The page layout information includes information indicating the order in which each of the files is placed on the page. The terminal device according to claim 11, characterized in that the determination means determines the order in which the files are transmitted according to the arrangement order of the files.
13. The terminal device according to claim 12, characterized in that, if any one of the multiple files included in page 1 is also included in other pages, the determination means determines the transmission order of file 1 among the multiple files included in page 1 to be earlier than the transmission order of files other than file 1 among the multiple files.
14. A data transmission method performed by a terminal device capable of communicating with an electronic information storage medium comprising volatile memory and non-volatile memory in which file data is written and read in page units, The steps include receiving page arrangement information from the electronic information storage medium, which shows the correspondence between a page in the non-volatile memory and multiple files contained in that page, for each page; The steps include determining the transmission order of each of the multiple files to be updated based on the aforementioned page layout information, The steps include sequentially transmitting update commands containing the data of the file to be updated and the identification information of the file to be updated to the electronic information storage medium in accordance with the determined transmission order, A data transmission method characterized by including the following.
15. A computer included in a terminal device capable of communicating with an electronic information storage medium comprising volatile memory and non-volatile memory in which file data is written and read on a page-by-page basis, Receiving means for receiving page arrangement information from the electronic information storage medium, which indicates the correspondence between a page in the non-volatile memory and multiple files contained in that page, for each page. A determination means for determining the transmission order of each of the multiple files to be updated based on the aforementioned page layout information, A terminal program characterized by functioning as a transmission means that sequentially transmits update commands containing the data of the file to be updated and identification information of the file to be updated to the electronic information storage medium in accordance with the transmission order determined by the determination means.
Citation Information
Patent Citations
Electric information storage medium, IC card, external device, method for writing data, and program for writing data
JP2019086972A