CN101923513A - Data writing and reading method of memory, system and FLASH memory - Google Patents
Data writing and reading method of memory, system and FLASH memory Download PDFInfo
- Publication number
- CN101923513A CN101923513A CN 201010250985 CN201010250985A CN101923513A CN 101923513 A CN101923513 A CN 101923513A CN 201010250985 CN201010250985 CN 201010250985 CN 201010250985 A CN201010250985 A CN 201010250985A CN 101923513 A CN101923513 A CN 101923513A
- Authority
- CN
- China
- Prior art keywords
- data
- read
- write
- address
- storer
- 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
Images
Landscapes
- Read Only Memory (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to a data writing and reading method of a memory, a system and the memory. The data writing and reading method of the invention comprises writing of data and reading of data and concretely comprises the following steps: before the data is written, adding a data structure head comprising data identification and data length into the data to be written to form a data packet; and when the data is written, carrying out addressing of data writing according to the data identification and the data length, and shifting from the starting point of one datum by the length of the datum to obtain the starting point of a next datum. The system of the invention is a system for realizing the method. The memory of the invention is a memory adopting the system. The technical scheme of the invention has the beneficial effects on improving the service efficiency of the memory and reducing the erasing frequency of the memory.
Description
Technical field
Design data field of storage of the present invention particularly relates to a kind of method of data write-read, system and FLASH storer of storer.
Background technology
At present, for serviceable life and the performance that improves storer, storer is carried out paging management, for example Chinese invention patent prospectus CN101174244 discloses a kind of " dynamic management method for flash memory of smart card ", this method is divided into several pages or leaves with FLASH and manages, with the storage of rolling of the data source of frequent operation in using, reducing frequently erasable to same page data, thereby prolong the serviceable life of FLASH storer.
But the capacity fixed size of each page in this method, and the size of user storage data may constantly change, as the channel data of set-top box, along with the variation of the number of programs of operator's operation, its channel list data also can constantly change.If every page size is fixed, then every page storage space be provided with can not be too little, otherwise, can cause user data can not preserve fully with in one page; If but every page of storage space is too big, then may cause the storage space waste, the indegree write after once wiping is restricted, and therefore can increase the erasing times of storer, increases loss.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method of data write-read, system and a kind of FLASH storer of storer, to realize according to the size of each data of storing storer being carried out dynamic paging.
One of technical matters of the present invention is solved by the following technical programs:
A kind of method of data write-read of storer comprises writing of data and reading of data, it is characterized in that writing of described data may further comprise the steps:
A, interpolation data structure head: add the data structure head and form packet in writing data, described data structure head comprises Data Identification and data length, and the value of described data length is the total length of described packet; B, search and write the address: b1, read data with described Data Identification same word joint number from the reading and writing data first address of storer; B2, judge whether the value of these data is identical with Data Identification, if judged result is not for, then output reading and writing data address herein is that data write the address; If judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with Data Identification same word joint number, repeating step b2 are read in the address after be offset; C, write packet: described packet is write described data write the address.
In some receiving terminal for digital television equipment, set-top box for example, when upgrading, each digital television program new programme information need be deposited in the internal storage, and device just will read the program information table that deposits in for the last time in the internal storage when set-top box is moved, the packet that promptly deposits in for the last time, therefore in the middle of practice, described data read can may further comprise the steps: D, search and read the address: d1, read data with described Data Identification same word joint number from the reading and writing data first address of storer; D2, judge whether the value of these data is identical with Data Identification, if judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with Data Identification same word joint number, repeating step d2 are read in the address after the skew; If judged result is not, then the preceding address of the last skew of output is a data read address.E, reading of data: from described data read address reading of data.Such scheme is applied in the digital TV terminal equipment, can be according to the reading and writing data characteristic of digital TV terminal equipment, and the change by address step that legacy memory is read and write data can improve the space availability ratio to storer in the equipment.
Preferably, in order to save storage space, adopt compression algorithm to compress to desiring to write data; Described step e comprises: adopt corresponding decompression algorithm that the data that read are decompressed.In data read, adopt corresponding decompression algorithm that packet is decompressed.
Preferably, described step B also comprises: b3, write address failure if search, then wipe described storer, the reading and writing data first address of described storer is write the address as data, described searching writes the address failure and is meant that all judged results are among the described step b2 and is.
The characteristics of combined memory, the byte number of described Data Identification (being the length of value) is 8 bytes or 16 bytes or longer, the less storer of capacity can adopt 8 bytes to save the space, and the storer that capacity is bigger can suitably adopt 16 bytes or longer to guarantee the effect of identification data.
Technical matters of the present invention also is achieved by the following technical programs:
A kind of data of storer are write read apparatus, comprise: data processing module, be used for desiring to write data adding data structure head composition packet, described data structure head comprises Data Identification and data length, and the value of described data length is the total length of described packet; Write-read execution module: be used for storing wherein read data packet with described packet write store with from FLASH; The write-read control module is used for controlling by described data structure head the write-read address of described write-read execution module.
Preferably, described write-read control module comprises: write the address control module: be used for writing the following step of fashionable execution: g1 in data: read data with described Data Identification same word joint number from the reading and writing data first address of storer; G2, judging whether the value of these data is identical with Data Identification, is that data write the address if judged result, is then controlled described write-read execution module for not with herein reading and writing data address; If judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with the Data Identification equal length, repeating step g2 are read in the address after be offset.
Preferably, described write-read control module also comprises: read the address control module: be used for carrying out following step when data read: search and read the address: h1, read data with described Data Identification equal length from the reading and writing data first address of storer; Whether the value of the data that h2, judgement are read is identical with Data Identification, if judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with the Data Identification equal length, repeating step h2 are read in the address after the skew; Address before with last skew is a data read address if judged result, is then controlled described write-read execution module for not.
Preferably, described data processing module also comprises compression module: be used for writing in data and fashionablely compress desiring to write data, carry out corresponding decompression when data read.
Technical matters of the present invention also is achieved by the following technical programs: a kind of storer, it is characterized in that, and comprise that aforesaid any one data write read apparatus.
Compared with prior art, the method of data write-read of storer of the present invention, system is by desiring to write data structure head of adding in the data, the addressing that writes according to the Data Identification in the described data structure head and data length, from writing behind the data length that starting point is offset these data of a packet is the storage IP address of next data, thereby there is not the waste of storage space between the adjacent packet, be equivalent to storer be carried out dynamic paging according to the size that writes packet at every turn, thereby when having solved the fixed size paging, small data is write fashionable waste storage space, thereby cause the indegree write behind the memory erase to reduce, and then cause erasing times to increase, the problem that loss is serious, the method of data write-read of F storer of the present invention has the storer of raising service efficiency, reduces the beneficial effect of memory erase number of times.FLASH storer of the present invention has adopted aforesaid reading and writing data management system, therefore also has space availability ratio height, the low characteristics of loss.
Description of drawings
Fig. 1 is that specific embodiment of the invention data write schematic flow sheet;
Fig. 2 is a specific embodiment of the invention data read schematic flow sheet.
Embodiment
For disclosing technical scheme of the present invention more fully, technical scheme of the present invention is set forth below in conjunction with embodiment.
This embodiment is that (but the application of method of data write-read of the present invention and system is not limited to the FLASH storer to a kind of FLASH storer, can be applied to other similar nonvolatile memories equally), comprise that data write read apparatus, described data are write read apparatus and are comprised data processing module, write-read execution module and write-read control module, and described write-read control module comprises and writes the address control module and read the address control module.
For the amount of capacity that realizes distributing the FLASH page or leaf dynamically, when data Data desire write store, at first add a data structure strcuctTagFlashHead{ among the data Data desiring to write by described data processing module according to the length that deposits data in
Int TYPE; / * data origination sign */
Int LENGTH; / * data length */
; Described data structure head and described data Data form data packets Datal, and wherein the TYPE territory is the beginning flag of identification data, and the LENGTH territory is used for identifying the total length of current data packets Datal.The data of the FLASH storer of present embodiment write and may further comprise the steps: (as shown in Figure 1, the data for present embodiment write schematic flow sheet)
The first step: form packet according to above-mentioned form, wherein the TYPE value is 0xA0B1C3, each TYPE value that writes packet all is identical, the value of present embodiment is made as 0xA0B1C3, length is that 8 bytes (are that byte number is 8 bytes, can also get the numerical value of other length and type in the practice,, not influence enforcement of the present invention as long as can play the effect of identification data packet; The value of LENGTH is the length of this data packets Datal, owing to write the length of data package difference at every turn, so the value of LENGTH also changes thereupon;
Second step: search and write the address: said write address control module reads the data of identical with the TYPE byte number (8 byte) from the first address fAddress of FLASH configuring area, judge whether these data are TYPE value 0xA0B1C3, if 0xA0B1C3, show that then this address stored packet, can not write once more; Then read the data length LENGTH that is comprised in the data structure head of this place deposit data bag, and after being offset the length shown in this LENGTH, address after skew is read the data identical with the TYPE byte number once more, and relatively whether these data are TYPE value 0xA0B1C3; If not, show that then this address does not deposit data as yet in, then export the data write-read address of this data field and give described write-read execution module, write the address as data; If do not find erasable address then this piece Flash remaining space deficiency be described, can't write new data, then wipe the flash configuring area again, write the configuring area first address fAddress that the flash address is exactly this piece flash this moment, and described first address is sent to the write-read execution module.The configuring area of FLASH is the zone of read-write data in this embodiment.
The 3rd step: described write-read execution module receives after described data write the address, and the Flash data that data packets Datal are written to appointment write the address.
The data read of the FLASH storer of present embodiment may further comprise the steps: the data read schematic flow sheet of the specific embodiment of the invention (as shown in Figure 2, for)
The first step: search and read the address: read the address control module and at first read the data identical with the TYPE byte number from the configuring area first address fAddress of storer, relatively whether these data are TYPE value 0xA0B1C3, if 0xA0B1C3, canned data herein then is described, read the LENGTH of this place deposit data bag, and be offset length shown in this LENGTH, and the data identical with the TYPE byte number are read in the address after the skew once more, and relatively whether the TYPE value is 0xA0B1C3; If not, the data of previous data (data of being deposited in the FLASH address before the promptly last skew) for depositing at last then are described, then export previous Flash address (the FLASH address before the promptly last skew) and give the write-read execution module as reading the address.
Second step: the write-read execution module reads address reading data according to this after receiving and reading the address.
Write more than the employing and read step, reading of data, write all data head by data packets carry out addressing (but not picture fixedly paging with changeless page address as reading, write the address), data first after wiping write the address and are fixed as the first address, it is relevant with the length of the data of preceding write-once that data write start position, length between any one read-write starting point and next read-write starting point is the length of institute's deposit data bag just, promptly being equivalent to each time data writes and all forms a FLASH dynamic page, the size of this paging is a dynamic size, but not fixed size.
In order further to save storage space, present embodiment also can comprise compression module, uses compression algorithm to compress to Data when writing data, carries out corresponding decompression algorithm and decompress when reading, and reduces to write and the reading of data time.
Above content be in conjunction with concrete preferred implementation to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the technician of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.
Claims (10)
1. the method for data write-read of a storer comprises writing of data and reading of data, it is characterized in that writing of described data may further comprise the steps:
A, interpolation data structure head: add the data structure head and form packet in writing data, described data structure head comprises Data Identification and data length, and the value of described data length is the total length of described packet;
B, search and write the address: b1, read data with described Data Identification same word joint number from the reading and writing data first address of storer; B2, judge whether the value of these data is identical with Data Identification, if judged result is not for, then output reading and writing data address herein is that data write the address; If judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with Data Identification same word joint number, repeating step b2 are read in the address after be offset;
C, write packet: described packet is write described data write the address.
2. method of data write-read according to claim 1 is characterized in that, described data read may further comprise the steps:
D, search and read the address: d1, read data with described Data Identification same word joint number from the reading and writing data first address of storer; D2, judge whether the value of these data is identical with Data Identification, if judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with Data Identification same word joint number, repeating step d2 are read in the address after the skew; If judged result is not, then the preceding address of the last skew of output is a data read address.
E, reading of data: from described data read address reading of data.
3. method of data write-read according to claim 2 is characterized in that, described steps A also comprises: adopt compression algorithm to compress desiring to write data; Described step e also comprises: adopt corresponding decompression algorithm that the data that read are decompressed.
4. method of data write-read according to claim 1, it is characterized in that, described step B also comprises: b3, write address failure if search, then wipe described storer, the reading and writing data first address of described storer is write the address as data, and described searching writes address failure and is meant that all judged results are among the described step b2 and is.
5. method of data write-read according to claim 1 is characterized in that, the byte number of described Data Identification is 8 bytes or 16 bytes.
6. the data of a storer are write read apparatus, comprising:
Data processing module is used for desiring to write data adding data structure head composition packet, and described data structure head comprises Data Identification and data length, and the value of described data length is the total length of described packet;
Write-read execution module: be used for described packet write store with from storing wherein read data packet;
The write-read control module is used for controlling by described data structure head the write-read address of described write-read execution module.
7. write read apparatus according to the data of the described storer of claim 6, it is characterized in that, described write-read control module comprises:
Write the address control module: be used for writing the following step of fashionable execution: g1: read data with described Data Identification same word joint number from the reading and writing data first address of storer in data; G2, judging whether the value of these data is identical with Data Identification, is that data write the address if judged result, is then controlled described write-read execution module for not with herein reading and writing data address; If judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with the Data Identification equal length, repeating step g2 are read in the address after be offset.
8. write read apparatus according to the data of the described storer of claim 7, it is characterized in that, described write-read control module comprises:
Read the address control module: be used for when data read, carrying out following step: search and read the address: h1, read data with described Data Identification equal length from the reading and writing data first address of storer; Whether the value of the data that h2, judgement are read is identical with Data Identification, if judged result is for being, then be offset the value of data length included in the data structure head of this place deposit data bag, and the data with the Data Identification equal length, repeating step h2 are read in the address after the skew; Address before with last skew is a data read address if judged result, is then controlled described write-read execution module for not.
9. write read apparatus according to the data of claim 6,7 or 8 described storeies, it is characterized in that: described data processing module also comprises compression module: be used for writing in data and fashionablely compress desiring to write data, carry out corresponding decompression when data read.
10. a FLASH storer is characterized in that, comprises that any described data in the claim 6 to 9 are write read apparatus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102509855A CN101923513B (en) | 2010-08-11 | 2010-08-11 | Data writing and reading method of memory, system and FLASH memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2010102509855A CN101923513B (en) | 2010-08-11 | 2010-08-11 | Data writing and reading method of memory, system and FLASH memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101923513A true CN101923513A (en) | 2010-12-22 |
CN101923513B CN101923513B (en) | 2012-08-22 |
Family
ID=43338464
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2010102509855A Expired - Fee Related CN101923513B (en) | 2010-08-11 | 2010-08-11 | Data writing and reading method of memory, system and FLASH memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101923513B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102646452A (en) * | 2011-02-22 | 2012-08-22 | 原相科技股份有限公司 | Programmable memory and writing and reading method thereof |
CN108089818A (en) * | 2017-12-12 | 2018-05-29 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
CN108376052A (en) * | 2017-12-14 | 2018-08-07 | 北京智芯微电子科技有限公司 | A kind of data processing method and device of safety chip |
CN111857590A (en) * | 2020-07-17 | 2020-10-30 | 苏州浪潮智能科技有限公司 | NAND effective data reading method and device |
CN113126885A (en) * | 2020-01-14 | 2021-07-16 | 瑞昱半导体股份有限公司 | Data writing method, data reading method and storage device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1124378A (en) * | 1994-04-19 | 1996-06-12 | 株式会社日立制作所 | Data processor |
US5784698A (en) * | 1995-12-05 | 1998-07-21 | International Business Machines Corporation | Dynamic memory allocation that enalbes efficient use of buffer pool memory segments |
-
2010
- 2010-08-11 CN CN2010102509855A patent/CN101923513B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1124378A (en) * | 1994-04-19 | 1996-06-12 | 株式会社日立制作所 | Data processor |
US5784698A (en) * | 1995-12-05 | 1998-07-21 | International Business Machines Corporation | Dynamic memory allocation that enalbes efficient use of buffer pool memory segments |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102646452A (en) * | 2011-02-22 | 2012-08-22 | 原相科技股份有限公司 | Programmable memory and writing and reading method thereof |
CN102646452B (en) * | 2011-02-22 | 2016-01-20 | 原相科技股份有限公司 | Programmable storage and write thereof and read method |
CN108089818A (en) * | 2017-12-12 | 2018-05-29 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
CN108089818B (en) * | 2017-12-12 | 2021-09-07 | 腾讯科技(深圳)有限公司 | Data processing method, device and storage medium |
CN108376052A (en) * | 2017-12-14 | 2018-08-07 | 北京智芯微电子科技有限公司 | A kind of data processing method and device of safety chip |
CN113126885A (en) * | 2020-01-14 | 2021-07-16 | 瑞昱半导体股份有限公司 | Data writing method, data reading method and storage device |
CN111857590A (en) * | 2020-07-17 | 2020-10-30 | 苏州浪潮智能科技有限公司 | NAND effective data reading method and device |
CN111857590B (en) * | 2020-07-17 | 2023-05-05 | 苏州浪潮智能科技有限公司 | NAND effective data reading method and device |
Also Published As
Publication number | Publication date |
---|---|
CN101923513B (en) | 2012-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100573476C (en) | Flash memory medium data management method | |
US10545876B2 (en) | Control unit for data storage system and method for updating logical-to-physical mapping table | |
CN101923513B (en) | Data writing and reading method of memory, system and FLASH memory | |
US7937522B2 (en) | Method for flash memory data management | |
CN103324578A (en) | NAND flash memory device and random writing method thereof | |
CN102339254A (en) | Flash data storage method for intelligent electric energy meter | |
US20120079170A1 (en) | Method for performing block management, and associated memory device and controller thereof | |
CN102662856A (en) | Solid state disk and access method | |
CN102681946A (en) | Memory access method and device | |
CN101321250B (en) | Television set important data storage method | |
KR101400506B1 (en) | Non-volatile Memory Controller and Control Method Therefor | |
CN101673246A (en) | High-efficient first-in first-out (FIFO) data pool reading and writing method | |
CN103294607A (en) | Memory management method | |
CN102306124A (en) | Method for implementing hardware driver layer of Nand Flash chip | |
US8856425B2 (en) | Method for performing meta block management, and associated memory device and controller thereof | |
CN102156731B (en) | Data storage method and device for flash memory | |
CN101216806B (en) | Data updating method and device | |
CN103092771A (en) | Solid-state storing device and control method of cache thereof | |
CN102243611A (en) | Data storage method and system | |
CN101938594A (en) | Volume saving method for digital television set top box | |
CN101692211B (en) | Method for managing Flash data | |
CN101963942A (en) | Rapid storage method for nor type flash of set-top box | |
CN102469357A (en) | Method and system for storing user operation data and receiving terminal of digital television | |
US8566562B2 (en) | Method for sequentially writing data with an offset to a non-volatile memory | |
US20090055574A1 (en) | NAND Flash Memory Device And Related Method Thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120822 Termination date: 20210811 |
|
CF01 | Termination of patent right due to non-payment of annual fee |