CN109683803A - A kind of data processing method and device - Google Patents

A kind of data processing method and device Download PDF

Info

Publication number
CN109683803A
CN109683803A CN201710979022.0A CN201710979022A CN109683803A CN 109683803 A CN109683803 A CN 109683803A CN 201710979022 A CN201710979022 A CN 201710979022A CN 109683803 A CN109683803 A CN 109683803A
Authority
CN
China
Prior art keywords
area
data
written
solid
state memory
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
CN201710979022.0A
Other languages
Chinese (zh)
Other versions
CN109683803B (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201710979022.0A priority Critical patent/CN109683803B/en
Publication of CN109683803A publication Critical patent/CN109683803A/en
Application granted granted Critical
Publication of CN109683803B publication Critical patent/CN109683803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/062Securing storage systems
    • G06F3/0622Securing storage systems in relation to access
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1044Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices with specific ECC/EDC distribution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0656Data buffering arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

Abstract

The embodiment of the invention discloses a kind of data processing method and devices, applied to the first solid-state memory, first solid-state memory can be divided into multiple partition holdings, each memory block subregion can be divided into multiple pieces, each piece is divided into multiple pages, and every page of storage region is at least made of first area and second area;The described method includes: being index with the corresponding page number in the first area when detecting that preset document system needs that cleaning label is written to first area, the first data of the first area should be written in caching;When the second data need to be written to second area corresponding with the first area in determination, by the first data that the first area should be written and the second data that the second area should be written combination the first solid-state memory of write-in.

Description

A kind of data processing method and device
Technical field
The present invention relates to the solid-state memory field (FLASH) more particularly to a kind of data processing method and devices.
Background technique
Currently, Serial Peripheral Interface (SPI) (SPI, Serial Peripheral Interface) NAND (Not AND) FLASH NAND FLASH is gradually substituted, because SPI NAND FLASH is small in size, pin is few, and is used for the difference of NAND FLASH False retrieval is surveyed and correction algorithm (ECC, Error Checking and Correction) is not dependent on host CPU (CPU, Central Processing Unit's), the FLASH ECC module of host CPU can be saved, it can be with save the cost.
For embedded device huge for delivering amount, many costs can be saved using SPI NAND FLASH.
Summary of the invention
In order to solve the above technical problems, can prevent an embodiment of the present invention is intended to provide a kind of data processing method and device The method for generating ECC error when only SPI NAND FLASH is used.
In a first aspect, it is applied to the first solid-state memory the embodiment of the invention provides a kind of data processing method, it is described First solid-state memory can be divided into multiple partition holdings, and each memory block subregion can be divided into multiple pieces, each piece be divided into it is multiple Page, every page of storage region are at least made of first area and second area;The described method includes:
When detecting that preset document system needs that cleaning label is written to first area, with the corresponding page in the first area Number for index, the first data of the first area should be written in caching;
When the second data need to be written to second area corresponding with the first area in determination, firstth area should be written First data in domain and the second data combination the first solid-state memory of write-in that the second area should be written.
It is optionally, described by the first data that the first area be written and should to be written described in the embodiment of the present invention The second data combination the first solid-state memory of write-in of second area, comprising:
Determination need to second area corresponding with the first area be written the second data when, search whether caching with The corresponding page number in the first area is the first data of the first area of index;
If so, the first data of the first area combining write-in with the second data that the second area should be written First solid-state memory;
If not provided, determining the first data that the first area should not be written, and the second area should only be written The second data be written the first solid-state memory.
It is optionally, described by the first data that the first area be written and should to be written described in the embodiment of the present invention The second data combination the first solid-state memory of write-in of second area, comprising:
The first area of every page and second area are divided into four groups, obtain four groups by first area and second area group At data pair;
In the form of data pair, by the first data that the first area should the be written and second area should be written the Data are written to the first solid-state memory in two data.
In the embodiment of the present invention, optionally, the method also includes:
If preset operating system scans content in partition holding scanning result when carrying out carry to partition holding is Content is sky in the partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
In the embodiment of the present invention, optionally, the first page write-in cleaning mark to each of described partition holding piece Note, comprising:
To the first area write-in cleaning label in first group in first page.
In the embodiment of the present invention, optionally, the method also includes:
In host CPU (CPU) after the N pages content read in first solid-state memory in m-th block, If receiving the first acquisition instruction that the host CPU is sent, reads in the status register of first solid-state memory and use In the ECC field of characterization error detection and correction algorithm (ECC) mode bit;Wherein, described first check that instruction is used to indicate reading Take the ECC mode bit in first solid-state memory in status register;
It is returned to the host CPU described for characterizing the ECC field of ECC mode bit.
Second aspect, the embodiment of the invention provides a kind of data processing equipments, are applied to the first solid-state memory, described First solid-state memory can be divided into multiple partition holdings, and each memory block subregion can be divided into multiple pieces, each piece be divided into it is multiple Page, every page of storage region are at least made of first area and second area;Described device includes:
Cache module, when for detecting that preset document system needs that cleaning label is written to first area, with described the The corresponding page number in one region is index, and the first data of the first area should be written in caching;
Control module will answer when the second data need to be written to second area corresponding with the first area for determination The first data of the first area are written and the second data combination the first solid-state storage of write-in of the second area should be written Device.
In the embodiment of the present invention, optionally, the control module is specifically used for:
When the second data need to be written to second area corresponding with the first area in determination, searched from the cache module Whether first data with first area that the first area corresponding page number be index of caching are had;
If so, the first data of the first area combining write-in with the second data that the second area should be written First solid-state memory;
If not provided, determining the first data that the first area should not be written, the second area will should only be written The first solid-state memory is written in second data.
In the embodiment of the present invention, optionally, the control module is specifically used for:
The first area of every page and second area are divided into four groups, obtain four groups by first area and second area group At data pair;
In the form of data pair, by the first data that the first area should the be written and second area should be written the Data are written to the first solid-state memory in two data.
In the embodiment of the present invention, optionally, the control module is also used to:
If preset operating system scans content in partition holding scanning result when carrying out carry to partition holding is Content is sky in the partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
In the embodiment of the present invention, optionally, the control module is specifically used for:
To the first area write-in cleaning label in first group in first page.
In the embodiment of the present invention, optionally, the control module is also used to:
In host CPU after the N pages content read in first solid-state memory in m-th block, if receiving described The first acquisition instruction that host CPU is sent then is read in the status register of first solid-state memory for characterizing ECC state The ECC field of position;Wherein, described first check that instruction is used to indicate in reading first solid-state memory in status register ECC mode bit;It is returned to the host CPU described for characterizing the ECC field of ECC mode bit.
The third aspect, the embodiment of the invention also provides a kind of computer storage medium, in the computer storage medium Computer executable instructions are stored with, the computer executable instructions are for executing data processing described in the embodiment of the present invention Method.
In the technical solution of the embodiment of the present invention, it is applied to the first solid-state memory, first solid-state memory can divide At multiple partition holdings, each memory block subregion can be divided into multiple pieces, and each piece is divided into multiple pages, and every page of storage region is extremely It is few to be made of first area and second area;The described method includes: detecting that preset document system needs to be written to first area It is index with the corresponding page number in the first area when cleaning label, the first data of the first area should be written in caching;Really When the second data need to be written to second area corresponding with the first area surely, the first number of the first area will should be written The first solid-state memory of write-in is combined according to the second data that the second area should be written.It proposes through the embodiment of the present invention Technical solution, since the first data of the first area should be written in use and the second data of the second area should be written Combination the first solid-state memory of write-in, rather than first the first data of the first area should be written in write-in, then be written institute should be written The second data for stating second area can effectively prevent the method for generating ECC error when SPI NAND FLASH is used.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of data processing method of the embodiment of the present invention;
Fig. 2 is that page provided by the invention is laid out a kind of signal of (page Assignment) and data to (Data pair) Figure;
Fig. 3 is the flow chart of Jffs2 file system provided by the invention write-in cleaning label (cleanmarker);
Process flow diagram of Fig. 4 jffs2 file system provided by the invention to second area (region main) write-in data;
Fig. 5 is a kind of composed structure schematic diagram of data processing equipment of the embodiment of the present invention.
Specific embodiment
The characteristics of in order to more fully hereinafter understand the embodiment of the present invention and technology contents, with reference to the accompanying drawing to this hair The realization of bright embodiment is described in detail, appended attached drawing purposes of discussion only for reference, is not used to limit the embodiment of the present invention.
Following first solid-state memory as described in the examples, including but not limited to: NAND FLASH, SPI NAND FLASH。
Following first area as described in the examples refers to the region spare, also referred to as spare area;In following embodiment The second area refers to the region main, also referred to as main-data area;Wherein, the first area is at least used to store cleaning mark Remember (cleanmarker), correspond to different types of FLASH certainly, the first area can also be used to store bad block label, ECC Check value and information about page;Wherein, the second area is for storing user data.It is following as described in the examples to be The system for needing that data are written to first area (region spare), such as Jffs2 file system.
Below by taking Jffs2 file system as an example, Jffs2 file system is introduced to SPI NAND FLASH, data are written The problems of when.
Jffs2 file system when each carry FLASH subregion for subregion be it is empty in the case where can be toward FLASH The region the spare write-in cleaning label (cleanmarker) of first page (page) of each piece (block) in subregion, behind Just content can be written toward the region main when writing data, since SPI NAND FLASH is each page when calculating ECC The region spare and the region main be all divided into 4 groups, ECC is calculated according to every group, if first writing the region spare can also calculate ECC comes out, and can calculate ECC again until write the region main when, and the ECC for writing the calculating of the region spare has been written into FLASH In, the position of the region spare ECC storage can be also written in the ECC for writing the calculating of the region main, but spare can not be completely covered The ECC of region write-in cannot write 1 from 0 because the characteristic of FLASH is can only to be written as 0 from 1, cause to read this page below When, FLASH judges that the ECC state in status register for wrong (error), i.e., can prompt currently-read to host CPU Content mistake or failure.
Embodiment one
Fig. 1 is a kind of flow diagram of data processing method of the embodiment of the present invention, is applied to the first solid-state memory, First solid-state memory can be divided into multiple partition holdings, and each memory block subregion can be divided into multiple pieces, and each piece is divided into Multiple pages, every page of storage region are at least made of first area (region spare) and second area (region main);Such as Fig. 1 It is shown, which comprises
Step 101: when detecting that preset document system needs that cleaning label is written to first area, with the first area Corresponding page number is index, and the first data of the first area should be written in caching.
In the present embodiment, the preset document system refers to needs write-in cleaning in first area into every page of storage region The file system of label, such as Jffs2 file system.That is, all file system for needing to operate the region spare, this hair The bright method being previously mentioned is all suitable for.
Wherein, the first area is at least used to be written cleaning label.
Wherein, first data include at least cleaning label.
Certainly, for different preset document systems, the writable data in the first area may further include other letters Breath, as stored bad block label, ECC check value and the page information of the page belonging to the first area.
That is, when detecting that preset document system needs that cleaning label is written to first area, temporarily not to described First area write-in cleaning label, but the first area should be written using the corresponding page number in the first area as indexed cache The first data.It is come out in this way, being avoided that problem occur in that first writing the region spare also and can calculate ECC, until writing the area main ECC can be calculated when domain again, the ECC for writing the calculating of the region spare has been written into FLASH, writes the ECC of the region main calculating Also the position of the region spare ECC storage can be written, but the ECC of the region spare write-in can not be completely covered.
In general, minimum unit when carrying out write operation is page, and minimum unit when carrying out erasing operation is block.
Step 102: when data need to be written to second area corresponding with the first area in determination, described the should be written First data in one region and the second data combination the first solid-state memory of write-in that the second area should be written.
Wherein, the second area is for storing user data.
As an optional implementation manner, described by the first data that the first area be written and should to be written described The second data combination the first solid-state memory of write-in of second area, comprising:
Determination need to second area corresponding with the first area be written the second data when, search whether caching with The corresponding page number in the first area is the first data of the first area of index;
If so, the first data of the first area combining write-in with the second data that the second area should be written First solid-state memory;
If not provided, determining the first data that the first area should not be written, the second area will should only be written The first solid-state memory is written in second data.
For example, the region spare corresponding first of page 1 of the block a in partition holding A is cached in cache module Data, first data include cleaning label;Detect the region main of page 1 write-in for needing the block a into partition holding A When the second data, searched whether from cache module corresponding with the region spare that page 1 of the block a in partition holding A is index The first data and should be written if so, by page 1 of the block a in partition holding A of corresponding first data in the region spare Corresponding second data combination the first solid-state memory of write-in in the region main of page 1 of block a in partition holding A;If not yet Have, only the first solid-state storage is written in the second data corresponding with page 1 of the block a that should be written in partition holding A of the region main Device.
As an implementation, described the first data that the first area be written and secondth area will should to be written Second data combination first solid-state memory of write-in in domain, comprising:
The first area of every page and second area are divided into four groups, obtain four groups by first area and second area group At data pair;
The first data of the first area will should be written and the second data of the second area should be written, with data pair Form, to the first solid-state memory be written data.
Fig. 2 is that page provided by the invention is laid out a kind of signal of (page Assignment) and data to (Data pair) Figure;Each page (page) can be divided into two kinds of regions, and one is the regions spare;One is the regions main, as shown in Fig. 2, one A page (page) is divided into first area (region spare) and second area (region main), again by the region main and the region spare 4 parts respectively it have been divided into, it is seen then that four groups of regions pair being made of first area and second area are always obtained, it may be assumed that by being identified as The region pair that the first area of 1st and the second area for being identified as 1st form, by being identified as the first area of 2nd and being identified as The region pair of the second area composition of 2nd, the area being made of the first area for being identified as 3rd and the second area for being identified as 3rd Domain pair, the region pair being made of the first area for being identified as 4th and the second area for being identified as 4th.Specifically, in write-in data When, it should be to each region to write-in data.For example, determine the second data are written to the second area of 1st when, while should be to The first data are written in the first area of 1st;Determine the second data are written to the second area of 2nd when, while should be to the of 2nd The first data are written in one region.
It but when calculating ECC is calculated as unit of Data pair.As it can be seen that being always obtained four groups by first The data pair in region and second area composition form mark by the first area for being identified as 1st and the second area for being identified as 1st For the data pair of 1st, the data for being identified as 1st are made of the first area for being identified as 1st and the second area for being identified as 1st It is right, the data pair for being identified as 2nd are made of the first area for being identified as 2nd and the second area for being identified as 2nd, by being identified as The first area of 3rd and the second area composition for being identified as 3rd are identified as the data pair of 3rd, by the first area for being identified as 4th The data pair for being identified as 4th are formed with the second area for being identified as 4th.
Further, the method also includes:
If preset operating system scans content in partition holding scanning result when carrying out carry to partition holding is Content is sky in the partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
Here, the preset operating system can be linux system.Certainly, the preset operating system can also be it The operating system of his type, such as Windows system, no longer enumerated here.
As a kind of specific embodiment, the first page write-in cleaning mark to each of described partition holding piece Note, comprising:
To the first area write-in cleaning label in first group in first page.
For example, each of partition holding piece is each divided into multipage, and each piece of first page is divided into 4 A first area and 4 second areas;So, for each first page, formation is combined by first area and second area Total 4 groups of region, be denoted as first group, second group, third group and the 4th group respectively;In write-in cleaning label, it is not necessarily to this First area write-in cleaning label in each group in 4 groups, and cleaning label need to only be written to the first area in first group ?.
As an optional implementation manner, the method also includes:
In host CPU after the N pages content read in first solid-state memory in m-th block, if receiving described The first acquisition instruction that host CPU is sent then is read in the status register of first solid-state memory for characterizing ECC state The ECC field of position;Wherein, described first check that instruction is used to indicate in reading first solid-state memory in status register ECC mode bit;
It is returned to the host CPU described for characterizing the ECC field of ECC mode bit.
In this way, the host CPU can characterize the ECC field of ECC mode bit based on the received, to judge that it is read Data whether be correct.
In general, host CPU is after the N pages content read in m-th block in first solid-state memory, Ke Yixuan Selecting property the first acquisition instruction is sent to the first solid-state memory, that is to say, that the first acquisition instruction can be sent, it can also not Send acquisition instruction.
In general, a total of 8 of ECC field, wherein there is two to be used to characterize ECC mode bit.
For example, this two representation is 00,01,02,03, wherein 00 indicates that currently-read data are Correctly;02 indicates that currently-read data are wrong;01 indicates that currently-read data are the data through verifying, And do not use maximum checking feature;03 indicates that currently-read data are the data through verifying, and has used most senior colonel Test ability.In practical application, which kind of concrete meaning 01 and 03 specifically indicate, can be set according to the actual situation by producer.
In fact, sending the value in relation to ECC mode bit in read status register to the first solid-state memory in host CPU Before order, what host CPU was sent to the first solid-state memory is the order for reading the data of certain one page, then the first solid-state storage Device returns to the data of this page to host CPU.First solid-state memory whether the value in relation to ECC mode bit in read status register, The order for allowing it to read the value of host CPU transmission whether is received depending on FLASH.
The technical solution proposed through the embodiment of the present invention, due to using the first data that the first area should be written The first solid-state memory of write-in is combined with the second data that the second area should be written, rather than first write-in should be written described first First data in region, then the second data that the second area should be written are written, can effectively prevent SPI NAND FLASH makes The method of used time generation ECC error.
Embodiment two
In the following, introducing SPI NAND with SPI NAND FLASH of the model TC58CVG0S3HRAIG of Toshiba The calculation method of ECC in FLASH chip, the size 2048+64B of next page the case where FLASH opens ECC function, separately The outer ECC area there are one 64B is to stash sightless, is responsible for filling in by FLASH chip oneself.Wherein, for one The 2048+64B of a page, therein 2048 are used to the distribution of the region main;64B therein is used to the region spare Distribution.FLASH does not open the size 2048+128B of the case where ECC function next page.
It as shown in Fig. 2, one page points are the region main and the region spare, but is with Data when calculating ECC What pair was unit to calculate, that is, the region main and the region spare have been divided into 4 parts again.
Jffs2 file system can scan whether content in FLASH is sky when carrying out carry to FLASH subregion, such as Fruit is sky, then can be to write-in cleaning label (cleanmarker) in first page of each block, and representing the FLASH can be with Use directly is fetched, usually, a block=64page.Fig. 3 shows Jffs2 file system write-in cleaning label Flow chart, as shown in figure 3, the process specifically includes that
Step 301: detecting that Jffs2 file system needs that cleaning label (cleanmarker) is written;
Mtd layers of step 302:Jffs2 file system call driving;
First area (spare should be written to cache in the driving of step 302:Jffs2 file system call FLASH controller Region) cleaning label.
That is, Jffs2 file system can call mtd layers of drive when Jffs2 file system needs to be written cleaning label It is dynamic, it then finally calls the driving of FLASH controller to write cleanmarker, needs exist for the cleaning label to first area It is cached, the index of caching is that the region spare is No. page corresponding.
Subsequent jffs2 file system is when saving data, if having used first page of some block, just The data in the corresponding region spare can be searched whether from cache module according to this No. page.
Fig. 4 shows jffs2 file system to the process flow diagram of second area (region main) write-in data, such as Fig. 4 Shown, which includes:
Content is written into the region main of FLASH in step 401:jffs2 file system, jumps to step 402;
Wherein, FLASH when in use, mainly there is 2 kinds of usage modes.One is naked operations, i.e., oneself is directly operated;It is another Kind is to manage FLASH by file system such as jffs2 file system.
Step 402: the mtd layer driving for calling linux kernel to provide jumps to step 403;
Step 403: the driving of bottom FLASH controller has searched whether the corresponding first area (area spare according to page Domain), if so, jumping to step 404;If not provided, jumping to step 405;
Here, Jffs2 file system itself is a kind of driving;Mtd layers of driving are a kind of driving in itself;Bottom FLASH control Device driving processed is a kind of driving in itself;Jffs2 file system, mtd layers of driving, the driving of bottom FLASH controller are all in LINUX A part of core.
However, the driving of bottom FLASH controller may be different for different host CPUs;But Jffs2 File system, mtd layers of driving are typically all general.
Step 404: after second area (region main) and first area (region spare) combination, being written to together In FLASH, step 406 is jumped to;
Step 405: only content in second area (region main) being written in FLASH, jumps to step 406;
Step 406: the ECC field of status register in FLASH is read, if for characterizing ECC mode bit in ECC field ECC field be the first preset value, jump to step 407;If the ECC field in ECC field for characterizing ECC mode bit is Second preset value, jumps to step 408;
Wherein, the first preset value indicates that currently-read data are correct;Second preset value indicates currently-read Data be wrong.
Step 407: being returned success message to host CPU, terminate whole flow process;
That is, informing host CPU, the data which reads are correctly, to be equivalent to and read data success.
Step 408: returning to failed message to host CPU, terminate whole flow process.
That is, inform host CPU, the host CPU read data be it is wrong, be equivalent to reading data failure.
In practical application, if first writing the region spare for any one page in SPI NAND FLASH, then write The region main is easy to cause ECC error, first caches the region spare content the present invention provides a kind of, then writes the region main When the method that the region main and spare is written together is solved the problems, such as again ECC error.Specifically, Jffs2 file system For system when cleanmarker is written to the region spare, the driving of bottom FLASH controller is first corresponding with the region spare Page is index, caches spare area data, is index with this page when using the region main of this page It goes to have searched whether corresponding spare area data, if so, the region main and the region spare are then incorporated into FLASH together In.In this way, can effectively prevent the method that SPI NAND FLASH generates ECC error when in use.
Embodiment three
Fig. 5 is a kind of composed structure schematic diagram of data processing equipment of the embodiment of the present invention, is deposited applied to the first solid-state Reservoir, first solid-state memory can be divided into multiple partition holdings, and each memory block subregion can be divided into multiple pieces, each piece It is divided into multiple pages, every page of storage region is at least made of first area and second area;As shown in figure 5, the data processing Device includes: cache module 10, control module 20;Wherein,
The cache module 10, when for detecting that preset document system needs that cleaning label is written to first area, with The corresponding page number in the first area is index, and the first data of the first area should be written in caching;
For determination the second data need to be written to second area corresponding with the first area in the control module 20 When, the first data that the first area should be written and the second data that the second area should be written combination write-in first are consolidated State memory.
As an implementation, the control module 20, is specifically used for:
When the second data need to be written to second area corresponding with the first area in determination, searched from the cache module Whether first data with first area that the first area corresponding page number be index of caching are had;
If so, the first data of the first area combining write-in with the second data that the second area should be written First solid-state memory;
If not provided, determining the first data that the first area should not be written, the second area will should only be written The first solid-state memory is written in second data.
As an implementation, the control module 20, is specifically used for:
The first area of every page and second area are divided into four groups, obtain four groups by first area and second area group At data pair;
The first data of the first area will should be written and the second data of the second area should be written, with data pair Form, to the first solid-state memory be written data.
As a kind of optional embodiment, the control module 20 is also used to:
If preset operating system scans content in partition holding scanning result when carrying out carry to partition holding is Content is sky in the partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
As a kind of specific embodiment, the control module 20 is specifically used for:
To the first area write-in cleaning label in first group in first page.
As a kind of optional embodiment, the control module 20 is also used to:
In host CPU after the N pages content read in first solid-state memory in m-th block, if receiving described The first acquisition instruction that host CPU is sent then is read in the status register of first solid-state memory for characterizing ECC state The ECC field of position;Wherein, described first check that instruction is used to indicate in reading first solid-state memory in status register ECC mode bit;It is returned to the host CPU described for characterizing the ECC field of ECC mode bit.
In practical applications, the cache module 10, the control module 20, can be by being located at the data processing equipment In central processing unit (CPU, Central Processing Unit), microprocessor (MPU, Microprocessor Unit), digital signal processor (DSP, Digital Signal Processor) or field programmable gate array (FPGA, Field-Programmable Gate Array) etc. realize.
Data processing equipment described in the present embodiment generates the method for ECC error when can prevent SPI NAND FLASH from using.
The present embodiment also provides a kind of storage medium, and the storage medium is stored with computer program, the computer journey After sequence is executed by processor, aforementioned any one or more data processing method can be realized.
The computer storage medium can be various types of storage mediums, preferably deposit in the present embodiment for non-moment Storage media.
It will be appreciated by those skilled in the art that in the storage medium of the present embodiment each program function, can refer to embodiment The associated description of the data processing method and understand.
Using the method for the embodiment of the present invention, compared with prior art, the first area should be written due to using The first data and should be written the second area the second data combination write-in the first solid-state memory, rather than first write-in should write Enter the first data of the first area, then the second data that the second area should be written are written, can effectively prevent SPI The method of ECC error is generated when NAND FLASH is used.
It, in the absence of conflict, can be in any combination between technical solution documented by the embodiment of the present invention.
In several embodiments provided by the present invention, it should be understood that disclosed method and smart machine, Ke Yitong Other modes are crossed to realize.Apparatus embodiments described above are merely indicative, for example, the division of the unit, only Only a kind of logical function partition, there may be another division manner in actual implementation, such as: multiple units or components can be tied It closes, or is desirably integrated into another system, or some features can be ignored or not executed.In addition, shown or discussed each group Can be through some interfaces at the mutual coupling in part or direct-coupling or communication connection, equipment or unit it is indirect Coupling or communication connection, can be electrical, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member, which can be or may not be, to be physically separated, aobvious as unit The component shown can be or may not be physical unit, it can and it is in one place, it may be distributed over multiple network lists In member;Some or all of units can be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
In addition, each functional unit in various embodiments of the present invention can be fully integrated into a second processing unit, It is also possible to each unit individually as a unit, can also be integrated in one unit with two or more units; Above-mentioned integrated unit both can take the form of hardware realization, can also add the form of SFU software functional unit real using hardware It is existing.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.

Claims (10)

1. a kind of data processing method, is applied to the first solid-state memory, first solid-state memory can be divided into multiple storages Subregion, each memory block subregion can be divided into multiple pieces, and each piece is divided into multiple pages, and every page of storage region is at least by the firstth area Domain and second area composition;It is characterized in that, which comprises
When detecting that preset document system needs that cleaning label is written to first area, it is with the corresponding page number in the first area The first data of the first area should be written in index, caching;
When the second data need to be written to second area corresponding with the first area in determination, the first area will should be written First data and the second data combination the first solid-state memory of write-in that the second area should be written.
2. the method according to claim 1, wherein it is described by should be written the first area the first data and The second data combination the first solid-state memory of write-in of the second area should be written, comprising:
Determination need to second area corresponding with the first area be written the second data when, search whether caching with described The corresponding page number in first area is the first data of the first area of index;
If so, combining the first data of the first area with the second data that the second area should be written write-in first Solid-state memory;
If not provided, the first data of the first area should not be written by determining, and it will should only be written the of the second area The first solid-state memory is written in two data.
3. method according to claim 1 or 2, which is characterized in that first number that the first area will should be written The first solid-state memory of write-in is combined according to the second data that the second area should be written, comprising:
The first area of every page and second area be divided into four groups, four groups is obtained and is made of first area and second area Data pair;
The first data of the first area will should be written and the second data of the second area should be written, according to data pair Data are written to the first solid-state memory in form.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
If it is described that preset operating system, which scans the scanning result of content in the partition holding when carrying out carry to partition holding, Content is sky in partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
5. according to the method described in claim 4, it is characterized in that, the first page to each of described partition holding piece Write-in cleaning label, comprising:
To the first area write-in cleaning label in first group in first page.
6. a kind of data processing equipment, is applied to the first solid-state memory, first solid-state memory can be divided into multiple storages Subregion, each memory block subregion can be divided into multiple pieces, and each piece is divided into multiple pages, and every page of storage region is at least by the firstth area Domain and second area composition;It is characterized in that, described device includes:
Cache module, when for detecting that preset document system needs that cleaning label is written to first area, with firstth area The corresponding page number in domain is index, and the first data of the first area should be written in caching;
Control module should be written when the second data need to be written to second area corresponding with the first area for determination First data of the first area and the second data combination the first solid-state memory of write-in that the second area should be written.
7. device according to claim 6, which is characterized in that the control module is specifically used for:
When the second data need to be written to second area corresponding with the first area in determination, searched whether from the cache module There are the first data with the first area that the corresponding page number in the first area is index of caching;
If so, combining the first data of the first area with the second data that the second area should be written write-in first Solid-state memory;
If not provided, the first data of the first area should not be written by determining, and it will should only be written the of the second area The first solid-state memory is written in two data.
8. device according to claim 6 or 7, which is characterized in that the control module is specifically used for:
The first area of every page and second area be divided into four groups, four groups is obtained and is made of first area and second area Data pair;
The first data of the first area will should be written and the second data of the second area should be written, according to data pair Data are written to the first solid-state memory in form.
9. device according to claim 8, which is characterized in that the control module is also used to:
If it is described that preset operating system, which scans the scanning result of content in the partition holding when carrying out carry to partition holding, Content is sky in partition holding, then to the first page write-in cleaning label of each of described partition holding piece.
10. device according to claim 9, which is characterized in that the control module is specifically used for:
To the first area write-in cleaning label in first group in first page.
CN201710979022.0A 2017-10-19 2017-10-19 Data processing method and device Active CN109683803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710979022.0A CN109683803B (en) 2017-10-19 2017-10-19 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710979022.0A CN109683803B (en) 2017-10-19 2017-10-19 Data processing method and device

Publications (2)

Publication Number Publication Date
CN109683803A true CN109683803A (en) 2019-04-26
CN109683803B CN109683803B (en) 2021-07-13

Family

ID=66184165

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710979022.0A Active CN109683803B (en) 2017-10-19 2017-10-19 Data processing method and device

Country Status (1)

Country Link
CN (1) CN109683803B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030135674A1 (en) * 2001-12-14 2003-07-17 I/O Integrity, Inc. In-band storage management
US20090089508A1 (en) * 2007-09-28 2009-04-02 Intel Corporation Method for reducing number of writes in a cache memory
CN101425342A (en) * 2008-10-29 2009-05-06 四川登巅微电子有限公司 Access method for NAND Flash redundant code
US20090164733A1 (en) * 2007-12-21 2009-06-25 Mips Technologies, Inc. Apparatus and method for controlling the exclusivity mode of a level-two cache
CN101587744A (en) * 2009-06-19 2009-11-25 上海微小卫星工程中心 Multi-level data redundancy method of large scale FLASH memory array
CN101996168A (en) * 2009-08-25 2011-03-30 中兴通讯股份有限公司 Method and device for formatting flash memory
CN102004698A (en) * 2010-11-23 2011-04-06 深圳市江波龙电子有限公司 Flash memory management method and system
CN102122269A (en) * 2010-01-07 2011-07-13 慧荣科技股份有限公司 Writing timeout control method of flash memory and memory device thereof
CN102789427A (en) * 2012-07-17 2012-11-21 威盛电子股份有限公司 Data storage device and operation method thereof
CN102934089A (en) * 2010-06-17 2013-02-13 微软公司 Error detection for files
CN103827865A (en) * 2011-09-23 2014-05-28 国际商业机器公司 Improving database caching utilizing asynchronous log-based replication

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030135674A1 (en) * 2001-12-14 2003-07-17 I/O Integrity, Inc. In-band storage management
US20090089508A1 (en) * 2007-09-28 2009-04-02 Intel Corporation Method for reducing number of writes in a cache memory
US20090164733A1 (en) * 2007-12-21 2009-06-25 Mips Technologies, Inc. Apparatus and method for controlling the exclusivity mode of a level-two cache
CN101425342A (en) * 2008-10-29 2009-05-06 四川登巅微电子有限公司 Access method for NAND Flash redundant code
CN101587744A (en) * 2009-06-19 2009-11-25 上海微小卫星工程中心 Multi-level data redundancy method of large scale FLASH memory array
CN101996168A (en) * 2009-08-25 2011-03-30 中兴通讯股份有限公司 Method and device for formatting flash memory
CN102122269A (en) * 2010-01-07 2011-07-13 慧荣科技股份有限公司 Writing timeout control method of flash memory and memory device thereof
CN102934089A (en) * 2010-06-17 2013-02-13 微软公司 Error detection for files
CN102004698A (en) * 2010-11-23 2011-04-06 深圳市江波龙电子有限公司 Flash memory management method and system
CN103827865A (en) * 2011-09-23 2014-05-28 国际商业机器公司 Improving database caching utilizing asynchronous log-based replication
CN102789427A (en) * 2012-07-17 2012-11-21 威盛电子股份有限公司 Data storage device and operation method thereof

Also Published As

Publication number Publication date
CN109683803B (en) 2021-07-13

Similar Documents

Publication Publication Date Title
CN101369246B (en) System and method for using a memory mapping function to map memory defects
US8255614B2 (en) Information processing device that accesses memory, processor and memory management method
CN103164342B (en) Coordinate during the carry of availability of data
US6742148B1 (en) System and method for testing memory while an operating system is active
CN101510445B (en) Method and apparatus for storing and reading bad block meter of memory
CN103198450A (en) Image forming apparatus
CN106844245A (en) Data transmission method and device
US20090113249A1 (en) Stress testing method of file system
CN110459259A (en) Store test method, system and the storage medium of equipment write error error correcting capability
CN108415853A (en) A kind of method, apparatus and storage device of garbage reclamation
CN104765576B (en) A kind of date storage method and data storage device
CN106445398A (en) Novel memory-based embedded file system and realization method thereof
CN105988921A (en) Method and device for detecting out of range problem of memory
CN109522154A (en) Data reconstruction method and relevant device and system
CN102043648A (en) Multi-core system and starting method thereof
US20060095707A1 (en) Bidirectional data storing method
CN109144754A (en) A kind of method for testing reliability and device
CN105573872B (en) The HD management method and apparatus of data-storage system
CN102750213B (en) Disk detects, disposal route and detection, disposal system
US9838598B2 (en) Image identification system and image storage control method
CN114924923A (en) Method, system, equipment and medium for verifying correctness of hard disk write-in point
CN109542800A (en) Method, solid state hard disk and the storage device of garbage disposal based on flash memory
CN102737716B (en) Memorizer memory devices, Memory Controller and method for writing data
CN109683803A (en) A kind of data processing method and device
US8381023B2 (en) Memory system and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant