CN101593193A - A kind of management method of smart card document system - Google Patents

A kind of management method of smart card document system Download PDF

Info

Publication number
CN101593193A
CN101593193A CNA200810113118XA CN200810113118A CN101593193A CN 101593193 A CN101593193 A CN 101593193A CN A200810113118X A CNA200810113118X A CN A200810113118XA CN 200810113118 A CN200810113118 A CN 200810113118A CN 101593193 A CN101593193 A CN 101593193A
Authority
CN
China
Prior art keywords
bunch
file
data
dat
space
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
Application number
CNA200810113118XA
Other languages
Chinese (zh)
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.)
Beijing CEC Huada Electronic Design Co Ltd
Original Assignee
Beijing CEC Huada Electronic Design 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 Beijing CEC Huada Electronic Design Co Ltd filed Critical Beijing CEC Huada Electronic Design Co Ltd
Priority to CNA200810113118XA priority Critical patent/CN101593193A/en
Publication of CN101593193A publication Critical patent/CN101593193A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present invention is a kind of management method of smart card document system, belongs to the smart card operating system field in the field of embedded software.The present invention mainly provides a kind of method of smart card document system management, relate to the design of smartcard internal file data structure, with a series of management methods such as data access, operations, solved file data has been threshed interpolation, deletion and the change operations such as size that take up room, and the problem of data space recycling, defragmentation in the card.The present invention adopts a kind of DAT, and (Data Allocation Table: mode data distribution list) is managed the smartcard internal space.With bunch mode manage each piece actual physics space, bunch in bunch between have logical relation.Different data or file can take discontinuous bunch.The present invention is mainly used in the operating system design of high end intelligent card, OTA for example, smart cards such as USIM.

Description

A kind of management method of smart card document system
Technical field
The invention belongs to the smart card operating system category in the field of embedded software.
Background technology
Smart card is a kind of IC-card, and the integrated circuit in the card comprises central processor CPU, EEPROM (or other medium), RAM and is solidificated in the interior smart card operating system COS of card.
One of function of smart card operating system is exactly every data and the file in the control card, just said file system.
Smart card document system mode or other the discontinuous storage modes that adopt by the physical space sequential storage more, sequential access is the simplest file access, when opening file, the access indicator of file is pointed to first information unit, as first byte or first record, information unit access indicator of every access adds 1, points to next information unit, so analogizes.The sequential access shortcoming is that file is difficult for dynamic growth, the waste headspace, be unfavorable for the redistributing and moving of insertion, deletion, space of file, there are problems such as external fragmentation, be difficult to reach the requirement of the file system of complete meaning, promptly to file and data interpolation, deletion and change etc. repeatedly.
Summary of the invention
Increasing along with the application function demand, demand to operations such as file and data interpolation, deletion and changes repeatedly is more and more, the present invention is just for addressing this problem a kind of method that designs, solved file data has been threshed interpolation, deletion and the change operations such as size that take up room, and the interior data space of card reuses, the problem of defragmentation, can carry out retrieval management to the smart card space, improve the service efficiency and the life-span of smart card.
The present invention mainly provides a kind of method of smart card document system management, relates to the design and a series of management method such as data access, operation of smartcard internal file data structure.Solved file data has been threshed interpolation, deletion and the change operations such as size that take up room, and the problem of data space recycling, defragmentation in the card.
The present invention adopts the mode of a kind of DAT (data distribution list) to manage the smartcard internal space.With bunch mode manage each piece actual physics space, bunch in bunch between have logical relation.Different data or file can take discontinuous bunch.A corresponding cover file structure pattern is proposed simultaneously.
Term definition:
DAT:Data Allocation Table, data distribution list.
Cluster (bunch): the minimum unit that the DAT file system can be managed, its big or small byte number must be 8 multiples.Generally be 32,64,128 bytes.
MF:master?file
DF:directory?file
EF:elementary?file
The system physical storage organization as shown in Figure 1, the smart cards for storage space is divided into system data area, data distribution list DAT district, MF master catalogue district, DF directory area and EF transparent file district, adopt the mode of data distribution list DAT to manage the smartcard internal space, with bunch mode manage each piece actual physics space, bunch in bunch between have logical relation, the DAT table writes down the operating position of each bunch in order successively, and different data or file take discontinuous bunch; The directory area writes down the address information of file attribute and the file DF of subordinate and the EF of this catalogue, and attribute and the file body of an EF write down in the file area.
Wherein, followed by the DAT list area, in the DAT table, each represented implication of DAT table is that the management information record of the embodiment of the space of this bunch expression in the DAT table is called a bunch entry in the back of COS system data area.In the DAT table, bunch numbering also is the numbering of entry.
Each bunch of DAT file system entry accounts for 16bit, the length of 2 bytes among the present invention.The DAT table has write down the operating position of each bunch in order successively, is a kind of diagrammatic sketch method.Every bunch operating position is filled in 16 scale-of-two, and a bunch relevant position that is not assigned with writes zero; Nonzero value is inserted in a bunch relevant position of having distributed.Be specially: if this bunch is the last cluster of file, the value of inserting is 7FFFH, if this bunch is not the last cluster of file, the value of inserting be the next one that takies of this document bunch bunch number, bunch of chain of each bunch formation that so just in time file is taken is kept in the DAT table, as shown in Figure 1.A file often needs to take a lot of bunches.Same file not necessarily can intactly leave in the continuous storage space, but is divided into plurality of sections, deposits as the chain.In filename record, point to DAT bunch of begin chain place of file storage, and the DAT of this bunch table is deposited DAT bunch of value of next chain, if end-of-file (EOF) is used an end-of-file mark, expression arrival last-of-chain, the chain type that has so just identified file is stored.Bunch space size and DAT district, the directory area size that takes up space calculate according to the user's space size by card operation system.
Fig. 3 has represented a kind ofly to represent that by DAT mode comes the example of data of description: accounted for 3 bunches of spaces altogether as a file, its first bunch is 0000H bunch, the 2nd bunch has accounted for 0001H bunch, the 3rd bunch 0003H bunch, its following cluster of mark is which bunch (0001H a bunch) on the 0000th of DAT item No. so, its following cluster of mark is which bunch (0003H a bunch) on the 0001st of DAT item No. then, at last on the 0003rd of DAT item No. mark it be last cluster (7FFF).
Preserve in the internal memory current directory district bunch number, current EF bunch number, i.e. file channel information.File system bottom layer treatment module provides logic continuous read by DAT table and file channel information to the upper strata.
The directory area has write down the address information of file attribute and subordinate's file (DF/EF) of this catalogue.Wherein MF always follows closely in back, DAT district.
Attribute and the file body of an EF write down in the file area.It has a plurality of discontinuous bunch of storages, describes for convenient, represents with relative bunch number.
General smart card is not supported data space recycling in blocking at present, or the bad problem of implicit defragmentation, thereby can not finish some application-specific.
The method of this smart card document system management provided by the invention, solved when file data threshed interpolation, deletion and change and take up room operation such as size, problem to data space recycling, defragmentation in blocking makes smart card can satisfy abundanter application demand.
Description of drawings
Fig. 1 is the system physical storage organization
Fig. 2 is 16 DAT list items of 2 bytes;
Fig. 3 is each bunch number desirable list item value and implication thereof in the file allocation table;
Fig. 4 comes the example of data of description for represent mode by DAT;
Fig. 5 is the directory area structure of MF;
Fig. 6 is the directory area structure of DF;
Fig. 7 is the file area structure;
Fig. 8 is the file/data write process flow diagram to DAT managed
Embodiment
Below by embodiment the present invention is specifically introduced.
Preserve in the internal memory current directory district bunch number, current EF bunch number, i.e. file channel information.File system bottom layer treatment module provides the data logic continuous read by DAT table and file channel information to the upper strata.
The directory area has write down the address information of file attribute and subordinate's file (DF/EF) of this catalogue.Wherein MF always follows closely in back, DAT district.
Attribute and the file body of an EF write down in the file area.It has a plurality of discontinuous bunch of storages, describes for convenient, represents with relative bunch number.
Specifically the operation to smart card relates to many aspects, illustrates the embodiment of the present invention in practical operation below.
For example will revise the data of the 6F01 (EF, transparent file) among the 7F20 (DF) under the 3F00 (MF), typical DAT treatment scheme is as follows.
(1) searches 3F00 (MF) file.Regulation 3F00 (MF) is since the 0th bunch, and first address is 0x0000.According to bunch number and the product of bunch size calculate the start address of 3F00 (MF) file.
(2) search 7F20 (DF) file.In the directory area (see figure 5) of the 3F00 that finds from (1) (MF), whether retrieval " the file ID i of subordinate " has the item that equals " 7F20 ".If do not have, then report file does not exist; If have, then can obtain this " file ID i first bunch number ".Then the start address of 7F20 (DF) file just equals first bunch number and the product of bunch size of file ID i.
(3) search 6F01 (EF) file.From 2) in the directory area (see figure 6) of the 7F20 (DF) that finds, whether retrieval " the file ID i of subordinate " has the item that equals " 6F01 ".If do not have, then report file does not exist; If have, then can obtain this " file ID i first bunch number ".Then the start address of 6F01 (EF) file just equals the product of " file ID i first bunch number " and bunch size.
(4) check whether file attribute meets the demands.
More whether read " file layout " field, be " transparent file " type.If then the 3rd, 4 bytes are file size; If not, then execution error report;
Check " writing attribute " field, the key authentication by allowing to write before judging whether if allow to write, then jumps to 4.3); If do not allow to write, then execution error report;
Check that " purpose offset address " and " data length " is whether in the data area of 6F01 (EF) file.At first, more whether exceed " file size " with " purpose offset address " and " data length " addition; If smaller or equal to, then jump to 5); If greater than, then execution error report.
(5) specific address of calculating " purpose offset address ".This operation will be retrieved the DAT table.Calculate according to " purpose offset address " " relative bunch number ", then from first bunch number of 6F01 (EF) (with reference to the file of Fig. 3 with bunch number corresponding relation) begin to search the absolute bunch of number A that " relative bunch number " pointed to; And specific address in the compute cluster.
(6) in bunch A, write the modification data.The space * greater than data length y, the process of then writing finishes if can write in bunch; Otherwise, writing the data of " can write the space in bunch " length, data length y changes to the value that y deducts x.
(7) in the DAT table, search bunch B that the next one belongs to 6F01 (EF) file then, repeat 6) step.
The method of this smart card document system management provided by the invention, solved when file data threshed interpolation, deletion and change and take up room operation such as size, problem to data space recycling, defragmentation in blocking makes smart card can satisfy application demand.

Claims (3)

1, a kind of management method of smart card document system, it is characterized in that the smart cards for storage space is divided into system data area, data distribution list DAT district, MF master catalogue district, DF directory area and EF transparent file district, adopt the mode of data distribution list DAT to manage the smartcard internal space, with bunch mode manage each piece actual physics space, bunch in bunch between have logical relation, the DAT table writes down the operating position of each bunch in order successively, and different data or file take discontinuous bunch; The directory area writes down the address information of file attribute and the file DF of subordinate and the EF of this catalogue, and attribute and the file body of an EF write down in the file area.
2, a kind of management method of smart card document system as claimed in claim 1 is characterized in that MF master catalogue district is in back, data distribution list DAT district.
3, a kind of management method of smart card document system as claimed in claim 1, space size that it is characterized in that bunch and DAT district, the directory area size that takes up space is calculated according to the user's space size by card operation system.
CNA200810113118XA 2008-05-28 2008-05-28 A kind of management method of smart card document system Pending CN101593193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA200810113118XA CN101593193A (en) 2008-05-28 2008-05-28 A kind of management method of smart card document system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA200810113118XA CN101593193A (en) 2008-05-28 2008-05-28 A kind of management method of smart card document system

Publications (1)

Publication Number Publication Date
CN101593193A true CN101593193A (en) 2009-12-02

Family

ID=41407852

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA200810113118XA Pending CN101593193A (en) 2008-05-28 2008-05-28 A kind of management method of smart card document system

Country Status (1)

Country Link
CN (1) CN101593193A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567522A (en) * 2011-12-28 2012-07-11 北京握奇数据系统有限公司 Method and device for managing file system of intelligent card
CN104573571A (en) * 2015-02-04 2015-04-29 郑州信大捷安信息技术股份有限公司 Method for generating security file system of smart card
CN105279097A (en) * 2014-07-07 2016-01-27 北京数码视讯科技股份有限公司 Management method and equipment of invoke transient object, and smart card
CN106649860A (en) * 2016-12-30 2017-05-10 郑州云海信息技术有限公司 Defragmentation method applied to aggregation file

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567522A (en) * 2011-12-28 2012-07-11 北京握奇数据系统有限公司 Method and device for managing file system of intelligent card
CN102567522B (en) * 2011-12-28 2014-07-30 北京握奇数据系统有限公司 Method and device for managing file system of intelligent card
CN105279097A (en) * 2014-07-07 2016-01-27 北京数码视讯科技股份有限公司 Management method and equipment of invoke transient object, and smart card
CN105279097B (en) * 2014-07-07 2019-06-18 北京数码视讯科技股份有限公司 A kind of management method, equipment and smart card calling transient object
CN104573571A (en) * 2015-02-04 2015-04-29 郑州信大捷安信息技术股份有限公司 Method for generating security file system of smart card
CN104573571B (en) * 2015-02-04 2017-09-19 郑州信大捷安信息技术股份有限公司 A kind of generation method of smart card security file system
CN106649860A (en) * 2016-12-30 2017-05-10 郑州云海信息技术有限公司 Defragmentation method applied to aggregation file
CN106649860B (en) * 2016-12-30 2020-09-18 苏州浪潮智能科技有限公司 Defragmentation method applied to aggregated files

Similar Documents

Publication Publication Date Title
CN101315628B (en) Internal memory database system and method and device for implementing internal memory data base
CN102867071B (en) Management method for massive network management historical data
KR101157171B1 (en) A storage system for a smart card and a method of managing file creation in the storage system
CN101263462B (en) Nonvolatile memory with block management
CN105389264B (en) The method and system of garbage collection in storage system
US20060015510A1 (en) Method for sorting a data structure
CN101571869B (en) File memory and read method of smart card and device thereof
CN102999429B (en) To have nonvolatile memory system comparatively fast set flattening
CN103838853B (en) Mixed file system based on different storage media
CN1321377C (en) Method for controlling smart card storage environment
CN101488153A (en) Method for implementing high-capacity flash memory file system in embedded type Linux
CN102426586B (en) FAT (file allocation table) file storage method in embedded system
CN103488710B (en) The non-fixed-length data method of efficient storage in big data page
CN100424699C (en) Attribute extensible object file system
CN111522507B (en) Low-delay file system address space management method, system and medium
CN102253985B (en) File system data management method and system
KR102316271B1 (en) Method for managing of memory address mapping table for data storage device
CN102609492B (en) Metadata management method supporting variable table modes
CN103425435A (en) Disk storage method and disk storage system
CN103500206A (en) Storage method and device based on file storage data
CN101593193A (en) A kind of management method of smart card document system
CN101876956A (en) File access method and device of SD (Secure Digital) card
CN101441596B (en) Method for improving flash memory medium read-write speed
CN100543748C (en) A kind of method and system of utilizing file allocation table to carry out the file tracking
CN107704200A (en) A kind of data deposit method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20091202