WO2022241917A1 - 一种智能卡寿命延长方法及装置 - Google Patents

一种智能卡寿命延长方法及装置 Download PDF

Info

Publication number
WO2022241917A1
WO2022241917A1 PCT/CN2021/104180 CN2021104180W WO2022241917A1 WO 2022241917 A1 WO2022241917 A1 WO 2022241917A1 CN 2021104180 W CN2021104180 W CN 2021104180W WO 2022241917 A1 WO2022241917 A1 WO 2022241917A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
storage area
frequency
header
smart card
Prior art date
Application number
PCT/CN2021/104180
Other languages
English (en)
French (fr)
Inventor
王鸣
刘凯
肖灵
张新访
董逢华
Original Assignee
武汉天喻信息产业股份有限公司
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 武汉天喻信息产业股份有限公司 filed Critical 武汉天喻信息产业股份有限公司
Publication of WO2022241917A1 publication Critical patent/WO2022241917A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7211Wear leveling

Definitions

  • the present application relates to the technical field of smart cards, in particular to a method and device for extending the life of a smart card.
  • the smart card divides the storage area into physical blocks of the same size for use, and also requires a large number of mapping blocks for data storage and related data processing.
  • This application provides a method and device for extending the life of a smart card, which divides the file storage area based on the erasing frequency of the file, uses a specific storage area to store the file body of the frequently erased file, and assists in file search through the mapping relationship , effectively avoid disorderly erasing and writing work on the storage area of the smart card, and prolong the service life of the smart card.
  • the application provides a method for extending the life of a smart card, the method comprising the following steps:
  • a high-frequency file storage area is set in the preset storage area of the smart card, and the high-frequency file storage area is used to store the file body of the frequently erased file, and the file header of the frequently erased file is stored in the preset storage area , and there is a mapping relationship between the file header and the file body of the frequently erased file;
  • the execution object In response to the read instruction, if the execution object is the frequently erased file, by accessing the corresponding file header in the preset storage area, and then accessing the corresponding file body in the high-frequency file storage area and executing the read command;
  • the execution object In response to the write instruction, if the execution object is the frequently erased file and there is a corresponding file header in the preset storage area, then access the corresponding file body in the high-frequency file storage area and execute the write instruction .
  • the method also includes the following steps:
  • the execution object is the frequently erased file and the corresponding file header does not exist in the preset storage area, then create a corresponding file header in the preset storage area, and Create a corresponding file body in the video file storage area and execute the write instruction.
  • the method also includes the following steps:
  • performing file backup in the preset storage area according to the corresponding file header in the preset storage area and the corresponding file body in the high-frequency file storage area includes the following steps:
  • the backup storage file is stored in the preset storage area.
  • the file bodies in the high-frequency file storage area are configured with corresponding file numbers, and the file numbers correspond to the order in which the file bodies are first written.
  • the present application provides a device for extending the life of a smart card, the device comprising:
  • the area configuration module is used to set a high-frequency file storage area in the preset storage area of the smart card, the high-frequency file storage area is used to store the file body of the frequently erased file, and the file header of the frequently erased file is stored In the preset storage area, there is a mapping relationship between the file header and the file body of the frequently erased file;
  • the instruction execution module is used to respond to the read instruction. If the execution object is the frequently erased file, it accesses the corresponding file header in the preset storage area, and then accesses the corresponding file header in the high-frequency file storage area. file body and execute the read command;
  • the instruction execution module is also used to respond to the write instruction, if the execution object is the frequently erased file and there is a corresponding file header in the preset storage area, then access the corresponding file in the high-frequency file storage area body and execute the write command.
  • the instruction execution module is also used to respond to the write instruction, if the execution object is the frequently erased file and there is no corresponding file header in the preset storage area, then in the preset storage area Create a corresponding file header, create a corresponding file body in the high-frequency file storage area, and execute the write instruction.
  • the device also includes a file backup module
  • the instruction execution module is also used to respond to the write instruction, if the execution object is the frequently erased file and the storage space of the preset storage area is full, issue a file backup instruction;
  • the file backup module is configured to respond to the file backup instruction, and perform file backup in the preset storage area according to the corresponding file header in the preset storage area and the corresponding file body in the high-frequency file storage area. file backup;
  • the instruction execution module is also used to clear the data in the high-frequency file storage area after the file backup is completed;
  • the instruction execution module is also used to create a corresponding file header in the preset storage area after the data is cleared, and create a corresponding file body in the high-frequency file storage area and execute the write instruction .
  • the file backup module is also used to integrate the corresponding file header in the preset storage area and the corresponding file body in the high-frequency file storage area to obtain a corresponding backup storage file;
  • the file backup module is also used for storing the backup storage file in the preset storage area.
  • the file bodies in the high-frequency file storage area are configured with corresponding file numbers, and the file numbers correspond to the order in which the file bodies are first written.
  • This application divides the file storage area based on the erasing frequency of the file, uses a specific storage area to store the file body of the frequently erased file, and assists in file search through the mapping relationship, effectively avoiding disorder in the smart card storage area Erase and write work, prolong the life of the smart card.
  • SIM Subscriber Identity Module
  • user identification card user identification card
  • Fig. 1 is the flow chart of the steps of the smart card life extension method provided in the embodiment of the present application
  • Fig. 2 is the flow chart of the steps of the file writing process of the smart card life extension method provided in the embodiment of the application;
  • Fig. 3 is a flow chart of the steps of the file update process of the smart card life extension method provided in the embodiment of the present application;
  • FIG. 4 is a structural block diagram of a device for extending the life of a smart card provided in an embodiment of the present application.
  • the embodiment of the present application provides a method and device for extending the service life of a smart card, which divides the file storage area based on the erasing frequency of the file, uses a specific storage area to store the file body of the frequently erased file, and assists in file storage through the mapping relationship. Search work, effectively avoid disorderly erasing and writing work on the storage area of the smart card, and prolong the service life of the smart card.
  • a data processing method with privacy protection function comprises the following steps:
  • the high-frequency file storage area is used to store the file body of the frequently erased file, and the file header of the frequently erased file is stored in the preset storage area. There is a mapping relationship between the file header and the file body of the erased file;
  • the embodiment of the present application provides a method for extending the life of a smart card, which includes the following steps:
  • the high-frequency file storage area is used to store the file body of the frequently erased file, and the file header of the frequently erased file is stored in the preset storage area. There is a mapping relationship between the file header and the file body of the erased file;
  • the file storage area is divided, the file body of frequently erasing files is stored in a specific storage area, and the file search is assisted through the mapping relationship, effectively avoiding the smart card storage.
  • the area performs disorderly erasing and writing, prolonging the service life of the smart card.
  • frequently erased files are data that need to be frequently erased in the daily processing of smart cards. When classifying them, they can be identified according to the data type, and specific types of data can be classified as frequently erased data. Historical erasing and writing data are recorded. When the erasing and writing times exceed the erasing and writing times threshold within the preset judgment period, the data is judged as frequent erasing and writing data.
  • the file body of frequently erased files is allocated to the high-frequency file storage area, and only the file header is allocated to the file system area. At the same time, the file header is extended by one byte to save the number of the file in the high-frequency file area;
  • the latest value of each file in the high-frequency file area is backed up, and then the entire high-frequency file area is erased for reuse.
  • the method also includes the following steps:
  • the method also includes the following steps:
  • performing file backup in the preset storage area includes the following steps:
  • the file bodies in the high-frequency file storage area are configured with corresponding file numbers, and the file numbers correspond to the order in which the file bodies are first written.
  • the first step is to create a frequently erased file EF01 on the SIM card, the file size is 08, and the initial value is all 0.
  • the SIM card allocates a high-frequency area for it.
  • the high-frequency area is numbered 01, and the number is recorded in the file header.
  • store the file content in the high-frequency FLASH area After storage, the content of the high-frequency FLASH area is as follows:
  • Step 2 Create a frequently erased file EF02 on the SIM card, the file size is 04, and the initial value is all 0.
  • the SIM card allocates a high-frequency area for it.
  • the high-frequency area is numbered 02, and the number is recorded in the file header, and Store the file content in the high-frequency FLASH area.
  • the storage location is searched from the beginning of the high-frequency area, and it is enough to find an unused area. After storage, the content of the high-frequency FLASH area is as follows:
  • the third step is to update the frequently erased file EF01 value is all 1, store the file content in the high-frequency FLASH area, search for the storage location from the starting position of the high-frequency area, find an unused area, and store it in the high-frequency FLASH area
  • the content is as follows:
  • Step 4 Read the file content of the frequently erased file EF01, search for the BLOCK numbered 01 from the beginning of the high-frequency area, find the first BLOCK, and the value is all 0. At this time, because the subsequent area is not an unused area , so you need to continue to search backwards. After finding the third BLOCK, the subsequent area is an unused area, stop searching, and the finally found BLOCK that matches the number is the third BLOCK, so the file content of EF01 is the third BLOCK The file value, which is all 1.
  • Step 5 When the entire high-frequency area space is used up, store the latest BLOCK content numbered 01 and 02, and then erase the entire high-frequency area for reuse.
  • the frequently erased file EF01 and the frequently erased file EF02 can be two files created in the high-frequency file storage area, or can be understood as divided storage areas for storing frequently erased data.
  • the high-frequency file storage area can store two or more frequently erased files.
  • an embodiment of the present application provides a device for extending the life of a smart card, which is based on the method for extending the life of a smart card mentioned in the first aspect.
  • the device includes:
  • the area configuration module is used to set a high-frequency file storage area in the preset storage area of the smart card.
  • the high-frequency file storage area is used to store the file body of the frequently erased file, and the file header of the frequently erased file is stored in the preset storage area. In the area, there is a mapping relationship between the file header and the file body of the frequently erased file;
  • the instruction execution module is used to respond to the read instruction. If the execution object is a frequently erased file, it accesses the corresponding file body in the high-frequency file storage area by accessing the corresponding file header in the preset storage area and executes the read Fetch instructions;
  • the instruction execution module is also used to respond to the write instruction, if the execution object is a frequently erased file and there is a corresponding file header in the preset storage area, then access the corresponding file body in the high-frequency file storage area and execute the write instruction.
  • the file storage area is divided, the file body of frequently erasing files is stored in a specific storage area, and the file search is assisted through the mapping relationship, effectively avoiding the smart card storage.
  • the area performs disorderly erasing and writing, prolonging the service life of the smart card.
  • frequently erased files are data that need to be frequently erased in the daily processing of smart cards. When classifying them, they can be identified according to the data type, and specific types of data can be classified as frequently erased data. Historical erasing and writing data are recorded. When the erasing and writing times exceed the erasing and writing times threshold within the preset judgment period, the data is judged as frequent erasing and writing data.
  • the file body of frequently erased files is allocated to the high-frequency file storage area, and only the file header is allocated to the file system area. At the same time, the file header is extended by one byte to save the number of the file in the high-frequency file area;
  • the latest value of each file in the high-frequency file area is backed up, and then the entire high-frequency file area is erased for reuse.
  • the instruction execution module is also used to respond to the write instruction, if the execution object is a frequently erased file and there is no corresponding file header in the preset storage area, then create a corresponding file header in the preset storage area, and Create a corresponding file body in the high-frequency file storage area and execute the write command.
  • the device also includes a file backup module
  • the instruction execution module is also used to respond to the write instruction, if the execution object is a frequently erased file and the storage space in the preset storage area is full, issue a file backup instruction;
  • the file backup module is used to respond to the file backup instruction, and perform file backup in the preset storage area according to the corresponding file header in the preset storage area and the corresponding file body in the high-frequency file storage area;
  • the instruction execution module is also used to clear the data in the high-frequency file storage area after the file backup is completed;
  • the command execution module is also used to create a corresponding file header in the preset storage area after the data is cleared, and create a corresponding file body in the high-frequency file storage area and execute the write command.
  • the file backup module is also used to integrate the corresponding file headers in the preset storage area and the corresponding file bodies in the high-frequency file storage area to obtain corresponding backup storage files;
  • the file backup module is also used for storing backup storage files in the preset storage area.
  • the file bodies in the high-frequency file storage area are configured with corresponding file numbers, and the file numbers correspond to the order in which the file bodies are first written.

Abstract

一种智能卡寿命延长方法及装置,涉及智能卡技术领域,该方法包括以下步骤:在智能卡的预设存储区域设置用于存储频繁擦写文件的文件体的高频文件存储区域,频繁擦写文件的文件头存储在预设存储区域中(S1);响应读取指令,若执行对象为频繁擦写文件,则通过访问预设存储区域中的对应的文件头,进而访问高频文件存储区域中对应的文件体并执行读取指令(S2);响应写入指令,若执行对象为频繁擦写文件且预设存储区域中存在对应的文件头,则访问高频文件存储区域中对应的文件体并执行写入指令(S3)。所述方法利用特定的存储区域存储频繁擦写文件,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的擦写工作,延长智能卡使用寿命。

Description

一种智能卡寿命延长方法及装置 技术领域
本申请涉及智能卡技术领域,具体涉及一种智能卡寿命延长方法及装置。
背景技术
随着电子技术的发展,智能卡的技术逐渐成熟。现阶段智能卡,将存储区域划分为相同大小的物理块进行使用,并且还需要数量庞大的映射块,从而进行数据存储和相关的数据处理工作。
但基于传统的智能卡数据存储手段,智能卡在日常使用过程中,进行数据存储时会造成智能卡存储空间的浪费严重。久而久之,对智能卡的存储区域进行反复擦写,会严重影响智能卡的使用寿命。
因此,为了避免缩短智能卡的使用寿命,现提供一种智能卡寿命延长技术方案。
发明内容
本申请提供一种智能卡寿命延长方法及装置,基于对文件的擦写频率,对文件存储区域进行划分,利用特定的存储区域存储频繁擦写文件的文件体,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的擦写工作,延长智能卡使用寿命。
第一方面,本申请提供了一种智能卡寿命延长方法,所述方法包括以下步骤:
在智能卡的预设存储区域设置一高频文件存储区域,所述高频文件存储区域用于存储频繁擦写文件的文件体,所述频繁擦写文件的文件头存储在所述预设存储区域中,且所述频繁擦写文件的文件头与文 件体之间存在映射关系;
响应读取指令,若执行对象为所述频繁擦写文件,则通过访问所述预设存储区域中的对应的文件头,进而访问所述高频文件存储区域中对应的文件体并执行所述读取指令;
响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中存在对应的文件头,则访问所述高频文件存储区域中对应的文件体并执行所述写入指令。
进一步的,所述方法还包括以下步骤:
响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中不存在对应的文件头,则在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
进一步的,所述方法还包括以下步骤:
响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域的存储空间已满,则根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份;
待文件备份完毕后,对所述高频文件存储区域中的数据进行清除;
待数据清除完毕后,在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
具体的,所述根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份中,包括以下步骤:
将所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
在所述预设存储区域中存储所述备份存储文件。
具体的,所述高频文件存储区域中的文件体配置有对应的文件编号,所述文件编号与所述文件体初次写入顺序对应。
第二方面,本申请提供了一种智能卡寿命延长装置,所述装置包括:
区域配置模块,其用于在智能卡的预设存储区域设置一高频文件存储区域,所述高频文件存储区域用于存储频繁擦写文件的文件体,所述频繁擦写文件的文件头存储在所述预设存储区域中,且所述频繁擦写文件的文件头与文件体之间存在映射关系;
指令执行模块,其用于响应读取指令,若执行对象为所述频繁擦写文件,则通过访问所述预设存储区域中的对应的文件头,进而访问所述高频文件存储区域中对应的文件体并执行所述读取指令;
所述指令执行模块还用于响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中存在对应的文件头,则访问所述高频文件存储区域中对应的文件体并执行所述写入指令。
进一步的,所述指令执行模块还用于响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中不存在对应的文件头,则在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
进一步的,所述装置还包括文件备份模块;
所述指令执行模块还用于响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域的存储空间已满,发布文件备份指令;
所述文件备份模块用于响应所述文件备份指令,根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份;
所述指令执行模块还用于待文件备份完毕后,对所述高频文件存储区域中的数据进行清除;
所述指令执行模块还用于待数据清除完毕后,在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
进一步的,所述文件备份模块还用于将所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
所述文件备份模块还用于在所述预设存储区域中存储所述备份存储文件。
进一步的,所述高频文件存储区域中的文件体配置有对应的文件编号,所述文件编号与所述文件体初次写入顺序对应。
本申请提供的技术方案带来的有益效果包括:
本申请基于对文件的擦写频率,对文件存储区域进行划分,利用特定的存储区域存储频繁擦写文件的文件体,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的擦写工作,延长智能卡使用寿命。
附图说明
术语解释:
SIM:Subscriber Identity Module,用户身份识别卡。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在 不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例中提供的智能卡寿命延长方法的步骤流程图;
图2为本申请实施例中提供的智能卡寿命延长方法的文件写入流程的步骤流程图;
图3为本申请实施例中提供的智能卡寿命延长方法的文件更新流程的步骤流程图;
图4为本申请实施例中提供的智能卡寿命延长装置的结构框图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图对本申请的实施例作进一步详细说明。
本申请实施例提供一种智能卡寿命延长方法及装置,基于对文件的擦写频率,对文件存储区域进行划分,利用特定的存储区域存储频繁擦写文件的文件体,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的擦写工作,延长智能卡使用寿命。
为达到上述技术效果,本申请的总体思路如下:
一种具有隐私保护功能的数据处理方法,该方法包括以下步骤:
S1、在智能卡的预设存储区域设置一高频文件存储区域,高频文 件存储区域用于存储频繁擦写文件的文件体,频繁擦写文件的文件头存储在预设存储区域中,且频繁擦写文件的文件头与文件体之间存在映射关系;
S2、响应读取指令,若执行对象为频繁擦写文件,则通过访问预设存储区域中的对应的文件头,进而访问高频文件存储区域中对应的文件体并执行读取指令;
S3、响应写入指令,若执行对象为频繁擦写文件且预设存储区域中存在对应的文件头,则访问高频文件存储区域中对应的文件体并执行写入指令。
以下结合附图对本申请的实施例作进一步详细说明。
第一方面,参见图1~3所示,本申请实施例提供一种智能卡寿命延长方法,该方法包括以下步骤:
S1、在智能卡的预设存储区域设置一高频文件存储区域,高频文件存储区域用于存储频繁擦写文件的文件体,频繁擦写文件的文件头存储在预设存储区域中,且频繁擦写文件的文件头与文件体之间存在映射关系;
S2、响应读取指令,若执行对象为频繁擦写文件,则通过访问预设存储区域中的对应的文件头,进而访问高频文件存储区域中对应的文件体并执行读取指令;
S3、响应写入指令,若执行对象为频繁擦写文件且预设存储区域中存在对应的文件头,则访问高频文件存储区域中对应的文件体并执行写入指令。
本申请实施例中,基于对文件的擦写频率,对文件存储区域进行划分,利用特定的存储区域存储频繁擦写文件的文件体,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的 擦写工作,延长智能卡使用寿命。
需要说明的是,频繁擦写文件为智能卡在日常处理工作中,需要频繁擦写的数据,具体分类时,可以根据数据类型进行识别,将特定类型的数据归为频繁擦写数据,也可以多历史擦写数据进行记录,当在预设判断周期内,擦写次数超过擦写次数阈值的数据判定为频繁擦写数据。
本申请实施例中,通过将频繁擦写文件的文件体内容集中放到一块FLASH区域中,在次区域中进行均衡擦写的方式,提高智能卡文件系统FLASH写入寿命,
频繁擦写文件的文件体分配到高频文件存储区域,文件系统区域只分配文件头,同时文件头扩展一个字节,保存该文件在高频文件区的编号;
读取文件时,如果是频繁擦写文件,通过文件头中记录的高频文件区的编号,在高频文件区域查找最新的文件内容;
写入文件时,在高频文件区域查找未使用的区域,将该文件的高频文件区的编号和文件内容一并写入;
在高频文件区域查找不到未使用区域后,将高频文件区域各文件的最新值进行备份处理后,再将整个高频文件区域进行擦除,重新使用。
进一步的,该方法还包括以下步骤:
响应写入指令,若执行对象为频繁擦写文件且预设存储区域中不存在对应的文件头,则在预设存储区域中新建对应的文件头,并在高频文件存储区域中新建对应的文件体并执行写入指令。
进一步的,该方法还包括以下步骤:
响应写入指令,若执行对象为频繁擦写文件且预设存储区域的存储空间已满,则根据预设存储区域中的对应的文件头以及高频文件存 储区域中对应的文件体,在预设存储区域中进行文件备份;
待文件备份完毕后,对高频文件存储区域中的数据进行清除;
待数据清除完毕后,在预设存储区域中新建对应的文件头,并在高频文件存储区域中新建对应的文件体并执行写入指令。
具体的,根据预设存储区域中的对应的文件头以及高频文件存储区域中对应的文件体,在预设存储区域中进行文件备份中,包括以下步骤:
将预设存储区域中的对应的文件头以及高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
在预设存储区域中存储备份存储文件。
具体的,高频文件存储区域中的文件体配置有对应的文件编号,文件编号与文件体初次写入顺序对应。
需要说明的是,以SIM卡为例,给出一种本实施例的具体实施方式,具体操作流程如下:
第一步、在SIM卡上创建一个频繁擦写文件EF01,文件大小08,初始值全0,SIM卡为其分配一个高频区域,该高频区域编号01,文件头中记录下该编号,并在高频FLASH区域存储文件内容,存储后高频FLASH区域内容如下:
01(高频区域编号)08(文件大小)0000000000000000(文件内容);
第二步、SIM卡上创建一个频繁擦写文件EF02,文件大小04,初始值全0,SIM卡为其分配一个高频区域,该高频区域编号02,文件头中记录下该编号,并在高频FLASH区域存储文件内容,存储位置从高频区域起始位置开始查找,找到未使用的区域即可,存储后高频FLASH区域内容如下:
01(高频区域编号)08(文件大小)0000000000000000(文件内 容)02(高频区域编号)04(文件大小)00000000(文件内容);
第三步、更新频繁擦写文件EF01值为全1,在高频FLASH区域存储文件内容,存储位置从高频区域起始位置开始查找,找到未使用的区域即可,存储后高频FLASH区域内容如下:
01(高频区域编号)08(文件大小)0000000000000000(文件内容)02(高频区域编号)04(文件大小)00000000(文件内容)01(高频区域编号)08(文件大小)1111111111111111(文件内容);
第四步、读取频繁擦写文件EF01的文件内容,从高频区域起始位置开始查找编号为01的BLOCK,找到第1个BLOCK,值为全0,此时由于后续区域不是未使用区域,所以还需继续向后查找,找到第3个BLOCK后,后续区域是未使用区域,停止查找,最后找到的与编号匹配的BLOCK是第3个BLOCK,所以EF01的文件内容是第3个BLOCK的文件值,即全1.
第五步、当整个高频区域空间用完后,存储编号01,02的最新BLOCK内容,然后将整个高频区域进行擦除,重新使用。
其中,本申请实施例中的文件写入流程如说明书附图的图2所示,文件更新流程如说明书附图的图3所示。
可以理解的是,频繁擦写文件EF01以及频繁擦写文件EF02,可以是在高频文件存储区域建立的2个文件,也可以理解为划分的存储区域,用于存储频繁擦写数据。
需要说明的是,高频文件存储区域可以存储两个甚至多个频繁擦写文件。
第二方面,参见图4所示,本申请实施例提供一种智能卡寿命延长装置,其基于第一方面提及的智能卡寿命延长方法,该装置包括:
区域配置模块,其用于在智能卡的预设存储区域设置一高频文件 存储区域,高频文件存储区域用于存储频繁擦写文件的文件体,频繁擦写文件的文件头存储在预设存储区域中,且频繁擦写文件的文件头与文件体之间存在映射关系;
指令执行模块,其用于响应读取指令,若执行对象为频繁擦写文件,则通过访问预设存储区域中的对应的文件头,进而访问高频文件存储区域中对应的文件体并执行读取指令;
指令执行模块还用于响应写入指令,若执行对象为频繁擦写文件且预设存储区域中存在对应的文件头,则访问高频文件存储区域中对应的文件体并执行写入指令。
本申请实施例中,基于对文件的擦写频率,对文件存储区域进行划分,利用特定的存储区域存储频繁擦写文件的文件体,并通过映射关系协助进行文件查找工作,有效避免对智能卡存储区域进行无序的擦写工作,延长智能卡使用寿命。
需要说明的是,频繁擦写文件为智能卡在日常处理工作中,需要频繁擦写的数据,具体分类时,可以根据数据类型进行识别,将特定类型的数据归为频繁擦写数据,也可以多历史擦写数据进行记录,当在预设判断周期内,擦写次数超过擦写次数阈值的数据判定为频繁擦写数据。
本申请实施例中,通过将频繁擦写文件的文件体内容集中放到一块FLASH区域中,在次区域中进行均衡擦写的方式,提高智能卡文件系统FLASH写入寿命,
频繁擦写文件的文件体分配到高频文件存储区域,文件系统区域只分配文件头,同时文件头扩展一个字节,保存该文件在高频文件区的编号;
读取文件时,如果是频繁擦写文件,通过文件头中记录的高频文件区的编号,在高频文件区域查找最新的文件内容;
写入文件时,在高频文件区域查找未使用的区域,将该文件的高频文件区的编号和文件内容一并写入;
在高频文件区域查找不到未使用区域后,将高频文件区域各文件的最新值进行备份处理后,再将整个高频文件区域进行擦除,重新使用。
进一步的,指令执行模块还用于响应写入指令,若执行对象为频繁擦写文件且预设存储区域中不存在对应的文件头,则在预设存储区域中新建对应的文件头,并在高频文件存储区域中新建对应的文件体并执行写入指令。
进一步的,该装置还包括文件备份模块;
指令执行模块还用于响应写入指令,若执行对象为频繁擦写文件且预设存储区域的存储空间已满,发布文件备份指令;
文件备份模块用于响应文件备份指令,根据预设存储区域中的对应的文件头以及高频文件存储区域中对应的文件体,在预设存储区域中进行文件备份;
指令执行模块还用于待文件备份完毕后,对高频文件存储区域中的数据进行清除;
指令执行模块还用于待数据清除完毕后,在预设存储区域中新建对应的文件头,并在高频文件存储区域中新建对应的文件体并执行写入指令。
进一步的,文件备份模块还用于将预设存储区域中的对应的文件头以及高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
文件备份模块还用于在预设存储区域中存储备份存储文件。
进一步的,高频文件存储区域中的文件体配置有对应的文件编号,文件编号与文件体初次写入顺序对应。
需要说明的是,在本申请中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种智能卡寿命延长方法,其特征在于,所述方法包括以下步骤:
    在智能卡的预设存储区域设置一高频文件存储区域,所述高频文件存储区域用于存储频繁擦写文件的文件体,所述频繁擦写文件的文件头存储在所述预设存储区域中,且所述频繁擦写文件的文件头与文件体之间存在映射关系;
    响应读取指令,若执行对象为所述频繁擦写文件,则通过访问所述预设存储区域中的对应的文件头,进而访问所述高频文件存储区域中对应的文件体并执行所述读取指令;
    响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中存在对应的文件头,则访问所述高频文件存储区域中对应的文件体并执行所述写入指令。
  2. 如权利要求1所述的智能卡寿命延长方法,其特征在于,所述方法还包括以下步骤:
    响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中不存在对应的文件头,则在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
  3. 如权利要求1所述的智能卡寿命延长方法,其特征在于,所述方法还包括以下步骤:
    响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域的存储空间已满,则根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份;
    待文件备份完毕后,对所述高频文件存储区域中的数据进行清除;
    待数据清除完毕后,在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
  4. 如权利要求3所述的智能卡寿命延长方法,其特征在于,所述根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份中,包括以下步骤:
    将所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
    在所述预设存储区域中存储所述备份存储文件。
  5. 如权利要求1所述的智能卡寿命延长方法,其特征在于:
    所述高频文件存储区域中的文件体配置有对应的文件编号,所述文件编号与所述文件体初次写入顺序对应。
  6. 一种智能卡寿命延长装置,其特征在于,所述装置包括:
    区域配置模块,其用于在智能卡的预设存储区域设置一高频文件存储区域,所述高频文件存储区域用于存储频繁擦写文件的文件体,所述频繁擦写文件的文件头存储在所述预设存储区域中,且所述频繁擦写文件的文件头与文件体之间存在映射关系;
    指令执行模块,其用于响应读取指令,若执行对象为所述频繁擦写文件,则通过访问所述预设存储区域中的对应的文件头,进而访问所述高频文件存储区域中对应的文件体并执行所述读取指令;
    所述指令执行模块还用于响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域中存在对应的文件头,则访问所述高频文件存储区域中对应的文件体并执行所述写入指令。
  7. 如权利要求6所述的智能卡寿命延长装置,其特征在于:
    所述指令执行模块还用于响应写入指令,若执行对象为所述频繁 擦写文件且所述预设存储区域中不存在对应的文件头,则在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
  8. 如权利要求6所述的智能卡寿命延长装置,其特征在于,所述装置还包括文件备份模块;
    所述指令执行模块还用于响应写入指令,若执行对象为所述频繁擦写文件且所述预设存储区域的存储空间已满,发布文件备份指令;
    所述文件备份模块用于响应所述文件备份指令,根据所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体,在所述预设存储区域中进行文件备份;
    所述指令执行模块还用于待文件备份完毕后,对所述高频文件存储区域中的数据进行清除;
    所述指令执行模块还用于待数据清除完毕后,在所述预设存储区域中新建对应的文件头,并在所述高频文件存储区域中新建对应的文件体并执行所述写入指令。
  9. 如权利要求8所述的智能卡寿命延长装置,其特征在于:
    所述文件备份模块还用于将所述预设存储区域中的对应的文件头以及所述高频文件存储区域中对应的文件体进行整合,获得对应的备份存储文件;
    所述文件备份模块还用于在所述预设存储区域中存储所述备份存储文件。
  10. 如权利要求6所述的智能卡寿命延长装置,其特征在于:
    所述高频文件存储区域中的文件体配置有对应的文件编号,所述文件编号与所述文件体初次写入顺序对应。
PCT/CN2021/104180 2021-05-19 2021-07-02 一种智能卡寿命延长方法及装置 WO2022241917A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110560963.7 2021-05-19
CN202110560963.7A CN113282521A (zh) 2021-05-19 2021-05-19 一种智能卡寿命延长方法及装置

Publications (1)

Publication Number Publication Date
WO2022241917A1 true WO2022241917A1 (zh) 2022-11-24

Family

ID=77280824

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/104180 WO2022241917A1 (zh) 2021-05-19 2021-07-02 一种智能卡寿命延长方法及装置

Country Status (2)

Country Link
CN (1) CN113282521A (zh)
WO (1) WO2022241917A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114237502A (zh) * 2021-12-10 2022-03-25 武汉天喻信息产业股份有限公司 提高eSIM智能卡FLASH写入寿命的方法及装置
CN116541210B (zh) * 2023-06-26 2023-11-17 成都融见软件科技有限公司 一种源文件的备份方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205373A1 (en) * 2007-09-06 2010-08-12 Shuo He Smart sd card and method of accessing the same
CN106354718A (zh) * 2015-07-13 2017-01-25 中国移动通信集团公司 用户识别模块的文件管理方法及装置
CN107039077A (zh) * 2017-03-20 2017-08-11 北京握奇智能科技有限公司 一种延长可擦写芯片寿命的方法和装置
CN109213448A (zh) * 2018-08-30 2019-01-15 东信和平科技股份有限公司 一种智能卡的擦写数据的方法、装置、设备及存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100470506C (zh) * 2007-06-08 2009-03-18 马彩艳 基于sector访问的flash存储器的存储管理方法
CN105989304A (zh) * 2015-03-06 2016-10-05 深圳酷派技术有限公司 一种文件存储方法、读取方法及装置
CN105468692A (zh) * 2015-11-17 2016-04-06 盛趣信息技术(上海)有限公司 文件系统结构及其打包方法和读取方法
CN105573918A (zh) * 2015-12-17 2016-05-11 深圳市新国都支付技术有限公司 一种轻量级闪存系统和方法
CN109656481A (zh) * 2018-12-14 2019-04-19 成都三零嘉微电子有限公司 一种提高智能卡文件系统flash写入寿命的方法
CN110134645B (zh) * 2019-04-15 2023-07-11 深圳市战音科技有限公司 文件系统存储管理方法、读取方法、管理装置和读取装置
CN110489236A (zh) * 2019-08-21 2019-11-22 恒宝股份有限公司 一种物联网卡及其实现flash负载均衡的方法
CN111159114A (zh) * 2019-12-30 2020-05-15 中国科学院寒区旱区环境与工程研究所 文件存储方法、装置及服务器
CN112231244B (zh) * 2020-12-21 2021-04-20 深圳杰睿联科技有限公司 应用于SoftSIM的SIM卡文件擦写系统、方法和可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100205373A1 (en) * 2007-09-06 2010-08-12 Shuo He Smart sd card and method of accessing the same
CN106354718A (zh) * 2015-07-13 2017-01-25 中国移动通信集团公司 用户识别模块的文件管理方法及装置
CN107039077A (zh) * 2017-03-20 2017-08-11 北京握奇智能科技有限公司 一种延长可擦写芯片寿命的方法和装置
CN109213448A (zh) * 2018-08-30 2019-01-15 东信和平科技股份有限公司 一种智能卡的擦写数据的方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN113282521A (zh) 2021-08-20

Similar Documents

Publication Publication Date Title
WO2022241917A1 (zh) 一种智能卡寿命延长方法及装置
US6571326B2 (en) Space allocation for data in a nonvolatile memory
US8041887B2 (en) Memory device and control method thereof
US10754549B2 (en) Append only streams for storing data on a solid state device
US20070150691A1 (en) Methods and apparatus to share a thread to reclaim memory space in a non-volatile memory file system
US8060684B2 (en) Memory control apparatus, memory control method and program
US20070192534A1 (en) Flash memory management system and apparatus
US20150052292A1 (en) Method for erasing data entity in memory module
JP2008507770A (ja) Usbフラッシュ書込性能を向上させる方法および装置
WO2021082422A1 (zh) 一种存储系统空间回收的兼容处理方法、系统及设备
US8090692B2 (en) Method for using an OTP storage device
CN110312986B (zh) 用于在固态设备上存储数据的流的机会性使用
US20180232154A1 (en) Append Only Streams For Storing Data On A Solid State Device
US8595426B2 (en) Handling commands within a write-once read-many storage device configuration
US20160124650A1 (en) Data Storage Device and Flash Memory Control Method
US8250285B2 (en) Non-volatile dual memory die for data storage devices
CN110471626B (zh) 应用于Java Card的Nor Flash管理层及方法
CN112612753A (zh) 一种动态管理Java Card存储空间的系统和方法
JP2008134777A (ja) ファイル割当テーブルのキャッシュ方法
JP2005339450A (ja) フラッシュメモリのデータ管理方式
CN109753240B (zh) 一种采用垃圾回收机制的数据存储方法
JP2003316659A (ja) Icカードに搭載されたフラッシュメモリの管理方法及びシステム
JP2001318824A (ja) フラッシュメモリのデータ管理方式およびそのプログラムを記録した記録媒体
CN117742582A (zh) 一种高效率垃圾回收方法及存储装置
CN113835622A (zh) 存储装置的处理方法、主机装置、存储装置及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21940366

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE