CN104331275B - A kind of Java card and its method using patch installing - Google Patents

A kind of Java card and its method using patch installing Download PDF

Info

Publication number
CN104331275B
CN104331275B CN201410425823.9A CN201410425823A CN104331275B CN 104331275 B CN104331275 B CN 104331275B CN 201410425823 A CN201410425823 A CN 201410425823A CN 104331275 B CN104331275 B CN 104331275B
Authority
CN
China
Prior art keywords
applet
file
application
specified
service packs
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
CN201410425823.9A
Other languages
Chinese (zh)
Other versions
CN104331275A (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.)
Datang Microelectronics Technology Co Ltd
Original Assignee
Datang Microelectronics Technology 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 Datang Microelectronics Technology Co Ltd filed Critical Datang Microelectronics Technology Co Ltd
Priority to CN201410425823.9A priority Critical patent/CN104331275B/en
Publication of CN104331275A publication Critical patent/CN104331275A/en
Application granted granted Critical
Publication of CN104331275B publication Critical patent/CN104331275B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

A kind of method that the present invention provides JAVA card and its application patch installing, this method include:The service packs of specified application is downloaded, the service packs includes applet (Applet) subclass for inheriting the specified application;The service packs is instantiated.The present invention devises efficient easy, the simple and practical commercially available application patch mechanism for JavaCard using inheritance;The layering that is designed in hard mask JAVA card built-in application APPLET, patch framework, can change the arbitrary levels problem in APPLET.

Description

A kind of Java card and its method using patch installing
Technical field
The present invention relates to field of intelligent cards, more particularly to a kind of Java card and its method of application patch installing.
Background technology
With being constantly progressive for science and technology, the application of smart card has been directed to the every field of human lives, such as business, The multiple fields such as medical treatment, insurance, traffic, social public utilities.Meanwhile the smart card quantity in user hand is also more and more, it is special Be not it is congener card since card image to be upgraded generally requires to change a neocaine so, how to efficiently use smart card, i.e., The patch mechanism for how designing smart card, to realize, update card application program is highly important project after hair fastener.
Under normal circumstances, block for NATIVE (nation method realization), if it find that COS (Card Operating System, card operation system) in have program error or need to increase new function and need to change certain functions or file, most Simple method is exactly again hair fastener, that is, recycles card, re-download COS.But work as card in user hand, at this moment, Card is not only recycled, the stages such as COS downloads, individualized are will also be subjected to, this just shows very troublesome.
Traditional patch design method is directly to reserve one section or multistage code in a program.In this way, when needing to download When patch, patch need to only be write in reserved address and go.But due to not can determine that generally in reserved code Future downloads the size and number of patch, so, this implementation method has certain limitation, moreover, the benefit downloaded in needs When fourth is larger or more, it is easier the case where code overlapping occur, COS is made to occur exception error in the process of implementation.
Also it has been proposed that by establishing PATCH (patch) function tables and the design calling patch in operating system master Interface realizes the download and management of patch, can carry out patch download according to different patch classified index, and no longer by The limitation of patch size, while supporting the download of multiple patches.
It is the development of NATIVE card patch mechanisms above, and for the JavaCard based on Object-Oriented Programming thought (Java card), since across CAP (Converted Applet the convert applet) limitation that packet accesses, almost there are no cut Real feasible patch mechanism.Cause JavaCard application and development flexibilities poor, especially in card mask completion or It goes wrong again after being delivered for use, modification difficulty can be very big, and it is long to change the period.For the purpose of safety, Java platform There is prodigious limitation to the structure of application, existing patch mechanism is all in theory stage, from efficiently easy, simple and practical mesh It marks and also has certain gap, still (JAVA programs have can dynamic using complete rear download when most Java Card COS go wrong The attribute of download, downloaded after complete i.e. will application program all carry out after download, abandon all application programs of mask) side Formula is modified.
Existing patch mechanism is only in theory stage, and the space cost for not being directed to the patch exploitation in later stage is considered, such as Fruit application goes wrong, and patch will be tight especially in commercial process by the valuable erasable storage region resource of a large amount of wastes Ghost image rings the competitiveness of card.
Invention content
The technical problem to be solved in the present invention is to provide a kind of JAVA card and its methods of application patch installing, with based on face Practicable patch mechanism is realized into the JavaCard of object programming idea.
In order to solve the above technical problem, the present invention provides a kind of methods of JAVA card application patch installing, including:
The service packs of specified application is downloaded, the service packs includes the small application for inheriting the specified application Program (Applet) subclass;
The service packs is instantiated.
Further, the above method also has the characteristics that following:The applet subclass includes:
The problems in the specified application rewritten subprogram.
Further, the above method also has the characteristics that following:
The specified application is to inherit the application program of the applet (Applet), is claimed as abstract category Property, it is stored in the first conversion applet file;
The application interface program of the specified application inherits the specified application, is stored in that the second conversion is small to answer With in program file;
The service packs of the specified application is stored in third conversion applet file.
To solve the above-mentioned problems, the present invention also provides a kind of JAVA cards, wherein including:
Download module, the service packs for downloading specified application, the service packs include inheriting described specify to answer With applet (Applet) subclass of program;
Module is instantiated, for being instantiated to the service packs.
Further, above-mentioned JAVA card also has the characteristics that following:
The applet subclass includes:The problems in the specified application rewritten subprogram.
Further, above-mentioned JAVA card also has the characteristics that following:Further include,
Memory module, for the specified application to be stored in the first conversion applet file, the finger It is to inherit the application program of the applet (Applet) to determine application program, is claimed as abstract attribute;Described specify is answered It is stored in the second conversion applet file with the application interface program of program, the application interface of the specified application Program inherits the specified application;The service packs of the specified application is stored in third conversion applet text In part.
To solve the above-mentioned problems, the present invention also provides a kind of methods of JAVA card application patch installing, including:
Download specified file service packs, the service packs include inherit the file subclass of the specified file, and after Hold applet (Applet) subclass for the application program for calling the specified file, the Applet subclasses are by the file The instance objects of subclass are assigned to the instance objects for calling the specified file in the application program;
The service packs is instantiated.
Further, the above method also has the characteristics that following:
The file subclass includes:Rewrite the specified file the problem of subprogram.
Further, the above method also has the characteristics that following:
The application program is to inherit the application program of the applet (Applet), is claimed as abstract attribute, puts In the first conversion applet file;
The service packs of the specified file is placed in the second Transformation Application program file.
To solve the above-mentioned problems, the present invention also provides a kind of JAVA cards, wherein including:
Download module, the service packs for downloading specified file, the service packs include inheriting the specified file File subclass, and inherit applet (Applet) subclass for the application program for calling the specified file, the Applet The instance objects of the file subclass are assigned to the example pair in the application program for calling the specified file by subclass As;
Module is instantiated, for being instantiated to the service packs.
Further, above-mentioned JAVA card also has the characteristics that following:
The file subclass includes:Rewrite the specified file the problem of function.
Further, above-mentioned JAVA card also has the characteristics that following:Further include:
Memory module, it is described to apply journey for the application program to be stored in the first conversion applet file Sequence is to inherit the application program of the applet (Applet), is claimed as abstract attribute;By the patch of the specified file Packet is stored in the second Transformation Application program file.
To sum up, the present invention provides a kind of JAVA card and its method using patch installing, is devised and is directed to using inheritance Efficient easy, the simple and practical commercially available application patch mechanism of JavaCard;Hard mask JAVA card built-in application APPLET The layering of middle design, patch framework, can change the arbitrary levels problem in APPLET.Consider that the exploitation of later stage patch is paid Space cost, design can using minimum space realization modification demand patch framework.Rational deployment first floor system and function letter Number, modularized processing code so that patch framework is simply apparent, shortens the development cycle.
Description of the drawings
Fig. 1 is a kind of flow chart of the method for JAVA card patch installing of the embodiment of the present invention one;
Fig. 2 is the patch Organization Chart of the embodiment of the present invention one;
Fig. 3 is that the present invention one applies exemplary patch Organization Chart;
Fig. 4 is a kind of flow chart of the method for JAVA card patch installing of the embodiment of the present invention two;
Fig. 5 is the patch Organization Chart of the embodiment of the present invention two.
Specific implementation mode
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature mutually can arbitrarily combine.
Fig. 1 is a kind of flow chart of the method for JAVA card patch installing of the embodiment of the present invention one, as shown in Figure 1, this implementation The method of example is to carry out patch installing for application program, be may comprise steps of:
Step 11, the service packs for downloading specified application, the service packs include inheriting the specified application Applet (Applet) subclass;
Step 12 instantiates the service packs.
The method of the present invention is described in detail with specific embodiment below.
In the present embodiment, JAVA APPLET can be finely divided by module, as illustrated in fig. 2, it is assumed that:
The associated class of the bottom (includes common constituent instruments and shared interface, such as binary file, variable-length record file Deng) be placed in the CAP of entitled filesystem (this name is example, similarly hereinafter), as first floor system library;
Class (i.e. application program) extends Applet (inheriting in Applet) containing application function, can call first floor system Class in library, and be claimed as abstract (abstract) attribute, is placed in the CAP of entitled absapplet, as application function library, Wherein each function all modularized processings, differentiation is apparent, and function is using design is successively called, and single function size of code is small, convenient for subtracting Small patch code amount;The class for being claimed as abstract (abstract) attribute can be inherited, but can not independent operating, but if such Inherit Applet, then inherit such subclass with independent operating, can otherwise inherit such subclass can not independent operating.
As the application interface packet interacted with JAVA platforms, the class for inheriting application function library has the attribute of applet, can The instruction for receiving and handling the distribution of JAVA platforms, is placed in the CAP of entitled pboc, this CAP occupied space very little, compared to whole A COS systems are taken up space, and can be neglected.
Application interface in application interface packet is corresponded with the application program in the packet of application function library.
Succession is the important mechanisms of object oriented language, by succession, can extend original code, be applied to other journeys In sequence, without rewriting these codes.In JAVA language, succession is by extending original class, it is real stating that new class is come Existing.The new class of extension statement is known as subclass, and original class is known as superclass (parent).Inheritance mechanism provides that subclass can possess The all properties and method of superclass, can also the distinctive attribute of expanded definition oneself, increase and new method and redefine superclass Method.
If necessary to change JAVA APPLET functions, a new application interface packet is downloaded after needing Patchpboc.CAP, referred to as patch application interface packet substitute former application interface packet, and realize function in patchpboc.CAP Modification carries out instantiation by the interface packet when use and patch function can be realized.
The patch application interface packet includes the APPLET subclasses for inheriting application program to be modified, in this way to the patch APPLET subclasses in application interface packet are instantiated, you can realize whole attributes of application program to be modified.
The patch application interface packet includes the APPLET subclasses for inheriting application program to be modified, the APPLET subclasses Subprogram to be modified in application program to be modified including rewriting.
The method of the present embodiment can use in the commercial project more applied, for example, can Chinese people's silver supported 3.0 application of debt-credit note of row publication, EDEP and EDEP expanded applications, as shown in figure 3, detailed framework is as follows:
A. first floor system library
Including common constituent instruments and shared interface, emphasis is constituent instruments, including:
Binary file (Binary File);
Variable-length record file (Variable Record File);
Fixed-length record file (Fix Record File);
Cycle index file (Cyclic Record File);
For modularization management file system, using the similarities and differences according to file attribute between each file, using the side of succession Formula is realized, big quantity space can be both saved, and also allows for subsequent patch design.In addition to constituent instruments, file system also contains another Partial content-PBOC shared interfaces, the interface are realized by Sharable (shared) interface, primarily to realizing applet Between access operation.
B. application function library
Application function library includes rights management, trading function etc., and (class in the library is in sound by the Similar integral APPLET in the library It has all been write as the class that XX extends applet, applet are the own special statement applets of platform when bright, has been answered in this way , need not be followed by holding applet as long as inheriting such independent operating with the class in interface packet) and be claimed as Abstract types are related to the demand in terms of file process, all call first floor system library, can contain multiple such classes, to support It applies more, such as PBOC3.0, EDEP and EDEP expanded application in Fig. 2, all power functions all modularizations as possible so that letter Number level is clear, and single function code should not be excessive, and when avoiding rewriteeing the function in patch, errorless part also needs in code It rewrites, causes space waste.
C. the application interface packet interacted with JAVA platforms
The interaction of applet and JAVA platforms are mainly realized in application interface packet, the Similar integral application function library in the packet In class, with applet attribute, can receive and processing platform distribution instruction, this CAP occupied space is small as possible, will Real applet is simplified to " shell " of a very little, if subsequently needing patch installing, need to only re-download one it is similar " shell " and the service packs for rewriteeing corresponding power function, you can achieve the purpose that modification function.
The patch mechanism of the present embodiment design, can change the JAVA applications problem built in hard mask, including most bottom The problems in the file system of layer.
The embodiment of the present invention correspondingly provides a kind of JAVA card, may include:
Download module, the service packs for downloading specified application, the service packs include inheriting described specify to answer With applet (Applet) subclass of program;
Module is instantiated, for being instantiated to the service packs.
Wherein, the applet subclass includes:The problems in the specified application rewritten subprogram.
The JAVA card of the present embodiment can also include:
Memory module, for the specified application to be stored in the first conversion applet file, the finger It is to inherit the application program of the applet (Applet) to determine application program, is claimed as abstract attribute;Described specify is answered It is stored in the second conversion applet file with the application interface program of program, the application interface of the specified application Program inherits the specified application;The service packs of the specified application is stored in third conversion applet text In part.
Fig. 4 is a kind of flow chart of the method for JAVA card patch installing of the embodiment of the present invention two, as shown in figure 4, this implementation The method of example is to carry out patch installing for the file system in JAVA card, be may comprise steps of:
Step 21, the service packs for downloading specified file, the service packs include file for inheriting the specified file Class, and applet (Applet) subclass for the application program for calling the specified file is inherited, the Applet subclasses will The instance objects of the file subclass are assigned to the instance objects for calling the specified file in the application program;
Step 22 instantiates the service packs.
As shown in figure 5, creating a file subclass in the patch to the file system in JAVA card, this document subclass is inherited File to be modified, for example, the fileA in file system goes wrong to be modified, include a new file subclass in service packs File B, file B inherit file A, and the problems in fileA functions are rewritten in file B.
Further include the module for calling new file subclass file B in the service packs, the module is by new file subclass The instance objects of file B are assigned to the instance objects flieA a for calling file f lie A to be modified in application program.
The patch framework of the present embodiment, readability is understandable, simple in structure apparent, to JavaCard grammers and Object-Oriented Programming Know quite well can it is individually designed and use such patch, the development cycle can be very short, and can greatly improve project executes effect Rate.The utilization rate of ROM code is maintained at very by the present embodiment for realizing the application interface packet occupied space very little of patch function High level avoids the waste of resource, the space of saving that from can increasing the number of applications that card can carry.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program Related hardware is completed, and described program can be stored in computer readable storage medium, such as read-only memory, disk or CD Deng.Optionally, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly Ground, the form that hardware may be used in each module/unit in above-described embodiment are realized, the shape of software function module can also be used Formula is realized.The present invention is not limited to the combinations of the hardware and software of any particular form.
It these are only the preferred embodiment of the present invention, certainly, the invention may also have other embodiments, without departing substantially from this In the case of spirit and its essence, those skilled in the art make various corresponding changes in accordance with the present invention And deformation, but these corresponding change and deformations should all belong to the protection domain of appended claims of the invention.

Claims (8)

1. a kind of method of JAVA card application patch installing, including:
The service packs of specified application is downloaded, the service packs includes the applet for inheriting the specified application Applet subclasses;
The service packs is instantiated;
The specified application is to inherit the application program of the applet Applet, is claimed as abstract attribute, storage In the first conversion applet file;
The application interface program of the specified application inherits the specified application, and it is small using journey to be stored in the second conversion In preface part;
The service packs of the specified application is stored in third conversion applet file.
2. the method as described in claim 1, it is characterised in that:The applet subclass includes:
The problems in the specified application rewritten subprogram.
3. a kind of JAVA card, which is characterized in that including:
Download module, the service packs for downloading specified application, the service packs include that succession is described specified using journey The applet Applet subclasses of sequence;
Module is instantiated, for being instantiated to the service packs;
Memory module, for the specified application to be stored in the first conversion applet file, described specify is answered It is to inherit the application program of the applet Applet with program, is claimed as abstract attribute;By the specified application Application interface program be stored in the second conversion applet file, the application interface program of the specified application after Hold the specified application;The service packs of the specified application is stored in third conversion applet file.
4. JAVA card as claimed in claim 3, it is characterised in that:
The applet subclass includes:The problems in the specified application rewritten subprogram.
5. a kind of method of JAVA card application patch installing, including:
The service packs of specified file is downloaded, the service packs includes inheriting the file subclass of the specified file, and inherit and adjust With the applet Applet subclasses of the application program of the specified file, the Applet subclasses are by the file subclass Instance objects are assigned to the instance objects for calling the specified file in the application program;
The service packs is instantiated;
The application program is to inherit the application program of the applet Applet, is claimed as abstract attribute, is placed on first It converts in applet file;
The service packs of the specified file is placed in the second Transformation Application program file.
6. method as claimed in claim 5, it is characterised in that:
The file subclass includes:Rewrite the specified file the problem of subprogram.
7. a kind of JAVA card, which is characterized in that including:
Download module, the service packs for downloading specified file, the service packs include the file for inheriting the specified file Subclass, and the applet Applet subclasses for the application program for calling the specified file are inherited, the Applet subclasses will The instance objects of the file subclass are assigned to the instance objects for calling the specified file in the application program;
Module is instantiated, for being instantiated to the service packs;
Memory module, for the application program to be stored in the first conversion applet file, the application program is The application program for inheriting the applet Applet, is claimed as abstract attribute;The service packs of the specified file is stored In the second Transformation Application program file.
8. JAVA card as claimed in claim 7, it is characterised in that:
The file subclass includes:Rewrite the specified file the problem of function.
CN201410425823.9A 2014-08-26 2014-08-26 A kind of Java card and its method using patch installing Active CN104331275B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410425823.9A CN104331275B (en) 2014-08-26 2014-08-26 A kind of Java card and its method using patch installing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410425823.9A CN104331275B (en) 2014-08-26 2014-08-26 A kind of Java card and its method using patch installing

Publications (2)

Publication Number Publication Date
CN104331275A CN104331275A (en) 2015-02-04
CN104331275B true CN104331275B (en) 2018-10-12

Family

ID=52406009

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410425823.9A Active CN104331275B (en) 2014-08-26 2014-08-26 A kind of Java card and its method using patch installing

Country Status (1)

Country Link
CN (1) CN104331275B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598551B (en) * 2016-12-16 2019-01-29 大唐微电子技术有限公司 A kind for the treatment of method and apparatus of smart card, smart card
CN113312038B (en) * 2021-06-18 2022-05-31 浪潮云信息技术股份公司 Implementation method for generating Java code class relay structure
CN115562572A (en) * 2022-08-30 2023-01-03 北京握奇数据股份有限公司 Method, storage medium and system for improving operation efficiency of security chip

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976211A (en) * 2010-09-26 2011-02-16 北京握奇数据系统有限公司 Method, device and system for replacing function in CAP file
CN103309696A (en) * 2012-03-15 2013-09-18 中国移动通信集团公司 Method and device for updating Java card extended library, and Java card
CN103645917A (en) * 2013-12-03 2014-03-19 北京中电华大电子设计有限责任公司 Java code patching method of Java card
CN103761126A (en) * 2014-01-07 2014-04-30 中国神华能源股份有限公司 Method and device for upgrading application program
CN103914351A (en) * 2012-12-28 2014-07-09 北京中电华大电子设计有限责任公司 Method for achieving JAVA card system patches

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976211A (en) * 2010-09-26 2011-02-16 北京握奇数据系统有限公司 Method, device and system for replacing function in CAP file
CN103309696A (en) * 2012-03-15 2013-09-18 中国移动通信集团公司 Method and device for updating Java card extended library, and Java card
CN103914351A (en) * 2012-12-28 2014-07-09 北京中电华大电子设计有限责任公司 Method for achieving JAVA card system patches
CN103645917A (en) * 2013-12-03 2014-03-19 北京中电华大电子设计有限责任公司 Java code patching method of Java card
CN103761126A (en) * 2014-01-07 2014-04-30 中国神华能源股份有限公司 Method and device for upgrading application program

Also Published As

Publication number Publication date
CN104331275A (en) 2015-02-04

Similar Documents

Publication Publication Date Title
US11169784B2 (en) Computing expression medium, development environment, and device communication and control architecture
US10146522B1 (en) Live code updates
CN109976761A (en) Generation method, device and the terminal device of Software Development Kit
US20100293538A1 (en) Dynamic program updating in a continuation based runtime
CN106415488A (en) Decomposing a generic class into layers
US9176769B2 (en) Partitioned array objects in a distributed runtime
CN107924326A (en) The moving method of updated type is covered
CN109542459A (en) Application program packaging method and device, computer installation and computer storage medium
CN102221998A (en) Method for extending EJB container in component running support platform
CN104331275B (en) A kind of Java card and its method using patch installing
US9535678B2 (en) Providing distributed array containers for programming objects
CN112685020A (en) Method and device for dynamically creating service interface, electronic equipment and storage medium
US7421715B1 (en) System and method for dynamic late-binding of persistent object implementations in software-based systems
US8024374B2 (en) Computer object conversion using an intermediate object
CN103631645A (en) Digital family middleware system based on digital medical treatment
CN102103494A (en) Method and device for changing software resource
US8271938B2 (en) Flexible base class library
US10331465B2 (en) Apparatus and method for realizing runtime system for programming language
CN111414226A (en) Method and system for establishing task sandbox
KR20100110710A (en) Method for simplifying interfaces having dynamic libraries
CN106598551B (en) A kind for the treatment of method and apparatus of smart card, smart card
CN110347471B (en) Hierarchical display component system, display component calling method and device
CN110990018B (en) Compiling method and compiling system of embedded system
CN104063229A (en) Digital family middleware system
EP3834090B1 (en) Fast initialization of complex in-memory data structures

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant