Smart card application patching method, system and equipment

By importing mask code projects and exporting library files after the smart card issuance, and using the smart card standard API interface to create patch applications, the problem of loss of information and poor reusability of patch patching methods for large applications in smart cards is solved, and universality and security are achieved patch update for most hardmask card scenarios.

CN119025142APending Publication Date: 2024-11-26WUHAN TIANYU INFORMATION IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411175851.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing technology patching methods for patching large Java Applet applications in smart cards have problems such as loss of information and poor reusability, especially since Java can only define 128 public functions and cannot be applied to large application scenarios.

Method used

After the smart card is issued, you can create a patch application by importing mask code projects and exporting library files, and downloading it to the smart card. Use the smart card standard API interface to achieve the matching and patching process of patch applications, ensuring the integrity and universality of the original application information sex.

Benefits of technology

It realizes patch updates to smart cards without losing original application information. It is suitable for large application scenarios, improves the versatility and security of patches, and is suitable for most hard mask cards patching scenarios, improving performance. And reduces the update cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025142A_ABST
    Figure CN119025142A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent cards, and discloses an intelligent card application patching method, system and device. The method comprises the steps of creating a patch file and a patch interface when a mask code project is constructed; when a patch needs to be added after the intelligent card is issued, importing the mask code project and / or the export library file of the intelligent card platform; wherein the export library file is exported based on the patch file and the patch interface; creating a patch application based on the export library file, and downloading the patch application to the smart card; matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card; and if the matching is successful, entering a patching process of the mask application. According to the patch application, after the card is issued, the patch is downloaded into the intelligent card for patch adding of the mask application, it is guaranteed that the issued card is continuously and normally used, the patch interface adopts the standard API of the intelligent card, and therefore the universality and safety of the patch adding process are guaranteed, the performance is improved, and the patch adding method is suitable for most hard mask card scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart card technology, and in particular to a method, system and device for patching smart card applications. Background Art

[0002] Applet is a Java program, which generally runs in a Java-supported Web browser. Because it has complete Java API support, Applet is a full-featured Java application. Currently, for Java Applet applications, once they are masked into the card (smart card), they cannot be modified. Therefore, a patch mechanism needs to be set up to facilitate subsequent patching and modification of the application to ensure the continued normal use of the smart card.

[0003] Conventionally, the Java mechanism is used to implement subsequent patch additions by directly calling the function package file. This patching method requires regenerating the function package and application to make the patch effective, which will cause the loss of the original application information and poor reusability. At the same time, it can only be used for some small applications with fewer functions. For some large applications, since Java can only define up to 128 public functions, when the number exceeds this number, other functions can only exist as private functions, and private functions cannot directly call the function package file. Therefore, this patching method of directly calling the function package is not applicable to large application scenarios. Therefore, there is an urgent need for a patching method that can ensure the integrity of the original Java application information while being compatible with large application scenarios. Summary of the invention

[0004] The main purpose of the present invention is to provide a method, system and device for patching smart card applications, aiming to solve at least one of the above problems.

[0005] To achieve the above object, the present invention provides a method for patching a smart card application, comprising:

[0006] When building a mask code project, create patch files and patch interfaces;

[0007] When a patch needs to be added after the smart card is issued, the export library file of the mask code engineering and / or the smart card platform is imported; wherein the export library file is exported based on the patch file and the patch interface;

[0008] Creating a patch application based on the exported library file, and downloading the patch application to the smart card;

[0009] Matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card;

[0010] If the match is successful, the patching process of the mask application is entered.

[0011] In some embodiments, when constructing a mask code project, creating a patch file and a patch interface includes:

[0012] When constructing a mask code project, a patch file is created and a patch entry is reserved in the patch file;

[0013] A patch interface is created based on a standard API interface of a smart card; wherein the patch entry corresponds to the patch interface.

[0014] In some embodiments, when constructing a mask code project, creating a patch file and reserving a patch entry in the patch file includes:

[0015] When building the mask code project, create a new patch file called MaskAPP.java;

[0016] When editing the patch file, at least one patch entry is reserved in the patch file.

[0017] In some embodiments, the creating a patch interface based on a standard API interface of a smart card includes:

[0018] Establish a patch interface based on the shared interface in the standard API interface of the smart card;

[0019] Add the patch interface at the function entry where the patch needs to be added;

[0020] The patch file created in the mask code project inherits the shared interface.

[0021] In some embodiments, creating a patch application based on the exported library file and downloading the patch application to the smart card includes:

[0022] Creating a patch application based on the export library file, so that the patch application implements the patch interface in the patch file when the mask code engineering is constructed;

[0023] The patch application is downloaded to the smart card.

[0024] In some embodiments, the patching process of entering the mask application includes:

[0025] When applying a patch, obtaining an entry to the patch application through the unique application identifier of the patch application;

[0026] Implementing a shared interface in the patch application;

[0027] Intercommunication between the mask application and the patch application is achieved based on the shared interface.

[0028] In some embodiments, the smart card is a Java Card.

[0029] In some embodiments, the Java card includes a read-only memory, and the application implementation code of the Java card is masked in the read-only memory.

[0030] In addition, to achieve the above-mentioned purpose, the present invention also proposes a smart card application patching system, comprising:

[0031] The patch file creation module is used to create patch files and patch interfaces when building a mask code project;

[0032] A file import module, used to import the export library file of the mask code engineering and / or the smart card platform when a patch needs to be added after the smart card is issued; wherein the export library file is exported based on the patch file and the patch interface;

[0033] A patch application creation module, used to create a patch application based on the exported library file, and download the patch application to the smart card;

[0034] an identification matching module, used to match the unique application identification of the patch application with the unique application identification of the mask application of the smart card;

[0035] The patching module is used to enter the patching process of the mask application if the match is successful.

[0036] In addition, to achieve the above-mentioned purpose, the present invention also proposes an electronic device, which includes: a memory, a processor, and a smart card application patching program stored in the memory and runnable on the processor, wherein the smart card application patching program is configured to implement the smart card application patching method as described above.

[0037] The present invention provides a method for patching smart card applications, comprising: creating a patch file and a patch interface when constructing a mask code project; when a patch needs to be added after the smart card is issued, importing the export library file of the mask code project and / or the smart card platform; wherein the export library file is exported based on the patch file and the patch interface; creating a patch application based on the export library file, and downloading the patch application to the smart card; matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card; if the match is successful, entering the patching process of the mask application. Compared with the need to set the corresponding patch file in the card before the card is issued, and calling the patch adding method of the patch file through the preset fixed patch entry in the function when the application needs a patch, the patch application provided by the present invention is to download the patch to the smart card after the card is issued to perform the patch adding of the mask application, so as to ensure the continuous normal use of the issued card, and the patch interface adopts the smart card standard API, so as to ensure the versatility and security of the application in the patch adding process, and can improve the performance, and is suitable for the patching scenarios of most hard mask cards. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention;

[0039] Figure 2 A schematic diagram of a process flow of a method for patching a smart card application according to an embodiment of the present invention;

[0040] Figure 3 A structural block diagram of an embodiment of a system for patching smart card applications of the present invention.

[0041] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] It should be noted that all directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0044] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in the field to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0045] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of an electronic device of the hardware operating environment involved in the embodiment of the present invention.

[0046] like Figure 1 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM memory) or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0047] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0048] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a smart card application patching program.

[0049] exist Figure 1In the electronic device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the smart card application patching program stored in the memory 1005 through the processor 1001, and executes the smart card application patching method provided in an embodiment of the present invention.

[0050] The present invention provides a method, system and device for patching smart card applications.

[0051] The embodiment of the present invention provides a method for patching a smart card application, referring to Figure 2 , Figure 2 A flowchart of an embodiment of a method for patching a smart card application according to the present invention.

[0052] like Figure 2 As shown, the method for patching a smart card application includes:

[0053] Step S100: when constructing a mask code project, creating a patch file and a patch interface;

[0054] Step S200: when a patch needs to be added after the smart card is issued, the export library file of the mask code engineering and / or the smart card platform is imported; wherein the export library file is exported based on the patch file and the patch interface;

[0055] Step S300: creating a patch application based on the exported library file, and downloading the patch application to the smart card;

[0056] Step S400: Matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card;

[0057] Step S500: If the match is successful, the patching process of the mask application is entered.

[0058] It should be noted that the execution subject in this embodiment may be an electronic device, which may be a computer device with data processing functions, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment, a computer device is used as an example for explanation.

[0059] In one embodiment, the smart card is a Java card.

[0060] In one embodiment, the Java card includes a read-only memory, and the application implementation code of the Java card is masked in the read-only memory.

[0061] It is understandable that a smart card is an IC (Integrated Circuit) card, which is widely used in various industries, such as bus cards, campus cards, access cards, and various membership cards. During the production process of smart cards, a lot of software codes, such as platform system software implementation codes and application software implementation codes, are solidified in the read-only memory (ROM) of the smart card. The ROM mask production process transfers the program code from the EEPROM to the ROM, which is called a "hard mask" and cannot be easily modified.

[0062] Specifically, the embodiment of the present application takes the smart card as a Java card, and after the Java card is issued, a patch is downloaded to the smart card to add a patch for mask application as an example for explanation.

[0063] Exemplarily, a Java card includes a Java platform and multiple Applet applications. The Java platform is used to implement a standard application programming interface and operating environment. Applet applications (developed in Java language) can use the interface provided by the Java platform to call system services and resources. The Java card platform is implemented with the Java card platform implementation code, and the processor in the Java card implements the corresponding functions of the Java card platform by running the Java card platform implementation code. In addition, the Applet application is implemented with the Applet application implementation code, and the processor in the Java card implements the corresponding functions of the Applet application by running the Applet application implementation code.

[0064] In one example, the Java Card platform implementation code of the Java Card is masked in the read-only memory; the Java Card Applet application implementation code is masked in the read-only memory. The read-only memory ROM works in a non-destructive read mode, and can only read but not write information. Once the information is written, it is fixed. Since this part of the code (such as the Applet application implementation code) is solidified during the chip manufacturing process, the content in the read-only memory cannot be modified after the Java Card is produced. Therefore, it is necessary to design a patch mechanism to update the Applet application software in the read-only memory. This embodiment proposes a method for patching smart card applications.

[0065] In one embodiment, when constructing a mask code project, a patch file and a patch interface are created, including: when constructing a mask code project, a patch file is created and a patch entry is reserved in the patch file; a patch interface is created based on a standard API interface of a smart card; wherein the patch entry corresponds to the patch interface.

[0066] In one embodiment, when constructing a mask code project, a patch file is created and a patch entry is reserved in the patch file, including: when constructing a mask code project, a new patch file MaskAPP.java is created; when editing the patch file, at least one patch entry is reserved in the patch file.

[0067] In one embodiment, a patch interface is created based on a standard API interface of a smart card, including: establishing a patch interface based on a shared interface in the standard API interface of a smart card; adding the patch interface at the function entry where a patch needs to be added; and the patch file created in the mask code project inherits the shared interface.

[0068] Specifically, step 1: create a patch file, leave a patch entry in the patch file, and apply the patch through the patch entry.

[0069] For example, when constructing a code project (mask code project), a new patch file MaskAPP.java is created. When editing the patch file, a patch entry is reserved in the patch file. The patch entry corresponds to the patch interface to which a subsequent function (mask application code function) needs to add a patch. The patch can be directly added to the function that needs to be patched through the patch entry.

[0070] Specifically, step 2, based on the shared interface provided in the standard Java Card API interface, the shared interface is used as a patch interface, and the patch interface is added at the entry of the function (mask application code function) where the patch needs to be added. The patch file created in the build code project (mask code project) inherits this shared interface.

[0071] Exemplarily, when in use, by specifying the AID (unique application identifier) ​​of the patch application, the entry of the patch application can be obtained through the AID, and this shared interface is implemented in the patch application. At the same time, a shared function is written to make the shared interface of the patch application visible to the outside, thereby utilizing the shared interface to achieve intercommunication between the mask application and the patch application.

[0072] In one embodiment, creating a patch application based on the export library file and downloading the patch application to the smart card includes: creating a patch application based on the export library file so that the patch application implements the patch interface in the patch file when the mask code engineering is constructed; downloading the patch application to the smart card.

[0073] Specifically, when a patch needs to be added to the application of the smart card, the export library file is first imported to create a patch application. The export library file may be a patch file constructed based on mask code engineering and a file exported by a patch interface.

[0074] Exemplarily, in step 3, when a patch needs to be added to the application of the smart card, the JAR package and EXP file generated by the mask code engineering are first imported. The patch application will implement the patch interface in the patch file when the mask application code is constructed. At this time, if the AID (unique application identifier) ​​of the patch application matches the AID reserved by the mask application in the shared interface, the mask application can enter the patch application process to achieve the purpose of patching. Among them, the JAR package and EXP file can be files exported by the card platform code of the smart card, or files exported by the mask application code, or files exported by both the card platform and the mask application of the smart card. In actual applications, the imported file can be selected according to the actual situation, and this embodiment does not limit this.

[0075] Specifically, by specifying the AID (unique application identifier) ​​of the patch application, the entry of the patch application can be obtained through the AID, and the shared interface is implemented in the patch application. At the same time, a shared function is written to make the shared interface of the patch application visible to the outside, so as to facilitate the subsequent use of the shared interface to achieve intercommunication between the mask application and the patch application.

[0076] It should be noted that compared with the traditional patch adding method, which requires setting the corresponding patch file in the card before the card is issued, and calling the patch file through a preset fixed patch entry in the function when the application needs a patch, in the method proposed in the embodiment of the present application, the timing of adding the patch application: the patch application provided in the embodiment of the present application is a patch addition in which the patch is downloaded to the card for application after the card is issued.

[0077] In one embodiment, the patching process of entering the mask application includes: when patching, obtaining the entry of the patch application through the unique application identifier of the patch application; implementing a shared interface in the patch application; and realizing intercommunication between the mask application and the patch application based on the shared interface.

[0078] Specifically, when in use, by specifying the AID (unique application identifier) ​​of the patch application, the entry of the patch application can be obtained through the AID, and this shared interface is implemented in the patch application. The written shared function makes the shared interface of the patch application visible to the outside, so as to utilize the shared interface to realize the intercommunication between the mask application and the patch application, and realize the patching of the mask application.

[0079] The present embodiment provides a method for patching a smart card application, comprising: creating a patch file and a patch interface when constructing a mask code project; when a patch needs to be added after the smart card is issued, importing the export library file of the mask code project and / or the smart card platform; wherein the export library file is exported based on the patch file and the patch interface; creating a patch application based on the export library file, and downloading the patch application to the smart card; matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card; if the match is successful, entering the patching process of the mask application. Compared with the traditional method of setting the corresponding patch file in the card before the card is issued, and calling the patch file through the preset fixed patch entry in the function when the application needs a patch, the patch application provided in the present embodiment is to download the patch to the smart card after the card is issued to perform the patch addition of the mask application, so as to ensure the continuous normal use of the issued card, and the patch interface adopts the smart card standard API (such as the Java Card standard API), so as to ensure the versatility and security of the application in the patch addition process, and can improve the performance, which is suitable for the patching scenarios of most hard mask cards. In addition, the method described in this embodiment can be used to update the application masked in the read-only memory in the Java card, thereby effectively repairing problems (such as bugs) existing in the Java card application, improving user experience and reducing update costs.

[0080] In addition, an embodiment of the present invention further proposes a storage medium on which a smart card application patching program is stored. When the smart card application patching program is executed by a processor, the steps of the smart card application patching method described above are implemented.

[0081] Reference Figure 3 , Figure 3 A structural block diagram of an embodiment of a system for patching smart card applications of the present invention.

[0082] like Figure 3 As shown, the smart card application patching system includes:

[0083] The patch file creation module 10 is used to create a patch file and a patch interface when constructing a mask code project;

[0084] The file import module 20 is used to import the export library file of the mask code engineering and / or the smart card platform when a patch needs to be added after the smart card is issued; wherein the export library file is exported based on the patch file and the patch interface;

[0085] A patch application creation module 30, used to create a patch application based on the exported library file, and download the patch application to the smart card;

[0086] An identification matching module 40, used to match the unique application identification of the patch application with the unique application identification of the mask application of the smart card;

[0087] The patching module 50 is used to enter the patching process of the mask application if the match is successful.

[0088] In one embodiment, the patch file creation module 10 is specifically used to: create a patch file and reserve a patch entry in the patch file when building a mask code project; create a patch interface based on the standard API interface of the smart card; wherein the patch entry corresponds to the patch interface.

[0089] In one embodiment, the patch file creation module 10 is specifically used to: create a new patch file MaskAPP.java when building a mask code project; and reserve at least one patch entry in the patch file when editing the patch file.

[0090] In one embodiment, the patch file creation module 10 is specifically used to: establish a patch interface based on a shared interface in the standard API interface of the smart card; add the patch interface at the function entry where a patch needs to be added; and the patch file created in the mask code project inherits the shared interface.

[0091] In one embodiment, the patch application creation module 30 is specifically used to: create a patch application based on the export library file so that the patch application implements the patch interface in the patch file when the mask code engineering is constructed; and download the patch application to the smart card.

[0092] In one embodiment, the patching module 50 is specifically used to: when patching, obtain the entry of the patch application through the unique application identifier of the patch application; implement a shared interface in the patch application; and implement intercommunication between the mask application and the patch application based on the shared interface.

[0093] In one embodiment, the smart card is a Java card.

[0094] In one embodiment, the Java card comprises a read-only memory, and the Java Card platform implementation code of the Java card is masked in the read-only memory.

[0095] This embodiment provides a smart card application patching system. Compared with the traditional method of setting the corresponding patch file in the card before the card is issued, when the application needs a patch, the patch application provided by this embodiment is to download the patch to the smart card after the card is issued to add the patch of the mask application, so as to ensure the continuous normal use of the issued card. The patch interface adopts the smart card standard API (such as the Java Card standard API), so as to ensure the versatility and security of the application in the patch adding process, and can improve the performance, which is suitable for most hard mask card patching scenarios. The method described in this embodiment can be used to update the application masked in the read-only memory of the Java card, so as to effectively repair the problems (such as bugs) existing in the Java card application, improve the user experience, and reduce the update cost.

[0096] It should be noted that the technical details that are not described in detail in the system embodiment of the smart card application patching can be found in the method for smart card application patching as described above provided in any embodiment of the present invention, and will not be repeated here.

[0097] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.

[0098] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0099] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0102] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for patching a smart card application, characterized in that: include: When building a mask code project, create patch files and patch interfaces; When a patch needs to be added after the smart card is issued, the export library file of the mask code engineering and / or the smart card platform is imported; wherein the export library file is exported based on the patch file and the patch interface; Creating a patch application based on the exported library file, and downloading the patch application to the smart card; Matching the unique application identifier of the patch application with the unique application identifier of the mask application of the smart card; If the match is successful, the patching process of the mask application is entered.

2. The method according to claim 1, characterized in that When constructing the mask code project, the patch file and patch interface are created, including: When constructing a mask code project, a patch file is created and a patch entry is reserved in the patch file; A patch interface is created based on a standard API interface of a smart card; wherein the patch entry corresponds to the patch interface.

3. The method according to claim 2, characterized in that When constructing the mask code project, creating a patch file and reserving a patch entry in the patch file include: When building the mask code project, create a new patch file called MaskAPP.java; When editing the patch file, at least one patch entry is reserved in the patch file.

4. The method according to claim 2, characterized in that The smart card-based standard API interface creates a patch interface, including: Establish a patch interface based on the shared interface in the standard API interface of the smart card; Add the patch interface at the function entry where the patch needs to be added; The patch file created in the mask code project inherits the shared interface.

5. The method according to claim 1, characterized in that The step of creating a patch application based on the exported library file and downloading the patch application to the smart card includes: Creating a patch application based on the export library file, so that the patch application implements the patch interface in the patch file when the mask code engineering is constructed; The patch application is downloaded to the smart card.

6. The method according to claim 1, characterized in that The patching process of entering the mask application includes: When applying a patch, obtaining an entry to the patch application through the unique application identifier of the patch application; Implementing a shared interface in the patch application; Intercommunication between the mask application and the patch application is achieved based on the shared interface.

7. The method according to any one of claims 1 to 6, characterized in that The smart card is a Java card.

8. The method according to claim 7, characterized in that The Java card includes a read-only memory, and the application implementation code of the Java card is masked in the read-only memory.

9. A system for patching smart card applications, characterized in that: include: The patch file creation module is used to create patch files and patch interfaces when building a mask code project; A file import module, used to import the export library file of the mask code engineering and / or the smart card platform when a patch needs to be added after the smart card is issued; wherein the export library file is exported based on the patch file and the patch interface; A patch application creation module, used to create a patch application based on the exported library file, and download the patch application to the smart card; an identification matching module, used to match the unique application identification of the patch application with the unique application identification of the mask application of the smart card; The patching module is used to enter the patching process of the mask application if the match is successful.

10. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a smart card application patching program stored in the memory and executable on the processor, wherein the smart card application patching program is configured to implement the smart card application patching method according to any one of claims 1 to 8.