CN101751427A - Method for reasonably using file space of smart card - Google Patents

Method for reasonably using file space of smart card Download PDF

Info

Publication number
CN101751427A
CN101751427A CN200810239500A CN200810239500A CN101751427A CN 101751427 A CN101751427 A CN 101751427A CN 200810239500 A CN200810239500 A CN 200810239500A CN 200810239500 A CN200810239500 A CN 200810239500A CN 101751427 A CN101751427 A CN 101751427A
Authority
CN
China
Prior art keywords
file
space
deleted
smart card
new
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
CN200810239500A
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 CN200810239500A priority Critical patent/CN101751427A/en
Publication of CN101751427A publication Critical patent/CN101751427A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

A method for reasonably using file space is provided by using file deletion and space recovery mechanism of smart card and the method mainly comprises the steps of deleting files and arranging directory or card space. The aims of the method are to delete redundant files, arrange fragment space, support the client to adjust the current file system and adapt to different application demands.

Description

A kind of method of rationally utilizing the smart card file space
Technical field
The present invention is a kind of method of rationally utilizing the file space, is mainly concerned with the embedded system development field.
Background technology
In the card of a multitude of names, smart card product is in ecommerce, and fields such as E-Government have obtained using widely; Present smart card product needs often to tackle the different stages in application process and its file system is adjusted, if each adjustment is hair fastener again all, or buying again, be that production procedure or production cost all can bring great inconvenience, under such situation, on intrinsic product, develop file delete and space reclamation function and just seem particularly urgent.
Summary of the invention
A kind of method of smart card file space of rationally utilizing disclosed in this invention can make the client at the application need of self its file system be adjusted, redundant file in using is deleted, can delete DDF, ADF, transparent file, log file, public and private key file, stored value card, electronic bankbook, document change after the deletion is specific file type, and changing original file structure, the file header size changes 7 bytes into, has so just reduced the size of fragment as much as possible, also belong to deleted document or fragment if find adjacent file, so just be integrated into a file; Carrying out running into the file of deleted document type in the process of file polling according to file tree, need calculate so that continue according to the file space after the change and seek downwards.When setting up file, at first to seek deleted file, utilize the algorithm of searching spatial optimization that deleted document is compared, find the only deleted file in space; If the space is big slightly, just form a deleted file or fragment at remaining space.In order successfully to set up new file, sufficient but when discontinuous, need do the work of disk arrangement at total free space, integrate free space.Unified resource, file delete and space reclamation mechanism just can very easily distribute file system and integrate again flexibly.
Description of drawings
Fig. 1: smart card file delete and space reclamation mechanism process flow diagram
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described:
1. deleted file changes original file type into the deleted document type, and file header becomes 7 bytes, and the file space is adjusted into the remaining space of removing 7 bytes, judges whether adjacent file is deleted document, if be integrated into a deleted document.If delete last file, then directly revise the effective length in catalogue space; Check input parameter, search the file that to delete, judge that whether erase right satisfies, and calculates deleted file length; Judge whether delete last file, integrate deleted file; Write the deleted file file header.
2. statistics catalogue space is counted the file header and the file space of deleted file in the residue useful space when handling the file of deleted file type in the lump;
3. when setting up new file, begin to travel through from current directory.Find out all deleted documents successively, find optimal space.Locating file during class file, judges whether the space size of deletion class file satisfies the size of new files to deletion earlier, if greater than newly-built file, then relatively whether the space differs minimum with the space of new files; If less than newly-built file, then skip this file, under current directory, continue to seek, up to end-of-file, compare with the catalogue remaining space in the space of finding again, and selects final enough big and a room minimum and come new files.On the deleted document space during new files, if deletion class file space greater than newly-built file space, need so remaining space is converted into a new deletion class file or a file fragmentation.Sufficient but when discontinuous, need do the work of disk arrangement at total free space, integrate free space.

Claims (4)

1. method of rationally utilizing the smart card file space: the redundant file in using is deleted and the defrag space, be it is characterized in that step is as follows:
(1) deleted file changes original file type into the deleted document type, judges whether adjacent file is deleted document, if be integrated into a deleted document; If delete last file, then directly revise catalogue valid data length;
(2) calculate the file header and the file space of deleted file in the residue useful space when handling the file of deleted file type in the lump in statistics catalogue space;
(3) set up new file, begin to travel through, find out all deleted documents successively, find optimal space from current directory.
2. a kind of method of rationally utilizing the smart card file space as claimed in claim 1 is characterized in that described step (1) specifically comprises following steps:
(1) procuratorial work input parameter;
(2) search the file that to delete;
(3) judge whether erase right satisfies;
(4) calculate deleted file length;
(5) judge whether delete last file, if then forward 9 to;
Whether be deleted file, if not, forward 8 to if (6) searching adjacent file;
(7) integrate deleted file;
(8) write the deleted file file header;
(9) new directory valid data length more.
3. method according to claim 1 is characterized in that rebuliding file on the file basis after the deletion, adjusts space distribution.
4. a kind of method of rationally utilizing the smart card file space as claimed in claim 1 is characterized in that described step (3) specifically comprises following steps:
(1) judge whether the space size of deletion class file satisfies the size of new files, if greater than newly-built file, then relatively whether the space differs minimum with the space of new files; If less than newly-built file, then skip this file;
(2) continue to seek under current directory, up to end-of-file, compare with the catalogue remaining space in the space of finding again, and selects final enough big and a room minimum and come new files;
(3) on the deleted document space during new files, if deletion class file space greater than newly-built file space, remaining space is converted into a new deletion class file or a file fragmentation;
(4) sufficient but when discontinuous, do the disk housekeeping at total free space, integrate free space.
CN200810239500A 2008-12-12 2008-12-12 Method for reasonably using file space of smart card Pending CN101751427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200810239500A CN101751427A (en) 2008-12-12 2008-12-12 Method for reasonably using file space of smart card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200810239500A CN101751427A (en) 2008-12-12 2008-12-12 Method for reasonably using file space of smart card

Publications (1)

Publication Number Publication Date
CN101751427A true CN101751427A (en) 2010-06-23

Family

ID=42478418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200810239500A Pending CN101751427A (en) 2008-12-12 2008-12-12 Method for reasonably using file space of smart card

Country Status (1)

Country Link
CN (1) CN101751427A (en)

Cited By (3)

* 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
CN102682024A (en) * 2011-03-11 2012-09-19 中国科学院高能物理研究所 Method for recombining incomplete JPEG file fragmentation
CN105656866A (en) * 2014-12-02 2016-06-08 华为技术有限公司 Data encryption method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102682024A (en) * 2011-03-11 2012-09-19 中国科学院高能物理研究所 Method for recombining incomplete JPEG file fragmentation
CN102682024B (en) * 2011-03-11 2014-02-05 中国科学院高能物理研究所 Method for recombining incomplete JPEG file fragmentation
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
CN105656866A (en) * 2014-12-02 2016-06-08 华为技术有限公司 Data encryption method and system

Similar Documents

Publication Publication Date Title
US9542276B2 (en) Multi stream deduplicated backup of collaboration server data
CN102110146B (en) Key-value storage-based distributed file system metadata management method
CN103036956B (en) A kind of distributed configuration mass data filing system and implementation method
CN104572670B (en) A kind of storage of small documents, inquiry and delet method and system
CN102169507A (en) Distributed real-time search engine
CN105868286B (en) The parallel method of adding and system merged based on distributed file system small documents
CN101739310B (en) Method and device for cycling backup
CN102456059A (en) Data deduplication processing system
CN102915336A (en) Incremental data capturing and extraction method based on timestamps and logs
WO2014015488A1 (en) Method and apparatus for data storage and query
CN1755720A (en) Methods and systems for caching and synchronizing project data
CN103853743A (en) Distributed system and log query method thereof
WO2019104977A1 (en) Service data storage method, application server and computer storage medium
WO2007041456A3 (en) Accumulating access frequency and file attributes for supporting policy based storage management
US20090319540A1 (en) Synchronization adapter for synchronizing data to applications that do not directly support synchronization
CN104317956A (en) Query and memory space cleaning method and system based on cloud server
CN102223410A (en) Searching method of intelligent information terminal and terminal
US9722797B2 (en) Computer-based optimization of digital signature generation for records based on eventual selection criteria for products and services
CN103246549B (en) A kind of method and system of data conversion storage
CN102646133B (en) Two-dimensional table organization method based on metadata storage
CN100363890C (en) System and method for synchronously renewing file of remote computer
CN102523301A (en) Method for caching data on client in cloud storage
WO2017124905A1 (en) Method, device and system for uploading compound document
CN104199901A (en) Method for batch merging of hbase table regions
CN101751427A (en) Method for reasonably using file space of smart card

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: 20100623