CN105426237A - Method and system for dynamically managing JavaCard transient resources - Google Patents

Method and system for dynamically managing JavaCard transient resources Download PDF

Info

Publication number
CN105426237A
CN105426237A CN201510777120.7A CN201510777120A CN105426237A CN 105426237 A CN105426237 A CN 105426237A CN 201510777120 A CN201510777120 A CN 201510777120A CN 105426237 A CN105426237 A CN 105426237A
Authority
CN
China
Prior art keywords
application
space
dtr
transient state
resource
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
CN201510777120.7A
Other languages
Chinese (zh)
Other versions
CN105426237B (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.)
Wuhan Tianyu Information Industry Co Ltd
Original Assignee
Wuhan Tianyu Information Industry 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 Wuhan Tianyu Information Industry Co Ltd filed Critical Wuhan Tianyu Information Industry Co Ltd
Priority to CN201510777120.7A priority Critical patent/CN105426237B/en
Publication of CN105426237A publication Critical patent/CN105426237A/en
Application granted granted Critical
Publication of CN105426237B publication Critical patent/CN105426237B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/468Specific access rights for resources, e.g. using capability register
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and system for dynamically managing JavaCard transient resources, relating to the technical field of management of JavaCard transient resources. The method comprises the following steps: distributing a total transient resource space to the transient resources at first; when an application packet stored in a logical channel applies for the transient resources, judging whether the size of the available transient resource space satisfies the application requirement at this time or not, if so, applying for corresponding transient resources, and otherwise, prompting abnormal information that the space is insufficient; providing an RTR space in the total transient resource space for the application packet applying for the RTR space to always occupy in the use process of an RTR resource, only resetting till a card is reset; and dynamically distributing and adjusting the size of a DTR space in the total transient resource space according to the activation state or the deactivation state of the application packet applying for the DTR space in the use process of a DTR resource. According to the invention, the resource utilization rate is effectively increased; and furthermore, the method is flexible to manage and high in adaptation.

Description

A kind of method and system of dynamic management JavaCard transient state resource
Technical field
The present invention relates to the administrative skill field of JavaCard transient state resource, is specifically a kind of method and system of dynamic management JavaCard transient state resource.
Background technology
JavaCard is that a kind of smart card or device close with smart card of allowing is to have the mode of safety to perform the technology of small-sized JavaApplet (applet).JavaCard platform is an operating system based on JavaCard, can provide the resource of the transient state needed for operation for JavaCard application.The appearance of JavaCard, the application level in order to the Java that expands on the one hand, also be in order to the characteristic of JavaCard platform and the benefit of Java are taken on smart card on the other hand, because on the basis of JavaCard, Application and Development has platform-neutral and security, therefore, JavaCard has been widely used in the fields such as finance and communication.
Although it is convenient to develop Applet on the basis of JavaCard, develop comparatively speaking with traditional Applet, effective utilization of resource and performance is its maximum problem.Because EEPROM (Electrically-ErasableProgrammableRead-OnlyMemory write by JavaCard platform, the electronics formula of erasing can make carbon copies ROM (read-only memory)) need the time scale expended to be maximum in old process, therefore, the most direct way solving resource and performance issue is exactly replace the operation of EEPROM (namely reducing the number of times writing EEPROM) with RAM (RandomAccessMemory, random access memory) as far as possible.But for JavaCard platform, RAM resource is but very limited, how effectively manages and to use the RAM resource of JavaCard platform, it is this area problem demanding prompt solution that the transient state resource that RAM is provided can meet the demand that each JavaCard applies.
JavaCard application applies for JavaCard transient state resource by JavaCardAPI (ApplicationProgrammingInterface, application programming interface).JavaCard transient state resource is divided into DTR (ClearnOnDeselect cancels and removing) and RTR (ClearnOnReset resets and removes) by type.
At present, for the management of JavaCard transient state resource, be substantially divided into following two kinds of modes:
(1) mode of unified management DTR, RTR resource, it follows following administrative mechanism:
As shown in Figure 1, under original state, whole available transient state resource size is the available maximum space of single card: TRANSIENT_SIZE; After the application bag application size applied containing JavaCard is the DTR of sizeD1, then remaining transient state resource space is: TRANSIENT_SIZE-sizeD1; After other application bags apply for that size is the RTR of sizeR1 again, then remaining transient state resource space is: TRANSIENT_SIZE-sizeD1-sizeR1; After other application bag continuation application sizes are the DTR of sizeD2, then remaining transient state resource space is: TRANSIENT_SIZE-sizeD1-sizeR1-sizeD2; By that analogy, no matter be application DTR or RTR, remaining transient state resource all can change accordingly, and whole transient state resource space is linear structure, follows whose first to file, distributes to whose principle.
Although this way to manage is relatively simple, but there is DTR resource space, the not reusable problem of RTR resource space, make resource utilization lower, run into the situation that application bag is more, may cause the application of subsequent applications bag, because RAM is not enough, unsuccessful risk is installed.
(2) mode of separate management DTR, RTR resource, it follows following administrative mechanism:
As shown in Figure 2, the resource space of DTR and RTR is independently opened, under original state, the implementation of 4 logical channels (JCRE2.2.1 specification supports 4 logical channels) is supported according to card, for the DTR resource space (sizeDmax is the available maximum DTR space of card) of each logical channel predistribution sizeDmax size, then remaining transient state resource space is the maximum application space of RTR resource, i.e. TRANSIENT_SIZE-sizeDmax*4; After having application bag to apply for the DTR of sizeD1, sizeD2 size, only when certain logical channel of activation (as logical channel 0), just the actual address of the DTR of application is taken on the physical address of counterlogic passage; After having application bag to apply for the RTR of sizeR1, sizeR2 size, then the application of this application bag can take RTR resource space always, and corresponding residue transient state resource space also can reduce accordingly.
Although this way to manage makes the resource space of DTR to obtain resource multiplex, meet the requirement that many application bags can apply for the DTR resource of sizeDmax size, but, DTR and RTR must separately manage, and the size of the DTR resource space of each logical channel starts just to have preset, the spendable maximum transient resource of user is caused to be restricted, the DTR resource of sizeDmax size can only be applied for, the RTR resource of RTRANSIENT_SIZE-4*sizeDmax size, managerial flexibility is poor, and adaptability is not high.
Summary of the invention
The object of the invention is the deficiency in order to overcome above-mentioned background technology, providing a kind of method and system of dynamic management JavaCard transient state resource, not only effectively improve resource utilization, and management flexibly, adaptability is high.
For reaching above object, the invention provides a kind of method and system of dynamic management JavaCard transient state resource, comprising the following steps:
S1: be the transient state resource space that transient state Resourse Distribute one is total, proceed to S2;
S2: when being stored in the application bag application transient state resource in logical channel, transient state resource comprises DTR resource, RTR resource, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource, proceeds to S3; If not, then point out the abnormal information of insufficient space, terminate;
S3: in the use procedure of RTR resource, is supplied to its application bag of application and takies always by the RTR space in total transient state resource space, until when card resets, just carry out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic assignment and adjustment are carried out to the DTR space size in total transient state resource space.
On the basis of technique scheme, further comprising the steps of before S2: the DTR space size recording the required application of each application bag, and the DTR space size of application bag maximum for wherein required application space is recorded as sizeDm;
Judge described in S2 whether available transient state resource space size meets this application demand, specifically comprises the following steps:
Total transient state resource space size TRANSIENT_SIZE is defined as M, and the RTR space size sizeR applied for is defined as N, and the DTR space size sizeDruning of the current all application bags be activated is defined as P, and the space size of this application is defined as Q;
When applied for transient state resource type is RTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge sizeDm whether > P, if, then judge M-N-sizeDm whether > Q further, if, then be judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand; Otherwise, judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
When applied for transient state resource type is DTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand.
On the basis of technique scheme, corresponding transient state resource is applied for described in S2, specifically comprise the following steps: when applying for RTR resource, once application just from the afterbody of total transient state resource space, wrap the size of applying for according to application, distribute required RTR space and use to the application of application bag; When applying for DTR resource, from the head of total transient state resource space, only just distributing corresponding DTR resource provisioning bag place logical channel when applying bag and activating use.
On the basis of technique scheme, in S3, when applying for that the application bag of DTR is in state of activation, described dynamic assignment and adjustment being carried out to the DTR space size in total transient state resource space, specifically comprising the following steps:
S401: when applying for that the application bag of DTR is activated, judge whether this application bag is first application bag be activated, and if so, proceeds to S402, if not, proceeds to S403;
S402: from the head of total transient state resource space, the size of applying for according to this application bag, distributes required DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S403: judge whether available transient state resource space size meets this activation demand, if so, proceeds to S404, if not, proceeds to S405;
S404: from the afterbody in the DTR space distributed, according to the size needed for this application bag, distributes DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S405: the abnormal information of prompting insufficient space, exits this activation manipulation.
On the basis of technique scheme, in S3, when applying for that the application bag of DTR is in deactivation status, described dynamic assignment and adjustment being carried out to the DTR space size in total transient state resource space, specifically comprising the following steps:
When applying for the application bag deactivation of DTR, be divided into following two kinds of situations:
If A applies for that the application bag of DTR is deactivated owing to selecting the application of other application bags, then first judging whether this application bag has is activated by other logical channels;
Activated by other logical channels if had, illustrate that the DTR space of the current use of this application bag can't be released, then first retain the DTR space that this application bag uses, and judge whether the application bag selected by this activates in other logical channels, if so, the transient state space then this logical channel taken and selected application wrap in the transient state space that other passages activate and are consistent; If not, then from the afterbody in the DTR space distributed, according to the size of selected application bag application, distribute DTR space and use to the logical channel at this application bag place;
If do not activated by other logical channels, illustrate that the DTR resource of the current use of this application bag can be released, then judge whether the application bag selected by this activates in other logical channels, if, after then discharging the DTR space of the current use of this application bag, exit this deactivating operation, if not, then the DTR space of current for this application bag use is supplied to selected application bag to use, and space size is adjusted to the size of selected application bag application;
If B applies for that the application bag of DTR is owing to closing its place logical channel and deactivation, then judging whether this application bag activates in other logical channels, if so, then do not carry out any process, directly exit this deactivating operation; Otherwise, behind the DTR space of the current use of release this application bag, exit this deactivating operation.
On the basis of technique scheme, the size of transient state resource space total described in S1 is that the size of the RAM resource that can provide according to JavaCard platform is specified.
The present invention also provides a kind of system of the dynamic management JavaCard transient state resource based on said method, comprises original allocation module, resource bid administration module and resource use management module;
Described original allocation module is used for: be the transient state resource space that transient state Resourse Distribute one is total;
Described resource bid administration module is used for: when being stored in the application bag application transient state resource in logical channel, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource; If not, then the abnormal information of insufficient space is pointed out;
Described resource use management module is used for: in the use procedure of RTR resource, the RTR space in total transient state resource space is supplied to its application bag of application and takies always, until when card resets, just carries out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic assignment and adjustment are carried out to the DTR space size in total transient state resource space.
Beneficial effect of the present invention is:
Present invention employs a kind of thought of dynamic management JavaCard transient state resource, the management of transient state resource is dynamically divided.Specifically, for RTR resource, once application just from the afterbody of total transient state resource space, the size of applying for is wrapped according to application, distribute required RTR space to use to the application of application bag, and RTR resource space is employed bag and takies in use procedure always, until when card resets, just carry out clearing and process; And for DTR resource, the not allocation space immediately when applying for, but from the head of total transient state resource space, the logical channel use of corresponding DTR resource provisioning bag place is just distributed when application bag activates, and in use, according to state of activation or the deactivation status of the application bag of application DTR, dynamic conditioning is carried out to the DTR space size in total transient state resource space, thus realizes the dynamic management of transient state resource.
Compared with unified management mode of the prior art, the present invention, owing to have employed dynamic management mode, overcomes the not reusable drawback in DTR space in unified management mode, effectively improves transient state resource utilization; In addition, compared with separate management mode of the prior art, the present invention specifically presets maximum DTR space due to prior unpromising logical channel, thus avoid DTR resource and be restricted, and then overcome the relatively less deficiency in DTR space, make the management of transient state resource more flexible, adaptability is high, can meet resource bid demand substantially.
Accompanying drawing explanation
Fig. 1 is the principle schematic of unified management DTR, RTR resource mode in background technology;
Fig. 2 is the principle schematic of separate management DTR, RTR resource mode in background technology;
Fig. 3 is the process flow diagram of the method for dynamic management JavaCard transient state resource in the embodiment of the present invention;
Fig. 4 is the process flow diagram carrying out dynamic conditioning in the embodiment of the present invention when the application bag applying for DTR is state of activation.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is described in further detail.
Shown in Figure 3, the embodiment of the present invention provides a kind of method of dynamic management JavaCard transient state resource, comprises the following steps:
S1: according to transient state resource space size TRANSIENT_SIZE is the transient state resource space that transient state Resourse Distribute one is total; Record the DTR space size of the required application of each application bag, can sizeD1, sizeD2...sizeDn be designated as, and the DTR space size of application bag maximum for wherein required application space is recorded as sizeDm, proceed to S2.
During concrete operations, the resource of transient state described in S1 available array transient_heap [TRANSIENT_SIZE] defines; Described transient state resource space size TRANSIENT_SIZE is that the size of the RAM resource that can provide according to JavaCard platform is specified.
S2: when being stored in the application bag application transient state resource in logical channel, transient state resource comprises DTR resource, RTR resource, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource, proceeds to S3; If not, then point out the abnormal information of insufficient space, terminate.
During practical operation, described in S2, judge whether available transient state resource space size meets this application demand, specifically comprises the following steps:
Total transient state resource space size TRANSIENT_SIZE is defined as M, and the RTR space size sizeR applied for is defined as N, and the DTR space size sizeDruning of the current all application bags be activated is defined as P, and the space size of this application is defined as Q;
When applied for transient state resource type is RTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge sizeDm whether > P, if, then judge M-N-sizeDm whether > Q further, if, then be judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand; Otherwise, judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
When applied for transient state resource type is DTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand.
In addition, corresponding transient state resource is applied for described in S2, specifically comprise the following steps: when applying for RTR resource, once application just from the afterbody of total transient state resource space, the size of applying for is wrapped according to application, distribute required RTR space to use to the application of application bag, and initialization operation is carried out to the application in this application bag; When applying for DTR resource, in total transient state resource space, do not distribute any space when applying for, but from the head of total transient state resource space, just distribute the logical channel use of corresponding DTR resource provisioning bag place when application bag activates.
S3: in the use procedure of RTR resource, is supplied to its application bag of application and takies always by the RTR space in total transient state resource space, until when card resets, just carry out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic conditioning is carried out to the DTR space size in total transient state resource space, thus realizes the dynamic management of transient state resource.
Shown in Figure 4, during concrete operations, when applying for that the application bag of DTR is in state of activation, described in S3, dynamic conditioning being carried out to the DTR space size in total transient state resource space, specifically comprising following operation:
S401: when applying for that the application bag of DTR is activated, judge whether this application bag is first application bag be activated, and if so, proceeds to S402, if not, proceeds to S403;
S402: from the head of total transient state resource space, the size of applying for according to this application bag, distributes required DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S403: (namely total transient state resource space size deducts the RTR space size distributed and deducts the DTR space size distributed to judge available transient state resource space size whether to meet this activation demand, whether be greater than the DTR size that this application bag be activated is applied for, if so, then meet; Otherwise do not meet), if so, proceed to S404, if not, proceed to S405;
S404: from the afterbody in the DTR space distributed, according to the size needed for this application bag, distributes DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S405: the abnormal information of prompting insufficient space, exits this activation manipulation.
Further, when applying for that the application bag of DTR is in deactivation status, described in S3, dynamic conditioning being carried out to the DTR space size in total transient state resource space, specifically comprising following operation:
When applying for the application bag deactivation of DTR, be divided into following two kinds of situations:
If A applies for that the application bag of DTR is deactivated owing to selecting the application of other application bags, then first travel through the application bag that other each logical channel activates, judging whether this application bag has is activated by other logical channels;
Activated by other logical channels if had, illustrate that the DTR space of the current use of this application bag can't be released (owing to have activated in other logical channels), then first retain the DTR space that this application bag uses, and judge whether the application bag selected by this activates in other logical channels, if so, the transient state space then this application bag place logical channel taken and selected application wrap in the transient state space that other passages activate and are consistent; If not, then activate according to above-mentioned application bag activation manipulation (namely from the afterbody in the DTR space distributed to selected application bag, according to the size of selected application bag application, distribute DTR space to use to selected application bag place logical channel, and initialization operation is carried out to the application in this application bag);
If do not activated by other logical channels, illustrate that the DTR resource of the current use of this application bag can be released, then first judge whether the application bag selected by this application bag activates in other logical channels, if, after then discharging the DTR space of the current use of this application bag, exit this deactivating operation, if not, then the DTR space of current for this application bag use is supplied to selected application bag to use, and space size is adjusted to the size of selected application bag application;
If B applies for that the application bag of DTR is owing to closing its place logical channel and deactivation, then first judging whether this application bag activates in other logical channels, if so, then do not carry out any process, directly exit this deactivating operation; Otherwise, behind the DTR space of the current use of release this application bag, exit this deactivating operation.
The present invention also provides a kind of system of the dynamic management JavaCard transient state resource based on said method, comprises original allocation module, resource bid administration module and resource use management module;
Original allocation module is used for: be the transient state resource space that transient state Resourse Distribute one is total;
Resource bid administration module is used for: when being stored in the application bag application transient state resource in logical channel, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource; If not, then the abnormal information of insufficient space is pointed out;
Resource use management module is used for: in the use procedure of RTR resource, the RTR space in total transient state resource space is supplied to its application bag of application and takies always, until when card resets, just carries out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic assignment and adjustment are carried out to the DTR space size in total transient state resource space.
The present invention is not limited to above-mentioned embodiment, and for those skilled in the art, under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvements and modifications are also considered as within protection scope of the present invention.The content be not described in detail in this instructions belongs to the known prior art of professional and technical personnel in the field.

Claims (7)

1. a method for dynamic management JavaCard transient state resource, is characterized in that, comprise the following steps:
S1: be the transient state resource space that transient state Resourse Distribute one is total, proceed to S2;
S2: when being stored in the application bag application transient state resource in logical channel, transient state resource comprises DTR resource, RTR resource, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource, proceeds to S3; If not, then point out the abnormal information of insufficient space, terminate;
S3: in the use procedure of RTR resource, is supplied to its application bag of application and takies always by the RTR space in total transient state resource space, until when card resets, just carry out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic assignment and adjustment are carried out to the DTR space size in total transient state resource space.
2. the method for dynamic management JavaCard transient state resource as claimed in claim 1, it is characterized in that: further comprising the steps of before S2: the DTR space size recording the required application of each application bag, and the DTR space size of application bag maximum for wherein required application space is recorded as sizeDm;
Judge described in S2 whether available transient state resource space size meets this application demand, specifically comprises the following steps:
Total transient state resource space size TRANSIENT_SIZE is defined as M, and the RTR space size sizeR applied for is defined as N, and the DTR space size sizeDruning of the current all application bags be activated is defined as P, and the space size of this application is defined as Q;
When applied for transient state resource type is RTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge sizeDm whether > P, if, then judge M-N-sizeDm whether > Q further, if, then be judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand; Otherwise, judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
When applied for transient state resource type is DTR, deterministic process is as follows:
The application bag of application DTR whether is had to be activated before first judging this time application;
If do not apply for, the application bag of DTR is activated, then judge M-N whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand;
If there is the application bag of application DTR to be activated, then judge M-N-P whether > Q, be if so, then judged as that available transient state resource space size can meet this application demand, if not, be then judged as that available transient state resource space size can not meet this application demand.
3. the method for dynamic management JavaCard transient state resource as claimed in claim 1, it is characterized in that: described in S2, apply for corresponding transient state resource, specifically comprise the following steps: when applying for RTR resource, once application just from the afterbody of total transient state resource space, wrap the size of applying for according to application, distribute required RTR space and use to the application of application bag; When applying for DTR resource, from the head of total transient state resource space, only just distributing corresponding DTR resource provisioning bag place logical channel when applying bag and activating use.
4. the method for dynamic management JavaCard transient state resource as claimed in claim 1, it is characterized in that: in S3, when applying for that the application bag of DTR is in state of activation, described dynamic assignment and adjustment being carried out to the DTR space size in total transient state resource space, specifically comprising the following steps:
S401: when applying for that the application bag of DTR is activated, judge whether this application bag is first application bag be activated, and if so, proceeds to S402, if not, proceeds to S403;
S402: from the head of total transient state resource space, the size of applying for according to this application bag, distributes required DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S403: judge whether available transient state resource space size meets this activation demand, if so, proceeds to S404, if not, proceeds to S405;
S404: from the afterbody in the DTR space distributed, according to the size needed for this application bag, distributes DTR space and uses to the logical channel at this application bag place, and after carrying out initialization operation to the application in this application bag, exit this activation manipulation;
S405: the abnormal information of prompting insufficient space, exits this activation manipulation.
5. the method for dynamic management JavaCard transient state resource as claimed in claim 1, it is characterized in that: in S3, when applying for that the application bag of DTR is in deactivation status, described dynamic assignment and adjustment being carried out to the DTR space size in total transient state resource space, specifically comprising the following steps:
When applying for the application bag deactivation of DTR, be divided into following two kinds of situations:
If A applies for that the application bag of DTR is deactivated owing to selecting the application of other application bags, then first judging whether this application bag has is activated by other logical channels;
Activated by other logical channels if had, illustrate that the DTR space of the current use of this application bag can't be released, then first retain the DTR space that this application bag uses, and judge whether the application bag selected by this activates in other logical channels, if so, the transient state space then this logical channel taken and selected application wrap in the transient state space that other passages activate and are consistent; If not, then from the afterbody in the DTR space distributed, according to the size of selected application bag application, distribute DTR space and use to the logical channel at this application bag place;
If do not activated by other logical channels, illustrate that the DTR resource of the current use of this application bag can be released, then judge whether the application bag selected by this activates in other logical channels, if, after then discharging the DTR space of the current use of this application bag, exit this deactivating operation, if not, then the DTR space of current for this application bag use is supplied to selected application bag to use, and space size is adjusted to the size of selected application bag application;
If B applies for that the application bag of DTR is owing to closing its place logical channel and deactivation, then judging whether this application bag activates in other logical channels, if so, then do not carry out any process, directly exit this deactivating operation; Otherwise, behind the DTR space of the current use of release this application bag, exit this deactivating operation.
6. the method for dynamic management JavaCard transient state resource as claimed in claim 1, is characterized in that: the size of transient state resource space total described in S1 is that the size of the RAM resource that can provide according to JavaCard platform is specified.
7., based on a system for the dynamic management JavaCard transient state resource of method according to any one of claim 1 to 6, it is characterized in that: comprise original allocation module, resource bid administration module and resource use management module;
Described original allocation module is used for: be the transient state resource space that transient state Resourse Distribute one is total;
Described resource bid administration module is used for: when being stored in the application bag application transient state resource in logical channel, judges whether available transient state resource space size meets this application demand, if so, then applies for corresponding transient state resource; If not, then the abnormal information of insufficient space is pointed out;
Described resource use management module is used for: in the use procedure of RTR resource, the RTR space in total transient state resource space is supplied to its application bag of application and takies always, until when card resets, just carries out clearing process; In the use procedure of DTR resource, according to state of activation or the deactivation status of the application bag of application DTR, dynamic assignment and adjustment are carried out to the DTR space size in total transient state resource space.
CN201510777120.7A 2015-11-13 2015-11-13 A kind of method and system of dynamic management JavaCard transient state resources Active CN105426237B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510777120.7A CN105426237B (en) 2015-11-13 2015-11-13 A kind of method and system of dynamic management JavaCard transient state resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510777120.7A CN105426237B (en) 2015-11-13 2015-11-13 A kind of method and system of dynamic management JavaCard transient state resources

Publications (2)

Publication Number Publication Date
CN105426237A true CN105426237A (en) 2016-03-23
CN105426237B CN105426237B (en) 2018-11-06

Family

ID=55504463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510777120.7A Active CN105426237B (en) 2015-11-13 2015-11-13 A kind of method and system of dynamic management JavaCard transient state resources

Country Status (1)

Country Link
CN (1) CN105426237B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807846A (en) * 2017-10-20 2018-03-16 大唐微电子技术有限公司 The method and apparatus for distributing JavaCard transient object memory spaces
CN109032960A (en) * 2018-06-29 2018-12-18 北京中电华大电子设计有限责任公司 A kind of dynamic allocation method and data structure of smart card RAM

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1289967A (en) * 1999-09-24 2001-04-04 国际商业机器公司 Dynamic memory administration for target data in small allied programme in Jave card
US20070168951A1 (en) * 2003-12-08 2007-07-19 Giesecke & Devrient Gmbh Java smart card chip having memory area reserved for global variables
CN102521145A (en) * 2011-12-23 2012-06-27 东信和平智能卡股份有限公司 Java card system and space distribution processing method thereof
CN102799660A (en) * 2012-07-04 2012-11-28 北京中电华大电子设计有限责任公司 JAVA card object management method
CN103309812A (en) * 2012-03-15 2013-09-18 中国移动通信集团公司 Allocation method and device for memory space of smart card
CN103699493A (en) * 2013-12-26 2014-04-02 上海柯斯软件有限公司 System and method for controlling DTR memory space of intelligent card

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1289967A (en) * 1999-09-24 2001-04-04 国际商业机器公司 Dynamic memory administration for target data in small allied programme in Jave card
US20070168951A1 (en) * 2003-12-08 2007-07-19 Giesecke & Devrient Gmbh Java smart card chip having memory area reserved for global variables
CN102521145A (en) * 2011-12-23 2012-06-27 东信和平智能卡股份有限公司 Java card system and space distribution processing method thereof
CN103309812A (en) * 2012-03-15 2013-09-18 中国移动通信集团公司 Allocation method and device for memory space of smart card
CN102799660A (en) * 2012-07-04 2012-11-28 北京中电华大电子设计有限责任公司 JAVA card object management method
CN103699493A (en) * 2013-12-26 2014-04-02 上海柯斯软件有限公司 System and method for controlling DTR memory space of intelligent card

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YOON-SIM YANG, WON-HO CHOI, MIN-SIK JIN, CHEUL-JUN HWANG等: "《An Advanced Java Card System Architecture for Smart Card Based on Large RAM Memory》", 《2006 INTERNATIONAL CONFERENCE ON HYBRID INFORMATION TECHNOLOGY》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107807846A (en) * 2017-10-20 2018-03-16 大唐微电子技术有限公司 The method and apparatus for distributing JavaCard transient object memory spaces
CN109032960A (en) * 2018-06-29 2018-12-18 北京中电华大电子设计有限责任公司 A kind of dynamic allocation method and data structure of smart card RAM
CN109032960B (en) * 2018-06-29 2023-10-10 北京中电华大电子设计有限责任公司 Dynamic allocation method of smart card RAM and storage device of data structure

Also Published As

Publication number Publication date
CN105426237B (en) 2018-11-06

Similar Documents

Publication Publication Date Title
US9996457B2 (en) Efficient buffering for a system having non-volatile memory
CN108197504B (en) Controllable data encryption and decryption system and method
US7725721B2 (en) Method and system for transferring software and hardware feature licenses between devices
US7426613B2 (en) Addressing, command protocol, and electrical interface for non-volatile memories utilized in recording usage counts
EP1361514B1 (en) System and method for managing resources of portable resource modules
CN101582089B (en) File management method of embedded equipment and system
CN105912307A (en) Data processing method and device of Flash controller
CN102207912B (en) Flash memory device and the access method thereof of sectoring function is realized in equipment end
CN103617440B (en) Multi-application smart card achieving multi-way independent control and issuing method thereof
US20060236026A1 (en) Method and system for allocating, accessing and de-allocating storage space of a memory card
CN105426237A (en) Method and system for dynamically managing JavaCard transient resources
CN109067523A (en) A kind of data ciphering method of encrypted card
CN101510332B (en) Method and apparatus for managing memory space of smart card
CN103297350B (en) Implementing method and switching equipment of cell switching system
CN103778149A (en) Document system and document storage managing method thereof
CN109032960B (en) Dynamic allocation method of smart card RAM and storage device of data structure
CN106626795A (en) Serial number transmission method, device, consumable chip and imaging box
CN109325356A (en) A kind of encryption card architecture
WO2009013877A1 (en) Memory controller, memory card, and nonvolatile memory system
CN1979428A (en) System for automatically releasing applied programe module leaked memory in inlaid system
CN1307558C (en) Virtual internal storage allocating and managing method of subsystem in communication system
CN105825146A (en) Design and implementation of rapid data authority distribution under RBAC model
CN102419693A (en) Method for managing disk space of memory cell and electronic equipment
CN103678151A (en) Configuration method and configuration device of block storage device of virtual machine
TW200601044A (en) Method of efficient data management with flash storage system

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