CN102005245A - Intelligent card erasing and writing protection method - Google Patents
Intelligent card erasing and writing protection method Download PDFInfo
- Publication number
- CN102005245A CN102005245A CN201010566258XA CN201010566258A CN102005245A CN 102005245 A CN102005245 A CN 102005245A CN 201010566258X A CN201010566258X A CN 201010566258XA CN 201010566258 A CN201010566258 A CN 201010566258A CN 102005245 A CN102005245 A CN 102005245A
- Authority
- CN
- China
- Prior art keywords
- backup
- block
- erasable
- smart card
- sign
- 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.)
- Granted
Links
Abstract
The invention aims at disclosing an intelligent card erasing and writing protection method. When an intelligent card begins the erasing and writing operation, a data located block is backed up to a backup region before target address data is modified. Meanwhile, because the backup region is frequently erased and written and is easy to damage, the address of the damaged backup region is allowed to be changed; a backup mark of the backup region singly occupies one block, new addresses are sequentially written in the block during the updating in each time, the block erasing operation can be executed after the block is full, and then, the new addresses are written in from the beginning, so the modification time of the backup mark can be saved, and the goal of the intelligent card erasing and writing protection can be realized.
Description
Technical field
The present invention relates to a kind of erasable guard method, the particularly erasable guard method of a kind of smart card of field of intelligent cards.
Background technology
At present, the smart card of domestic use, along with the continuous expansion of application item function and the quickening of the pace of product renewal, traditional (such as ROM etc.) CPU smart card is replaced by new-type Flash fast flash memory bank CPU smart card gradually.
And the Flash storer often need carry out the erasable operation of data, generally is to wipe legacy data earlier, writes new data again; But, in erasable process, will face powered-off fault, cause the unusual of data.
In sum,, need the erasable guard method of a kind of smart card especially, solve the problem of the erasable power down protection of smart card Flash at the defective of prior art.
Summary of the invention
The object of the present invention is to provide the erasable guard method of a kind of smart card, at the defective of above-mentioned prior art, the system that makes loses in accident under the situation of power supply, can guarantee the determinacy of system running state and the integrality of record data; Behind system's service restoration, field data can in time be recovered, and avoids the application system confusion reigned.
Technical problem solved by the invention can realize by the following technical solutions:
The erasable guard method of a kind of smart card is characterized in that it comprises the steps:
When 1) smart card begins erasable operation, check the global variable sign, check whether power down and judge data block and backup area whether normal;
2) if this global variable sign is effective, then reads the object block content and copy in the backup block the erasable operation of beginning backup block;
3) if this global variable sign is invalid, then read the backup block sequence number to the global variable sign, read the object block content and copy in this backup block the erasable operation of beginning backup block;
4) if this backup block is erasable to be backed up successfully, then calculate object block number, new backup sign is set, begin then object block is carried out data erase and write operation;
5) reset backup sign is finished erasable protection operation;
6) if the erasable backup failure of this backup block then upgrades backup block number, re-start the erasable operation of backup beginning backup block.
In one embodiment of the invention, backup area backup sign retouching operation comprises the steps:
When 1) carrying out the erasable operation of backup mark block of backup block, check earlier global variable, determine whether 0;
2) if global variable is judged as 0, represent that then this piece is fully written, begin to wipe sign place piece, write the backup sign to the global variable place, its value divides exactly block size value for (global variable+4), revises the backup sign and finishes;
3) if it is not 0 that global variable is judged, then directly write the backup sign to the global variable place, its value divides exactly block size value for (global variable+4), revises the backup sign and finishes.
In one embodiment of the invention, before smart card carries out data backup, check that the backup area backup indicates.
In one embodiment of the invention, smart card carry out the data backup piece erasable before, check the backup block remaining space.
In one embodiment of the invention, smart card carries out the data backup piece when erasable, upgrades backup block number.
In one embodiment of the invention, smart card carries out the data backup piece when erasable, allows change backup area address after damaging.
In one embodiment of the invention, when smart card carries out the data backup block operations, only have and after the backup mark block is write completely, just carry out the erasable operation of backup mark block.
The erasable guard method of smart card of the present invention when smart card begins erasable operation, before the modifying target address date, backups to this data place piece in the backup area; Simultaneously, because backup area often by erasable, damages easily, allow change backup area address after damaging; The backup of backup area sign takies separately a piece, and the new address in the write-in block successively when at every turn upgrading only has to write when this piece and just carries out this piece erase operation after full, from the beginning writes again, can save like this time that the backup sign is revised, and realizes purpose of the present invention.
Characteristics of the present invention can be consulted the detailed description of the graphic and following better embodiment of this case and be obtained to be well understood to.
Description of drawings
Fig. 1 is the FB(flow block) of the erasable guard method of smart card of the present invention;
Fig. 2 is the process principle figure that backup area backup of the present invention indicates retouching operation.
Embodiment
For technological means, creation characteristic that the present invention is realized, reach purpose and effect is easy to understand, below in conjunction with concrete diagram, further set forth the present invention.
As shown in Figure 1, the erasable guard method of smart card of the present invention, it comprises the steps:
When 1) smart card begins erasable operation, check global variable sign blk_seq, check whether power down and judge data block and backup area whether normal;
2) if this global variable sign blk_seq is effective, then reads the object block content and copy in the backup block the erasable operation of beginning backup block;
3) if this global variable sign blk_seq is invalid, then read the backup block sequence number to global variable sign blk_seq, read the object block content and copy in this backup block the erasable operation of beginning backup block;
4) if this backup block is erasable to be backed up successfully, then calculate object block number, new backup sign is set, begin then object block is carried out data erase and write operation;
5) reset backup sign is finished erasable protection operation;
6) if the erasable backup failure of this backup block then upgrades backup block number, re-start the erasable operation of backup beginning backup block.
In the present invention, before smart card carries out data backup, check that the backup area backup indicates.
In the present invention, smart card carry out the data backup piece erasable before, check the backup block remaining space.
In the present invention, smart card carries out the data backup piece when erasable, upgrades backup block number.
In the present invention, smart card carries out the data backup piece when erasable, allows change backup area address after damaging.
In the present invention, when smart card carries out the data backup block operations, only have and after the backup mark block is write completely, just carry out the erasable operation of backup mark block.
For the operation of backup area backup block, particularly backup is indicated the erasable operating process of piece, because backup area often by erasable, damages easily, damage the back and allow change backup area address; Backup sign (4 byte) takies a piece separately, and the new address in the write-in block successively when at every turn upgrading has only to write when this piece and just carries out this piece erase operation after full, from the beginning writes again, can save the time that the backup sign is revised like this.
As shown in Figure 2, in the present invention, the backup area backup indicates retouching operation and comprises the steps:
When 1) carrying out the erasable operation of backup mark block of backup block, check earlier global variable flag_offset, determine whether 0;
2) if global variable flag_offset is judged as 0, represent that then this piece has been write completely, begin to wipe sign place piece, write the backup sign to global variable flag_offset place, its value divides exactly block size value (blksize) for (global variable flag_offset+4), revises the backup sign and finishes;
3) if it is not 0 that global variable flag_offset judges, then directly write the backup sign to global variable flag_offset place, its value divides exactly block size value (blksize) for (global variable flag_offset+4), revises the backup sign and finishes.
More than show and described ultimate principle of the present invention and principal character and advantage of the present invention.The technician of the industry should understand; the present invention is not restricted to the described embodiments; that describes in the foregoing description and the instructions just illustrates principle of the present invention; without departing from the spirit and scope of the present invention; the present invention also has various changes and modifications; these changes and improvements all fall in the claimed scope of the invention, and the claimed scope of the present invention is defined by appending claims and equivalent thereof.
Claims (7)
1. the erasable guard method of smart card is characterized in that it comprises the steps:
When 1) smart card begins erasable operation, check the global variable sign, check whether power down and judge data block and backup area whether normal;
2) if this global variable sign is effective, then reads the object block content and copy in the backup block the erasable operation of beginning backup block;
3) if this global variable sign is invalid, then read the backup block sequence number to the global variable sign, read the object block content and copy in this backup block the erasable operation of beginning backup block;
4) if this backup block is erasable to be backed up successfully, then calculate object block number, new backup sign is set, begin then object block is carried out data erase and write operation;
5) reset backup sign is finished erasable protection operation;
6) if the erasable backup failure of this backup block then upgrades backup block number, re-start the erasable operation of backup beginning backup block.
2. the erasable guard method of smart card as claimed in claim 1 is characterized in that, the backup area backup indicates retouching operation and comprises the steps:
When 1) carrying out the erasable operation of backup mark block of backup block, check earlier global variable, determine whether 0;
2) if global variable is judged as 0, represent that then this piece is fully written, begin to wipe sign place piece, write the backup sign to the global variable place, its value divides exactly block size value for (global variable+4), revises the backup sign and finishes;
3) if it is not 0 that global variable is judged, then directly write the backup sign to the global variable place, its value divides exactly block size value for (global variable+4), revises the backup sign and finishes.
3. the erasable guard method of smart card as claimed in claim 1 is characterized in that, before smart card carries out data backup, checks that the backup area backup indicates.
4. the erasable guard method of smart card as claimed in claim 1 is characterized in that, smart card carry out the data backup piece erasable before, check the backup block remaining space.
5. the erasable guard method of smart card as claimed in claim 1 is characterized in that, smart card carries out the data backup piece when erasable, upgrades backup block number.
6. the erasable guard method of smart card as claimed in claim 1 is characterized in that, smart card carries out the data backup piece when erasable, damages the back and allows change backup area address.
7. the erasable guard method of smart card as claimed in claim 1 is characterized in that, when smart card carries out the data backup block operations, only has and just carry out the erasable operation of backup mark block after the backup mark block is write completely.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010566258.XA CN102005245B (en) | 2010-11-30 | 2010-11-30 | Intelligent card erasing and writing protection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201010566258.XA CN102005245B (en) | 2010-11-30 | 2010-11-30 | Intelligent card erasing and writing protection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102005245A true CN102005245A (en) | 2011-04-06 |
CN102005245B CN102005245B (en) | 2015-07-22 |
Family
ID=43812522
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201010566258.XA Active CN102005245B (en) | 2010-11-30 | 2010-11-30 | Intelligent card erasing and writing protection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102005245B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103699344A (en) * | 2013-11-05 | 2014-04-02 | 威盛电子股份有限公司 | Nonvolatile memory device and method of operating the same |
CN103744746A (en) * | 2013-12-30 | 2014-04-23 | 北京工业大学 | Index-based smart card record backup and recovery method |
CN104778133A (en) * | 2014-01-09 | 2015-07-15 | 苏州融卡智能科技有限公司 | Method for prolonging service life of electrically erasable programmable read only memory (EEPROM) of smart card |
CN106445851A (en) * | 2016-08-26 | 2017-02-22 | 北京中电华大电子设计有限责任公司 | Method for improving interface response capability of Flash NFC-SIM smart card |
CN112131040A (en) * | 2020-09-30 | 2020-12-25 | 郑州信大捷安信息技术股份有限公司 | Wear balance management method and system for power-down backup area of smart card |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101226604A (en) * | 2007-01-19 | 2008-07-23 | 东信和平智能卡股份有限公司 | Smart card and data write-in method |
CN101382918A (en) * | 2008-07-26 | 2009-03-11 | 深圳市硅格半导体有限公司 | NAND flash memory optimizing and managing method based on data interchange zone |
CN101876927A (en) * | 2009-11-30 | 2010-11-03 | 北京握奇数据系统有限公司 | Power-off protection method for realizing FAT32 file system, and device thereof |
-
2010
- 2010-11-30 CN CN201010566258.XA patent/CN102005245B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101226604A (en) * | 2007-01-19 | 2008-07-23 | 东信和平智能卡股份有限公司 | Smart card and data write-in method |
CN101382918A (en) * | 2008-07-26 | 2009-03-11 | 深圳市硅格半导体有限公司 | NAND flash memory optimizing and managing method based on data interchange zone |
CN101876927A (en) * | 2009-11-30 | 2010-11-03 | 北京握奇数据系统有限公司 | Power-off protection method for realizing FAT32 file system, and device thereof |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103699344A (en) * | 2013-11-05 | 2014-04-02 | 威盛电子股份有限公司 | Nonvolatile memory device and method of operating the same |
CN103699344B (en) * | 2013-11-05 | 2016-08-17 | 威盛电子股份有限公司 | Nonvolatile memory device and method of operating the same |
CN103744746A (en) * | 2013-12-30 | 2014-04-23 | 北京工业大学 | Index-based smart card record backup and recovery method |
CN103744746B (en) * | 2013-12-30 | 2016-08-03 | 北京工业大学 | A kind of intelligent card records backup based on index and restoration methods |
CN104778133A (en) * | 2014-01-09 | 2015-07-15 | 苏州融卡智能科技有限公司 | Method for prolonging service life of electrically erasable programmable read only memory (EEPROM) of smart card |
CN104778133B (en) * | 2014-01-09 | 2017-09-22 | 苏州融卡智能科技有限公司 | Increase the method in smart card programmable read only memory life-span |
CN106445851A (en) * | 2016-08-26 | 2017-02-22 | 北京中电华大电子设计有限责任公司 | Method for improving interface response capability of Flash NFC-SIM smart card |
CN112131040A (en) * | 2020-09-30 | 2020-12-25 | 郑州信大捷安信息技术股份有限公司 | Wear balance management method and system for power-down backup area of smart card |
CN112131040B (en) * | 2020-09-30 | 2022-02-11 | 郑州信大捷安信息技术股份有限公司 | Wear balance management method and system for power-down backup area of smart card |
Also Published As
Publication number | Publication date |
---|---|
CN102005245B (en) | 2015-07-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106095620B (en) | A kind of development approach of built-in Linux partition holding | |
EP2115595B1 (en) | Memory device performance enhancement through pre-erase mechanism | |
US9645894B2 (en) | Data storage device and flash memory control method | |
US20100122015A1 (en) | Software adapted wear leveling | |
CN102081577A (en) | Data storage structure of Flash memory and data manipulation mode thereof | |
CN103678144B (en) | Data storage device and flash memory control method | |
CN103164342B (en) | Coordinate during the carry of availability of data | |
CN103995784B (en) | Flash memory controller, storage device and flash memory control method | |
CN106776362B (en) | The control method and device of memory | |
CN102005245B (en) | Intelligent card erasing and writing protection method | |
CN103914407B (en) | A kind of SD card power down protection, restoration methods and the SD card with power down protection | |
CN100511166C (en) | High-speed storage device and method for high-speed updating data | |
CN109933545A (en) | The data processing method of data memory device and memory device | |
CN102004706B (en) | Flash erasing power-fail protection method based on FTL(Flash Translation Layer) | |
CN1936853B (en) | Data cut-off protection and repairing method of inlaid apparatus | |
CN101216789A (en) | Data update method, device and system | |
CN101699476B (en) | Data processing method and device of smart cards | |
CN103996412A (en) | Power-fail protection method applied to intelligent-card nonvolatile memories | |
CN101901189A (en) | Data updating and recovering methods for a non-volatile memory array | |
CN104765569A (en) | Data write-in method, memory control circuit unit and memory storing device | |
CN102662688B (en) | A kind of Nor flash update method and device | |
JP2009205689A (en) | Flash disk device | |
CN103425549A (en) | Firmware managing method and system of embedded controller | |
CN102789404A (en) | Method for storing anti-dropping data during updating of integrated circuit (IC) card data | |
CN101526922B (en) | Flash data access method and device thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |