Electronic information storage medium, IC chip, record processing method, and program
The IC chip uses a management table for record identification to allow flexible record issuance and handle overlaps, simplifying the process and managing records efficiently.
Patent Information
- Application Number
- JP2024018300
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-02-09
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2044-02-09
AI Technical Summary
Conventional IC chips require sequential record writing and matching record numbers with publishing order, leading to time-consuming processes and issues with overlapping records during restarts.
An IC chip with a management table for record identification information, allowing records to be written in any order and handling overlapping records by overwriting or sending error responses.
Enables record issuance in any order without knowing record numbers, reducing design complexity and efficiently managing overlapping records.
Smart Images

Figure 2025122710000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to the technical field of IC (Integrated Circuit) chips and the like that can write multiple records from an external device. [Background technology]
[0002] Conventionally, as disclosed in Patent Document 1, for example, 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 a process for sequentially writing the plurality of records from the issuing device is executed in the IC chip. [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 conventional IC chips, the record publishing process sometimes required matching the record number of each record with the publishing order (write order) of the records. For example, the Append Record command defined in the JICSAP specification appends a record to a file specified by a parameter, and the record numbers of the appended records are assigned in the publishing order. This required IC chip issuers to design the execution order of write commands with the final record configuration in mind, which was time-consuming. Furthermore, if the publishing device were to stop for some reason during the record publishing process and then restart, the IC chip would have to redo the process of sequentially writing multiple records from the publishing device. In this case, records that overlap with records already written to the IC chip would be sent from the publishing device to the IC chip by the write command, and the IC chip would need to take appropriate measures.
[0005] Therefore, the present invention aims to provide an electronic information storage medium, an IC chip, a record writing method, and a program that allow an issuer to issue records in any order without being aware of record numbers, and also to provide an electronic information storage medium, an IC chip, a record processing method, and a program that allow 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 an 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 with a plurality of record storage areas for writing records, characterized in that it comprises: a storage means for storing 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 the element of the management table.
[0007] The invention described in claim 2 is an electronic information storage medium having a memory with a plurality of record storage areas for writing records, characterized in that it comprises: a storage means for storing 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, 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, sending a response indicating an error to the external device 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 plurality of record storage areas to which the record has not been written, and registers the identification information included in the write command in an element of the management table associated with that 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 the 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 storage area corresponding to the searched element of the management table, and transmits a response including the read record to the external device.
[0010] The invention described in claim 5 is an electronic information storage medium having a memory with a plurality of record storage areas for writing records, characterized in that it comprises: 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 to a first area of one of the plurality of record storage areas, and for writing the identification information included in the write command to a second area of the record storage area to which the record is written.
[0011] The invention described in claim 6 is characterized in that, in the electronic information storage medium described in claim 5, it further comprises a judgment means for judging whether identification information matching the identification information included in the write command is stored in the second area of any of the record storage areas, and when the judgment means judges 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.
[0012] The invention described in claim 7 is characterized in that, in the electronic information storage medium described in claim 5, it further comprises a judgment means for judging whether identification information matching the identification information included in the write command is stored in the second area of any of the record storage areas, and when the judgment means judges 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 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 characterized in that, in the electronic information storage medium described in claim 6, 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 the first area of the searched record storage area, and writes the identification information included in the write command to the second area of the record storage area in which the record is 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 the first area of the searched record storage area, and writes the identification information included in the write command to the second area of the record storage area in which the record is 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 characterized in that, in the electronic information storage medium described in any one of claims 5 to 9, the receiving means receives a read command including identification information of the record to be read from the external device, and the processing means searches the record storage area in which identification information matching the identification information included in the read command is stored, reads the record from the searched record storage area, and transmits a response including the read record to the external device.
[0017] The invention described in claim 12 is an IC chip having a memory with a plurality of record storage areas for writing records, characterized in that it comprises: 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 determining 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 determining 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 with a plurality of record storage areas for writing records, characterized in that it comprises: 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 determining 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, 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, sending a response indicating an error to the external device without writing the record included in the write command to the record storage area.
[0019] The invention described in claim 14 is an IC chip having a memory with a plurality of record storage areas for writing records, characterized in that it comprises: 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 to a first area of one of the plurality of record storage areas, and for writing the identification information included in the write command to a second area of the record storage area to which the record is written.
[0020] The invention described in claim 15 is a record processing method executed by an electronic information storage medium having a memory with a plurality of record storage areas for writing records, characterized in that it includes 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 associated with 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 with 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 management table including a record and the record's identification information; 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, transmitting 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 a record processing method executed by an electronic information storage medium having a memory with multiple record storage areas for writing records, characterized in that it includes the steps of receiving a write command including a record and identification information for the record from an external device, writing the record included in the write command to a first area of one of the multiple 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.
[0023] The invention described in claim 18 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 steps of: 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, 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 associated with 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 steps of: 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 characterized in that a computer included in an electronic information storage medium having a memory with multiple record storage areas for writing records executes the steps of receiving a write command including a record and identification information for the record from an external device, writing the record included in the write command to a first area of one of the multiple 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. [Effects of the Invention]
[0026] According to the present invention, a publisher can issue records in any order without being concerned about record numbers. [Brief explanation of the drawings]
[0027] [Figure 1] 1 is a diagram illustrating an example of a hardware configuration of an IC chip 1. FIG. [Figure 2] FIG. 10 is a conceptual diagram showing an example of an array of Record classes in a record body. [Figure 3] FIG. 10 is a conceptual diagram illustrating an example of the correspondence between a Record class and elements of a management table. [Figure 4] FIG. 10 is a conceptual diagram illustrating an example of an array of a Record class that stores records and identification information of the records. [Figure 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 between a Record class and elements of a management table when a new record is written in the issuing process shown in FIG. 5. FIG. [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] 10 is a flowchart showing an example of a read process executed by a CPU 15 of an IC chip 1 according to a second embodiment. DETAILED DESCRIPTION OF THE INVENTION
[0028] Hereinafter, embodiments 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 on 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 illustrating an example of the 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. Communication between the IC chip 1 and the external device 2 may be contactless or contactless. In the case of contactless communication, the communication between the IC chip 1 and the external device 2 is performed via an antenna (not shown) mounted on an IC card or a mobile device, for example. 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] The NVM 13 may be, for example, a flash memory. The NVM 13 may be an "Electrically Erasable Programmable Read-Only Memory." The NVM 13 or the ROM 14 stores various programs (including the program of the present invention), such as an OS (Operating System) and one or more applications. The NVM 13 has a record body for writing (saving) records. Here, a record refers to data logically stored (in other words, logically organized) in a file (e.g., an EF (Elementary File)) used by an application. Examples of records include configuration 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 a Short File Identifier (SFI), which is a file identifier. Each record is assigned a record number (i.e., a logical number in the file), which is an example of record identification information. 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 a single record. For example, each time a new record is published, an instance of the Record class is created and added to an empty element (i.e., the Record class) in 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 in 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 existing implementations, when a record publishing 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 they were written. For example, record numbers are assigned sequentially in the order the records were written: 1 → 2 → 3. Therefore, 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 record numbers of records stored in a Record class is stored in a storage area separate from the record bodies. That is, in this embodiment, the IC chip 1 has a management table as a data structure for managing the record numbers of the records, separate from the record bodies that actually store the contents of the records. Elements of the management table are associated with each Record class. 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 Tables [0] to [3]. Also, in the example of FIG. 3, a value combining an SFI and a 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, record identification information may be managed without using the management table. In this case, each Record class is provided with a first area for storing records and a second area for storing the identification information of the record. In other words, by including record identification information as meta-information in the array of Record classes, the issuer of the IC chip 1 can issue records in any order without being aware of the record number, even without implementing the management table. FIG. 4 is a conceptual diagram showing an example of an array of Record classes that stores records and their identification information (in this example, a value combining the SFI and the record number). In the example of FIG. 4, the first two bytes of each Record class are allocated as the second area (i.e., the record itself is stored following its identification information). In the example of FIG. 4, the second area of Record[0] stores SFI “2” and record number “1” (i.e., 0201(h) is stored), and the first area of Record[0] stores the record (0000...) identified by SFI “2” and record number “1.” On the other hand, the second area of Record[1] stores SFI "2" and record number "5", and the first area of Record[1] stores the 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, the 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) executes the OS, applications, and the like stored in the NVM 13, thereby functioning as the storage means, receiving means, determining means, processing means, and the like of the present invention. The CPU 15 may or may not store the above-mentioned management table using the NVM 13. The CPU 15 also receives command APDUs (Application Protocol Data Units) specified in ISO / IEC 7816, for example, from the external device 2 via the I / O circuit 11. Examples of command APDUs include an issue command (an example of a write command) such as an Append Record command received from an issuer in a manufacturing plant for the IC chip 1, and a read command such as a READ RECORD command received from a transaction device in a store after the IC chip 1 is shipped.
[0036] Here, the issue command and read command each consist of a header section made up of CLA, INS, P1, and P2, and a body section. CLA indicates the command class (instruction class), and INS indicates the command code (instruction code). INS identifies the type of command. P1 and P2 indicate command parameters (instruction parameters). The data section of the issue command includes a record as the issue data, the record number of that record, and the SFI of the file that logically stores that 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 that record. The record number and SFI may be included in P1 or P2.
[0037] When a management table is used and an issue command is received from the external device 2, the CPU 15 writes the record included in the issue command to one of a plurality of Record classes in accordance with 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. If 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, the CPU 15 may search (search) for a Record class to which no record has been written (empty element) based on the arrangement 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, if the CPU 15 determines that identification information matching the identification information included in the issued command is registered in an element of the management table, it writes the record included in the issued command to the Record class associated with the element of the management table instead of the record stored in the Record class associated with the element of the management table (for example, overwrites and saves). This makes it possible to appropriately handle a case where a record that overlaps with an already written record is transmitted from the external device 2. If the CPU 15 determines that identification information matching the identification information included in the issued command is registered in an element of the management table, it may write the record included in the issued command to the Record class instead of the record stored in the Record class associated with the element of the management table, and may register the identification information included in the issued command to the element of the management table instead of the identification information registered in the element of the management table associated with the Record class (that is, overwrite and record with the same identification information). Alternatively, if the CPU 15 determines that identification information matching the identification information included in the issued command is registered in an element of the management table, it may send a response indicating an error to the external device 2 without writing the record included in the issued command to 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 status words (SW1, SW2) indicating an error.
[0039] When a management table is used and 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. This response APDU includes status words (SW1, SW2) indicating normal completion.
[0040] On the other hand, when a 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 a 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 a second area of the Record class to which the record is to be 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 of the Record classes. If 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 of the Record classes, the CPU 15 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 to be written.
[0041] On the other hand, if the CPU 15 determines that identification information matching the identification information included in the issue command is stored in the second area of any Record class, it writes the record included in the issue command to the first area instead of the record stored in the first area of that Record class. This makes it possible to appropriately handle the case where a record that overlaps with a record already written is transmitted from the external device 2. If the CPU 15 determines that identification information matching the identification information included in the issue command is stored in the second area of any Record class, it may write the record included in the issue command to the first area instead of the record stored in the first area of that Record class, and write the identification information included in the issue command to the second area instead of the identification information stored in the second area of that Record class (i.e., overwrite and save with the same identification information). Alternatively, if the CPU 15 determines that identification information matching the identification information included in the issue command is stored in the second area of any Record class, it may send a response indicating an error to the external device 2, as described above, without writing the record included in the issue command to the Record class. This also makes it possible to appropriately handle the case where a record that overlaps with an already written record is sent from the external device 2.
[0042] Then, when a 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 in two separate examples: 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 issuance 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 issuance 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 at 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 Figure 5 begins. The issuing process shown in Figure 5 is repeatedly executed until writing of all records necessary for application operation is completed. In other words, IC chip 1 receives multiple issuing commands sequentially. 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 from the issued command a record, the record number of the record, and the SFI of the file that stores the record (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 identification information that matches the record number and SFI acquired in step S1 is 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 identification information that matches the record number and SFI acquired in step S1 is 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 (i.e., a Record class to which no record has been written) in the array of Record classes, starting 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 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 acquired in step S1 is registered. Next, the CPU 15 executes a process to write the record acquired in step S1 to the Record class identified in step S5 (step S6), and proceeds to step S7. In this process, the record acquired 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 a write error occurred in the processing 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 processing shown in Fig. 5 ends. On the other hand, if it is determined that a write error did not occur (step S7: NO), the processing 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 for 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 data has already been written, the value obtained by combining the SFI and record number obtained in step S1 in the 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 completion 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 the 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 and the SFI of the file that stores the record from the read command (step S21).
[0053] Next, CPU 15 searches for an element in the management table in which identification information matching the record number and SFI acquired in step S21 is registered (step S22). Then, CPU 15 identifies a Record class associated with the element in the management table searched (i.e., identified by the search) in step S22 (step S23). Next, CPU 15 executes a process to read 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 completion 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 is configured to hold a management table for managing record numbers of records, and upon receiving an issue command including a record and the record number of the record from the external device 2, write the record included in the issue command to one of a plurality of Record classes and register the record number of the record in an element of the management table associated with the Record class. This allows the issuer to issue records in any order without being aware of the record numbers. For example, the brand providing the credit card payment application may specify the order in which each record is written. In conventional IC chips, record numbers are assigned sequentially in the order in which the records are written. This required the issuer of the IC chip to design (e.g., 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, the elements of the management table are associated with Record classes to manage record identification information, thereby reducing the effort required to design the execution order of each issue command in the record issuance process as in the conventional method.
[0055] Furthermore, according to the above-mentioned Example 1, when identification information matching the identification information included in the received issuance command is already registered in an element of the management table, the IC chip 1 is configured to write 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 to send a response indicating an error to the external device 2 without writing the record included in the issuance command to the Record class. Therefore, even when a record that overlaps with a record that has already been written is sent from the external device 2, appropriate action can be taken.
[0056] Example 2 Next, the operation of the IC chip 1 according to the second embodiment will be described with reference to Fig. 8 and Fig. 9. Fig. 8 is a flowchart showing an example of an issuance 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 read process executed by the CPU 15 of the IC chip 1 according to the second embodiment. The process shown in Fig. 8, similar to the process shown in Fig. 5, is started when the IC chip 1 receives an issuance command from an issuing device, which is an external device 2, in a record issuance process at a manufacturing factory for the IC chip 1, for example. Note that the issuance process shown in Fig. 8, similar to the process shown in Fig. 5, is repeatedly executed until writing of all records required for the operation of the application is completed.
[0057] 8 starts, the CPU 15 acquires from the issued command a record, the record number of the record, and the SFI of the file storing the record (step S31). Next, the CPU 15 determines whether or not identification information (i.e., a value 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 determined 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 determined 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 (i.e., a Record class to which no record has been written) in the array of Record class from the beginning. Then, CPU 15 executes a process to write the record acquired in step S31 to the first area of the Record class, which is an empty element found by the search in step S33 (step S34), and proceeds to step S37.
[0059] In step S35, the CPU 15 identifies a Record class that stores identification information that matches the record number and SFI acquired in step S31. 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 a write error occurred in the processing 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 processing shown in Fig. 8 ends. On the other hand, if it is determined that a write error did not occur (step S37: NO), the processing 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 for the record. When a record is overwritten in an already written Record class, the value obtained by combining the SFI and record number obtained in step S31 may be overwritten in the second area of the Record class, 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 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 the 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 and the SFI of the file that stores the record from the read command (step S41).
[0063] Next, CPU 15 searches for a Record class that stores identification information that matches the record number and SFI acquired in step S41 (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 indicating normal completion, including the record read in step S43, to the transaction device, which is the external device 2 (step S44), and ends 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 is configured to write the record included in the issue command to the first area of one of a plurality of Record classes and to write the record number of the record to the second area of the Record class. This allows the issuer to issue records in any order without being aware of the record numbers. For example, as in the first embodiment, in conventional IC chips, record numbers are assigned sequentially in the order in which the records are written, so that the issuer of the IC chip had 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 records stored in the first area of the Record class is managed in the second area of the Record class. This reduces the effort required to design the execution order of each issue command in the record issue process as in the conventional method.
[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 either 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, thereby making it possible to appropriately deal with the situation even when 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 records; 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 that matches the identification information included in the write command is registered in an element of the management table; a processing means for writing, 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, the record included in the write command into the record storage area in place of the record stored in the record storage area associated with 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 records; 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 that matches 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 to 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 that 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 described in 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 storage area corresponding to the searched element of the management table, and sends a response including the read record to the external device.
5. 1. An electronic information storage medium comprising 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; An electronic information storage medium comprising:
6. a determination unit that determines whether or not identification information that matches the identification information included in the write command is stored in a second area of any of the record storage areas, The electronic information storage medium described in claim 5, 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 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. a determination unit that determines whether or not identification information that matches the identification information included in the write command is stored in a second area of any of the record storage areas, The electronic information storage medium described in claim 5, 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.
8. The electronic information storage medium described in claim 6, 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 the first area of the searched record storage area, and writes the identification information included in the write command to the second area of the record storage area in which the record is 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 the first area of the searched record storage area, and writes the identification information included in the write command to the second area of the record storage area in which the record is written.
10. the receiving means sequentially receives the plurality of 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 identification information of a record to be read from the external device; The electronic information storage medium of any one of claims 5 to 9, characterized in that the processing means searches the record storage area in which identification information matching the identification information included in the read command is stored, reads the record from the searched record storage area, and sends 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 records; 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 that matches the identification information included in the write command is registered in an element of the management table; a processing means for writing, 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, the record included in the write command into the record storage area in place of the record stored in the record storage area associated with 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 records; 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 that matches 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 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; An IC chip comprising:
15. 1. A record processing method executed by an electronic information storage medium having a memory with a plurality of record storage areas for writing records, comprising: a step of retaining a management table for managing the identification information of the records; receiving a write command from an external device, the write command including a record and identification information of the record; determining whether or not identification information that matches the 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 into the record storage area in place of the record stored in the record storage area associated with the element of the management table; 10. A record processing method comprising:
16. 1. A record processing method executed by an electronic information storage medium having a memory with a plurality of record storage areas for writing records, comprising: a step of retaining a management table for managing the identification information of the records; receiving a write command from an external device, the write command including a record and identification information of the record; determining whether or not identification information that matches the 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; 10. A record processing method comprising:
17. 1. A record processing method executed by an electronic information storage medium having a memory with a plurality of record storage areas for writing records, comprising: receiving a write command from an external device, the write command including a record and identification information of the record; writing a record included in the write command to a first area of one of the plurality of record storage areas, and writing identification information included in the write command to a second area of the record storage area to which the record is written; 10. A record processing method comprising:
18. a computer included in an electronic information storage medium having a memory with a plurality of record storage areas for writing records, a step of retaining a management table for managing the identification information of the records; receiving a write command from an external device, the write command including a record and identification information of the record; determining whether or not identification information that matches the 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 into 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 following.
19. a computer included in an electronic information storage medium having a memory with a plurality of record storage areas for writing records, a step of retaining a management table for managing the identification information of the records; receiving a write command from an external device, the write command including a record and identification information of the record; determining whether or not identification information that matches the 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 following.
20. a computer included in an electronic information storage medium having a memory with a plurality of record storage areas for writing records, receiving a write command from an external device, the write command including a record and identification information of the record; writing a record included in the write command to a first area of one of the plurality of record storage areas, and writing identification information 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 following.
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