CN106354718B - File management method and device of user identification module - Google Patents

File management method and device of user identification module Download PDF

Info

Publication number
CN106354718B
CN106354718B CN201510408918.4A CN201510408918A CN106354718B CN 106354718 B CN106354718 B CN 106354718B CN 201510408918 A CN201510408918 A CN 201510408918A CN 106354718 B CN106354718 B CN 106354718B
Authority
CN
China
Prior art keywords
file
type
storage
partition
storage partition
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
CN201510408918.4A
Other languages
Chinese (zh)
Other versions
CN106354718A (en
Inventor
刘辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201510408918.4A priority Critical patent/CN106354718B/en
Publication of CN106354718A publication Critical patent/CN106354718A/en
Application granted granted Critical
Publication of CN106354718B publication Critical patent/CN106354718B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for managing files of an SIM card, comprising the following steps: dividing a storage area into a first storage partition and a second storage partition; when a file is created, storing a file header of the file in the first storage partition, wherein a file attribute in the file header identifies the type of the file, and the type of the file is a first type of file or a second type of file; when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition; and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition.

Description

File management method and device of user identification module
Technical Field
The present invention relates to a file system in a Subscriber Identity Module (SIM), and in particular, to a method and an apparatus for managing a file of an SIM card.
Background
The SIM card is a user identity identification module widely used by mobile equipment, is used for network-login authentication and security data storage, and has the characteristics of high security, reliability and the like. The data of the SIM card are stored in the card in the form of a file, the logical structure of which complies with the ISO 7816 specification. Referring to fig. 1, the File structure of the SIM card is divided into a Directory File (MF, Main File and DF, Directory File) and a basic File (EF, Element File), wherein the EF is used for storing File data.
The main physical storage medium of the SIM card is FLASH memory (FLASH), which is a high-density, Non-Volatile (Non-Volatile) storage medium. Referring to fig. 2, the logical structure of FLASH is Page (Page) unit, the capacity of each Page of FLASH is 256 bytes or 512 bytes, FLASH has specific read-write operation requirement, i.e. erasing by Page, writing data needs to be from logical 1 to 0, if data is to be rewritten, FLASH needs to be erased, the number of times of erasing is limited, and generally the number of times of erasing is allowed to be about one hundred thousand.
In view of the characteristics of FLASH storage, a file system based on a FLASH storage medium often needs to consider balanced erasure. The balanced erasing means that the erasing times of each page of the FLASH should be used as average as possible, for example, when data is updated to the FLASH, the data is not updated at the original address, and the data is updated to a new FLASH available page. The balanced erasing can improve the service life of the FLASH, but can reduce the efficiency of the file system, and especially on the SIM card with limited processing capability and storage resources, the influence of the performance is more obvious.
The existing SIM card file system based on FLASH storage medium is realized by the following two schemes:
scheme one, referring to fig. 3, the data Body (Bata Body) is located by the Head Table (Head Table). The scheme does not distinguish the difference of the physical storage media, the updated file data is updated in the original position of the physical storage media, and the updated file data is used due to the characteristics of high running speed and low resource consumption, such as updating the data body with the reference number of 6.
In the second scheme, referring to fig. 4, in order to implement the FLASH erase-balancing management, the FLASH page is cyclically used to store data, that is, the physical location of data storage is changed, and the management information of the data moves cyclically together with the data. The start position of each page holds management information (Admin info) such as a file ID, and the rest of the page stores data. The scheme uses new idle pages to update data, and averagely uses page erasing times of FLASH, so that the file system is used with long service life and good reliability. For example, File1 (identified as 2 and 3) is updated.
The prior art has the following problems:
according to the first scheme, the storage of the files depends on the service life of the FLASH, and the files with high updating frequency are easy to lose effectiveness.
And the scheme II provides balanced erasing management for all files, the speed of a file system is low, and a large number of storage resources (FLASH and RAM) are occupied. And as the storage capacity of the SIM card is larger and larger, implementing the balanced erasure management on all files brings more problems.
Disclosure of Invention
In order to solve the above technical problem, embodiments of the present invention provide a method and an apparatus for managing a file of an SIM card.
The file management method of the SIM card provided by the embodiment of the invention comprises the following steps:
dividing a storage area into a first storage partition and a second storage partition;
when a file is created, storing a file header of the file in the first storage partition, wherein a file attribute in the file header identifies the type of the file, and the type of the file is a first type of file or a second type of file;
when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition.
In the embodiment of the present invention, the method further includes:
determining a file header of the file according to an Identification (ID) of the file;
determining the type of the file according to the file attribute in the file header;
when the type of the file is a second type of file, finding a free page in a second storage partition;
and storing the update file data body of the file into the idle page, and setting the page of the source file data body in which the file is stored as an invalid page.
In the embodiment of the present invention, the method further includes:
when no free page is found in the second storage partition, finding an invalid page in the second storage partition;
and erasing the invalid page, and storing the updated file data body of the file to the erased invalid page.
In the embodiment of the present invention, the method further includes:
and determining the number of the pages in the second storage partition according to the number and the size of the second type of files, the updating times of the second type of files and the erasing times of the pages in the user identification module.
In the embodiment of the present invention, the method further includes:
and when the type of the file is the first type of file, updating the file data body on a page of a source file data body of the file stored in the first storage partition.
The file management device of the SIM card provided by the embodiment of the invention comprises:
the partition unit is used for dividing the storage area into a first storage partition and a second storage partition;
the first storage unit is used for storing a file header of a file in the first storage partition when the file is created, wherein the file attribute in the file header identifies the type of the file, and the type of the file is a first type of file or a second type of file; when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
and the second storage unit is used for storing the file data body of the second type of file in a second storage partition when the file attribute indicates that the created file belongs to the second type of file.
In the embodiment of the present invention, the apparatus further includes:
the first determining unit is used for determining a file header of the file according to the ID of the file;
the second determining unit is used for determining the type of the file according to the file attribute in the file header;
the first searching unit is used for searching the idle page in the second storage partition when the type of the file is the second type of file;
and the first updating unit is used for storing the update file data body of the file into the idle page and setting the page in which the source file data body of the file is stored as an invalid page.
In the embodiment of the present invention, the apparatus further includes:
the second searching unit is used for searching an invalid page in the second storage partition when the idle page is not searched in the second storage partition;
the first updating unit is further configured to erase the invalid page, and store the update file data volume of the file to the erased invalid page.
In the embodiment of the present invention, the apparatus further includes:
and the third determining unit is used for determining the number of the pages in the second storage partition according to the number and the size of the second type of files, the updating times of the second type of files and the erasing times of the pages in the user identification module.
In the embodiment of the present invention, the apparatus further includes:
and the second updating unit is used for updating the file data body on the page of the source file data body of the file stored in the first storage partition when the type of the file is the first type of file.
In the technical solution of the embodiment of the present invention, a storage area of a storage medium FLASH in an SIM card is divided into a first storage partition and a second storage partition, where the first storage partition refers to a common storage partition, i.e., a low update partition, and the second storage partition refers to a high update partition. When a file is created, file headers of all files are stored in a first storage partition, wherein file attributes in the file headers identify the type of the file, and the type of the file is a first type of file or a second type of file. Here, the first type of files refers to low update frequency files, and the second type of files refers to high update frequency files. When the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition; and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition. According to the technical scheme of the embodiment of the invention, the file system is partitioned, the files with different updating frequencies are stored in different partitions, and different updating operations are supported for the files in different partitions so as to respectively manage the files with high updating frequency and the files with low updating frequency in the SIM card file system, so that less storage resources can be consumed, the processing performance is improved, and the reliability of the SIM card file system is greatly improved.
Drawings
FIG. 1 is a schematic diagram of a file logic structure of a SIM card;
FIG. 2 is a schematic diagram of the logical structure of FLASH in page units;
FIG. 3 is a diagram I illustrating data update in FLASH;
FIG. 4 is a second schematic diagram of data update in FLASH;
fig. 5 is a schematic flowchart of a file management method for an SIM card according to a first embodiment of the present invention;
fig. 6 is a flowchart illustrating a file management method for an SIM card according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of a file management apparatus for a SIM card according to a first embodiment of the present invention;
fig. 8 is a schematic structural diagram of a file management apparatus for a SIM card according to a second embodiment of the present invention;
FIG. 9 is a schematic diagram of the partition of FLASH according to the embodiment of the present invention;
FIG. 10 is a storage diagram illustrating the creation of a high update frequency file according to an embodiment of the present invention;
FIG. 11 is a storage diagram of an update high update frequency file according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating dynamic configuration file system partitioning according to an embodiment of the present invention.
Detailed Description
So that the manner in which the features and aspects of the embodiments of the present invention can be understood in detail, a more particular description of the embodiments of the invention, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings.
Fig. 5 is a schematic flowchart of a file management method for an SIM card according to an embodiment of the present invention, where as shown in fig. 5, the file management method for an SIM card includes the following steps:
step 501: the storage area is divided into a first storage partition and a second storage partition.
In the embodiment of the invention, the storage medium of the SIM card is FLASH, and the storage area of the FLASH is divided into two areas, namely a first storage partition area and a second storage partition area.
Referring to fig. 9, for the first memory partition, the memory partition is a normal memory partition, or a Low update partition (Low update area), and the memory partition is used for storing data with a Low update frequency. For the second memory partition, the memory partition is a High update area (High update area) and the memory partition is used for storing data with High update frequency. Here, the update frequency is determined by factors such as the performance of FLASH, for example, if the erase frequency of FLASH is very high, the update frequency tolerated by the storage partition is high, and if the erase frequency of FLASH is low, the update frequency tolerated by the storage area is low. Here, the logical structure of the FLASH of each memory partition is in units of pages, and the capacity of each page is 256 bytes or 512 bytes.
In the embodiment of the invention, the SIM card is a special electronic device and has the following characteristics:
1) most files have few updating operations and many reading operations, such as International Mobile Subscriber Identity (IMSI), phone files, and short message files.
2) And a few files have high updating frequency, such as a position information file and an authentication counter file.
3) There are fewer operations to create and delete files.
4) Compared with terminal equipment, the processing capacity is limited, and hardware resources are limited.
The high update frequency files account for about 8% of the whole files of the SIM card, but the use of the SIM card is seriously problematic due to the invalid contents of the files, and the embodiment of the invention is the key point for realizing the management of the high update frequency files by reasonably utilizing limited resources according to the characteristics of the SIM card.
Therefore, in the embodiment of the invention, the SIM card file system is partitioned into the ordinary storage partition and the high updating partition, the two partitions respectively adopt different storage management methods, the low updating frequency file is stored in the ordinary storage partition, the file header of the high updating frequency file is stored in the ordinary storage partition, and the file data body of the high updating frequency file is stored in the high updating partition.
Step 502: when a file is created, storing a file header of the file in the first storage partition, wherein a file attribute in the file header identifies the type of the file, and the type of the file is a first type of file or a second type of file.
In the embodiment of the invention, when the file is created, the file header of the file is stored in the first storage partition. The file attribute in the file header identifies the type of the file, and the type of the file is the first type of file or the second type of file. Here, the first type of files refers to low update frequency files, and the second type of files refers to high update frequency files. The file header of the file has an attribute that identifies whether the file is a low update frequency file or a high update frequency file.
Referring to fig. 10, for a file of a high update partition, a header identifies the file as a high update frequency file. When a file is created, a file header is stored in a common storage partition, and the type of the file is judged according to the file attribute in the file header.
Step 503: and when the file attribute indicates that the created file belongs to the first type of file, storing the file data body of the first type of file in the first storage partition.
Referring to fig. 10, if the file attribute indicates that the file is a low update frequency file, a storage space is allocated for file data in the general storage partition.
Step 504: and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition.
Referring to fig. 10, if the file attribute indicates that the file is a high update frequency file, storage space is allocated for file data in the high update partition.
Referring to fig. 11, when updating a high update frequency file in a high update partition, the following procedure is adopted:
finding out a file header of the file according to the file ID, and judging whether the file is a high-update-frequency file or not according to the file attribute of the file header; if the file is a high-update-frequency file, finding a new free page in the high-update partition, writing the updated data into the new free page, and setting an old page which originally stores the file data as an invalid page. And if no new free page is found in the high-update partition, finding an invalid page in the high-update partition, erasing the found invalid page, and writing the updated data into the erased invalid page.
The partition of the file system is dynamically configured, and specifically, the number of FLASH pages occupied by the high-update partition is calculated according to the size and the number of the high-update-frequency files to be created, the required file update times and the FLASH erasing time limit. When the SIM card system compiles, the memory space is allocated according to the calculated number of pages of FLASH in the high update partition, see fig. 12. And when the SIM card system is started, initializing the file system partition.
In the technical solution of the embodiment of the present invention, a storage area of a storage medium FLASH in an SIM card is divided into a first storage partition and a second storage partition, where the first storage partition refers to a common storage partition, i.e., a low update partition, and the second storage partition refers to a high update partition. When a file is created, file headers of all files are stored in a first storage partition, wherein file attributes in the file headers identify the type of the file, and the type of the file is a first type of file or a second type of file. Here, the first type of files refers to low update frequency files, and the second type of files refers to high update frequency files. When the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition; and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition. The technical scheme of the embodiment of the invention partitions the file system, stores files with different updating frequencies in different partitions and supports different updating operations for the files in different partitions. The technical scheme of the embodiment of the invention consumes less storage resources and performance, and greatly improves the reliability of the SIM card file system. And moreover, the high-update-frequency file partition is dynamically configured, so that the storage resources of the SIM card are reasonably and effectively used.
Fig. 6 is a flowchart illustrating a file management method for an SIM card according to a second embodiment of the present invention, where as shown in fig. 6, the file management method for an SIM card includes the following steps:
step 601: the storage area is divided into a first storage partition and a second storage partition.
In the embodiment of the invention, the storage medium of the SIM card is FLASH, and the storage area of the FLASH is divided into two areas, namely a first storage partition area and a second storage partition area.
Referring to fig. 9, for the first memory partition, the memory partition is a normal memory partition, or a Low update partition (Low update area), and the memory partition is used for storing data with a Low update frequency. For the second memory partition, the memory partition is a High update area (High update area) and the memory partition is used for storing data with High update frequency. Here, the update frequency is determined by factors such as the performance of FLASH, for example, if the erase frequency of FLASH is very high, the update frequency tolerated by the storage partition is high, and if the erase frequency of FLASH is low, the update frequency tolerated by the storage area is low. Here, the logical structure of the FLASH of each memory partition is in units of pages, and the capacity of each page is 256 bytes or 512 bytes.
In the embodiment of the invention, the SIM card is a special electronic device and has the following characteristics:
1) most files have few updating operations and many reading operations, such as IMSI, telephone files and short message files.
2) And a few files have high updating frequency, such as a position information file and an authentication counter file.
3) There are fewer operations to create and delete files.
4) Compared with terminal equipment, the processing capacity is limited, and hardware resources are limited.
The high update frequency files account for about 8% of the whole files of the SIM card, but the use of the SIM card is seriously problematic due to the invalid contents of the files, and the embodiment of the invention is the key point for realizing the management of the high update frequency files by reasonably utilizing limited resources according to the characteristics of the SIM card.
Therefore, in the embodiment of the invention, the SIM card file system is partitioned into the ordinary storage partition and the high updating partition, the two partitions respectively adopt different storage management methods, the low updating frequency file is stored in the ordinary storage partition, the file header of the high updating frequency file is stored in the ordinary storage partition, and the file data body of the high updating frequency file is stored in the high updating partition.
Step 602: when a file is created, storing a file header of the file in the first storage partition, wherein a file attribute in the file header identifies the type of the file, and the type of the file is a first type of file or a second type of file.
In the embodiment of the invention, when the file is created, the file header of the file is stored in the first storage partition. The file attribute in the file header identifies the type of the file, and the type of the file is the first type of file or the second type of file. Here, the first type of files refers to low update frequency files, and the second type of files refers to high update frequency files. The file header of the file has an attribute that identifies whether the file is a low update frequency file or a high update frequency file.
Referring to fig. 10, for a file of a high update partition, a header identifies the file as a high update frequency file. When a file is created, a file header is stored in a common storage partition, and the type of the file is judged according to the file attribute in the file header.
Step 603: and when the file attribute indicates that the created file belongs to the first type of file, storing the file data body of the first type of file in the first storage partition.
Referring to fig. 10, if the file attribute indicates that the file is a low update frequency file, a storage space is allocated for file data in the general storage partition.
Step 604: and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition.
Referring to fig. 10, if the file attribute indicates that the file is a high update frequency file, storage space is allocated for file data in the high update partition.
Step 605: determining a file header of the file according to the ID of the file; determining the type of the file according to the file attribute in the file header; when the type of the file is a second type of file, finding a free page in a second storage partition; and storing the update file data body of the file into the idle page, and setting the page of the source file data body in which the file is stored as an invalid page.
Referring to fig. 11, when updating a high update frequency file in a high update partition, the following procedure is adopted:
finding out a file header of the file according to the file ID, and judging whether the file is a high-update-frequency file or not according to the file attribute of the file header; if the file is a high-update-frequency file, finding a new free page in the high-update partition, writing the updated data into the new free page, and setting an old page which originally stores the file data as an invalid page. And if no new free page is found in the high-update partition, finding an invalid page in the high-update partition, erasing the found invalid page, and writing the updated data into the erased invalid page.
Step 606: when no free page is found in the second storage partition, finding an invalid page in the second storage partition; and erasing the invalid page, and storing the updated file data body of the file to the erased invalid page.
In the embodiment of the invention, the number of the pages in the second storage partition is determined according to the number and the size of the second type of files, the updating times of the second type of files and the erasing times of the pages in the user identification module.
The partition of the file system is dynamically configured, and specifically, the number of FLASH pages occupied by the high-update partition is calculated according to the size and the number of the high-update-frequency files to be created, the required file update times and the FLASH erasing time limit. When the SIM card system compiles, the memory space is allocated according to the calculated number of pages of FLASH in the high update partition, see fig. 12. And when the SIM card system is started, initializing the file system partition.
In the embodiment of the present invention, when the type of the file is a first type of file, the file data body is updated on a page of a source file data body in which the file is stored in the first storage partition.
In the technical solution of the embodiment of the present invention, a storage area of a storage medium FLASH in an SIM card is divided into a first storage partition and a second storage partition, where the first storage partition refers to a common storage partition, i.e., a low update partition, and the second storage partition refers to a high update partition. When a file is created, file headers of all files are stored in a first storage partition, wherein file attributes in the file headers identify the type of the file, and the type of the file is a first type of file or a second type of file. Here, the first type of files refers to low update frequency files, and the second type of files refers to high update frequency files. When the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition; and when the file attribute indicates that the created file belongs to the second type of file, storing the file data body of the second type of file in a second storage partition. The technical scheme of the embodiment of the invention partitions the file system, stores files with different updating frequencies in different partitions and supports different updating operations for the files in different partitions. The technical scheme of the embodiment of the invention consumes less storage resources and performance, and greatly improves the reliability of the SIM card file system. And moreover, the high-update-frequency file partition is dynamically configured, so that the storage resources of the SIM card are reasonably and effectively used.
Fig. 7 is a schematic structural composition diagram of a file management apparatus for a SIM card according to a first embodiment of the present invention, as shown in fig. 7, the apparatus includes:
a partitioning unit 71 configured to divide the storage area into a first storage partition and a second storage partition;
a first storage unit 72, configured to store a file header of a file in the first storage partition when creating the file, where a file attribute in the file header identifies a type of the file, and the type of the file is a first type of file or a second type of file; when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
a second storing unit 73, configured to store the file data body of the second type file in the second storage partition when the file attribute indicates that the created file belongs to the second type file.
It should be understood by those skilled in the art that the functions implemented by each unit in the file management device of the SIM card shown in fig. 7 can be understood by referring to the related description of the file management method of the SIM card.
Fig. 8 is a schematic structural composition diagram of a file management device for a SIM card according to a second embodiment of the present invention, and as shown in fig. 8, the device includes:
a partition unit 81 for dividing the storage area into a first storage partition and a second storage partition;
a first storage unit 82, configured to store a file header of a file in the first storage partition when creating the file, where a file attribute in the file header identifies a type of the file, and the type of the file is a first type of file or a second type of file; when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
a second storage unit 83, configured to store the file data body of the second type file in the second storage partition when the file attribute indicates that the created file belongs to the second type file.
The device further comprises:
a first determining unit 84, configured to determine a file header of a file according to an identifier ID of the file;
a second determining unit 85, configured to determine the type of the file according to the file attribute in the file header;
a first searching unit 86, configured to search for a free page in the second storage partition when the file type is the second type file;
a first updating unit 87, configured to store the update file data body of the file into the free page, and set a page in which the source file data body of the file is stored as an invalid page.
The device further comprises:
a second searching unit 88, configured to search for an invalid page in the second storage partition when no free page is found in the second storage partition;
the first updating unit 87 is further configured to erase the invalid page, and store the update file data body of the file into the erased invalid page.
The device further comprises:
a third determining unit 89, configured to determine the number of pages in the second storage partition according to the number and size of the second type of file, the number of updates of the second type of file, and the number of erasures of pages in the subscriber identity module.
The device further comprises: a second updating unit 810, configured to update the file data body on a page of the source file data body of the file stored in the first memory partition, when the type of the file is the first type of file.
It should be understood by those skilled in the art that the functions implemented by each unit in the file management device of the SIM card shown in fig. 8 can be understood by referring to the related description of the file management method of the SIM card.
The technical schemes described in the embodiments of the present invention can be combined arbitrarily without conflict.
In the embodiments provided in the present invention, it should be understood that the disclosed method and intelligent device may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one second processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention.

Claims (6)

1. A file management method of a user identification module is characterized in that the user identification module is provided with a storage area; the method comprises the following steps:
dividing the storage area into a first storage partition and a second storage partition;
when a file is created, storing a file header of the file in the first storage partition, wherein a file attribute in the file header identifies the type of the file, the type of the file is a first type of file or a second type of file, and the update frequency of the first type of file is less than that of the second type of file;
when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
when the file attribute indicates that the created file belongs to a second type of file, storing a file data body of the second type of file in a second storage partition;
determining a file header of the file according to the ID of the file;
determining the type of the file according to the file attribute in the file header;
when the type of the file is a second type of file, finding a free page in a second storage partition;
storing an update file data body of the file to the idle page, and setting a page of a source file data body storing the file as an invalid page;
and when the type of the file is the first type of file, updating the file data body on a page of a source file data body of the file stored in the first storage partition.
2. The method for file management of a subscriber identity module according to claim 1, the method further comprising:
when no free page is found in the second storage partition, finding an invalid page in the second storage partition;
and erasing the invalid page, and storing the updated file data body of the file to the erased invalid page.
3. The method for file management of a subscriber identity module according to claim 1, the method further comprising:
and determining the number of the pages in the second storage partition according to the number and the size of the second type of files, the updating times of the second type of files and the erasing times of the pages in the user identification module.
4. A file management device of a user identification module is characterized in that the user identification module is provided with a storage area; the device comprises:
a partition unit for dividing the storage area into a first storage partition and a second storage partition;
the file management system comprises a first storage unit, a second storage unit and a third storage unit, wherein the first storage unit is used for storing a file header of a file in the first storage partition when the file is created, the file attribute in the file header identifies the type of the file, the type of the file is a first type of file or a second type of file, and the update frequency of the first type of file is less than that of the second type of file; when the file attribute indicates that the created file belongs to a first type of file, storing a file data body of the first type of file in a first storage partition;
the second storage unit is used for storing the file data body of the second type of file in a second storage partition when the file attribute indicates that the created file belongs to the second type of file;
the first determining unit is used for determining a file header of the file according to the identification ID of the file;
the second determining unit is used for determining the type of the file according to the file attribute in the file header;
the first searching unit is used for searching the idle page in the second storage partition when the type of the file is the second type of file;
the first updating unit is used for storing an updating file data body of the file into the idle page and setting a page in which a source file data body of the file is stored as an invalid page;
and the second updating unit is used for updating the file data body on the page of the source file data body of the file stored in the first storage partition when the type of the file is the first type of file.
5. The apparatus for file management of a subscriber identity module according to claim 4, further comprising:
the second searching unit is used for searching an invalid page in the second storage partition when the idle page is not searched in the second storage partition;
the first updating unit is further configured to erase the invalid page, and store the update file data volume of the file to the erased invalid page.
6. The apparatus for file management of a subscriber identity module according to claim 4, further comprising:
and the third determining unit is used for determining the number of the pages in the second storage partition according to the number and the size of the second type of files, the updating times of the second type of files and the erasing times of the pages in the user identification module.
CN201510408918.4A 2015-07-13 2015-07-13 File management method and device of user identification module Active CN106354718B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510408918.4A CN106354718B (en) 2015-07-13 2015-07-13 File management method and device of user identification module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510408918.4A CN106354718B (en) 2015-07-13 2015-07-13 File management method and device of user identification module

Publications (2)

Publication Number Publication Date
CN106354718A CN106354718A (en) 2017-01-25
CN106354718B true CN106354718B (en) 2021-05-25

Family

ID=57842085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510408918.4A Active CN106354718B (en) 2015-07-13 2015-07-13 File management method and device of user identification module

Country Status (1)

Country Link
CN (1) CN106354718B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109213448B (en) * 2018-08-30 2022-04-05 东信和平科技股份有限公司 Method, device, equipment and storage medium for erasing and writing data of smart card
CN111565245A (en) * 2020-04-28 2020-08-21 武汉天喻聚联网络有限公司 Multi-code storage method and system
CN111782605A (en) * 2020-07-06 2020-10-16 东信和平科技股份有限公司 Chip card file management method, device, terminal and storage medium
CN113282521A (en) * 2021-05-19 2021-08-20 武汉天喻信息产业股份有限公司 Method and device for prolonging service life of smart card

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369451A (en) * 2007-08-14 2009-02-18 三星电子株式会社 Solid state memory (ssm), computer system including an ssm, and method of operating an ssm
CN101740110A (en) * 2009-12-17 2010-06-16 中兴通讯股份有限公司 Method and device for erasure balance of Nand Flash
CN102799534A (en) * 2012-07-18 2012-11-28 上海宝存信息科技有限公司 Storage system and method based on solid state medium and cold-hot data identification method
CN102981966A (en) * 2012-11-09 2013-03-20 青岛海信宽带多媒体技术有限公司 Data storage method with Flash storage blocks evenly assigned
CN104461935A (en) * 2014-11-27 2015-03-25 华为技术有限公司 Method, device and system for data storage

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8452929B2 (en) * 2005-04-21 2013-05-28 Violin Memory Inc. Method and system for storage of data in non-volatile media
US20090132621A1 (en) * 2006-07-28 2009-05-21 Craig Jensen Selecting storage location for file storage based on storage longevity and speed
CN101571869B (en) * 2009-05-31 2011-04-20 北京握奇数据***有限公司 File memory and read method of smart card and device thereof
US8832371B2 (en) * 2011-04-04 2014-09-09 Hitachi, Ltd. Storage system with multiple flash memory packages and data control method therefor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101369451A (en) * 2007-08-14 2009-02-18 三星电子株式会社 Solid state memory (ssm), computer system including an ssm, and method of operating an ssm
CN101740110A (en) * 2009-12-17 2010-06-16 中兴通讯股份有限公司 Method and device for erasure balance of Nand Flash
CN102799534A (en) * 2012-07-18 2012-11-28 上海宝存信息科技有限公司 Storage system and method based on solid state medium and cold-hot data identification method
CN102981966A (en) * 2012-11-09 2013-03-20 青岛海信宽带多媒体技术有限公司 Data storage method with Flash storage blocks evenly assigned
CN104461935A (en) * 2014-11-27 2015-03-25 华为技术有限公司 Method, device and system for data storage

Also Published As

Publication number Publication date
CN106354718A (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN107168647B (en) FLASH data read-write method and system
CN108038002B (en) Embedded software memory management method
CN106354718B (en) File management method and device of user identification module
CN106155915B (en) Data storage processing method and device
CN103440205B (en) A kind of set top box data storage method and device
CN110209348B (en) Data storage method and device, electronic equipment and storage medium
CN103092687B (en) A kind of application program management apparatus and method
US10152274B2 (en) Method and apparatus for reading/writing data from/into flash memory, and user equipment
US20150169570A1 (en) Method and device for managing data
CN109101437A (en) A kind of date storage method and terminal
CN102037456A (en) Identification of memory cards by host
CN104933051A (en) File storage space recovery method and device
JP2016533588A (en) Storage processing method, apparatus and terminal
CN102073733A (en) Method and device for managing Hash table
CN107479834A (en) A kind of file memory method and device based on COS
CN103440204A (en) Method for updating file system and storage device
CN107148612A (en) A kind of method and apparatus of extending user subregion
CN102184375A (en) Management method and terminal of data in subscriber identity module (SIM) card
CN108664482A (en) FLASH memory and storage file management method
US10949340B2 (en) Block mapping systems and methods for storage device
CN107632944B (en) Method and device for reading data
CN116301614A (en) Memory data access method, system, device and storage medium
CN112612753B (en) System and method for dynamically managing Java Card storage space
CN114237506A (en) EMMC data storage and read-write method
US10698626B2 (en) Method of managing integrated circuit cards, corresponding card and apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant