CN109685190A - A kind of IC card power-off protection method and device - Google Patents

A kind of IC card power-off protection method and device Download PDF

Info

Publication number
CN109685190A
CN109685190A CN201811621864.XA CN201811621864A CN109685190A CN 109685190 A CN109685190 A CN 109685190A CN 201811621864 A CN201811621864 A CN 201811621864A CN 109685190 A CN109685190 A CN 109685190A
Authority
CN
China
Prior art keywords
data
storage address
microprocessor
backup
page
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
Application number
CN201811621864.XA
Other languages
Chinese (zh)
Other versions
CN109685190B (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.)
Jiangsu Hengbao Intelligent System Technology Co Ltd
Original Assignee
Jiangsu Hengbao Intelligent System Technology 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 Jiangsu Hengbao Intelligent System Technology Co Ltd filed Critical Jiangsu Hengbao Intelligent System Technology Co Ltd
Priority to CN201811621864.XA priority Critical patent/CN109685190B/en
Publication of CN109685190A publication Critical patent/CN109685190A/en
Application granted granted Critical
Publication of CN109685190B publication Critical patent/CN109685190B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/067Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components
    • G06K19/07Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips
    • G06K19/073Special arrangements for circuits, e.g. for protecting identification code in memory
    • G06K19/07309Means for preventing undesired reading or writing from or onto record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/067Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components
    • G06K19/07Record carriers with conductive marks, printed circuits or semiconductor circuit elements, e.g. credit or identity cards also with resonating or responding marks without active components with integrated circuit chips
    • G06K19/077Constructional details, e.g. mounting of circuits in the carrier

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

This application provides a kind of IC card power-off protection method and devices, wherein this method is applied to the microprocessor in IC card;This method comprises: obtaining the corresponding multiple storage address of Data Identification in service request after the service request for receiving terminal device transmission;The corresponding initial data of multiple storage address is read from the data field of memory;Storage address to be processed is selected from multiple storage address, and the page info of memory page where storage address to be processed is written to the area the backup area Zhong Fangba;If microprocessor power down when responding the corresponding initial data of any storage address to be processed, after microprocessor re-powers, microprocessor covers the page info of memory page where the initial data in the data field based on the corresponding page info of the initial data in the area Fang Ba.The embodiment of the present application achievees the effect that prevent loss of data at no point in the update process by dividing the area Fang Ba in the memory of IC card.

Description

A kind of IC card power-off protection method and device
Technical field
This application involves integrated circuit card technology fields, in particular to a kind of IC card power-off protection method and device.
Background technique
IC card is a kind of card using chip as medium.Chip card capacity is big, can store key, digital certificate and refers to The much informations such as line, working principle is similar to microcomputer, and can handle multiple functions simultaneously, provides one for holder The multi-purpose convenience of card.
IC card most basic at present is Contact Type Ic Card, is actually IC chip, general structure includes non-volatile Property memory, relay protective scheme circuit and microprocessor CPU.The memory of IC card is divided into EEPROM, ROM and Flash, more next at present More IC card chips selects Flash as storage medium (also referred to as flash memory), because flash storage is not connecting electricity In the case of be capable of the information of long-term preservation storage, the characteristics of flash storage existing ROM (read-only memory), and have very high Storage speed, and be easy to wipe and rewrite, the lesser feature of power consumption;Flash storage compared with EEPROM, it is at low cost and Density is big.
Although flash storage is with the problem of lot of advantages, there are still erasable power down in the process.Work as needs When being updated to the data of flash storage target area, needs first to wipe the data in target area and write afterwards, since Flash is deposited The minimum unit of reservoir erasing is one page, will lead to the loss of whole page data if the power down in above-mentioned renewal process, Therefore at no point in the update process, other than protecting the several bytes to be updated, it is also necessary to be protected to whole page.So to Flash The anti-lost electric protection of memory is particularly important.
Apply for content
In view of this, embodiments herein is to provide a kind of IC card power-off protection method and device, to reduce IC card The probability that power down causes whole page data to lose in use process.
In a first aspect, the embodiment of the present application provides a kind of IC card power-off protection method, wherein applied to micro- in IC card Processor, the IC card further include the memory connecting with the microprocessor, and the memory includes data field and backup area; The described method includes:
After the service request for receiving terminal device transmission, the Data Identification obtained in the service request is corresponding more A storage address;The corresponding initial data of the multiple storage address is read from the data field of the memory;
Select storage address to be processed from multiple storage address, and by memory page where the storage address to be processed Page info be written to the area the backup area Zhong Fangba;The page info includes page data;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info.
With reference to first aspect, the embodiment of the present application provides the first possible embodiment of first aspect, wherein institute It states after reading the corresponding initial data of the multiple storage address in the data field of the memory, the method is also wrapped It includes:
By each storage address and the corresponding initial data of each storage address, and, each described initial data The storage address of corresponding original associated data and the original associated data is written to the backup stack of the backup area;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info after, the method also includes:
The corresponding original associated data of the initial data and the original incidence number are obtained from the backup stack of the backup area According to corresponding storage address;
The corresponding current pass of the storage address obtained in the data field is covered using the original associated data of acquisition Join data.
With reference to first aspect, the embodiment of the present application provides second of possible embodiment of first aspect, wherein institute It states and selects storage address to be processed from multiple storage address, and by the page of memory page where the storage address to be processed Information is written to after the area the backup area Zhong Fangba, further includes:
Page info for memory page where the storage address to be processed of the area Fang Ba storage is provided with criterion Know;
When microprocessor non-power down when responding the corresponding initial data of the storage address to be processed, then anti-pulled out to be described Failure indication is arranged in the page info of memory page where the storage address to be processed of area's storage.
The possible embodiment of second with reference to first aspect, the embodiment of the present application provide the third of first aspect Possible embodiment, wherein if microprocessor power down when responding the corresponding initial data of any storage address to be processed, when After the microprocessor re-powers, the method also includes:
The microprocessor detects the page letter at storage address place to be processed memory page described in the area Fang Ba When ceasing no-failure mark, detect the page info it is corresponding effectively identify whether it is complete, when the microprocessor detects institute State page info it is corresponding it is effective mark it is complete when, the microprocessor be based on the area Fang Ba in the corresponding page of the initial data Face information covers the page info of memory page where the initial data in the data field.
The possible embodiment of with reference to first aspect the first, the embodiment of the present application provide the 4th kind of first aspect Possible embodiment, wherein by each storage address and the corresponding initial data of each storage address, and, each The storage address of the corresponding original associated data of initial data and the original associated data is written to the backup area Backup stack, which comprises
Each storage address and the corresponding initial data of each storage address are written to the backup of the backup area In stack;
The microprocessor be the backup stack in each storage address and each storage address it is corresponding original Data distribute the first checking mark, generate the first duplicated record, and store first checking mark;
The storage address of each corresponding original associated data of target data and the original associated data is write Enter into the backup stack of the backup area;
The microprocessor is that the corresponding original associated data of each initial data is original with this in the backup stack The second checking mark of allocations of storage addresses of associated data generates the second duplicated record, and stores second checking mark.
The 4th kind of possible embodiment with reference to first aspect, the embodiment of the present application provide the 5th kind of first aspect Possible embodiment, wherein if microprocessor power down when responding the corresponding initial data of any storage address to be processed, when After the microprocessor re-powers, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers It covers in the data field after the page info of memory page where the initial data, the method also includes:
The microprocessor verifies first checking mark in first duplicated record, when verification passes through Afterwards, the microprocessor verifies second checking mark in second duplicated record;
After verification passes through, corresponding second duplicated record of initial data is obtained from the backup stack of the backup area In original associated data and the corresponding storage address of the original associated data;
The corresponding current pass of the storage address obtained in the data field is covered using the original associated data of acquisition Join data;
From depositing for the initial data and initial data obtained in the backup stack of the backup area in first duplicated record Store up address;
The corresponding current data of the storage address obtained in the data field is covered using the initial data of acquisition.
The possible embodiment of with reference to first aspect the first, the embodiment of the present application provide the 6th kind of first aspect Possible embodiment, wherein the backup stack of the backup area includes multiple backup blocks, the method also includes:
A target is selected in the multiple backup block originates memory block;
The microprocessor by currently pending storage address and the corresponding initial data of currently pending storage address, with And the storage address of the corresponding original associated data of the initial data and the original associated data is written to the target and rises Beginning memory block;
When monitoring that the access times of target starting memory block reach preset threshold value, according to preset sequence, It is that next target originates memory block that the backup block in addition to the target originates memory block is selected from the multiple backup block.
6th kind of possible embodiment with reference to first aspect, the embodiment of the present application provide first aspect the 7th kind can The embodiment of energy, wherein it is next that the backup block in addition to the target originates memory block is selected from the multiple backup block After a target starting memory block, the method also includes:
When the microprocessor monitors into the backup stack without optional backup block after, again in the multiple backup block In select target and originate memory block, repeat currently pending storage address and the corresponding original of currently pending storage address Beginning data, and, the storage address of the corresponding original associated data of initial data and the original associated data is written to The process of the target starting memory block, until the access times of the backup stack reach preset threshold value.
6th kind of possible embodiment with reference to first aspect, the embodiment of the present application provide first aspect the 8th kind can The embodiment of energy, wherein the method also includes:
If monitoring the multiple backup block not in the memory range of the backup stack, the target for resetting backup block is risen Beginning backup block, so that the multiple backup block is all in the memory range of the backup stack.
Second aspect, the embodiment of the present application also provides a kind of IC card power-down protection apparatus, wherein described device includes micro- Processor, the memory connecting with the microprocessor, the memory further include data field and backup area;
The microprocessor, for obtaining in the service request after the service request for receiving terminal device transmission The corresponding multiple storage address of Data Identification;It is corresponding that the multiple storage address is read from the data field of the memory Initial data;Select storage address to be processed from multiple storage address, and by memory page where the storage address to be processed The page info in face is written to the area the backup area Zhong Fangba;The page info includes page data;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info.
A kind of IC card power-off protection method and device provided by the embodiments of the present application divide anti-pull out in the memory of IC card Area, when power down during IC card use, after re-powering, current operation is restored in the microprocessor control area Fang Ba in IC card All data of memory page where data solve the memory page where current operation data when IC card power down in the prior art The problem of loss of the whole page data in face, achieve the effect that prevent loss of data at no point in the update process.
Further, a kind of IC card power-off protection method and device provided in an embodiment of the present invention, also in the memory of IC card Middle division backup stack, when power down during IC card use, after re-powering, the microprocessor control backup stack in IC card is extensive Multiple data associated with current operation data achieve the effect that keep data to update self-consistent property at no point in the update process.
To enable the above objects, features, and advantages of the application to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
Technical solution in ord to more clearly illustrate embodiments of the present application, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only some embodiments of the application, therefore is not construed as pair The restriction of range for those of ordinary skill in the art without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 shows a kind of flow diagram of IC card power-off protection method provided by the embodiment of the present application;
Fig. 2 shows the flow diagrams of another kind IC card power-off protection method provided by the embodiment of the present application;
Fig. 3 shows the flow diagram of another kind IC card power-off protection method provided by the embodiment of the present application;
Fig. 4 shows a kind of structural schematic diagram of IC card power-down protection apparatus provided by the embodiment of the present application.
Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application Middle attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is only It is some embodiments of the present application, instead of all the embodiments.The application being usually described and illustrated herein in the accompanying drawings is real The component for applying example can be arranged and be designed with a variety of different configurations.Therefore, below to the application's provided in the accompanying drawings The detailed description of embodiment is not intended to limit claimed scope of the present application, but is merely representative of the selected reality of the application Apply example.Based on embodiments herein, those skilled in the art institute obtained without making creative work There are other embodiments, shall fall in the protection scope of this application.
Fig. 1 is a kind of flow diagram of IC card power-off protection method provided by the embodiments of the present application, as shown in Figure 1, institute Method is stated applied to the microprocessor in IC card, the IC card further includes the memory connecting with the microprocessor, described to deposit Reservoir includes data field and backup area;The described method includes:
S101, receive terminal device transmission service request after, obtain the Data Identification pair in the service request The multiple storage address answered;The corresponding initial data of the multiple storage address is read from the data field of the memory;
Above-mentioned IC card can be divided into contact and contactless card (supporting contact and non-contact two kinds of operation modes), contact Formula card (only contact being supported to operate with) and contactless card (only supporting Touchless manipulation use).
The structure of above-mentioned IC card generally comprises: microprocessor, the memory being connected with microprocessor and relay protective scheme circuit. Above-mentioned memory is flash storage (i.e. flash memory).By taking financial IC card as an example: memory includes data field and backup Area, for storing the data information of IC card;It includes user information (user's surname in data field that the data information, which is typically stored at, Name, the ID card No. of user's phone number and user), amount information and transaction journal information etc..Above-mentioned backup area includes standby The area part Zhan Hefangba, for storing the primary data information (pdi) of currently processed data to back up to currently processed information.
Above-mentioned terminal device is to respond the equipment of above-mentioned IC card (such as: above-mentioned IC card is financial IC card, then above-mentioned terminal device For self-service withdrawal machine ATM).
Above-mentioned service request is user's input with the corresponding request for executing operation, for requesting the content in IC card And IC card is made to complete corresponding operation.It include the Data Identification that user wants the data of operation in above-mentioned service request;Above-mentioned number According to mark for distinguishing data different in a service request.
Such as: above-mentioned IC card is financial IC card, and IC card is inserted into ATM by user, and ATM reads the information of the IC card, and Input password instruction is shown on interface, user is prompted to input the password of this IC card, and after user inputs password, ATM will be read The password stored in the IC card memory got is compared with the password that the user of acquisition inputs, and after comparing consistent, ATM is aobvious Show and carries out the interface of next step operation (operation interface here generally comprises: depositing, withdraws the money, transfers accounts and move back the corresponding behaviour such as card Elect key), after user presses " withdrawal " key, withdrawal amount is inputted, above-mentioned withdrawal service request is sent to IC by AIM Card (includes: that user wants that the amount of money of withdrawal operation is thought in the withdrawal operation carried out to IC card, user in withdrawal service request here And complete above-mentioned withdrawal and operate some bottom datas being related to), the microprocessor of IC card is according to above-mentioned withdrawal service request Data Identification (Data Identification here is used to distinguish to withdraw the money and operation, amount information and completes above-mentioned withdrawal and operate to be related to Some bottom datas) corresponding multiple storage address, obtain the corresponding initial data in the multiple storage address in IC card data field.
S103, storage address to be processed is selected from multiple storage address, and will deposit where the storage address to be processed The page info of the storage page is written to the area the backup area Zhong Fangba;The page info includes page data;
Above-mentioned multiple storage address are to reach the storage address for all data that the operation that user wants to realize is related to.Example Such as: user want to IC card withdraw the money, to realize withdraw the money operation, then can be related to amount information, transaction journal record information with And some bottom datas.
Above-mentioned storage address to be processed is the storage address where current data to be processed.Such as: if realizing above-mentioned use The operation that family withdraws the money to IC card then needs to handle the data in withdrawal service request one by one, current time data institute to be treated Storage address be then storage address to be processed.
Since the flash storage erasing of IC card is whole page, so needing the storage address to be processed is corresponding The page info of whole page is written in the area Fang Ba of backup area, and above-mentioned page info generally comprises the ground of the data of whole page, this page Location, effective marker and check byte and failure mark and check byte.
Such as: during user operates financial IC card, needed after IC card receives withdrawal service request It first modifies to corresponding value data, since the minimum unit of IC card flash storage erasing is one page, so to IC Card is written before modified value data, first according to the storage address of the value data of current operation by the amount of money of current operation In the area Fang Ba for the flash storage that the whole page data of the page where the storage address of data is stored in IC card, then IC card Microprocessor wipes the page where value data in data field, and modified value data is being written.
If S104, the microprocessor power down when responding any storage address to be processed corresponding initial data, when described micro- After processor re-powers, the microprocessor is based on described in the corresponding page info covering of the initial data in the area Fang Ba The page info of memory page where the initial data in data field.
Above-mentioned power down refers generally to IC card internal circuit and is not turned on, and the microprocessor of IC card is in inoperable state.
Above-mentioned re-power refers generally to the connection of IC card internal circuit, and the microprocessor of IC card is in running order.
Such as: during user carries out withdrawal operation to the financial IC card being inserted in ATM, at this time when IC card receives It needs first to modify to corresponding value data after withdrawal service request, since the minimum of IC card flash storage erasing is single Member is one page, so before modified value data is written to IC card, first according to the storage of the value data of current operation The whole page data of the page where the storage address of the value data of current operation is stored in the flash storage of IC card by address In the area Fang Ba, then the microprocessor of IC card wipes the page where value data in data field, after write-in modification Value data, during write-in, in no completion write operation, user just extracts financial IC card, at this time IC Card power down, when user is again insertable into IC card, the microprocessor of IC card can read the amount of money of the current operation stored in the area Fang Ba The original whole page data of the page where the storage address of data, and original whole page data is re-write to data field current erasure The page in.
A kind of IC card power-off protection method provided by the embodiments of the present application is divided anti-by the flash storage to IC card The mode for pulling out area, in the process that user operates IC card, IC card microprocessor can be first by the page where the data of current operation Whole page primary data information (pdi) is written to the area Fang Ba, then carries out whole page erasing in the data to current operation, and after modification is written Data, if IC card it is above-mentioned to current operation data update during power down, by the area Fang Ba save current operation The mode of the whole page initial data of the page where data, so that the whole page for restoring to be wiped free of page is original after IC card re-powers Data avoid and are carrying out the loss that data update whole page data in operating process to IC card.
Further, the IC card power-off protection method provided in the embodiment of the present application, the data from the memory After reading the corresponding initial data of the multiple storage address in area, the method also includes:
S102, by each storage address and the corresponding initial data of each storage address, and, each is described original The storage address of the corresponding original associated data of data and the original associated data is written to the backup stack of the backup area;
Above-mentioned original associated data is that the corresponding related data updated is needed during operating initial data.Update The data for needing to be related to during initial data, original associated data herein are 0, one or more.
Such as: user carries out withdrawal operation to IC card, and above-mentioned withdrawal service request is sent to IC card (here by AIM It include: that user wants that the withdrawal operation carried out to IC card, user are wanted to withdraw the money in the amount of money operated and completion in withdrawal service request State some bottom datas that operation of withdrawing the money is related to), by the storage address of multiple data in withdrawal service request and storage ground Initial data in location and the original related data in the storage address and storage address of the relevant data of each initial data (as: by the storage address and storage address of value data original amount data, to the relevant data of modification value data Original related data in storage address and storage address) it is written in the standby stack of backup area, so that in IC card operating process After power down re-powers, it is maintained at the consistency for all data being related in withdrawal operating process.
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info after, the method also includes:
S105, the corresponding original associated data of the initial data and the original pass are obtained from the backup stack of the backup area Join the corresponding storage address of data;
After when microprocessor, when responding any storage address to be processed corresponding initial data, power down is re-powered, IC card Microprocessor first according to the area Fang Ba storage storage address to be processed where interface whole page initial data recovery be wiped free of Storage address to be processed where the page, initial data is then corresponded to according to the storage address to be processed stored in backup stack and is obtained Take the original associated data and the corresponding storage address of the original associated data of the initial data.
S106, cover that the storage address obtained in the data field is corresponding to be worked as using the original associated data of acquisition Preceding associated data.
Such as: during user carries out withdrawal operation to the financial IC card being inserted in ATM, will first withdraw the money service request In the storage address of multiple data and the initial data in storage address and the relevant data of each initial data storage Original related data in address and storage address is (such as: by the original amount in the storage address and storage address of value data Original related data in data, the storage address and storage address of data relevant to modification value data) it is written to backup In the standby stack in area, if modifying at this time to value data, needing first will according to the storage address of the value data of current operation The whole page data of the page is stored in the area Fang Ba of the flash storage of IC card where the storage address of the value data of current operation In, the microprocessor of IC card wipes the page where value data in data field, then modified value data is written, During write-in, in no completion write operation, user just extracts financial IC card, at this time IC card power down, when with When family is again insertable into IC card, the microprocessor of IC card is with can read the storage of the value data of the current operation stored in the area Fang Ba The original whole page data of the page where location, and original whole page data is re-write into the page of data field current erasure, so It is (i.e. golden according to the corresponding initial data of the storage address to be processed (storage address i.e. where value data) stored in backup stack afterwards Specified number evidence) obtain the initial data original associated data (be related to during modifying the amount of money others it is associated Data) and the corresponding storage address of the original associated data (others that are related to during modifying the amount of money are associated Data where storage address), storage where original associated data in data field is covered according to the original associated data of acquisition Current associated data in address so that IC is after renewal process power down re-powers, keep current more new data and with The consistency of current more new data associated data, if current more new data is updated value, with currently more new data phase Associated data are updated value, if current more new data be the value before update, and currently more new data is associated Data are the value before updating.
A kind of IC card power-off protection method provided by the embodiments of the present application is divided standby by the flash storage to IC card The mode of part stack, the related data that can first request corresponding operating in the process that user operate IC card, IC card microprocessor and Storage address where related data is written in backup stack, if IC card is during the above-mentioned update to current operation data After power down re-powers, the microprocessor of IC card covers original in data field according to the original associated data of the acquisition in backup stack Current associated data in storage address where associated data, thus keep current more new data and to currently more new data is related Join the consistency of data.
Further, as shown in Fig. 2, in a kind of IC card power-off protection method provided in the embodiment of the present application, it is described from Select storage address to be processed in multiple storage address, and by the page info of memory page where the storage address to be processed It is written to after the area the backup area Zhong Fangba, further comprising the steps of:
S201, it is provided with for the page info of memory page where the storage address to be processed of the area Fang Ba storage Criterion is known;
S202, when microprocessor non-power down when responding the corresponding initial data of the storage address to be processed, then be institute Failure indication is arranged in the page info of memory page where the storage address to be processed of the area Shu Fangba storage.
In conjunction with above-mentioned steps 201 and step 202, the area Fang Ba is used to protect the page where currently pending storage address. First the whole page data of the page to be updated is stored in the available page in one, the area Fang Ba, then corresponding anti-pulls out mark at this page Write effective mark in area.At this point, the protection work to the page where currently pending storage address is completed, can update to be processed Data in storage address after the renewal of the page where the storage address to be processed, are then write after effective mark of this page Upper failure indication indicates that this prevents that pulling out the page has completed task, and the anti-data information for pulling out the page is no longer valid.
Further, in a kind of IC card power-off protection method provided in the embodiment of the present application, if microprocessor is responding Power down when any storage address to be processed corresponding initial data, after the microprocessor re-powers, the method is also Include:
The microprocessor detects the page letter at storage address place to be processed memory page described in the area Fang Ba When ceasing no-failure mark, detect the page info it is corresponding effectively identify whether it is complete, when the microprocessor detects institute State page info it is corresponding it is effective mark it is complete when, the microprocessor be based on the area Fang Ba in the corresponding page of the initial data Face information covers the page info of memory page where the initial data in the data field.
The power down when IC card is in response storage address to be processed corresponding initial data, after IC card re-powers, micro- place Whether the page info that reason device detects storage address place to be processed memory page described in the area Fang Ba first has failure indication, when When no-failure identifies, then the page info of memory page has effectively identified whether where detecting the storage address to be processed It is whole, after detecting that above-mentioned effective mark is complete, then institute is covered based on the corresponding page info of the initial data in the area Fang Ba State the page info of memory page where the initial data in data field.
Further, in conjunction with above-mentioned steps 201 and step 202, the area Fang Ba is only used for ensuring storage address place to be processed The page currently updated integrality, and transaction Transaction process do not have direct relationship, if the storage to be processed The update of data then may insure the non-atomic integrality write not in transaction in target pages where location.And prevent pulling out The page is using that will fail after primary, therefore, anti-to pull out the page and may be reused.So the anti-number restriction for pulling out the page is spirit Living, it at least can be set one and prevent pulling out page identified page corresponding with its, but generally guarantee the service life in the area Fang Ba, meeting Corresponding more settings are some to be prevented pulling out the page.
Further, as shown in figure 3, a kind of IC card power-off protection method provided in the embodiment of the present application, by each Storage address and the corresponding initial data of each storage address, and, the corresponding original incidence number of each described initial data It is written to the backup stack of the backup area according to the storage address with the original associated data, the described method comprises the following steps:
S301, each storage address and the corresponding initial data of each storage address are written to the backup area In backup stack;
S302, the microprocessor be the backup stack in each storage address and each storage address it is corresponding Initial data distributes the first checking mark, generates the first duplicated record, and store first checking mark;
Above-mentioned first checking mark is cyclic redundancy check code CRC, for powering on recovery process verification the first backup note The accuracy of record.
S303, by the storage of each corresponding original associated data of target data and the original associated data Location is written in the backup stack of the backup area;
S304, the microprocessor be in the backup stack the corresponding original associated data of each initial data and this The second checking mark of allocations of storage addresses of original associated data generates the second duplicated record, and stores the second verification mark Know.
Above-mentioned second checking mark is cyclic redundancy check code CRC, for powering on recovery process verification the second backup note The accuracy of record.
Above-mentioned second duplicated record includes the corresponding original associated data of each initial data and the original incidence number According to storage address and be above-mentioned original associated data distribution the second checking mark, above-mentioned second duplicated record is 0 Item, 1 or a plurality of.
The duplicated record that the data composition of target area to be updated (i.e. data field) is stored in above-mentioned backup stack, wherein often Include in duplicated record storage address (storage address here can may be for the storage address of pending data with The storage address of the associated data of the pending data), (length here can also for the length of pending data for length Think the length with the pending data associated data), (initial data here can be pending data to initial data Can be and the pending data associated data) and check byte (check byte here is the first checking mark and second Checking mark).
Further, a kind of IC card power-off protection method provided in the embodiment of the present application, if microprocessor is appointed in response Power down when one storage address to be processed corresponding initial data, after the microprocessor re-powers, the microprocessor base The corresponding page info of the initial data covers memory page where the initial data in the data field in the area Fang Ba Page info after, the method also includes following steps:
The microprocessor verifies first checking mark in first duplicated record, when verification passes through Afterwards, the microprocessor verifies second checking mark in second duplicated record;
After verification passes through, corresponding second duplicated record of initial data is obtained from the backup stack of the backup area In original associated data and the corresponding storage address of the original associated data;
The corresponding current pass of the storage address obtained in the data field is covered using the original associated data of acquisition Join data;
From depositing for the initial data and initial data obtained in the backup stack of the backup area in first duplicated record Store up address;
The corresponding current data of the storage address obtained in the data field is covered using the initial data of acquisition.
Above-mentioned first duplicated record refer to the storage of backup stack be currently pending storage address, it is original in the storage address First duplicated record of data and checking mark composition;Above-mentioned second duplicated record, which refers to, is handling storage address Central Plains to be processed The original associated data of others, the storage address and checking mark of the original associated data being related to during beginning data, And second duplicated record be 0,1 or a plurality of.
Microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the micro process is thought highly of After newly powering on, microprocessor is according to the initial data institute in the corresponding page info covering of the initial data in the area Fang Ba data field After the page info of memory page, to the first duplicated record, (the first duplicated record here refers to microprocessor: to be processed to deposit Store up address, the initial data in the storage address, initial data length and the first checking mark) in the first checking mark carry out Verification, after verification passes through, (the second duplicated record here refers to: storage address to be processed corresponds to number to the second duplicated record According to original related data, the storage address of the original related data, the length of the original related data and the original dependency number According to the second checking mark) in the second checking mark verified.
After verification passes through, then above-mentioned second duplicated record is first obtained, and according to the original association in the second duplicated record The corresponding current associated data of the storage address obtained in data cover data field;Above-mentioned first duplicated record, and root are obtained again According to the corresponding current data of storage address obtained in the initial data covering data field in the first duplicated record;Above-mentioned recovery is standby Duplicated record in part stack by the way of successively being restored from back to front, to guarantee that Flash is stored under power-down conditions The integrality of device.
Further, the backup stack of the IC card power-off protection method provided in the embodiment of the present application, the backup area includes Multiple backup blocks, the method also includes following steps:
A target is selected in the multiple backup block originates memory block;
Above-mentioned backup stack is generally divided into multiple backup blocks, and a selected backup block is the standby of current operation data storage Part block (i.e. target starting memory block), and first generated from the data that the target originates storage BOB(beginning of block) storage current operation is standby Part record and the second duplicated record with current operation data correlation data.
The microprocessor by currently pending storage address and the corresponding initial data of currently pending storage address, with And the storage address of the corresponding original associated data of the initial data and the original associated data is written to the target and rises Beginning memory block;
When monitoring that the access times of target starting memory block reach preset threshold value, according to preset sequence, It is that next target originates memory block that the backup block in addition to the target originates memory block is selected from the multiple backup block.
Above-mentioned preset threshold value is the reference value of counter.
In the present embodiment, in order to make the recycling of entire backup stack, therefore can then it be incited somebody to action after transaction reaches certain number The currently used of backup stack also carries out rotation, general process are as follows: after the completion of update of entirely trading, user confirms according to homepage Prompt information carries out confirmation submission, and IC card microprocessor, which executes, submits process, can wipe the current of backup stack head pointer direction The target starting memory block used, and (the storage number at this is identified as by the storage number mark of target starting memory block 5, the end of transaction ID TID) plus 1, when the storage number mark for detecting target starting memory block has reached counter reference value (memory block is generally originated according to target herein, corresponding standard is set, for example check that the storage number of target starting memory block reaches To 32 times) when, then the backup block in addition to the target originates memory block is selected in multiple backup blocks as the starting of next target Memory block, to originate the transaction data of storage BOB(beginning of block) storage next time from the target.
Further, the IC card power-off protection method provided in the embodiment of the present application is selected from the multiple backup block After backup block in addition to the target originates memory block originates memory block for next target, the method also includes:
When the microprocessor monitors into the backup stack without optional backup block after, again in the multiple backup block In select target and originate memory block, repeat currently pending storage address and the corresponding original of currently pending storage address Beginning data, and, the storage address of the corresponding original associated data of initial data and the original associated data is written to The process of the target starting memory block, until the access times of the backup stack reach preset threshold value.
When microprocessor monitors into backup stack without optional backup block after (all backup blocks i.e. in backup stack are deposited Storage number reaches preset threshold, as: 32 times) if back within and select the starting of target in the multiple backup block and deposit The step of storing up block;And repetitive operation following steps: microprocessor is by currently pending storage address and currently pending storage The corresponding initial data in location, and, the storage of the corresponding original associated data of initial data and the original associated data Location is written to the target starting memory block;Reach preset threshold in the access times for monitoring the target starting memory block When value, according to preset sequence, under being from the backup block selected in the multiple backup block in addition to the target originates memory block One target originates memory block, (all backups i.e. in backup stack until in the backup stack without optional backup block The storage number of block is reached preset threshold, such as: 32 times);Access times until entirely backing up stack reach preset number Until.
Further, a kind of IC card power-off protection method provided in the embodiment of the present application, the method also includes:
If monitoring the multiple backup block not in the memory range of the backup stack, the target for resetting backup block is risen Beginning backup block, so that the multiple backup block is all in the memory range of the backup stack.
When microprocessor monitors to the multiple backup blocks divided are not within the scope of backup stack or there are non-homepage alignment etc. When problem, then need to reset the target starting backup block of above-mentioned backup block, so that the memory space of multiple backup blocks is equal In the memory range of backup stack.
Fig. 4 is a kind of structural schematic diagram of IC card power-down protection apparatus provided by the embodiments of the present application, and described device includes Microprocessor 401, the memory 402 connecting with the microprocessor, the memory further includes data field and backup area;
The microprocessor, for obtaining in the service request after the service request for receiving terminal device transmission The corresponding multiple storage address of Data Identification;It is corresponding that the multiple storage address is read from the data field of the memory Initial data;Select storage address to be processed from multiple storage address, and by memory page where the storage address to be processed The page info in face is written to the area the backup area Zhong Fangba;The page info includes page data.
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info.
A kind of IC card power-off protection method provided by the embodiments of the present application is divided anti-by the flash storage to IC card The mode for pulling out area, in the process that user operates IC card, IC card microprocessor can be first by the page where the data of current operation Whole page primary data information (pdi) is written to the area Fang Ba, then carries out whole page erasing in the data to current operation, and after modification is written Data, if IC card it is above-mentioned to current operation data update during power down, by the area Fang Ba save current operation The mode of the whole page initial data of the page where data, so that the whole page for restoring to be wiped free of page is original after IC card re-powers Data avoid and are carrying out the loss that data update whole page data in operating process to IC card.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: by each storage address and the corresponding initial data of each storage address, and, each described initial data is corresponding The storage address of original associated data and the original associated data is written to the backup stack of the backup area;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor After re-powering, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data field In memory page where the initial data page info after, the method also includes:
The microprocessor is also used to obtain the corresponding original association of the initial data from the backup stack of the backup area Data and the corresponding storage address of the original associated data;It is covered in the data field and is obtained using the original associated data of acquisition The corresponding current associated data of the storage address.
A kind of IC card power-off protection method provided by the embodiments of the present application is divided standby by the flash storage to IC card The mode of part stack, the related data that can first request corresponding operating in the process that user operate IC card, IC card microprocessor and Storage address where related data is written in backup stack, if IC card is during the above-mentioned update to current operation data After power down re-powers, the microprocessor of IC card covers original in data field according to the original associated data of the acquisition in backup stack Current associated data in storage address where associated data, thus keep current more new data and to currently more new data is related Join the consistency of data.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: the page info of memory page where the storage address to be processed of the area Fang Ba storage is provided with criterion knowledge;When Microprocessor non-power down when responding the corresponding initial data of the storage address to be processed, then be the institute of the area Fang Ba storage The page info setting failure indication of memory page where stating storage address to be processed.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: when detecting the page info no-failure mark at storage address place to be processed memory page described in the area Fang Ba, inspection It surveys that the page info is corresponding effectively to be identified whether complete, has when the microprocessor detects that the page info is corresponding When criterion knows complete, the microprocessor is based on the corresponding page info of the initial data in the area Fang Ba and covers the data The page info of memory page where the initial data in area.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: in the backup stack that each storage address and the corresponding initial data of each storage address are written to the backup area; For in the backup stack each storage address and the corresponding initial data of each storage address distribute the first checking mark, The first duplicated record is generated, and stores first checking mark;By the corresponding original association of each target data The storage address of data and the original associated data is written in the backup stack of the backup area;For each institute in the backup stack It states the second checking mark of allocations of storage addresses of the corresponding original associated data of initial data He the original associated data, generates the Two duplicated records, and store second checking mark.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In:
First checking mark in first duplicated record is verified, after verification passes through, micro- place Reason device verifies second checking mark in second duplicated record;
After verification passes through, corresponding second duplicated record of initial data is obtained from the backup stack of the backup area In original associated data and the corresponding storage address of the original associated data;
The corresponding current pass of the storage address obtained in the data field is covered using the original associated data of acquisition Join data;
From depositing for the initial data and initial data obtained in the backup stack of the backup area in first duplicated record Store up address;
The corresponding current data of the storage address obtained in the data field is covered using the initial data of acquisition.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the backup stack of the backup area Including multiple backup blocks, the microprocessor is also used to: being selected a target in the multiple backup block and is originated memory block; By currently pending storage address and the corresponding initial data of currently pending storage address, and, the initial data is corresponding Original associated data and the storage address of the original associated data be written to target starting memory block;Monitoring The access times of target starting memory block are stated when reaching preset threshold value, according to preset sequence, from the multiple backup block The selected backup block in addition to the target originates memory block is that next target originates memory block.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: after monitoring in the backup stack without optional backup block, a target is selected in the multiple backup block again and is risen Beginning memory block is repeated currently pending storage address and the corresponding initial data of currently pending storage address, and, it is described The storage address of the corresponding original associated data of initial data and the original associated data is written to the target starting storage The process of block, until the access times of the backup stack reach preset threshold value.
Further, a kind of IC card power-down protection apparatus provided in the embodiment of the present application, the microprocessor are also used In: if monitoring the multiple backup block not in the memory range of the backup stack, the target starting for resetting backup block is standby Part block, so that the multiple backup block is all in the memory range of the backup stack.
The computer program product of IC card power-off protection method is carried out provided by the embodiment of the present application, including stores journey The computer readable storage medium of sequence code, the instruction that said program code includes can be used for executing institute in previous methods embodiment The method stated, specific implementation can be found in embodiment of the method, and details are not described herein.
The device of IC card power down protection provided by the embodiment of the present application can be the specific hardware or installation in equipment In software or firmware etc. in equipment.The technical effect of device provided by the embodiment of the present application, realization principle and generation and Preceding method embodiment is identical, and to briefly describe, Installation practice part does not refer to place, can refer in preceding method embodiment Corresponding contents.It is apparent to those skilled in the art that for convenience and simplicity of description, foregoing description is The specific work process of system, device and unit, the corresponding process during reference can be made to the above method embodiment, it is no longer superfluous herein It states.
In embodiment provided herein, it should be understood that disclosed device and method, it can be by others side Formula is realized.The apparatus embodiments described above are merely exemplary, for example, the division of the unit, only one kind are patrolled Function division is collected, there may be another division manner in actual implementation, in another example, multiple units or components can combine or can To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual Coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some communication interfaces, device or unit It connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
In addition, each functional unit in embodiment provided by the present application can integrate in one processing unit, it can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantially in other words The part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meter Calculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be a People's computer, server or network equipment etc.) execute each embodiment the method for the application all or part of the steps. And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic or disk.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing, in addition, term " the One ", " second ", " third " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Finally, it should be noted that embodiment described above, the only specific embodiment of the application, to illustrate the application Technical solution, rather than its limitations, the protection scope of the application is not limited thereto, although with reference to the foregoing embodiments to this Shen It please be described in detail, those skilled in the art should understand that: anyone skilled in the art Within the technical scope of the present application, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of the embodiment of the present application technical solution.The protection in the application should all be covered Within the scope of.Therefore, the protection scope of the application shall be subject to the protection scope of the claim.

Claims (10)

1. a kind of IC card power-off protection method, which is characterized in that applied to the microprocessor in IC card, the IC card further include with The memory of the microprocessor connection, the memory includes data field and backup area;The described method includes:
After the service request for receiving terminal device transmission, obtain that the Data Identification in the service request is corresponding multiple to be deposited Store up address;The corresponding initial data of the multiple storage address is read from the data field of the memory;
Select storage address to be processed from multiple storage address, and by the page of memory page where the storage address to be processed Face information is written to the area the backup area Zhong Fangba;The page info includes page data;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor again After powering on, the microprocessor is based on should in the corresponding page info covering of the initial data in the area the Fang Ba data field The page info of memory page where initial data.
2. IC card power-off protection method according to claim 1, which is characterized in that the data field from the memory It is middle read the corresponding initial data of the multiple storage address after, the method also includes:
By each storage address and the corresponding initial data of each storage address, and, each described initial data is corresponding Original associated data and the storage address of the original associated data be written to the backup stack of the backup area;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor again After powering on, the microprocessor is based on should in the corresponding page info covering of the initial data in the area the Fang Ba data field After the page info of memory page where initial data, the method also includes:
The corresponding original associated data of the initial data and the original associated data pair are obtained from the backup stack of the backup area The storage address answered;
The corresponding current incidence number of the storage address obtained in the data field is covered using the original associated data of acquisition According to.
3. IC card power-off protection method according to claim 1, which is characterized in that it is described selected from multiple storage address to Storage address is handled, and the page info of memory page where the storage address to be processed is written in the backup area After the area Fang Ba, further includes:
The page info of memory page where the storage address to be processed of the area Fang Ba storage is provided with criterion knowledge;
When microprocessor non-power down when responding the corresponding initial data of the storage address to be processed, then deposited for the area Fang Ba Failure indication is arranged in the page info of memory page where the storage address to be processed of storage.
4. IC card power-off protection method according to claim 3, which is characterized in that if microprocessor is any wait locate in response Power down when managing storage address corresponding initial data, after the microprocessor re-powers, the method also includes:
The page info of memory page where the microprocessor detects storage address to be processed described in the area Fang Ba without When failure indication, detect the page info it is corresponding effectively identify whether it is complete, when the microprocessor detects the page When information corresponding effective mark in face is complete, the microprocessor is based on the initial data corresponding page letter in the area Fang Ba Breath covers the page info of memory page where the initial data in the data field.
5. IC card power-off protection method according to claim 2, which is characterized in that by each storage address and each deposit The corresponding initial data in address is stored up, and, each corresponding original associated data of initial data and the original incidence number According to storage address be written to the backup stack of the backup area, which comprises
Each storage address and the corresponding initial data of each storage address are written in the backup stack of the backup area;
The microprocessor is each storage address and the corresponding initial data of each storage address in the backup stack The first checking mark is distributed, generates the first duplicated record, and store first checking mark;
The storage address of each corresponding original associated data of target data and the original associated data is written to In the backup stack of the backup area;
The microprocessor is each corresponding original associated data of initial data and original association in the backup stack The second checking mark of allocations of storage addresses of data generates the second duplicated record, and stores second checking mark.
6. IC card power-off protection method according to claim 5, which is characterized in that if microprocessor is any wait locate in response Power down when managing storage address corresponding initial data, after the microprocessor re-powers, the microprocessor is based on described The corresponding page info of the initial data covers the page of memory page where the initial data in the data field in the area Fang Ba After information, the method also includes:
The microprocessor verifies first checking mark in first duplicated record, after verification passes through, The microprocessor verifies second checking mark in second duplicated record;
After verification passes through, obtained in corresponding second duplicated record of initial data from the backup stack of the backup area Original associated data and the corresponding storage address of the original associated data;
The corresponding current incidence number of the storage address obtained in the data field is covered using the original associated data of acquisition According to;
From the storage of the initial data and initial data obtained in the backup stack of the backup area in first duplicated record Location;
The corresponding current data of the storage address obtained in the data field is covered using the initial data of acquisition.
7. IC card power-off protection method according to claim 2, which is characterized in that the backup stack of the backup area includes more A backup block, the method also includes:
A target is selected in the multiple backup block originates memory block;
The microprocessor by currently pending storage address and the corresponding initial data of currently pending storage address, and, The storage address of the corresponding original associated data of initial data and the original associated data is written to the target starting Memory block;
When monitoring that the access times of the target starting memory block reach preset threshold value, according to preset sequence, from institute Stating the backup block selected in addition to the target originates memory block in multiple backup blocks is that next target originates memory block.
8. according to IC card power-off protection method described in right 7, which is characterized in that select from the multiple backup block except described After target originates the backup block outside memory block as next target starting memory block, the method also includes:
When the microprocessor monitors into the backup stack without optional backup block after, selected in the multiple backup block again A fixed target originates memory block, repeats currently pending storage address and the corresponding original number of currently pending storage address According to, and, the storage address of the corresponding original associated data of initial data and the original associated data is written to described Target originates the process of memory block, until the access times of the backup stack reach preset threshold value.
9. IC card power-off protection method according to claim 7, which is characterized in that the method also includes:
If monitoring the multiple backup block not in the memory range of the backup stack, the target starting for resetting backup block is standby Part block, so that the multiple backup block is all in the memory range of the backup stack.
10. a kind of IC card power-down protection apparatus, which is characterized in that described device includes that microprocessor and the microprocessor connect The memory connect, the memory further include data field and backup area;
The microprocessor, for obtaining the number in the service request after the service request for receiving terminal device transmission According to the corresponding multiple storage address of mark;It is corresponding original that the multiple storage address is read from the data field of the memory Data;Select storage address to be processed from multiple storage address, and by memory page where the storage address to be processed Page info is written to the area the backup area Zhong Fangba;The page info includes page data;
If microprocessor power down when responding the corresponding initial data of any storage address to be processed, when the microprocessor again After powering on, the microprocessor is based on should in the corresponding page info covering of the initial data in the area the Fang Ba data field The page info of memory page where initial data.
CN201811621864.XA 2018-12-28 2018-12-28 Power-down protection method and device for IC card Active CN109685190B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811621864.XA CN109685190B (en) 2018-12-28 2018-12-28 Power-down protection method and device for IC card

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811621864.XA CN109685190B (en) 2018-12-28 2018-12-28 Power-down protection method and device for IC card

Publications (2)

Publication Number Publication Date
CN109685190A true CN109685190A (en) 2019-04-26
CN109685190B CN109685190B (en) 2022-04-12

Family

ID=66190123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811621864.XA Active CN109685190B (en) 2018-12-28 2018-12-28 Power-down protection method and device for IC card

Country Status (1)

Country Link
CN (1) CN109685190B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110597665A (en) * 2019-09-18 2019-12-20 普联技术有限公司 Power-down protection device
CN111105563A (en) * 2019-12-17 2020-05-05 厦门计讯物联科技有限公司 Water card data writing method, device, equipment and storage medium for preventing data loss
CN111104253A (en) * 2019-11-22 2020-05-05 江苏恒宝智能系统技术有限公司 Power-down protection smart card and working method thereof
WO2022126470A1 (en) * 2020-12-17 2022-06-23 深圳杰睿联科技有限公司 Flash data power failure protection method and device

Citations (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001022653A (en) * 1999-07-12 2001-01-26 Matsushita Electric Ind Co Ltd Non-volatile semiconductor storage device
JP2004234311A (en) * 2003-01-30 2004-08-19 Matsushita Electric Ind Co Ltd Ic card device and communication method therefor
US20070078901A1 (en) * 2005-09-30 2007-04-05 Fujitsu Limited Hierarchical storage system, and control method and program therefor
US20070130436A1 (en) * 1999-10-19 2007-06-07 Super Talent Electronics, Inc. Electronic Data Storage Medium With Fingerprint Verification Capability
CN1983266A (en) * 2005-07-01 2007-06-20 Qnx软件操作系统德国有限公司 File system storing transaction records in flash-like media
CN101699476A (en) * 2009-10-29 2010-04-28 北京握奇数据系统有限公司 Data processing method and device of smart cards
CN101807320A (en) * 2010-04-12 2010-08-18 中兴通讯股份有限公司 Terminal aiming at non-contact intelligent card and method thereof for processing abnormality
CN102063384A (en) * 2009-11-13 2011-05-18 恒宝股份有限公司 Method for performing read-write operation on programmable read-only memory with cache by JAVA card
CN102073595A (en) * 2011-01-24 2011-05-25 华亚微电子(上海)有限公司 Power failure prevention loss balanced storage method
CN102254261A (en) * 2011-07-15 2011-11-23 武汉天喻信息产业股份有限公司 Instantaneous consumption application processing method and system for intelligent card
US20120266031A1 (en) * 2011-04-14 2012-10-18 Mstar Semiconductor, Inc. Controlling Method and Controller for Memory
CN102929805A (en) * 2012-10-19 2013-02-13 浪潮电子信息产业股份有限公司 Power-down protection method for cache data in memory system
CN103150125A (en) * 2013-02-20 2013-06-12 郑州信大捷安信息技术股份有限公司 Method for prolonging service life of power-down protection date buffer memory and smart card
CN103914407A (en) * 2012-12-30 2014-07-09 航天信息股份有限公司 Secure digital memory (SD) card power down protection and restoring method and SD card with power down protection function
CN104461770A (en) * 2014-10-31 2015-03-25 上海动联信息技术股份有限公司 Power-off protection method of Flash chip
CN104536847A (en) * 2014-12-18 2015-04-22 飞天诚信科技股份有限公司 Method for improving data writing integrity
CN104615662A (en) * 2015-01-05 2015-05-13 宇龙计算机通信科技(深圳)有限公司 Data processing method and device and terminal device
CN104881334A (en) * 2015-02-06 2015-09-02 北京飞杰信息技术有限公司 Crash-proof cache data protection method and system
CN105138432A (en) * 2015-08-31 2015-12-09 深圳市瑞耐斯技术有限公司 Solid state disk data fast backup method and system used under abnormal power failure
CN105260270A (en) * 2015-11-11 2016-01-20 恒宝股份有限公司 Flash storage space dynamic recovery method and device
CN106227680A (en) * 2016-07-26 2016-12-14 成都三零嘉微电子有限公司 A kind of data process and power fail preventing data guard method
CN106598484A (en) * 2016-11-17 2017-04-26 华为技术有限公司 Data storage method, flash memory chip and storage device
CN107944532A (en) * 2017-11-28 2018-04-20 恒宝股份有限公司 A kind of smart card and the method and terminal for reading and writing smart card

Patent Citations (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001022653A (en) * 1999-07-12 2001-01-26 Matsushita Electric Ind Co Ltd Non-volatile semiconductor storage device
US20070130436A1 (en) * 1999-10-19 2007-06-07 Super Talent Electronics, Inc. Electronic Data Storage Medium With Fingerprint Verification Capability
JP2004234311A (en) * 2003-01-30 2004-08-19 Matsushita Electric Ind Co Ltd Ic card device and communication method therefor
CN1983266A (en) * 2005-07-01 2007-06-20 Qnx软件操作系统德国有限公司 File system storing transaction records in flash-like media
US20070078901A1 (en) * 2005-09-30 2007-04-05 Fujitsu Limited Hierarchical storage system, and control method and program therefor
CN101699476A (en) * 2009-10-29 2010-04-28 北京握奇数据系统有限公司 Data processing method and device of smart cards
CN102063384A (en) * 2009-11-13 2011-05-18 恒宝股份有限公司 Method for performing read-write operation on programmable read-only memory with cache by JAVA card
CN101807320A (en) * 2010-04-12 2010-08-18 中兴通讯股份有限公司 Terminal aiming at non-contact intelligent card and method thereof for processing abnormality
CN102073595A (en) * 2011-01-24 2011-05-25 华亚微电子(上海)有限公司 Power failure prevention loss balanced storage method
US20120266031A1 (en) * 2011-04-14 2012-10-18 Mstar Semiconductor, Inc. Controlling Method and Controller for Memory
CN102254261A (en) * 2011-07-15 2011-11-23 武汉天喻信息产业股份有限公司 Instantaneous consumption application processing method and system for intelligent card
CN102929805A (en) * 2012-10-19 2013-02-13 浪潮电子信息产业股份有限公司 Power-down protection method for cache data in memory system
CN103914407A (en) * 2012-12-30 2014-07-09 航天信息股份有限公司 Secure digital memory (SD) card power down protection and restoring method and SD card with power down protection function
CN103150125A (en) * 2013-02-20 2013-06-12 郑州信大捷安信息技术股份有限公司 Method for prolonging service life of power-down protection date buffer memory and smart card
CN104461770A (en) * 2014-10-31 2015-03-25 上海动联信息技术股份有限公司 Power-off protection method of Flash chip
CN104536847A (en) * 2014-12-18 2015-04-22 飞天诚信科技股份有限公司 Method for improving data writing integrity
CN104615662A (en) * 2015-01-05 2015-05-13 宇龙计算机通信科技(深圳)有限公司 Data processing method and device and terminal device
CN104881334A (en) * 2015-02-06 2015-09-02 北京飞杰信息技术有限公司 Crash-proof cache data protection method and system
CN105138432A (en) * 2015-08-31 2015-12-09 深圳市瑞耐斯技术有限公司 Solid state disk data fast backup method and system used under abnormal power failure
CN105260270A (en) * 2015-11-11 2016-01-20 恒宝股份有限公司 Flash storage space dynamic recovery method and device
CN106227680A (en) * 2016-07-26 2016-12-14 成都三零嘉微电子有限公司 A kind of data process and power fail preventing data guard method
CN106598484A (en) * 2016-11-17 2017-04-26 华为技术有限公司 Data storage method, flash memory chip and storage device
CN107944532A (en) * 2017-11-28 2018-04-20 恒宝股份有限公司 A kind of smart card and the method and terminal for reading and writing smart card

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴俊军等: "面向耗损均衡的COS数据备份机制研究", 《计算机工程与科学》 *
张金霞等: "基于FLASH的智能卡数据掉电保护机制设计", 《电子技术与软件工程》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110597665A (en) * 2019-09-18 2019-12-20 普联技术有限公司 Power-down protection device
CN111104253A (en) * 2019-11-22 2020-05-05 江苏恒宝智能系统技术有限公司 Power-down protection smart card and working method thereof
CN111104253B (en) * 2019-11-22 2023-06-06 江苏恒宝智能系统技术有限公司 Smart card for power failure protection and working method thereof
CN111105563A (en) * 2019-12-17 2020-05-05 厦门计讯物联科技有限公司 Water card data writing method, device, equipment and storage medium for preventing data loss
CN111105563B (en) * 2019-12-17 2021-08-24 厦门计讯物联科技有限公司 Water card data writing method, device, equipment and storage medium for preventing data loss
WO2022126470A1 (en) * 2020-12-17 2022-06-23 深圳杰睿联科技有限公司 Flash data power failure protection method and device

Also Published As

Publication number Publication date
CN109685190B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN109685190A (en) A kind of IC card power-off protection method and device
CN103559054A (en) Implementing and deleting method and device for intelligent terminal multi-operation system
US10303560B2 (en) Systems and methods for eliminating write-hole problems on parity-based storage resources during an unexpected power loss
CN104599122A (en) Quick payment method, related equipment and related system
US10997516B2 (en) Systems and methods for predicting persistent memory device degradation based on operational parameters
CN103425505B (en) A kind of IC card electric energy meter online upgrading method and system
CN107608828A (en) Method, system, device and the storage medium that data center's power down recovers automatically
CN105956442A (en) Data clearing method and terminal device
CN109783390A (en) PSU firmware promotion and demotion stability test method, apparatus, terminal and storage medium
CN103559098B (en) Smart card test number control, Apparatus and system
CN105760251B (en) A kind of method and apparatus of Backup Data
CN109582337A (en) A kind of method, apparatus and computer readable storage medium of firmware upgrade
CN101833496B (en) Detection device based on host anti-object reusability of hard disk and detection method thereof
CN111007987A (en) Memory management method, system, terminal and storage medium for raid io
US20190004948A1 (en) Systems and methods for prognosticating likelihood of successful save operation in persistent memory
CN103778024A (en) Server system and message processing method thereof
CN106778369A (en) A kind of hard disk data access method, tax control server
CN105573872A (en) Hardware maintenance method and device of data storage system
CN103605939A (en) Method, device and system for writing personal data in financial IC card
CN109408282A (en) Application Backup restoration methods, equipment and computer readable storage medium
EP2775461B1 (en) Smart card, electronic device and portable electronic device
US20020139860A1 (en) Recording medium control method, data management apparatus, and recording medium
CN109074467A (en) Method for managing the real-time clock in portable tamper resistant device
US10146644B2 (en) Integrity of transactional memory of card computing devices in case of card tear events
CN113884976B (en) Cloud platform based intelligent electric meter data protection method and system

Legal Events

Date Code Title Description
PB01 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