CN105677233A - Storage method and storage device for real-time data - Google Patents

Storage method and storage device for real-time data Download PDF

Info

Publication number
CN105677233A
CN105677233A CN201410660485.7A CN201410660485A CN105677233A CN 105677233 A CN105677233 A CN 105677233A CN 201410660485 A CN201410660485 A CN 201410660485A CN 105677233 A CN105677233 A CN 105677233A
Authority
CN
China
Prior art keywords
data
storage unit
instant data
storage
logic
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
CN201410660485.7A
Other languages
Chinese (zh)
Other versions
CN105677233B (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.)
BYD Semiconductor Co Ltd
Original Assignee
BYD 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 BYD Co Ltd filed Critical BYD Co Ltd
Priority to CN201410660485.7A priority Critical patent/CN105677233B/en
Publication of CN105677233A publication Critical patent/CN105677233A/en
Application granted granted Critical
Publication of CN105677233B publication Critical patent/CN105677233B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Read Only Memory (AREA)

Abstract

The invention discloses a storage method for flash-memory storage of real-time data. A flash memory comprises multiple storage units. The storage method comprises following steps: S1, an arithmetic logic reads real-time data last time, stored in a first storage unit, from cache logic; S2, the cache logic stores the current real-time data and the arithmetic logic judges whether the current real-time data is the same as the real-time data last time, going to the step S3 if so and otherwise the step S4; S3, a data storage control logic does not store the current real-time data to the storage units; S4, the data storage control logic writes in the current real-time data to the first storage unit to cover the real-time data last time or writing the current real-time data to a second storage unit. The above storage method helps avoid unnecessary real-time data storage process by judging whether inputted current real-time data is the same as the real-time data stored last time and performing corresponding motion. Therefore, working efficiency of a MCU and a COU is increased. The invention further discloses a storage device.

Description

The storage method of instant data and storing unit
Technical field
The present invention relates to data storing field, especially relate to storage method and the storing unit of a kind of instant data.
Background technology
The development of current MCU (microcontrollerunit) control field is rapidly, wherein need to support that application scheme and the product demand of instant storage are on the increase, the record of each moment temperature in such as temperature control field, the record of equipment data in each second, or the preservation of user's use habit information etc.
Even if above-mentioned data information needs MCU also can be saved when cutting off the electricity supply, or can not be lost for the precondition of the work of MCU next time. Therefore, prior art uses EEPROM to carry out the instant storage of such data information on the one hand, namely each fixed time (such as: each second) will need the data information preserved to write EEPROM, it is ensured that when MCU stopping or power dump, continuation is long-time preserves data information; Using Flash (flash memory) storage volume to replace EEPROM to carry out above-mentioned same operation on the other hand, it solves the high cost problem using EEPROM to cause to a great extent, and the current program becomes the main method that such functional design of MCU realizes gradually.
Using Flash storage volume to replace EEPROM to carry out the storage of instant data information, current techniques mainly realizes dividing out sub-fraction in same a slice Flash storage space, is used as the storage space of instant data information. Namely with program curing and instant data information two kinds of data of storing MCU in a slice Flash storage volume. In MCU real work, carrying out timesharing multiplexing with the storage function with instant data information that reads of a slice Flash storage volume program curing, namely when the CPU of MCU reads the program curing of Flash storage volume, instant data information can not stored simultaneously; When storing instant data information, CPU needs the reading suspending the program curing to Flash storage volume until the process storing instant data completes. With this, it is achieved Flash storage volume is used as the function that instant storage unit stores instant data.
Above-mentioned use Flash storage volume replaces EEPROM to carry out the method for instant data information preservation, there is following deficiency: owing to the feature of Flash storage volume mainly reads data quickly, but the step of erasing and write data very complicated with rule very slow (speed with write that reads is compared with efficiency and poor can be weighed with 1000 times, and the speed with erasing that reads compare with efficiency can with 10002Doubly poor weigh); For MCU itself, what Flash storage volume stored is the program of solidification, and it uses for MCU normal operation, in the process of MCU normal operation, the controller of Flash storage volume and its correspondence can be in busy state at any time, reads the program curing in Flash storage volume for CPU; Need immediately to be preserved once instant data information, CPU must suspend the reading to program curing in Flash storage volume, abdicate the rights of using of Flash storage volume and controller, make instant data store control logic can preserve data information at once in the instant data storage space of same a slice Flash storage volume.
Therefore, as from the foregoing, said process causes the processing speed of MCU and CPU and performance greatly to reduce, and in the process storing instant data, CPU is in idle longer suspended state, waste performance resource.
Summary of the invention
The present invention is intended to one of technical problem at least solving existence in prior art. For this reason, the present invention needs to propose a kind of flash memory storage body as instant storage unit to store the storage method of instant data and a kind of storing unit.
A kind of flash memory storage body is used as the storage method that instant storage unit stores instant data, this flash memory storage body comprises the multiple storage unit for storing these instant data, the plurality of storage unit comprises the first storage unit and the 2nd storage unit, and this storage method comprises step:
S1: arithmetic logic reads instant data last time from cache logic, this last time, instant data were stored in this first storage unit;
S2: this cache logic stores the current instant data of input, this arithmetic logic receive these current instant data and judge these current instant data and this last time instant data whether identical, if then entering step S3, then enter step S4 if not;
S3: data store control logic does not store these current instant data to this storage unit; And
These current instant data are maybe write the 2nd storage unit by S4: these current instant data are write this first storage unit to cover this last time of instant data by this data store control logic, and the 2nd storage unit is the storage unit do not used.
Above-mentioned storage method, whether identical by instant data last time of the current instant data and storage that judge input, and do corresponding action, avoid the instant data storage procedure not needed, the erasable number of times of flash memory is significantly reduced, and then the time that the wait shortening MCU and CPU suspends, it is to increase the working efficiency of MCU and CPU.
In an embodiment, step S4 comprises step:
S41: these current instant data are carried out step-by-step or logical calculated with this last time of instant data by this arithmetic logic, if A | B=B, enters step S42, if A | B ≠ B, enters step S43, and wherein A represents this currently data immediately, and B represents this last time of instant data;
S42: these current instant data are write this first storage unit to cover this last time of instant data by this data store control logic; And
S43: these current instant data are write the 2nd storage unit by this data store control logic.
In an embodiment, in step s 4 which, the tandem that this data store control logic is preset by the plurality of storage unit stores instant data, the tandem preset by this, this first storage unit with the 2nd storage unit be two adjacent storage unit of order and the order of this first storage unit front, the order of the 2nd storage unit is rear.
In an embodiment, this storage unit comprises the data block for storing instant data and the zone bit block for storing zone bit, whether the instant data that this zone bit is stored in this data block for identifying are up-to-date data, in step S41, after carrying out step-by-step or logical calculated, this arithmetic logic identifies these current instant data and is stored in the data block of this first storage unit or is stored in the data block of the 2nd storage unit and generates this zone bit, in step S42, this data store control logic stores the data block of these current instant data in this first storage unit according to this mark, and store the zone bit block of this zone bit in this first storage unit, in step S43, this data store control logic stores the data block of these current instant data in the 2nd storage unit according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit.
In an embodiment, between step S41 and step S43, this storage method also comprises step:
S44: this arithmetic logic judges whether the storage time counting number of storage unit reaches pre-determined number, if then entering step S45, then step S43 if not;
S45: this arithmetic logic controls this data store control logic and the plurality of storage unit is carried out erase operation,
After step S43, this storage method also comprises step:
S46: this arithmetic logic adds 1 at this storage time counting number.
A kind of storing unit utilizing flash memory storage body to store instant data, this flash memory storage body comprises the multiple storage unit for storing these instant data, the plurality of storage unit comprises the first storage unit and the 2nd storage unit, this storing unit comprises cache logic, arithmetic logic and data store control logic, this arithmetic logic for reading instant data last time from this cache logic, this last time, instant data were stored in this first storage unit, this cache logic for store input current instant data or this last time instant data, this arithmetic logic also for receive these current instant data and judge these current instant data and this last time instant data whether identical, if these current instant data are identical with this last time of instant data, this data store control logic is not for storing these current instant data to this storage unit, if these current instant data and this last time instant data not identical, this data store control logic is used for these current instant data are write this first storage unit to cover this last time of instant data, or for by this current instant data write the 2nd storage unit, 2nd storage unit is the storage unit do not used.
In an embodiment, if this current instant data and when this last time, instant data were not identical, this arithmetic logic be used for by these current instant data and this last time instant data carry out step-by-step or logical calculated, if A | B=B, this data store control logic is used for these current instant data are write this first storage unit to cover this last time of instant data, if A | B ≠ B, this data store control logic is used for these current instant data are write the 2nd storage unit, wherein A represents this current instant data, and B represents this last time of instant data.
In an embodiment, this data store control logic also stores instant data for the tandem default by the plurality of storage unit, the tandem preset by this, this first storage unit with the 2nd storage unit be two adjacent storage unit of order and the order of this first storage unit front, the order of the 2nd storage unit is rear.
In an embodiment, this storage unit comprises the data block for storing instant data and the zone bit block for storing zone bit, whether the instant data that this zone bit is stored in this data block for identifying are up-to-date data, after carrying out step-by-step or logical calculated, this arithmetic logic is also stored in the data block of this first storage unit for identifying these current instant data or is stored in the data block of the 2nd storage unit and generates this zone bit, this data storage is patrolled and is also stored the data block of these current instant data in this first storage unit for collecting according to this mark, and store the zone bit block of this zone bit in this first storage unit, or this data store control logic is also for storing the data block of these current instant data in the 2nd storage unit according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit.
In an embodiment, this arithmetic logic also for, before at this data store control logic, by this, current instant data write the 2nd storage unit, judge whether the storage time counting number of storage unit reaches pre-determined number, if, for controlling, the plurality of storage unit is carried out erase operation to this arithmetic logic by this data store control logic, if not, this data store control logic is used for these current instant data are write the 2nd storage unit, this arithmetic logic also for, after at this data store control logic, by this, current instant data write the 2nd storage unit, add 1 at this storage time counting number.
The additional aspect of the present invention and advantage will part provide in the following description, and part will become obvious from the following description, or be recognized by the practice of the present invention.
Accompanying drawing explanation
Above-mentioned and/or the additional aspect of the present invention and advantage from accompanying drawing below combining to the description of the mode of enforcement becoming obviously with it should be readily understood that wherein:
Fig. 1 be better embodiment of the present invention by the module diagram of instant data storing to the storing unit of flash memory storage body.
Fig. 2 is the module diagram of the flash memory storage body used by the storing unit of better embodiment of the present invention.
Fig. 3 is the module diagram of the arithmetic logic of the storing unit of better embodiment of the present invention.
Fig. 4 is the module diagram of the data store control logic of the storing unit of better embodiment of the present invention.
Fig. 5 be better embodiment of the present invention by the schematic flow sheet of instant data storing to the storage method of flash memory storage body.
Embodiment
Being described below in detail embodiments of the present invention, the example of described enforcement mode is shown in the drawings, and wherein same or similar label represents same or similar element or has element that is identical or similar functions from start to finish. It is exemplary below by the enforcement mode being described with reference to the drawings, only for explaining the present invention, and limitation of the present invention can not be interpreted as.
In describing the invention, it is to be understood that term " first ", " the 2nd " are only for describing object, and can not be interpreted as instruction or hint relative importance or imply the quantity indicating indicated technology feature.Thus, be limited with " first ", the feature of " the 2nd " can express or implicit comprise one or more described features. In describing the invention, the implication of " multiple " is two or more, unless otherwise expressly limited specifically.
In describing the invention, it is necessary to explanation, unless otherwise clearly defined and limited, term " installation ", " being connected ", " connection " should be interpreted broadly, such as, it is possible to be fixedly connected with, it is also possible to be removably connect, or connect integratedly; Can be mechanically connected, it is also possible to be electrically connected or can intercom mutually; Can be directly be connected, it is also possible to be indirectly connected by intermediary, it is possible to be the connection of two element internals or the interaction relationship of two elements. For the ordinary skill in the art, it is possible to understand above-mentioned term concrete implication in the present invention according to particular case.
Disclosing hereafter provides many different enforcement modes or example is used for realizing the different structure of the present invention. In order to simplify disclosing of the present invention, hereinafter parts and setting to specific examples are described. Certainly, they are only example, and object is not restriction the present invention. In addition, the present invention can in different example repeat reference numerals and/or with reference to letter, this kind repeats to be to simplify and clearly object, itself do not indicate the relation between discussed various enforcement mode and/or setting. In addition, various specific technique that the present invention provides and the example of material, but those of ordinary skill in the art can recognize the application of other techniques and/or the use of other materials.
Refer to Fig. 1, the storing unit 10 of the present invention's better embodiment, storing unit 10 for by instant data storing in flash memory (flash) storage volume 20. Please refer to the drawing 2, this flash memory storage body 20 comprises program curing storage unit 202 and stores multiple storage unit 204 of instant data. Multiple storage unit 204 comprises the first storage unit 206 and the 2nd storage unit 208, first storage unit 206 stores instant data, and the 2nd storage unit 208 is the storage unit do not used. The storage unit do not used refers to not write the storage unit of data when flash memory is after initialize, or after storage unit carries out erase operation, does not write the storage unit of data.
This storing unit 10 comprises cache logic 102, arithmetic logic 104 and data store control logic 106. This arithmetic logic 104 for reading instant data last time from this cache logic 102, and this last time, instant data were stored in this first storage unit 206. This arithmetic logic 104 also for receive these current instant data and judge these current instant data and this last time instant data whether identical.
Specifically, incorporated by reference to Fig. 3, this arithmetic logic 104 comprises Compare Logic 108 and step-by-step or logic 110, this Compare Logic 108 for judge these current instant data and this last time instant data whether identical. If these current instant data are identical with this last time of instant data, this Compare Logic 108 Output rusults a1, if this currently immediately data and this last time instant data not identical, this Compare Logic 108 Output rusults a2.
This step-by-step or logic 110 are for according to result a2, carrying out step-by-step or logical calculated to instant data B last time with current instant data A. If A | B=B, so according to the storage characteristics of flash memory 20, in flash memory storage body 20, current instant data A is turned into from instant data B last time, the first storage unit 206 storing instant data B last time only need to carry out the current instant data A of write operate, it is not necessary to the first storage unit 206 is carried out erase operation.So step-by-step or logic Output rusults b1.
If A | B ≠ B, so according to the storage characteristics of flash memory it will be seen that only carry out write operation and make the data of the first storage unit 206 of storage instant data B last time turn into current instant data A cannot to realize. Now, it is necessary to be written in the 2nd storage unit 208 (storage unit of new flash memory storage body), step-by-step or logic Output rusults b2.
This cache logic 102 for store input current instant data or last time instant data. MCU can control after arithmetic logic 104 first reads instant data B last time from cache logic 102, and MCU writes current instant data A again in cache logic 102.
If these current instant data are identical with this last time of instant data, this data store control logic 106 is not for storing these current instant data to this storage unit 204. If these current instant data and this last time instant data not identical, this data store control logic 106 for these current instant data are write this first storage unit 206 to cover this last time of instant data, or for by this current instant data write the 2nd storage unit 208.
Specifically, incorporated by reference to Fig. 4, this data store control logic 106 comprises result analysis logic 112 and write steering logic 114. When result analysis logic 112 receives result a1, then draw currently without any need for the conclusion operated, storage unit 204 is not carried out any operation, do not store this current instant data.
When result analysis logic 112 receives result b1, for controlling, these current instant data are write this first storage unit 206 to cover this last time of instant data to result analysis logic 112 by this write steering logic 114. When result analysis logic 112 receives result b2, for controlling, these current instant data are write the 2nd storage unit 208 to result analysis logic 112 by this write steering logic 114.
Said storage unit 10, whether identical by instant data last time of the current instant data and storage that judge input, and do corresponding action, avoid the instant data storage procedure not needed, the erasable number of times of flash memory 20 is significantly reduced, and then the time that the wait shortening MCU and CPU suspends, it is to increase the working efficiency of MCU and CPU.
In one embodiment, this data store control logic 106 is also for storing instant data by the default tandem of the plurality of storage unit 204, the tandem preset by this, this first storage unit 206 with the 2nd storage unit 208 be two adjacent storage unit of order and the order of this first storage unit 206 front, the order of the 2nd storage unit 208 is rear. So, storing unit 10 stores instant data according to the tandem of storage unit 204, makes instant data be easy to management, facilitates subsequent access, it is to increase the working efficiency of MCU and CPU.
In one embodiment, incorporated by reference to Fig. 2, this storage unit 204 comprises the data block 210 for storing instant data and the zone bit block 212 for storing zone bit, whether the instant data that this zone bit is stored in this data block for identifying are up-to-date data, this arithmetic logic 104 also comprises zone bit formation logic 116, after carrying out step-by-step or logical calculated, for identifying, these current instant data are stored in the data block of this first storage unit 206 or are stored in the data block of the 2nd storage unit 208 and generate this zone bit this zone bit formation logic 116. This data store control logic 106 also stores the data block of these current instant data in this first storage unit 206 for collecting according to this mark, and store the zone bit block of this zone bit in this first storage unit 206, or this data store control logic 106 is also for storing the data block of these current instant data in the 2nd storage unit 208 according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit 208.
Specifically, as zone bit formation logic 116 reception result b1, zone bit formation logic 116 identifies current instant data A and is stored to the data block of the first storage unit 206 and generates this zone bit, namely writes the data block of the first storage unit 206 and zone bit block to cover instant data last time (old instant data) and zone bit. Zone bit formation logic 116 Output rusults c1.
As zone bit formation logic 116 reception result b2, zone bit formation logic 116 identifies current instant data A and is stored to the data block of the 2nd storage unit 208 and generates this zone bit, namely writes data block and the zone bit block of the 2nd storage unit 208. Zone bit formation logic 116 Output rusults c2.
This data store control logic 106 also comprises zone bit and instant data integration logic 118, this zone bit and instant data integration logic 118 are for according to result c1 or c2, by zone bit and instant data integration, the instant data after integrating and zone bit are together write in the data block of the first storage unit 206 and the data block of zone bit block or the 2nd storage unit 208 and zone bit block by result analysis logic 112 according to result c1 or c2 control write steering logic 114.
Such as, the zone bit initial value of all storage unit is 1. in the storage process of instant data, zone bit formation logic 116 generation value is the zone bit of 0, value is the zone bit of 0 and instant data integration by zone bit and instant data integration logic 118, instant data and zone bit after integrating together is write in the data block of the first storage unit 206 and the data block of zone bit block or the 2nd storage unit 208 and zone bit block by result analysis logic 112 according to result c1 or c2 control write steering logic 114, makes the mark place value of correspondence turn into 0 from 1. the tandem preset by storage unit, in the rear storage unit corresponding mark place value adjacent with the 2nd storage unit 208 order is still 1, then specify that the instant data that the 2nd storage unit 208 stores are up-to-date instant data, other mark place value is the instant data that the storage unit of 0 correspondence stores is the instant data of non-current, namely the tandem preset by storage unit, the value occurring zone bit first is the data that the upper storage unit of the storage unit of 1 stores is up-to-date instant data, other zone bit is the instant data that the storage unit of 0 correspondence stores is the instant data of non-current.
Said storage unit 10 uses zone bit can accurately locate the storage location of up-to-date instant data so that the utilization ratio of storage space is also significantly increased, and memory reliability is strengthened.
In one embodiment, this arithmetic logic 104 also for, before at this data store control logic 106, by this, current instant data write the 2nd storage unit 208, judge whether the storage time counting number of storage unit reaches pre-determined number, if, for controlling, the plurality of storage unit 204 is carried out erase operation to this arithmetic logic 104 by this data store control logic 106, if not, this data store control logic 106 is for writing the 2nd storage unit 208 by these current instant data, this arithmetic logic 104 also for, after at this data store control logic 106, by this, current instant data write the 2nd storage unit 208, add 1 at this storage time counting number.
Specifically, this arithmetic logic 104 also comprises storage number of times logical circuit of counter 120, this storage number of times logical circuit of counter 120 is according to result b2, judge whether the storage time counting number of storage unit reaches pre-determined number, if, this storage number of times logical circuit of counter 120 Output rusults d1, if not, this storage number of times logical circuit of counter 120 Output rusults d2.
This data store control logic 106 also comprises erasing steering logic 122, result analysis logic 112 reception result d1, and control erasing steering logic 122 and the plurality of storage unit 204 is carried out erase operation, remove the instant data and zone bit had been friends in the past, start new instant data and store. Result analysis logic 112 reception result d2, and control write steering logic 114 and current instant data are write in the 2nd storage unit 208. Afterwards, this storage number of times logical circuit of counter 120 is also for adding 1 at this storage time counting number.
Said storage unit 10, when all storage unit 204 for storing instant data are finished, and need when new storage unit writes new instant data, the instant data and zone bit had been friends in the past can be removed, new instant data can be stored in time, avoid the wait of time and the loss of data.
The storing unit 10 of above enforcement mode is described below in conjunction with concrete data instance.
1) concrete regulation in this example: it is 8 that flash memory storage body 20 stores bit wide; Instant data message block is made up of the storage unit of 128 8 bit wides, and pre-determined number is 128; Instant data information bit wide is 7; Zone bit is 1; All storage unit acquiescence initial value of instant data is 1 (namely data state) after Flash memory erase entirely; Cache logic 102 gives tacit consent to the instant data value (being 1 entirely under default conditions) that initial value equals up-to-date, and initial storage number of times is counted as 0; MCU can control storing unit 10 under above-mentioned prescribed condition and work;
2) producing one group of new instant data A1 (current instant data), its data value is A1=7 ' b110_0011; It is B1=7 ' b111_1111 that now old in cache logic 102 instant data B1 (instant data last time) equals its data value of primary data;
3) Compare Logic 108 judges A1 ≠ B1 Output rusults a2, then step-by-step or logic 110 are according to result a2, calculate A1 | B1=B1, Output rusults b1, zone bit formation logic 116 is according to result b1, put mark place value=0 and Output rusults c1, zone bit and instant data integration logic 118 according to result c1 by data A1 in conjunction with zone bit, result analysis logic 112 writes in the storage unit of steering logic 114 by the data A1 after integration and zone bit write data B1 according to result c1 and b1 control, and the next storage unit zone bit adjacent with this storage unit is still default value=1, represent that first storage unit stores up-to-date instant data. complete the storage of instant data A1, store number of times logical circuit of counter 120 and will store time counting number 0+1=1, represent and currently employ 1 storage unit altogether. herein, owing to being the first pen data of write after storage unit initialize, can think that all storage unit are the storage unit do not used, therefore the storage of first group of instant data A1 is equivalent to instant data A1 is written to the storage unit do not used, stores number of times logical circuit of counter 120 and storage number of times is added 1,
4) producing again one group of newly instant data A2, its data value is A2=7 ' b100_0010; Now old in cache logic 102 instant data B2 equals aforesaid operations 2) new instant data A1, its data value is B2=7 ' b110_0011;
5) Compare Logic 108 judges A2 ≠ B2, Output rusults a2, then step-by-step or logic 110 calculate A2 according to result a2 | B2=B2, Output rusults b1, zone bit formation logic 116 is according to result b1, put mark place value=0 and Output rusults c1, zone bit and instant data integration logic 118 according to result c1 by data A2 in conjunction with zone bit, result analysis logic 112 writes steering logic 114 by interior for the storage unit of the data A2 after integration and zone bit write data B2 (data A1) to cover old instant data A1 according to result c1 and b1 control, complete the storage of instant data A2,And the next storage unit zone bit adjacent with this storage unit is still default value=1, represent that this storage unit stores up-to-date instant data; Store time counting number=1, represent and currently employ 1 storage unit altogether;
6) producing again one group of newly instant data A3, its data value is A3=7 ' b000_0000; Now in cache logic 102, old instant data B3 equals aforesaid operations 4) new instant its data value of data A2 be B3=7 ' b100_0010;
7) Compare Logic 108 judges A3 ≠ B3, Output rusults a2, then step-by-step or logic 110 are according to result a2, calculate A3 | B3=B3, Output rusults b1, zone bit formation logic 116 is according to result b1, put mark place value=0 and Output rusults c1, zone bit and instant data integration logic 118 according to result c1 by data A3 in conjunction with zone bit, result analysis logic 112 writes steering logic 114 by interior for the storage unit of the data A3 after integration and zone bit write data B3 (data A2) to cover old instant data A2 according to result c1 and b1 control, complete the storage of instant data A3. and the next storage unit zone bit adjacent with this storage unit is still default value=1, represent that this storage unit stores up-to-date instant data, store time counting number=1, represent and currently employ 1 storage unit altogether,
8) producing again one group of newly instant data A4, its data value is A4=7 ' b010_1110; Now in cache logic 102, old instant data B4 equals aforesaid operations 6) new instant its data value of data A3 be B4=7 ' b000_0000;
9) Compare Logic 108 judges A4 ≠ B4, Output rusults a2, then step-by-step or logic 110 are according to result a2, calculate A4 | B4 ≠ B4, Output rusults b2, store number of times logical circuit of counter 120 and judge that storing time counting number does not reach preset times 128 times for 1 time, Output rusults d2, zone bit formation logic 116 is according to result b2, put mark place value=0 and Output rusults c2, zone bit and instant data integration logic 118 according to result c2 by data A4 in conjunction with zone bit, result analysis logic 112 is according to result c2, data A4 after integration and zone bit write are stored in the next adjacent storage unit of storage unit of data A3 by b2 and d2 control write steering logic 114, namely in the 2nd storage unit, complete the storage of instant data A4. store number of times logical circuit of counter 120 and will store time counting number 1+1=2 according to result b2, represent and currently employ 2 storage unit altogether,
10) producing again one group of newly instant data A5, its data value is A5=7 ' b111_0000; Now in cache logic 102, old instant data B5 equals aforesaid operations 8) new instant its data value of data A4 be B5=7 ' b010_1110;
11) Compare Logic 108 judges A5 ≠ B5 Output rusults a2, then step-by-step or logic 110 are according to result a2, calculate A5 | B5 ≠ B5, Output rusults b2, store number of times logical circuit of counter 120 and judge that storing time counting number does not reach preset times 128 times for 2 times, Output rusults d2, zone bit formation logic 116 is according to result b2, put mark place value=0 and Output rusults c2, zone bit and instant data integration logic 118 according to result c2 by data A5 in conjunction with zone bit, result analysis logic 112 is according to result c2, data A5 after integration and zone bit write are stored in the next adjacent storage unit of storage unit of data A4 by b2 and d2 control write steering logic 114, namely in the 3rd storage unit, complete the storage of instant data A5.Store number of times logical circuit of counter 120 and will store time counting number 2+1=3 according to result b2, represent and currently employ 3 storage unit altogether;
12) when storing secondary counting number=128, represent that all instant data storage unit 204 of flash memory storage body 20 is used, at An ≠ Bn and An | during Bn ≠ Bn, store number of times logical circuit of counter 120 and judge that storing time counting number reaches preset times 128 times, Output rusults d1, result analysis logic 112 reception result d1, and control erasing steering logic 122 and the plurality of storage unit 204 is carried out erase operation, remove the instant data and zone bit had been friends in the past, start new instant data to store, storing unit 10 preserves An and the zone bit corresponding with it (mark place value=0) again in first storage unit afterwards, complete the storage of instant data An, store counts=1.
Please refer to the drawing 5, a kind of storage method utilizing flash memory storage body to store instant data that better embodiment of the present invention provides, this flash memory storage body 20 comprises the multiple storage unit 204 for storing these instant data, and the plurality of storage unit 204 comprises the first storage unit 206 and the 2nd storage unit 208. This storage method can be performed by said storage unit 10. This storage method comprises step:
S1: arithmetic logic 104 reads instant data last time from cache logic 102, this last time, instant data were stored in this first storage unit 206;
S2: this cache logic 102 stores the current instant data of input, this arithmetic logic 104 receive these current instant data and judge these current instant data and this last time instant data whether identical, if then entering step S3, then enter step S4 if not;
S3: data store control logic 106 does not store these current instant data to this storage unit 204; And
S4: these current instant data are write this first storage unit 206 to cover this last time of instant data by this data store control logic 106, maybe these current instant data being write the 2nd storage unit the 208, two storage unit 208 is the storage unit do not used.
Specifically, step S4 comprises step:
S41: this arithmetic logic 104 by these current instant data and this last time instant data carry out step-by-step or logical calculated, if A | B=B, enters step S42, if A | B ≠ B, enters step S43, and wherein A represents this current instant data, and B represents this last time of instant data;
S42: these current instant data are write this first storage unit 206 to cover this last time of instant data by this data store control logic 106; And
S43: these current instant data are write the 2nd storage unit 208 by this data store control logic 106.
Above-mentioned storage method, whether identical by instant data last time of the current instant data and storage that judge input, and do corresponding action, avoid the instant data storage procedure not needed, the erasable number of times of flash memory is significantly reduced, and then the time that the wait shortening MCU and CPU suspends, it is to increase the working efficiency of MCU and CPU.
In one embodiment, in step s 4 which, the tandem that this data store control logic 106 is preset by the plurality of storage unit 204 stores instant data, the tandem preset by this, this first storage unit 206 with the 2nd storage unit 208 be two adjacent storage unit of order and the order of this first storage unit 206 front, the order of the 2nd storage unit 208 is rear. So, storage method stores instant data according to the tandem of storage unit 204, makes instant data be easy to management, facilitates subsequent access, it is to increase the working efficiency of MCU and CPU.
In one embodiment, this storage unit 204 comprises the data block 210 for storing instant data and the zone bit block 212 for storing zone bit, whether the instant data that this zone bit is stored in this data block 210 for identifying are up-to-date data, in step S41, after carrying out step-by-step or logical calculated, this arithmetic logic 104 identifies these current instant data and is stored in the data block of this first storage unit 206 or is stored in the data block of the 2nd storage unit 208 and generates this zone bit, in step S42, this data store control logic 106 stores the data block of these current instant data in this first storage unit 206 according to this mark, and store the zone bit block of this zone bit in this first storage unit 206, in step S43, this data store control logic stores the data block of these current instant data single 208 yuan of the 2nd storage according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit 208. so, above-mentioned storage method uses zone bit can accurately locate the storage location of up-to-date instant data so that the utilization ratio of storage space is also significantly increased, and memory reliability is strengthened.
In one embodiment, between step S41 and step S43, this storage method also comprises step:
S44: this arithmetic logic 104 judges whether the storage time counting number of storage unit reaches pre-determined number, if then entering step S45, then step S43 if not;
S45: this arithmetic logic 104 controls this data store control logic 106 and the plurality of storage unit is carried out erase operation,
After step S43, this storage method also comprises step:
S46: this arithmetic logic 104 adds 1 at this storage time counting number.
Above-mentioned storage method, when all storage unit 204 for storing instant data are finished, and need when new storage unit writes new instant data, the instant data and zone bit had been friends in the past can be removed, new instant data can be stored in time, avoid the wait of time and the loss of data.
In the description of this specification sheets, the description of reference term " implement mode ", " some implement mode ", " exemplary embodiment ", " example ", " concrete example " or " some examples " etc. means at least one enforcement mode that the concrete feature in conjunction with described enforcement mode or example description, structure, material or feature be contained in the present invention or example. In this manual, the schematic representation of above-mentioned term is not necessarily referred to identical enforcement mode or example. And, the concrete feature of description, structure, material or feature can combine in an appropriate manner in any one or more enforcement mode or example.
Although it has been shown and described that embodiments of the present invention, it will be understood by those skilled in the art that: these enforcement modes can be carried out multiple change, amendment, replacement and modification when not departing from principle and the objective of the present invention, the scope of the present invention by claim and etc. jljl limit.

Claims (10)

1. one kind utilizes the storage method that flash memory storage body stores instant data, this flash memory storage body comprises the multiple storage unit for storing these instant data, the plurality of storage unit comprises the first storage unit and the 2nd storage unit, it is characterised in that, this storage method comprises step:
S1: arithmetic logic reads instant data last time from cache logic, this last time, instant data were stored in this first storage unit;
S2: this cache logic stores the current instant data of input, this arithmetic logic receive these current instant data and judge these current instant data and this last time instant data whether identical, if then entering step S3, then enter step S4 if not;
S3: data store control logic does not store these current instant data to this storage unit; And
These current instant data are maybe write the 2nd storage unit by S4: these current instant data are write this first storage unit to cover this last time of instant data by this data store control logic, and the 2nd storage unit is the storage unit do not used.
2. storage method as claimed in claim 1, it is characterised in that, step S4 comprises step:
S41: these current instant data are carried out step-by-step or logical calculated with this last time of instant data by this arithmetic logic, if A | B=B, enters step S42, if A | B ≠ B, enters step S43, and wherein A represents this currently data immediately, and B represents this last time of instant data;
S42: these current instant data are write this first storage unit to cover this last time of instant data by this data store control logic; And
S43: these current instant data are write the 2nd storage unit by this data store control logic.
3. storage method as claimed in claim 2, it is characterized in that, in step s 4 which, the tandem that this data store control logic is preset by the plurality of storage unit stores instant data, the tandem preset by this, this first storage unit with the 2nd storage unit be two adjacent storage unit of order and the order of this first storage unit front, the order of the 2nd storage unit is rear.
4. storage method as claimed in claim 3, it is characterized in that, this storage unit comprises the data block for storing instant data and the zone bit block for storing zone bit, whether the instant data that this zone bit is stored in this data block for identifying are up-to-date data, in step S41, after carrying out step-by-step or logical calculated, this arithmetic logic identifies these current instant data and is stored in the data block of this first storage unit or is stored in the data block of the 2nd storage unit and generates this zone bit, in step S42, this data store control logic stores the data block of these current instant data in this first storage unit according to this mark, and store the zone bit block of this zone bit in this first storage unit, in step S43, this data store control logic stores the data block of these current instant data in the 2nd storage unit according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit.
5. storage method as claimed in claim 4, it is characterised in that, between step S41 and step S43, this storage method also comprises step:
S44: this arithmetic logic judges whether the storage time counting number of storage unit reaches pre-determined number, if then entering step S45, then step S43 if not;
S45: this arithmetic logic controls this data store control logic and the plurality of storage unit is carried out erase operation,
After step S43, this storage method also comprises step:
S46: this arithmetic logic adds 1 at this storage time counting number.
6. one kind utilizes the storing unit that flash memory storage body stores instant data, this flash memory storage body comprises the multiple storage unit for storing these instant data, the plurality of storage unit comprises the first storage unit and the 2nd storage unit, it is characterized in that, this storing unit comprises cache logic, arithmetic logic and data store control logic, this arithmetic logic for reading instant data last time from this cache logic, this last time, instant data were stored in this first storage unit, this cache logic for store input current instant data or this last time instant data, this arithmetic logic also for receive these current instant data and judge these current instant data and this last time instant data whether identical, if these current instant data are identical with this last time of instant data, this data store control logic is not for storing these current instant data to this storage unit, if these current instant data and this last time instant data not identical, this data store control logic is used for these current instant data are write this first storage unit to cover this last time of instant data, or for by this current instant data write the 2nd storage unit, 2nd storage unit is the storage unit do not used.
7. storing unit as claimed in claim 6, it is characterized in that, if this current instant data and when this last time, instant data were not identical, this arithmetic logic be used for by these current instant data and this last time instant data carry out step-by-step or logical calculated, if A | B=B, this data store control logic is used for these current instant data are write this first storage unit to cover this last time of instant data, if A | B ≠ B, this data store control logic is used for these current instant data are write the 2nd storage unit, wherein A represents this current instant data, B represents this last time of instant data.
8. storing unit as claimed in claim 7, it is characterized in that, this data store control logic also stores instant data for the tandem default by the plurality of storage unit, the tandem preset by this, this first storage unit with the 2nd storage unit be two adjacent storage unit of order and the order of this first storage unit front, the order of the 2nd storage unit is rear.
9. storing unit as claimed in claim 8, it is characterized in that, this storage unit comprises the data block for storing instant data and the zone bit block for storing zone bit, whether the instant data that this zone bit is stored in this data block for identifying are up-to-date data, after carrying out step-by-step or logical calculated, this arithmetic logic is also stored in the data block of this first storage unit for identifying these current instant data or is stored in the data block of the 2nd storage unit and generates this zone bit, this data storage is patrolled and is also stored the data block of these current instant data in this first storage unit for collecting according to this mark, and store the zone bit block of this zone bit in this first storage unit, or this data store control logic is also for storing the data block of these current instant data in the 2nd storage unit according to this mark, and store the zone bit block of this zone bit in the 2nd storage unit.
10. storing unit as claimed in claim 9, it is characterized in that, this arithmetic logic also for, before at this data store control logic, by this, current instant data write the 2nd storage unit, judge whether the storage time counting number of storage unit reaches pre-determined number, if, for controlling, the plurality of storage unit is carried out erase operation to this arithmetic logic by this data store control logic, if not, this data store control logic is used for these current instant data are write the 2nd storage unit, this arithmetic logic also for, after at this data store control logic, by this, current instant data write the 2nd storage unit, add 1 at this storage time counting number.
CN201410660485.7A 2014-11-19 2014-11-19 The storage method and storage device of instant data Active CN105677233B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410660485.7A CN105677233B (en) 2014-11-19 2014-11-19 The storage method and storage device of instant data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410660485.7A CN105677233B (en) 2014-11-19 2014-11-19 The storage method and storage device of instant data

Publications (2)

Publication Number Publication Date
CN105677233A true CN105677233A (en) 2016-06-15
CN105677233B CN105677233B (en) 2019-02-26

Family

ID=56944791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410660485.7A Active CN105677233B (en) 2014-11-19 2014-11-19 The storage method and storage device of instant data

Country Status (1)

Country Link
CN (1) CN105677233B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110988425A (en) * 2019-12-31 2020-04-10 凌云光技术集团有限责任公司 Mini oscilloscope system
CN112702418A (en) * 2020-12-21 2021-04-23 潍柴动力股份有限公司 Double-cache data downloading control method and device and vehicle
CN114816833A (en) * 2022-04-15 2022-07-29 巨翊科技(上海)有限公司 Flash data writing method, device and system
CN115147954A (en) * 2022-06-23 2022-10-04 重庆长安汽车股份有限公司 Data storage method and device for vehicle, vehicle and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004289683A (en) * 2003-03-24 2004-10-14 Sharp Corp Data receiver, data reception method, data reception program, and computer-readable record medium having the program recorded thereon
CN102231881A (en) * 2011-07-05 2011-11-02 广州市动景计算机科技有限公司 Method, server and system for processing user data of mobile terminal
CN103516774A (en) * 2012-12-28 2014-01-15 Tcl集团股份有限公司 Method and system for eliminating multiplicating storage based on cloud storage
CN103886902A (en) * 2012-12-19 2014-06-25 比亚迪股份有限公司 EEPROM storage apparatus and data storage method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004289683A (en) * 2003-03-24 2004-10-14 Sharp Corp Data receiver, data reception method, data reception program, and computer-readable record medium having the program recorded thereon
CN102231881A (en) * 2011-07-05 2011-11-02 广州市动景计算机科技有限公司 Method, server and system for processing user data of mobile terminal
CN103886902A (en) * 2012-12-19 2014-06-25 比亚迪股份有限公司 EEPROM storage apparatus and data storage method thereof
CN103516774A (en) * 2012-12-28 2014-01-15 Tcl集团股份有限公司 Method and system for eliminating multiplicating storage based on cloud storage

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110988425A (en) * 2019-12-31 2020-04-10 凌云光技术集团有限责任公司 Mini oscilloscope system
CN112702418A (en) * 2020-12-21 2021-04-23 潍柴动力股份有限公司 Double-cache data downloading control method and device and vehicle
CN114816833A (en) * 2022-04-15 2022-07-29 巨翊科技(上海)有限公司 Flash data writing method, device and system
CN115147954A (en) * 2022-06-23 2022-10-04 重庆长安汽车股份有限公司 Data storage method and device for vehicle, vehicle and medium

Also Published As

Publication number Publication date
CN105677233B (en) 2019-02-26

Similar Documents

Publication Publication Date Title
CN102347078B (en) Methods and systems for dynamically controlling operations in a non-volatile memory
CN102483717B (en) Remapping method and device for memory wear leveling
CN102937830B (en) Electric quantity management method and device of mobile equipment and mobile equipment
CN111124305B (en) Solid state disk wear leveling method and device and computer readable storage medium
CN104423894B (en) Data memory device and method for controlling flash memory
US20080235306A1 (en) Garbage collection in nonvolatile memories using data attributes, computer program products and methods of operating the same
US20110191525A1 (en) Flash memory storage device, controller thereof, and data programming method thereof
CN104615550A (en) Storage equipment bad block processing method and device and storage equipment
CN105487986A (en) Sizing a cache while taking into account a total bytes written requirement
CN105677233A (en) Storage method and storage device for real-time data
CN102455973A (en) Method for setting data field to erase data by using residual space of Flash chip
CN109508142A (en) Data storage device and its operating method
CN105745628A (en) Terminal, service provision apparatus, and coupon server, electronic wallet system having same, control method thereof, and recording medium in which computer program is recorded
CN101561782A (en) Non-volatile memory apparatus and method for accessing a non-volatile memory apparatus
CN105511806A (en) Method for processing write request and mobile terminal
CN108664577B (en) File management method and system based on FLASH idle area
CN104464809A (en) Method for prolonging service life of flash memory
CN105224238B (en) Storage management method, memory storage apparatus and memorizer control circuit unit
CN103543901A (en) Method and device for generating menus
CN104375944A (en) Method and device for storing data
CN105205015A (en) Data storage method and storage equipment
CN109683470A (en) A kind of software and hardware self-adaptive matching method, device and driving device
CN104376872A (en) Method for processing erase interrupt of flash memory
CN106325764A (en) Memory management method, memory control circuit unit and memory storage apparatus
CN102662849B (en) The block management method of multi-channel flash memory

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20200108

Address after: 518119 1 Yanan Road, Kwai Chung street, Dapeng New District, Shenzhen, Guangdong

Patentee after: SHENZHEN BYD MICROELECTRONICS Co.,Ltd.

Address before: BYD 518118 Shenzhen Road, Guangdong province Pingshan New District No. 3009

Patentee before: BYD Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 518119 No.1 Yan'an Road, Kuiyong street, Dapeng New District, Shenzhen City, Guangdong Province

Patentee after: BYD Semiconductor Co.,Ltd.

Address before: 518119 No.1 Yan'an Road, Kuiyong street, Dapeng New District, Shenzhen City, Guangdong Province

Patentee before: BYD Semiconductor Co.,Ltd.

Address after: 518119 No.1 Yan'an Road, Kuiyong street, Dapeng New District, Shenzhen City, Guangdong Province

Patentee after: BYD Semiconductor Co.,Ltd.

Address before: 518119 No.1 Yan'an Road, Kuiyong street, Dapeng New District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN BYD MICROELECTRONICS Co.,Ltd.