Smart card Java application upgrade method and device, electronic device

Upgrading the smart card Java application by updating the system API solves the problems of difficulty in traditional smart card application development and user data loss, enables application upgrades without data backup, optimizes user experience and reduces the risk of errors.

CN115878155BActive Publication Date: 2024-10-15EASTCOMPEACE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211593260.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2024-10-15
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

In the application development and upgrade process, traditional smart cards have problems such as difficulty in application development, long development cycle, inability to support cross-industry requirements for multiple applications for one card, and user data is easily lost during application upgrades.

Method used

Upgrade the Java application of the smart card by updating the system API, modify the system API code, convert it into system API data in a specific format, obtain the new index information, and write it into the reserved update index area to ensure that the index information is arranged After the original index information, update the system API data to complete the application upgrade.

Benefits of technology

It realizes data-free backup, migration and upgrade of smart card Java applications, optimizes user experience, reduces the risk of errors, maintains application calling relationships, and avoids cumbersome data synchronization operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878155B_ABST
    Figure CN115878155B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a method and device for upgrading a smart card Java application, and an electronic device, and belong to the field of smart card technology. The method includes: modifying the system API code of the smart card according to the Java application upgrade requirements; converting the modified system API code into system API data in a specific format; obtaining the newly added index information corresponding to the system API data; writing the newly added index information into a reserved update index area, and the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area in the smart card; updating the system API data to the coding area to complete the Java application upgrade. Based on this, the upgrade method of the embodiments of the present application is for Java applications that call the system API, and the user application is upgraded by updating the system API. After the upgrade, the user area data before the application upgrade is retained, and there is no need to perform data backup and migration, thereby optimizing the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of smart cards, and in particular to a method and device for upgrading a smart card Java application, and an electronic device. Background Art

[0002] Smart Cards are widely used in fields closely related to ordinary consumers, including telecommunications, banking, public transportation, medical treatment, identity documents, security authentication, etc., and they play an irreplaceable role in the fields of mobile payment and personal information security. Traditional Native Cards have problems such as difficulty in application development, long development cycle, lack of general development platform, etc. In addition, Native Cards cannot support cross-industry one-card-multiple-application requirements very friendly, and the applications are fixed when the card is issued, which cannot meet the personalized needs of customers.

[0003] Java Card is a microprocessor smart card that can run Java programs, which facilitates the application development of smart cards and the realization of multiple applications on one card, and allows dynamic loading, updating or deletion of card applications. However, once there is a problem with the implementation of the Java application loaded on the smart card, the user needs to upgrade the application. Directly deleting the user application and then reloading the application to upgrade the application will result in the loss of user data, which undoubtedly causes trouble to the user. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose a smart card Java application upgrade method and device, and electronic device, which upgrades user applications by updating the system API. After the upgrade, the user area data before the application upgrade is retained, and there is no need for data backup and migration, thereby optimizing the user experience.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for upgrading a smart card Java application, the method comprising:

[0006] Modify the system API code of the smart card according to the Java application upgrade requirements;

[0007] Converting the modified system API code into system API data in a specific format;

[0008] Obtaining newly added index information corresponding to the system API data;

[0009] Writing the newly added index information into a reserved update index area, wherein the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card;

[0010] The system API data is updated to the coding area to complete the Java application upgrade.

[0011] In some embodiments, converting the modified system API code into system API data in a specific format includes:

[0012] The modified system API code is converted into system API data in a specific format through a third-party tool.

[0013] In some embodiments, converting the modified system API code into system API data in a specific format by a third-party tool includes:

[0014] Use a third-party tool to convert the modified system API code into system API data in a specific format through Convert;

[0015] The system API data is stored in the encoding area.

[0016] In some embodiments, the step of writing the newly added index information into a reserved update index area, wherein the newly added index information is arranged after the original index information, includes:

[0017] Reserving the update index area in a mapping relationship table of the encoding area, wherein the mapping relationship table is used to determine a mapping relationship between index information and a data storage address;

[0018] Determine that the original index information corresponds to the original index area in the mapping relationship table;

[0019] Setting the updated index area after the original index area;

[0020] The newly added index information is written into the updated index area so that the newly added index information is arranged after the original index information.

[0021] In some embodiments, updating the system API data to the coding area to complete the Java application upgrade includes:

[0022] Updating the system API data to the coding area by means of local COS upgrade to complete the Java application upgrade; or,

[0023] The system API data is updated to the coding area by online COS upgrade to complete the Java application upgrade.

[0024] In some embodiments, the updating of the system API data to the coding area by means of a local COS upgrade to complete the Java application upgrade includes:

[0025] The system API data is updated to the coding area by means of local APDU upgrade to complete the Java application upgrade.

[0026] In some embodiments, the smart card includes the coding area and the data area, the Java application exists in the data area, and the coding area and the data area are independent of each other.

[0027] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a smart card Java application upgrade device, the device comprising:

[0028] A modification module, used to modify the system API code of the smart card according to the Java application upgrade requirements;

[0029] A conversion module, used for converting the modified system API code into system API data in a specific format;

[0030] An acquisition module, used to acquire newly added index information corresponding to the system API data;

[0031] A writing module, used for writing the newly added index information into a reserved update index area, wherein the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card;

[0032] An update module is used to update the system API data to the coding area to complete the Java application upgrade.

[0033] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0034] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0035] The smart card Java application upgrade method, device, and electronic device proposed in the present application modify the smart card's system API code according to the Java application upgrade requirements; convert the modified system API code into system API data in a specific format; obtain the newly added index information corresponding to the system API data; write the newly added index information into the reserved update index area, and arrange the newly added index information after the original index information, wherein the update index area is located in the coding area of ​​the smart card; update the system API data to the coding area to complete the Java application upgrade. Based on this, by writing the newly added index information corresponding to the upgraded system API data into the reserved update index area, and arranging the newly added index information after the original index information, the calling relationship of the application can be maintained, the original index information is not changed, and there is no need to perform cumbersome data synchronization operations after the upgrade, thereby eliminating the data synchronization operation and the need to regenerate the calling relationship, which not only improves the user experience, but also reduces the risk of errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a main flow chart of the smart card Java application upgrade method provided in the embodiment of the present application;

[0037] Figure 2 This is a diagram of the Java smart card architecture provided by an embodiment of the present application;

[0038] Figure 3 It is a sub-flow chart of the smart card Java application upgrade method provided in the embodiment of the present application;

[0039] Figure 4 It is a sub-flow chart of the smart card Java application upgrade method provided in the embodiment of the present application;

[0040] Figure 5 This is an example diagram of storage and method calling of PKG provided in an embodiment of the present application;

[0041] Figure 6 It is a call relationship diagram after the upgraded application provided in the embodiment of the present application;

[0042] Figure 7 It is a structural diagram of a smart card Java application upgrade device provided in an embodiment of the present application;

[0043] Figure 8 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0046] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0047] First, some nouns involved in this application are analyzed:

[0048] Java: It is an object-oriented programming language. It not only absorbs the advantages of C++, but also abandons the difficult-to-understand concepts of multiple inheritance and pointers in C++. Therefore, Java has two characteristics: powerful functions and simple and easy to use. As a representative of static object-oriented programming languages, Java has excellently implemented object-oriented theory, allowing programmers to perform complex programming with an elegant way of thinking. Java has the characteristics of simplicity, object-oriented, distributed, robust, secure, platform-independent and portable, multi-threaded, and dynamic. Java can be used to write desktop applications, Web applications, distributed systems, and embedded system applications.

[0049] API (Application Programming Interface): is a set of predefined functions that aims to provide applications and developers with the ability to access a set of routines based on a certain software or hardware without having to access the source code or understand the details of the internal working mechanism. The application program interface is a set of definitions, procedures and protocols that enable mutual communication between computer software through the API interface. One of the main functions of API is to provide a common set of functions. Programmers can reduce programming tasks by developing applications by calling API functions. API is also a kind of middleware that provides data sharing for various platforms.

[0050] Convert: is a file system modification command in Windows. Convert converts file allocation table (FAT) and FAT32 volumes to NTFS file system, while existing files and folders remain intact.

[0051] Upgrade: refers to the update of software from a lower version to a higher version. Since higher versions often fix some bugs in lower versions, after the software upgrade, the performance will generally be better than the original version, with optimized effects, and users can also have a better experience.

[0052] Index: In a relational database, an index is a separate, physical storage structure that sorts the values ​​of one or more columns in a database table. It is a collection of values ​​of one or more columns in a table and a corresponding list of logical pointers to the data pages in the table that physically identify these values. The role of an index is equivalent to the catalog of a book, and you can quickly find the required content based on the page number in the catalog. The index provides pointers to the data values ​​stored in the specified columns of the table, and then sorts these pointers according to the sort order you specify. The database uses the index to find a specific value, and then follows the pointer to find the row containing the value. This allows the SQL statement corresponding to the table to execute faster and quickly access specific information in the database table. When there are a large number of records in the table, if you want to query the table, the first way to search for information is to search the entire table, which is to take out all the records one by one, compare them with the query conditions one by one, and then return the records that meet the conditions. This will consume a lot of database system time and cause a lot of disk I / O operations; the second way is to create an index in the table, then find the index value that meets the query conditions in the index, and finally quickly find the corresponding record in the table through the ROWID (equivalent to the page number) stored in the index.

[0053] In the prior art, after the smart card is upgraded, the registry needs to be traversed to find the call information of each application and update this information; in the case of many user applications on the smart card, there is a lot of data, it takes a long time, and the implementation is complicated. At the same time, it is necessary to consider the interruption or abnormal power failure during the data synchronization process. In addition, the smart card needs to be loaded with at least one data application that cooperates with the business application upgrade for data storage, and an additional shared interface needs to be implemented for searching, updating, and deleting data, which increases the amount of code, and uses a dynamic array as data storage. If the array is not released after the upgrade, the available resources of the card will be reduced; the card side needs to store the data of the upgraded business application through the data application, and the business application that needs to be upgraded also implements the supporting interface area for data storage and acquisition, so as to synchronize data after the business application is upgraded, which invisibly increases the amount of code of the business application that is not related to normal business. At the same time, handing over the data of the business application to a third-party application for storage also increases the risk of data leakage.

[0054] Based on this, the embodiment of the present application provides a smart card Java application upgrade method and device, and electronic device, which modify the smart card system API code according to the Java application upgrade requirements; convert the modified system API code into system API data in a specific format; obtain the newly added index information corresponding to the system API data; write the newly added index information into the reserved update index area, and the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area in the smart card; update the system API data to the coding area to complete the Java application upgrade. Based on this, by writing the newly added index information corresponding to the upgraded system API data into the reserved update index area, and the newly added index information is arranged after the original index information, the calling relationship of the application can be maintained, the original index information is not changed, and there is no need to perform tedious data synchronization operations after the upgrade, thereby eliminating the data synchronization operation and the need to regenerate the calling relationship, which not only improves the user experience, but also reduces the risk of errors.

[0055] The smart card Java application upgrade method and device, and electronic device provided in the embodiments of the present application are specifically described through the following embodiments. First, the smart card Java application upgrade method in the embodiments of the present application is described.

[0056] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.

[0057] Figure 1 is an optional flowchart of the smart card Java application upgrade method provided in the embodiment of the present application, Figure 1 The method may include but is not limited to steps S101 to S105.

[0058] Step S101, modifying the system API code of the smart card according to the Java application upgrade requirements;

[0059] Step S102, converting the modified system API code into system API data in a specific format;

[0060] Step S103, obtaining newly added index information corresponding to the system API data;

[0061] Step S104, writing the newly added index information into a reserved update index area, where the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card;

[0062] Step S105, updating the system API data to the coding area to complete the Java application upgrade.

[0063] In some embodiments, see Figure 2 The architecture of Java smart card includes the storage structure of code area (CODE area) and user data area, wherein the user's Java application exists in the user data area. In addition to the Java code developed by the user, the user application will also call the standard JavaCard API and the system API provided by the card. The CODE area and the data area are physically independent, and the data between applications are independent of each other. This application describes the function of upgrading the user's Java application by upgrading the system API.

[0064] In some embodiments, all API packages on the smart card are converted into a specific format in advance by a third-party tool and stored on the smart card. At this time, the links between the API packages on the smart card have been established and stored in the CODE area. After the card is issued, when the user downloads the Java pkg, some link relationships will be generated. When installing / executing the application, some links will also be established and user data will be generated, and these link relationships and data are stored in the user data area. When the application is upgraded, the index on the card must be maintained unchanged to ensure the normal operation of the application. Application upgrades often increase methods, pkg, etc., which will lead to an increase in the index on the card and a change in the pkg id. The main purpose of the present invention is to achieve the purpose of user Java application upgrade by modifying third-party tools and adjusting the pkg storage structure.

[0065] In some embodiments, the present application achieves the purpose of Java application upgrade in the form of COS upgrade. When the application is upgraded, the modified Java code can be regenerated into data in a specific format through a third-party tool and stored in the CODE area, and the user application code and data are not modified. When the Java application upgrade is started, the Java code part is modified according to the upgrade requirements, and the modified Java code is converted into a data format through the modified convert tool, and the upgraded Java code data is updated to a specific area on the smart card. The update method is not limited to the local APDU method and the over-the-air online upgrade method. After the update, no other processing is required for the application or the card. The application is upgraded to the required version, and the user data has not changed and does not need to be synchronized.

[0066] In some embodiments, by writing the newly added index information corresponding to the upgraded system API data into the reserved update index area, and arranging the newly added index information after the original index information, the calling relationship of the application can be maintained, the original index information is not changed, and there is no need to perform cumbersome data synchronization operations after the upgrade, thereby eliminating data synchronization operations and no need to regenerate the calling relationship, which not only improves the user experience but also reduces the risk of errors. The upgrade method of the embodiment of the present application is aimed at Java applications that call system APIs. This method upgrades user applications by updating the system API. After the upgrade, the user area data before the application upgrade is retained, and there is no need to perform data backup and migration, thereby optimizing the user experience.

[0067] In some embodiments, this application is mainly aimed at upgrading smart card Java applications. Java applications are not limited to applications pre-installed on the card and applications downloaded by users after the card is issued. Supported smart card Java application upgrades include: smart card Java application function expansion and smart card Java application bug repair. The smart card reserves enough space for application upgrades. COS developers modify the system code according to requirements and generate the latest COS data. Users write new COS data into the card CODE area through online upgrades or local upgrades. No modification is required to the user data area, and no data synchronization is required after the upgrade.

[0068] In some embodiments, step S102 may include but is not limited to step S201:

[0069] Step S201: converting the modified system API code into system API data in a specific format through a third-party tool.

[0070] In some embodiments, by upgrading applications through third-party tools, you can know whether the application's calling relationship has changed before upgrading the application, eliminating the need for data synchronization operations and regenerating calling relationships, which not only improves user experience but also reduces the risk of errors. By completing application upgrades through third-party tools, there are no limitations for COS platforms with different functions, and there is no need to add relevant codes for upgrading on each COS platform. The tool can be developed once and applied to multiple platforms, reducing repetitive work.

[0071] See also Figure 3 In some embodiments, step S201 may include but is not limited to steps S301 to S302:

[0072] Step S302, using a third-party tool to convert the modified system API code into system API data in a specific format through Convert;

[0073] Step S303, storing the system API data in the encoding area.

[0074] In some embodiments, when the application is upgraded, the modified Java code can be regenerated into data in a specific format through a third-party tool and stored in the CODE area, and the user application code and data are not modified. When the Java application upgrade begins, the Java code part is modified according to the upgrade requirements, and the modified Java code is converted into a data format through a modified convert tool, and the upgraded Java code data is updated to a specific area on the smart card. The update method is not limited to the local APDU method and the over-the-air online upgrade method. After the update, no other processing is required for the application or the card. The application is upgraded to the required version, and the user data does not change and does not need to be synchronized.

[0075] See also Figure 4 In some embodiments, step S104 may include but is not limited to steps S401 to S404:

[0076] Step S401, reserving an update index area in a mapping relationship table of the coding area, wherein the mapping relationship table is used to determine a mapping relationship between index information and a data storage address;

[0077] Step S402, determining the original index area in the mapping relationship table corresponding to the original index information;

[0078] Step S403, setting the updated index area after the original index area;

[0079] Step S404, writing the newly added index information into the updated index area so that the newly added index information is arranged after the original index information.

[0080] In some embodiments, application developers develop applications through tools (such as JCOP) that integrate standard JavaCard APIs, and can directly call standard API interfaces. If it is necessary to call a custom system API on the card side, it is necessary to provide the relevant jar (export) file to the application developer, and the COS developer will implement the relevant API. After the application development is completed, the user will download the application source code to the smart card through the download and installation instructions described in the GP specification and instantiate it into an executable program. The process of downloading and installing the application will establish a link relationship between the application program and the standard API and system API on the smart card. By establishing a link relationship, the user application can access the API and data on the smart card when it is actually executed. All API packages on the smart card are converted into a specific format in advance by a third-party tool and stored on the smart card. At this time, the links between the API packages on the smart card have been established and stored in the CODE area. After the smart card is issued, when the user downloads Javapkg, some link relationships will be generated. When installing / executing the application, some links will also be established and user data will be generated, and these link relationships and data are stored in the user data area. When the application is upgraded, the index on the smart card must be kept unchanged to ensure the normal operation of the application. Application upgrades often add methods, pkg, etc., which will lead to an increase in the index on the smart card and a change in the pkg id. Therefore, the purpose of user Java application upgrade is achieved by modifying third-party tools and adjusting the pkg storage structure. The purpose of Java application upgrade is achieved by COS upgrade. When the application is upgraded, the modified Java code is regenerated into data in a specific format through a third-party tool and stored in the CODE area. The user application code and data are not modified. In order to meet the needs of Java application upgrades, an update index area is reserved on the smart card for upgrade use. The update index area is reserved in the mapping relationship table of the coding area, where the mapping relationship table is used to determine the mapping relationship between index information and data storage address. Determine the original index information corresponding to the original index area in the mapping relationship table, set the update index area after the original index area, and write the newly added index information to the update index area so that the newly added index information is arranged after the original index information. Since the newly added index information is arranged after the original index information, the meaning of the original index information may not be changed, and the index link relationship remains unchanged, thereby maintaining the calling relationship of the application. There is no need to perform tedious data synchronization operations after upgrading, thereby eliminating data synchronization operations and no need to regenerate the calling relationship, which not only improves the user experience but also reduces the risk of errors.

[0081] In some embodiments, for the upgrade method, the system API data can be updated to the coding area by local COS upgrade to complete the Java application upgrade; the system API data can also be updated to the coding area by online COS upgrade to complete the Java application upgrade. Specifically, the upgraded Java code data can be updated to a specific area on the card, and the update method is not limited to the local APDU method and the over-the-air online upgrade method. After the update, no other processing is required for the application or the card. The application is upgraded to the required version, and the user data is unchanged and does not need to be synchronized.

[0082] The smart card Java application upgrade method of the present application is further described below with reference to the accompanying drawings and specific embodiments.

[0083] like Figure 2 The figure shows the architecture of the Java smart card and the storage structure of the CODE area and the user data area on the card, wherein: the user's Java application exists in the user data area. In addition to the Java code developed by the user, the user application will also call the standard JavaCard API and the system API provided by the card. The CODE area and the data area are physically independent, and the data between applications are independent of each other. The present invention describes the function of realizing the user Java application upgrade by upgrading the system API.

[0084] Application developers develop applications through tools that integrate standard JavaCardAPI (such as JCOP), and can directly call standard API interfaces. If they need to call the customized system API on the card side, they need to provide the relevant jar (export) files to the application developers, and the COS developer will implement the relevant API. After the application development is completed, the user will download the application source code of the generated CAP to the card through the download and installation instructions described in the GP specification and instantiate it into an executable program. The process of downloading and installing the application will establish a link relationship between the application program and the standard API and system API on the card. By establishing a link relationship, the user application can access the API and data on the card when it is actually executed.

[0085] like Figure 5The figure shows a diagram of a user application accessing the API on the card, where: S1 is the card mapTable, and its content is the mapping relationship between the index and the actual data storage address; S2, S3, and S4 are the Java pkg info loaded on the card, including the standard api pkg, the system api pkg, and the pkg downloaded by the user. The address information stored in the pkg info is all mapped through the mapTable index; S5, S6, and S7 are the method contents corresponding to the Java pkg, and each method corresponds to an index of the mapTable; S8 is the index link relationship between the user application instance and the calling process method.

[0086] All API packages on the smart card are converted into a specific format (such as Figure 5 As shown) and the storage on the card, at this time, the link between the API package on the card has been established and stored in the CODE area. After the card is issued, when the user downloads Javapkg, some link relationships will be generated, and some links will also be established when installing / executing applications (such as Figure 5 As shown in S8), user data is generated, and these link relationships and data are stored in the user data area. When the application is upgraded, the index on the card must be kept unchanged to ensure the normal operation of the application. Application upgrades often increase methods, pkg, etc., which will lead to an increase in indexes on the card and changes in pkg id. The main purpose of the present invention is to achieve the purpose of user Java application upgrade by modifying third-party tools and adjusting the pkg storage structure.

[0087] This solution describes how to upgrade Java applications by upgrading COS. When the application is upgraded, the modified Java code is regenerated into data in a specific format through a third-party tool and stored in the CODE area (see Figure 2 CODE area), user application code and data are not modified (see Figure 2 As shown in the data area). Figure 6As shown, in order to meet the Java application upgrade requirements, pkg info (S10) and index for update (S11) are reserved on the card for upgrade use. The affected code during the upgrade is the two methods of API pkg1, which are located at index2 and index3 in the mapTable. Since the user application searches for the method (S13, S14) of API pkg1 through the index (index of mapTable) when calling the method, as long as the original index meaning does not change, whether the physical address of the storage changes or not will not affect the user application to find these two methods, and the content modification of S13 and S14 will not affect the calling logic between the user application from the application end to the system API. As long as S9 to S12 can be executed normally and the meaning of the system API method index index2 and index3 contained in S12 remains unchanged, the card can run normally after the upgrade. During the upgrade, a method Method_x1 is added to the reserved API pkg_x1. The total number of indexes in the mapTable changes, and this method is called by Method1. Its index must be generated before Method1, so the index before Method1 will change, causing the index value after Method1 to change. However, the data of the original user application has not been modified. The system API method indexes index2 and index3 called by it may not be the expected modified methods. This situation will cause confusion in the card data after the upgrade. In response to this, we have adjusted the third-party tool. When the Java code generates data in a specific format, if it is found that a new index-new is inserted before the existing index before the upgrade, this index-new is generated to the reserved mapTable area indexfor update (S11), and the original index meaning is maintained unchanged. The third-party tool ensures that only the content corresponding to the address pointed to by the method is modified during the upgrade, and the meaning of the original index is not changed. The newly added method is called by the method in the system API area (such as Figure 6 As shown in S14), it is not directly called by the user application layer, and the user application does not need to pay attention to the internal calling logic between the system APIs.

[0088] Based on this, the embodiments of the present application have the following advantages: using third-party tools to maintain the calling relationship of the application, there is no need to perform tedious data synchronization operations after the upgrade. By performing application upgrades through third-party tools, you can know whether the calling relationship of the application has changed before upgrading the application, eliminating data synchronization operations and the need to regenerate the calling relationship, which not only improves the user experience but also reduces the risk of errors. By completing application upgrades through third-party tools, there are no limitations for COS platforms with different functions, and there is no need to add relevant code to implement the upgrade on each COS platform. The tool can be developed once and applied to multiple platforms, reducing repetitive work. The upgrade method of the embodiments of the present application is aimed at user Java applications that call the card system API. This solution does not require backing up user data, and does not require implementing specific interfaces for application upgrades and data synchronization. The overall implementation difficulty is low.

[0089] See also Figure 7 The embodiment of the present application further provides a smart card Java application upgrade device, which can implement the smart card Java application upgrade method, and the device includes:

[0090] A modification module 710 is used to modify the system API code of the smart card according to the Java application upgrade requirements;

[0091] A conversion module 720, configured to convert the modified system API code into system API data in a specific format;

[0092] The acquisition module 730 is used to acquire the newly added index information corresponding to the system API data;

[0093] A writing module 740 is used to write the newly added index information into a reserved update index area, where the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card;

[0094] The update module 750 is used to update the system API data to the coding area to complete the Java application upgrade.

[0095] In the smart card Java application upgrade device of the embodiment of the present application, the modification module 710 modifies the smart card system API code according to the Java application upgrade requirements; the conversion module 720 converts the modified system API code into system API data of a specific format; the acquisition module 730 acquires the newly added index information corresponding to the system API data; the writing module 740 writes the newly added index information into the reserved update index area, and the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card; the update module 750 updates the system API data to the coding area to complete the Java application upgrade. Based on this, by writing the newly added index information corresponding to the upgraded system API data into the reserved update index area, and the newly added index information is arranged after the original index information, the calling relationship of the application can be maintained, the original index information is not changed, and there is no need to perform cumbersome data synchronization operations after the upgrade, thereby eliminating the data synchronization operation and the need to regenerate the calling relationship, which not only improves the user experience, but also reduces the risk of errors.

[0096] The specific implementation of the smart card Java application upgrade device is substantially the same as the specific implementation of the smart card Java application upgrade method described above, and will not be described in detail herein.

[0097] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned smart card Java application upgrade method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.

[0098] See also Figure 8 , Figure 8 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0099] The processor 801 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solution provided in the embodiment of the present application.

[0100] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM). The memory 802 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the smart card Java application upgrade method of the embodiment of this application, that is, modifying the smart card system API code according to the Java application upgrade requirements; converting the modified system API code into a specific format of system API data; obtaining the newly added index information corresponding to the system API data; writing the newly added index information to the reserved update index area, and the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card; updating the system API data to the coding area to complete the Java application upgrade. Based on this, by writing the new index information corresponding to the upgraded system API data into the reserved update index area, and arranging the new index information after the original index information, the calling relationship of the application can be maintained without changing the original index information. There is no need to perform tedious data synchronization operations after the upgrade, thereby eliminating data synchronization operations and the need to regenerate the calling relationship, which not only improves the user experience but also reduces the risk of errors.

[0101] The input / output interface 803 is used to implement information input and output.

[0102] The communication interface 804 is used to realize the communication interaction between this device and other devices. Communication can be realized through wired methods (such as USB, network cable, etc.) or wireless methods (such as mobile network, WIFI, Bluetooth, etc.).

[0103] The bus transmits information between various components of the device (eg, the processor 801 , the memory 802 , the input / output interface 803 , and the communication interface 804 ).

[0104] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus.

[0105] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the upgrade method of the smart card Java application is implemented.

[0106] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0107] The smart card Java application upgrade method, smart card Java application upgrade device, electronic device and storage medium provided in the embodiment of the present application modify the smart card system API code according to the Java application upgrade requirements; convert the modified system API code into system API data in a specific format; obtain the newly added index information corresponding to the system API data; write the newly added index information into the reserved update index area, and the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card; update the system API data to the coding area to complete the Java application upgrade. Based on this, by writing the newly added index information corresponding to the upgraded system API data into the reserved update index area, and the newly added index information is arranged after the original index information, the calling relationship of the application can be maintained, the original index information is not changed, and there is no need to perform cumbersome data synchronization operations after the upgrade, thereby eliminating the data synchronization operation and the need to regenerate the calling relationship, which not only improves the user experience but also reduces the risk of errors.

[0108] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as a computer-readable program, a data structure, a program module or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassette, magnetic tape, disk storage or other magnetic storage device, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media generally contain computer-readable programs, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0109] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0110] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0111] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0112] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0113] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0114] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0115] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0116] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0117] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0119] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for upgrading a smart card Java application, It is characterized in that The method comprises: Modify the system API code of the smart card according to the Java application upgrade requirements; Converting the modified system API code into system API data in a specific format; Obtaining newly added index information corresponding to the system API data; Reserving an update index area in a mapping relationship table of the encoding area, wherein the mapping relationship table is used to determine a mapping relationship between index information and a data storage address; Determine that the original index information corresponds to the original index area in the mapping relationship table; Setting the updated index area after the original index area; Writing the newly added index information into the updated index area so that the newly added index information is arranged after the original index information, wherein the updated index area is located in the coding area of ​​the smart card; Updating the system API data to the coding area by means of local COS upgrade to complete the Java application upgrade; or, The system API data is updated to the coding area by online COS upgrade to complete the Java application upgrade.

2. The method according to claim 1, It is characterized in that The converting the modified system API code into system API data in a specific format includes: The modified system API code is converted into system API data in a specific format through a third-party tool.

3. The method according to claim 2, It is characterized in that The method of converting the modified system API code into system API data in a specific format through a third-party tool includes: Use a third-party tool to convert the modified system API code into system API data in a specific format through Convert; The system API data is stored in the encoding area.

4. The method according to claim 1, It is characterized in that The method of updating the system API data to the coding area by means of a local COS upgrade to complete the Java application upgrade includes; The system API data is updated to the coding area by means of local APDU upgrade to complete the Java application upgrade.

5. The method according to any one of claims 1 to 4, It is characterized in that The smart card includes the coding area and the data area, the Java application exists in the data area, and the coding area and the data area are independent of each other.

6. A smart card Java application upgrade device, It is characterized in that The device comprises: A modification module, used to modify the system API code of the smart card according to the Java application upgrade requirements; A conversion module, used for converting the modified system API code into system API data in a specific format; An acquisition module, used to acquire newly added index information corresponding to the system API data; A writing module is used to reserve an update index area in a mapping relationship table of the coding area, wherein the mapping relationship table is used to determine a mapping relationship between index information and a data storage address; determine that the original index information corresponds to the original index area in the mapping relationship table; set the update index area after the original index area; write the newly added index information to the update index area so that the newly added index information is arranged after the original index information, wherein the update index area is located in the coding area of ​​the smart card; An update module is used to update the system API data to the coding area through a local COS upgrade to complete the Java application upgrade; or to update the system API data to the coding area through an online COS upgrade to complete the Java application upgrade.

7. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the smart card Java application upgrade method according to any one of claims 1 to 5 when executing the computer program.

8. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method for upgrading the smart card Java application according to any one of claims 1 to 5 is implemented.