CN101923513B - 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 PDF

Info

Publication number
CN101923513B
CN101923513B CN2010102509855A CN201010250985A CN101923513B CN 101923513 B CN101923513 B CN 101923513B CN 2010102509855 A CN2010102509855 A CN 2010102509855A CN 201010250985 A CN201010250985 A CN 201010250985A CN 101923513 B CN101923513 B CN 101923513B
Authority
CN
China
Prior art keywords
data
read
write
address
writing
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.)
Expired - Fee Related
Application number
CN2010102509855A
Other languages
Chinese (zh)
Other versions
CN101923513A (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.)
Shenzhen Coship Electronics Co Ltd
Original Assignee
Shenzhen Coship Electronics 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 Shenzhen Coship Electronics Co Ltd filed Critical Shenzhen Coship Electronics Co Ltd
Priority to CN2010102509855A priority Critical patent/CN101923513B/en
Publication of CN101923513A publication Critical patent/CN101923513A/en
Application granted granted Critical
Publication of CN101923513B publication Critical patent/CN101923513B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

The method of data write-read of storer, system and FLASH storer
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 just 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, like the channel data of STB, 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 possibly 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 solves through following technical scheme:
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 said data may further comprise the steps:
A, interpolation data structure head: in writing data, add the data structure head and form packet, said data structure head comprises Data Identification and data length, and the value of said data length is the total length of said packet; B, search and write the address: b1, read the data with said 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 the reading and writing data address here is that data write the address; If judged result is for being, the value of included data length in the data structure head of this place deposit data bag that then squints, and the data with Data Identification same word joint number, repeating step b2 are read in the address after squint; C, write packet: said packet is write said data write the address.
In some receiving terminal for digital television equipment; STB for example;, each digital television program need new programme information be deposited in the internal storage when upgrading; And device just will read the program information table that deposits in for the last time in the internal storage when STB moves; The packet that promptly deposits in for the last time, therefore in the middle of practice, said data read and can may further comprise the steps: D, search and read the address: d1, read the data with said 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 the squint value of included data length 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 said 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 through 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; Said step e comprises: adopt corresponding decompression algorithm that the data that read are decompressed.When data read, adopt corresponding decompression algorithm that packet is decompressed.
Preferably; Said step B also comprises: b3, write address failure if search; Then wipe said storer, the reading and writing data first address of said storer is write the address as data, said searching writes the address failure and is meant that all judged results are among the said step b2 and is.
The characteristics of combined memory; The byte number of said 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 through following technical scheme:
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, said data structure head comprises Data Identification and data length, and the value of said data length is the total length of said packet; Write-read execution module: be used for storing wherein read data packet with said packet write store with from FLASH; The write-read control module is used for controlling through said data structure head the write-read address of said write-read execution module;
Said write-read control module comprises: write the address control module: be used for writing the following step of fashionable execution: g1 in data: read the data with said 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 said write-read execution module for not with the reading and writing data address here; If judged result is for being, the value of included data length in the data structure head of this place deposit data bag that then squints, and the data with the Data Identification equal length, repeating step g2 are read in the address after squint.
Preferably, said write-read control module also comprises: read the address control module: be used for when data read, carrying out following step: search and read the address: h1, read the data with said 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 the squint value of included data length 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 said write-read execution module for not.
Preferably, said data processing module also comprises compression module: be used for writing in data and fashionablely compress desiring to write data, when data read, carry out corresponding decompression.
Technical matters of the present invention also is achieved through following technical scheme: 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 are through desiring to write data structure head of adding in the data; Addressing according to the Data Identification in the said data structure head and data length write is the storage IP address of next data behind the data length that writes these data of starting point skew of a packet, thereby does not have the waste of storage space between the adjacent packet; Be equivalent to storer 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 causes the indegree write behind the memory erase to reduce; And then cause erasing times to increase; The problem that loss is serious, the method for data write-read of F storer of the present invention have the storer of raising service efficiency, reduce 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 that 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; Said data are write read apparatus and are comprised data processing module, write-read execution module and write-read control module, and said write-read control module comprises and writes the address control module and read the address control module.
In order to realize coming the amount of capacity of the dynamic FLASH of distribution page or leaf according to the length that deposits data in; When data Data desires write store, at first add a data structure strcuct TagFlashHead{ among the data Data desiring to write through said data processing module
Int TYPE; / * data origination sign */
Int LENGTH; / * data length */
; Said data structure head and said data Data form data packets Data1, 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 Data1.The data of the FLASH storer of this embodiment write and may further comprise the steps: (as shown in Figure 1, for the data of this embodiment write schematic flow sheet)
The first step: form packet according to above-mentioned form; Wherein the TYPE value is 0xA0B1C3, and each TYPE value that writes packet all is identical, and the value of this 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 Data1, 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 the length shown in this LENGTH that squints; 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 said write-read execution module, write the address as data; If do not find erasable address then explain that this piece Flash remaining space is not enough; 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 said 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: said write-read execution module receives after said data write the address, and the Flash data that data packets Data1 are written to appointment write the address.
The data of the FLASH storer of this embodiment read and may further comprise the steps: (as shown in Figure 2, for the data of the specific embodiment of the invention read schematic flow sheet)
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 then explains canned data here; Read the LENGTH of this place deposit data bag; And the length shown in this LENGTH that squints, 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; Data read, write all data head through 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 preceding data that once write that data write start position, and any read-write starting point is the length of institute's deposit data bag with the next length of reading and writing between starting point just, promptly is equivalent to each time data and writes and all form a FLASH dynamic page; The size of this paging is a dynamic size, but not fixed size.
In order further to save storage space, this embodiment also can comprise compression module, when writing data, uses compression algorithm to compress to Data, when reading, carries out corresponding decompression algorithm and decompresses, and reduces to write and the reading of data time.
Above content is to combine concrete preferred implementation to the further explain that the present invention did, and can not assert that practical implementation of the present invention is confined to these explanations.For person of ordinary skill in the field of the present invention, under the prerequisite that does not break away from the present invention's design, can also make some simple deduction or replace, all should be regarded as belonging to protection scope of the present invention.

Claims (9)

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 said data may further comprise the steps:
A, interpolation data structure head: in writing data, add the data structure head and form packet, said data structure head comprises Data Identification and data length, and the value of said data length is the total length of said packet;
B, search and write the address: b1, read the data with said 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 the reading and writing data address here is that data write the address; If judged result is for being, the value of included data length in the data structure head of this place deposit data bag that then squints, and the data with Data Identification same word joint number, repeating step b2 are read in the address after squint;
C, write packet: said packet is write said data write the address.
2. method of data write-read according to claim 1 is characterized in that, said data read and may further comprise the steps:
D, search and read the address: d1, read the data with said 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 the squint value of included data length 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 said data read address reading of data.
3. method of data write-read according to claim 2 is characterized in that, said steps A also comprises: adopt compression algorithm to compress desiring to write data; Said 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; Said step B also comprises: b3, write address failure if search; Then wipe said storer, the reading and writing data first address of said storer is write the address as data, said searching writes the address failure and is meant that all judged results are among the said step b2 and is.
5. method of data write-read according to claim 1 is characterized in that, the byte number of said 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 said data structure head comprises Data Identification and data length, and the value of said data length is the total length of said packet;
Write-read execution module: be used for said packet write store with from storing wherein read data packet;
The write-read control module is used for controlling through said data structure head the write-read address of said write-read execution module;
Said write-read control module comprises:
Write the address control module: be used for writing the following step of fashionable execution: g1: read the data with said 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 said write-read execution module for not with the reading and writing data address here; If judged result is for being, the value of included data length in the data structure head of this place deposit data bag that then squints, and the data with the Data Identification equal length, repeating step g2 are read in the address after squint.
7. write read apparatus according to the data of the said storer of claim 6, it is characterized in that, said write-read control module also comprises:
Read the address control module: be used for when data read, carrying out following step: search and read the address: h1, read the data with said 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 the squint value of included data length 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 said write-read execution module for not.
8. write read apparatus according to the data of claim 6 or 7 described storeies, it is characterized in that: said data processing module also comprises compression module: be used for writing in data and fashionablely compress desiring to write data, when data read, carry out corresponding decompression.
9. a FLASH storer is characterized in that, comprises that any described data in the claim 6 to 8 are write read apparatus.
CN2010102509855A 2010-08-11 2010-08-11 Data writing and reading method of memory, system and FLASH memory Expired - Fee Related CN101923513B (en)

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 CN101923513A (en) 2010-12-22
CN101923513B true 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)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102646452B (en) * 2011-02-22 2016-01-20 原相科技股份有限公司 Programmable storage and write thereof and read method
CN108089818B (en) * 2017-12-12 2021-09-07 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN108376052B (en) * 2017-12-14 2021-08-13 北京智芯微电子科技有限公司 Data processing method and device for security chip
CN113126885A (en) * 2020-01-14 2021-07-16 瑞昱半导体股份有限公司 Data writing method, data reading method and storage device
CN111857590B (en) * 2020-07-17 2023-05-05 苏州浪潮智能科技有限公司 NAND effective data reading method and device

Citations (2)

* Cited by examiner, † Cited by third party
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN101923513A (en) 2010-12-22

Similar Documents

Publication Publication Date Title
CN101923513B (en) Data writing and reading method of memory, system and FLASH memory
CN100573476C (en) Flash memory medium data management method
US20140082265A1 (en) Data storage device and flash memory control method thereof
CN100435116C (en) Non-volatile memory and method with memory planes alignment
CN106527969B (en) A kind of Nand Flash memorizer reading/writing method in a balanced way of life-span
CN103324578A (en) NAND flash memory device and random writing method thereof
US8521971B2 (en) System and apparatus for flash memory data management
CN102662856B (en) A kind of solid state hard disc and access method thereof
CN101981551B (en) Apparatus and method for cache utilization
US10545876B2 (en) Control unit for data storage system and method for updating logical-to-physical mapping table
CN101819509A (en) Solid state disk read-write method
CN106406753B (en) A kind of date storage method and data storage device
CN101320594A (en) Physical operation method of flash memory chip
US20120079170A1 (en) Method for performing block management, and associated memory device and controller thereof
US20140328127A1 (en) Method of Managing Non-Volatile Memory and Non-Volatile Storage Device Using the Same
CN101321250B (en) Television set important data storage method
CN103365786A (en) Data storage method, device and system
US20080209161A1 (en) Storage device and method of mapping a nonvolatile memory based on a map history
CN102156731B (en) Data storage method and device for flash memory
CN101216806B (en) Data updating method and device
CN103246615A (en) Method and device for data management in flash memory device
CN101692211B (en) Method for managing Flash data
CN101938594A (en) Volume saving method for digital television set top box
CN101963942A (en) Rapid storage method for nor type flash of set-top box
CN107688435B (en) IO stream adjusting method and device

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120822

Termination date: 20210811