CN103309812B - A kind of distribution method of smart card memory space and device - Google Patents

A kind of distribution method of smart card memory space and device Download PDF

Info

Publication number
CN103309812B
CN103309812B CN201210069460.0A CN201210069460A CN103309812B CN 103309812 B CN103309812 B CN 103309812B CN 201210069460 A CN201210069460 A CN 201210069460A CN 103309812 B CN103309812 B CN 103309812B
Authority
CN
China
Prior art keywords
space
dtr
rtr
address
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210069460.0A
Other languages
Chinese (zh)
Other versions
CN103309812A (en
Inventor
李琳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201210069460.0A priority Critical patent/CN103309812B/en
Publication of CN103309812A publication Critical patent/CN103309812A/en
Application granted granted Critical
Publication of CN103309812B publication Critical patent/CN103309812B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Memory System (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

Embodiments of the invention disclose a kind of distribution method and device of smart card memory space, relate to technical field of intelligent card, to solve in prior art RTR and DTR space size in smart card RAM and distribute the technical matters being difficult to determine.Method of the present invention mainly comprises is appointed as RTR and DTR space by one section of continuous print address space in RAM, and according to the initial-boundary value preset, arranges the initial boundary in RTR and DTR space in described continuous print address space; When in described RTR space, remaining memory capacity is less than the amount of capacity of RTR data application, or when remaining memory capacity is less than the amount of capacity of described DTR data application in described DTR space, change the size in described RTR space or DTR space by boundary line described in dynamic conditioning in described continuous print address space.

Description

A kind of distribution method of smart card memory space and device
Technical field
The present invention relates to field of intelligent cards, particularly relate to a kind of distribution method and device of smart card memory space.
Background technology
Along with the widespread use of smart card techniques, the multiclass cards such as bank card, mass transit card, venue entrance ticket card all can concentrate in the safety chip of a mobile phone or a SIM card (being referred to as smart card below), have driven the demand of conglomerate cooperation hair fastener simultaneously.Multi-application card has more design and requirement in application management, card space management, secure communication mechanism etc.The many application markets of one card maintain sustained and rapid growth, application (applet) kind is variation day by day also, RAM (randomaccessmemory in the smart card that applet can take, random access memory) space according to application dynamic load, the application of correlation space dynamic and recovery.Available ram space is divided into two classes 1, RTR (CLEAR_ON_RESETRAM resets and removes): this sheet space can be wiped free of when smart card resets.Multiple applet can apply for this space, once each applet exclusively enjoys the space of application after application, therefore also can be called for short and exclusively enjoy internal memory.2, DTR (CLEAR_ON_DESELECTRAM cancels and removing): this sheet space can be wiped free of when application is by deselect, in addition, also can wipe this sheet space time smart card resets.Multiple applet can apply for this space, once multiple applet shares this space after application, and therefore also can referred to as shared drive.
Because ram space in safety chip in current mobile phone terminal or SIM card is valuable and limited, so the space size of RTR and DTR can limit to some extent.In the prior art, if smart card only uses RTR space, for RAM variable busy when being selected by applet and buffer, when just monopolizing after distribution, when applet quantity is many, occur that the probability of ram space deficiency is larger.If smart card only uses DTR space, also expect for some overall RAM variablees of application and buffer the applet always retaining (as state value) this space after powering, this demand just cannot realize.If smart card has RTR and DTR space simultaneously, the size distribution in two spaces is difficult to determine.Because RTR with the DTR spatial strategy that different intelligent card applet takies is different, for many applet smart card, more difficultly during hair fastener determine rational allocation of space value.Because once distribute behind RTR and DTR space, may deal with improperly due to operating system, cause having two space-likes and distribute mutual overlapping applet loss of data, even the applet situation of dying.
Summary of the invention
Embodiments of the invention provide a kind of distribution method and device of smart card memory space, and when can solve hair fastener, in smart card, RTR and the DTR space size of RAM distributes the technical matters being difficult to determine, improves application space utilization factor.
For achieving the above object, embodiments of the invention adopt following technical scheme:
The distribution method in smart card memory space, is characterized in that, comprising:
One section of continuous print address space in RAM is appointed as RTR and DTR space, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in continuous print address space, it is boundary line that continuous print address space is divided into initial boundary, side, boundary line is as RTR space, and opposite side is as DTR space;
When memory capacity remaining in RTR space is less than the amount of capacity of RTR data application, or when memory capacity remaining in DTR space is less than the amount of capacity of DTR data application, change the size in RTR space or DTR space by dynamic conditioning boundary line in continuous print address space, to make under RTR space DTR data under RTR data or DTR space.
Preferably, the method also comprises:
For the RTR data received, store in order to high address from the low address in RTR space, for the DTR data received, store in order to low address from the high address in DTR space; Or,
For the RTR data received, store in order to address from the high address in RTR space, for the DTR data received, store in order to high address from the low address in DTR space.
Further, the size changing RTR space or DTR space above by dynamic conditioning boundary line in continuous print address space specifically comprises:
Calculate the space size that RTR space requirement increases, and check whether the capacity of every section of DTR internal memory in DTR space has residue, if during the space size that every section of remaining capacity summation of DTR internal memory increases more than RTR space requirement, the mode being reduced every section of DTR memory size by equivalent adjusts boundary line, RTR space is increased, every section of DTR internal memory reduces, until RTR data under RTR space, and is upgraded in system registry by the boundary value in the boundary line after adjustment; Or
The DTR section internal memory calculating the application of DTR data needs the space size increased, and check whether the capacity in RTR space has residue, if the residue of being checked through, and the amount of capacity of RTR Spatial Residual is when enough every section of DTR internal memory all increases the space size needing to increase, the mode being increased every section of DTR memory size by equivalent adjusts boundary line, every section of DTR internal memory is all increased, RTR space reduces, until DTR data under DTR space, and the boundary value in the boundary line after adjustment is upgraded in system registry.
Further, RTR data from RTR space delete, or DTR data from DTR space delete after, the method also comprises:
Defragmentation is carried out to the RTR space after deletion or DTR space, the RTR space taken or DTR space is moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, boundary line place simultaneously.
Further, after defragmentation, the method also comprises:
Recover boundary line to default initial-boundary value, and more in RTR space, in the position of RTR data and/or DTR space the position of DTR data after new defragmentation in the registration table of system.
The distributor in smart card memory space, comprising:
Setting unit, for one section of continuous print address space in RAM is appointed as RTR and DTR space, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in continuous print address space, it is boundary line that continuous print address space is divided into initial boundary, side, boundary line is as RTR space, and opposite side is as DTR space;
Adjustment unit, for when memory capacity remaining in RTR space is less than the amount of capacity of RTR data application, or when memory capacity remaining in DTR space is less than the amount of capacity of DTR data application, change the size in RTR space or DTR space by dynamic conditioning boundary line in continuous print address space, make RTR data or DTR data under RTR space or DTR space.
Preferably, adjustment unit comprises:
Computing module, for calculating the space size that RTR space requirement increases, and checks whether the capacity of every section of DTR internal memory in DTR space has residue; Distribution module, the capacity being checked through every section of DTR internal memory for computing module has residue, and during the space size that every section of remaining capacity summation of DTR internal memory increases more than RTR space requirement, the mode being reduced every section of DTR memory size by equivalent adjusts boundary line, RTR space is increased, and every section of DTR internal memory reduces;
Or, computing module, the DTR section internal memory also for calculating the application of DTR data needs the space size increased, and checks whether the capacity in RTR space has residue; Distribution module, also for being checked through residue at computing module, and the amount of capacity of RTR Spatial Residual is when enough every section of DTR internal memory all increases the space size needing to increase, the mode being increased every section of DTR memory size by equivalent adjusts boundary line, every section of DTR internal memory is all increased, and RTR space reduces.
In addition, this device also comprises:
Continuous space allocation units, for for the RTR data received, store from the low address in RTR space in order to high address; For the DTR data received, store in order from the high address in DTR space to low address.
Fragment rectifies unit, for carrying out defragmentation to the RTR space after deletion RTR data, the RTR space taken is moved together formation continuation address, and for after deleting DTR data or DTR space carry out defragmentation, the DTR space taken is moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, boundary line place simultaneously.
Recovery unit, for after de-fragmentation unit arranges, recovers boundary line to default initial-boundary value, and more in RTR space, in the position of RTR data and/or DTR space the position of DTR data after new defragmentation in the registration table of system.
In the allocative decision in the smart memory space that the embodiment of the present invention provides, RTR space and DTR space is taked to be appointed as one section of continuous print address space, and pass through the technological means in the boundary line of RTR space and DTR space intersection in this continuation address space of adjustment, solve in prior art, because the RTR space of RAM in smart card during hair fastener and DTR space size distribute the technical matters being difficult to determine, and then can obtain and change RTR space or DTR spatial content dynamically according to the RTR data of application or the size of DTR data, reasonable distribution memory headroom, improve the technique effect of memory headroom utilization factor.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet of the distribution method in smart card memory space in the embodiment of the present invention 1;
The schematic diagram in Fig. 2 to be appointment continuous print address in the embodiment of the present invention 1 be RTR space and DTR space;
Fig. 3 is the schematic diagram of the mode of smart cards for storage RTR data and DTR data in the embodiment of the present invention 1;
Fig. 4 increases RTR space in the embodiment of the present invention 1, reduces the process schematic in DTR space;
Fig. 5 increases DTR space in the embodiment of the present invention 1, reduces the process schematic in RTR space;
Fig. 6 be in the embodiment of the present invention 1 smart card application delete after, defragmentation process schematic diagram;
Fig. 7 is that in the embodiment of the present invention 1, smart card, after defragmentation, recovers the process schematic of initial boundary address;
Fig. 8 is the structural representation of the distributor in smart card memory space in the embodiment of the present invention 2.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.Further, following embodiment is possibility of the present invention, embodiment put in order and embodiment numbering execution sequence preferred with it have nothing to do.
Embodiment 1
The present embodiment provides a kind of distribution method of smart card memory space, and as Fig. 1, the method comprises:
101, one section of continuous print address space in RAM is appointed as RTR and DTR space by smart card, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in continuous print address space, it is boundary line that continuous print address space is divided into initial boundary, side, boundary line is as RTR space, and opposite side is as DTR space;
For example, referring to the smart card shown in Fig. 2 according to the initial-boundary value preset, the continuation address space of specifying for RTR and DTR space in RAM.Wherein, support that (smart card supports several logical channel to two logical channels with this smart card, just there are several sections of DTR spaces, because this part is prior art, and the place that non-invention is improved, be not repeated herein) be example, as can be known from Fig. 2, what there was one section of buffer (internal memory) space in the left side in boundary line is RTR space, and on the right side of boundary line, there are two sections of DTRbuffer spaces in DTR space, is respectively DTR1 and DTR2.Wherein, the buffer amount of capacity in RTR space has Nbytes, and each DTRbuffer has M/2bytes, the DTR space always total Mbytes of every section of adjacent composition of DTRbuffer.
102, the RTR data that applet applies for by smart card are stored into RTR space, by the DTR data DTR space of application.
In the present invention, RTR data can be taked to store in order from high address to low address when RTR data being stored RTR space or random storage mode.The mode storing in order from low address to high address or store at random can be taked when DTR data being stored in DTR space.But in the present embodiment, in order to dynamic conditioning boundary line can be passed through more fully, realize the scheme increasing or reduce RTR spatial content (or DTR spatial content), should ensure at the neighbor address place in RTR space and DTR space blank as much as possible, namely ensure that the vacant storage area in RTR space and/or DTR space connects in address, boundary line place as much as possible.So in a preferred approach, step 102 can be:
For the RTR data received, store in order to high address from the low address in RTR space, for the DTR data received, store in order to low address from the high address in DTR space; Or, for the RTR data received, store in order to address from the high address in RTR space, for the DTR data received, store in order to high address from the low address in DTR space.
As shown in Figures 2 and 3, the RTR data applying A and application B application store from the low address in RTR space in order to high address; The DTR data of application B application store from the high address in DTR space in order to low address.If but left side in fig. 2, DTR space, RTR space is right side in fig. 2, then the RTR data applying A and application B application store from the high address in RTR space in order to low address; The DTR data of application B application store from the low address in DTR space in order to high address.
103, smart card is according to the situation dynamic conditioning DTR space of the storage size and DTR or RTR Spatial Residual space of applying application and RTR space size, so that application under holding.
This step specifically can be divided into the following two kinds situation:
One, when memory capacity remaining in RTR space is less than the amount of capacity of RTR data application, change the size in RTR space by dynamic conditioning boundary line in continuous print address space, make RTR data under RTR space.Specifically, preferred implementation is as follows for the process in this adjustment boundary line:
Calculate the space size that RTR space requirement increases, and check whether the capacity of every section of DTR internal memory in DTR space has residue, if during the space size that every section of remaining capacity summation of DTR internal memory increases more than RTR space requirement, the mode being reduced every section of DTR memory size by equivalent adjusts boundary line, RTR space is increased, every section of DTR internal memory reduces, until RTR data under RTR space, and is upgraded in system registry by the boundary value in the boundary line after adjustment;
In the present embodiment, can configure RTR space and neighbor address place, DTR space automatically, neatly by the boundary line of dynamic conditioning RTR and DTR, the buffer realizing neighbor address place shares.Such as, with reference to shown in Fig. 4, when the RTR space of applying C application to exceed in this smart card that in RTR space, buffer remains memory capacity, the amount of capacity that smart card calculates RTR space requirement to be increased is Xbytes, and whether has remaining space in the section of inspection DTRbuffer.If there is remaining space, and DTR1 and DTR4 remaining space total amount is more than Xbytes, then every section of DTRbutter is reduced x/2, and RTR space increases x, until can hold the space of application C application.Enough spaces are asked at application C, after data successful installation, by new threshold, the address adjusting every section of DTRbuffer after occupied address, adjustment in rear RTR space and DTR space upgrades in the registration table of smart card OS (operating system).
Above-mentioned method of adjustment is because mode is simple, not needing to calculate or control every section of DTRbuffer respectively, so be easy to realize, is optimal way of the present invention, but the mode that also can adjust DTRbuffer by other realizes increasing RTR space, such as, calculate respectively or control DTR1, DTR4.By only checking that the remaining space of DTR4 finds whether have Xbytes, if having, mobile boundary line is only needed to take out Xbytes from the buffer of DTR4.
Two, when memory capacity remaining in DTR space is less than the amount of capacity of DTR data application, change the size in DTR space by dynamic conditioning boundary line in continuous print address space, make DTR data under DTR space.Specifically, preferred implementation is as follows for the process in this adjustment boundary line:
The DTR section internal memory calculating the application of DTR data needs the space size increased, and check whether the capacity in RTR space has residue, if the residue of being checked through, and the amount of capacity of RTR Spatial Residual is when enough every section of DTR internal memory all increases the space size needing to increase, the mode being increased every section of DTR memory size by equivalent adjusts boundary line, every section of DTR internal memory is all increased, RTR space reduces, until DTR data under DTR space, and the boundary value in the boundary line after adjustment is upgraded in system registry.
Shown in Fig. 5, if application D applies for that DTR space exceedes DTR1buffer remaining space y/2bytes in this smart card, smart card will check in RTRbuffer whether have remaining space.If there is remaining space, and the amount of capacity of remaining space is enough and DTR1 and DTR2 all increases y/2bytes, then by RTR reduced space ybytes, every section of DTRbuffer increases y/2bytes, until can hold the space of application application.After application successful installation, new threshold, application A, B, C and D are upgraded in the registration table of smart card OS in RTR space and the address of DTR space hold, the address of the rear every section of DTRbuffer of adjustment.
In the above-mentioned preferred version of the present embodiment, when increasing DTR space, adopting and reducing RTR space, the mode that simultaneously every section of DTR all increases same space realizes, and can reduce and calculate respectively or the complexity of controls DTRbuffer, be convenient to realize and apply.Certainly, the present embodiment can also realize increasing DTR2 capacity by other means.Such as: only adjust boundary line, from RTR space, separate y/2bytes to DTR1, without the need to also separating y/2bytes for DTR2; Or whether enough, if enough, the y/2bytes of DTR2 is distributed to DTR1 if detecting remaining space in DTR2.But consider because DTR belongs to shared drive, cannot determine whether DTR will be applied application by other and take, so or realize belonging to preferred version by the mode reducing RTR space.
In addition, consider that Applet exists the situation taking RTR space or DTR space, also there is the situation of deleting from RTR space or DTR space, in order to ensure Appropriate application and the safe handling of content, the present embodiment also comprises following scheme:
Delete from RTR space in RTR data, or DTR data from DTR space delete after, smart card carries out defragmentation to the RTR space after deletion or DTR space, the RTR space taken or DTR space are moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, boundary line place simultaneously.
If have application to delete in RTR space or DTR space, smart card carries out fragment integration by the space of release, to take up room and all move as consecutive shock space, vacant RTR space will be put into the high address position of RTRbuffer, vacant DTR space will be put into the low address position of DTRbuffer.Boundary, after carrying out defragmentation, can be returned to default initial-boundary value by smart card.
For Fig. 6 and Fig. 7, after application B deletes from RTR space, during smart card defragmentation, the bbytes that application B takies is moved to and locates continuously with DTR space address, boundary line is returned to the initial boundary address in Fig. 2 simultaneously.
Further, complete at defragmentation, after smart card recovers boundary line to default initial-boundary value, smart card also to need in the registration table of system the position of DTR data in the position of RTR data in RTR space after more new defragmentation and/or DTR space.For the anti-electricity of process interrupt here, the relevant location information of OS registration table record need be backed up before Data Position moves, in the data of successfully mobile rear removing backup.Even if power-off in moving process like this, smart card still can next time reset after by backup date restoring in the registration table of OS.
In the method that the present embodiment provides, continuous print address space is specified to be RTR space and DTR space by adopting, and the mode in the boundary line connected between dynamic conditioning two spaces, when can solve hair fastener, in smart card, the RTR space of RAM and DTR space size distribute and are difficult to determine, the problem that application space utilization factor is low, and can avoid behind distribution RTR and DTR space, because operating system is dealt with improperly, cause two space-likes to distribute mutual overlapping place application data to lose, even apply the timely problem of dying, and then achieve can the limited storage space of Appropriate application smart card, improve the technique effect of storage space utilization factor.
Embodiment 2
The present embodiment provides a kind of distributor of smart card memory space, as shown in Figure 8, comprises setting unit 81, adjustment unit 82.
Setting unit 81, for one section of continuous print address space in RAM is appointed as RTR and DTR space, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in continuous print address space, it is boundary line that continuous print address space is divided into initial boundary, side, boundary line is as RTR space, and opposite side is as DTR space; Adjustment unit 82, for when memory capacity remaining in RTR space is less than the amount of capacity of RTR data application, or when memory capacity remaining in DTR space is less than the amount of capacity of DTR data application, change the size in RTR space or DTR space by dynamic conditioning boundary line in continuous print address space, to make under RTR space DTR data under RTR data or DTR space.
In preferred version, adjustment unit 82 comprises: computing module 821, distribution module 822.
Computing module 821, for calculating the space size that RTR space requirement increases, and checks whether the capacity of every section of DTR internal memory in DTR space has residue; Distribution module 822, the capacity being checked through every section of DTR internal memory for computing module has residue, and during the space size that every section of remaining capacity summation of DTR internal memory increases more than RTR space requirement, the mode being reduced every section of DTR memory size by equivalent adjusts boundary line, RTR space is increased, and every section of DTR internal memory reduces;
And/or, computing module 821, the DTR section internal memory also for calculating the application of DTR data needs the space size increased, and checks whether the capacity in RTR space has residue; Distribution module 822, also for being checked through residue at computing module, and the amount of capacity of RTR Spatial Residual is when enough every section of DTR internal memory all increases the space size needing to increase, the mode being increased every section of DTR memory size by equivalent adjusts boundary line, every section of DTR internal memory is all increased, and RTR space reduces.
Further, this device also can comprise: continuous space allocation units 83, and fragment rectifies unit 84, recovery unit 85.
Continuous space allocation units 83, in the continuation address space that arranges at setting unit 81, for the RTR data received, store from the low address in RTR space to high address in order; For the DTR data received, store in order address on earth from the high address in DTR space.
Fragment rectifies unit 84, for carrying out defragmentation to the RTR space after deletion RTR data, the RTR space taken is moved together formation continuation address, and for after deleting DTR data or DTR space carry out defragmentation, the DTR space taken is moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, boundary line place simultaneously.
Recovery unit 85, for after de-fragmentation unit arranges, recovers boundary line to default initial-boundary value, and more in RTR space, in the position of RTR data and/or DTR space the position of DTR data after new defragmentation in the registration table of system.
The device that the present embodiment provides can be disposed within a smart card, realize the method in embodiment 1, and only need to revise the security module in smart card (such as SIM card), corresponding functional module is increased at OS software, smart card hardware is without the need to transformation, and software increases capacity estimation in 2-3K byte, therefore improves little, be convenient to realize, be easy to promote.
The device that the present embodiment provides takes RTR space and DTR space to be appointed as one section of continuous print address space, and pass through the technological means in the boundary line of RTR space and DTR space intersection in this continuation address space of adjustment, solve in prior art, because the RTR space of RAM in smart card during hair fastener and DTR space size distribute the technical matters being difficult to determine, and then can obtain and change RTR space or DTR spatial content dynamically according to the RTR data of application or the size of DTR data, reasonable distribution memory headroom, improves the technique effect of memory headroom utilization factor.
Technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, in other words: even if the main body of each equipment manner of execution of device of the present invention, equipment or composition system or practical function is hardware, but the essence part realizing this function of the present invention is module or the unit of computer software product.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection domain of claim.

Claims (8)

1. the distribution method in smart card memory space, is characterized in that, comprising:
One section of continuous print address space in RAM is appointed as RTR and DTR space, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in described continuous print address space, described continuous print address space is divided into described initial boundary as boundary line, side, described boundary line is as RTR space, and opposite side is as DTR space;
When in described RTR space, remaining memory capacity is less than the amount of capacity of RTR data application, or when in described DTR space, remaining memory capacity is less than the amount of capacity of described DTR data application, the size in described RTR space or DTR space is changed, described DTR data under described RTR data or described DTR space under making described RTR space by boundary line described in dynamic conditioning in described continuous print address space;
Wherein, the size changing described RTR space or DTR space by boundary line described in dynamic conditioning in described continuous print address space specifically comprises:
Calculate the space size that RTR space requirement increases, and check whether the capacity of every section of DTR internal memory in DTR space has residue, if when every section of DTR internal memory remaining capacity summation exceedes the space size of described RTR space requirement increase, the mode being reduced every section of DTR memory size by equivalent adjusts described boundary line, described RTR space is increased, every section of DTR internal memory reduces, until described RTR data under described RTR space, and is upgraded in system registry by the boundary value in the described boundary line after adjustment; Or
The DTR section internal memory calculating the application of described DTR data needs the space size increased, and check whether the capacity in RTR space has residue, if the residue of being checked through, and the amount of capacity of RTR Spatial Residual enough every section of DTR internal memory all increases described when needing the space size increased, the mode being increased every section of DTR memory size by equivalent adjusts described boundary line, described every section of DTR internal memory is all increased, RTR space reduces, until described DTR data under described DTR space, and the boundary value in the described boundary line after adjustment is upgraded in system registry.
2. the distribution method in smart card memory space according to claim 1, it is characterized in that, the method also comprises:
For the RTR data received, store in order to high address from the low address in RTR space, for the DTR data received, store in order to low address from the high address in DTR space; Or,
For the RTR data received, store in order to low address from the high address in RTR space, for the DTR data received, store in order to high address from the low address in DTR space.
3. the distribution method in smart card memory space according to claim 1 and 2, is characterized in that, deletes from described RTR space in described RTR data, or in described DTR data from after described DTR space is deleted, the method also comprises:
Defragmentation is carried out to the RTR space after deletion or DTR space, the RTR space taken or DTR space is moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, place, described boundary line simultaneously.
4. the distribution method in smart card memory space according to claim 3, is characterized in that, after defragmentation, the method also comprises:
Recover described boundary line to the initial-boundary value preset, and more in RTR space, in the position of RTR data and/or DTR space the position of DTR data after new defragmentation in the registration table of system.
5. the distributor in smart card memory space, is characterized in that, comprising:
Setting unit, for one section of continuous print address space in RAM is appointed as RTR and DTR space, and according to the initial-boundary value preset, the initial boundary in RTR and DTR space is set in described continuous print address space, described continuous print address space is divided into described initial boundary as boundary line, side, described boundary line is as RTR space, and opposite side is as DTR space;
Adjustment unit, for when in described RTR space, remaining memory capacity is less than the amount of capacity of RTR data application, or when in described DTR space, remaining memory capacity is less than the amount of capacity of described DTR data application, the size in described RTR space or DTR space is changed, DTR data under described RTR data or described DTR space under making described RTR space by boundary line described in dynamic conditioning in described continuous print address space;
Described adjustment unit comprises:
Computing module, for calculating the space size that RTR space requirement increases, and checks whether the capacity of every section of DTR internal memory in DTR space has residue;
Distribution module, the capacity being checked through every section of DTR internal memory for described computing module has residue, and when every section of DTR internal memory remaining capacity summation exceedes the space size of described RTR space requirement increase, the mode being reduced every section of DTR memory size by equivalent adjusts described boundary line, described RTR space is increased, and every section of DTR internal memory reduces;
Or,
Described computing module, the DTR section internal memory also for calculating the application of described DTR data needs the space size increased, and checks whether the capacity in RTR space has residue;
Described distribution module, also for being checked through residue at described computing module, and the amount of capacity of RTR Spatial Residual enough every section of DTR internal memory all increases described when needing the space size increased, the mode being increased every section of DTR memory size by equivalent adjusts described boundary line, described every section of DTR internal memory is all increased, and RTR space reduces.
6. the distributor in smart card memory space according to claim 5, is characterized in that, this device also comprises:
Continuous space allocation units, for for the RTR data received, store from the low address in RTR space in order to high address, for the DTR data received, store in order from the high address in DTR space to low address; Or, for the RTR data received, store in order to address from the high address in RTR space, for the DTR data received, store in order to high address from the low address in DTR space.
7. the distributor in the smart card memory space according to claim 5 or 6, is characterized in that, this device also comprises:
De-fragmentation unit, for carrying out defragmentation to the RTR space after deletion RTR data, the RTR space taken is moved together formation continuation address, and for after deleting DTR data or DTR space carry out defragmentation, the DTR space taken is moved together formation continuation address, makes remaining RTR space and remaining DTR space continuous in address, place, described boundary line simultaneously.
8. the distributor in smart card memory space according to claim 7, is characterized in that, this device also comprises:
Recovery unit, for after described de-fragmentation unit arranges, recovers described boundary line to default initial-boundary value, and more in RTR space, in the position of RTR data and/or DTR space the position of DTR data after new defragmentation in the registration table of system.
CN201210069460.0A 2012-03-15 2012-03-15 A kind of distribution method of smart card memory space and device Active CN103309812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210069460.0A CN103309812B (en) 2012-03-15 2012-03-15 A kind of distribution method of smart card memory space and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210069460.0A CN103309812B (en) 2012-03-15 2012-03-15 A kind of distribution method of smart card memory space and device

Publications (2)

Publication Number Publication Date
CN103309812A CN103309812A (en) 2013-09-18
CN103309812B true CN103309812B (en) 2016-03-30

Family

ID=49135059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210069460.0A Active CN103309812B (en) 2012-03-15 2012-03-15 A kind of distribution method of smart card memory space and device

Country Status (1)

Country Link
CN (1) CN103309812B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699493B (en) * 2013-12-26 2016-07-06 上海柯斯软件股份有限公司 The control system and method for smart card DTR memory headroom
CN105279097B (en) * 2014-07-07 2019-06-18 北京数码视讯科技股份有限公司 A kind of management method, equipment and smart card calling transient object
CN105824651B (en) * 2015-01-06 2019-01-01 中国移动通信集团公司 A kind of smart card is interior to apply installation method and device
CN105426237B (en) * 2015-11-13 2018-11-06 武汉天喻信息产业股份有限公司 A kind of method and system of dynamic management JavaCard transient state resources
CN107807846A (en) * 2017-10-20 2018-03-16 大唐微电子技术有限公司 The method and apparatus for distributing JavaCard transient object memory spaces
CN110520839A (en) * 2018-03-28 2019-11-29 深圳市大疆创新科技有限公司 Storage medium space application method, apparatus and unmanned plane in System on Chip/SoC
CN110750211B (en) * 2019-09-05 2021-05-04 华为技术有限公司 Storage space management method and device
CN110716934B (en) * 2019-10-09 2022-07-26 宁波三星医疗电气股份有限公司 Data storage method and device and electronic equipment
CN115391032A (en) * 2022-08-15 2022-11-25 上海慧程工程技术服务有限公司 Memory optimization method for industrial Internet of things edge equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1484230A (en) * 2002-09-18 2004-03-24 建兴电子科技股份有限公司 Dynamic memory configuring method for recording power of CDRW driver
CN1932779A (en) * 2006-09-20 2007-03-21 华为技术有限公司 Method and apparatus for updating data
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system
CN101515254A (en) * 2008-02-18 2009-08-26 鸿富锦精密工业(深圳)有限公司 System and method for managing storage space

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6996695B2 (en) * 2002-07-17 2006-02-07 Masse Wayne P Method, system, and storage medium for optimizing disk space and information access
JP2007094900A (en) * 2005-09-29 2007-04-12 Eastman Kodak Co Access apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1484230A (en) * 2002-09-18 2004-03-24 建兴电子科技股份有限公司 Dynamic memory configuring method for recording power of CDRW driver
CN1932779A (en) * 2006-09-20 2007-03-21 华为技术有限公司 Method and apparatus for updating data
CN101221536A (en) * 2008-01-25 2008-07-16 中兴通讯股份有限公司 Internal memory managing method and device of embedded system
CN101515254A (en) * 2008-02-18 2009-08-26 鸿富锦精密工业(深圳)有限公司 System and method for managing storage space

Also Published As

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

Similar Documents

Publication Publication Date Title
CN103309812B (en) A kind of distribution method of smart card memory space and device
CN104503708B (en) The method and device of data hash storage
CN102831069B (en) Internal memory processing method, memory management equipment
CN103902465A (en) Method and system for recycling solid state disk junk and solid state disk controller
CN106445408A (en) NAND flash memory management method, host, NAND flash memory reading and writing method, and NAND flash memory controller
CN102521145A (en) Java card system and space distribution processing method thereof
CN101446926A (en) Method for storing power-fail data of cache memory, equipment and system thereof
CN103392165B (en) Storage system
CN102722340A (en) Data processing method, apparatus and system
CN105404679A (en) Data processing method and apparatus
CN103049220A (en) Storage control method, storage control device and solid-state storage system
CN109086078A (en) Android system upgrade method, device, server and mobile terminal
CN106598495A (en) Mixed storage service quality control method and control apparatus
CN106155596A (en) Method for writing data and device
CN103034592A (en) Data processing method and device
CN108205498A (en) Method for recovering internal storage and device, computer installation and computer readable storage medium
US8549223B1 (en) Systems and methods for reclaiming storage space on striped volumes
CN102023821A (en) Disc space management method and system
CN103699493B (en) The control system and method for smart card DTR memory headroom
CN104461705B (en) A kind of method and storage control, cluster storage system of business access
CN107315658A (en) A kind of data back up method and device, computer installation and readable storage medium storing program for executing
CN104461779B (en) A kind of storage method of distributed data, apparatus and system
CN106341448A (en) Distributed storage method, device and system
CN106502591A (en) A kind of storage controlling method and memory control device based on mixing storage product
CN104408126A (en) Persistent writing method, device and system of database

Legal Events

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