Electronic information storage medium, patch program writing method, and program
The method of using separate storage areas with initial and standby states for patch programs and tables in secure elements addresses the challenge of interrupted writing, ensuring normal operation and recovery.
Patent Information
- Application Number
- JP2021001439
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-01-07
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2041-01-07
AI Technical Summary
Embedded secure elements like eUICC face challenges in recovering from interrupted patch program writing due to unexpected noise or power outages.
A method involving separate storage areas for patch programs and tables, with initial and standby states, ensuring normal recovery by resetting and initializing these areas upon command after interruptions.
Ensures normal operation and recovery of secure elements even if patch program writing is interrupted by noise or power outages.
Smart Images

Figure 0007563181000001 
Figure 0007563181000002 
Figure 0007563181000003
Abstract
Description
[Technical field]
[0001] The present invention relates to a technique such as a method for applying a patch program to an application program stored in an electronic information storage medium such as a secure element. [Background technology]
[0002] Conventionally, a known method for applying a patch program to an application program is a technique that uses a patch table in which the call address of a patch program is stored in association with the call address of a function. For example, the technique disclosed in Patent Document 1 is configured to generate an interrupt when a function is called, and to call the patch program using the call address of the patch program associated with the call address of the called function. Such a patch program can be applied to an application program by being written to an IC card in a factory, for example. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2010-134644 A Summary of the Invention [Problem to be solved by the invention]
[0004] Incidentally, in an embedded secure element such as an eUICC (Embedded Universal Integrated Circuit Card), patch programs may be written online (e.g., OTA) during operation to correct defects or change functions. In such cases, it is required that the secure element be able to recover even if writing of the patch program is interrupted by unexpected noise or power outage.
[0005] Therefore, the present invention has been made in consideration of the above points, and has an objective of providing an electronic information storage medium, a patch program writing method, and a program that can restore normal operation even if the writing of a patch program is interrupted by unexpected noise or a power outage. [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 first memory area for storing an application program, a second memory area for storing a patch program to be applied to the application program, a third memory area for storing a patch table to be referenced when the patch program is called, and a fourth memory area for storing a patch table that is not referenced when the patch program is called, characterized in that it comprises a setting means for setting states of the patch program and the patch table to an initial state before writing the patch program and the patch table transmitted from an external terminal to the memory, and then setting the state to a standby state after writing of the patch program to the second memory area and writing of the patch table to the fourth memory area are completed, and a writing means for initializing the third memory area and the fourth memory area when the state is the initial state when a command is received from an external terminal after resetting the electronic information storage medium, and writing the patch table from the fourth memory area to the third memory area when the state is the standby state.
[0007] The invention described in claim 2 is characterized in that, in the electronic information storage medium described in claim 1, the setting means sets the state to the normal state when the third memory area and the fourth memory area are initialized, or when the patch table is written from the fourth memory area to the third memory area.
[0008] The invention described in claim 3 is characterized in that, in the electronic information storage medium described in claim 1 or 2, the setting means sets the state to an initial state before the patch table is written from the fourth memory area to the third memory area when the state is a standby state.
[0009] The invention described in claim 4 is characterized in that, in the electronic information storage medium described in claim 2 or 3, it further comprises a control means which, when a command is received from an external terminal after the reset, verifies the patch program and the patch table if the state is normal, and executes processing according to the command if the verification is successful.
[0010] The invention described in claim 5 is characterized in that, in the electronic information storage medium described in any one of claims 1 to 4, when the patch program is written to the second memory area, the writing means writes version data transmitted from the external terminal, which indicates the version of the patch program, into a specified memory area in the memory, and further includes a transmitting means which reads the version data from the specified memory area and transmits it to the external terminal in response to a request from the external terminal.
[0011] The invention described in claim 6 is a method for writing a patch program executed by an electronic information storage medium having a memory having a first memory area for storing an application program, a second memory area for storing a patch program to be applied to the application program, a third memory area for storing a patch table to be referenced when the patch program is called, and a fourth memory area for storing a patch table that is not referenced when the patch program is called, the method including the steps of: setting states of the patch program and the patch table transmitted from an external terminal to an initial state before writing the patch program and the patch table to the memory, and then setting the state to a standby state after writing of the patch program to the second memory area and writing of the patch table to the fourth memory area are completed; and when a command is received from an external terminal after resetting the electronic information storage medium, initializing the third memory area and the fourth memory area if the state is the initial state, while writing the patch table from the fourth memory area to the third memory area if the state is the standby state.
[0012] The invention described in claim 7 is characterized in that a computer included in an electronic information storage medium having a memory having a first memory area for storing an application program, a second memory area for storing a patch program to be applied to the application program, a third memory area for storing a patch table to be referenced when the patch program is called, and a fourth memory area for storing a patch table that is not referenced when the patch program is called, is made to function as a setting means for setting states of the patch program and the patch table transmitted from an external terminal to an initial state before writing the patch program and the patch table to the memory, and then setting the state to a standby state after writing of the patch program to the second memory area and writing of the patch table to the fourth memory area are completed, and a writing means for initializing the third memory area and the fourth memory area when the state is the initial state when a command is received from an external terminal after resetting the electronic information storage medium, and for writing the patch table from the fourth memory area to the third memory area when the state is the standby state. Effect of the Invention
[0013] According to the present invention, even if writing of a patch program is interrupted by unexpected noise, a power outage, or the like, it can be restored to normal. [Brief description of the drawings]
[0014] [Figure 1] FIG. 2 is a diagram illustrating an example of a schematic configuration of an SE1. [Diagram 2] FIG. 2 is a diagram illustrating an example of a memory map of NVM12. [Diagram 3] 2 is a conceptual diagram showing an initial state, a standby state, and a normal state managed by an OS. [Figure 4] FIG. 13 illustrates an example of transition of a patch state. [Diagram 5] 11 is a sequence diagram showing an example of communication between an SE 1 and an external terminal 2 when a patch program and a patch table are downloaded. FIG. [Figure 6] 13 is a flowchart showing a process of the SE1 when the SE1 is reset. [Figure 7] 11 is a sequence diagram showing an example of communication between an SE 1 and an external terminal 2 when checking the version of a patch program. FIG. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0015] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings. The embodiment described below is an embodiment in which the present invention is applied to a secure element (hereinafter, referred to as "SE").
[0016] [1. SE1 configuration and functions] First, the configuration and functions of the SE1 according to the present embodiment will be described with reference to FIG. 1. FIG. 1 is a diagram showing an example of a schematic configuration of the SE1. The SE1 is an example of an electronic information storage medium of the present invention. As shown in FIG. 1, the SE1 is configured to include a CPU (Central Processing Unit) 10, a RAM (Random Access Memory) 11, an NVM (Nonvolatile Memory) 12 (nonvolatile memory), and an I / O circuit 13 (ROM may also be included). The SE1 is used by being mounted on various cards (e.g., credit cards and debit cards) or terminals such as smartphones. The SE1 may be mounted on the terminal as a small, detachable IC card, 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 terminal (i.e., formed integrally with the terminal).
[0017] The I / O circuit 13 is responsible for the interface with the external terminal 2. Examples of the external terminal 2 include a host (computer) that provides a patch program described later, and a device that uses the functions of the SE1 (for example, a communication partner of the various cards described above and a controller of the terminal described above). Examples of interfaces include SPI (Serial Peripheral Interface), I 2 C (Inter-Integrated Circuit), and ISO7816 interfaces. The communication between the SE1 and the external terminal 2 may be performed directly, or indirectly via a wireless communication unit of the terminal. In the latter case, protocol conversion is performed by the wireless communication unit of the terminal. Note that it is preferable that the communication between the SE1 and the host is performed through a secure channel established by executing mutual authentication.
[0018] Furthermore, a command (command APDU) transmitted from the external terminal 2 is received via the I / O circuit 13. The received command is configured with an APDU (Application Protocol Data Unit) including at least a header (consisting of CLA (command class), INS (command code), P1 and P2 (parameters)). Furthermore, in addition to the above-mentioned header, the command may also include a body having a program (e.g., a patch program) and data (e.g., a patch table). A response to the command (response APDU) is transmitted to the external terminal 2 via the I / O circuit 13. Here, the response is configured with at least SW (status word) indicating the processing result, and may also include data.
[0019] The CPU 10 is a processor (computer) that executes various programs stored in the NVM 12. The RAM 11 is used as a working memory, and has, for example, a stack area having a last-in, first-out structure. For example, local variables, arguments, return values, etc. are written in the stack area on a frame-by-frame basis, and are then retrieved on a frame-by-frame basis. The stack area may be provided in the NVM 12. The NVM 12 is an example of a storage unit, and for example, a flash memory is applied. The NVM 12 may be an "Electrically Erasable Programmable Read-Only Memory". Various programs (including the program of the present invention) are stored in advance (for example, stored before shipment of the SE1) in the NVM 12. The various programs include an operating system (hereinafter referred to as "OS"), an application program (hereinafter referred to as "application"), etc. The OS or application is an example of a setting means, a writing means, a control means, and a transmission means in the present invention.
[0020] Furthermore, a patch program to be applied to an application is written later (for example, written during operation after shipment of the SE1) into the NVM 12. The patch program can correct defects in the application or change or add functions. Such functions include, for example, an encryption calculation function and a biometric authentication function (for example, fingerprint authentication or palm print authentication). Furthermore, a patch table that is referenced when the patch program is called is written later into the NVM 12. The call address of the patch program is stored in the patch table. For example, the call address of the patch program is stored in association with the call address of a function called by the application.
[0021] 2 is a diagram showing an example of a memory map of the NVM 12. In the example of FIG. 2, the NVM 12 has a program storage area 121 (an example of a first storage area), a patch storage area 122 (an example of a second storage area), a first table storage area 123 (an example of a third storage area), a second table storage area 124 (an example of a fourth storage area), and a data storage area 125. The program storage area 121 is an area for storing an OS and an application. The patch storage area 122 is an area for storing a patch program. A patch program transmitted (downloaded) from the external terminal 2 is written to the patch storage area 122.
[0022] The first table storage area 123 is an area for storing a patch table that is referred to by the OS when a patch program is called (when an application is running). The second table storage area 124 is an area for storing a patch table that is not referred to by the OS when a patch program is called. However, in a normal state described later, the same patch table is stored in the first table storage area 123 and the second table storage area 124. A patch table transmitted from the external terminal 2 is not written to the first table storage area 123, but is first written to the second table storage area 124. Thereafter, the patch table stored in the second table storage area 124 is written to the first table storage area 123. That is, the patch table is copied from the second table storage area 124 to the first table storage area 123.
[0023] The data storage area 125 stores authentication data used in authentication processing for establishing a secure channel, and version data indicating the version of the patch program stored in the patch storage area 122. The version data may be stored in the first table storage area 123 and the second table storage area 124. The data storage area 125 is an area for storing various data.
[0024] The OS manages the states of the patch programs and patch tables in SE1 (hereinafter referred to as "patch states") in three states: "initial state", "standby state", and "normal state". Figures 3(A) to 3(D) are conceptual diagrams showing the initial state, standby state, and normal state managed by the OS. Figure 4 is a diagram showing an example of transition of the patch state. The patch state transitions as shown by the arrows in Figure 4.
[0025] The initial state is a state in which the first table storage area 123 and the second table storage area 124 are in when the SE1 is shipped. In the initial state, as shown in FIG. 3A, the patch tables stored in the first table storage area 123 and the second table storage area 124 are indefinite. Here, the indefinite value means a value that is not determined whether it can be normally used as a patch table, and the value may be corrupted (in other words, the patch table may be corrupted). Therefore, in the initial state, regardless of whether the patch table is stored in the first table storage area 123, the OS performs processing by determining that the patch table is not stored in the first table storage area 123. For example, if a corrupted patch table is referenced and a patch program is called, there is a possibility that the SE1 becomes inoperable and cannot be restored (returned). Therefore, in the initial state, the first table storage area 123 is not referenced by the OS.
[0026] The standby state is a state in which a patch table transmitted from the external terminal 2 has been written to the second table storage area 124, but the patch table has not yet been written to the first table storage area 123. In the standby state, as shown in FIG. 3B, the patch table stored in the second table storage area 124 has a normal value, but the patch table stored in the first table storage area 123 has an initial value. Here, the normal value means a value that can be normally used as a patch table, and the value indicates the call address of a patch program. On the other hand, the initial value is a value that the OS can determine is not the call address of a patch program. In other words, the initial value is a value that indicates that a patch program has not been assigned. Therefore, in the standby state, the first table storage area 123 is referenced by the OS, but the patch program is not called.
[0027] The normal state is a state in which the OS can refer to the patch table in the first table storage area 123 when a patch program is called. In the normal state, there are states in which a patch program is not applied to an application and states in which a patch program is applied to an application. Here, the state in which a patch program is not applied to an application is a state in which a patch program is not written and initial values are written (that is, initialized) in the first table storage area 123 and the second table storage area 124, as shown in FIG. 3(C). On the other hand, the state in which a patch program is applied to an application is a state in which a patch program and a patch table are written and then copied from the second table storage area 124 to the first table storage area 123, as shown in FIG. 3(D), and the patch table (normal value) in the first table storage area 123 is referred to by the OS, making it possible to call the patch program.
[0028] In the above configuration, the SE1 sets the patch state to the initial state before writing the patch program and the patch table transmitted from the external terminal 2 to the NVM 12. This makes it possible to prevent the SE1 from becoming inoperable and being unable to recover even if the patch table is damaged due to unexpected noise or power outage during subsequent processing. After the patch state is set to the initial state, the SE1 sets the patch state to the standby state after writing of the patch program to the patch storage area 122 and writing of the patch table to the second table storage area 124 are completed. Then, when a command is received from the external terminal 2 after resetting the SE1, if the patch state is the initial state, the SE1 initializes the first table storage area 123 and the second table storage area 124. In this way, when the first table storage area 123 and the second table storage area 124 are initialized, the patch state is set to the normal state.
[0029] On the other hand, when a command is received from the external terminal 2 after the SE1 is reset, if the patch state is a standby state, the SE1 writes (copies) the patch table from the second table storage area 124 to the first table storage area 123. Here, it is preferable that the patch state is set to the initial state before the patch table is written from the second table storage area 124 to the first table storage area 123. This makes it possible to prevent the SE1 from becoming inoperable and being unable to be restored even if the patch table is damaged, for example, due to unexpected noise or power outage during subsequent processing. In this way, when the patch table is written from the second table storage area 124 to the first table storage area 123, the patch state is set to the normal state.
[0030] On the other hand, when a command is received from the external terminal 2 after the SE1 is reset, if the patch state is normal, the SE1 verifies the patch program and the patch table, and if the verification is successful, causes the application to execute processing according to the command. Note that if the patch state is normal, the patch table is unlikely to be damaged, so processing according to the command may be executed without verifying the patch program and the patch table.
[0031] In addition, when the patch program transmitted from the external terminal 2 is written to the patch memory area 122 (for example, immediately before or immediately after writing the patch program), SE1 writes the version data transmitted from the external terminal 2, which indicates the version of the patch program, to a specified memory area in NVM12 (for example, the data memory area 125 or the second table memory area 124), and in response to a request from the external terminal 2, reads out the version data from the specified memory area and transmits it to the external terminal 2.
[0032] [2. SE1 Operation] (2.1. Downloading patch programs and patch tables) Next, the operation when downloading the patch program and the patch table will be described with reference to Fig. 5. Fig. 5 is a sequence diagram showing an example of the exchange between the SE1 and the external terminal 2 when downloading the patch program and the patch table. In Fig. 5, the external terminal 2 transmits a SELECT command to the SE1 to select an application to which the patch program is to be written (step S1). Upon receiving the SELECT command, the SE1 (OS) selects the application specified by the SELECT command (step S2) and transmits a response including a successful completion (SW:9000) and FCI (File Control Information) to the external terminal 2 (step S3).
[0033] Next, when the external terminal 2 receives a response from the SE1, it starts mutual authentication with the SE1 (step S4). When such mutual authentication starts, the external terminal 2 sends an INITALIZE UPDATE command to the SE1. When the SE1 receives the INITALIZE UPDATE command from the external terminal 2, it generates a session key and sends a response including authentication data to the external terminal 2. When the external terminal 2 receives a response from the SE1, it generates a session key and verifies the authenticity of the SE1. Then, when the external terminal 2 succeeds in verifying the authenticity of the SE1, it sends an EXTERNAL AUTHENTICATE command including authentication data to the SE1. When the SE1 receives the EXTERNAL AUTHENTICATE command from the external terminal 2, it verifies the authenticity of the external terminal 2. Then, when the SE1 succeeds in verifying the authenticity of the external terminal 2, it sends a response indicating successful authentication to the external terminal 2. This ends the mutual authentication for establishing a secure channel, and a secure channel between the SE1 and the external terminal 2 is established. After the secure channel is established, a command sent from the external terminal 2 to the SE 1 is protected using the session key generated by the mutual authentication, as will be described later.
[0034] Next, the external terminal 2 transmits a SET STATUS command to the SE1 to set the patch state (step S5). When the SE1 receives the SET STATUS command, it sets the patch state to the initial state (step S6) and transmits a response including a normal end (SW: 9000) to the external terminal 2 (step S7). Next, when the external terminal 2 receives the response from the SE1, it transmits a STORE DATA command including the patch program to the SE1 (step S8). When the SE1 receives the STORE DATA command, it writes the patch program to the patch storage area 122 by the application selected in step S2 (step S9), and transmits a response including a normal end (SW: 9000) to the external terminal 2 (step S10). Note that if the data length of the patch program exceeds the data length that can be transmitted at one time, the patch program is divided, and the STORE DATA command including the divided patch program and the response are transmitted and received multiple times.
[0035] When writing of the patch program is completed and the external terminal 2 receives a response from the SE1, it transmits a STORE DATA command including the patch table to the SE1 (step S11). When the SE1 receives the STORE DATA command, it writes the patch table to the second table storage area 124 by the application selected in step S2 (step S12), and transmits a response including a normal end (SW:9000) to the external terminal 2 (step S13). If the data length of the patch table exceeds the data length that can be transmitted at one time, the patch table is divided, and the STORE DATA command including the divided patch table and the response are transmitted and received multiple times.
[0036] When writing of the patch table is completed and the external terminal 2 receives a response from the SE1, the external terminal 2 transmits a STORE DATA command including version data indicating the version of the patch program written in the patch storage area 122 in step S9 to the SE1 (step S14). When the SE1 receives the STORE DATA command, the SE1 writes the version data in the data storage area 125 by the application selected in step S2 (step S15), and transmits a response including normal end (SW:9000) to the external terminal 2 (step S16). Here, if version data previously written in the data storage area 125 is stored, the version data is overwritten by the latest version data received later. As a result, every time a new patch program is written in the patch storage area 122, version data indicating the version is written in the data storage area 125. The version data may be written in the second table storage area 124.
[0037] When the writing of the version data is completed and the external terminal 2 receives a response from the SE1, it sends a SET STATUS command to the SE1 to set the patch state (step S17). When the SE1 receives the SET STATUS command, it sets the patch state to a standby state (step S18) and sends a response including a normal end (SW:9000) to the external terminal 2 (step S19). As described above, the patch program does not run at this point.
[0038] (2.2.SE1 reset operation) Next, the operation of the SE1 at the time of resetting will be described with reference to FIG. 6. FIG. 6 is a flowchart showing the processing of the SE1 (OS) at the time of resetting the SE1. The processing shown in FIG. 6 is started when a reset is received from the external terminal 2. When the processing shown in FIG. 6 is started, the SE1 transmits an ATR (Answer To Reset) including initial response information (e.g., protocol format and communication speed) to the external terminal 2 (step S21). When the external terminal 2 receives a response from the SE1, it transmits a predetermined command to the SE1. The command received here is the first command after the reset (hereinafter referred to as the "initial command"), and the type of the command does not matter. Then, when the SE1 receives the initial command from the external terminal 2 (step S22), the process proceeds to step S23.
[0039] In step S23, the SE1 judges the patch state. If it is judged that the patch state is the initial state (step S23: initial state), the process proceeds to step S24. On the other hand, if it is judged that the patch state is the standby state (step S23: standby state), the process proceeds to step S27. On the other hand, if it is judged that the patch state is the normal state (step S23: normal state), the process proceeds to step S30. Note that the processes of steps S23 to S34 need to be executed only when the initial command is received, and in the case of a command received after the initial command after the reset, the processes of steps S23 to S34 are not executed, but a process according to the received command is executed, and a response indicating the result of the process is transmitted to the external terminal 2.
[0040] In step S24, SE1 writes an initial value to the first table storage area 123. Next, SE1 writes an initial value to the second table storage area 124 (step S25). Next, SE1 sets the patch state to the normal state (step S26) and proceeds to step S34.
[0041] In step S27, SE1 sets the patch state to the initial state. Next, SE1 copies the patch table from the second table storage area 124 to the first table storage area 123 (step S28). If version data is stored in the second table storage area 124, the version data is copied together with the patch table to the first table storage area 123. Next, SE1 sets the patch state to the normal state (step S29) and proceeds to step S34.
[0042] In step S30, SE1 verifies the patch program in the patch storage area 122 and the patch table in the first table storage area 123. In this verification, the identity of the patch program and the patch table is confirmed using, for example, a checksum or the like. Next, SE1 judges whether or not the verification in step S30 is successful (step S31). If it is judged that the verification is successful (step S31: YES), the process proceeds to step S34. On the other hand, if it is judged that the verification is unsuccessful (step S31: NO), the process proceeds to step S32.
[0043] In step S32, SE1 copies the patch table from the second table storage area 124 to the first table storage area 123. If version data is stored in the second table storage area 124, the version data is copied to the first table storage area 123 together with the patch table. Next, SE1 judges whether the recovery is successful or not (step S33). For example, if the patch program can be normally called up using the patch table in the first table storage area 123 and the patch program can be executed, it is judged that the recovery is successful. Then, if it is judged that the recovery is successful (step S33: YES), the process proceeds to step S34. On the other hand, if it is judged that the recovery is not successful (step S33: NO), the process proceeds to step S24.
[0044] In step S34, the SE 1 executes processing according to the initial command. Next, the SE 1 transmits a response indicating the result of the processing in step S34 to the external terminal 2 (step S35), and ends the processing.
[0045] (2.3. Operation when checking patch program version) Next, the operation when checking the version of a patch program will be described with reference to Fig. 7. Fig. 7 is a sequence diagram showing an example of an exchange between the SE1 and the external terminal 2 when checking the version of a patch program. In Fig. 7, the external terminal 2 periodically or irregularly transmits a SELECT command for selecting an arbitrary application to the SE1 (step S41). Upon receiving the SELECT command, the SE1 (OS) selects the application specified by the SELECT command (step S42) and transmits a response including a successful completion (SW:9000) and an FCI to the external terminal 2 (step S43).
[0046] Next, when the external terminal 2 receives the response from the SE1, it transmits a GET command to the SE1 to acquire the version data (step S44). When the SE1 receives the GET command, it reads the version data specified by the GET command from the data storage area 125 or the first table storage area 123 (step S45), and transmits a response including a normal end (SW:9000) and the read version data to the external terminal 2 (step S46).
[0047] Next, when the external terminal 2 receives a response from the SE1, it checks whether the version indicated by the version data included in the response has been updated. For example, the external terminal 2 determines whether the version has been updated. If it is determined that the version has been updated (for example, the version is the latest), it is determined that the patch program has been successfully applied. On the other hand, if it is determined that the version has not been updated, the process (sequence) shown in FIG. 5 is executed again. This makes it possible to keep the patch program in the latest state.
[0048] As described above, according to the above embodiment, the SE1 sets the patch state to the initial state before writing the patch program and the patch table transmitted from the external terminal 2 to the NVM 12, and sets the patch state to the standby state after writing of the patch program to the patch storage area 122 and writing of the patch table to the second table storage area 124 are completed. Thereafter, when an initial command is received from the external terminal 2 after resetting the SE1, the SE1 initializes the first table storage area 123 and the second table storage area 124 if the patch state is the initial state, while when a command is received from the external terminal 2 after resetting the SE1, the SE1 copies the patch table from the second table storage area 124 to the first table storage area 123 if the patch state is the standby state. Therefore, even if writing of the patch program is interrupted by unexpected noise or power outage, it can be restored to normal. [Explanation of symbols]
[0049] 1 SE 2 External terminal 10 CPU 11 RAM 12 NVM 13 I / O circuit 121 Program Memory Area 122 Patch Storage Area 123 First table storage area 124 Second table storage area 125 Data Storage
Claims
1. An electronic information storage medium comprising a memory having a first storage area for storing an application program, a second storage area for storing a patch program to be applied to the application program, a third storage area for storing a patch table to be referenced when the patch program is called, and a fourth storage area for storing a patch table not to be referenced when the patch program is called, a setting means for setting states of the patch program and the patch table to an initial state before writing the patch program and the patch table transmitted from an external terminal into the memory, and then setting the states to a standby state after writing of the patch program into the second storage area and writing of the patch table into the fourth storage area are completed; a writing means for initializing the third storage area and the fourth storage area when the state is an initial state, and for writing the patch table from the fourth storage area to the third storage area when the state is a standby state, when a command is received from an external terminal after the electronic information storage medium is reset; An electronic information storage medium comprising:
2. The electronic information storage medium according to claim 1, characterized in that the setting means sets the state to a normal state when the third memory area and the fourth memory area are initialized, or when the patch table is written from the fourth memory area to the third memory area.
3. 3. The electronic information storage medium according to claim 1, wherein the setting means sets the state to an initial state before the patch table is written from the fourth memory area to the third memory area when the state is a standby state.
4. The electronic information storage medium according to claim 2 or 3, further comprising a control means for verifying the patch program and the patch table if the state is normal when a command is received from an external terminal after the reset, and for executing processing corresponding to the command if the verification is successful.
5. when the patch program is written into the second storage area, the writing means writes version data transmitted from the external terminal and indicating a version of the patch program into a predetermined storage area in the memory; 5. The electronic information storage medium according to claim 1, further comprising a transmission unit that reads out version data from the predetermined storage area and transmits the version data to the external terminal in response to a request from the external terminal.
6. 1. A patch program writing method executed by an electronic information storage medium having a memory having a first storage area for storing an application program, a second storage area for storing a patch program to be applied to the application program, a third storage area for storing a patch table to be referenced when the patch program is called, and a fourth storage area for storing a patch table not to be referenced when the patch program is called, the method comprising: setting states of the patch program and the patch table to an initial state before writing the patch program and the patch table transmitted from an external terminal into the memory, and then setting the states to a standby state after writing of the patch program into the second storage area and writing of the patch table into the fourth storage area are completed; when a command is received from an external terminal after resetting the electronic information storage medium, initializing the third storage area and the fourth storage area if the state is an initial state, and writing the patch table from the fourth storage area to the third storage area if the state is a standby state; 13. A method for writing a patch program, comprising:
7. a computer included in an electronic information storage medium having a memory having a first storage area for storing an application program, a second storage area for storing a patch program to be applied to the application program, a third storage area for storing a patch table to be referenced when the patch program is called, and a fourth storage area for storing a patch table to be not referenced when the patch program is called, a setting means for setting states of the patch program and the patch table to an initial state before writing the patch program and the patch table transmitted from an external terminal into the memory, and then setting the states to a standby state after writing of the patch program into the second storage area and writing of the patch table into the fourth storage area are completed; A program characterized by functioning as a writing means that, when a command is received from an external terminal after resetting the electronic information storage medium, initializes the third memory area and the fourth memory area if the state is an initial state, and writes the patch table from the fourth memory area to the third memory area if the state is a standby state.
Citation Information
Patent Citations
Electronic computer
JP1990194434A
System and method for updating software adapted to accident
JP2002189609A
IC card and patch execution method
JP2010134644A
Electronic information storage medium, data writing method, and data writing program
JP2017138763A
Information processing device
WO2018150820A1
