ELECTRONIC INFORMATION STORAGE MEDIUM, IC CHIP, RECORD PROCESSING METHOD, AND PROGRAM

The IC chip uses a management table to manage record identification information, allowing flexible record issuance and handling duplicate records, thus reducing design effort and ensuring efficient operation.

JP7582527B1Active Publication Date: 2024-11-13DAI NIPPON PRINTING CO LTD
View PDF 4 Cites -1 Cited by

Patent Information

Application Number
JP2024018300
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2024-02-09
Publication Date
2024-11-13
Estimated Expiration
2044-02-09

AI Technical Summary

Technical Problem

Conventional IC chips require careful design of write command execution order to match record numbers and writing order, and face issues when the issuing process is interrupted, leading to potential duplication of records.

Method used

The IC chip employs a management table to manage record identification information separately, allowing records to be written in any order without awareness of record numbers, and includes mechanisms to handle duplicate records by updating or rejecting them.

Benefits of technology

This approach reduces the time and effort required for designing write command execution order and ensures appropriate handling of duplicate records, enabling flexible and efficient record issuance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007582527000001_ABST
    Figure 0007582527000001_ABST
Patent Text Reader

Abstract

To provide an electronic information storage medium, an IC chip, a record processing method, and a program that enable an issuer to issue records in any order without being conscious of record numbers, and that can appropriately handle a record that overlaps with an already written record transmitted from an issuing device. [Solution] When identification information matching the identification information included in the received issuance command has already been registered in an element of the management table, the IC chip 1 either writes the record included in the issuance command to the Record class corresponding to the element of the management table in place of the record stored in the Record class, or sends a response indicating an error to the external device 2 without writing the record included in the issuance command to the Record class.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the technical field of IC (Integrated Circuit) chips to which a plurality of records can be written from an external device. [Background technology]

[0002] Conventionally, as disclosed in, for example, Patent Document 1, in a record issuing process for writing into an IC chip a plurality of records to be stored in a file to be used by the IC chip, a plurality of write commands are sequentially transmitted from an issuing device of an issuer (manufacturer) of the IC chip to the IC chip, whereby the IC chip executes a process of sequentially writing the plurality of records from the issuing device. [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Patent No. 6556489 Summary of the Invention [Problem to be solved by the invention]

[0004] However, in the conventional IC chip, in the record issuing process, there were cases where the record number of each record and the issuing order (writing order) of the records had to be consistent. For example, the Append Record command defined in the JICSAP specification is a command that appends a record to a file specified by a parameter, and the record numbers of the appended records are assigned in the issuing order. Therefore, the issuer of the IC chip had to design the execution order of the write commands while considering the final record configuration, which was time-consuming. Also, if the issuing device stops for some reason during the record issuing process and then resumes, the IC chip will redo the process of writing multiple records from the issuing device in sequence. In this case, records that overlap with records already written to the IC chip will be sent from the issuing device to the IC chip by the write command, and the IC chip is required to take appropriate measures.

[0005] Therefore, the present invention aims to provide an electronic information storage medium, IC chip, record writing method, and program that enable an issuer to issue records in any order without being aware of record numbers, and also to provide an electronic information storage medium, IC chip, record processing method, and program that enable an issuer to issue records in any order without being aware of record numbers, while also being able to appropriately handle the case where a record that overlaps with an already written record is sent from the issuing device. [Means for solving the problem]

[0006] In order to solve the above problem, the invention described in claim 1 is an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising: a holding means for holding a management table for managing identification information of the records; a receiving means for receiving a write command including a record and the identification information of the record from an external device; a determination means for determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and a processing means for writing the record included in the write command to the record storage area instead of the record stored in the record storage area corresponding to the element of the management table when the determination means determines that identification information matching the identification information included in the write command is registered in an element of the management table.

[0007] The invention described in claim 2 is an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising: a holding means for holding a management table for managing identification information of the records; a receiving means for receiving a write command including a record and the identification information of the record from an external device; a determination means for determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and a processing means for transmitting a response indicating an error to the external device when the determination means determines that identification information matching the identification information included in the write command is registered in an element of the management table without writing the record included in the write command to the record storage area.

[0008] The invention described in claim 3 is characterized in that, in the electronic information storage medium described in claim 1 or 2, when the determination means determines that identification information matching the identification information included in the write command is not registered in an element of the management table, the processing means writes the record included in the write command to a record storage area among the multiple record storage areas in which the record has not been written, and registers the identification information included in the write command in an element of the management table corresponding to the record storage area.

[0009] The invention described in claim 4 is characterized in that, in the electronic information storage medium described in claim 1 or 2, the receiving means receives a read command including identification information of a record to be read from the external device, and the processing means searches for an element of a management table in which identification information matching the identification information included in the read command is registered, reads the record from the record memory area corresponding to the searched management table element, and transmits a response including the read record to the external device.

[0010] The invention described in claim 5 is Logically stored in files used by applications An electronic information storage medium having a memory with a plurality of record storage areas for writing records, the record storage area being configured to receive records from an external device. 、 and the record in question A value that combines the record number and the identifier of the file in which the record is stored a receiving means for receiving a write command including: A value obtained by combining the record number and the identifier and a processing means for writing the

[0011] The invention described in claim 6 is the electronic information storage medium described in claim 5, wherein the write command includes A value obtained by combining the record number and the identifier Matches A combination of the record number and the file identifieris stored in the second area of ​​any of the record storage areas, and the processing means determines whether or not the A value obtained by combining the record number and the identifier Matches A combination of the record number and the file identifier is determined to be stored in a second area of ​​the record storage area, the record included in the write command is written to the first area instead of the record stored in the first area of ​​the record storage area.

[0012] The invention described in claim 7 is An electronic information storage medium comprising a memory having a plurality of record storage areas for writing records, the electronic information storage medium comprising: a receiving means for receiving a write command including a record and identification information of the record from an external device; and a processing means for writing the record included in the write command into a first area of ​​any one of the plurality of record storage areas, and for writing the identification information included in the write command into a second area of ​​the record storage area into which the record is written. a determination means for determining whether or not identification information matching the identification information included in the write command is stored in the second area of ​​any of the record storage areas; , The processing means is characterized in that when the determination means determines that identification information matching the identification information included in the write command is stored in a second area of ​​the record storage area, the processing means sends a response indicating an error to the external device without writing the record included in the write command to the record storage area.

[0013] The invention described in claim 8 is an electronic information storage medium having a memory having a plurality of record storage areas for writing records, the electronic information storage medium comprising: a receiving means for receiving a write command including a record and identification information of the record from an external device; a processing means for writing the record included in the write command to a first area of ​​one of the plurality of record storage areas, and writing the identification information included in the write command to a second area of ​​the record storage area to which the record is written; and a determining means for determining whether or not identification information matching the identification information included in the write command is stored in the second area of ​​any of the record storage areas, wherein when the determining means determines that identification information matching the identification information included in the write command is stored in the second area of ​​the record storage area, the processing means writes the record included in the write command to the first area instead of the record stored in the first area of ​​the record storage area, The processing means is characterized in that when the determination means determines that identification information matching the identification information included in the write command is not stored in the second area of ​​the record storage area, the processing means searches for a record storage area in which the record has not been written based on the arrangement of the record storage area, writes the record included in the write command to a first area of ​​the searched record storage area, and writes the identification information included in the write command to a second area of ​​the record storage area to which the record will be written.

[0014] The invention described in claim 9 is characterized in that, in the electronic information storage medium described in claim 7, when the determination means determines that identification information matching the identification information included in the write command is not stored in the second area of ​​the record storage area, the processing means searches for a record storage area in which the record has not been written based on the arrangement of the record storage area, writes the record included in the write command to a first area of ​​the searched record storage area, and writes the identification information included in the write command to a second area of ​​the record storage area to which the record will be written.

[0015] The invention described in claim 10 is characterized in that, in the electronic information storage medium described in any one of claims 5 to 9, the receiving means receives multiple write commands sequentially, and the contents of the records included in each write command are different from each other.

[0016] The invention described in claim 11 is or 6 In the electronic information storage medium described in the above, the receiving means receives a record to be read from the external device. A value that combines the record number and the identifier of the file in which the record is stored and the processing means receives a read command including A value obtained by combining the record number and the identifier Matches A combination of the record number and the file identifier the record storage area in which the record is stored is searched, the record is read from the searched record storage area, and a response including the read record is transmitted to the external device.

[0017] The invention described in claim 12 is an IC chip having a memory having a plurality of record memory areas for writing records, comprising: a holding means for holding a management table for managing identification information of the records; a receiving means for receiving a write command including a record and the identification information of the record from an external device; a determination means for determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and a processing means for writing the record included in the write command to the record memory area instead of the record stored in the record memory area corresponding to the element of the management table when the determination means determines that identification information matching the identification information included in the write command is registered in the element of the management table.

[0018] The invention described in claim 13 is an IC chip having a memory having a plurality of record memory areas for writing records, comprising: a holding means for holding a management table for managing identification information of the records; a receiving means for receiving a write command including a record and the identification information of the record from an external device; a determination means for determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and a processing means for transmitting a response indicating an error to the external device when the determination means determines that identification information matching the identification information included in the write command is registered in an element of the management table without writing the record included in the write command to the record memory area.

[0019] The invention described in claim 14 is Logically stored in files used by applications An IC chip having a memory with multiple record storage areas for writing records, and receiving records from an external device. 、 and the record in question A value that combines the record number and the identifier of the file in which the record is storeda receiving means for receiving a write command including: A value obtained by combining the record number and the identifier and a processing means for writing the

[0020] The invention described in claim 15 is a record processing method executed by an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising the steps of: retaining a management table for managing identification information of the records; receiving a write command from an external device, the write command including a record and the identification information of the record; determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and, when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, writing the record included in the write command to the record storage area instead of the record stored in the record storage area corresponding to the element of the management table.

[0021] The invention described in claim 16 is a record processing method executed by an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising the steps of: retaining a management table for managing identification information of the records; receiving a write command from an external device including a record and the identification information of the record; determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and, if it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, sending a response indicating an error to the external device without writing the record included in the write command to the record storage area.

[0022] The invention described in claim 17 is as follows: Logically stored in files used by applications A record processing method executed by an electronic information storage medium having a memory with a plurality of record storage areas for writing records, the method comprising: receiving records from an external device; 、 and the record in question A value that combines the record number and the identifier of the file in which the record is stored receiving a write command including: writing a record included in the write command to a first area of ​​any one of the plurality of record storage areas; and writing the record included in the write command to a second area of ​​the record storage area to which the record is written. A value obtained by combining the record number and the identifier and writing the

[0023] The invention described in claim 18 is characterized in that it executes the steps of: a computer included in an electronic information storage medium having a memory having a plurality of record storage areas for writing records, storing a management table for managing identification information of the records; receiving a write command including a record and the identification information of the record from an external device; determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and, when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, writing the record included in the write command to the record storage area instead of the record stored in the record storage area corresponding to the element of the management table.

[0024] The invention described in claim 19 is characterized in that a computer included in an electronic information storage medium having a memory with a plurality of record storage areas for writing records executes the following steps: retaining a management table for managing identification information of the records; receiving a write command including a record and the identification information of the record from an external device; determining whether identification information matching the identification information included in the write command is registered in an element of the management table; and if it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, sending a response indicating an error to the external device without writing the record included in the write command to the record storage area.

[0025] The invention described in claim 20 is Logically stored in files used by applications A computer included in an electronic information storage medium having a memory having a plurality of record storage areas for writing records is provided with a record input device that inputs records from an external device to the computer. 、 and the record in question A value that combines the record number and the identifier of the file in which the record is stored receiving a write command including: writing a record included in the write command to a first area of ​​any one of the plurality of record storage areas; and writing the record included in the write command to a second area of ​​the record storage area to which the record is written. A value obtained by combining the record number and the identifier The method is characterized by executing the steps of: Effect of the Invention

[0026] According to the present invention, a publisher can issue records in any order without being concerned with record numbers. [Brief description of the drawings]

[0027] [Figure 1] 2 is a diagram illustrating an example of a hardware configuration of an IC chip 1. FIG. [Diagram 2] FIG. 13 is a conceptual diagram showing an example of an array of Record classes in a record body. [Diagram 3]FIG. 13 is a conceptual diagram showing an example of the correspondence between a Record class and elements of a management table. [Figure 4] FIG. 13 is a conceptual diagram showing an example of an array of a Record class that stores records and identification information of the records. [Diagram 5] 10 is a flowchart showing an example of an issuing process executed by a CPU 15 of the IC chip 1 according to the first embodiment. [Figure 6] 6 is a conceptual diagram showing an example of the correspondence relationship between a Record class and elements of a management table when a new record is written in the issuing process shown in FIG. 5. [Figure 7] 10 is a flowchart showing an example of a read process executed by a CPU 15 of the IC chip 1 according to the first embodiment. [Figure 8] 10 is a flowchart showing an example of an issuing process executed by a CPU 15 of an IC chip 1 according to a second embodiment. [Figure 9] 11 is a flowchart showing an example of a read process executed by a CPU 15 of the IC chip 1 according to the second embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0028] Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.

[0029] [1. Configuration and Function of IC Chip 1] First, the configuration and functions of an IC chip 1 according to this embodiment will be described with reference to Fig. 1. The IC chip 1 is an example of an 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 cash 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 is detachable from the mobile device, or may be mounted on an embedded board as an eUICC (Embedded Universal Integrated Circuit Card) so that it cannot be easily removed or replaced from the mobile device.

[0030] FIG. 1 is a diagram showing an example of a hardware configuration of an IC chip 1. As shown in FIG. 1, the IC chip 1 includes an I / O circuit 11, a random access memory (RAM) 12, a nonvolatile memory (NVM) 13, a read only memory (ROM) 14, a central processing unit (CPU) 15 (an example of a computer), and a coprocessor 16 that performs cryptographic operations. The I / O circuit 11 serves as an interface with an external device 2. Note that communication between the IC chip 1 and the external device 2 may be non-contact communication or contact communication. In the case of non-contact communication, the IC chip 1 and the external device 2 communicate with each other via an antenna (not shown) mounted on an IC card or a mobile device. Note that examples of the external device 2 include an issuing device (issuing terminal) in a factory and a transaction device (transaction terminal) in a store.

[0031] For example, a flash memory is applied to the NVM 13. The NVM 13 may be an "Electrically Erasable Programmable Read-Only Memory". Various programs such as an OS (Operating System) and one or more applications (including the program of the present invention) are stored in the NVM 13 or the ROM 14. The NVM 13 has a record body for writing (saving) records. Here, a record is data that is logically stored (in other words, logically organized) in a file (for example, an EF (Elementary File)) used by an application. Examples of records include setting data that determines the operation of an application, key data required for encryption and decryption operations, and certificate data. A single file can store multiple records. A single application may use multiple files. Each file is assigned an SFI (Short File Identifier) ​​that is an identifier of the file. Each record is assigned a record number (that is, a logical number in the file), which is an example of identification information of the record. A record can be uniquely identified by specifying the SFI and the record number. The SFI and record number together can be called record identification information.

[0032] The record body is implemented, for example, as an array of multiple Record classes (an example of a record storage area). Each Record class is a class (a collection of data and processing) for saving the contents of one record. For example, every time a new record is issued, the newly issued record is created as an instance of the Record class and added to an empty element (i.e., the Record class) of the above array. Figure 2 is a conceptual diagram showing an example of an array of Record classes in the record body. In the example of Figure 2, the Record classes are represented as Record[0] to [3]. For example, the record (0000···) saved in Record[0] is identified by the SFI "1" (01(h)) and the record number "1". Each record may be saved in the Record class in TLV format. In the existing implementation, when a record issue command such as the Append Record command is received, elements are added sequentially to the array of the record body as shown in Figure 2, and the record numbers of the records written to the added elements are automatically assigned in the order in which they were written. For example, the record numbers are assigned sequentially from 1 to 2 to 3 in the order in which the records were written. For this reason, issuers of IC chips had to design the execution order of issued commands with the final record configuration in mind.

[0033] On the other hand, in the NVM 13 according to this embodiment, a management table for managing the record numbers of the records stored in the Record class is stored in a storage area separate from the record main body. That is, in this embodiment, the IC chip 1 has a management table for managing the record numbers of the records as a data structure separate from the record main body that actually stores the contents of the records. Each Record class is associated with an element of the management table. The elements of the management table are implemented, for example, as an integer array, similar to the array of the Record class. FIG. 3 is a conceptual diagram showing an example of the correspondence between the Record class and the elements of the management table. In the example of FIG. 3, the elements of the management table are represented as Table[0] to [3]. Also, in the example of FIG. 3, a value obtained by combining the SFI and the record number is registered in each element of the management table. For example, in FIG. 3, the SFI of the record stored in Record[0] is "2" and the record number is "1", and the SFI of the record stored in Record[2] is "2" and the record number is "3". Such a management table allows the issuer of the IC chip 1 to issue records in any order without being aware of the record numbers.

[0034] Alternatively, the identification information of the records may be managed without using the management table. In this case, each Record class is provided with a first area for storing the records and a second area for storing the identification information of the records. In other words, by including the identification information of the records as meta-information in the array of Record classes, the issuer of the IC chip 1 can issue the records in any order without being aware of the record numbers, even if the above-mentioned management table is not implemented. FIG. 4 is a conceptual diagram showing an example of an array of Record classes that stores records and the identification information of the records (in this example, a value obtained by combining the SFI and the record number). In the example of FIG. 4, the first two bytes of each Record class are assigned as the second area (that is, the record is stored following the identification information of the record). In the example of FIG. 4, the second area of ​​Record[0] stores SFI “2” and record number “1” (that is, 0201(h) is stored), and the first area of ​​Record[0] stores the record (0000···) identified by SFI “2” and record number “1”. Meanwhile, the second area of ​​Record[1] stores SFI “2” and record number “5”, and the first area of ​​Record[1] stores a record (1111...) identified by SFI “2” and record number “5”. Note that if the IC chip 1 can identify the length of each record, such as when the records are stored in TLV format, then in each Record class, identification information of the record may be stored after the record (i.e., following the record).

[0035] The CPU 15 (an example of a computer) functions as a holding means, a receiving means, a determining means, a processing means, and the like in the present invention by executing the OS and applications stored in the NVM 13. The CPU 15 may hold the above-mentioned management table using the NVM 13, or may not hold the management table. The CPU 15 also receives a command APDU (Application Protocol Data Unit) specified in ISO / IEC 7816, for example, from the external device 2 via the I / O circuit 11. Examples of the command APDU include an issue command (an example of a write command) such as an Append Record command received from an issue device in a manufacturing factory of the IC chip 1, and a read command such as a READ RECORD command received from a transaction device in a store after the shipment of the IC chip 1.

[0036] Here, the issue command and the read command are each composed of a header section consisting of CLA, INS, P1, and P2, and a body section. CLA indicates the command class, and INS indicates the command code. INS identifies the type of command. P1 and P2 indicate command parameters. The data section of the issue command includes a record as the issue data, the record number of the record, and the SFI of the file that logically stores the record. On the other hand, the data section of the read command includes the record number of the record to be read, and the SFI of the file that logically stores the record. The record number and SFI may be included in P1 or P2.

[0037] In the case where the management table is used, when an issue command is received from the external device 2, the CPU 15 writes a record included in the issue command to one of a plurality of Record classes in response to the issue command, and registers (records) the identification information included in the issue command (i.e., the identification information of the record) in an element of the management table associated with the Record class. In this case, when the issue command is received, the CPU 15 may determine whether or not identification information matching the identification information included in the issue command is registered in an element of the management table. Then, when the CPU 15 determines that identification information matching the identification information included in the issue command is not registered in an element of the management table, it may search (search) a Record class to which no record has been written (empty element) based on the array of Record classes, write the record included in the issue command to the searched Record class, and register the identification information included in the issue command in an element of the management table associated with the Record class.

[0038] On the other hand, when the CPU 15 determines that the identification information that matches the identification information included in the issued command is registered in an element of the management table, the CPU 15 writes the record included in the issued command in the Record class corresponding to the element of the management table instead of the record stored in the Record class corresponding to the element of the management table (for example, overwrites and saves). This makes it possible to appropriately handle even when a record that overlaps with a record that has already been written is transmitted from the external device 2. Note that when the CPU 15 determines that the identification information that matches the identification information included in the issued command is registered in an element of the management table, the CPU 15 may write the record included in the issued command in the Record class instead of the record stored in the Record class corresponding to the element of the management table, and may register the identification information included in the issued command in the element of the management table instead of the identification information registered in the element of the management table corresponding to the Record class (that is, overwrite and record with the same identification information). Alternatively, when the CPU 15 determines that the identification information that matches the identification information included in the issued command is registered in an element of the management table, the CPU 15 may transmit a response indicating an error to the external device 2 without writing the record included in the issued command in the Record class. This also makes it possible to appropriately handle the case where a record that overlaps with a record that has already been written is sent from the external device 2. Here, the response indicating an error is configured, for example, by a response APDU defined in ISO / IEC 7816. Such a response APDU includes a status word (SW1, SW2) indicating an error.

[0039] In the case where the management table is used, when a read command is received from the external device 2, the CPU 15 searches for an element of the management table in which identification information matching the identification information included in the read command is registered in response to the read command, reads a record from a Record class associated with the searched element of the management table, and transmits a response including the read record to the external device 2. Here, the response including the read record is configured, for example, by a response APDU defined in ISO / IEC 7816. Such a response APDU includes a status word (SW1, SW2) indicating normal termination.

[0040] On the other hand, when the management table is not used and an issue command is received from the external device 2, the CPU 15 writes the record included in the issue command to the first area of ​​one of the multiple Record classes in response to the issue command, and writes the identification information included in the issue command (i.e., the identification information of the record) to the second area of ​​the Record class to which the record is written. In this case, when the issue command is received, the CPU 15 may determine whether or not identification information matching the identification information included in the issue command is stored in the second area of ​​any Record class. Then, when the CPU 15 determines that identification information matching the identification information included in the issue command is not stored in the second area of ​​any Record class, it may search for a Record class to which no record has been written based on the arrangement of the Record classes, write the record included in the issue command to the first area of ​​the searched Record class, and write the identification information included in the issue command to the second area of ​​the Record class to which the record is written.

[0041] On the other hand, when the CPU 15 determines that the identification information that matches the identification information included in the issued command is stored in the second area of ​​any Record class, it writes the record included in the issued command in the first area instead of the record stored in the first area of ​​the Record class. This makes it possible to appropriately handle even when a record that overlaps with a record that has already been written is transmitted from the external device 2. When the CPU 15 determines that the identification information that matches the identification information included in the issued command is stored in the second area of ​​any Record class, it may write the record included in the issued command in the first area instead of the record stored in the first area of ​​the Record class, and write the identification information included in the issued command in the second area instead of the identification information stored in the second area of ​​the Record class (i.e., overwrite and save with the same identification information). Alternatively, when the CPU 15 determines that the identification information that matches the identification information included in the issued command is stored in the second area of ​​any Record class, it may transmit a response indicating an error to the external device 2 as described above without writing the record included in the issued command in the Record class. This also makes it possible to appropriately handle the case where a record that overlaps with a record that has already been written is transmitted from the external device 2.

[0042] Then, in a case where the management table is not used and a read command is received from the external device 2, the CPU 15 searches for a Record class in which identification information matching the identification information included in the read command is stored (i.e., stored in the second area) in response to the read command, reads a record from the first area of ​​the searched Record class, and transmits a response including the read record to the external device 2. Note that it is also possible to read a record and the identification information of the record from the searched Record class (first area and second area), and transmit a response including the record to the external device 2 excluding the read identification information.

[0043] [2. Operation of IC chip 1] Next, the operation of the IC chip 1 according to this embodiment will be described separately for Example 1 and Example 2.

[0044] Example 1 First, the operation of the IC chip 1 according to the first embodiment will be described with reference to Fig. 5 to Fig. 7. Fig. 5 is a flowchart showing an example of an issue process executed by the CPU 15 of the IC chip 1 according to the first embodiment. Fig. 6 is a conceptual diagram showing an example of a correspondence relationship between a Record class and an element of a management table when a record is written in the issue process shown in Fig. 5. Fig. 7 is a flowchart showing an example of a read process executed by the CPU 15 of the IC chip 1 according to the first embodiment.

[0045] For example, in a record issuing process in a manufacturing plant for IC chip 1, when IC chip 1 communicates with an issuing device, which is an external device 2, and receives an issuing command from the issuing device, the process shown in Fig. 5 is started. Note that the issuing process shown in Fig. 5 is repeatedly executed until writing of all records required for the operation of an application is completed. In other words, IC chip 1 receives multiple issuing commands in sequence. The contents of the issuing data (records) included in each issuing command are basically different from each other.

[0046] 5 starts, the CPU 15 acquires a record, the record number of the record, and the SFI of the file storing the record from the issued command (step S1). Next, the CPU 15 determines whether or not identification information (i.e., a value obtained by combining the SFI and the record number) that matches the record number and SFI acquired in step S1 is registered in an element of the management table (step S2). If it is determined that the record number and identification information that matches the SFI acquired in step S1 are not registered in an element of the management table (step S2: NO), the process proceeds to step S3. On the other hand, if it is determined that the record number and identification information that matches the SFI acquired in step S1 are registered in an element of the management table (step S2: YES), the process proceeds to step S5.

[0047] In step S3, the CPU 15 searches for an empty element (that is, a Record class to which no record has been written) in the array of Record class from the top. Then, the CPU 15 executes a process of writing the record acquired in step S1 to the Record class that is an empty element found by the search in step S3 (step S4), and proceeds to the process of step S7. For example, as shown in Fig. 6, if Record[0] to Record[3] have already been written, the new record acquired in step S1 is written to Record[4], which is an empty element.

[0048] In step S5, the CPU 15 identifies a Record class associated with an element of the management table in which identification information matching the record number and SFI obtained in step S1 is registered. Next, the CPU 15 executes a process of writing the record obtained in step S1 to the Record class identified in step S5 (step S6), and proceeds to step S7. In this process, the record obtained in step S1 is written to the Record class in place of the record stored in the Record class associated with the element of the management table (i.e., it is overwritten and saved).

[0049] In step S5, the CPU 15 may return a response indicating an error to the issuing device, which is the external device 2. In this case, the process of step S6 is not performed (i.e., the record acquired in step S1 is not written to the Record class), and the process shown in FIG. 5 ends.

[0050] In step S7, the CPU 15 determines whether or not a write error occurred in the process of step S4 or S6. If it is determined that a write error occurred (step S7: YES), a response indicating the error is returned to the issuing device, which is the external device 2 (step S8), and the process shown in Fig. 5 ends. On the other hand, if it is determined that a write error did not occur (step S7: NO), the process proceeds to step S9.

[0051] In step S9, the CPU 15 registers a value obtained by combining the SFI and record number obtained in step S1 in an element of the management table associated with the Record class to which the record was written in step S4 or S6, as identification information of the record. For example, as shown in FIG. 6, when a record is written to Record[4], which is an empty element, a value "0102(h)" obtained by combining the SFI "1" and record number "2" obtained in step S1 is registered (recorded) in Table[4]. On the other hand, when a record is overwritten in a Record class to which a record has already been written, the value obtained by combining the SFI and record number obtained in step S1 in an element of the management table associated with the Record class may be overwritten, or the process may proceed to step S10 without overwriting the value. Next, the CPU 15 returns a response indicating normal termination to the issuing device, which is the external device 2 (step S10), and ends the process shown in FIG. 5.

[0052] As described above, after the IC chip 1 on which all records necessary for the operation of the application have been written in the record issuing process has been shipped, the IC chip 1 communicates with a transaction device which is the external device 2, and when it receives a read command from the transaction device, the process shown in Fig. 7 is started. When the process shown in Fig. 7 is started, the CPU 15 obtains the record number of the record to be read from the read command and the SFI of the file that stores the record (step S21).

[0053] Next, CPU 15 searches for an element of the management table in which identification information that matches the record number and SFI acquired in step S21 is registered (step S22). Then, CPU 15 identifies a Record class associated with the element of the management table searched (i.e., identified by the search) in step S22 (step S23). Next, CPU 15 executes a process of reading a record from the Record class identified in step S23 (step S24). For example, the record is read from the Record class in NVM 13 to a work area in RAM 12. Next, CPU 15 returns a response including the record read in step S24 and indicating normal termination to the transaction device, which is the external device 2 (step S25), and ends the process shown in FIG. 7.

[0054] As described above, according to the first embodiment, the IC chip 1 holds a management table for managing record numbers of records, and when it receives an issue command including a record and the record number of the record from the external device 2, it writes the record included in the issue command to one of a plurality of Record classes, and registers the record number of the record in an element of the management table associated with the Record class. Therefore, the issuer can issue the record in a free order without being aware of the record number. For example, the brand that provides the credit payment application may specify the order in which each record is written, and in the conventional IC chip, the record numbers are assigned in the order in which the records are written, so that the issuer of the IC chip needs to design (for example, rearrange) the execution order (i.e., the transmission order) of each issue command in the issue command group. However, according to the IC chip 1 according to the first embodiment, it is configured to manage the identification information of the record by making the elements of the management table associated with the Record class, so that it is possible to reduce the effort required to design the execution order of each issue command in the record issue process as in the conventional case.

[0055] Furthermore, according to the above-mentioned first embodiment, when identification information matching the identification information included in the received issuance command has already been registered in an element of the management table, the IC chip 1 writes the record included in the issuance command to the Record class corresponding to the element of the management table instead of the record stored in the Record class, or transmits a response indicating an error to the external device 2 without writing the record included in the issuance command to the Record class. Therefore, it is possible to appropriately handle the case where a record that overlaps with a record that has already been written is transmitted from the external device 2.

[0056] Example 2 Next, the operation of the IC chip 1 according to the second embodiment will be described with reference to Figs. 8 and 9. Fig. 8 is a flowchart showing an example of an issuing process executed by the CPU 15 of the IC chip 1 according to the second embodiment. Fig. 9 is a flowchart showing an example of a reading process executed by the CPU 15 of the IC chip 1 according to the second embodiment. The process shown in Fig. 8 is similar to the process shown in Fig. 5, and is started when the IC chip 1 receives an issuing command from an issuing device which is an external device 2 in a record issuing process in a manufacturing factory of the IC chip 1, for example. Note that the issuing process shown in Fig. 8 is repeatedly executed until writing of all records required for the operation of the application is completed, similar to the process shown in Fig. 5.

[0057] When the process shown in Fig. 8 is started, the CPU 15 acquires a record, a record number of the record, and an SFI of a file storing the record from the issued command (step S31). Next, the CPU 15 judges whether or not the identification information (i.e., a value obtained by combining the SFI and the record number) that matches the record number and SFI acquired in step S31 is stored in the second area of ​​any Record class (step S32). If it is judged that the record number and identification information that matches the SFI acquired in step S31 are not stored in the second area of ​​any Record class (step S32: NO), the process proceeds to step S33. On the other hand, if it is judged that the record number and identification information that matches the SFI acquired in step S31 are stored in the second area of ​​any Record class (step S32: YES), the process proceeds to step S35.

[0058] In step S33, CPU 15 searches for an empty element (that is, a Record class to which no record has been written) in the array of Record class from the top. CPU 15 then executes a process of writing the record acquired in step S31 to the first area of ​​the Record class, which is the empty element found by the search in step S33 (step S34), and proceeds to the process of step S37.

[0059] In step S35, the CPU 15 identifies a Record class in which identification information that matches the record number and SFI acquired in step S31 is stored. Next, the CPU 15 executes a process to write the record acquired in step S31 to the first area of ​​the Record class identified in step S35 (step S36), and proceeds to step S37. In this process, the record acquired in step S31 is written to the first area of ​​the Record class in place of the record stored in the first area of ​​the Record class (i.e., it is overwritten and saved).

[0060] In step S37, the CPU 15 determines whether or not a write error occurred in the process of step S34 or S36. If it is determined that a write error occurred (step S37: YES), a response indicating the error is returned to the issuing device, which is the external device 2 (step S38), and the process shown in Fig. 8 ends. On the other hand, if it is determined that a write error did not occur (step S37: NO), the process proceeds to step S39.

[0061] In step S39, the CPU 15 registers a value obtained by combining the SFI and record number obtained in step S31 in the second area of ​​the Record class to which the record was written in step S34 or S36 as identification information of the record. When a record is overwritten in a Record class to which a record has already been written, the value obtained by combining the SFI and record number obtained in step S31 in the second area of ​​the Record class may be overwritten, or the process may proceed to step S40 without overwriting the value. Next, the CPU 15 returns a response indicating normal completion to the issuing device, which is the external device 2 (step S40), and ends the process shown in FIG. 8.

[0062] As described above, after the IC chip 1 in which all records necessary for the operation of the application have been written in the record issuing process has been shipped, the IC chip 1 communicates with a transaction device which is the external device 2, and when it receives a read command from the transaction device, the process shown in Fig. 9 is started. When the process shown in Fig. 9 is started, the CPU 15 obtains the record number of the record to be read from the read command and the SFI of the file that stores the record (step S41).

[0063] Next, CPU 15 searches for a Record class in which identification information that matches the record number and SFI acquired in step S41 is stored (step S42). Then, CPU 15 executes a process of reading a record from the first area of ​​the Record class searched for in step S42 (i.e., identified by the search) (step S43). For example, the record is read from the first area of ​​the Record class in NVM 13 to a work area in RAM 12. Next, CPU 15 returns a response including the record read in step S43 and indicating normal termination to the transaction device, which is the external device 2 (step S44), and terminates the process shown in FIG. 9.

[0064] As described above, according to the second embodiment, when the IC chip 1 receives an issue command including a record and the record number of the record from the external device 2, the IC chip 1 writes the record included in the issue command into the first area of ​​one of the multiple Record classes, and writes the record number of the record into the second area of ​​the Record class, so that the issuer can issue the records in a free order without being aware of the record number. For example, as in the first embodiment, in a conventional IC chip, the record numbers are assigned in the order in which the records are written, so that the issuer of the IC chip needs to design the execution order of each issue command in the issue command group. However, according to the IC chip 1 according to the second embodiment, the identification information of the record stored in the first area of ​​the Record class is managed in the second area of ​​the Record class, so that the effort of designing the execution order of each issue command in the record issue process as in the conventional method can be reduced.

[0065] Furthermore, according to the above-mentioned second embodiment, when identification information matching the identification information included in the received issue command has already been registered in the second area of ​​the Record class, the IC chip 1 is configured to write the record included in the issue command to the first area of ​​the Record class instead of the record stored in the first area of ​​the Record class, or to send a response indicating an error to the external device 2 without writing the record included in the issue command to the Record class. Therefore, it is possible to appropriately handle the case where a record that overlaps with a record that has already been written is sent from the external device 2. [Explanation of symbols]

[0066] 1 IC chip 11 I / O circuit 12 RAM ( 13 NVM 14 ROM 15 CPU 16 Coprocessors

Claims

1. 1. An electronic information storage medium comprising a memory having a plurality of record storage areas for writing records, a storage means for storing a management table for managing the identification information of the record; a receiving means for receiving a write command including a record and identification information of the record from an external device; a determination means for determining whether or not identification information matching the identification information included in the write command is registered in an element of the management table; a processing means for writing a record included in the write command to a record storage area in place of a record stored in the record storage area corresponding to the element of the management table when the determining means determines that identification information matching the identification information included in the write command is registered in the element of the management table; An electronic information storage medium comprising:

2. 1. An electronic information storage medium comprising a memory having a plurality of record storage areas for writing records, a storage means for storing a management table for managing the identification information of the record; a receiving means for receiving a write command including a record and identification information of the record from an external device; a determination means for determining whether or not identification information matching the identification information included in the write command is registered in an element of the management table; a processing means for transmitting a response indicating an error to the external device without writing the record included in the write command to the record storage area when the determining means determines that identification information matching the identification information included in the write command is registered in an element of the management table; An electronic information storage medium comprising:

3. The electronic information storage medium described in claim 1 or 2, characterized in that when the determination means determines that identification information matching the identification information included in the write command is not registered in an element of the management table, the processing means writes the record included in the write command to a record storage area among the multiple record storage areas in which the record has not been written, and registers the identification information included in the write command in an element of the management table corresponding to the record storage area.

4. the receiving means receives a read command including identification information of a record to be read from the external device; The electronic information storage medium according to claim 1 or 2, characterized in that the processing means searches for an element of a management table in which identification information matching the identification information included in the read command is registered, reads the record from the record memory area corresponding to the searched management table element, and transmits a response including the read record to the external device.

5. An electronic information storage medium having a memory having a plurality of record storage areas for writing records that are logically stored in a file used by an application, comprising: a receiving means for receiving from an external device a record and a write command including a value obtained by combining a record number of the record and an identifier of a file in which the record is to be stored; a processing means for writing a record included in the write command into a first area of ​​any one of the plurality of record storage areas, and for writing a value obtained by combining the record number and the identifier included in the write command into a second area of ​​the record storage area into which the record is written; An electronic information storage medium comprising:

6. a determination means for determining whether a value obtained by combining a record number and a file identifier that coincides with a value obtained by combining the record number and the identifier included in the write command is stored in a second area of ​​any of the record storage areas, The electronic information storage medium according to claim 5, characterized in that when the determination means determines that a value obtained by combining a record number and a file identifier that matches the value obtained by combining the record number and the identifier included in the write command is stored in a second area of ​​the record storage area, the processing means writes the record included in the write command to the first area instead of the record stored in the first area of ​​the record storage area.

7. An electronic information storage medium having a memory having a plurality of record storage areas for writing records, a receiving means for receiving a write command including a record and identification information of the record from an external device; a processing means for writing a record included in the write command into a first area of ​​any one of the plurality of record storage areas, and for writing identification information included in the write command into a second area of ​​the record storage area into which the record is written; a determination means for determining whether or not identification information matching the identification information included in the write command is stored in a second area of ​​any of the record storage areas; Equipped with The electronic information storage medium is characterized in that when the determination means determines that identification information matching the identification information included in the write command is stored in a second area of ​​the record memory area, the processing means sends a response indicating an error to the external device without writing the record included in the write command to the record memory area.

8. An electronic information storage medium having a memory having a plurality of record storage areas for writing records, a receiving means for receiving a write command including a record and identification information of the record from an external device; a processing means for writing a record included in the write command into a first area of ​​any one of the plurality of record storage areas, and for writing identification information included in the write command into a second area of ​​the record storage area into which the record is written; a determination means for determining whether or not identification information matching the identification information included in the write command is stored in a second area of ​​any of the record storage areas; Equipped with when the determination means determines that identification information matching the identification information included in the write command is stored in a second area of ​​the record storage area, the processing means writes the record included in the write command into the first area instead of the record stored in the first area of ​​the record storage area; The processing means, when the determination means determines that identification information matching the identification information included in the write command is not stored in the second area of ​​the record storage area, searches for a record storage area in which the record has not been written based on the arrangement of the record storage area, writes the record included in the write command to a first area of ​​the searched record storage area, and writes the identification information included in the write command to a second area of ​​the record storage area to which the record will be written.

9. The electronic information storage medium described in claim 7, characterized in that when the determination means determines that identification information matching the identification information included in the write command is not stored in the second area of ​​the record storage area, the processing means searches for a record storage area in which the record has not been written based on the arrangement of the record storage area, writes the record included in the write command to a first area of ​​the searched record storage area, and writes the identification information included in the write command to a second area of ​​the record storage area to which the record will be written.

10. The receiving means sequentially receives a plurality of the write commands, 10. The electronic information storage medium according to claim 5, wherein the contents of the records included in the respective write commands are different from each other.

11. the receiving means receives a read command including a value obtained by combining a record number of a record to be read from the external device and an identifier of a file in which the record is stored; The electronic information storage medium according to claim 5 or 6, characterized in that the processing means searches the record memory area in which a value obtained by combining a record number and a file identifier that matches a value obtained by combining the record number and the identifier included in the read command is stored, reads the record from the searched record memory area, and transmits a response including the read record to the external device.

12. An IC chip having a memory having a plurality of record storage areas for writing records, a storage means for storing a management table for managing the identification information of the record; a receiving means for receiving a write command including a record and identification information of the record from an external device; a determination means for determining whether or not identification information matching the identification information included in the write command is registered in an element of the management table; a processing means for writing a record included in the write command to a record storage area in place of a record stored in the record storage area corresponding to the element of the management table when the determining means determines that identification information matching the identification information included in the write command is registered in the element of the management table; An IC chip comprising:

13. An IC chip having a memory having a plurality of record storage areas for writing records, a storage means for storing a management table for managing the identification information of the record; a receiving means for receiving a write command including a record and identification information of the record from an external device; a determination means for determining whether or not identification information matching the identification information included in the write command is registered in an element of the management table; a processing means for transmitting a response indicating an error to the external device without writing the record included in the write command to the record storage area when the determining means determines that identification information matching the identification information included in the write command is registered in an element of the management table; An IC chip comprising:

14. An IC chip having a memory with a plurality of record storage areas for writing records that are logically stored in a file used by an application, comprising: a receiving means for receiving from an external device a record and a write command including a value obtained by combining a record number of the record and an identifier of a file in which the record is to be stored; a processing means for writing a record included in the write command into a first area of ​​any one of the plurality of record storage areas, and for writing a value obtained by combining the record number and the identifier included in the write command into a second area of ​​the record storage area into which the record is written; An IC chip comprising:

15. 1. A record processing method executed by an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising: A step of retaining a management table for managing identification information of the records; receiving a write command including a record and identification information of the record from an external device; determining whether or not identification information that matches identification information included in the write command is registered in an element of the management table; when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, writing the record included in the write command to the record storage area in place of the record stored in the record storage area associated with the element of the management table; 13. A method for processing records, comprising:

16. 1. A record processing method executed by an electronic information storage medium having a memory having a plurality of record storage areas for writing records, comprising: A step of retaining a management table for managing identification information of the records; receiving a write command including a record and identification information of the record from an external device; determining whether or not identification information that matches identification information included in the write command is registered in an element of the management table; when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, transmitting a response indicating an error to the external device without writing the record included in the write command to the record storage area; 13. A method for processing records, comprising:

17. A method of record processing performed by an electronic information storage medium having a memory having a plurality of record storage areas for writing records to be logically stored in a file used by an application, comprising: receiving a write command including a record from an external device and a value obtained by combining a record number of the record and an identifier of a file in which the record is to be stored; writing a record included in the write command to a first area of ​​any one of the plurality of record storage areas, and writing a value obtained by combining the record number and the identifier included in the write command to a second area of ​​the record storage area to which the record is written; 13. A method for processing records, comprising:

18. A computer included in an electronic information storage medium having a memory having a plurality of record storage areas for writing records, A step of retaining a management table for managing identification information of the records; receiving a write command including a record and identification information of the record from an external device; determining whether or not identification information that matches identification information included in the write command is registered in an element of the management table; when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, writing the record included in the write command to the record storage area in place of the record stored in the record storage area associated with the element of the management table; A program characterized by executing the above.

19. A computer included in an electronic information storage medium having a memory having a plurality of record storage areas for writing records, A step of retaining a management table for managing identification information of the records; receiving a write command including a record and identification information of the record from an external device; determining whether or not identification information that matches identification information included in the write command is registered in an element of the management table; when it is determined that identification information matching the identification information included in the write command is registered in an element of the management table, transmitting a response indicating an error to the external device without writing the record included in the write command to the record storage area; A program characterized by executing the above.

20. A computer including an electronic information storage medium having a memory having a plurality of record storage areas for writing records that are logically stored in a file used by an application, comprising: receiving a write command including a record from an external device and a value obtained by combining a record number of the record and an identifier of a file in which the record is to be stored; writing a record included in the write command to a first area of ​​any one of the plurality of record storage areas, and writing a value obtained by combining the record number and the identifier included in the write command to a second area of ​​the record storage area to which the record is written; A program characterized by executing the above.

Citation Information

Patent Citations

  • Portable electronic device

    JP1989284993A

  • Portable electronic device

    JP2001167236A

  • Mobile electronic apparatus and data management method in mobile electronic apparatus

    JP2010182270A

  • IC card, IC module, issuing device, issuing method, and issuing program

    JP6556489B2