A smart card and smart card upgrade method thereof
Receiving and processing upgrade data through SMS, the problem of difficulty in upgrading smart cards is solved, and the security upgrade is achieved in the system, without power outage, and the network is not interrupted, which is suitable for the large-scale promotion of smart cards.
Patent Information
- Application Number
- CN202111533567.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-12-15
AI Technical Summary
During the miniaturization process, upgrading and replacing smart cards becomes difficult, especially smart cards in the form of patches, which are difficult to remove from the Internet of Things system, resulting in the need to replace the entire system when upgrading or replacing, which is costly and unavailable to users. Existing OTA, RAM and RFM technologies cannot effectively upgrade smart card operating systems or user-sensitive data.
Receive upgrade data sent by external devices through SMS, store it in the free area of the smart card, and update the operating system, public data, personalized data and sensitive data of the smart card through parsing and processing of the upgrade data, realizing safe upgrades in the system, without power outage, and without network disconnection.
It has realized the large-scale promotion of smart cards, solved the problem of difficulty in upgrading smart cards, and can safely upgrade the operating system and data, avoiding the situation where users cannot use it, and reducing the upgrade cost.
Smart Images

Figure CN114185568B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart card upgrade, and in particular to a smart card and a smart card upgrade method thereof. Background Art
[0002] Smart Card: A general term for plastic cards with embedded microchips. Some smart cards contain a microelectronic chip that can exchange data with external devices. Smart cards are equipped with CPU, RAM and I / O, and can process a large amount of data by themselves without interfering with the operation of the CPU of external devices. The integrated circuit in the card includes a central processing unit CPU, Flash memory, random access memory RAM, a security algorithm module, an in-card operating system COS (Chip Operating System) stored in Flash, and public data and personalized data stored in Flash. Smart cards and external devices interact through APDU (Application Protocol Data Unit). The external device sends the command to be processed to the smart card through the command APDU. After the smart card completes the operation, it sends the processing result to the external device through the response APDU.
[0003] With the gradual evolution of mobile communication networks, the network communication speed and the number of users have greatly improved, the network charges have gradually decreased, the number of mobile operator users and IoT users has also exploded, and the user requirements have gradually increased. With the development of IoT technology, telecom smart cards have also grown rapidly, with many expansions in both packaging form and function. Standard forms such as 3FF, 4FF, MFF1, and MFF2 have appeared, and some forms with smaller packaging sizes have also appeared, with the smallest size being 1mm. 2 , which greatly facilitates integration into the Internet of Things system.
[0004] However, as smart cards are miniaturized, they are also difficult to replace and upgrade, especially for smart cards in the form of SMD (surface mount devices) such as MFF1 and MFF2, which are soldered in the device and are difficult to remove from the IoT system, or simply cannot be removed. This means that once a smart card needs to be upgraded or replaced, it needs to be removed before it can be upgraded, and it needs to be installed again after the upgrade is completed. For systems where the smart card cannot be removed, the system network access module or the entire IoT circuit system needs to be replaced, which is very expensive. In addition, during the replacement process, users cannot use the system, which also brings great inconvenience to users and makes it impossible to upgrade the smart card in the system.
[0005] Existing technologies such as OTA (Over The Air), RAM (Remote Application Management), and RFM (Remote File Management) only upgrade the STK menu, public files, and applications on the smart card, but cannot upgrade and control user sensitive data, let alone upgrade the operating system. Especially when the mobile network is upgraded from 2G to 3G, to 4G, and then to 5G, the smart card operating system also needs to be upgraded synchronously, or there are problems with the smart card operating system that need to be upgraded, and the above system upgrade technology is powerless to do this. With the in-depth development of 5G technology, various new applications and application scenarios will emerge in an endless stream, which requires smart cards to follow the corresponding function upgrades, data upgrades, and even the entire operating system upgrades, etc. Therefore, there is an urgent need for a method that can upgrade the smart card operating system, public data, and personalized data in the system without disconnecting the network, and can effectively control the sensitive data of the smart card. Summary of the invention
[0006] The present invention provides a smart card upgrading method, comprising:
[0007] S1. Receive the upgrade SMS sent by the external device;
[0008] S2, obtaining the upgrade data from the upgrade SMS and storing it in the free area of the smart card;
[0009] S3, determining whether all upgrade SMS messages corresponding to one upgrade operation are received successfully, if yes, executing step S4, otherwise returning a successful SMS reception response to the external device, and returning to step S1;
[0010] S4. parse and process all the upgrade data in the idle area of the smart card, update the data storage area or the operating system according to the upgrade data in the idle area, and return the processing result.
[0011] A smart card upgrade method as described above, wherein the upgrade SMS sent by the external device includes an upgrade flag, a total number of upgrade SMS messages, a number of current SMS messages, and upgrade content;
[0012] The upgrade flag is used to allow the smart card operating system to distinguish whether the text message is an upgrade text message or an ordinary user text message; the total number of upgrade text messages and the number of the current text message are used to determine whether the currently received upgrade text message is the last upgrade text message, and to determine the correct splicing order of the upgrade text messages; the upgrade content includes the upgrade data ciphertext and verification information.
[0013] The present invention also provides a smart card, comprising: a smart card operating system, a data storage area and a free area;
[0014] In the smart card operating system, the startup code module, platform code module and processing code module are modularly set up respectively; the startup code module is responsible for the hardware initialization of the smart card chip, and jumps to the platform code module to perform subsequent operations; the platform code module initializes the entire operating system, implements the hardware driver function for the processing module to use, and is responsible for data interaction with external devices; the processing module is used to operate the data storage area or free area according to the instructions of the external device;
[0015] The RAM area of the smart card includes a system RAM for storing global variables of the platform code module, a module RAM for access only by the processing module, and an exchange area RAM for storing data transmitted between processing modules or between the platform code module and the processing module.
[0016] A smart card upgrade method, applied to the smart card, the method comprising:
[0017] The smart card operating system is compiled and stored in advance according to module classification, and the startup code, platform code and processing code are modularly set respectively;
[0018] After the smart card is powered on, the startup code module initializes the chip hardware, the platform code module receives the upgrade data sent by the external device, searches the corresponding command processing code module from the function table, sends the upgrade SMS to the corresponding command processing code module, the command processing code module parses the upgrade SMS, writes the upgrade data into the free area of the smart card, and returns a successful SMS reception response to the external device;
[0019] After all the upgrade SMS messages are received, the upgrade processing module parses and processes the upgrade data in the free area to complete the upgrade of the smart card.
[0020] In the smart card upgrade method as described above, the smart card operating system is compiled and stored according to module classification, specifically including: defining the entry address and exit address of each module, and storing the calling relationship between modules in the form of a function table.
[0021] In the smart card upgrade method as described above, the upgrade data in the idle area is parsed and processed, specifically: the data storage area is updated or the operating system is updated according to the upgrade data in the idle area.
[0022] A smart card upgrade method as described above, wherein the update of the operating system includes the update of part of the operating system, that is, updating one or more command processing code modules; the update of the operating system also includes the update of the entire operating system, that is, running the code in the idle area as a new operating system, and using the original operating system area as a new idle area.
[0023] A smart card upgrade method as described above, wherein the update command processing code module is a new processing module, specifically includes: reserving a number of free items in the function table in preparation for adding a new processing module; if the data in the free area is used for the new module, then after downloading the corresponding module code to the free area, fill the relevant APDU command code and the address of the module into the first free item in the function table, connect the received new module to the original operating system, and deduct the space occupied by this upgrade from the free area, so as to complete the addition of the new functional module; when receiving the new APDU command, the platform code module can find the corresponding processing module function by querying the function table, and then make the CPU jump to the corresponding processing module address to execute the relevant code to complete the processing of the new APDU command.
[0024] A smart card upgrade method as described above, wherein the update command processing code module is a modification processing module, specifically includes: if the data in the free area is used to modify the module, then after downloading the corresponding module code to the free area, the module address corresponding to the APDU command code in the function table is modified to the newly downloaded processing module address, and the processing module update can be completed, and then the space occupied by the original processing module is linked to the free space to complete the space recovery.
[0025] In the smart card upgrade method as described above, the update command processing code module is a deletion processing module, which specifically includes: disconnecting the original module from the original operating system and merging its space as a free area with the original free area.
[0026] The beneficial effects achieved by the present invention are as follows:
[0027] (1) The present invention uses SMS to upgrade the smart card, which is supported by almost all terminals, so that the solution can be widely promoted without compatibility issues.
[0028] (2) The smart card operating system is restructured, compiled and stored according to module classification, and the free space on the smart card is used to safely implement "customized" upgrade management and control of the smart card operating system, smart card public data, smart card personalized data, and smart card sensitive data in the system without power outages or network disconnection. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0030] Figure 1 This is a schematic diagram of a smart card provided by Embodiment 1 of the present invention;
[0031] Figure 2 This is a flow chart of a smart card upgrade method provided in Embodiment 1 of the present invention;
[0032] Figure 3 This is a schematic diagram of a smart card provided by Embodiment 2 of the present invention;
[0033] Figure 4 This is a flow chart of a smart card upgrade method provided in Embodiment 2 of the present invention;
[0034] Figure 5 This is a schematic diagram of an upgrade channel of a smart card provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0035] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0036] Embodiment 1
[0037] like Figure 1 As shown, a first embodiment of the present invention provides a smart card 10, including a smart card operating system 11, a data storage area 12 and a free area 13; the data storage area 12 is used to store public data and personalized data, and the free area 13 is used to temporarily store upgrade data. The smart card operating system 11 updates the data storage area or part of the operating system, or even the entire operating system, according to the upgrade data in the free area 13.
[0038] like Figure 2 As shown, the smart card upgrade method specifically includes:
[0039] Step 210: receiving an upgrade SMS message sent by an external device;
[0040] The upgrade message sent by the external device includes an upgrade flag, a total number of upgrade messages, the number of the current message and upgrade content; the upgrade flag is used to allow the smart card operating system to distinguish whether the message is an upgrade message or an ordinary user message; the total number of upgrade messages and the number of the current message are used to determine whether the currently received upgrade message is the last upgrade message and to determine the correct splicing order of the upgrade messages; the upgrade content includes upgrade data ciphertext and verification information;
[0041] The upgrade APDU sent by the external device includes but is not limited to APDU defined by standard specifications, private APDU, etc.
[0042] Step 220: Obtain upgrade data from the upgrade SMS and store it in the free area of the smart card;
[0043] If an upgrade SMS is received from the SMS channel, the upgrade data is first obtained from the upgrade SMS, specifically including: parsing the upgrade SMS, decrypting the upgrade SMS, verifying the upgrade SMS, and storing it in a free area on the smart card after the verification is correct.
[0044] Step 230, determining whether all upgrade SMS messages corresponding to one upgrade operation are successfully received, if yes, executing step 240, otherwise returning a successful SMS reception response to the external device, and returning to step 210;
[0045] Specifically, the upgrade operation sent by the external device to the smart card can be sent to the smart card through one or more APDUs: if the upgrade operation is sent through one APDU, the upgrade SMS contains all the upgrade content ciphertext and verification information, the total number of upgrade SMS is 1, the smart card parses and decrypts and verifies the upgrade SMS, and then stores all the upgrade content in the free area; if the upgrade operation is sent through several APDUs, each upgrade SMS contains part of the upgrade content ciphertext and verification information. When the smart card receives an upgrade SMS other than the last one, the smart card only decrypts and verifies the relevant content, and stores the upgrade operation contained therein in the free area, and then returns a response to the external device.
[0046] Step 240: parse and process all the upgrade data in the free area of the smart card, update the data storage area or the operating system according to the upgrade data in the free area, and return the processing result;
[0047] Specifically, when the smart card receives the last upgrade SMS, the upgrade contents of all upgrade SMS in the free area are spliced together to form the current upgrade operation. The smart card operating system parses the upgrade operation, which can be a new operating system, adding a new functional module, deleting the original functional module, updating public data, personalized data, destroying personalized data, etc. After the upgrade operation is executed, the upgrade is completed, and then the processing result will be returned in response to APDU. In this way, when the next command APDU is received, the relevant upgrade operation has been completed and has taken effect immediately. There is no need to reset the smart card or reset the device, thereby achieving the upgrade of the smart card operating system in the system without power failure and reset.
[0048] Embodiment 2
[0049] like Figure 3 As shown, the second embodiment of the present invention provides a smart card 30, including a smart card operating system 31, a data storage area 32 and a free area 33;
[0050] The data storage area 12 is used to store public data and personalized data, and the free area 13 is used to temporarily store upgrade data;
[0051] A code area 311 is set in the smart card operating system 31; the code area 311 includes a modularly set startup code module 3111, a platform code module 3112 and multiple processing modules 3113 (including processing module 3113-1, processing module 3113-2...processing module 3113-n); the startup code module 3111 is responsible for the hardware initialization of the smart card chip, and jumps to the platform code module 3112 to perform subsequent operations; the platform code module 3112 initializes the entire operating system, implements the hardware driver function for the processing module 3113 to use, and is responsible for data interaction with external devices; the processing module 3113 is used to update the data storage area or the processing module or part of the operating system according to the upgrade data in the free area 33, or even the entire operating system;
[0052] The RAM area 312 of the smart card includes a system RAM 3121 for storing global variables of the platform code module 3112, a module RAM 3122 for access only by the processing module 3113, and an exchange area RAM 3123 for storing data transmitted between processing modules 3113 or between the platform code module 3112 and the processing module 3113.
[0053] like Figure 4 As shown, the smart card upgrade method includes:
[0054] Step 410: Restructure the smart card operating system in advance, compile and store it according to module classification, and modularize the startup code, platform code, and processing code respectively; define the entry address and exit address of each module, and store the calling relationship between the modules in the form of a function table;
[0055] In the embodiment of the present invention, in order to meet the requirement of upgrading the operating system code when the smart card operating system is running normally, it is necessary to restructure the smart card operating system, compile and store it according to the modules, and define the entry address and exit address. Each processing module is independent of each other, that is, there is no function call relationship between the processing modules, that is, the processing module will not call the functions of other processing modules, and its internal functions will not be called by other processing module functions. In order to reduce redundant functions, if there are functions with the same functions between processing modules, the functions with mutual call relationships are placed in the function table of the platform area for multiple processing modules to call together. In this way, if one of the modules changes, only the corresponding module and function table need to be modified, and the other modules will not change, which is convenient for the modules to be connected and activated in the system.
[0056] Specifically, in the smart card operating system, the startup code module, the platform code module and the processing code module are modularly set up respectively; among them, the startup code is responsible for initializing the hardware of the smart card chip, and jumps to the platform code to perform subsequent operations; the platform code initializes the entire operating system, implements the hardware driver function for the upper-level module to use, is responsible for receiving APDU commands from the device (such as receiving commands through the 7816 interface), calling related processing modules according to the APDU commands, and sending the processing results of the module to the external device; the processing code is responsible for processing the APDU commands and organizing the response data.
[0057] For example, the API functions provided by the platform code module to the command processing code module are all placed in a function table. If the command processing code module wants to call the platform function, it only needs to retrieve the function address from the fixed address function table, and then jump to the address to execute the API function. In this way, even if the platform API function or address changes, for the module code, it still needs to retrieve the API function address from the fixed function table address, and then jump to the address to execute the API function. This allows the platform to be modified without the need for corresponding changes to the module code, providing conditions for upgrading a module individually. In order to achieve dynamic switching of modules, a corresponding table of APDU and processing modules is maintained on the platform. Each data item in the table stores the address of the APDU and the corresponding module. The structure is shown in the following table:
[0058] Table 1 Function table structure
[0059]
[0060] When an APDU is received, the corresponding processing module address can be found by looking up Table 1, and then the CPU jumps to the corresponding module address to execute the relevant code to complete the processing of the corresponding APDU command. Several spare items are reserved in the function table to prepare for adding new processing modules in the future.
[0061] When a new processing module is needed, after downloading the corresponding module code to the free area, fill the relevant APDU command code and the address of the module into the first free item in the table to complete the addition of the new functional module. When the next command is received, the new module is already in effect. When a new APDU command is received, the platform can find the corresponding processing function by querying the linked list, and then make the CPU jump to the corresponding module address to execute the relevant code to complete the processing of the new APDU command. It avoids restarting the smart card and the device, and realizes the addition of new functional modules without disconnecting the system from the network.
[0062] When a function module needs to be modified, after downloading the corresponding module code to the free area, the module address corresponding to the APDU command code in the table is modified to the newly downloaded function module address to complete the function module update. Then the space occupied by the original module is linked to the free space to complete the space recovery. When the next APDU command is received, the module to be modified is already in effect. This avoids restarting the smart card and the device, and realizes the upgrade of the original function module without disconnecting the system from the network.
[0063] Furthermore, in the embodiment of the present invention, in order to ensure the use of RAM resources by each module, it is also necessary to divide the variables of the smart card operating system in detail. Each module can only use the RAM resources at its corresponding position. When multiple modules are involved in data transfer or cross-access, an exchange area will be designated for common use by each module.
[0064] Among them, the system RAM is used to store global variables used by the smart card operating system platform code, which cannot be accessed by each processing module; the module RAM can only be accessed by the processing module, and several areas are reserved for use by new modules or upgraded modules; the exchange area RAM stores data to be transferred between processing modules and between the platform and the processing module, and can be accessed by the platform and the processing module. The present invention places the global variables inside the processing module that will not be accessed by the outside in the RAM of the corresponding processing module, and the global variables accessed by other modules are placed at a fixed address in the exchange area. In this way, it can be ensured that when a module is upgraded, its global variables are maintained by itself, and the addresses of external variables that cross-access each other do not change in the exchange area, so that after the module code is downloaded, it can take effect immediately without resetting and reinitialization, thereby fully realizing the online, power-off, and restart-free upgrade of the module.
[0065] Step 420: After the smart card is powered on, the startup code module performs chip hardware initialization, the platform code module receives the upgrade data sent by the external device, searches the corresponding command processing code module from the function table, sends the upgrade data to the corresponding command processing code module, the command processing code module parses the upgrade data, writes the upgrade data into the free area of the smart card, and returns a data reception success response;
[0066] Step 430: After all the upgrade data are received, the upgrade processing code module parses and processes all the upgrade data in the free area to complete the smart card upgrade. After the upgrade operation is completed, the upgrade success response is returned to the platform code module, and the platform code module sends the upgrade success response to the external device to realize the smart card upgrade;
[0067] In an embodiment of the present invention, an upgrade operation is performed, specifically including updating the operating system, including updating the data storage area or the operating system according to the upgrade data in the free area; the operating system update includes updating part of the operating system, that is, updating one or more command processing code modules (including updating, deleting, adding, etc. of command processing code modules); the operating system update also includes updating the entire operating system, that is, running the code in the free area as a new operating system, and using the original operating system area as a new free area.
[0068] Perform the upgrade operation as follows:
[0069] Step 1, determine whether the data in the free area is used to upgrade the operating system. If so, run the code in the free area as a new cos, erase the original operating system area, and use the original operating system area as a new free area for the next upgrade. Otherwise, execute Step 2;
[0070] Step 2: Determine whether the data in the free area is used for the new module. If yes, link the received upgrade module to the original operating system and deduct the space occupied by this upgrade from the free area. Otherwise, execute Step 3.
[0071] Step 3. Determine whether the data in the free area is used to modify the module. If so, after downloading the corresponding module code to the free area, modify the module address corresponding to the APDU command code in the function table to the newly downloaded processing module address to complete the processing module update. Then link the space occupied by the original processing module to the free space to complete space recovery. Otherwise, execute Step 4.
[0072] Step 4. Determine whether the data in the free area is used to delete the module. If so, disconnect the original module from the original operating system and merge its space with the original free area as a free area. Otherwise, execute Step 5.
[0073] Step 5: Determine whether the data in the free area is used to upgrade the data. If so, upgrade the public file or personalized file. Otherwise, execute Step 6.
[0074] Step 6. Determine whether the data in the idle area is used for management and control operations. If so, manage the smart card and clear sensitive data. Otherwise, discard the data in the idle area.
[0075] It should be noted that the judgment operations of the above steps Step 1 to Step 6 have no execution order and can be executed simultaneously. In addition to the above upgrade operations, other upgrade operations can be processed according to the operation instructions and can be set according to actual needs, which is not limited here.
[0076] Embodiment 3
[0077] like Figure 5 As shown, the third embodiment of the present invention performs smart card upgrade based on multiple upgrade channels, and the upgrade channel includes a text message channel or an HTTP / HTTPs channel.
[0078] In the embodiment of the present application, the upgrade data sent by the external device to the smart card can be sent through a text message channel or through an HTTP / HTTPs channel:
[0079] SMS channel upgrade method: The upgrade platform is responsible for encrypting the upgrade package, splitting the upgrade package, organizing it into upgrade SMS, organizing the upgrade package into several SMS and sending it to the external device. The external device encapsulates the upgrade SMS into update SMS APDU and sends it to the smart card one by one. In this upgrade solution, the external device is a transfer station and does not need to be modified.
[0080] HTTP / HTTPs channel upgrade method: The upgrade platform is responsible for encrypting the upgrade package as a whole and sending it to the external device through HTTP, HTTPs and other channels; the external device splits the upgrade package and then encapsulates it into update SMS APDU or other APDUs defined by other standards and specifications, or even private APDUs, and sends them to the smart card. This upgrade solution requires modification of the external device.
[0081] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A smart card, characterized in that: include: Smart card operating system, data storage area and free area; In the smart card operating system, the startup code module, platform code module and processing code module are modularly set up respectively, and the entry address and exit address of each module are defined. There is no function calling relationship between each processing code module. Functions with the same functions between each processing code module are placed in the function table of the platform area for common calling by multiple processing code modules. The platform code module puts the API functions provided by the processing code module into the function table. If the processing code module wants to call the API function, it needs to fetch the function address from the fixed address function table and jump to the address to execute the API function. A correspondence table of APDU command codes and processing code modules is maintained on the platform. Each data item in the table stores the APDU command code and the address of the corresponding module. Several spare items are reserved in the correspondence table to prepare for adding new processing code modules in the future. The startup code module is responsible for the hardware initialization of the smart card chip and jumps to the platform code module to perform subsequent operations; the platform code module initializes the entire operating system, implements the hardware driver function for the processing code module to use, and is responsible for data interaction with external devices; the processing code module is used to operate the data storage area or free area according to the instructions of the external device; The RAM area of the smart card includes a system RAM for storing global variables of the platform code module, a module RAM for access only by the processing code module, and an exchange area RAM for storing data transmitted between processing code modules or between the platform code module and the processing code module; and global variables inside the processing code module that will not be accessed externally are placed in the module RAM of the corresponding processing code module, and global variables accessed by other modules are placed at fixed addresses in the exchange area RAM.
2. A smart card upgrade method, applied to the smart card as claimed in claim 1, characterized in that: The method comprises: After the smart card is powered on, the startup code module initializes the chip hardware, the platform code module receives the upgrade SMS sent by the external device, obtains the upgrade data from the upgrade SMS, writes the upgrade data into the free area of the smart card, and returns a successful SMS reception response to the external device; After all the upgrade SMS messages are received, the upgrade processing code module corresponding to the APDU command code related to the upgrade is searched from the corresponding table, and the upgrade processing code module parses and processes the upgrade data in the free area to complete the upgrade operation of the smart card; After the upgrade operation is completed, the APDU command code related to the upgraded module and the address of the upgraded module are filled into the first free item in the corresponding table, the upgraded module is linked to the original operating system, and the space occupied by this upgrade is deducted from the free area. The addition of the new functional module is completed and the response result is returned.
3. The smart card upgrade method according to claim 2, characterized in that: The upgrade data in the idle area is parsed and processed, specifically: the data storage area is updated or the operating system is updated according to the upgrade data in the idle area.
4. The smart card upgrade method according to claim 3, characterized in that: The update of the operating system includes the update of part of the operating system, that is, updating one or more processing code modules; the update of the operating system also includes the update of the entire operating system, that is, running the code in the idle area as a new operating system and using the original operating system area as a new idle area.
5. The smart card upgrade method according to claim 4, characterized in that: When receiving a newly added APDU command, the platform code module can find the corresponding processing code module by querying the corresponding table, and then make the CPU jump to the corresponding processing code module address to execute related codes to complete the processing of the newly added APDU command.
6. The smart card upgrade method according to claim 4, characterized in that: Updating the processing code module is to modify the processing code module, which specifically includes: if the upgrade data in the free area is used to modify the processing code module, then after downloading the corresponding module code to the free area, the module address corresponding to the APDU command code in the corresponding table is modified to the newly downloaded processing code module address, and the processing code module update can be completed. After that, the space occupied by the original processing code module is linked to the free space to complete the space recovery.
7. The smart card upgrade method according to claim 4, characterized in that: The updating of the processing code module is to delete the processing code module, which specifically includes: disconnecting the original processing code module from the original operating system, and merging its space as a free area with the original free area.
8. The smart card upgrade method according to any one of claims 2 to 7, characterized in that: The upgrade message sent by the external device includes the upgrade mark, the total number of upgrade messages, the number of the current message and the upgrade content; The upgrade flag is used to allow the smart card operating system to distinguish whether the SMS is an upgrade SMS or a common user SMS; The total number of upgrade SMS messages and the number of the current SMS message are used to determine whether the currently received upgrade SMS message is the last upgrade SMS message and to determine the correct splicing order of the upgrade SMS messages; the upgrade content includes the upgrade data ciphertext and verification information.
Citation Information
Patent Citations
IC card and IC card program
JP2004030532A