CN100561452C - A kind of card operating system carries out method of operating and smart card to the data file - Google Patents

A kind of card operating system carries out method of operating and smart card to the data file Download PDF

Info

Publication number
CN100561452C
CN100561452C CNB2007101762483A CN200710176248A CN100561452C CN 100561452 C CN100561452 C CN 100561452C CN B2007101762483 A CNB2007101762483 A CN B2007101762483A CN 200710176248 A CN200710176248 A CN 200710176248A CN 100561452 C CN100561452 C CN 100561452C
Authority
CN
China
Prior art keywords
file
data
card
data file
smart card
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
CNB2007101762483A
Other languages
Chinese (zh)
Other versions
CN101140548A (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.)
Beijing Watchdata Limited by Share Ltd
Original Assignee
Beijing WatchData System 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 WatchData System Co Ltd filed Critical Beijing WatchData System Co Ltd
Priority to CNB2007101762483A priority Critical patent/CN100561452C/en
Publication of CN101140548A publication Critical patent/CN101140548A/en
Application granted granted Critical
Publication of CN100561452C publication Critical patent/CN100561452C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of smart card card operating system the data file is carried out method of operating and smart card, be used for External memory equipment is carried out data file operation, comprise: smart card card operating system is obtained the External memory equipment configuration information, and described configuration information comprises the capacity and the file data form of External memory equipment; When smart card card operating system or application program of intelligent card carried out data file operation, smart card card operating system was according to the externally enterprising line data file operation of memory device of described configuration information.Use the present invention, can make card operating system when External memory equipment is operated, can't destroy original file format system on the memory device externally, make external unit still can visit its original file system.

Description

A kind of card operating system carries out method of operating and smart card to the data file
Technical field
The present invention relates to data file operation, particularly smart card card operating system is carried out method of operating and smart card to the data file.
Background technology
Smart card, English " SMART CARD " by name claims again " integrated circuit card "; Be a kind of cards micro integrated circuit chip, that have standard specification such as microprocessor and storer that have.Smart card standard mainly contains ISO7816 (International Standards Organization 7816, ISO (International Standards Organization) 7816 standards the 4th part), CEN (TC224, WG10) (the European Committee forStandardization Electronic Purse, European Committee for Standardization's stored value card), EMV (Europay, Mastercard and Visa, credit card association) ETSI (European Telecommunications StandardsInstitute, ETSI European Telecommunications Standards Institute) etc.Fig. 1 is the smartcard internal structural representation.As shown in the figure, smart card can carry out data interaction by USB interface, flash interface, 7816 interfaces, SD/MMC interface and outside.Under the competitive environment that is growing more intense, smart card techniques develops towards the direction of vast capacity, high throughput, high-speed interface and high security.
At present, smart card is associated with other external equipments becomes the new highlight in market, as the External memory equipment nand flash memory is incorporated on the intelligent card chip, makes the capacity of smart card can reach 64MB to 512MB even higher.In the use of this class External memory equipment, for PC (PersonalComputer, PC), terminal such as mobile phone, they can pass through MMC/USB fast interfaces such as (Multi Media Card/Universal Serial Bus, multimedia card/USB (universal serial bus)) and directly visit nand flash memory in the prior art.For smart card, by also interconnecting between the flash memory of nand flash memory controller control and the intelligent card chip, make the application program on the smart card can pass through COS (CardOperating System, card operating system) flash memory of integrating is conducted interviews, thereby obtain bigger free space.
But, the deficiencies in the prior art are: when visiting nand flash memory owing to terminals such as PC, mobile phones by fast interfaces such as MMC/USB, need to use the file system of PC or mobile phone itself, as FAT16, FAT32 flash memory has been carried out on the correspondent file system basis nand flash memory being conducted interviews after the corresponding format again; So COS can not allow the application access nand flash memory and not destroy the file system of flash memory itself in the prior art, can not guarantee simultaneously that flash memory still can be by PC or this kind equipment of mobile phone by the visit of MMC/USB express passway.
Summary of the invention
The embodiment of the invention provides a kind of card operating system that the data file is carried out method of operating and smart card, with so that External memory equipment of the prior art can be carried out data file operation by smart card COS, also can be carried out the problem of data file operation as PC or this kind equipment of mobile phone by other.
The embodiment of the invention provides a kind of smart card card operating system that the data file is carried out method of operating, is used for External memory equipment is carried out data file operation, comprises the steps:
Smart card card operating system is obtained the External memory equipment configuration information, and described configuration information comprises the capacity and the file data form of External memory equipment;
When smart card card operating system or application program of intelligent card carried out data file operation, smart card card operating system was according to the externally enterprising line data file operation of memory device of described configuration information.
The embodiment of the invention also provides a kind of smart card, is applied to carry out data file operation with External memory equipment, comprises external equipment administration module, file operation requests module, external equipment access interface, file access control module, wherein:
The external equipment administration module, be used to obtain the configuration information of External memory equipment, described configuration information comprises the capacity and the file data form of External memory equipment, and provides the passage that the data file is operated according to configuration information after setting up being connected of smart card and External memory equipment;
The file operation requests module is used to initiate the operation requests to the data file;
The external equipment access interface is used for after the operation requests that receives described file operation requests module, and the operational order that External memory equipment is operated is provided according to operation requests;
The file access control module is used for after receiving operational order, the externally enterprising line data file operation of memory device of operating walk way that provides by described external equipment administration module by operational order according to described configuration information.
Embodiment of the invention beneficial effect is as follows:
In the embodiment of the invention, smart card COS at first obtains the External memory equipment configuration information when External memory equipment is carried out data file operation, and configuration information comprises capacity and the file data form that External memory equipment is arranged; Like this, when smart card card COS or application program of intelligent card carried out data file operation, smart card COS not only needed according to the capacity in the configuration information, goes back the file layout externally memory device enterprising line data file operation of fibrous root according to External memory equipment.Because carrying out the action need of data file on memory bank carries out according to file layout, make COS can't destroy the original file format system on the memory device externally when External memory equipment is operated, this has just guaranteed that also terminals such as PC, mobile phone still can visit its original file system by fast interfaces such as MMC/USB.
Description of drawings
Fig. 1 is a smartcard internal structural representation described in the background technology;
Fig. 2 carries out method of operating implementing procedure synoptic diagram for smart card COS described in the embodiment of the invention to the data file;
Fig. 3 is a smart card architecture synoptic diagram described in the embodiment of the invention;
Fig. 4 is that file directory described in the embodiment of the invention is resolved the implementing procedure synoptic diagram;
Fig. 5 is the synoptic diagram of high-speed cache implementing procedure described in the embodiment of the invention;
Fig. 6 interrupts described in the embodiment of the invention and unusual implementing procedure synoptic diagram.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described.
Application program of intelligent card described in the embodiment of the invention is meant and operates on the COS, finishes the application of various different demands by COS.JavaApplet application program of the application program of various safety enciphers, telecommunications STK (SIM Tool Kit, the SIM card tool box) application program that comprises " super book ", " sending short messages in groups " etc., support Java or the like is for example arranged.
The External memory equipment of smart card is meant the memory device that is incorporated on the intelligent card chip, built-in memory bank on the relative smart card, refer generally to the memory device of outside jumbo memory device, particularly M (million) level, such as using more nand flash memory at present.
Externally memory device with as the data manipulation pass of external unit such as PC and smart card fasten, External memory equipment can be articulated on the various operating systems such as windows, Unix of external unit as moveable magnetic disc by express passways such as the USB/MMC on its chip, and the file system of External memory equipment can and be operated by corresponding operating system identification; And the data bus of COS by inside visits External memory equipment, External memory equipment is carried out the operation of data file, as read and operation such as modification, simultaneously, the application program on the card also can effectively be visited and operate External memory equipment by COS.Like this, by express passway and smartcard internal data buss such as USB/MMC, external unit can carry out data interaction with External memory equipment, and smart card also can carry out data interaction with External memory equipment.
By aforementioned manner with after External memory equipment is connected, smart card COS just can carry out data file operation to External memory equipment, Fig. 2 carries out method of operating implementing procedure synoptic diagram for smart card COS to the data file, as shown in the figure, smart card COS carries out data file operation to External memory equipment and can comprise the steps:
Step 201, smart card COS obtain the External memory equipment configuration information, and described configuration information comprises the capacity and the file data form of External memory equipment;
Step 202, when smart card COS or application program of intelligent card carry out data file operation, smart card COS is according to the externally enterprising line data file operation of memory device of described configuration information.
In the enforcement, when smart card COS or application program of intelligent card carry out the data file operation of ISO7816 form, smart card COS or application program of intelligent card are externally operated in the data folder of memory device I SO7816 form, like this, because COS is to carry out by the ISO7816 agreement to the operation of External memory equipment, and in the data file of ISO7816, operate, therefore can't have influence on the file system of external unit such as PC, as FAT16, Ext3 etc. to original operation; And when smart card card operating system or application program of intelligent card carried out the data file operation of directory file system form, smart card card operating system or application program of intelligent card can directly externally be operated in the data folder of the directory file system form of memory device.
In the enforcement, because External memory equipment might not include the ISO7816 data file, when so smart card COS obtains the External memory equipment configuration information, can further include: when not containing the file data of ISO7816 form in the configuration information, create the data folder of ISO7816 form; When smart card COS or application program of intelligent card carried out the data file operation of ISO7816 form, smart card COS or application program of intelligent card were operated in the data folder of the ISO7816 of described External memory equipment form;
Perhaps, when smart card COS or application program of intelligent card carry out the data file operation of ISO7816 form, when not containing the file data of ISO7816 form in the described configuration information, create the data folder of ISO7816 form; Smart card COS or application program of intelligent card are operated in the data folder of the ISO7816 of described External memory equipment form.
The data file of creating the ISO7816 form is to utilize jumbo External memory equipment for rational and effective more, and it is that externally memory device is opened up a panel region and is specifically designed to the file of depositing 7816 normalized definitions.Can come 7816 data files of creating in the External memory equipment control that conducts interviews according to the ISO7816 standard.
For example, when the initiation request of access of application program need be operated the data file, if operation requests at be 7816 data files, then the request of visit is analyzed, externally search in 7816 data file systems of memory device, find the file of request, and finish the operation of reading or writing.
Can be divided into 7816 data file systems identification configuration, the parsing of 7816 data file system bibliographic structures and three parts of 7816 data file read-write operations during concrete enforcement accordingly.Externally set up a file corresponding to the External memory equipment file system under the root directory of memory device during 7816 data file systems identification configuration, all 7816 data files that are saved in External memory equipment all will be kept in the content of this file.Be responsible for when 7816 data file system bibliographic structures are resolved each 7816 data file in this file is discerned parsing, find 7816 catalogues or the file of appointment.After finding 7816 catalogue files of appointment, just can finish operations such as reading and write to 7816 data files.
Certainly, if the request of access of application program at be directory file system, then externally search in the directory file system of memory device, find the file of request, and finish the operation of reading or writing.
Accordingly, also can be divided into directory file system identification, the parsing of directory file system bibliographic structure and three parts of file read-write operation in concrete the enforcement.At first read the content of External memory equipment initial sector during directory file system identification, then the content format of initial sector is analyzed, judgement is FAT16 file system or FAT32 file system or alternative document systems such as Ext2, Ext3.Bibliographic structure is finished when resolving the analysis of bibliographic structure such as is searched at operation, after finishing the identification of External memory equipment file system, can other be resolved the file system directories structure according to concrete filesystem class, finish searching to assigned catalogue or specified file, as for FAT16 or FAT32 file system, then be to carry out directory entry's traversal and search etc. from root directory.After Search and Orientation to assigned catalogue or file is finished in the bibliographic structure analysis, can finish the opening of file, read-write, and corresponding directory entry revise etc. operation.
Smart card COS can further include one of following steps or its combination according to the externally enterprising line data file operation of memory device of described configuration information:
1, anti-plug is pulled out the electric protection step: when smart card COS externally writes data file operation on the memory device according to described configuration information, write External memory equipment after described data file write the intelligent card data backup area; When External memory equipment powers on,, the data file of described intelligent card data backup area is write External memory equipment if when described intelligent card data backup area and External memory equipment data file are inconsistent;
In this step; in access process to External memory equipment; because the singularity of the environment for use of smart card own; the situation that might occur power down suddenly in the access process; destroyed and cause the out of use situation of whole card in order to make card and External memory equipment core data in the power down process, not occur, can use this step to come the data on the smart card are protected.Particularly, can work as the file access system module need read the External memory equipment data time, the data of direct access External memory equipment not, but finish reading and revising of data by calling anti-plug function.After the instruction that receives data read or modification, can write data into the backup area in the card earlier, backup area writes External memory equipment after writing and finishing again.And when re-powering, check at first whether backup area wants data recovered at every turn, if having, then recover accordingly according to the content of backup area.
2, buffer memory step: at smart card buffer area storing data files, smart card operating system preferentially reads the data file that needs operation from described buffer area to smart card COS according to the operation rule;
Because the characteristic of External memory equipment physical equipment, the speed of COS visit External memory equipment will be well below the speed of direct visit smartcard internal storer.Therefore, this step can read content in the External memory equipment in advance to the buffer area of card, in order to improve the speed of visit.When needs read data file in the External memory equipment, whether the data file that inspection will be visited was present in the buffer area, if be present in the buffer area, and the direct content data file in the return cache district then; If there is not the data file of needs in the buffer area, then needs reading corresponding data file from External memory equipment, and relevant data file copies is got final product in buffer area.
During concrete enforcement, can read the rule of External memory equipment according to COS, data file that reading frequency is high etc. for example, read this part data file in the External memory equipment in advance in buffer memory, COS is when the visit External memory equipment like this, just can directly in buffer memory, read, can improve the speed of visit greatly.
3, interrupt and unusual controlled step: when the data file operation that smart card COS externally carries out on the memory device according to described configuration information takes place to interrupt, preserve the operation executing state, after interrupting recovering, continue to carry out according to the operation executing state of described preservation.
In the process of visit External memory equipment, certain sector physical damage also may take place can not read, can not find abnormal conditions such as corresponding data sector, External memory equipment response timeout, this step can be used to handle these anomalous events.In the enforcement, when data file send or data file when finishing receiving or the data file transmission time triggered when the sheet wheel changes and had no progeny in corresponding, finish response, and call corresponding Interrupt Process function and finish processing interrupting.Concrete, when aborted takes place, execute present instruction after, will jump to the execution of corresponding aborted handling procedure place.After the aborted handling procedure was complete, program turned back to next bar instruction place of the instruction that interruption takes place and carries out.When entering the aborted handling procedure, preserve interrupted program implementation scene.When the aborted handling procedure withdraws from, recover that interrupted program implementation is on-the-spot to get final product.
The embodiment of the invention also provides a kind of smart card that is applied to carry out with External memory equipment data file operation, describes below in conjunction with the embodiment of accompanying drawing to smart card.
Because the file system format that External memory equipment has is more various, in order to realize the visit of smart card COS and application program to External memory equipment, embodiment has adopted the scheme of hierarchical structure, application program and COS are packaged into different functional hierarchies to the accessing operation of External memory equipment, application program only need be called the outermost functional module of COS, and operation control, buffer memory, anti-plug are pulled out each module such as electricity and all are encapsulated in the middle layer accordingly, and the bottom then is the unified physics read module that calls External memory equipment; Thereby made up fast, safely, effectively the External memory equipment operation scheme of being convenient to expand.
Each module section that hierarchical structure mainly will constitute carries out layout according to different levels; Unidirectional dependence between layer and the layer, by interfacial interaction, lower floor provides service for the upper strata between adjacent layer, and the service that use lower floor in upper strata provides is to realize the function of this layer.The upper strata hides the details that is right after lower floor, and related technical manual, the realization technology of lower floor is close to the upper strata and shields.
Fig. 3 is the smart card architecture synoptic diagram, this application of IC cards is in carrying out data file operation with External memory equipment, as shown in the figure, smart card comprises external equipment administration module, file operation requests module, external equipment access interface, file access control module, wherein:
The external equipment administration module, be used to obtain the configuration information of External memory equipment, described configuration information comprises the capacity and the file data form of External memory equipment, and provides the passage that the data file is operated according to configuration information after setting up being connected of smart card and External memory equipment;
The file operation requests module is used to initiate the operation requests to the data file;
The external equipment access interface is used for after the operation requests that receives described file operation requests module, and the operational order that External memory equipment is operated is provided according to operation requests;
The file access control module is used for after receiving operational order, the externally enterprising line data file operation of memory device of operating walk way that provides by described external equipment administration module by operational order according to described configuration information.
Concrete enforcement to each module describes below.
One, external equipment administration module.
The external equipment administration module can be set up and being connected of External memory equipment, and finishes the data that read in the External memory equipment and data is write operations such as External memory equipment.When obtaining the configuration information of External memory equipment, at first inquire the current available External memory equipment that whether has, after meeting with a response, continue to inquire about concrete External memory equipment device configuration information according to the result who responds.After obtaining the External memory equipment configuration information, just can connect with External memory equipment, simultaneously also can carry out data read and operation such as write External memory equipment.
The external equipment administration module is enumerated the External memory equipment equipment that connects, obtain effective External memory equipment device configuration information, in device configuration information, can obtain the information such as capacity, file system format of interface, the External memory equipment of device type, support, and connect with External memory equipment equipment in view of the above.
Concrete, can obtain the device configuration information of External memory equipment by the External memory equipment device descriptor, and connect, thereby outside storage device data is read and write with this.The External memory equipment device descriptor can comprise content shown in the following table:
Skew Field Size (byte) Value Describe
0 Length 1 10h The length of descriptor
1 Device type 1 NandFlash or other storage mediums
2 Supporting interface 1 MMC or USB etc.
3 Product IDs 2 The ID of production firm number
5 The External memory equipment capacity 4 With k is unit
9 Configuration information 1 Bit0:1 band power down protection 0 is not with bit1:1 to support 7816 data files read-write 0 not support
Bit 2-7 keeps
10 Reserve bytes 6 Keep
Two, file operation requests module.
Can also comprise card operating system request unit and/or application requests unit in the file operation requests module, wherein:
The card operating system request unit is used for when card operating system is operated the data file, initiates the operation requests to the data file;
The application requests unit is used for when application program is operated the data file, initiates the operation requests to the data file.
Three, external equipment access interface.
Can comprise in the external equipment access interface that directory file system access instruction collection storage unit, 7816 data file system access instruction collection storage unit, instruction provide the unit, wherein:
Directory file system access instruction collection storage unit is used for storage directory file system access instruction set;
7816 data file system access instruction collection storage unit are used to store 7816 data file system access instruction collection;
Instruction provides the unit, be used for after the operation requests that receives described file operation requests module, after choosing the corresponding operating instruction according to operation requests from directory file system access instruction collection storage unit or 7816 data file system access instruction collection storage unit, provide the operational order that External memory equipment is operated.
The instruction set that the external equipment access interface provides application program by operating system External memory equipment to be conducted interviews.Module is positioned at the superiors of whole access schemes, application program and COS can be encapsulated in this interface the accessing operation of External memory equipment, and COS and application program realize operational access to External memory equipment by directly calling instruction set in this interface.The external equipment access interface is handled according to request after receiving the request of access of application program, calls the instruction set of corresponding directory file system or 7816 data file systems visit again.
Consider that the file system in the External memory equipment may include bibliographic structure and 7,816 two kinds of file system, the corresponding instruction collection also is divided into bibliographic structure file access instruction set and 7816 data file access instruction collection two parts, these instructions are by calling the file system access control service of lower floor, finish separately the searching of file, read, operational order function such as modification.
In the enforcement,, before all instructions, can increase prefix cm because instruction set is the instruction set of COS visit External memory equipment.The coded format of input parameter is if pure English digital is then used the ASC sign indicating number; If comprise Chinese character, then can adopt the Unicode coding.
Terse for what describe, directory information cited below comprises 7816 data file contents and general catalogue file directory.
If the filename form as input parameter is not with directory information, be file under the current directory then, if directory information is arranged, then must comprise complete catalogue (from root directory).
1, reading the instruction of External memory equipment file and catalogue is exemplified below:
A), the order that for example changes the current directory can be expressed as:
Boolean cm_Cdir(byte[]DestDir)
That is, current directory is set to DestDir indication catalogue.
In access process, can keep the variable of an overall situation, the current directory of current accessed position when being identified to outside storage device access to External memory equipment.By defining this current directory, COS when continuing visit, if accessed object under current directory, just needn't the input reference object from the complete absolute path of root directory, but can import more brief from the initial relative path of current directory.
As input parameter:
Byte[]DestDir:
When DestDir was absolute path, catalogue format was: partition number: directory name directory name; If carried out subregion on the External memory equipment, establish then that first subregion is 0 subregion on the External memory equipment, second subregion is 1 subregion, and the like.As 0: dir1 dir2.If DestDir is a relative path, then do not have partition number, form is: directory name directory name, as dir1 dir2, refer to the sub-directory under the current directory.The coded format of DestDir: as be pure English digital, then be the ASC sign indicating number, as comprise Chinese character, then adopt the Unicode coding.
Rreturn value: if can correctly have access to destination directory, then return true, otherwise return false.
B), for example check that All Files and directory listing order can be expressed as under the current directory:
Boolean cm_List(byte[]listbuffer,byte listType)
That is, file under the current directory and directory listing are input among the listbuffer.
Listbuffer: file under the current directory and catalogue are filled in this buffer memory with the form of TLV (Tag Length Value, mark lengths numerical value).
By can one group of data of output after the top command execution, and data be according to the TLV format organization that defines in this form:
TLV TLV TLV
Concrete as:
If output: D0000474657374DF0008746573742E747874;
Have under the expression current directory: catalogue test file test.txt.
Figure C20071017624800171
The listType:0 file directory all outputs among the listbuffer
1 outputs to file among the listbuffer
2 output to catalogue among the listbuffer
Rreturn value:, then return true, otherwise return false if the file directory that can correctly have access under the current directory is tabulated.
C), the specified file order can be expressed as under the current directory as reading:
Boolean cm_ReadFile(byte[]destfile,short fileoffset,byte[]destBuffer,shortdestoffset,short length)
That is, the given content (side-play amount+length) of specified file is outputed in the assigned address of destBuffer (side-play amount).Each order is respectively:
Byte[] destfile: as byte[] when destfile comprised the path, if be absolute path, form was: partition number: directory name directory name filename; If be relative path, then refer to the file that comprises in the sub-directory under the current directory.If do not comprise the path, then refer to the file of current directory.Coded format: as be pure English digital, then be the ASC sign indicating number, as comprise Chinese character, then adopt the Unicode coding.
Fileoffset: the reference position of reading content from the purpose file.
DestBuffer: the buffer area that file content is deposited.
Destoffset: the reference position of depositing the buffer area of the file content that reads.
Length: the length of the file content that reads.Whole file is read in 0 expression.
Rreturn value: if can correctly have access to specified file, then return true, otherwise return false.
D), the specified file order can be expressed as in the specified scope as searching:
Boolean cm_FindFile(byte[]destfile,byte[]destDir,byte[]result)
That is, in the assigned catalogue scope, search the file of specified file name, return its full directory information.Each order is respectively:
Destfile: the complete file name does not comprise the path.
DestDir: in this catalogue scope, search,, then refer to the path of relative current directory if be relative path.
The Result:LV form, L 2 byte representation subsequent content length, the V absolute path, coded format: as be pure English digital, then be the ASC sign indicating number, as comprise Chinese character, then adopt the Unicode coding.Rreturn value: if can find specified file, then return true, otherwise return false.
E), as checking that the order of specified file attribute can be expressed as:
Boolean cm_GetFileAttribute(byte[]destfile,byte AttributeType,byte[]AttributeBuffer)
Wherein each order is respectively:
Destfile: if be absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer to the file that comprises in the sub-directory under the current directory.
AttributeType: the attribute type of the file that returns.
AttributeBuffer: the file attribute output buffers district that returns.
Figure C20071017624800191
Rreturn value: if can find the attribute of specified file, then return true, otherwise return false.
Above-mentioned order meeting is returned the corresponding file attribute according to the AttributeType of input, it is concrete that how correspondence then is to carry out according to the description of form, as to import AttributeType be 0x01, so according to form, corresponding is the size of inquiry file, so can write one group of data representation corresponding file size attribute at the AttributeBuffer place, and how concrete data represent file size, also define in form.
2, revising the instruction of External memory equipment file and catalogue is exemplified below:
A), be shown as revising specified file file name instruction list:
Boolean cm_ChgFileNm(byte[]destfile,byte[]NewFileName)
That is, the file name with the Destfile appointment is revised as the file name that defines among the NewFileName.Each order is respectively:
Destfile: if be absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer to the file that comprises in the sub-directory under the current directory.
NewFileName: new file name.The LV form.L 2 byte V file names, as be pure English digital, then be the ASC sign indicating number, as comprise Chinese character, then adopt the Unicode coding.
Rreturn value: if the success of revised file name is then returned true, otherwise returned false.
B), be shown as revising assigned catalogue title instruction list:
Boolean cm_ChgDirNm(byte[]destDirNm,byte[]NewDirNm)
That is be the directory name that defines among the NewDirNm, with destDirNm designated directory name modifications.Each order is respectively:
DestDirNm: if be absolute path, form is: partition number: directory name directory name; If be relative path, then refer to the sub-directory under the current directory.
NewDirNm: new directory name.The LV form.L 2 byte V file names, as be pure English digital, then be the ASC sign indicating number, as comprise Chinese character, then adopt the Unicode coding.
Rreturn value:, then return true, otherwise return false if revise the directory name success.
C), be shown as deletion specified file instruction list:
Boolean cm_DelFile(byte[]destfile)
Wherein each order is respectively: destfile: if for absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer to the file that comprises in the sub-directory under the current directory.
Rreturn value: if the deleted file success is then returned true, otherwise returned false.
D), be expressed as creating file instruction:
Boolean cm_CreateFile(byte[]destfile)
That is, creating a content is empty file.Wherein each order is respectively:
Destfile: if be absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer in the sub-directory under the current directory, create file.
Rreturn value:, then return true, otherwise return false if create the file success.
E), be shown as revising the specified file instruction list:
Boolean cm_AmendFile(byte[]destfile,short FileOffset,byte[]SrcBuffer,short SrcOffset,short Length)
Wherein each order is respectively:
Destfile: if be absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer to the file that in the sub-directory under the current directory, comprises.If can not find the file of appointment in bibliographic structure, order will be created this document automatically.
Fileoffset: the reference position of writing content from the purpose file.
SrcBuffer: the buffer area that the file content that write is deposited.
SrcOffset: the reference position of depositing the buffer area that writes file content.
Length: the length of the file content that writes.
Rreturn value:, then return true, otherwise return false if write the file success.
F), be shown as the md command list:
Boolean cm_MD(byte[]SubDirName)
Wherein each order is respectively:
SubDirName: if be absolute path, form is: partition number: directory name directory name; If be relative path, then refer to the sub-directory under current directory.
Rreturn value:, then return true, otherwise return false if create the sub-directory success
G), be shown as the copied files instruction list:
Byte cm_CopyFile(byte[]destfile,byte[]destdir)
Wherein each order is respectively:
Destfile: if be absolute path, form is: partition number: directory name directory name filename; If be relative path, then refer to the file that comprises in the sub-directory under the current directory.
Destdir: if be absolute path, form is: partition number: directory name directory name; If be relative path, then refer to the sub-directory under the current directory.
Rreturn value: 0 expression document copying success.
The xcopy failure is read in 1 expression
Under the 2 expression destination directories file of the same name is arranged, can't cover
H), be shown as the instruction list that deltrees:
Boolean cm_DelDir(byte[]destdir)
Wherein each order is respectively:
Delete this catalogue, and all sub-directories and son file under the catalogue.Can not delete current directory.
Destdir: if be absolute path, form is: partition number: directory name directory name; If be relative path, then refer to the sub-directory under the current directory.
Four, file access control module.
The file access control module can comprise directory file system access control unit and/or 7816 data file access control units, can be encapsulated in this module, wherein to the analysis and the read-write operation of the directory file system on the External memory equipment:
The directory file system access control unit, be used for after receiving operational order, the operating walk way that provides by described external equipment administration module by operational order according to described configuration information externally carries out the data file operation of directory file system form on the memory device;
7816 data file access control units, be used for after receiving operational order, the operating walk way that provides by described external equipment administration module by operational order according to described configuration information externally carries out the data file operation of ISO7816 document format data on the memory device.
Receiving the operation requests of application program or COS when the external equipment access interface after, if the request at be directory file system, then calling the directory file system access control unit analyzes the request of visit, externally search in the directory file system of memory device, find the file of request, and finish and operation such as read or write.
The directory file system access control unit can be divided into directory file system identification, the directory file system bibliographic structure is resolved and three parts of file read-write operation.The directory file system identification division at first reads the content of External memory equipment initial sector, then the content format of initial sector is analyzed, and judgement is FAT16 file system or FAT32 file system or alternative document systems such as Ext2, Ext3.Bibliographic structure is resolved part and is finished the analysis of bibliographic structure such as is searched at operation, after finishing the identification of External memory equipment file system, can other be resolved the file system directories structure according to concrete filesystem class, finish searching to assigned catalogue or specified file, as for FAT16 or FAT32 file system, then be to carry out directory entry's traversal and search etc. from root directory.The file read-write operation part is after the bibliographic structure analysis part is finished Search and Orientation to assigned catalogue or file, assigns to finish opening, reading and writing and operation such as corresponding directory entry is revised file by the file read-write operating portion.
Receiving the operation requests of application program or COS when the external equipment access interface after, if the request at be 7816 data files, then calling 7816 data file system access control units analyzes the request of visit, externally search in 7816 data file systems of memory device, find the file of request, and finish the operation of reading or writing.
7816 data file system access control units also can be divided into 7816 data file systems identification configuration, 7816 data file system bibliographic structures are resolved and three parts of 7816 data file read-write operations.7816 data file systems identification configuration section is externally set up a file corresponding to the External memory equipment file system under the root directory of memory device, and all 7816 data files that are saved in External memory equipment all will be kept in the content of this file.7816 data file system bibliographic structures are resolved part and are responsible for each 7816 data file in this file is discerned parsing, find 7816 catalogues or the file of appointment.After finding 7816 catalogue files of appointment, 7816 data file read-write operations are partly finished the operation of reading and writing to 7816 data files
Utilize jumbo External memory equipment for rational and effective more, externally memory device is opened up the file that a panel region is used to deposit 7816 normalized definitions.Therefore smart card can further include first creation module and/or second creation module, wherein:
First creation module is used for when smart card COS obtains the External memory equipment configuration information, does not contain the file data of ISO7816 form in described configuration information, then creates the data folder of ISO7816 form;
Second creation module is used for when smart card COS or application program of intelligent card carry out the data file operation of ISO7816 form, when not containing the file data of ISO7816 form in the described configuration information, creates the data folder of ISO7816 form;
Like this, 7816 data file access control units can also be further used for after receiving operational order, and the data folder of the ISO7816 form that the operating walk way that provides by described external equipment administration module by operational order according to described configuration information is externally created on the memory device carries out the data file operation of ISO7816 document format data.
Concrete, directory file system is responsible for finishing the visit to the External memory equipment directory file system, includes the reading and modification etc. of parsing, file of identification, the file directory of file system.
During file system identification, read the main boot partition table of the Master boot sector of External memory equipment,, just can obtain the file system type information of External memory equipment by analyzing the system partitioning type in the main boot partition table.
Fig. 4 resolves the implementing procedure synoptic diagram for file directory, as shown in the figure, can finish as follows for the parsing of file directory:
Whether the List catalogue of step 401, judgement input is absolute catalogue, is then to change step 402 over to, otherwise changes step 403 over to;
Step 402, read the root directory sector, return root directory sector content, change step 404 over to;
Step 403, read the current directory position, find the catalogue file content of current directory, change step 404 over to;
Step 404, search in directory entry whether assigned catalogue is arranged, have then to change step 409 over to, otherwise change step 405 over to; In 403 steps, read the content of catalogue file, this content has comprised the directory entry information (directory name or filename are arranged in the directory entry information) of all sub-directories and file under this catalogue, program compares the directory name of the subdirectory name in these directory entries with the destination directory that will inquire about, if identical directory name is arranged, then finish whole parsing, otherwise change 405 over to.
Step 405, judge the directory entry whether catalogue of not searching for is arranged in the directory entry, have then to change step 406 over to, otherwise change step 408 over to;
Step 406, find the content of catalogue file, change step 407 over to according to directory entry and FAT table; In step 405, obtained directory entry, can know the reference position of this catalogue file content, just can know the end position of this catalogue file content by the FAT table again, thereby obtain the content of whole catalogue file at directory entry;
Step 407, judge in the content of catalogue file whether the directory entry of assigned catalogue is arranged,, then turn back to 405,, then change step 409 over to if find designated directory if do not find designated directory;
Step 408, return False, can not find the catalogue of List.
Step 409, return True, the output directory content.
When the reading and revise of file,, utilize by catalogue and resolve the file data initial sector position that obtains for reading file, call the sector function reading of bottom, the sector content is read in circulation, until end of file, the content of reading is outputed to appointed positions get final product.For revised file, the content that will revise splits according to sector-size, and circulation writes the reference position of file sectors, can finish file modifying.
The treatment scheme and the directory file system of 7816 data file access control are similar, and the detail difference of access object just gets final product with reference to the execution of directory file system.
Five, anti-plug is pulled out electric protection module, cache module, interruption and unusual control module.
COS and application program by COS in visit during External memory equipment; except reading or rewrite the content of External memory equipment; can also further consider the problem of read or write speed, the problem of power down protection takes place in the read-write process, effectively visit the problem etc. of the file system of External memory equipment; based on this; smart card can further include anti-plug and pulls out one of electric protection module, cache module, interruption and unusual control module or its combination, wherein:
1, anti-plug is pulled out the electric protection module, is used for when described file access control module externally writes data file operation on the memory device according to described configuration information, writes External memory equipment after described data file is write the intelligent card data backup area; When External memory equipment powers on,, the data file of described intelligent card data backup area is write External memory equipment if when described intelligent card data backup area and External memory equipment data file are inconsistent.
In access process to External memory equipment; because the singularity of the environment for use of smart card own; the situation that power down suddenly in the access process might occur; it is destroyed and cause the out of use situation of whole smart card core data to occur for fear of smart card and External memory equipment in the power down process, can set up anti-plug and pull out the electric protection module data on the card are protected.Concrete, when the file access system module need read the External memory equipment data, data that can not the direct access External memory equipment, and must finish reading and revising of data by the function that calls anti-plug withdrawing pattern piece and provide.Anti-plug withdrawing pattern piece can write data into the backup area of smart card earlier behind the operational order that receives data read or modification, backup area writes External memory equipment after writing and finishing again; Simultaneously, when re-powering, anti-plug withdrawing pattern piece can check at first whether backup area wants data recovered at every turn, if having, then according to the corresponding data file of the content recovery of backup area.
Specifically can implement in the following manner:
Open up a backup area in smart card, in the time of writing External memory equipment, the content that will write writes backup area according to the form of backup area earlier, and backup area writes External memory equipment after writing and finishing again.When powering on, check at first whether backup area wants data recovered at every turn,, then should recover accordingly according to the content of backup area earlier if having.
The data layout of whole backup area can be as follows:
Backup label Data
Wherein the form of data division can be as follows:
Data label Data length (M) Data content (O) Address information (M) Check information (M)
Wherein: backup label is used to show whether data are effective in the whole backup area.As showing that with label 0xAA data are effective in the backup area, other show invalid.
Data label is used to show whether this data item is effective, as showing that with label 0x55 this data item is effective, otherwise invalid.
Data length can adopt in the similar BER coding criterion length to represent mode, as:
When length<128, use 1 byte representation.
When length>127, use a plurality of byte representations, wherein the most significant digit of first byte is 1, the low shared byte number n of 7 bit representation length.Follow-up n byte representation length, high-order preceding.
When first byte is 0xFF, think an invalid length.
Adopt this expression mode can preserve the data that surpass 256 bytes, to adapt to later application demand.
Especially, when length is 0, can represent that data length is one page (page size is decided according to intelligent chip), this moment, data content item was empty, and data content is preserved in the middle of the backed-up pages.
Data content need to refer to backed up data.When length was 0, this was empty.
Address information can adopt 2/3/4 byte according to the capacity of chip, and this is divided into two parts, piece number and piece bias internal, and the piece bias internal is 2 bytes, piece number can be 0/1/2 byte according to the capacity of chip.
Check information is used to verify whether this Backup Data is effective.
Then wipe and at first to destroy backup label, write backup label as 0x00, make whole backup area lose efficacy, and then wipe whole backup area at backup area.
The length of backup area is configurable.Utilize the Backup Address item among the OS Configuration to realize, Backup Address is two bytes, and first byte representation backup area is in the high position of address, base region, second page number that the byte representation backup area is shared.Such as FF03, the expression backup area is in the initial address of 0xFF00, and backup area accounts for 3 pages or leaves.
2, cache module is used for operating rule at smart card buffer area storing data files according to described file access control module, and described file access control module preferentially reads the data file that needs operation from described buffer area.
Because the characteristic of External memory equipment physical equipment, the speed of visit External memory equipment will be well below the speed of direct visit smartcard internal storer.Therefore, can utilize cache module, read content in the External memory equipment in advance to the buffer area of smart card, in order to improve the speed of visit.When the file access control module need read data in the External memory equipment, cache module can check whether the data file that will visit is present in the buffer area, if be present in the buffer area, the data content in the then direct return cache district is given the file access control module; If there are not the data that need in the buffer area, reading corresponding data from External memory equipment then, and with relevant copying data in buffer area.Cache module can utilize specific algorithm, as read the rule of External memory equipment according to COS, read data file in the External memory equipment in advance in buffer memory, COS is when the visit External memory equipment like this, just can directly in buffer memory, read, can improve the speed of visit greatly.
Fig. 5 is a high-speed cache implementing procedure synoptic diagram, as shown is a kind of comparatively simple cache algorithm, easily knows, also can adopt the cache algorithm of other comparative maturities, can comprise the steps: when then high-speed cache is implemented
Step 501, visit External memory equipment;
Step 502, judge whether the corresponding data file is arranged in the high-speed cache, have then to change step 504 over to, otherwise change step 503 over to;
Step 503, call the bottom function and read corresponding data file in the External memory equipment;
Step 504, return data file content;
Step 505, will close on the sectors of data file content and copy cache memory section to.
3, interruption and unusual control module, when being used for data file operation that described file access control module externally carries out on the memory device according to described configuration information and taking place to interrupt, preserve the operation executing state, after interrupting recovering, carry out according to the operation executing state continuation of described preservation.
Certain sector physical damage may take place in the process of visit External memory equipment can not read, can not find abnormal conditions such as corresponding data sector, External memory equipment response timeout, interrupt then being responsible for these anomalous events are handled accordingly with unusual control module, when data send or Data Receiving is finished, data transmission period sheet wheel changes when triggering corresponding the interruption, interruption and abnormality processing module are finished the response of interrupting, and call corresponding Interrupt Process function and finish processing.Concrete, when aborted takes place, after executing present instruction, will jump to corresponding aborted handling procedure place and carry out.After the aborted handling procedure was complete, program turned back to next bar instruction place of the instruction that interruption takes place and carries out.When entering the aborted handling procedure, preserve interrupted program implementation scene.When the aborted handling procedure withdraws from, recover that interrupted program implementation is on-the-spot to get final product.
When the processor response is interrupted, always begin,, can write one section interruption analysis program and connect in order to make upper level applications and hardware interrupts redirect connect from fixing address.Fig. 6 is interruption and unusual implementing procedure synoptic diagram, and as shown in the figure, concrete enforcement can comprise the steps:
Step 601, initiation interrupt request;
Step 602, jump to fixed address;
Step 603, jump to the memory field of user-defined fixed address from the initial secured address, wherein deposit the analysis program that interrupts redirect again;
Step 604, analysis program read interrupt vector table, obtain the destination address of interrupt function;
Step 605, jump to the objective function address.
The definition of part interrupt vector can be as follows:
THOR_DRV_USART_INTERRUPT =THOR_DRV_SET_LBIT(0),
THOR_DRV_MMC_INTERRUPT =THOR_DRV_SET_LBIT(2),
THOR_DRV_FLASH_INTERRUPT =THOR_DRV_SET_LBIT(3),
THOR_DRV_GPT1_INTERRUPT =THOR_DRV_SET_LBIT(6),
THOR_DRV_GPIO_INTERRUPT =THOR_DRV_SET_LBIT(10),
THOR_DRV_SMAP_INTERRUPT =THOR_DRV_SET_LBIT(15),
THOR_DRV_DMA_INTERRUPT =THOR_DRV_SET_LBIT(18)。
And define corresponding Interrupt Process function and be:
typVoidFunc pFIQInterruptHandler;
typVoidFunc pMUARTInterruptHandler;
typVoidFunc pMMCInterruptHandler;
typVoidFunc pWDTInterruptHandler;
typVoidFunc pGPT1InterruptHandler;
typVoidFunc pGPIOInterruptHandler;
typVoidFunc pDMAInterruptHandler。
Further, in the enforcement owing to pull out the electric protection module all is based on logical data to the visit of External memory equipment visit by cache module and anti-plug.And direct physical address addressing complexity and needs to consider the situation of bad piece and load balancing, if directly carry out the data file visit of physical address, and very low of efficient.Can utilize the conversion of External memory equipment logic sector access interface module package logical address and physical address and the problems such as management of bad piece and load balancing like this, make the file access operation on upper strata can carry out the data access of External memory equipment easily to logical address by logic sector access interface module.
External memory equipment logic sector access modules be actually for the upper strata provide a kind of continuous, not bad piece, be the address space and the memory interface of unit visit with the sector.Described functional module can manage the physical block of External memory equipment, identifies bad piece, and realizes that the logical address that the upper strata is transmitted is mapped as the corresponding physical address of External memory equipment.Simultaneously, because the piece of flash has the restriction of erasable number of times, so can also allow each physical block that uniform erasable chance is arranged, make new data write the minimum free block that is used as far as possible, and the data that remain unchanged for a long period of time will copy in the other piece, and the piece that originally took is used by the data of frequent updating.Because the FLASH write operation can only carry out in sky or the unit of having wiped, and with respect to read-write operation, the time of erase operation is very long.So be not the piece at data place to be wiped the back writing data when new data more, but look for a new free block to write data, previous piece is labeled as gives up, system's free time, wipe those and be labeled as the piece of giving up.
The function that encapsulates in the logic sector access interface module invokes physical sector access interface module is finished the data access to physical sector.Different vendor, different FLASH structure all can cause the difference of the control command of flash memory; And different capacity can cause address word joint number difference; External memory equipment physical sector access modules then realizes corresponding driving at these differences.And these differences are encapsulated, provide unified interface, make the upper strata can visit the data of any physical address, and need not be concerned about control command sequence and address word joint number to the upper strata.
Above-mentioned enforcement is arranged as can be seen, even the COS of each smart card company is different, the storage medium of External memory equipment and on file system also be not quite similar, but the embodiment of the invention can realize that card application program and COS are to External memory equipment effectively visit fast and safely.The embodiment of the invention is by adopting the scheme of hierarchical structure, to be packaged into different functional hierarchies to the operation of External memory equipment, only need call the outermost power function of COS during operation gets final product, and concrete read-write control, buffer memory, anti-plug pull out each module such as electricity and all be encapsulated in the middle layer accordingly, and the bottom is a physics function reading of calling External memory equipment; Thereby make up one fast, safety, effectively, also be convenient to the system of the smart card access External memory equipment expanded simultaneously.
Under the hierarchical structure of the embodiment of the invention, carry out abstract according to different levels the various piece of construction system; Complete unidirectional dependence between layer and the layer, by interfacial interaction, lower floor provides service for the upper strata between adjacent layer, and the service that use lower floor in upper strata provides is to realize the function of this layer.The upper strata hides the details that is right after lower floor, and related technical manual, realization technology and the complicacy thereof of lower floor shielded by the next-door neighbour upper strata fully, and its level of abstraction of past more upper strata is high more, more and more presents unitarity; And the while upper strata also remedies the defective and the deficiency of lower floor, provides function more perfect service.
Further; the embodiment of the invention at COS in visit during External memory equipment; except operations such as the content that reads or rewrite External memory equipment, the speed of optimizing read-write also be provided, solved the power down protection problem that in the read-write process, takes place, improved the file system of effective visit External memory equipment, externally set up on the memory device functions such as directory file structure of COS.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.

Claims (11)

1, a kind of smart card card operating system is carried out method of operating to the data file, is used for External memory equipment is carried out data file operation, it is characterized in that, comprises the steps:
Smart card card operating system is obtained the External memory equipment configuration information, and described configuration information comprises the capacity and the file data form of External memory equipment;
When smart card card operating system or application program of intelligent card carried out data file operation, smart card card operating system was according to the externally enterprising line data file operation of memory device of described configuration information.
2, the method for claim 1, it is characterized in that, when smart card card operating system or application program of intelligent card carried out the data file operation of ISO7816 form, smart card card operating system or application program of intelligent card were operated in the data folder of the ISO7816 of described External memory equipment form;
When smart card card operating system or application program of intelligent card carried out the data file operation of directory file system form, smart card card operating system or application program of intelligent card were operated in the data folder of the directory file system form of described External memory equipment.
3, method as claimed in claim 2, it is characterized in that, when smart card card operating system is obtained the External memory equipment configuration information, further comprise: when not containing the file data of ISO7816 form in the described configuration information, create the data folder of ISO7816 form;
It is described when smart card card operating system or application program of intelligent card carry out data file operation, smart card card operating system is according to the externally enterprising line data file operation of memory device of described configuration information, be specially: when smart card card operating system or application program of intelligent card carry out the data file operation of ISO7816 form, operate in the data folder of the ISO7816 form that smart card card operating system or application program of intelligent card are created on described External memory equipment.
4, method as claimed in claim 2, it is characterized in that, when smart card card operating system or application program of intelligent card carry out the data file operation of ISO7816 form, further comprise: when not containing the file data of ISO7816 form in the described configuration information, create the data folder of ISO7816 form;
Described smart card card operating system is specially: operate in the data folder of the ISO7816 form that smart card card operating system or application program of intelligent card are created on described External memory equipment according to the externally enterprising line data file operation of memory device of described configuration information.
As the arbitrary described method of claim 1 to 4, it is characterized in that 5, smart card card operating system is according to the externally enterprising line data file operation of memory device of described configuration information, one of further comprise the steps or its combination:
Anti-plug is pulled out the electric protection step: when smart card card operating system externally writes data file operation on the memory device according to described configuration information, write External memory equipment after described data file write the intelligent card data backup area; When External memory equipment powers on,, the data file of described intelligent card data backup area is write External memory equipment if when described intelligent card data backup area and External memory equipment data file are inconsistent;
The buffer memory step: smart card card operating system reads the operation rule of external unit at smart card buffer area storing data files according to smart card operating system, and smart card operating system preferentially reads the data file that needs operation from described buffer area;
Interrupt and unusual controlled step: when the data file operation that smart card card operating system is externally carried out on the memory device according to described configuration information takes place to interrupt, preserve the operation executing state, after interrupting recovering, carry out according to the operation executing state continuation of described preservation.
6, a kind of smart card is applied to carry out data file operation with External memory equipment, it is characterized in that, comprises external equipment administration module, file operation requests module, external equipment access interface, file access control module, wherein:
The external equipment administration module, be used to obtain the configuration information of External memory equipment, described configuration information comprises the capacity and the file data form of External memory equipment, and provides the passage that the data file is operated according to configuration information after setting up being connected of smart card and External memory equipment;
The file operation requests module is used to initiate the operation requests to the data file;
The external equipment access interface is used for after the operation requests that receives described file operation requests module, and the operational order that External memory equipment is operated is provided according to operation requests;
The file access control module is used for after receiving operational order, the externally enterprising line data file operation of memory device of operating walk way that provides by described external equipment administration module by operational order according to described configuration information.
7, smart card as claimed in claim 6 is characterized in that, described file operation requests module comprises card operating system request unit and/or application requests unit, wherein:
The card operating system request unit is used for when card operating system is operated the data file, initiates the operation requests to the data file;
The application requests unit is used for when application program is operated the data file, initiates the operation requests to the data file.
8, smart card as claimed in claim 6 is characterized in that, described external equipment access interface comprises that directory file system access instruction collection storage unit, 7816 data file system access instruction collection storage unit, instruction provide the unit, wherein:
Directory file system access instruction collection storage unit is used for storage directory file system access instruction set;
7816 data file system access instruction collection storage unit are used to store 7816 data file system access instruction collection;
Instruction provides the unit, be used for after the operation requests that receives described file operation requests module, after choosing the corresponding operating instruction according to operation requests from directory file system access instruction collection storage unit or 7816 data file system access instruction collection storage unit, provide the operational order that External memory equipment is operated.
9, smart card as claimed in claim 6 is characterized in that, described file access control module comprises directory file system access control unit and/or 7816 data file access control units, wherein:
The directory file system access control unit, be used for after receiving operational order, the operating walk way that provides by described external equipment administration module by operational order according to described configuration information externally carries out the data file operation of directory file system form on the memory device;
7816 data file access control units, be used for after receiving operational order, the operating walk way that provides by described external equipment administration module by operational order according to described configuration information externally carries out the data file operation of ISO7816 document format data on the memory device.
10, smart card as claimed in claim 9 is characterized in that, further comprises first creation module and/or second creation module, wherein:
First creation module is used for not containing the file data of ISO7816 form in described configuration information when smart card card operating system is obtained the External memory equipment configuration information, then creates the data folder of ISO7816 form;
Second creation module is used for when smart card card operating system or application program of intelligent card carry out the data file operation of ISO7816 form, when not containing the file data of ISO7816 form in the described configuration information, creates the data folder of ISO7816 form;
Described 7816 data file access control units are further used for after receiving operational order, and the data folder of the ISO7816 form that the operating walk way that provides by described external equipment administration module by operational order according to described configuration information is externally created on the memory device carries out the data file operation of ISO7816 document format data.
11, as the arbitrary described smart card of claim 6 to 10, it is characterized in that, comprise that further anti-plug pulls out one of electric protection module, cache module, interruption and unusual control module or its combination, wherein:
Anti-plug is pulled out the electric protection module, is used for when described file access control module externally writes data file operation on the memory device according to described configuration information, writes External memory equipment after described data file is write the intelligent card data backup area; When External memory equipment powers on,, the data file of described intelligent card data backup area is write External memory equipment if when described intelligent card data backup area and External memory equipment data file are inconsistent;
Cache module is used for operating rule at smart card buffer area storing data files according to described file access control module, and described file access control module preferentially reads the data file that needs operation from described buffer area;
Interrupt and unusual control module, when being used for data file operation that described file access control module externally carries out on the memory device according to described configuration information and taking place to interrupt, preserve the operation executing state, after interrupting recovering, carry out according to the operation executing state continuation of described preservation.
CNB2007101762483A 2007-10-23 2007-10-23 A kind of card operating system carries out method of operating and smart card to the data file Active CN100561452C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101762483A CN100561452C (en) 2007-10-23 2007-10-23 A kind of card operating system carries out method of operating and smart card to the data file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007101762483A CN100561452C (en) 2007-10-23 2007-10-23 A kind of card operating system carries out method of operating and smart card to the data file

Publications (2)

Publication Number Publication Date
CN101140548A CN101140548A (en) 2008-03-12
CN100561452C true CN100561452C (en) 2009-11-18

Family

ID=39192504

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101762483A Active CN100561452C (en) 2007-10-23 2007-10-23 A kind of card operating system carries out method of operating and smart card to the data file

Country Status (1)

Country Link
CN (1) CN100561452C (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101789019B (en) * 2010-02-11 2012-05-30 株洲南车时代电气股份有限公司 Method for controlling removable disk under Windows
CN103544173A (en) * 2012-07-13 2014-01-29 国民技术股份有限公司 Command processing method, information interaction method, SIM card and mobile terminal
CN102799691B (en) * 2012-08-15 2016-05-04 深圳市宏电技术股份有限公司 Filesystem conversion access method and filesystem conversion access means
CN103679236B (en) * 2013-12-26 2017-02-15 东信和平科技股份有限公司 Method and system for tracking and processing interactive data of smart card
CN103281219B (en) * 2013-06-04 2016-08-10 东信和平科技股份有限公司 A kind of monitor the method and device that ISOIEC7816-3 interface data is mutual
CN103686379B (en) * 2013-12-18 2017-02-15 青岛海信电器股份有限公司 Playing method and device for multi-media file, and television
CN104484619B (en) * 2014-12-22 2017-10-27 东信和平科技股份有限公司 It is a kind of to solve the method that client multi-logical channel accesses PKCS#15 file conflicts
CN106095873B (en) * 2016-06-06 2020-10-23 北京美屏传媒有限公司 Method and device for expanding capacity of mobile terminal
CN106354432A (en) * 2016-08-30 2017-01-25 北京小米移动软件有限公司 Data modification method and device
CN108228097A (en) * 2017-12-25 2018-06-29 中国航空工业集团公司洛阳电光设备研究所 A kind of power-off protection method based on FAT32 file system
CN108733758B (en) * 2018-04-11 2022-04-05 北京三快在线科技有限公司 Hotel static data pushing method and device, electronic equipment and readable storage medium
CN108628550B (en) * 2018-04-28 2022-02-22 深信服科技股份有限公司 Method, device and system for reading disk mapping file
CN108971762A (en) * 2018-07-28 2018-12-11 北京艾丕科技有限责任公司 A kind of electronic signature equipment process line and method
CN110334063B (en) * 2019-07-15 2024-05-14 深圳前海微众银行股份有限公司 File system operation method, device, equipment and computer readable storage medium
CN110532237B (en) * 2019-09-05 2022-02-08 恒生电子股份有限公司 Concurrent processing method, device and system for format data file
CN112905546A (en) * 2021-03-15 2021-06-04 深圳软牛科技有限公司 Deleted file recovery method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN101140548A (en) 2008-03-12

Similar Documents

Publication Publication Date Title
CN100561452C (en) A kind of card operating system carries out method of operating and smart card to the data file
US8028006B2 (en) Method and apparatus for exchanging sub-hierarchical structures within a hierarchical file system
CN101147119B (en) Direct data file storage implementation techniques in flash memories
CN101288045B (en) Enhanced host interface
US7769978B2 (en) Method and system for accessing non-volatile storage devices
US7793068B2 (en) Dual mode access for non-volatile storage devices
US8849880B2 (en) Providing a shadow directory and virtual files to store metadata
TWI435219B (en) Data protecting method, memory controller and portable memory storage device
CN102214109B (en) Method and device for loading plug-ins
US20070143532A1 (en) Method and system for accessing non-volatile storage devices
CN107479922A (en) A kind of flash data management method, device and computer-readable recording medium
US20060010177A1 (en) File server for long term data archive
CN101441634A (en) Embedded type file system suitable for smart card application environment
CN103473296A (en) Recycle bin mechanism and recycle bin system applicable to cloud computing
CN101375280A (en) Event structured file system (ESFS)
CN100507919C (en) FAT file system and its processing method
CN104035842A (en) Method for deleting and recovering built-in application program
CN102243636B (en) Method and device for storing file information to be protected and protecting file
KR100987320B1 (en) Data processing apparatus and Data procssing method, using FAT file system capable of fast file recovery
US7167964B1 (en) Memory defragmentation in chipcards
CN103218300A (en) Data processing method, memory controller and memory storage device
CN102375781A (en) Data protecting method, memory controller and portable memory storage device
US8595426B2 (en) Handling commands within a write-once read-many storage device configuration
CN106557572A (en) A kind of extracting method and system of Android application program file
CN103257928A (en) Method and system for data management of flash memory equipment

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Ou Yingfeng

Inventor after: Xu Daxing

Inventor after: Liu Qinghai

Inventor after: Wang Youjun

Inventor before: Ou Yingfeng

Inventor before: Xu Daxing

Inventor before: Liu Qinghai

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100015 Beijing city Chaoyang District Dongzhimen West eight Street No. 2 room Wanhong Yan Dong Business Garden

Patentee after: Beijing Watchdata Limited by Share Ltd

Address before: 100015 Beijing city Chaoyang District Dongzhimen West eight Street No. 2 room Wanhong Yan Dong Business Garden

Patentee before: Beijing Woqi Data System Co., Ltd.