[go: up one dir, main page]

CN103309696B - Method and device for updating Java card extended library, and Java card - Google Patents

Method and device for updating Java card extended library, and Java card Download PDF

Info

Publication number
CN103309696B
CN103309696B CN201210068799.9A CN201210068799A CN103309696B CN 103309696 B CN103309696 B CN 103309696B CN 201210068799 A CN201210068799 A CN 201210068799A CN 103309696 B CN103309696 B CN 103309696B
Authority
CN
China
Prior art keywords
expanding library
library
expanding
java card
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210068799.9A
Other languages
Chinese (zh)
Other versions
CN103309696A (en
Inventor
乐祖晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201210068799.9A priority Critical patent/CN103309696B/en
Publication of CN103309696A publication Critical patent/CN103309696A/en
Application granted granted Critical
Publication of CN103309696B publication Critical patent/CN103309696B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The invention discloses a method for updating a Java card extended library. The method comprises the following steps: A, obtaining a reference relationship between an extended library to be updated and an application and/or embodiment and/or a second extended library; obtaining a first mapping relationship of all methods and memory addresses thereof in the extended library to be updated; B, updating the extended library, and establishing a second mapping relationship between all the methods in the extended library after being updated and memory addresses thereof according to the memory state of the extended library after being updated; C, updating the corresponding information of the memory addresses aiming at the methods in the extended library in the application and/or embodiment and/or extended library according to the reference relationship and the second mapping relationship. According to the method, the files of the extended library in the Java card can be updated under the condition that the application and embodiment are not deleted. Moreover, the invention also discloses a device for updating the Java card extended library, and a Java card.

Description

一种Java卡扩展库更新方法、装置和Java卡A Java card expansion library update method, device and Java card

技术领域technical field

本发明涉及一种更新Java Card扩展库的方法,属于数据业务领域。The invention relates to a method for updating a Java Card extension library, which belongs to the field of data business.

背景技术Background technique

Java卡是Sun公司为智能卡开发平台制定的一个开放标准。使用Java卡平台创建的智能卡上存有Java applet。在卡发行后也可以把applet加到卡上或修改卡上已有的applet。它们把数据存储在一个集成的微处理器芯片里。然后applet被下载到微处理器的内存里,由Java虚拟机来运行。类似于另一个智能卡的开发技术MULTOS,Java卡使多个应用程序被安装并且各自独立地共存。每个applet都被防火墙保护以维护其完整性以及防止干扰。应用程序可以动态地升级。Java Card is an open standard developed by Sun Corporation for the smart card development platform. Smart cards created using the Java Card platform have Java applets stored on them. It is also possible to add applets to the card or modify existing applets on the card after the card is issued. They store data in an integrated microprocessor chip. The applet is then downloaded into the microprocessor's memory and run by the Java virtual machine. Similar to MULTOS, another smart card development technology, Java Card enables multiple applications to be installed and coexist independently. Each applet is protected by a firewall to maintain its integrity and prevent interference. Applications can be dynamically upgraded.

如图1所示,Java卡中包含标准库(Standard Library)及扩展库(ExtensionalLibrary),应用(Applet)通过引用可调用库提供的API(Application ProgrammingInterface)接口,创建一个或多个实例(Instance),其中,图2展现了一种标准的Java卡的构成图,其包括:卡硬件(SMART CARD HW AND NATIVE SYSTEM)、Java卡虚拟机(Java CardVM BYTECODE INTERETER)、本地方法(NATIVE METHOD)、系统库(SYSTEM CLASSES)、安装管理器(INSTALLER)、标准Java卡API(FRAMEWORK CLASSES APIS)、扩展库(INDUSTRYSPECIFIC EXTENSIONS),其中,一般地,系统库中存在着applet management、transactionmanagement、I/O network communication以及其他services,一般地,Java卡的API为智能卡指定了一个Java语言的特殊子集,同时由于Java虚拟机的使用,上述applet能够得到跨平台的运行。As shown in Figure 1, the Java Card contains the Standard Library and the Extensional Library. The application (Applet) creates one or more instances (Instance) by referring to the API (Application Programming Interface) interface provided by the callable library. , wherein, Fig. 2 shows a composition diagram of a standard Java card, which includes: card hardware (SMART CARD HW AND NATIVE SYSTEM), Java card virtual machine (Java CardVM BYTECODE INTERETER), local method (NATIVE METHOD), system Library (SYSTEM CLASSES), installation manager (INSTALLER), standard Java card API (FRAMEWORK CLASSES APIS), extension library (INDUSTRYSPECIFIC EXTENSIONS), among them, generally, there are applet management, transaction management, I/O network communication in the system library As well as other services, in general, the Java Card API specifies a special subset of the Java language for smart cards, and due to the use of the Java virtual machine, the above applets can be run across platforms.

其中,Java虚拟机实现了卡接口的统一和编程语言的统一,其中,API接口主要负责执行Java卡applet以及提供applet执行所需要的环境,其中,扩展库则是服务方提供的类,使得企业和公司能够提供属于自己的服务程序,这些类在本申请中简称方法(method),其在Java卡中存在对应的地址;而Java卡applet即是开发的应用,其中,每个applet与扩展库中的方法具有一定的引用关系,且上述applet通过引用方法的地址信息执行相关的方法,其中,Java卡的执行环境并不支持多线程,所以一次只能执行一个Applet,且每个applet之间都有防火墙的阻隔。Among them, the Java virtual machine realizes the unification of the card interface and the unification of the programming language. Among them, the API interface is mainly responsible for executing the Java card applet and providing the environment required for applet execution. Among them, the extension library is the class provided by the server, so that the enterprise And companies can provide their own service programs, these classes are referred to as methods in this application, and there are corresponding addresses in the Java Card; and the Java Card applet is the application developed, wherein each applet and the extended library The methods in have a certain reference relationship, and the above applet executes the related methods by referring to the address information of the method. Among them, the execution environment of the Java Card does not support multi-threading, so only one Applet can be executed at a time, and each applet There are firewalls blocking.

目前,若要更新Java卡中的扩展库,必须先删除引用它的实例及应用。如图3所示,如要更新扩展库,必须先删除实例(Instance),接下来删除Applet2、Applet3,然后再删除扩展库;重新安装扩展库,安装Applet2、Applet3,安装Instance。At present, if you want to update the extended library in Java Card, you must first delete the instances and applications that reference it. As shown in Figure 3, if you want to update the extension library, you must first delete the instance (Instance), then delete Applet2, Applet3, and then delete the extension library; reinstall the extension library, install Applet2, Applet3, and install Instance.

其中,在库的安装过程中,需要设置一个引用关系表,将库的名字转换成引用项,将方法转换成实际的调用地址;Java程序在更新库时,需要删除对应表项中的内容。Among them, during the installation process of the library, a reference relationship table needs to be set to convert the name of the library into a reference item, and convert the method into an actual calling address; when the Java program updates the library, it needs to delete the contents of the corresponding table item.

从上述描述中可以发现,现有技术存在的问题:From the above description, it can be found that the problems in the prior art:

1)要更新扩展库,必须先删除引用该扩展库的实例、应用/扩展库;1) To update the extension library, you must first delete the instance, application/extension library that references the extension library;

2)要删除实例,必须先备份(迁出)实例数据,待重新安装实例后再恢复(迁入)实例数据;当扩展库被大量应用及实例引用时,这一操作将变得异常繁琐,甚至不可执行。2) To delete an instance, you must first back up (move out) the instance data, and then restore (move in) the instance data after reinstalling the instance; when the extended library is referenced by a large number of applications and instances, this operation will become extremely cumbersome. Not even executable.

发明内容Contents of the invention

本发明要解决的技术问题是更新扩展库时无需先删除引用它的实例及应用,并且,该方法不会因为更新扩展库造成Java卡出现工作异常。The technical problem to be solved by the present invention is that it is not necessary to delete instances and applications referencing it when updating the extended library, and the method will not cause Java cards to work abnormally due to updating the extended library.

其中,根据本发明的一个目的,本发明提供了一种Java卡扩展库更新方法,包括:Wherein, according to an object of the present invention, the present invention provides a kind of Java card extension storehouse update method, comprising:

A、获取待更新的扩展库与应用和/或实例和/或第二扩展库的引用关系;获取所述待更新的扩展库中的所有方法及其存储地址的第一映射关系;A. Obtain the reference relationship between the extension library to be updated and the application and/or instance and/or the second extension library; obtain the first mapping relationship between all methods in the extension library to be updated and their storage addresses;

B、更新所述扩展库,根据更新后的扩展库的存储状态建立更新后的扩展库中的所有方法和其存储地址之间的第二映射关系;B. Update the extended library, and establish a second mapping relationship between all methods in the updated extended library and their storage addresses according to the storage state of the updated extended library;

C、根据所述引用关系和第二映射关系,更新上述应用和/或实例和/或扩展库中针对所述扩展库中的方法所对应的存储地址信息。C. According to the reference relationship and the second mapping relationship, update the storage address information corresponding to the method in the extension library in the above application and/or instance and/or extension library.

其中,优选的是,在步骤A中,还包括:禁用上述应用和/或实例和/或第二扩展库在所述Java卡中的运行。Wherein, preferably, in step A, further comprising: disabling the running of the above-mentioned application and/or instance and/or the second extension library in the Java card.

其中,优选的是,所述应用和/或实例和/或第二扩展库直接或者间接引用所述扩展库中的一个或者多个方法,其中,所述应用和/或实例和/或第二扩展库通过引用所述方法的存储地址信息执行对应的方法。Wherein, preferably, the application and/or instance and/or the second extension library directly or indirectly references one or more methods in the extension library, wherein the application and/or instance and/or the second extension library The extension library executes the corresponding method by referring to the storage address information of the method.

其中,优选的是,步骤A中,具体包括:Wherein, preferably, in step A, specifically include:

遍历Java卡上以第一扩展库为根的所有应用、扩展库及实例,获取并保存所述应用、第二扩展库及实例与所述扩展库之间的引用关系;Traversing all applications, extension libraries and instances on the Java card with the first extension library as the root, obtaining and saving the reference relationship between the application, the second extension library and instances and the extension library;

根据第一扩展库的存储信息获取第一扩展库中的方法和其存储地址之间的第一映射关系。The first mapping relationship between the methods in the first extension library and their storage addresses is obtained according to the storage information of the first extension library.

其中,优选的是,步骤C中,具体包括:Wherein, preferably, in step C, specifically include:

根据所述引用关系获取引用所述第一扩展库的所有应用、扩展库和实例;根据所述第二映射关系将所述应用、扩展库和实例中引用的方法的旧的物理地址修改为新的物理地址,同时将这些应用、扩展库及实例的状态修改为启用状态。Obtain all applications, extension libraries and instances that refer to the first extension library according to the reference relationship; modify the old physical addresses of the methods referenced in the applications, extension libraries and instances to new ones according to the second mapping relationship , and modify the state of these applications, extension libraries, and instances to the enabled state.

其中,优选的是,进一步还包括:Among them, preferably, further include:

检查应用和/或实例和/或第二扩展库中对应的方法和更新后的第一扩展库中的方法之间的对应关系;Checking the corresponding relationship between the application and/or the instance and/or the corresponding method in the second extension library and the updated method in the first extension library;

其中,当在所述更新后的第一扩展库中不存在相应的方法时,发出提示Java扩展库更新失败的报警信息。Wherein, when there is no corresponding method in the updated first extension library, an alarm message is issued to prompt that the update of the Java extension library fails.

其中,优选的是,步骤C之中,在上述存储地址信息更新完成后,还包括:Wherein, preferably, in step C, after the update of the above-mentioned storage address information is completed, it further includes:

所述应用和/或实例和/或第二扩展库根据更新后的地址信息,进行对应的应用和/或实例和/或第二扩展库在Java卡中的运行。The application and/or instance and/or the second extension library executes the corresponding application and/or instance and/or the second extension library in the Java card according to the updated address information.

本申请通过上述方法的引用关系,进而替换掉对应的方法的旧的地址信息,从而使得更新后的扩展库能够被原先的应用和/或实例和/或其他扩展库所引用,该种方法克服了现有技术必须删除旧有的应用、实例和扩展库方可以更新扩展库的缺点,具有很好的技术效果。This application replaces the old address information of the corresponding method through the reference relationship of the above methods, so that the updated extension library can be referenced by the original application and/or instance and/or other extension libraries. This method overcomes the The disadvantage of the existing technology that the extended library can be updated only by deleting old applications, instances and extended libraries has a good technical effect.

此外,本发明还提供了一种Java卡中扩展库更新装置,包括:In addition, the present invention also provides a kind of expansion library updating device in Java card, comprising:

关联关系管理单元,用于获取待更新的第一扩展库与应用和/或实例和/或第二扩展库的引用关系;An association relationship management unit, configured to obtain a reference relationship between the first extension library to be updated and the application and/or instance and/or the second extension library;

地址关系获取单元,用于获取第一扩展库中的方法及其存储地址之间的第一映射关系;An address relationship acquiring unit, configured to acquire a first mapping relationship between methods in the first extended library and their storage addresses;

扩展库安装单元,用于删除旧的第一扩展库并安装新的第一扩展库;An extension library installation unit, used to delete the old first extension library and install a new first extension library;

所述地址关系获取单元,还用于根据更新后的第一扩展库的存储信息建立更新后的第一扩展库中的方法和其存储地址之间的第二映射关系;The address relationship obtaining unit is further configured to establish a second mapping relationship between the methods in the updated first extended library and their storage addresses according to the storage information of the updated first extended library;

地址信息更新单元,用于根据所述引用关系和第二映射关系,更新上述应用和/或实例和/或第二扩展库中针对所述第一扩展库中的方法所对应的存储地址信息。The address information updating unit is configured to update the storage address information in the application and/or instance and/or the second extension library corresponding to the method in the first extension library according to the reference relationship and the second mapping relationship.

其中,优选的是,还包括:状态管理单元,用于禁用或者启动上述应用和/或实例和/或第二扩展库的运行。Wherein, preferably, it further includes: a state management unit, configured to disable or start the operation of the above-mentioned application and/or instance and/or the second extension library.

其中,优选的是,所述应用和/或实例和/或第二扩展库直接或者间接引用所述第一扩展库中的一个或者多个方法。Wherein, preferably, the application and/or instance and/or the second extension library directly or indirectly references one or more methods in the first extension library.

其中,优选的是,还包括:应用方法地址管理单元,用于保存所述应用和/或实例和/或第二扩展库中包含有所述一个或者多个方法的存储地址信息。Wherein, preferably, it further includes: an application method address management unit, configured to save the storage address information of the application and/or instance and/or the second extension library containing the one or more methods.

其中,优选的是,还包括:Among them, preferably, also include:

对应关系检测单元,用于检查应用和/或实例和/或第二扩展库中对应的方法和更新后的第一扩展库中的方法之间的对应关系;A correspondence detection unit, configured to check the correspondence between the application and/or instance and/or the corresponding method in the second extension library and the updated method in the first extension library;

信息报警单元,用于当在所述更新后的第一扩展库中不存在相应的方法时,发出提示Java扩展库更新失败的报警信息。The information alarm unit is configured to issue an alarm message prompting that the update of the Java extension library fails when there is no corresponding method in the updated first extension library.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

附图说明Description of drawings

下面结合附图对本发明进行详细的描述,以使得本发明的上述优点更加明确。The present invention will be described in detail below in conjunction with the accompanying drawings, so as to make the above-mentioned advantages of the present invention clearer.

图1是现有技术中一个Java卡的示意图;Fig. 1 is the schematic diagram of a Java card in the prior art;

图2是现有技术中一个Java卡的结构示意图Fig. 2 is a structural representation of a Java Card in the prior art

图3是现有技术中一个Java卡中扩展库的更新示意图;Fig. 3 is the update schematic diagram of the extension library in a Java card in the prior art;

图4是本发明Java卡中扩展库更新方法的流程示意图Fig. 4 is the schematic flow chart of the extension library updating method in the Java card of the present invention

图5是本发明一个实施例的Java卡中扩展库的更新方法流程示意图;Fig. 5 is a schematic flow chart of the update method of the extended library in the Java card of an embodiment of the present invention;

图6是本发明一个实施例中Java卡中扩展库的更新装置的结构示意图。Fig. 6 is a schematic structural diagram of an updating device for an extension library in a Java Card in an embodiment of the present invention.

具体实施方式detailed description

以下结合附图和具体实施例对本发明进行详细的说明。The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments.

方法实施例一:Method embodiment one:

图4是本发明Java卡中扩展库更新方法的流程示意图;Fig. 4 is the schematic flow chart of the extension library updating method in the Java card of the present invention;

如图4所示,所示Java卡中扩展库更新方法,主要包括:As shown in Figure 4, the method for updating the extended library in the Java card mainly includes:

S101:获取待更新的扩展库与应用和/或实例和/或第二扩展库的引用关系;包括:遍历Java卡上以第一扩展库为根的所有应用、扩展库及实例,获取并保存所述应用、第二扩展库及实例与所述扩展库之间的引用关系;S101: Obtain the reference relationship between the extended library to be updated and the application and/or instance and/or the second extended library; including: traversing all applications, extended libraries and instances on the Java card with the first extended library as the root, obtaining and saving The reference relationship between the application, the second extension library and the instance, and the extension library;

S102:获取所述待更新的扩展库中的所有方法及其存储地址的第一映射关系;包括:根据扩展库的存储信息获取第一扩展库中的方法和其存储地址之间的第一映射关系。S102: Obtain the first mapping relationship between all the methods in the extended library to be updated and their storage addresses; including: obtaining the first mapping between the methods in the first extended library and their storage addresses according to the storage information of the extended library relation.

S103:更新所述扩展库,S103: updating the extended library,

包括:删除旧的扩展库并用新的扩展库替换掉旧有的扩展库,其中,所述新的扩展库具有旧的扩展库所有的方法;Including: deleting the old extension library and replacing the old extension library with a new extension library, wherein the new extension library has all the methods of the old extension library;

S104:根据更新后的扩展库的存储状态建立更新后的扩展库中的所有方法和其存储地址之间的第二映射关系;S104: Establish a second mapping relationship between all methods in the updated extended library and their storage addresses according to the storage state of the updated extended library;

S105:根据所述引用关系和第二映射关系,更新上述应用和/或实例和/或扩展库中针对所述扩展库中的方法所对应的存储地址信息。S105: According to the reference relationship and the second mapping relationship, update the storage address information corresponding to the method in the extension library in the above application and/or instance and/or extension library.

其中,本申请通过上述方法的引用关系,进而替换掉对应的方法的旧的地址信息,从而使得更新后的扩展库能够被原先的应用和/或实例和/或其他扩展库所引用,该种方法克服了现有技术必须删除旧有的应用、实例和扩展库方可以更新扩展库的缺点,具有很好的技术效果。Among them, the present application replaces the old address information of the corresponding method through the reference relationship of the above methods, so that the updated extension library can be referenced by the original application and/or instance and/or other extension libraries. The method overcomes the disadvantage of the prior art that the old application, instance and extension library must be deleted before the extension library can be updated, and has a good technical effect.

其中,可以理解的是,在S101之前,需要禁用上述应用和/或实例和/或第二扩展库在所述Java卡中的运行,以便于获取和保存上述引用关系和/或地址和方法之间的对应关系。Wherein, it can be understood that, before S101, it is necessary to disable the running of the above-mentioned application and/or instance and/or the second extension library in the Java card, so as to obtain and save the above-mentioned reference relationship and/or address and method Correspondence between.

其中所述应用和/或实例和/或第二扩展库直接或者间接引用所述扩展库中的一个或者多个方法,其中,所述应用和/或实例和/或第二扩展库通过引用所述方法的存储地址信息执行对应的方法。Wherein the application and/or instance and/or the second extension library directly or indirectly references one or more methods in the extension library, wherein the application and/or example and/or the second extension library refer to the Execute the corresponding method according to the storage address information of the above method.

其中,S105中,具体包括:Among them, S105 specifically includes:

根据所述引用关系获取引用所述第一扩展库的所有应用、扩展库和实例;根据所述第二映射关系将所述应用、扩展库和实例中引用的方法的旧的物理地址修改为新的物理地址,同时将这些应用、扩展库及实例的状态修改为启用状态。Obtain all applications, extension libraries and instances that refer to the first extension library according to the reference relationship; modify the old physical addresses of the methods referenced in the applications, extension libraries and instances to new ones according to the second mapping relationship , and modify the state of these applications, extension libraries, and instances to the enabled state.

此外,为了尽可能降低出错的频率,在更新完成以后或者在更新之前,需要检查应用和/或实例和/或第二扩展库中对应的方法和更新后的第一扩展库中的方法之间的对应关系;In addition, in order to reduce the frequency of errors as much as possible, after the update is completed or before the update, it is necessary to check the relationship between the corresponding method in the application and/or instance and/or the second extension library and the updated method in the first extension library corresponding relationship;

其中,当在所述更新后的第一扩展库中不存在相应的方法时,发出提示Java扩展库更新失败的报警信息。Wherein, when there is no corresponding method in the updated first extension library, an alarm message is issued to prompt that the update of the Java extension library fails.

并且,上述存储地址信息更改完成以后,所述应用和/或实例和/或第二扩展库根据更新后的地址信息,进行对应的应用和/或实例和/或第二扩展库在Java卡中的运行。And, after the modification of the above-mentioned storage address information is completed, the application and/or instance and/or the second extension library performs corresponding application and/or instance and/or the second extension library in the Java card according to the updated address information. running.

其中,本发明采取了上述的更新方法以后,其更新扩展库时无需先删除引用它的实例及应用;并且,该发明不会因为更新扩展库造成Java卡出现工作异常,具有很好的技术优点。Wherein, after the present invention adopts the above-mentioned update method, it is not necessary to delete the instances and applications referencing it when updating the extended library; moreover, this invention will not cause the Java card to work abnormally due to the updated extended library, which has very good technical advantages .

方法实施例二:Method embodiment two:

其中,结合更具体的实施例对本发明进行详细说明;图5是本发明一个实施例的Java卡中扩展库的更新方法流程示意图。Wherein, the present invention is described in detail in combination with more specific embodiments; FIG. 5 is a schematic flowchart of a method for updating an extension library in a Java Card according to an embodiment of the present invention.

其中,所述方法包括两个主要的步骤,其中,S101~S102主要涉及到更新扩展库之前的操作,具体如下:Wherein, the method includes two main steps, wherein, S101-S102 mainly relate to the operation before updating the extension library, specifically as follows:

修改状态:检查卡上以该扩展库为根的所有应用、扩展库及实例,将这些应用、扩展库及实例的状态修改为禁用状态;Modify status: Check all applications, extension libraries and instances on the card that take the extension library as the root, and modify the status of these applications, extension libraries and instances to disabled status;

也就是,S1011:保存库中的方法和库的实际地址之间的引用关系,即哪些应用、扩展库引用了该扩展库,并将上述信息放入到一个引用关系表中;That is, S1011: save the reference relationship between the methods in the library and the actual address of the library, that is, which applications and extension libraries refer to the extension library, and put the above information into a reference relationship table;

S1022:保存该扩展库的方法及旧真实地址的映射关系表,即:method—addressold的一个对应关系;删除扩展库。S1022: Save the method of the extended library and the mapping relationship table of the old real address, that is, a corresponding relationship of method-addressold; delete the extended library.

其中,所谓的原子操作,指上述操作要么全部执行成功,要么不执行,不会出现执行一半无法恢复的情况,下同。Among them, the so-called atomic operation means that the above operations are either all executed successfully, or not executed, and there will be no situation where half of the execution cannot be recovered, the same below.

步骤S103~S105涉及到更新扩展库的主要步骤,其中,在一个具体的实施例中,主要执行以下的原子操作:Steps S103-S105 involve the main steps of updating the extended library, wherein, in a specific embodiment, the following atomic operations are mainly performed:

安装扩展库;Install the extension library;

形成该扩展库中的方法及新真实地址的映射关系表,即:method—address new;Form the mapping relationship table between the method in the extended library and the new real address, namely: method—address new;

根据之前保存的引用关系表,遍历所有引用该扩展库的应用及扩展库,将addressold修改为address new;According to the previously saved reference relationship table, traverse all applications and extension libraries that reference the extension library, and change addressold to address new;

将这些应用、扩展库及实例的状态修改为启用状态。Change the status of these apps, extensions, and instances to enabled.

其中,同样可以理解的是,为避免因更新库而造成原有应用、扩展库调用的方法出现更新或删除的情况,必须在安装库之前执行检查操作,若出现上述情况则提示更新失败。Among them, it is also understandable that in order to avoid updating or deleting the methods called by the original application and the extended library due to updating the library, a check operation must be performed before installing the library. If the above situation occurs, it will prompt that the update fails.

其中,本案改进了Java卡的库的更新方法,无需删除过多的应用和个人数据,其解决了现有的Java程序中更新库的机制,不按照现有树形结构的顺序删除机制,适用于特定场景,有很好的优点。Among them, this case improves the update method of the library of the Java card without deleting too many applications and personal data. It solves the mechanism of updating the library in the existing Java program. For specific scenarios, it has very good advantages.

装置实施例一:Device embodiment one:

其中,本发明还公开了一种Java卡,其包括一个或多个扩展库和应用和/或实例,并且,还设有一个扩展库更新装置,由于在不删除应用的情况下更新Java卡中的一个或者多个扩展库。Among them, the present invention also discloses a Java card, which includes one or more extended libraries and applications and/or examples, and is also provided with an extended library update device, because the Java card can be updated without deleting the application. One or more extension libraries for .

其中,图6是本发明一个实施例中Java卡中扩展库的更新装置的结构示意图;Wherein, Fig. 6 is a schematic structural diagram of an updating device for an extended library in a Java card in an embodiment of the present invention;

如图6所示,所述更新装置,具体包括:As shown in Figure 6, the update device specifically includes:

关联关系管理单元,用于获取待更新的第一扩展库与应用和/或实例和/或第二扩展库的引用关系;An association relationship management unit, configured to obtain a reference relationship between the first extension library to be updated and the application and/or instance and/or the second extension library;

地址关系获取单元,用于获取第一扩展库中的方法及其存储地址之间的第一映射关系;An address relationship acquiring unit, configured to acquire a first mapping relationship between methods in the first extended library and their storage addresses;

扩展库安装单元,用于删除旧的第一扩展库并安装新的第一扩展库;An extension library installation unit, used to delete the old first extension library and install a new first extension library;

所述地址关系获取单元,还用于根据更新后的第一扩展库的存储信息建立更新后的第一扩展库中的方法和其存储地址之间的第二映射关系;The address relationship obtaining unit is further configured to establish a second mapping relationship between the methods in the updated first extended library and their storage addresses according to the storage information of the updated first extended library;

地址信息更新单元,用于根据所述引用关系和第二映射关系,更新上述应用和/或实例和/或第二扩展库中针对所述第一扩展库中的方法所对应的存储地址信息。The address information updating unit is configured to update the storage address information in the application and/or instance and/or the second extension library corresponding to the method in the first extension library according to the reference relationship and the second mapping relationship.

其中,还包括:状态管理单元,用于禁用或者启动上述应用和/或实例和/或第二扩展库的运行。Wherein, it also includes: a state management unit, configured to disable or start the operation of the above-mentioned application and/or instance and/or the second extension library.

其中,所述应用和/或实例和/或第二扩展库直接或者间接引用所述第一扩展库中的一个或者多个方法。Wherein, the application and/or instance and/or the second extension library directly or indirectly references one or more methods in the first extension library.

其中,还包括:应用方法地址管理单元,用于保存所述应用和/或实例和/或第二扩展库中包含有所述一个或者多个方法的存储地址信息。Wherein, it further includes: an application method address management unit, configured to save the storage address information of the application and/or instance and/or the second extension library containing the one or more methods.

其中,还包括:Among them, also include:

对应关系检测单元,用于检查应用和/或实例和/或第二扩展库中对应的方法和更新后的第一扩展库中的方法之间的对应关系;A correspondence detection unit, configured to check the correspondence between the application and/or instance and/or the corresponding method in the second extension library and the updated method in the first extension library;

信息报警单元,用于当在所述更新后的第一扩展库中不存在相应的方法时,发出提示Java扩展库更新失败的报警信息。The information alarm unit is configured to issue an alarm message prompting that the update of the Java extension library fails when there is no corresponding method in the updated first extension library.

其中,本发明采取了上述的更新装置以后,其更新扩展库时无需先删除引用它的实例及应用;并且,该发明不会因为更新扩展库造成Java卡出现工作异常,具有很好的技术优点。Among them, after the present invention adopts the above-mentioned update device, it does not need to delete the instances and applications that refer to it when updating the extended library; and this invention will not cause the Java card to work abnormally due to the updated extended library, which has good technical advantages .

其中,本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:只读存储器(Read Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟、终端手机软件或者光盘等各种可以存储程序代码的介质。Wherein, those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, , performing the steps comprising the above-mentioned method embodiment; and the aforementioned storage medium includes: a read-only memory (Read Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a magnetic disk, a terminal mobile phone software or an optical disk Various media that can store program codes.

最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Finally, it should be noted that: the above is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, for those skilled in the art, it still The technical solutions recorded in the foregoing embodiments may be modified, or some technical features thereof may be equivalently replaced. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (13)

1. a kind of Java card expanding library update method, including:
A, acquisition the first expanding library to be updated and the adduction relationship of application and/or example and/or the second expanding library;Obtain described All methods in the first expanding library to be updated and the first mapping relations of its storage address;
B, described first expanding library of renewal, set up the first extension after updating according to the storage state of the first expanding library after updating The second mapping relations between all methods in storehouse and its storage address;
C, according to described adduction relationship and the second mapping relations, update pin in above-mentioned application and/or example and/or the second expanding library To the storage address information corresponding to the method in described first expanding library.
2. Java card expanding library update method according to claim 1, in step, also includes:Disable above-mentioned application And/or the operation in described Java card of example and/or the second expanding library.
3. Java card expanding library update method according to claim 1 and 2 is it is characterised in that described application and/or example And/or second expanding library directly or indirectly quote one of described first expanding library or multiple method, wherein, described should With and/or example and/or the second expanding library corresponding method is executed by the storage address information quoting methods described.
4. Java card expanding library update method according to claim 1 is it is characterised in that in step A, specifically include:
All applications with the first expanding library as root, the second expanding library and example on traversal Java card, obtain and preserve described answering With the adduction relationship between, the second expanding library and example and described first expanding library;
Storage information according to the first expanding library obtains the first mapping between method and its storage address in the first expanding library Relation.
5. Java card expanding library update method according to claim 1 is it is characterised in that in step C, specifically include:
Obtain all applications, the second expanding library and the example quoting described first expanding library according to described adduction relationship;
According to described second mapping relations by the old physical address of the method quoted in described application, the second expanding library and example It is revised as new physical address, these are applied, the status modifier of the second expanding library and example is to enable state simultaneously.
6. Java card expanding library update method according to claim 1 is it is characterised in that further comprise:
Check application and/or example and/or the second expanding library in corresponding method and update after the first expanding library in method Between corresponding relation;
Wherein, when there is not corresponding method in the first expanding library after described renewal, send prompting Java expanding library more The warning message of new failure.
7. Java card expanding library update method according to claim 6 is it is characterised in that in above-mentioned storage address information more After the completion of new, also include:
Described application and/or example and/or the second expanding library according to the address information after updating, carry out corresponding application and/or The operation in Java card of example and/or the second expanding library.
8. a kind of Java card expanding library updating device, including:
Incidence relation administrative unit, for obtaining the first expanding library to be updated and application and/or example and/or the second expanding library Adduction relationship;
Address relationship acquiring unit, closes for obtaining the first mapping between the method in the first expanding library and its storage address System;
Expanding library installation unit, for deleting the first old expanding library and installing the first new expanding library;
Described address relationship acquiring unit, is additionally operable to set up the after updating according to the storage information of the first expanding library after updating The second mapping relations between method in one expanding library and its storage address;
Address information updating block, for according to described adduction relationship and the second mapping relations, updating above-mentioned application and/or example And/or second in expanding library for the storage address information corresponding to method in described first expanding library.
9. Java card expanding library updating device according to claim 8 is it is characterised in that also include:State managing unit, For disabling or starting the operation of above-mentioned application and/or example and/or the second expanding library.
10. Java card expanding library updating device according to claim 9 is it is characterised in that described application and/or example And/or second expanding library directly or indirectly quote one of described first expanding library or multiple method.
11. Java card expanding library updating devices according to claim 10 are it is characterised in that also include:Application process ground Location administrative unit, includes one or more of sides for preserving in described application and/or example and/or the second expanding library The storage address information of method.
12. Java card expanding library updating devices according to claim 10 are it is characterised in that also include:
Corresponding relation detector unit, after corresponding method in inspection application and/or example and/or the second expanding library and renewal The first expanding library in method between corresponding relation;
Information alert unit, for when there is not corresponding method in the first expanding library after described renewal, sending prompting Java expanding library updates the warning message of failure.
A kind of 13. Java card, want it is characterised in that being additionally provided with right including one or more expanding libraries and application and/or example Seek 8~12 arbitrary described expanding library updating devices.
CN201210068799.9A 2012-03-15 2012-03-15 Method and device for updating Java card extended library, and Java card Active CN103309696B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210068799.9A CN103309696B (en) 2012-03-15 2012-03-15 Method and device for updating Java card extended library, and Java card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210068799.9A CN103309696B (en) 2012-03-15 2012-03-15 Method and device for updating Java card extended library, and Java card

Publications (2)

Publication Number Publication Date
CN103309696A CN103309696A (en) 2013-09-18
CN103309696B true CN103309696B (en) 2017-02-08

Family

ID=49134957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210068799.9A Active CN103309696B (en) 2012-03-15 2012-03-15 Method and device for updating Java card extended library, and Java card

Country Status (1)

Country Link
CN (1) CN103309696B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761126B (en) * 2014-01-07 2017-03-15 中国神华能源股份有限公司 The upgrade method of application program and device
CN104793964B (en) * 2014-01-16 2018-10-02 国民技术股份有限公司 Java cards and its application update method, the terminal applied to java cards, smart card system
CN104331275B (en) * 2014-08-26 2018-10-12 大唐微电子技术有限公司 A kind of Java card and its method using patch installing
CN105630516A (en) * 2014-10-28 2016-06-01 苏州融卡智能科技有限公司 Patch upgrading method suitable for application software in JAVA card
CN106227576A (en) * 2016-08-18 2016-12-14 北京智芯微电子科技有限公司 The function realizing method of a kind of Java card application and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1763716A (en) * 2004-10-21 2006-04-26 株式会社东芝 Portable electronic device and method for updating application programs in portable electronic device
US7191288B2 (en) * 2004-02-24 2007-03-13 Sun Microsystems, Inc. Method and apparatus for providing an application on a smart card
CN101895883A (en) * 2010-06-04 2010-11-24 中国联合网络通信集团有限公司 Smart card supporting authentication arithmetic update and method for updating authentication arithmetic
CN102243595A (en) * 2011-08-03 2011-11-16 浙江大学 Method for updating Java Card system component based on memory management unit (MMU) framework

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7191288B2 (en) * 2004-02-24 2007-03-13 Sun Microsystems, Inc. Method and apparatus for providing an application on a smart card
CN1763716A (en) * 2004-10-21 2006-04-26 株式会社东芝 Portable electronic device and method for updating application programs in portable electronic device
JP2006119901A (en) * 2004-10-21 2006-05-11 Toshiba Corp Portable electronic device and application updating method for portable electronic device
CN101895883A (en) * 2010-06-04 2010-11-24 中国联合网络通信集团有限公司 Smart card supporting authentication arithmetic update and method for updating authentication arithmetic
CN102243595A (en) * 2011-08-03 2011-11-16 浙江大学 Method for updating Java Card system component based on memory management unit (MMU) framework

Also Published As

Publication number Publication date
CN103309696A (en) 2013-09-18

Similar Documents

Publication Publication Date Title
CN107870968B (en) Performing real-time updates to a file system volume
US9804933B2 (en) System differential upgrade method, apparatus, and mobile terminal
US9003546B2 (en) Secured deletion of information
US8997047B2 (en) Dynamically updating code without requiring processes to restart
CN103309696B (en) Method and device for updating Java card extended library, and Java card
US20230036357A1 (en) Method and apparatus for authority control, computer device and storage medium
WO2015050620A2 (en) Method and system for backing up and restoring a virtual file system
CN109241731A (en) A kind of method for protecting privacy based on virtual application, device and storage medium
CN108614702B (en) Byte code optimization method and device
CN110333876A (en) A kind of data clearing method and control equipment
US12339951B2 (en) Enforcing policies for unmanaged applications
CN108228077B (en) Storage area management method, operating method, apparatus, device, and readable medium
US11977559B2 (en) Providing instant and distributed access to a source blob via copy-on-read blobs and link blobs
US10606612B2 (en) Context check bypass to enable opening shared-object libraries
CN103761118A (en) Intelligent card and method for deploying applications in same
CN109271792A (en) Terminal peripheral control method and device based on Android local layer hook
CN103309758B (en) A kind of mthods, systems and devices blocking application and download
CN111443945A (en) Component code modification method and device
JP7202543B2 (en) eUICC and eUICC provisioning methods
US9104518B2 (en) Wireless communication terminal and method for securely running industry software
CN110110503A (en) A kind of method and device of the control specific behavior for software
CN120358084B (en) Central authority service device, authority management method, device, equipment and medium
US20240144256A1 (en) Decentralized blockchain client authorization and authentication
CN116185462B (en) A method, system, computer and readable storage medium for upgrading front-end applications
KR102101041B1 (en) Security control apparatus and method for operating the same

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant