CN104657678A - Replay protection monotonic counter, reading method and counting method thereof - Google Patents
Replay protection monotonic counter, reading method and counting method thereof Download PDFInfo
- Publication number
- CN104657678A CN104657678A CN201310583016.5A CN201310583016A CN104657678A CN 104657678 A CN104657678 A CN 104657678A CN 201310583016 A CN201310583016 A CN 201310583016A CN 104657678 A CN104657678 A CN 104657678A
- Authority
- CN
- China
- Prior art keywords
- data
- storage block
- bit
- current storage
- additional identification
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/70—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
- G06F21/78—Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Storage Device Security (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to the technical field of a memory and in particular to a replay protection monotonic counter, a reading method and a counting method of the replay protection monotonic counter. The replay protection monotonic counter comprises a first memory block for storing counting data, a second memory block for storing the counting data and an additional memory block for storing an additional identifier; the data of the additional identifier determines the present memory block which is storing the counting data when the replay protection monotonic counter is abnormal. When the present memory block is difficultly to be determined because of abnormal power failure or other situations, the present memory block is determined to count or read the data according to the data information recorded in the additional identifier; therefore, with adoption of the technical scheme, the accurate monotonic counting of the replay protection monotonic counter is ensured.
Description
Technical field
The present invention relates to memory technology field, be specifically related to a kind of response protection monotone counter, response protection monotone counter read method and method of counting.
Background technology
Response protection monotone counter (Replay Protection Monotonic Counter; RPMC) counter with dull tally function is referred to; after that is to say the data counted in response protection monotone counter, response protection monotone counter only can along with the increasing progressively of change dullness of count value or successively decreasing of dullness.Usual response protection monotone counter combines with (flash memory) FLASH, for the confidentiality and integrity ensureing to read and write data in data storage procedure.Such as, to be combined with FLASH at response protection monotone counter and to be used for determining that storer stores number of times, when FLASH often carries out the read-write of a secondary data, just in monotone counter, increase a count value, therefore for FLASH provides the number of times that reads and writes data to provide a complete data record; And for example in data transmission procedure, data dullness counting, ensure that the not repeated of data, and then improves the confidentiality of data transmission.Therefore, tally function part is just most important accurately to ensure monotone counter.
In prior art, response protection monotone counter often adopts two storage blocks to carry out stored count to data in turn, when current storage block does not write enumeration data all over, only needs in current storage block, carry out data reading or counting; But when a storage block stores full enumeration data, current total count value number is first write in another storage block, and simultaneously the count identification bit of another storage block and check bit write, then the storage block of full data is write in erasing, at this moment carries out necessary switching with regard to needing to two storage blocks.But, in prior art, if when two storage blocks switch when powered-off fault or other abnormal conditions, such as voltage fluctuation etc., often cause the current storage block being difficult to determine to carry out counting, and then cause the counting when next time counts inaccurate or carry out carrying out digital independent to monotone counter time, cause read error etc.
Summary of the invention
For making when powered-off fault or other abnormal conditions; still accurately can determine to reply current storage block in protection monotone counter and carry out reading or the counting of data, embodiments provide and a kind ofly reply protection monotone counter, the read method of response protection monotone counter and method of counting.
In first aspect, embodiments provide a kind of response protection monotone counter, comprising:
First storage block, for stored count data;
Second storage block, for stored count data;
Extra storage block, for storing additional identification position, current just in the current storage block of stored count data when the data of described additional identification position determine that response protection monotone counter is abnormal.
Further, described response protection monotone counter, described additional identification position comprises a data bit, and described data bit is for storing data 0 or data 1.
Further, described response protection monotone counter, determines that when the data of described additional identification position are 0 first storage block is current storage block, determines that the second storage block is current storage block when the data of additional identification position are 1.
Determine that when the data of described additional identification position are 0 second storage block is current storage block, determine that when the data of additional identification position are 1 first storage block is current storage block.
Further, described response protection monotone counter, described first storage block and the second storage block include: radix position, check bit, count identification bit and data bit.
The response protection monotone counter that the embodiment of the present invention provides; when counting or read; switch between first storage block and the second storage block; because of powered-off fault or other abnormal conditions cause being difficult to determine current storage block time, determine current storage block according to the data of additional identification position that extra storage block stores.With this, the enforcement of technical solution of the present invention, abnormal at response protection monotone counter; when being difficult to determine current storage block; determine current storage block according to additional identification position, achieve the reading accurately to data or counting, ensure that tightness and the integrality of response protection monotone counter counting.
In second aspect, the invention process additionally provides a kind of read method of replying protection monotone counter, comprising:
Read the first data bit of the count identification bit of the first storage block and the second storage block, check bit and the first storage block and the second storage block;
When the first storage block and the second storage block count identification bit and check bit all effectively and the first data bits according to time identical, read the data of additional identification position;
According to the data of described additional identification position, determine that current storage block carries out digital independent;
During digital independent, the data of radix position are added the data of data bit record are as reading data.
Further, described response protection monotone counter read method, the described data according to described additional identification position, determine that current storage block carries out digital independent, comprising:
When the data of additional identification position are 0, determine that the first storage block is that current storage block carries out digital independent; Or
When the data of additional identification position are 1, determine that the first storage block is that current storage block carries out digital independent.
Further, described response protection monotone counter read method, also comprises:
When only having the count identification bit of a storage block and check bit all effective, determining that all effective storage block of count identification bit and check bit is current storage block, carrying out digital independent.
Further, described response protection monotone counter read method, also comprises:
When the count identification bit of two storage blocks and check bit are all effective, when the first data bit is not identical, determine that the first data bit does not write the storage block of data, for current storage block carries out digital independent.
The read method of the response protection monotone counter that the embodiment of the present invention provides; when reading data; after switching when counting between the first storage block and the second storage block; when being difficult to determine current storage block because power down etc. is abnormal, the data of the additional identification position stored according to extra storage block determine current storage block.With this, the enforcement of technical solution of the present invention, at response protection monotone counter powered-off fault; when being difficult to determine current storage block; determine current storage block according to additional identification position, achieve the reading accurately to data, ensure that tightness and the integrality of response protection monotone counter counting.
In the third aspect, the embodiment of the present invention additionally provides a kind of method of counting of replying protection monotone counter, comprising:
After determining that the current storage block carrying out counting is the first storage block or the second storage block, judge described current storage block data bit status data memory;
When current storage block data bit does not have data to write, upgrade additional identification bit data information and additional identification bit data information and described current storage block are matched;
Erasing is not the storage block of current storage block; And
Count in first data bit write data not writing data of current storage block simultaneously.
Further, described response protection monotone counter method of counting, it is described when current storage block data bit does not have data to write, upgrade the data of additional identification position, comprise: when current storage block data do not have data to write, the data stored additional identification position are as additional identification bit data; Or
When current storage block data do not have data to write, re-write the data of data as additional identification position.
Further, described response protection monotone counter method of counting, also comprises:
When current storage block data bit writes full data, switch another storage block and count as current storage block;
The current count value as radix position is write, check bit and count identification bit in current storage block after handover;
Upgrading additional identification bit data information makes additional identification bit data information and the current storage block after switching match;
The current storage block of full data is write in erasing before switching; And
First data bit write data not writing data of the current storage block after described switching count.
Further, described response protection monotone counter method of counting also comprises:
When current storage block data bit does not write full data, in current storage block, first does not write and writes data in the data bit of data and count.
The method of counting of the response protection monotone counter that the embodiment of the present invention provides; when carrying out data counts; when the first storage block and the second storage block switch when last time counts; when being difficult to determine current storage block because power down etc. is abnormal, the data of the additional identification position stored according to extra storage block determine current storage block.With this, the enforcement of technical solution of the present invention, in exceptions such as response protection monotone counter power down; when being difficult to determine current storage block; determine current storage block according to additional identification position, achieve the reading accurately to data, ensure that tightness and the integrality of response protection monotone counter counting.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, does not form limitation of the invention.In the accompanying drawings:
It is the structural representation of response protection monotone counter in the embodiment of the present invention one shown in Fig. 1;
Response protection monotone counter first storage block or the second storage block structural representation in the embodiment of the present invention one shown in Fig. 2;
It is response protection monotone counter extra storage block structure schematic diagram in the embodiment of the present invention one shown in Fig. 3;
It is the read method schematic flow sheet of response protection monotone counter in the embodiment of the present invention two shown in Fig. 4;
It is the read method overall procedure schematic diagram of response protection monotone counter in the embodiment of the present invention two shown in Fig. 5;
It is the method for counting schematic flow sheet of response protection monotone counter in the embodiment of the present invention three shown in Fig. 6;
It is the method for counting overall procedure schematic diagram of response protection monotone counter in the embodiment of the present invention three shown in Fig. 7.
Embodiment
Below in conjunction with drawings and the specific embodiments, the present invention is carried out more in detail and complete explanation.Be understandable that, specific embodiment described herein is only for explaining the present invention, but not limitation of the invention.It also should be noted that, for convenience of description, illustrate only part related to the present invention in accompanying drawing but not full content.
Response protection monotone counter (Replay Protection Monotonic Counter; RPMC) counter with dull tally function is referred to; after that is to say the data counted in response protection monotone counter, response protection monotone counter only can along with the increasing progressively of change dullness of count value or successively decreasing of dullness.Usual response protection monotone counter combines with FLASH, for the confidentiality and integrity ensureing to read and write data in data storage procedure.Because existing response protection monotone counter often comprises two storage blocks, these two storage blocks carry out the counting of data in turn; Therefore count when a storage block data full after, need to switch the storage that another storage block carries out data.Now, just need to switch current storage block, wherein current storage block refers to that current time carries out the storage block of data counts; With this, after there is the situations such as powered-off fault in the process switched, if two storage blocks carrying out switching do not switch complete, then determine current storage block by being difficult to when again carrying out data counts or read, and then data may be caused to misread or miscount etc.With this, when two storage blocks are in handoff procedure, still effectively can just seem very important to the determination of current storage block after powered-off fault, below the present invention is described in detail with specific embodiment.
It is the structural representation of response protection monotone counter in the embodiment of the present invention one shown in Fig. 1; As shown in Figure 1, described response protection monotone counter comprises:
First storage block 101, for stored count data.
Second storage block 102, for stored count data.
Extra storage block 103, for storing additional identification position, current just in the current storage block of stored count data when the data of additional identification position determine that response protection monotone counter is abnormal.
Storage block refers to that storer is divided into equal region to be called storage block by the size of page, that is to say for the storage array in respective memory, according to certain mode, storage unit in storage array is divided into the memory bank be made up of respective memory unit, corresponding storage unit can be had according in the different storage blocks of dividing mode.In the present embodiment, protect the storage array of storer in monotone counter to be divided into response and at least comprise the first storage block 101, second storage block 102 and these three storage blocks of extra storage block 103.What those skilled in the art should understand that is can also there are other storage blocks in memory array in response protection monotone counter.Wherein, the exception of response protection monotone counter refers to the situations such as powered-off fault, reset, spread of voltage.
Response protection monotone counter first storage block or the second storage block structural representation in the embodiment of the present invention one shown in Fig. 2; As shown in Figure 2, the first storage block 200 and the second storage block 200 all can comprise: radix position 201, count identification bit 202, check bit 203 and data bit 204; Wherein, be increase the memory space of storage block, reduce erasing times, exist in storage block a lot of data bit 204, such as several thousand etc.
Radix position 201 refers to the data that last storage block counts before current storage block switches received for recording storage block.Because of the monotonicity of response protection monotone counter; the increasing or decreasing of data dullness; with this when switching storage block and carrying out data counts, must the data of the storage block before switching be saved in the storage block after switching, as the basis that the storage block after switching counts.Such as, when the first storage block is after current storage block is filled with data, the second storage block is being switched in the process of current storage block, reading the data counted of the first storage block, that is to say and total count data, and data are saved in the radix position of the second storage block as current storage block.Further, when after the first storage block and the second storage block are because of powered-off fault, position, radix position does not write data, then using current count value as radix position.
Count identification bit 202 is for determining that whether storage block is the zone bit of current storage block.When certain storage block counts as current storage block, corresponding data can be write to determine that this storage block is current storage block at count identification bit.According to the application of reality, the count identification bit in storage block can be made up of a storage unit, can also be made up of multiple storage unit.Such as, when there being a storage unit as count identification bit, can determine that this storage block is current storage block when storage unit counts when data are 0.
Check bit 203 is check codes that in verifying memory, whether digital independent is correct.Concrete, in the present embodiment, when replying protection monotone counter and counting, determine that whether the data counted are accurate by the data of check bit.
Data bit 204 is the storage unit for storing data, such as, when storage unit is that 0 interval scale counts data or counts data when storage unit is 1.
It is response protection monotone counter extra storage block structure schematic diagram in the embodiment of the present invention one shown in Fig. 3; As shown in Figure 3, shown extra storage block 300 comprises a data bit 301.
Preferably, in the present embodiment, extra storage block 300 is independent of the first storage block 301 and the second storage block 302, and in extra storage block, additional identification bit data counts is when after the current storage block of switching, and carries out carrying out while data enter in current storage block.With this, ensure when powered-off fault or other situation cause can not determine current storage block, still can determine current storage block according to the data of additional identification position in extra storage block.And extra storage block is independent of the first storage block and the second storage block, the data of additional identification position are switched while carrying out data write, can accurately determine current storage block, and then determine current storage block when powered-off fault according to the data message of additional identification position.
According to the application of reality, the additional identification position in storage block can be made up of a storage unit, can also be made up of multiple storage unit.In concrete the present embodiment, using a storage unit as flag in additional identification position, can determine that this storage block is current storage block when storage unit counts when data are 0 or 1.
Preferably, in the present embodiment, additional identification position comprises a data bit, and data bit is for storing data 0 or data 1; Wherein, only have the additional identification potential energy of a data bit enough to reduce the time of data write and erase operation, promote switch speed.
Preferably, determine when the data of described additional identification position are 0 in the present embodiment that the first storage block is current storage block, determines that when the data of additional identification position are 1 second storage block is current storage block; Or
Determine that when the data of described additional identification position are 0 second storage block is current storage block, determine that when the data of additional identification position are 1 first storage block is current storage block.
Further, in the present embodiment, response protection monotone counter also includes logic control circuit 104 and multiple I/O IO interface; Wherein, logic control circuit is used for carrying out controlling or adjusting in the process such as data counts, reading; I/O IO interface is used for carrying out inputing or outputing of data when counting or read.
In the present embodiment, after the storage block data bit as current storage block writes full data, when switching another storage block as current storage block, because causing during exception after electrification reset, again carry out counting or digital independent time can not effectively determine current storage block.With this, because the extra storage block of additional identification position exists independent of the first storage block and the second storage block, its data counted also can not be subject to the impact of the first storage block and the second storage block.With this, can determine that current storage block carries out write or the reading of data according to the data counted of additional identification position.
With this; the response protection monotone counter that the embodiment of the present invention provides; when carrying out counting or reading; carry out between first storage block and the second storage block in handoff procedure; during because being difficult to during exception determine current storage block, the data according to the additional identification position of extra storage block storage determine current storage block.With this; the enforcement of technical solution of the present invention; at response protection monotone counter powered-off fault; when being difficult to determine current storage block; current storage block is determined according to additional identification position; achieve the reading accurately to data or counting, ensure that tightness and the integrality of response protection monotone counter counting.
It is the read method schematic flow sheet of response protection monotone counter in the embodiment of the present invention two shown in Fig. 4; In the present embodiment, the enforcement of method step is reference data with response protection monotone counter in embodiment one, describes, do not repeat them here the concept related to described in the present embodiment or other related description with reference in embodiment one.As shown in Figure 4, described method comprises:
First data bit of step 401, the count identification bit reading the first storage block and the second storage block, check bit and the first storage block and the second storage block.
The reading to data realized in this step; that is to say when needs read data in response protection monotone counter; carry out reading response protection monotone counter, read the first data bit of count identification bit, check bit and the first storage block and the second storage block.By determining current storage block to the reading of above-mentioned data, and and then determine count value.
Step 402, when the first storage block and the second storage block count identification bit and check bit all effectively and the first data bits according to time identical, read the data of additional identification position.
The effective status of flag, that is to say the state when the data that flag counts can determine that this flag place storage block is current storage block.Such as, when the data of additional identification position are 1, then this storage block is current storage block.Then when two flags of two storage blocks are all data 1, then now two flags are all in effective status.When the first storage block and the second storage block count identification bit and check bit all effectively and the first data bit is identical time, then now the first storage block and the second storage block maintain identical state in abnormal cases, cause and are difficult to determine current storage block.
When the first storage block and the second storage block additional identification position all effectively time; then now response protection monotone counter is because of powered-off fault; cause the flag of the first storage block and the second storage block to be in effective status, that is to say that the first storage block is all recorded in the additional identification position of the first storage block and the second storage block and the second storage block is current storage block.Now, the data reading additional identification position are needed to determine current storage block.
Step 403, data according to additional identification position, determine that current storage block carries out digital independent.
Data because of additional identification are that storage block according to current storage block and determine.With this, can determine current storage block according to the data of additional identification position, that is to say should as the storage block of counting storage block before powered-off fault.
Preferably, in the present embodiment when the data of additional identification position are 0, determine that the first storage block is that current storage block carries out digital independent.
Preferably, in the present embodiment when the data of additional identification position are 1, determine that the first storage block is that current storage block carries out digital independent.
When step 404, digital independent, the data of radix position are added the data of data bit record are as reading data.
Determine current storage block in step 403, then can carry out the reading to data according to the current storage block determined.In the present embodiment; first the radix of radix position is read; that is to say the data of radix position; then the data of the data bit of current storage block are read successively; read data in data bit and add one on the basis of radix, and then realize the reading to data in response protection monotone counter according to the data determination enumeration data of the cardinal sum data bit record of the radix position of reading.
Further, in the present embodiment when only having the count identification bit of a storage block and check bit all effective, determining that all effective storage block of count identification bit and check bit is current storage block, carrying out digital independent.When only having the count identification bit of a storage block and check bit all effective, the storage block of some is current storage block certainly, and then carries out the reading of data.
Further, in the present embodiment when the count identification bit of two storage blocks and check bit are all effective, when the first data bit is not identical, that determines that the first data bit do not write data carries out digital independent for current storage block.When the count identification bit of two storage blocks and check bit all effective, when first data bit is different, then now there is exception in two storage blocks in handoff procedure, cause not write data as the storage block of current storage block, and another storage block is not by data erase, then what now do not write data is current storage block.
It is response protection monotone counter read method overall procedure schematic diagram in the embodiment of the present invention two shown in Fig. 5; In the present embodiment, read method performs as follows as shown in Figure 5:
First the first data bit of step 501, the flag reading the first storage block and the second storage block and the first storage block and the second storage block is performed.
When only having a flag effective, perform step: 502, the effective storage block of flag is current storage block; 506, the data of radix position are read; 507, data in read data bit, read a number and add 1 in radix position according to this, and then determine enumeration data.
When flag is all effective, and when the first data bit is identical, perform step: 503, read additional identification bit data; 505, current storage block is determined according to additional identification position; 506, the data of radix position are read.507, data in read data bit, read a number and add 1 in radix position according to this, and then determine enumeration data.
When flag is all effective, when the first data bit is not identical, perform step: the storage block that step 504, the first data bit do not write data is current storage block; The data of step 506, reading radix position; Data in step 507, read data bit, read a number and add 1 in radix position according to this, and then determine enumeration data.
When two flag data are all invalid, then read and occur mistake.
The read method of the response protection monotone counter that the embodiment of the present invention provides; when reading data; after switching between the first storage block and the second storage block are when counting; during because being extremely difficult to determine current storage block, the data according to the additional identification position of extra storage block storage determine current storage block.With this, the enforcement of technical solution of the present invention, at response protection monotone counter powered-off fault; when being difficult to determine current storage block; determine current storage block according to additional identification position, achieve the reading accurately to data, ensure that tightness and the integrality of response protection monotone counter counting.
It is the method for counting schematic flow sheet of response protection monotone counter in the embodiment of the present invention three shown in Fig. 6; In the present embodiment, the enforcement of method step is reference data with a response protection monotone counter in embodiment, describes, do not repeat them here the concept related to described in the present embodiment or other related description with reference in embodiment one.As shown in Figure 6, described method comprises:
Step 601, after determining the current storage block carrying out counting, judge described current storage block data bit status data memory.
The data bit memory state of current storage block has three kinds of situations usually, and one is that data bit is filled with data, and two is that data bit does not write data, and three are data bit write data but do not write full data.For determining that current storage block that is to say when needing after exception to count response protection monotone counter or read, the counting storage block determined.
Step 602, when current storage block data bit does not have data to write, upgrade additional identification bit data information and additional identification bit data information and current storage block are matched.
Now, when current storage block data bit does not write data, then current storage block switches.With this, check that the information upgrading additional identification position makes it whether mate with current count storage block, and then realize the renewal to additional identification position.
Preferably, in the present embodiment when current storage block data do not have data to write, the data stored additional identification position are as additional identification bit data.
When current storage block data do not have data to write, re-write the data of data as additional identification position.
Step 603, erasing are not the storage blocks of current storage block.
In the updated, will not the memory block erasing of current storage block, can ensure that when next time switches data count accurately.
Step 604, while, count in first data bit write data not writing data of current storage block.
In this step, be then that first data bit write data not writing data realizes the tally function that monotone counter is protected in response in the current storage block determined.
Further, in the present embodiment when current storage block data bit writes full data, switch another storage block and count as current storage block.
Current count value, check bit and the count identification bit as radix position is write in current storage block after handover.After handover, monotone counter has redefined current storage block, then need count value, and check bit and count identification bit re-write current storage block.
Upgrading additional identification bit data information makes additional identification bit data information and the current storage block after switching match.After count value, count identification bit and check bit are all write current storage block, then need to carry out necessary renewal to the data message in additional identification position, such as, delete, re-write.
The current storage block of full data is write in erasing before switching.
First data bit write data not writing data of the current storage block after described switching count.
Further, in the present embodiment when current storage block data bit does not write full data, in current storage block, first does not write and writes data in the data bit of data and count.
It is response protection monotone counter method of counting overall procedure schematic diagram in the embodiment of the present invention three shown in Fig. 7; In the present embodiment, method of counting performs as follows as shown in Figure 7:
Perform step 701, after determining the current storage block carrying out counting, when the data bit of current storage block does not write data, perform step: step 703, renewal additional identification bit data information; Step 704, erasing are not the storage blocks of current storage block; Step 705, write data count.
When data bit is full, when writing full data, perform step: step 702, switch another storage block as current storage block; Step 703, renewal additional identification bit data information; Step 704, erasing are not the storage blocks of current storage card; Step 705, write data count.
Work as data bit, less than time, perform step: step 705, data of writing direct count.
The method of counting of the response protection monotone counter that the embodiment of the present invention provides; when carrying out data counts; after the first storage block and the second storage block switch when last time counts; during because being extremely difficult to determine current storage block, the data according to the additional identification position of extra storage block storage determine current storage block.With this, the enforcement of technical solution of the present invention, abnormal at response protection monotone counter; when being difficult to determine current storage block; determine current storage block according to additional identification position, achieve the reading accurately to data, ensure that tightness and the integrality of response protection monotone counter counting.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, to those skilled in the art, the present invention can have various change and change.All do within spirit of the present invention and principle any amendment, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (12)
1. a response protection monotone counter, is characterized in that, comprising:
First storage block, for stored count data;
Second storage block, for stored count data;
Extra storage block, for storing additional identification position, current just in the current storage block of stored count data when the data of described additional identification position determine that response protection monotone counter is abnormal.
2. response protection monotone counter as claimed in claim 1, it is characterized in that, described additional identification position comprises a data bit, and described data bit is for storing data 0 or data 1.
3. response protection monotone counter as claimed in claim 2, is characterized in that, determine that the first storage block is current storage block when the data of described additional identification position are 0, determine that the second storage block is current storage block when the data of additional identification position are 1; Or
Determine that when the data of described additional identification position are 0 second storage block is current storage block, determine that when the data of additional identification position are 1 first storage block is current storage block.
4. response protection monotone counter as claimed in claim 1, it is characterized in that, described first storage block and the second storage block include: radix position, check bit, count identification bit and data bit.
5. a response protection monotone counter read method, is characterized in that, comprising:
Read the first data bit of the count identification bit of the first storage block and the second storage block, check bit and the first storage block and the second storage block;
When the first storage block and the second storage block count identification bit and check bit all effectively and the first data bits according to time identical, read the data of additional identification position;
According to the data of described additional identification position, determine that current storage block carries out digital independent;
During digital independent, the data of radix position are added the data of data bit record are as reading data.
6. response protection monotone counter read method as claimed in claim 5, is characterized in that the described data according to described additional identification position determine that current storage block carries out digital independent, comprising:
When the data of additional identification position are 0, determine that the first storage block is that current storage block carries out digital independent; Or
When the data of additional identification position are 1, determine that the first storage block is that current storage block carries out digital independent.
7. response protection monotone counter read method as claimed in claim 5, is characterized in that, also comprise:
When only having the count identification bit of a storage block and check bit all effective, determining that all effective storage block of count identification bit and check bit is current storage block, carrying out digital independent.
8. response protection monotone counter read method as claimed in claim 5, is characterized in that, also comprise:
When the count identification bit of two storage blocks and check bit are all effective, when the first data bit is not identical, determines that the storage block that the first data bit does not write data is current storage block, carry out digital independent.
9. a response protection monotone counter method of counting, is characterized in that, comprising:
After determining that the current storage block carrying out counting is the first storage block or the second storage block, judge described current storage block data bit status data memory;
When current storage block data bit does not have data to write, upgrade additional identification bit data information and additional identification bit data information and described current storage block are matched;
Erasing is not the storage block of current storage block; And
Count in first data bit write data not writing data of current storage block simultaneously.
10. response protection monotone counter method of counting as claimed in claim 9, it is characterized in that, it is described when current storage block data bit does not have data to write, upgrade the data of additional identification position, comprise: when current storage block data do not have data to write, the data stored additional identification position are as additional identification bit data; Or
When current storage block data do not have data to write, re-write the data of data as additional identification position.
11. reply protection monotone counter method of counting as claimed in claim 9, it is characterized in that, also comprise:
When current storage block data bit writes full data, switch another storage block and count as current storage block;
The current count value as radix position is write, check bit and count identification bit in current storage block after handover;
Upgrading additional identification bit data information makes additional identification bit data information and the current storage block after switching match;
The current storage block of full data is write in erasing before switching; And
First data bit write data not writing data of the current storage block after described switching count.
12. reply protection monotone counter method of counting as claimed in claim 9, it is characterized in that, also comprise:
When current storage block data bit does not write full data, in current storage block, first does not write and writes data in the data bit of data and count.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310583016.5A CN104657678B (en) | 2013-11-19 | 2013-11-19 | Response protection monotone counter, read method and method of counting |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310583016.5A CN104657678B (en) | 2013-11-19 | 2013-11-19 | Response protection monotone counter, read method and method of counting |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104657678A true CN104657678A (en) | 2015-05-27 |
CN104657678B CN104657678B (en) | 2018-01-09 |
Family
ID=53248786
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310583016.5A Active CN104657678B (en) | 2013-11-19 | 2013-11-19 | Response protection monotone counter, read method and method of counting |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104657678B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111261214A (en) * | 2020-04-30 | 2020-06-09 | 深圳市芯天下技术有限公司 | Answer protection monotonic counter and method for managing count value thereof |
CN112582009A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and counting method thereof |
CN112582010A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and method of operating the same |
CN112582008A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and method of operating the same |
CN114328283A (en) * | 2021-12-29 | 2022-04-12 | 上海芯存天下电子科技有限公司 | Counting address acquisition method, counting method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6128695A (en) * | 1995-07-31 | 2000-10-03 | Lexar Media, Inc. | Identification and verification of a sector within a block of mass storage flash memory |
CN1383510A (en) * | 2000-05-04 | 2002-12-04 | 皇家菲利浦电子有限公司 | Method, system and computer program for data management on storage medium |
US20070113013A1 (en) * | 2005-11-15 | 2007-05-17 | Mips Technologies, Inc. | Microprocessor having a power-saving instruction cache way predictor and instruction replacement scheme |
CN101526920A (en) * | 2008-12-31 | 2009-09-09 | 北京飞天诚信科技有限公司 | Method and device for writing data |
-
2013
- 2013-11-19 CN CN201310583016.5A patent/CN104657678B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6128695A (en) * | 1995-07-31 | 2000-10-03 | Lexar Media, Inc. | Identification and verification of a sector within a block of mass storage flash memory |
CN1383510A (en) * | 2000-05-04 | 2002-12-04 | 皇家菲利浦电子有限公司 | Method, system and computer program for data management on storage medium |
US20070113013A1 (en) * | 2005-11-15 | 2007-05-17 | Mips Technologies, Inc. | Microprocessor having a power-saving instruction cache way predictor and instruction replacement scheme |
CN101526920A (en) * | 2008-12-31 | 2009-09-09 | 北京飞天诚信科技有限公司 | Method and device for writing data |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111261214A (en) * | 2020-04-30 | 2020-06-09 | 深圳市芯天下技术有限公司 | Answer protection monotonic counter and method for managing count value thereof |
CN111261214B (en) * | 2020-04-30 | 2020-08-07 | 深圳市芯天下技术有限公司 | Answer protection monotonic counter and method for managing count value thereof |
CN112582009A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and counting method thereof |
CN112582010A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and method of operating the same |
CN112582008A (en) * | 2020-12-11 | 2021-03-30 | 武汉新芯集成电路制造有限公司 | Monotonic counter and method of operating the same |
CN112582010B (en) * | 2020-12-11 | 2022-06-10 | 武汉新芯集成电路制造有限公司 | Monotonic counter and method of operating the same |
WO2022120940A1 (en) * | 2020-12-11 | 2022-06-16 | 武汉新芯集成电路制造有限公司 | Monotonic counter and counting method thereof |
TWI805080B (en) * | 2020-12-11 | 2023-06-11 | 大陸商武漢新芯集成電路製造有限公司 | Monotonic counter and counting method thereof |
CN114328283A (en) * | 2021-12-29 | 2022-04-12 | 上海芯存天下电子科技有限公司 | Counting address acquisition method, counting method, device, equipment and storage medium |
CN114328283B (en) * | 2021-12-29 | 2022-11-18 | 上海芯存天下电子科技有限公司 | Counting address acquisition method, counting method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN104657678B (en) | 2018-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10445231B2 (en) | Method and system for storage device metadata management and processing | |
CN102656567B (en) | Data management in solid state storage devices | |
CN109783017B (en) | Storage device bad block processing method and device and storage device | |
CN102449613B (en) | Object oriented memory in solid state devices | |
US9201785B2 (en) | Data writing method, memory controller and memory storage apparatus | |
CN104657678A (en) | Replay protection monotonic counter, reading method and counting method thereof | |
TWI423024B (en) | Data storing method for a flash memory, and flash memory controller and flash memory storage system using the same | |
US9665481B2 (en) | Wear leveling method based on timestamps and erase counts, memory storage device and memory control circuit unit | |
US20100217919A1 (en) | Memory controller, semiconductor memory device and control method thereof | |
TWI551991B (en) | Method and system for memory management and memory storage device thereof | |
TWI490871B (en) | Method for preventing read-disturb, memory control circuit unit and memory storage apparatus | |
CN101494085B (en) | Prevent nonvolatile memory from method and the controller thereof of interference occurring to read | |
CN101944386B (en) | Control circuit and storage system and method for identifying error data in flash memory | |
US9177656B2 (en) | Data writing method, memory storage device and memory controlling circuit unit | |
TWI479314B (en) | Method of storing system data, and memory controller and memory storage apparatus using the same | |
US9442834B2 (en) | Data management method, memory controller and memory storage device | |
US10437484B2 (en) | Data protecting method, memory control circuit unit and memory storage device | |
TWI720246B (en) | Data storage device and operating method therefor | |
TWI421870B (en) | Data writing method for a flash memory, and controller and storage system using the same | |
US20150317245A1 (en) | Bidirectional counter in a flash memory | |
TWI486765B (en) | Memory management method, memory controller and memory storage device using the same | |
CN105302665A (en) | Improved copy-on-write snapshot method and system | |
CN104464809A (en) | Method for prolonging service life of flash memory | |
CN103593301B (en) | Bad block management method and system | |
CN102880432B (en) | Method and system for increasing writing speeds of flash memory chips by aid of limited lives of data and controller of system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Room 101, Floor 1-5, Building 8, Yard 9, Fenghao East Road, Haidian District, Beijing 100094 Patentee after: Zhaoyi Innovation Technology Group Co.,Ltd. Address before: 100083 12 Floors, Block A, Tiangong Building, Science and Technology University, 30 College Road, Haidian District, Beijing Patentee before: GIGADEVICE SEMICONDUCTOR(BEIJING) Inc. |
|
CP03 | Change of name, title or address |