CN104331275A - JavaCard and method for patching application of JavaCard - Google Patents

JavaCard and method for patching application of JavaCard Download PDF

Info

Publication number
CN104331275A
CN104331275A CN201410425823.9A CN201410425823A CN104331275A CN 104331275 A CN104331275 A CN 104331275A CN 201410425823 A CN201410425823 A CN 201410425823A CN 104331275 A CN104331275 A CN 104331275A
Authority
CN
China
Prior art keywords
applet
file
application
subclass
specified
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.)
Granted
Application number
CN201410425823.9A
Other languages
Chinese (zh)
Other versions
CN104331275B (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

The invention provides a JavaCard and method for patching an application of the JavaCard. The method comprises the following steps: downloading a patch of an appointed application program, wherein the patch comprises an applet subclass which inherits the appointed application program; and instantiating the patch. The invention utilizes an inheritance relationship to design an efficient, easy, simple and practical commercial application patching mechanism which aims at the JavaCard, a hierarchical patch framework designed in the application APPLET is built in a hard mask JavaCard, and a problem appearing in any layer in the APPLET can be revised.

Description

A kind of method of Java card and application patch installing thereof
Technical field
The present invention relates to field of intelligent cards, particularly relate to a kind of method of Java card and application patch installing thereof.
Background technology
Along with the continuous progress of science and technology, the application of smart card has related to the every field of human lives, as multiple fields such as business, medical treatment, insurance, traffic, social government utilities.Simultaneously, smart card quantity in user's hand also gets more and more, particularly congener card often needs to change a neocaine due to card image of will upgrading. so, how efficiency utilization smart card, namely how designing the patch mechanism of smart card, is very important problem to upgrade card application program after realizing hair fastener.
Generally, block for NATIVE (nation method realization), if find COS (Card Operating System, card operation system) in have program error or need to increase new function and need to revise some function or file, the simplest way is exactly again hair fastener, namely reclaim card, again download COS.But when card is in user's hand, at this moment, not only to reclaim card, also will experience that COS downloads, the stage such as individualized, this just aobvious very trouble.
Traditional patch method for designing directly reserves one section or multistage code in a program.Like this, when needs download patches, only patch need be write in reserved address and go.But, owing to generally can not determine size and the number of following download patches when reserved code, so, this implementation method has certain limitation, and, need download patch larger or more time, than being easier to the situation occurring code overlap, make COS occur exception error in the process of implementation.
Also someone proposes the download and the management that are realized patch by the interface setting up PATCH (patch) function table and patch is called in design in operating system master, patch download can be carried out according to different patch category index, and no longer by the restriction of patch size, support the download of multiple patch simultaneously.
It is more than the development of NATIVE card patch mechanism, and for the JavaCard (Java card) based on object based programming thought, due to across CAP (Converted Applet, transform applet) wrap the restriction of accessing, almost also there is no practicable patch mechanism.Cause JavaCard application and development very flexible, particularly card mask complete or go wrong again after being delivered for use, amendment difficulty can be very large, and the cycle of revising is long.For the purpose of safety, the structure of Java platform to application has very large restriction, existing patch mechanism is all in theory stage, certain gap is also had from efficiently easy, simple and practical target, still (JAVA program has the attribute that dynamic is downloaded to adopt complete rear download when most Java Card COS goes wrong, download after complete and all carry out rear download by application program, abandon all application programs of mask) mode modify.
Existing patch mechanism is only at theory stage, the space cost do not developed for the patch in later stage is considered, if application goes wrong, patch will waste valuable erasable storage area resource in a large number, particularly in commercial process, the competitive power of card will be had a strong impact on.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of method of JAVA card and application patch installing thereof, to realize practicable patch mechanism in the JavaCard based on object based programming thought.
In order to solve the problems of the technologies described above, the invention provides a kind of method of JAVA card application patch installing, comprising:
Download the service packs of specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Instantiation is carried out to described service packs.
Further, said method also has feature below: described applet subclass comprises:
Problem subroutine in the described specified application rewritten.
Further, said method also has feature below:
Described specified application is inherit the application program of described applet (Applet), is claimed as abstract attribute, leaves in the first conversion applet file;
Specified application described in the application interface program inherits of described specified application, leaves in the second conversion applet file;
The service packs of described specified application leaves the 3rd in and transforms in applet file.
In order to solve the problem, present invention also offers a kind of JAVA card, wherein, comprise:
Download module, for downloading the service packs of specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Instantiation module, for carrying out instantiation to described service packs.
Further, above-mentioned JAVA card also has feature below:
Described applet subclass comprises: the problem subroutine in the described specified application of rewriting.
Further, above-mentioned JAVA card also has feature below: also comprise,
Memory module, for described specified application being left in the first conversion applet file, described specified application is inherit the application program of described applet (Applet), is claimed as abstract attribute; The application interface program of described specified application is left in the second conversion applet file, specified application described in the application interface program inherits of described specified application; The service packs of described specified application is left in the 3rd to transform in applet file.
In order to solve the problem, present invention also offers a kind of method of JAVA card application patch installing, comprising:
Download the service packs of specified file, described service packs comprises the file subclass inheriting described specified file, call applet (Applet) subclass of the application program of described specified file with succession, the instance objects assignment of described file subclass is given in described application program and is used for the instance objects calling described specified file by described Applet subclass;
Instantiation is carried out to described service packs.
Further, said method also has feature below:
Described file subclass comprises: the problem subroutine of the described specified file of rewriting.
Further, said method also has feature below:
Described application program is inherit the application program of described applet (Applet), is claimed as abstract attribute, is placed in the first conversion applet file;
The service packs of described specified file is placed in the second Transformation Application program file.
In order to solve the problem, present invention also offers a kind of JAVA card, wherein, comprise:
Download module, for downloading the service packs of specified file, described service packs comprises the file subclass inheriting described specified file, call applet (Applet) subclass of the application program of described specified file with succession, the instance objects assignment of described file subclass is given in described application program and is used for the instance objects calling described specified file by described Applet subclass;
Instantiation module, for carrying out instantiation to described service packs.
Further, above-mentioned JAVA card also has feature below:
Described file subclass comprises: the problem function of the described specified file of rewriting.
Further, above-mentioned JAVA card also has feature below: also comprise:
Memory module, for described application program being left in the first conversion applet file, described application program is inherit the application program of described applet (Applet), is claimed as abstract attribute; The service packs of described specified file is left in the second Transformation Application program file.
To sum up, the invention provides a kind of method of JAVA card and application patch installing thereof, utilize inheritance devise can be commercial for JavaCard efficiently easy, simple and practical application patch mechanism; The layering designed in hard mask JAVA card built-in application APPLET, patch framework, can revise arbitrary levels produced problem in APPLET.Consider that later stage patch develops the space cost paid, design can utilize minimum space to realize the patch framework of amendment demand.Rational deployment first floor system and power function, modularized processing code, makes patch framework simply distinct, shortens the construction cycle.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the method for a kind of 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 the patch Organization Chart of the present invention one application example;
Fig. 4 is the process flow diagram of the method for a kind of 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.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly understand, hereinafter will be described in detail to embodiments of the invention by reference to the accompanying drawings.It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combination in any mutually.
Fig. 1 is the process flow diagram of the method for a kind of JAVA card patch installing of the embodiment of the present invention one, and as shown in Figure 1, the method for the present embodiment carries out patch installing for application program, can comprise the following steps:
The service packs of step 11, download specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Step 12, instantiation is carried out to described service packs.
With specific embodiment, method of the present invention is described in detail below.
In the present embodiment, JAVA APPLET can be segmented by module, as shown in Figure 2, suppose:
The associated class (comprising conventional basic document and shared interface, as binary file, variable-length record file etc.) of the bottom is placed in the CAP of filesystem by name (this name is example, lower same), as first floor system storehouse;
Containing class (i.e. application program) extends Applet (inheriting in Applet) of application function, the class in first floor system storehouse can be called, and be claimed as abstract (abstract) attribute, be placed in the CAP of absapplet by name, as application function storehouse, wherein each function all modularized processings, distinguish distinct, function adopts and successively calls design, and single function size of code is little, is convenient to reduce patch code amount; The class being claimed as abstract (abstract) attribute can be inherited, but cannot independent operating, if but such inherits Applet, then and the subclass inheriting such can independent operating, otherwise the subclass inheriting such can not independent operating.
As the application interface bag mutual with JAVA platform, the class inheriting application function storehouse has the attribute of applet, can receive and process the instruction of JAVA platform distribution, be placed in the CAP of pboc by name, this CAP takes up room very little, taken up space, can ignore compared to whole COS system.
Application interface in application interface bag and application function storehouse wrap in application program one_to_one corresponding.
Succession is the important mechanisms of object oriented language, by succession, can expand original code, be applied in other programs, and need not again write these codes.In JAVA language, succession is by expanding original class, states new class to realize.The new class of expansion statement is called subclass, and original class is called superclass (parent).Inheritance mechanism specifies, subclass can have all properties and the method for superclass, also can the distinctive attribute of expanded definition oneself, increase new method and the method redefining superclass.
If need amendment JAVA APPLET function, the application interface bag patchpboc.CAP that after needing, download one is new, be called patch application interface bag, substitute former application interface bag, and practical function amendment in patchpboc.CAP, carry out instantiation by this interface bag during use and can realize patch function.
Described patch application interface bag comprises the APPLET subclass inheriting application program to be modified, carries out instantiation like this, can realize whole attributes of application program to be modified to the APPLET subclass in this patch application interface bag.
Described patch application interface bag comprises the APPLET subclass inheriting application program to be modified, and this APPLET subclass comprises the subroutine to be modified in the application program to be modified of rewriting.
The method of the present embodiment can use in the commercial project of many application, and such as, can support that 3.0 application, EDEP and EDEP expanded application are remembered in the debt-credit that People's Bank of China issues, as shown in Figure 3, detailed framework is as follows:
A. first floor system storehouse
Comprise conventional basic document and shared interface, emphasis is basic document, comprising:
Binary file (Binary File);
Variable-length record file (Variable Record File);
Fixed-length record file (Fix Record File);
Cycle index file (Cyclic Record File);
......
In order to modularization management file system, between each file, adopt the similarities and differences according to file attribute, adopt the mode inherited to realize, both can save large quantity space, be also convenient to subsequent patch design.Except basic document, file system also shares interface containing another part content-PBOC, and this interface passes through Sharable (sharing) Interface realization, mainly in order to realize the accessing operation between applet.
B. application function storehouse
Application function storehouse comprises rights management, trading function etc., (class in this storehouse has all been write as XX extends applet when stating to Similar integral APPLET in this storehouse, applet is the class of the special statement applet that platform is had by oneself, just can independent operating as long as class in such application interface bag inherits such, do not need to inherit applet again) and be claimed as abstract type, relate to the demand of file processing aspect, all call first floor system storehouse, multiple such class can be contained, to support many application, as the PBOC3.0 in Fig. 2, EDEP and EDEP expanded application, all power functions are all tried one's best modularization, make function level clear and definite, single function code is too much unsuitable, when avoiding rewriteeing this function in patch, part errorless in code also needs to rewrite, cause space waste.
C. mutual with JAVA platform application interface bag
The mutual of applet and JAVA platform is mainly realized in application interface bag, class in Similar integral application function storehouse in this bag, there is the attribute of applet, the instruction with processing platform distribution can be received, this CAP takes up room as far as possible little, real applet is simplified to very little " shell ", needs patch installing if follow-up, then only again need download similar " shell " and rewrite the service packs of corresponding power function, the object of modify feature can be reached.
The patch mechanism of the present embodiment design, can revise hard mask built-in JAVA application produced problem, comprise the problem in the file system of the bottom.
The embodiment of the present invention correspondingly provides a kind of JAVA card, can comprise:
Download module, for downloading the service packs of specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Instantiation module, for carrying out instantiation to described service packs.
Wherein, described applet subclass comprises: the problem subroutine in the described specified application of rewriting.
The JAVA card of the present embodiment can also comprise:
Memory module, for described specified application being left in the first conversion applet file, described specified application is inherit the application program of described applet (Applet), is claimed as abstract attribute; The application interface program of described specified application is left in the second conversion applet file, specified application described in the application interface program inherits of described specified application; The service packs of described specified application is left in the 3rd to transform in applet file.
Fig. 4 is the process flow diagram of the method for a kind of JAVA card patch installing of the embodiment of the present invention two, and as shown in Figure 4, the method for the present embodiment carries out patch installing for the file system in JAVA card, can comprise the following steps:
The service packs of step 21, download specified file, described service packs comprises the file subclass inheriting described specified file, call applet (Applet) subclass of the application program of described specified file with succession, the instance objects assignment of described file subclass is given in described application program and is used for the instance objects calling described specified file by described Applet subclass;
Step 22, instantiation is carried out to described service packs.
As shown in Figure 5, a newly-built file subclass in the patch to the file system in JAVA card, this file subclass inherits file to be modified, such as, fileA in file system goes wrong to be modified, comprise new file subclass file B, a file B at service packs and inherit file A, in file B, rewrite the problem function in fileA.
In this service packs, also comprise the module for calling new file subclass file B, this module by the instance objects assignment of new file subclass file B to being used for the instance objects flieA a calling file f lie A to be modified in application program.
The patch framework of the present embodiment, readability is understandable, and structure is simply distinct, and know quite well JavaCard grammer and object based programming and get final product this type of patch of independent design and use, the construction cycle can be very short, greatly can improve the execution efficiency of project.The present embodiment takes up room very little for the application interface bag realizing patch function, and the utilization factor of ROM code is remained on very high level, avoids the waste of resource, and the space of saving can increase the number of applications that card can carry.
The all or part of step that one of ordinary skill in the art will appreciate that in said method is carried out instruction related hardware by program and is completed, and described program can be stored in computer-readable recording medium, as ROM (read-only memory), disk or CD etc.Alternatively, all or part of step of above-described embodiment also can use one or more integrated circuit to realize.Correspondingly, each module/unit in above-described embodiment can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.
These are only the preferred embodiments of the present invention; certainly; the present invention also can have other various embodiments; when not deviating from the present invention's spirit and essence thereof; those of ordinary skill in the art are when making various corresponding change and distortion according to the present invention, but these change accordingly and are out of shape the protection domain that all should belong to the claim appended by the present invention.

Claims (12)

1. a method for JAVA card application patch installing, comprising:
Download the service packs of specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Instantiation is carried out to described service packs.
2. the method for claim 1, is characterized in that: described applet subclass comprises:
Problem subroutine in the described specified application rewritten.
3. method as claimed in claim 1 or 2, is characterized in that:
Described specified application is inherit the application program of described applet (Applet), is claimed as abstract attribute, leaves in the first conversion applet file;
Specified application described in the application interface program inherits of described specified application, leaves in the second conversion applet file;
The service packs of described specified application leaves the 3rd in and transforms in applet file.
4. a JAVA card, is characterized in that, comprising:
Download module, for downloading the service packs of specified application, described service packs comprises applet (Applet) subclass inheriting described specified application;
Instantiation module, for carrying out instantiation to described service packs.
5. JAVA card as claimed in claim 4, is characterized in that:
Described applet subclass comprises: the problem subroutine in the described specified application of rewriting.
6. the JAVA card as described in claim 4 or 5, is characterized in that: also comprise,
Memory module, for described specified application being left in the first conversion applet file, described specified application is inherit the application program of described applet (Applet), is claimed as abstract attribute; The application interface program of described specified application is left in the second conversion applet file, specified application described in the application interface program inherits of described specified application; The service packs of described specified application is left in the 3rd to transform in applet file.
7. a method for JAVA card application patch installing, comprising:
Download the service packs of specified file, described service packs comprises the file subclass inheriting described specified file, call applet (Applet) subclass of the application program of described specified file with succession, the instance objects assignment of described file subclass is given in described application program and is used for the instance objects calling described specified file by described Applet subclass;
Instantiation is carried out to described service packs.
8. method as claimed in claim 7, is characterized in that:
Described file subclass comprises: the problem subroutine of the described specified file of rewriting.
9. method as claimed in claim 7 or 8, is characterized in that:
Described application program is inherit the application program of described applet (Applet), is claimed as abstract attribute, is placed in the first conversion applet file;
The service packs of described specified file is placed in the second Transformation Application program file.
10. a JAVA card, is characterized in that, comprising:
Download module, for downloading the service packs of specified file, described service packs comprises the file subclass inheriting described specified file, call applet (Applet) subclass of the application program of described specified file with succession, the instance objects assignment of described file subclass is given in described application program and is used for the instance objects calling described specified file by described Applet subclass;
Instantiation module, for carrying out instantiation to described service packs.
11. JAVA card as claimed in claim 10, is characterized in that:
Described file subclass comprises: the problem function of the described specified file of rewriting.
12. JAVA card as described in claim 10 or 11, is characterized in that: also comprise:
Memory module, for described application program being left in the first conversion applet file, described application program is inherit the application program of described applet (Applet), is claimed as abstract attribute; The service packs of described specified file is left in the second Transformation Application program file.
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 true CN104331275A (en) 2015-02-04
CN104331275B 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)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598551A (en) * 2016-12-16 2017-04-26 大唐微电子技术有限公司 Smart card, processing method and device of smart card
CN113312038A (en) * 2021-06-18 2021-08-27 浪潮云信息技术股份公司 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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106598551A (en) * 2016-12-16 2017-04-26 大唐微电子技术有限公司 Smart card, processing method and device of smart card
CN106598551B (en) * 2016-12-16 2019-01-29 大唐微电子技术有限公司 A kind for the treatment of method and apparatus of smart card, smart card
CN113312038A (en) * 2021-06-18 2021-08-27 浪潮云信息技术股份公司 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

Also Published As

Publication number Publication date
CN104331275B (en) 2018-10-12

Similar Documents

Publication Publication Date Title
US10795660B1 (en) Live code updates
CN109976761A (en) Generation method, device and the terminal device of Software Development Kit
CN106415488A (en) Decomposing a generic class into layers
CN103809975B (en) The implementation method of intelligent cloud list
CN102455931B (en) Method and system for developing Android platform engineering
CN110362301B (en) Processing method for terminal application behavior reflection
CN102073525A (en) Method and device for dynamically upgrading Web service system based on Java platform
WO2024045382A1 (en) Implementation of reflective mechanism in blockchain
CN104331275A (en) JavaCard and method for patching application of JavaCard
Bengtsson The R. oo package-object-oriented programming with references using standard R code
Haoyu et al. Basic design principles in software engineering
CN115543224A (en) ZNS SSD-based file system control method, device and equipment
US7421715B1 (en) System and method for dynamic late-binding of persistent object implementations in software-based systems
US8893155B2 (en) Providing distributed array containers for programming objects
CN103631645A (en) Digital family middleware system based on digital medical treatment
CN110347448B (en) Method for constructing runtime model of terminal application behavior
US20140032205A1 (en) Java program for emulating the memory management of a c program and corresponding method
US8271938B2 (en) Flexible base class library
CN111459573A (en) Method and device for starting intelligent contract execution environment
KR20100110710A (en) Method for simplifying interfaces having dynamic libraries
CN110990018B (en) Compiling method and compiling system of embedded system
CN106598551B (en) A kind for the treatment of method and apparatus of smart card, smart card
CN111857662A (en) Programming method for describing object specific constitution based on MAP and interface
CN104063229A (en) Digital family middleware system
CN111008056A (en) BIOS setting interface language configuration method and device

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