CN107729260A - Memory space recovery method for smart card - Google Patents
Memory space recovery method for smart card Download PDFInfo
- Publication number
- CN107729260A CN107729260A CN201710914594.0A CN201710914594A CN107729260A CN 107729260 A CN107729260 A CN 107729260A CN 201710914594 A CN201710914594 A CN 201710914594A CN 107729260 A CN107729260 A CN 107729260A
- Authority
- CN
- China
- Prior art keywords
- application
- smart card
- supplementary module
- module
- cards
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0253—Garbage collection, i.e. reclamation of unreferenced memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
Abstract
The present invention provides a kind of memory space recovery method for smart card, including:Application of IC cards source code is divided into primary module and supplementary module;The application state of application of IC cards is determined, and is determined in response to described to notify smart card operating system to reclaim the supplementary module related to the application state;By smart card operating system associative operation is performed in response to the notice.This method can be with data recyclable in each application code in automatic identification smart card and automatic recovery section memory space, so as to which smart cards for storage space be more efficiently utilized.
Description
Technical field
The present invention relates to technical field of intelligent card, and specifically, the present invention relates to a kind of memory space for smart card
Recovery method.
Background technology
The situation that multiple card applications are accommodated with the continuous development of smart card, in a sheet smart card is more and more common.Intelligence
Block and certain memory space is distributed for each application, the direct access of data can not be carried out between different applications.However, due to
Total memory space is often extremely limited on smart card, so the download and use of application are often because of free memory
Deficiency and be restricted.The focus that the utilization rate of limited storage space on smart card is technical field of intelligent card how is improved to ask
Topic.
The content of the invention
Totality of the scheme in existing recovery smart cards for storage space involved by generally both for each application of IC cards
Application data and corresponding temporary memory space.It is an object of the invention to provide one kind can more effectively utilize smart card
The solution of memory space, the source code for each application and related data, which take up space, in time carries out the automatic of part
Recovery.
The purpose of the present invention is realized by following technical scheme:
The invention provides a kind of memory space recovery method for smart card, including:
Application of IC cards source code is divided into primary module and supplementary module by step 1);
Step 2) determines the application state of application of IC cards, and is determined in response to described to notify smart card operating system to return
Receive the supplementary module related to the application state;
Step 3) deletes corresponding supplementary module by smart card operating system in response to the notice.
In the above method, it may also include in step 1) and the starting and ending address of supplementary module be marked.
In the above method, respectively primary module and supplementary module distribution application identifier are may also include in step 1), and will
The application identifier of the primary module and supplementary module that belong to same application of IC cards is associated.
In the above method, the supplementary module related to application state may include after application of IC cards enters the application state
The auxiliary code or data that will not be used again.
In the above method, the application state may include not individualize stage and individualized completion stage.
, can be by calling smart card operation system by the primary module or supplementary module in the step 2) in the above method
Unite provide interface come notify smart card operating system reclaim supplementary module.
In the above method, the step 1) may also include sets recovery mark for each supplementary module.
In the above method, the step 2) may also include in response to determining the application state of application of IC cards to change auxiliary
Recovery mark corresponding to module, the supplementary module can be reclaimed with instruction.
In the above method, the step 3) may include to reclaim mark as corresponding to smart card operating system in response to supplementary module
The supplementary module is deleted in the change of will.
In the above method, the step 3) may include the recovery as corresponding to smart card operating system periodic detection supplementary module
Mark, and perform related space reclamation for recyclable supplementary module and operate.
Compared with prior art, the present invention has following technique effect:
In each application code that can be in automatic identification smart card recyclable data and depositing in smart card is reclaimed automatically
Space is stored up, and does not interfere with the normal use of other various functions in addition to the function of being recovered part in smart card.
Brief description of the drawings
Hereinafter, embodiments of the invention are described in detail with reference to accompanying drawing, wherein:
Fig. 1 is the schematic flow sheet according to the memory space recovery method for smart card of the embodiment of the present invention.
Embodiment
In order that the purpose of the present invention, technical scheme and advantage are more clearly understood, pass through below in conjunction with accompanying drawing specific real
Applying example, the present invention is described in more detail.It should be appreciated that specific embodiment described herein is only to explain the present invention, and
It is not used in the restriction present invention.
Smart card generally comprises microprocessor unit (CPU), memory cell and input/output interface unit.Smart card
Memory cell generally includes random access memory (RAM), read-only storage (ROM) and Electrically Erasable Read Only Memory
(EEPROM).Wherein RAM is used to deposit ephemeral data or intermediate data, and capacity is generally smaller and is volatile memory;ROM
In be solidified with smart card operating system COS (Chip Operating System), it is impossible to change in any way, and EEPROM
It is nonvolatile memory, storing the various application messages (such as encryption data and application file etc.) of smart card, holder
Personal information, distribution unit for information about etc., and this part storage resource is also available for User Exploitation to utilize.But in intelligence
The capacity of the nonvolatile memory EEPROM integrated on card is limited, and the already present scheme of prior art is greatly both for intelligence
Can card application apply when performing and the overall recovery profit of the progress such as space that is taken using memory space, involved application data
With, but shared segment space is not utilized effectively the source code of consideration application of IC cards in itself.
Study and find through inventor, application of IC cards is after some stage of its life cycle is entered, which part source generation
Code will not be used again, therefore provide a kind of memory space recovery side for smart card in an embodiment of the present invention
Method, reclaimed automatically for the space shared by this partial code, so as to provide more non-volatile memories for smart card
The free space in area.In an embodiment of the present invention, are referred to as into smart card each stage for having different demands in application of IC cards should
Use state.After application of IC cards reaches some application state, some data will not subsequently be used, and this is due to some work(
Can be irreversible, or only need to realize once, once after the completion of function be prohibited.By this kind of number in the present embodiment
According to being defined as assistance data, such as including performing the number being related in number instruction only once, source code and its processing procedure
According to the set of object etc..After smart card enters some application state, that is, these assistance datas are automatically deleted, so as to reclaim intelligence
Card space.Illustrated below by taking the code performed in the individualized stage of application of IC cards as an example, smart card is being issued to use
Need to carry out the personalized or individualized stage during family, be exactly to add all data for assigning specific individual or particular card and application
It is loaded onto in smart card.The usual personalized technology of application of IC cards is using the automatic safe processing encrypted comprehensively, such as from intelligence
The card sequence number and master key (KM) of card calculate card release private key (KD) to encrypt personal data, then in an encrypted form
Send smart card to, by these data decipherings and EEPROM appropriate location is write in card;In another example utilize smart card master control
Key is imported and applies master control key, and other application key, such as consumption key etc. are imported using application master control key.It is although individual
Peopleization flow can change according to the different demands of different application, but after the individualized stage completes, these support individual
The dependent instruction or code of peopleization process are just no longer used, and the space shared by this partial code is reclaimed, undoubtedly can
More free spaces are provided for smart card.
Fig. 1 gives the flow signal of the memory space recovery method according to an embodiment of the invention for smart card
Figure.As shown in figure 1, this method includes S1) application of IC cards source code is divided into primary module and supplementary module;S2 intelligence) is determined
Block the application state of application, and determine that notice smart card operating system reclaims corresponding supplementary module in response to described;S3) by intelligence
Energy card operation system deletes corresponding supplementary module in response to the notice, to reclaim the memory space shared by it.
More specifically, in step S1) application of IC cards source code is split as primary module and supplementary module.Supplementary module bag
Include assistance data mentioned above, such as the code sum related to some application states in application of IC cards life cycle
According to, it is only necessary to realize or perform once, reach the code being just no longer used after some application state or data etc..Primary module bag
Include such as the data that the repeatable source code for realizing application of IC cards common function performed, needs are reused.At one
In embodiment, the supplementary module of application of IC cards can be marked to facilitate identification, such as the starting of mark supplementary module
Address and length, or starting and end address.In yet another embodiment, can also be by the primary module and auxiliary of application of IC cards
Module is stored separately, and sets related unique application identifier respectively to supplementary module for primary module, and pass through form or certain
Mathe-matical map method the identifier of the primary module of same application and supplementary module is associated.The main mould of same application of IC cards
Block can be associated with one or more supplementary modules.
In step S2) application state of application of IC cards is determined, and determine notice smart card operating system in response to described
Reclaim memory space.For example, application state can be divided into not individualized stage and individualized completion stage.When the application of IC cards
Application state when being the individualized completion stage, this, which is used to carrying out personalized supplementary module will not be in, is used.At one
In example, it can determine that supplementary module has completed the correlation function in individualized stage by primary module, and lead in response to the determination
Know that intelligent operating system reclaims the memory space related to supplementary module.In another example, it can also be existed by supplementary module
Intelligent operating system is notified to reclaim relative memory space immediately after having performed correlation function.
Illustrated below by taking a supplementary module for performing application of IC cards personalization process as an example, it is assumed that example
Application of IC cards primary module complete it is individualized need to write each 1 of 4 type keys (Key A, Key B, Key C, Key D) and
4 binary files (being divided into EF01, EF02, EF03, EF04 with identifier field), these keys and file are as primary module
Internal data store is in the nonvolatile memory of smart card.Before the individualized stage, supplementary module sets one and is stored in
Variable bCurrentConfig in nonvolatile memory, type byte, is worth for 0;In the individualized stage, supplementary module is every
After secondary reception Write Key are instructed and are successfully written key, Key Tpe is judged and correspondingly for variable bCurrentConfig
Carry out or operate:
If Key A, variable bCurrentConfig=bCurrentConfig | 0x01;
If Key B, variable bCurrentConfig=bCurrentConfig | 0x02;
If Key C, variable bCurrentConfig=bCurrentConfig | 0x04;
If Key D, variable bCurrentConfig=bCurrentConfig | 0x08.
Also, instructed and after be successfully written binary file when supplementary module receives Write Binary every time, judge text
Part identifier is simultaneously correspondingly carried out or operated for variable bCurrentConfig:
If EF01, variable bCurrentConfig=bCurrentConfig | 0x10;
If EF02, variable bCurrentConfig=bCurrentConfig | 0x20;
If EF03, variable bCurrentConfig=bCurrentConfig | 0x40;
If EF04, variable bCurrentConfig=bCurrentConfig | 0x80.
When supplementary module receives individualized END instruction and successful execution, variable bCurrentConfig value is checked
To judge the application state residing for application of IC cards:If its value is 0xFF, judge that all keys and binary file have been write
Enter, accordingly, the individualized stage has completed;Otherwise, then judge that related data does not write completely, accordingly, individualize the stage not
Complete.Or when supplementary module receives individualized END instruction and successful execution, by variable bCurrentConfig value
The variable bConfigInMaster that assignment is set into primary module.So, application of IC cards primary module can be by first checking change
The value for measuring bConfigInMaster judges the application state residing for application of IC cards:If its value is 0xFF, judge all close
Key and binary file have been written into, and accordingly, the individualized stage has completed;Otherwise, then judge that related data does not write completely,
Accordingly, the individualized stage does not complete.It is noted that above-mentioned example is merely illustrative of rather than carried out any restrictions, different intelligence
Can card application have different individualized demands (including all kinds key, all kinds file and structure, various initialization numbers
According to), therefore the process of the actual application state for judging application of IC cards can be come real with flexible and changeable depending on concrete application concrete condition
It is existing.It is above-mentioned application state to be divided into the not individualized stage and the individualized completion stage is also merely illustrative of rather than carried out any limit
System, as long as after entering some application state in application of IC cards life cycle, the auxiliary code or data that do not use subsequently
It can be seen as the supplementary module related to the application state.
It is determined that after the application state of application of IC cards, in response to the determination smart card operating system can be notified to return
Receive the supplementary module which will not subsequently be used again.In one embodiment, for example, can be by being sent out to smart card operating system
Message is sent to notify intelligent operating system recovery respective stored space.Still illustrated with example above, become in primary module inspection
BConfigInMaster value is measured afterwards or after supplementary module inspection variable bCurrentConfig value, calls intelligence
Can the message passing interface that provides of card operation system, by the parameter related to supplementary module (such as the address of supplementary module or auxiliary
Help application identifier of module etc.) notify smart card operating system.In yet another embodiment, it can be each supplementary module
Corresponding recovery indicating bit or recovery mark are set.After supplementary module has performed corresponding function, returning for its association can be set
Indicating bit or recovery mark are received, can be recycled with instruction.Smart card operating system can be regularly or in response on for example
Operation such as electricity etc. carrys out the recovery Warning Mark of each supplementary module of automatic detection, and phase is performed for the supplementary module that may be recovered
The space reclamation operation of pass.Smart card operating system can also change to reclaim this in response to the recovery mark of supplementary module
The memory space that supplementary module takes.
With continued reference to Fig. 1, in step S3) when smart card operating system is received from application of IC cards primary module or aids in mould
During the notice of block, the operation for deleting supplementary module is performed, non-volatile memory space (including source generation that the supplementary module takes
Code, and all data objects being related to etc.) it will all be recovered.
From above-described embodiment as can be seen that method provided by the invention is it is determined that the premise of the application state of application of IC cards
Under, part auxiliary code in above-mentioned application and data can be reclaimed automatically, intelligent card space profit is improved so as to reach
With the purpose of rate.And the scheme in existing recovery smart cards for storage space generally reclaims after application of IC cards life cycle terminates
Its memory space occupied, but it is not intended that detected in the normal life cycle of general intelligence card application inside application of IC cards
With the presence or absence of recyclable data.Different, the present invention is it is determined that the recyclable situation of divided data inside application of IC cards
Under, reclaimer operation is carried out to the recyclable data in the part by smart card operating system in time.
Although the present invention be described by means of preferred embodiments, but the present invention be not limited to it is described here
Embodiment, also include made various changes and change without departing from the present invention.
Claims (10)
1. a kind of memory space recovery method for smart card, including:
Application of IC cards source code is divided into primary module and supplementary module by step 1);
Step 2) determines the application state of application of IC cards, and in response to the determination come notify smart card operating system recovery with
The related supplementary module of the application state;
Step 3) deletes corresponding supplementary module by smart card operating system in response to the notice.
2. according to the method for claim 1, wherein also including entering the starting and ending address of supplementary module in step 1)
Line flag.
3. according to the method for claim 1, wherein should also including respectively primary module and supplementary module distribution in step 1)
With identifier, and the application identifier of the primary module and supplementary module that belong to same application of IC cards is associated.
4. according to the method for claim 1, enter wherein the supplementary module related to application state is included in application of IC cards
Enter the auxiliary code that will not be used again after the application state or data.
5. according to the method for claim 1, wherein the application state includes the not individualized stage and individualized to complete rank
Section.
6. according to the method for claim 1, wherein passing through calling by the primary module or supplementary module in the step 2)
Smart card operating system provide interface come notify smart card operating system reclaim supplementary module.
7. according to the method for claim 1, wherein the step 1) also includes setting recovery mark for each supplementary module.
8. according to the method for claim 7, wherein the step 2) also includes the application in response to determining application of IC cards
State indicates to change recovery corresponding to supplementary module, and the supplementary module can be reclaimed with instruction.
9. according to the method for claim 8, wherein the step 3) is included by smart card operating system in response to aiding in mould
The supplementary module is deleted in the change of recovery mark corresponding to block.
10. according to the method for claim 8, wherein the step 3) includes being aided in by smart card operating system periodic detection
Recovery mark corresponding to module, and perform related space reclamation for recyclable supplementary module and operate.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710914594.0A CN107729260A (en) | 2017-09-30 | 2017-09-30 | Memory space recovery method for smart card |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710914594.0A CN107729260A (en) | 2017-09-30 | 2017-09-30 | Memory space recovery method for smart card |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107729260A true CN107729260A (en) | 2018-02-23 |
Family
ID=61208456
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710914594.0A Pending CN107729260A (en) | 2017-09-30 | 2017-09-30 | Memory space recovery method for smart card |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107729260A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030106942A1 (en) * | 2001-12-11 | 2003-06-12 | Matsushita Electric Industrial Co., Ltd. | IC card and data processing method therefor |
CN1514987A (en) * | 2001-04-10 | 2004-07-21 | 格姆普拉斯公司 | Method and system for managing data designed to be stored in programmable smart card |
CN101246440A (en) * | 2007-02-12 | 2008-08-20 | 东信和平智能卡股份有限公司 | Java card system rubbish recovering method |
CN102591788A (en) * | 2011-12-23 | 2012-07-18 | 飞天诚信科技股份有限公司 | Method for recovering Java card garbage |
-
2017
- 2017-09-30 CN CN201710914594.0A patent/CN107729260A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1514987A (en) * | 2001-04-10 | 2004-07-21 | 格姆普拉斯公司 | Method and system for managing data designed to be stored in programmable smart card |
US20030106942A1 (en) * | 2001-12-11 | 2003-06-12 | Matsushita Electric Industrial Co., Ltd. | IC card and data processing method therefor |
CN101246440A (en) * | 2007-02-12 | 2008-08-20 | 东信和平智能卡股份有限公司 | Java card system rubbish recovering method |
CN102591788A (en) * | 2011-12-23 | 2012-07-18 | 飞天诚信科技股份有限公司 | Method for recovering Java card garbage |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104008061A (en) | Internal memory recovery method and device | |
CN102087715B (en) | Information processing device, information processing method and program | |
CN101533481B (en) | Method for expanding function of mask smart card | |
CN104008111B (en) | A kind of memory management method and device of data | |
CN101650972A (en) | Method for updating data of nonvolatile memory of intelligent card | |
JP2010072965A (en) | Portable electronic device and data processing method in portable electronic device | |
CN109726134B (en) | Interface test method and system | |
CN110949173A (en) | Charging method and device | |
CN110599267A (en) | Electronic invoice billing method and device, computer readable storage medium and computer equipment | |
CN109544265B (en) | Electronic lock information processing method, electronic device and storage medium | |
CN111027725A (en) | Recovered vehicle processing method and device, computer equipment and storage medium | |
CN114386058A (en) | Model file encryption and decryption method and device | |
CN110460686A (en) | A kind of block chain address register method and device | |
CN107729260A (en) | Memory space recovery method for smart card | |
CN104778099B (en) | A kind of damaged file reconstructing methods of the YAFFS2 based on old version | |
JP6928146B1 (en) | On-board unit and security function control program | |
CN105303208A (en) | IC card management method and system | |
CN101571808B (en) | Method for improving production efficiency of telecommunication smart card | |
CN105574425B (en) | Access the method and device of storage data | |
CN103309758A (en) | Card application downloading method, system and device | |
CN105809067B (en) | Data access method and system and memory storage apparatus | |
CN113568581A (en) | Multi-application resource recovery method and system for embedded equipment | |
CN101853216A (en) | Data processing system, controller, and method for searching specific memory area thereof | |
CN102236816A (en) | Non-contact intelligent card file system for supporting power fail safeguard and method for preventing power fail | |
CN116541132B (en) | Management method and device for indirect access variable stack |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180223 |