CN107122124A - Data processing method and device - Google Patents
Data processing method and device Download PDFInfo
- Publication number
- CN107122124A CN107122124A CN201610103929.6A CN201610103929A CN107122124A CN 107122124 A CN107122124 A CN 107122124A CN 201610103929 A CN201610103929 A CN 201610103929A CN 107122124 A CN107122124 A CN 107122124A
- Authority
- CN
- China
- Prior art keywords
- data
- page
- page data
- block
- solid state
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0647—Migration mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0626—Reducing size or complexity of storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
The invention provides a kind of data processing method and device.Wherein, this method includes:Obtain and reclaim request, wherein, reclaiming request is used to ask to carry out data record to the page data in solid state hard disc;The page data that request obtains the first kind from effective page data of caching is reclaimed in response, wherein, the page data of the first kind is used to indicate to replace from caching storage to the page data of solid state hard disc;By the page data of the first kind from the caching resettlement resettlement position predetermined into solid state hard disc, wherein, predetermined resettlement position is performs after data record the effectively storage location of page data.By the present invention, solve in correlation technique due to the problem of data-handling efficiency is relatively low caused by the secondary resettlement of data, and then reached the effect for improving data-handling efficiency.
Description
Technical field
The present invention relates to the communications field, in particular to a kind of data processing method and device.
Background technology
Solid state hard disc (Solid State Drives, abbreviation SSD) is that advanced semiconductor technology is incorporated into Large Copacity to move
The hard disk of new generation for moving storage and producing.Because inside is without mechanical structure as similar magnetic head, it is not necessary to moving head
Location data, so solid state hard disc starts faster, and due to no tracking time, the storage of solid state hard disc and read-write speed
Degree is also superior to mechanical hard disk.In addition to high-performance, solid state hard disc also includes relative to the advantage of traditional magnetic disk:Reliability height,
Shock resistance is strong, low-power consumption, low noise etc..Just because of this, solid state hard disc starts in individual application field and enterprise-level
Gradually popularized in.
However, solid state hard disc still has several drawbacks, such as write preceding erasing, limited erasing times, garbage reclamation.Wherein,
1) erasing refers to before writing:Solid state hard disc must be wiped first before having three kinds of operations of reading and writing and erasing, write operation, i.e.,
Covering write operation can not directly be carried out.For example, when needing to change the data having been written into, it is necessary to first lose some old data marks
Effect, then write new data into free space.The characteristic of erasing greatly reduces the write performance of solid state hard disc before writing.2)
Limited erasing times refer to:The erasing times of solid state hard disc are usually 100,000 times to 1,000,000 times, be will be unable to if wiping is worn
It is continuing with, it is necessary to the Data Migration that impairment unit is stored is to other unit, and when impairment unit exceedes certain amount,
Monoblock solid state hard disc will be unable to use.3) garbage reclamation (Garbage Collection, abbreviation GC) refers to:When not having
, it is necessary to discharge a part of free space when thering is the free free space to carry out write operation, that is to say, that all effective pages again
Move in one or several data blocks, the block not comprising the valid data page is wiped to discharge free space.
At present, for the garbage reclamation of solid state hard disc, method commonly used in the prior art is using classical greedy algorithm
(Greedy Algorithm), that is, select those data blocks comprising the at most failure page to carry out garbage reclamation, data block
In the page all failure will be by priority reclamation., can be by that is, when free space in solid state hard disc is not enough
Effective page in solid state hard disc data record block is moved, and the failure page in data record block is wiped,
To realize the garbage reclamation to solid state hard disc.However, in existing garbage collection procedure, solid state hard disc is not to effective
The page data page is finely divided, i.e., after resettlement, and cold dirty page data can be replaced from caching in effective page data
Go out, further also need to move the cold dirty page data again, will just move the data markers of new position
For failure, the position that the new data write-in solid state hard disc in caching is updated.It is so right during the use of solid state hard disc
Effective page carries out substantial amounts of, meaningless secondary resettlement, the expense of solid state hard disc will be greatly increased, so as to influence solid-state hard
The treatment effeciency of data in disk.
For it is set forth above the problem of, effective solution is not yet proposed at present.
The content of the invention
The invention provides a kind of data processing method and device, at least to solve in correlation technique due to the secondary resettlement of data
The problem of caused data-handling efficiency is relatively low.
According to an aspect of the invention, there is provided a kind of data processing method, including:Obtain and reclaim request, wherein,
Above-mentioned recovery is asked for asking to carry out data record to the page data in solid state hard disc;Responding above-mentioned recovery request postpones
The page data of the first kind is obtained in the effective page data deposited, wherein, the page data of the above-mentioned first kind is used to refer to
Show the page data that storage will be replaced from above-mentioned caching to above-mentioned solid state hard disc;By the page data of the above-mentioned first kind
Predetermined resettlement position is moved into above-mentioned solid state hard disc from above-mentioned caching, wherein, above-mentioned predetermined resettlement position is execution
The storage location of above-mentioned effective page data after above-mentioned data record.
Alternatively, responding above-mentioned recovery request page data of the acquisition first kind from effective page data of caching includes:
Obtain the access frequency and modified logo to above-mentioned effective page data in above-mentioned caching;According to above-mentioned access frequency and on
The page type that modified logo obtains above-mentioned effective page data is stated, wherein, the page type bag of above-mentioned effective page data
The page data of the above-mentioned first kind and the page data of Second Type are included, the page data of above-mentioned Second Type is used to indicate
Page data of the displacement storage to above-mentioned solid state hard disc not from above-mentioned caching;According to the classes of pages of above-mentioned effective page data
Type is separated to above-mentioned effective page data, obtains the page data of the above-mentioned first kind.
Alternatively, the page data of above-mentioned Second Type includes first page data and second page data, wherein, according to
The page type that above-mentioned access frequency and above-mentioned modified logo obtain above-mentioned effective page data includes:By above-mentioned modified logo
It is the page data do not changed as above-mentioned first page data, by above-mentioned modified logo to be changed and above-mentioned access
Frequency is more than or equal to the page data of the first predetermined threshold as above-mentioned second page data, by above-mentioned modified logo for by
Modification and above-mentioned access frequency be less than above-mentioned first predetermined threshold page data be used as the above-mentioned first kind page data.
Alternatively, the page data of the above-mentioned first kind is being moved into above-mentioned solid state hard disc predetermined remove from above-mentioned caching
Before moving position, in addition to:The data record of above-mentioned solid state hard disc is determined according at least to the page data of the above-mentioned first kind
Block, wherein, the page type of the page data in above-mentioned solid state hard disc in each data block includes:Do not write page data,
Fail page data, above-mentioned effective page data, and each above-mentioned data block includes above-mentioned data record block;To above-mentioned number
Above-mentioned data record is carried out according to block is reclaimed.
Alternatively, the page data according at least to the above-mentioned first kind determines that the data record block of above-mentioned solid state hard disc includes:
According to the page data in each data block in the page data of the above-mentioned first kind in above-mentioned caching and above-mentioned solid state hard disc
Obtain the data record rate of each above-mentioned data block;Above-mentioned data record block is determined according to above-mentioned data record rate.
Alternatively, according in each data block in the page data of the above-mentioned first kind in above-mentioned caching and above-mentioned solid state hard disc
Page data obtain the data record rate of above-mentioned each data block and include:Following steps are repeated, until having traveled through
State each above-mentioned data block in solid state hard disc:Obtain the block identification of current data block;Obtain what above-mentioned block identification was identified
The page data of the above-mentioned first kind and above-mentioned failure page data;The upper of above-mentioned current data block is obtained in the following manner
State data record rate:Wherein, above-mentioned r represents the above-mentioned data record rate of above-mentioned current data block, on
The page quantity that a represents the above-mentioned failure page data of above-mentioned current data block in above-mentioned solid state hard disc is stated, above-mentioned b is represented
The page quantity of the page data of the above-mentioned first kind in above-mentioned caching, above-mentioned P representation pages size, above-mentioned B is represented
Block size.
Alternatively, carrying out above-mentioned data record to above-mentioned data record block includes:Above-mentioned in above-mentioned data record block is had
Effect page data is moved to above-mentioned predetermined resettlement position, and is above-mentioned failure page number by above-mentioned effective page data markers
According to;Above-mentioned failure page data in above-mentioned data record block is wiped.
Alternatively, the page data of the above-mentioned first kind is being moved into above-mentioned solid state hard disc predetermined remove from above-mentioned caching
Before moving position, in addition to:According to above-mentioned in other data blocks in above-mentioned solid state hard disc in addition to above-mentioned data record block
The size for not writing page data determines above-mentioned predetermined resettlement position.
According to another aspect of the present invention there is provided a kind of data processing equipment, including:First acquisition unit, is used for
Obtain and reclaim request, wherein, above-mentioned recovery is asked for asking to carry out data record to the page data in solid state hard disc;
Second acquisition unit, the page number of the first kind is obtained for responding above-mentioned recovery request from effective page data of caching
According to, wherein, the page data of the above-mentioned first kind will be replaced for instruction from above-mentioned caching stores hard to above-mentioned solid-state
The page data of disk;Unit is moved, for the page data of the above-mentioned first kind to be moved to above-mentioned solid-state from above-mentioned caching
Predetermined resettlement position in hard disk, wherein, above-mentioned predetermined resettlement position is above-mentioned active page after the above-mentioned data record of execution
The storage location of face data.
Alternatively, second acquisition unit includes:First acquisition module, for obtaining to the above-mentioned active page in above-mentioned caching
The access frequency and modified logo of face data;Second acquisition module, for according to above-mentioned access frequency and above-mentioned modified logo
The page type of above-mentioned effective page data is obtained, wherein, the page type of above-mentioned effective page data includes above-mentioned first
The page data of type and the page data of Second Type, the page data of above-mentioned Second Type are used to indicate not from above-mentioned slow
Middle displacement storage is deposited to the page data of above-mentioned solid state hard disc;Separation module, for the page according to above-mentioned effective page data
Noodles type is separated to above-mentioned effective page data, obtains the page data of the above-mentioned first kind.
Alternatively, the page data of above-mentioned Second Type includes first page data and second page data, wherein, it is above-mentioned
The page type that second acquisition module obtains above-mentioned effective page data in the following manner includes:It is by above-mentioned modified logo
Above-mentioned modified logo, as above-mentioned first page data, is to be changed and above-mentioned access frequency by the page data do not changed
Rate is more than or equal to the page data of the first predetermined threshold as above-mentioned second page data, is to be repaiied by above-mentioned modified logo
Change and above-mentioned access frequency be less than above-mentioned first predetermined threshold page data be used as the above-mentioned first kind page data.
Alternatively, in addition to:First determining unit, for being removed by the page data of the above-mentioned first kind from above-mentioned caching
Adjourn to before resettlement position predetermined in above-mentioned solid state hard disc, according at least to the above-mentioned first kind page data determine it is above-mentioned
The data record block of solid state hard disc, wherein, the page type bag of the page data in above-mentioned solid state hard disc in each data block
Include:Page data, failure page data, above-mentioned effective page data are not write, and each above-mentioned data block includes above-mentioned number
According to recovery block;Recovery unit, for carrying out above-mentioned data record to above-mentioned data record block.
Alternatively, the first determining unit includes:3rd acquisition module, for according to the above-mentioned first kind in above-mentioned caching
Page data in page data and above-mentioned solid state hard disc in each data block obtains the data record of each above-mentioned data block
Rate;Determining module, for determining above-mentioned data record block according to above-mentioned data record rate.
Alternatively, above-mentioned 3rd acquisition module includes:Submodule is handled, for repeating following steps, until traversal
Each above-mentioned data block in complete above-mentioned solid state hard disc:Obtain the block identification of current data block;Above-mentioned block identification is obtained to be marked
The page data and above-mentioned failure page data for the above-mentioned first kind known;Above-mentioned current data block is obtained in the following manner
Above-mentioned data record rate:Wherein, above-mentioned r represents the above-mentioned data record rate of above-mentioned current data block,
Above-mentioned a represents the page quantity of the above-mentioned failure page data of above-mentioned current data block in above-mentioned solid state hard disc, above-mentioned b tables
Show the page quantity of the page data of the above-mentioned first kind in above-mentioned caching, above-mentioned P representation pages size, above-mentioned B tables
Show block size.
Alternatively, above-mentioned recovery unit includes:Module is moved, for by above-mentioned effective page in above-mentioned data record block
Data are moved to above-mentioned predetermined resettlement position, and are above-mentioned failure page data by above-mentioned effective page data markers;Wipe
Except module, for wiping the above-mentioned failure page data in above-mentioned data record block.
Alternatively, in addition to:Second determining unit, for being removed by the page data of the above-mentioned first kind from above-mentioned caching
Adjourn to before resettlement position predetermined in above-mentioned solid state hard disc, according in above-mentioned solid state hard disc in addition to above-mentioned data record block
Other data blocks in the above-mentioned size for not writing page data determine above-mentioned predetermined resettlement position.
By the present invention, when getting the recovery request that data record is carried out to the page data in solid state hard disc, pass through
The page data that storage to the first kind of solid state hard disc will be replaced in effective page data from caching is direct once
Resettlement position predetermined in solid state hard disc is moved, without first the page data of the first kind is replaced into solid state hard disc,
Once moved again again, so as to overcome the data processing effect in correlation technique caused by the secondary resettlement of data
The problem of rate is low, and then the effect for improving data-handling efficiency is realized, in addition, also reducing solid state hard disc in data record
Data resettlement number of times and its overhead caused with during caching replacement, improve the performance of solid state hard disc.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, the present invention
Schematic description and description be used for explain the present invention, do not constitute inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is a kind of flow chart of optional data processing method according to embodiments of the present invention;
Fig. 2 is a kind of structural representation of optional data block according to embodiments of the present invention;
Fig. 3 is the flow chart of another optional data processing method according to embodiments of the present invention;And
Fig. 4 is a kind of schematic diagram of optional data processing equipment according to embodiments of the present invention.
Embodiment
Describe the present invention in detail below with reference to accompanying drawing and in conjunction with the embodiments.It should be noted that in the feelings not conflicted
Under condition, the feature in embodiment and embodiment in the application can be mutually combined.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, "
Two " etc. be for distinguishing similar object, without for describing specific order or precedence.
Embodiment 1
A kind of data processing method is provided in the present embodiment, and Fig. 1 is provide according to embodiments of the present invention a kind of optional
Data processing method flow chart, as shown in figure 1, the flow comprises the following steps:
Step S102, obtains and reclaims request, wherein, reclaiming request is used to ask to carry out the page data in solid state hard disc
Data record;
The page data that request obtains the first kind from effective page data of caching is reclaimed in step S104, response, wherein,
The page data of the first kind is used to indicate to replace from caching storage to the page data of solid state hard disc;
Step S106, by the page data of the first kind from the caching resettlement resettlement position predetermined into solid state hard disc, wherein,
Predetermined resettlement position is the storage location for performing effective page data after data record.
Alternatively, in the present embodiment, above-mentioned data processing method can be, but not limited to the rubbish number applied to solid state hard disc
According in removal process.That is, in the present embodiment, to the page data progress as the rubbish in solid state hard disc
During data record, it can pass through when getting the recovery request that data record is carried out to the page data in solid state hard disc
The page data that storage to the first kind of solid state hard disc will be replaced in effective page data from caching is direct once
Resettlement position predetermined in solid state hard disc is moved, without first the page data of the first kind is replaced into solid state hard disc,
Once moved again again, so as to overcome the data processing effect in correlation technique caused by the secondary resettlement of data
The problem of rate is low, and then realize while data-handling efficiency is improved, solid state hard disc is also greatly reduced because data are removed
Move caused expense.
Alternatively, in the present embodiment, above-mentioned solid state hard disc includes:Flash translation layer (FTL) (Flash Translation
Layer, abbreviation FTL), flash translation layer (FTL) is used to logical address is mapped as into physical address by mapping table;It is responsible for mark
Page type in solid state hard disc;Free space is detected, trigger data is reclaimed when occurring not enough, for example, when solid-state is hard
When the quantity of erased block in disk accounts for less than the 20% of total data block number, triggering is used to ask to the page in solid state hard disc
Face data carry out the recovery request of data record.
Alternatively, in the present embodiment, the page data of the page type of above-mentioned effective page data including the first kind and
The page data of Second Type, wherein, the page data of the first kind is stored to solid state hard disc for that will be replaced from caching
Page data, the page data of Second Type is page data of the displacement storage to solid state hard disc not from caching.
Alternatively, in the present embodiment, the page that request obtains the first kind from effective page data of caching is reclaimed in response
Face data include:Obtain the access frequency and modified logo to effective page data in caching;According to access frequency and repair
Change the page type that mark obtains effective page data, wherein, the page type of effective page data includes the first kind
The page data of page data and Second Type, the page data of Second Type be used to indicate not from caching displacement storage to
The page data of solid state hard disc;Effective page data is separated according to the page type of effective page data, is obtained
The page data of one type.
For example, the cache layer (Cache Layer) for the effective page data in temporal cache, will not make at most according to recently
The page in caching is queued up with (Least Recently Used) algorithm (queue to be not used at most recently, i.e.,
LRU queues).Wherein, LRU queues can be, but not limited to be divided into hot (HOT) page and cold (COOL) according to predetermined threshold
The page, for example, predetermined threshold is 10, then the tail of the queue of LRU queues 10% is marked as cold (COOL) page, preceding 90%
The page be marked as hot (HOT) page.Wherein, LRU queues can be, but not limited to be sorted according to access frequency.
Further, the page data changed in cache layer is labeled as dirty (DIRTY) page, the page do not changed
Face data markers are clean (CLEAN) page.Containing dirty pages face in the cold page is referred to as cold dirty (COOL DIRTY) page (use
CD is identified), the containing dirty pages face in the hot page be referred to as dirty (HOT DIRTY) page (being identified with HD) of heat.
It should be noted that page data in the buffer has two copies, one is the copy in solid state hard disc,
One is copy in the buffer.If the clean page, then two copy contents are identical;If containing dirty pages face,
Copy in then caching is that the copy in newest page data, solid state hard disc is old page data.That is, solid-state is hard
Cold containing dirty pages face and cold containing dirty pages face in caching are the different copies of the same page in disk, and the cold containing dirty pages face in caching stores new number
According to store the legacy data in cold containing dirty pages face in solid state hard disc.In the present embodiment, by by caching replacement and data record
Flexibly combined, during so that the cold containing dirty pages face in caching being replaced away, legacy data can will be store in solid state hard disc
Cold containing dirty pages face labeled as failure page data, and the corresponding new data in cold containing dirty pages face in caching is write direct into solid state hard disc
Position after middle renewal (as performed resettlement position predetermined after data record).It is slow so as to avoid first passing through cold containing dirty pages face
Store and change resettlement into solid state hard disc, during data record is carried out, then the step of perform once secondary resettlement, from
And overcome in correlation technique the problem of the data-handling efficiency caused by the secondary resettlement of data is low, and then realize
While improving data-handling efficiency, expense of the solid state hard disc caused by data are moved is also greatly reduced.
For example, as shown in Fig. 2 can be, but not limited to include following 5 type in the data block of each in solid state hard disc
Page data:Not writing page data (can with do not write page representation), failure page data (can use failure page table
Show), effective page data (effective page representation can be used), wherein, effective page packet is included:Clean page data
(can use clean page representation), hot dirty page data (can use hot dirty page representation) and cold dirty page data (can
With with cold dirty page representation).Wherein, it is the free space in the data block page data not to be write, be wiped free of or
From unassigned, can directly it write data into.Clean page data refers to that the page has been written into data, while the page
Face data are not changed in the buffer;The dirty page data of heat refers to that the page data is changed in the buffer, but due to quilt
The page data for frequently accessing and not displaced from caching temporarily;Cold dirty page data refers to the page data in the buffer
Changed, and be not accessed frequently, replacement algorithm will be buffered and replaced away;Failure page data refers to the page number
According to being modified, new data has been written to other positions, then legacy data is fail data.In addition, in the present embodiment
In, it is used to store effective page data in above-mentioned caching, wherein can be, but not limited to include the page number of following 3 type
According to:Clean page data, hot dirty page data and cold dirty page data.
That is, in the present embodiment, the page data of above-mentioned Second Type can include but is not limited to:The clean page
Data, hot dirty page data, the page data of the above-mentioned first kind can include but is not limited to cold dirty page data.Wherein,
It should be noted that due to the content of clean page data in the buffer with being stored in solid state hard disc in effective page data
Unanimously, thus, in the present embodiment, clean page data can be, but not limited to hot dirty page data be regarded as not from
Page data of the displacement storage to the Second Type of solid state hard disc in caching.
Alternatively, in the present embodiment, by the page data of the first kind from caching resettlement into solid state hard disc it is predetermined
Before resettlement position, in addition to:
S1, the data record block of solid state hard disc is determined according at least to the page data of the first kind;
S2, data record is carried out to data record block.
Alternatively, in the present embodiment, it is above-mentioned that data record block progress data record can be included:By data record block
In effective page data move to predetermined resettlement position, and by effective page data markers for failure page data;It is right
Failure page data in data record block is wiped.
Alternatively, in the present embodiment, the above-mentioned page data according at least to the first kind determines that the data of solid state hard disc are returned
Receive the data time that block can be, but not limited to obtain each data block in solid state hard disc according at least to the page data of the first kind
Yield, the data record rate obtained by comparing come determine data record block (as determine data record block block identification).
Alternatively, in the present embodiment, by way of comparing obtained data record rate and determining data record block include with
It is at least one lower:
1) it regard data record rate highest data block as data record block;
2) if the data record rate of several data blocks is identical and for peak, then the in these data blocks is compared
The quantity of the page data of one type, the big person of numerical value is used as data record block;
3) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, then compares the quantity of the page data of the Second Type of these data blocks, the small person of numerical value
It is used as data record block;
4) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, and the quantity of the page data of Second Type is also identical, then by the maximum data of block identification
Block is used as data record block.
Alternatively, in the present embodiment, each data block in solid state hard disc is obtained according at least to the page data of the first kind
Data record rate can include but is not limited to:According in each data block in the page data and solid state hard disc of the first kind
Failure page data determine data record rate.
Alternatively, in the present embodiment, by the page data of the first kind from caching resettlement into solid state hard disc it is predetermined
Before resettlement position, in addition to:Page number is not write according in other data blocks in solid state hard disc in addition to data record block
According to size determine predetermined resettlement position.So that effective page data in solid state hard disc can be moved all to it again
The corresponding region of page data is not write in his data block.
It is specific to be illustrated with reference to the example below, as shown in figure 3, this method includes:
S302, system trigger reclaims request;
S304, obtains the page type of all page datas in caching, therefrom obtains the page data of the first kind;
S306, calculates the data record rate of each data block in solid state hard disc;
S308, determines data record block;
S310, chooses predetermined resettlement position;
S312, by the page data direct copying of Second Type in data record block to moving position-scheduled resettlement position;
S314, will by page data corresponding with the page data of the first kind in data record block labeled as the failure page
The page data of the newest first kind is copied to predetermined resettlement position in caching;
S316, the data record block is wiped.
The embodiment provided by the application, is getting the recovery to the page data progress data record in solid state hard disc
During request, by the way that page number of the storage to the first kind of solid state hard disc will will be replaced in effective page data from caching
According to resettlement position predetermined in solid state hard disc is directly once moved, without first the page data displacement of the first kind is arrived
In solid state hard disc, then once moved again, so as to overcome in correlation technique caused by the secondary resettlement of data
Data-handling efficiency it is low the problem of, and then realize improve data-handling efficiency effect, in addition, it is hard to also reduce solid-state
Data resettlement number of times and its overhead that causes of the disk during data record and caching replacement, improve solid state hard disc
Performance.
As a kind of optional scheme, the page that request obtains the first kind from effective page data of caching is reclaimed in response
Data include:
S1, obtains the access frequency and modified logo to effective page data in caching;
S2, the page type of effective page data is obtained according to access frequency and modified logo, wherein, effective page data
Page type including the first kind page data and the page data of Second Type, the page data of Second Type is used for
Indicate page data of the displacement storage to solid state hard disc not from caching;
S3, is separated according to the page type of effective page data to effective page data, obtains the page of the first kind
Data.
Alternatively, in the present embodiment, the page data of Second Type includes first page data and second page data,
Wherein, the page type for obtaining effective page data according to access frequency and modified logo includes:By modified logo for not by
The page data of modification is as first page data, by modified logo change and access frequency is pre- more than or equal to first
The page data of threshold value is determined as second page data, by modified logo to be changed and access frequency makes a reservation for less than first
The page data of threshold value as the first kind page data.
That is, in the present embodiment, the FTL in solid state hard disc will detect the free space of solid state hard disc in real time,
Detect that free space is not enough and trigger after recovery request, the LRU queues that system will be begun stepping through in caching, and to LRU
Page data markup page type in queue.
For example, it is assumed that the predetermined threshold for boundary is 10%, then cache layer is by 10% page mark of the tail of the queue of LRU queues
The cold page is designated as, is the hot page by remaining page marks.Further, the cold page and the hot page are traveled through respectively, by the cold page
In containing dirty pages face be labeled as cold containing dirty pages face (CD), by the containing dirty pages face in the hot page be labeled as hot containing dirty pages face (HD), and will mark
Remember that the page type notifies the FTL in solid state hard disc.
That is, after the page type of page data marked in getting caching, then the can be obtained by separating
The page data (i.e. cold containing dirty pages face) of one type, consequently facilitating the page data of the first kind is once moved,
The storage location of effective page data after resettlement to execution data record, and avoid performing caching replacement and data record process
In resettlement twice, reach reduce expense effect.
As a kind of optional scheme, removed by the page data of the first kind from caching resettlement is predetermined into solid state hard disc
Before moving position, in addition to:
S1, the data record block of solid state hard disc is determined according at least to the page data of the first kind, wherein, in solid state hard disc
The page type of page data in each data block includes:Page data, failure page data, effective page number are not write
According to each data block includes data record block;
S2, data record is carried out to data record block.
Alternatively, in the present embodiment, the above-mentioned page data according at least to the first kind determines that the data of solid state hard disc are returned
Receiving block includes:
S12, the page data in each data block in the page data and solid state hard disc of the first kind in caching is obtained
The data record rate of each data block;
S14, data record block is determined according to data record rate.
Alternatively, in the present embodiment, by way of comparing obtained data record rate and determining data record block include with
It is at least one lower:
1) it regard data record rate highest data block as data record block;
2) if the data record rate of several data blocks is identical and for peak, then the in these data blocks is compared
The quantity of the page data of one type, the big person of numerical value is used as data record block;
3) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, then compares the quantity of the page data of the Second Type of these data blocks, the small person of numerical value
It is used as data record block;
4) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, and the quantity of the page data of Second Type is also identical, then by the maximum data of block identification
Block is used as data record block.
It should be noted that in the present embodiment, the page is not only stored in the above-mentioned mapping table as the cache layer of caching
The page type of data markers, also corresponds to and stores page data in displacement storage to default positional information after solid state hard disc
(block identification of such as data block).
For example, it is assumed that the page data of the first kind be cold containing dirty pages face, then FTL can count by caching obtain mark for
Fail the quantity of page data in the quantity in the cold containing dirty pages face of the page data of the first kind, and solid state hard disc each data block,
In units of data block, failed in each data block page quantity and cold dirty page quantity are obtained respectively, above-mentioned failure is utilized
Page quantity and cold dirty page quantity calculate the data record rate of each data block.
The embodiment provided by the application, being accurately positioned by data record rate in solid state hard disc is used to carry out data time
The data record block of receipts, so as to realize the data record to solid state hard disc precise and high efficiency, and then ensures data in solid state hard disc
Treatment effeciency.
As a kind of optional scheme, according in each data block in the page data and solid state hard disc of the first kind in caching
Page data obtain the data record rate of each data block and include:
S1, repeats following steps, until having traveled through each data block in solid state hard disc:
S12, obtains the block identification of current data block;
S14, obtains the page data and failure page data for the first kind that block identification is identified;
S16, obtains the data record rate of current data block in the following manner:
Wherein, r represents the data record rate of current data block, and a represents the failure page of current data block in solid state hard disc
The page quantity of data, b represents the page quantity of the page data of the first kind in caching, P representation page sizes, B
Represent block size.
It should be noted that in the present embodiment, the unit of read-write operation is the page in solid state hard disc, wherein, the page is big
Small is usually 2KB, and access delay is generally 15us to 200us.The unit of erasing operation is block, wherein, block size leads to
It is often 128KB, one piece of erasing needs 2ms or so expense.
The embodiment provided by the application, the data for calculating each data block in solid state hard disc successively through the above way are returned
Yield, so that the accuracy of data record block determined by ensureing, and then realize the data time to solid state hard disc precise and high efficiency
Receive.
As a kind of optional scheme, carrying out data record to data record block includes:
S1, effective page data in data record block is moved to predetermined resettlement position, and by effective page data mark
It is designated as the page data that fails;
S2, is wiped the failure page data in data record block.
For example, it is assumed that the page data of the first kind is by taking cold containing dirty pages face as an example, the page data of Second Type is with the clean page
, then, can be dirty by the clean page and heat in data record block during data record is performed exemplified by hot containing dirty pages face
Page direct copying changes the corresponding positional information of above-mentioned page data in FTL to predetermined resettlement position.And by number
It is failure page data (failure page representation can be used) according to corresponding effective page data markers in block are reclaimed.
Further, by the cold containing dirty pages face in data record block also labeled as failure page data, and will this is cold dirty in the buffer
The latest data of the page is copied to predetermined resettlement position.Then, the latest data of the cold containing dirty pages face in the buffer is deleted,
The corresponding positional information of above-mentioned page data in FTL is changed simultaneously.
Then, the page data in erasing data record block, " erasing " is labeled as by the data record block, to realize
To the data record of solid state hard disc, the purpose in releasing idling space.
The embodiment provided by the application, realizes ensure that active page to the data record of solid state hard disc through the above way
The page data of the first kind in the data of face and the page data of Second Type can once move predetermined resettlement position
Put, it is to avoid the secondary resettlement to the page data of the first kind, realize the effect of the expense of reduction solid state hard disc.
As a kind of optional scheme, removed by the page data of the first kind from caching resettlement is predetermined into solid state hard disc
Before moving position, in addition to:
S1, is determined pre- according to the size for not writing page data in other data blocks in solid state hard disc in addition to data record block
Fixed resettlement position.
For example, statistics reclaims the size of effective page data in block, the FTL of real-time update is checked, inquiry solid-state is hard
The size that effective page data is met in other data blocks of disk does not write page of data, regard the data block found as this
The predetermined resettlement position of effective page data of data record block.
The embodiment provided by the application, by according in other data blocks in solid state hard disc in addition to data record block
The size for not writing page data determines predetermined resettlement position, can be complete with the effective page data ensured in data record block
Move in portion.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-described embodiment
Method the mode of required general hardware platform can be added to realize by software, naturally it is also possible to by hardware, but a lot
In the case of the former be more preferably embodiment.Understood based on such, technical scheme is substantially in other words to existing
The part for having technology to contribute can be embodied in the form of software product, and the computer software product is stored in one
In storage medium (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be with
It is mobile phone, computer, server, or network equipment etc.) perform method described in each of the invention embodiment.
Embodiment 2
A kind of data processing equipment is additionally provided in the present embodiment, and the device is used to realize above-described embodiment and be preferable to carry out
Mode, had carried out repeating no more for explanation.As used below, term " module " can realize predetermined function
Software and/or hardware combination.Although the device described by following examples is preferably realized with software, firmly
Part, or the realization of the combination of software and hardware is also that may and be contemplated.
Fig. 4 is a kind of schematic diagram of the optional data processing equipment provided according to embodiments of the present invention, as shown in figure 4,
The device includes:
1) first acquisition unit 402, request is reclaimed for obtaining, wherein, reclaiming request is used to ask in solid state hard disc
Page data carry out data record;
2) second acquisition unit 404, request acquisition first kind from effective page data of caching is reclaimed for responding
Page data, wherein, the page data of the first kind is used to indicate to replace from caching storage to the page of solid state hard disc
Face data;
3) unit 406 is moved, for the page data of the first kind to be moved to the resettlement predetermined into solid state hard disc from caching
Position, wherein, predetermined resettlement position is the storage location for performing effective page data after data record.
Alternatively, in the present embodiment, above-mentioned data processing equipment can be, but not limited to the rubbish number applied to solid state hard disc
According in removal process.That is, in the present embodiment, to the page data progress as the rubbish in solid state hard disc
During data record, it can pass through when getting the recovery request that data record is carried out to the page data in solid state hard disc
The page data that storage to the first kind of solid state hard disc will be replaced in effective page data from caching is direct once
Resettlement position predetermined in solid state hard disc is moved, without first the page data of the first kind is replaced into solid state hard disc,
Once moved again again, so as to overcome the data processing effect in correlation technique caused by the secondary resettlement of data
The problem of rate is low, and then realize while data-handling efficiency is improved, solid state hard disc is also greatly reduced because data are removed
Move caused expense.
Alternatively, in the present embodiment, above-mentioned solid state hard disc includes:Flash translation layer (FTL) (Flash Translation
Layer, abbreviation FTL), flash translation layer (FTL) is used to logical address is mapped as into physical address by mapping table;It is responsible for mark
Page type in solid state hard disc;Free space is detected, trigger data is reclaimed when occurring not enough, for example, when solid-state is hard
When the quantity of erased block in disk accounts for less than the 20% of total data block number, triggering is used to ask to the page in solid state hard disc
Face data carry out the recovery request of data record.
Alternatively, in the present embodiment, the page data of the page type of above-mentioned effective page data including the first kind and
The page data of Second Type, wherein, the page data of the first kind is stored to solid state hard disc for that will be replaced from caching
Page data, the page data of Second Type is page data of the displacement storage to solid state hard disc not from caching.
Alternatively, in the present embodiment, second acquisition unit 404 includes:(1) first acquisition module, for acquisition pair
The access frequency and modified logo of effective page data in caching;(2) second acquisition modules, for according to access frequency
And modified logo obtains the page type of effective page data, wherein, the page type of effective page data includes the first kind
The page data of type and the page data of Second Type, the page data of Second Type are used to indicate to replace not from caching to deposit
Store up the page data of solid state hard disc;(3) separation module, for according to the page type of effective page data to active page
Face data are separated, and obtain the page data of the first kind.
For example, the cache layer (Cache Layer) for the effective page data in temporal cache, will not make at most according to recently
The page in caching is queued up with (Least Recently Used) algorithm (queue to be not used at most recently, i.e.,
LRU queues).Wherein, LRU queues can be, but not limited to be divided into hot (HOT) page and cold (COOL) according to predetermined threshold
The page, for example, predetermined threshold is 10, then the tail of the queue of LRU queues 10% is marked as cold (COOL) page, preceding 90%
The page be marked as hot (HOT) page.Wherein, LRU queues can be, but not limited to be sorted according to access frequency.
Further, the page data changed in cache layer is labeled as dirty (DIRTY) page, the page do not changed
Face data markers are clean (CLEAN) page.Containing dirty pages face in the cold page is referred to as cold dirty (COOL DIRTY) page (use
CD is identified), the containing dirty pages face in the hot page be referred to as dirty (HOT DIRTY) page (being identified with HD) of heat.
It should be noted that page data in the buffer has two copies, one is the copy in solid state hard disc,
One is copy in the buffer.If the clean page, then two copy contents are identical;If containing dirty pages face,
Copy in then caching is that the copy in newest page data, solid state hard disc is old page data.That is, solid-state is hard
Cold containing dirty pages face and cold containing dirty pages face in caching are the different copies of the same page in disk, and the cold containing dirty pages face in caching stores new number
According to store the legacy data in cold containing dirty pages face in solid state hard disc.In the present embodiment, by by caching replacement and data record
Flexibly combined, during so that the cold containing dirty pages face in caching being replaced away, legacy data can will be store in solid state hard disc
Cold containing dirty pages face labeled as failure page data, and the corresponding new data in cold containing dirty pages face in caching is write direct into solid state hard disc
Position after middle renewal (as performed resettlement position predetermined after data record).It is slow so as to avoid first passing through cold containing dirty pages face
Store and change resettlement into solid state hard disc, during data record is carried out, then the step of perform once secondary resettlement, from
And overcome in correlation technique the problem of the data-handling efficiency caused by the secondary resettlement of data is low, and then realize
While improving data-handling efficiency, expense of the solid state hard disc caused by data are moved is also greatly reduced.
For example, as shown in Fig. 2 can be, but not limited to include following 5 type in the data block of each in solid state hard disc
Page data:Not writing page data (can with do not write page representation), failure page data (can use failure page table
Show), effective page data (effective page representation can be used), wherein, effective page packet is included:Clean page data
(can use clean page representation), hot dirty page data (can use hot dirty page representation) and cold dirty page data (can
With with cold dirty page representation).Wherein, it is the free space in the data block page data not to be write, be wiped free of or
From unassigned, can directly it write data into.Clean page data refers to that the page has been written into data, while the page
Face data are not changed in the buffer;The dirty page data of heat refers to that the page data is changed in the buffer, but due to quilt
The page data for frequently accessing and not displaced from caching temporarily;Cold dirty page data refers to the page data in the buffer
Changed, and be not accessed frequently, replacement algorithm will be buffered and replaced away;Failure page data refers to the page number
According to being modified, new data has been written to other positions, then legacy data is fail data.In addition, in the present embodiment
In, it is used to store effective page data in above-mentioned caching, wherein can be, but not limited to include the page number of following 3 type
According to:Clean page data, hot dirty page data and cold dirty page data.
That is, in the present embodiment, the page data of above-mentioned Second Type can include but is not limited to:The clean page
Data, hot dirty page data, the page data of the above-mentioned first kind can include but is not limited to cold dirty page data.Wherein,
It should be noted that due to the content of clean page data in the buffer with being stored in solid state hard disc in effective page data
Unanimously, thus, in the present embodiment, clean page data can be, but not limited to hot dirty page data be regarded as not from
Page data of the displacement storage to the Second Type of solid state hard disc in caching.
Alternatively, in the present embodiment, said apparatus also includes:(1) first determining unit, for by the first kind
Page data before the caching resettlement resettlement position predetermined into solid state hard disc, according at least to the page number of the first kind
According to the data record block for determining solid state hard disc, wherein, the page type of the page data in the data block of each in solid state hard disc
Including:Page data, failure page data, effective page data are not write, and each data block includes data record block;
(2) recovery unit, for carrying out data record to data record block.
Alternatively, in the present embodiment, above-mentioned recovery unit realizes that carrying out data to data record block returns by following steps
Receive:Effective page data in data record block is moved to predetermined resettlement position, and is by effective page data markers
Fail page data;Failure page data in data record block is wiped.
Alternatively, in the present embodiment, above-mentioned first determining unit is realized according at least to the first kind by following steps
Page data determines the data record block of solid state hard disc:Obtain each in solid state hard disc according at least to the page data of the first kind
The data record rate of individual data block, the data record rate obtained by comparing to determine data record block, (as determined, return by data
Receive the block identification of block).
Alternatively, in the present embodiment, by way of comparing obtained data record rate and determining data record block include with
It is at least one lower:
1) it regard data record rate highest data block as data record block;
2) if the data record rate of several data blocks is identical and for peak, then the in these data blocks is compared
The quantity of the page data of one type, the big person of numerical value is used as data record block;
3) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, then compares the quantity of the page data of the Second Type of these data blocks, the small person of numerical value
It is used as data record block;
4) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, and the quantity of the page data of Second Type is also identical, then by the maximum data of block identification
Block is used as data record block.
Alternatively, in the present embodiment, each data block in solid state hard disc is obtained according at least to the page data of the first kind
Data record rate can include but is not limited to:According in each data block in the page data and solid state hard disc of the first kind
Failure page data determine data record rate.
Alternatively, in the present embodiment, by the page data of the first kind from caching resettlement into solid state hard disc it is predetermined
Before resettlement position, in addition to:Page number is not write according in other data blocks in solid state hard disc in addition to data record block
According to size determine predetermined resettlement position.So that effective page data in solid state hard disc can be moved all to it again
The corresponding region of page data is not write in his data block.
It is specific to be illustrated with reference to the example below, as shown in figure 3, above-mentioned data processing equipment can be real by following steps
Now to the data record of solid state hard disc:
S302, system trigger reclaims request;
S304, obtains the page type of all page datas in caching, therefrom obtains the page data of the first kind;
S306, calculates the data record rate of each data block in solid state hard disc;
S308, determines data record block;
S310, chooses predetermined resettlement position;
S312, by the page data direct copying of Second Type in data record block to moving position-scheduled resettlement position;
S314, will by page data corresponding with the page data of the first kind in data record block labeled as the failure page
The page data of the newest first kind is copied to predetermined resettlement position in caching;
S316, the data record block is wiped.
The embodiment provided by the application, is getting the recovery to the page data progress data record in solid state hard disc
During request, by the way that page number of the storage to the first kind of solid state hard disc will will be replaced in effective page data from caching
According to resettlement position predetermined in solid state hard disc is directly once moved, without first the page data displacement of the first kind is arrived
In solid state hard disc, then once moved again, so as to overcome in correlation technique caused by the secondary resettlement of data
Data-handling efficiency it is low the problem of, and then realize improve data-handling efficiency effect, in addition, it is hard to also reduce solid-state
Data resettlement number of times and its overhead that causes of the disk during data record and caching replacement, improve solid state hard disc
Performance.
As a kind of optional scheme, second acquisition unit includes:
1) the first acquisition module, for obtaining access frequency and modified logo to effective page data in caching;
2) the second acquisition module, the page type for obtaining effective page data according to access frequency and modified logo,
Wherein, the page type of effective page data includes the page data of the first kind and the page data of Second Type, second
The page data of type is used to indicate page data of the displacement storage to solid state hard disc not from caching;
3) separation module, separates to effective page data for the page type according to effective page data, obtains
The page data of the first kind.
Alternatively, in the present embodiment, the page data of above-mentioned Second Type can include:First page data and second
Page data, wherein, the page type that the second acquisition module obtains effective page data in the following manner includes:It will repair
Change and be designated the page data do not changed as first page data, by modified logo to be changed and access frequency is big
It is to be changed and access frequency by modified logo in the page data equal to the first predetermined threshold as second page data
Less than the first predetermined threshold page data as the first kind page data.
That is, in the present embodiment, the FTL in solid state hard disc will detect the free space of solid state hard disc in real time,
Detect that free space is not enough and trigger after recovery request, the LRU queues that system will be begun stepping through in caching, and to LRU
Page data markup page type in queue.
For example, it is assumed that the predetermined threshold for boundary is 10%, then cache layer is by 10% page mark of the tail of the queue of LRU queues
The cold page is designated as, is the hot page by remaining page marks.Further, the cold page and the hot page are traveled through respectively, by the cold page
In containing dirty pages face be labeled as cold containing dirty pages face (CD), by the containing dirty pages face in the hot page be labeled as hot containing dirty pages face (HD), and will mark
Remember that the page type notifies the FTL in solid state hard disc.
That is, after the page type of page data marked in getting caching, then the can be obtained by separating
The page data (i.e. cold containing dirty pages face) of one type, consequently facilitating the page data of the first kind is once moved,
The storage location of effective page data after resettlement to execution data record, and avoid performing caching replacement and data record process
In resettlement twice, reach reduce expense effect.
As a kind of optional scheme, in addition to:
1) the first determining unit, for by the page data of the first kind from caching resettlement into solid state hard disc it is predetermined
Move before position, the data record block of solid state hard disc is determined according at least to the page data of the first kind, wherein, solid-state
The page type of page data in the data block of each in hard disk includes:Do not write page data, failure page data, effectively
Page data, each data block includes data record block;
2) recovery unit, for carrying out data record to data record block.
Alternatively, in the present embodiment, the first determining unit includes:
(1) the 3rd acquisition module, for each data in the page data and solid state hard disc according to the first kind in caching
Page data in block obtains the data record rate of each data block;
(2) determining module, for determining data record block according to data record rate.
Alternatively, in the present embodiment, by way of comparing obtained data record rate and determining data record block include with
It is at least one lower:
1) it regard data record rate highest data block as data record block;
2) if the data record rate of several data blocks is identical and for peak, then the in these data blocks is compared
The quantity of the page data of one type, the big person of numerical value is used as data record block;
3) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, then compares the quantity of the page data of the Second Type of these data blocks, the small person of numerical value
It is used as data record block;
4) if the data record rate of several data blocks is identical and is the first kind in peak, and these data blocks
The quantity of the page data of type is identical, and the quantity of the page data of Second Type is also identical, then by the maximum data of block identification
Block is used as data record block.
It should be noted that in the present embodiment, the page is not only stored in the above-mentioned mapping table as the cache layer of caching
The page type of data markers, also corresponds to and stores page data in displacement storage to default positional information after solid state hard disc
(block identification of such as data block).
For example, it is assumed that the page data of the first kind be cold containing dirty pages face, then FTL can count by caching obtain mark for
Fail the quantity of page data in the quantity in the cold containing dirty pages face of the page data of the first kind, and solid state hard disc each data block,
In units of data block, failed in each data block page quantity and cold dirty page quantity are obtained respectively, above-mentioned failure is utilized
Page quantity and cold dirty page quantity calculate the data record rate of each data block.
The embodiment provided by the application, being accurately positioned by data record rate in solid state hard disc is used to carry out data time
The data record block of receipts, so as to realize the data record to solid state hard disc precise and high efficiency, and then ensures data in solid state hard disc
Treatment effeciency.
As a kind of optional scheme, the 3rd acquisition module includes:
1) submodule is handled, for repeating following steps, until having traveled through each data block in solid state hard disc:
S1, obtains the block identification of current data block;
S2, obtains the page data and failure page data for the first kind that block identification is identified;
S3, obtains the data record rate of current data block in the following manner:
Wherein, r represents the data record rate of current data block, and a represents the failure page of current data block in solid state hard disc
The page quantity of data, b represents the page quantity of the page data of the first kind in caching, P representation page sizes, B
Represent block size.
It should be noted that in the present embodiment, the unit of read-write operation is the page in solid state hard disc, wherein, the page is big
Small is usually 2KB, and access delay is generally 15us to 200us.The unit of erasing operation is block, wherein, block size leads to
It is often 128KB, one piece of erasing needs 2ms or so expense.
The embodiment provided by the application, the data for calculating each data block in solid state hard disc successively through the above way are returned
Yield, so that the accuracy of data record block determined by ensureing, and then realize the data time to solid state hard disc precise and high efficiency
Receive.
As a kind of optional scheme, recovery unit includes:
1) module is moved, for effective page data in data record block to be moved to predetermined resettlement position, and will
Effective page data markers are failure page data;
2) module is wiped, for wiping the failure page data in data record block.
For example, it is assumed that the page data of the first kind is by taking cold containing dirty pages face as an example, the page data of Second Type is with the clean page
, then, can be dirty by the clean page and heat in data record block during data record is performed exemplified by hot containing dirty pages face
Page direct copying changes the corresponding positional information of above-mentioned page data in FTL to predetermined resettlement position.And by number
It is failure page data (failure page representation can be used) according to corresponding effective page data markers in block are reclaimed.
Further, by the cold containing dirty pages face in data record block also labeled as failure page data, and will this is cold dirty in the buffer
The latest data of the page is copied to predetermined resettlement position.Then, the latest data of the cold containing dirty pages face in the buffer is deleted,
The corresponding positional information of above-mentioned page data in FTL is changed simultaneously.
Then, the page data in erasing data record block, " erasing " is labeled as by the data record block, to realize
To the data record of solid state hard disc, the purpose in releasing idling space.
The embodiment provided by the application, realizes ensure that active page to the data record of solid state hard disc through the above way
The page data of the first kind in the data of face and the page data of Second Type can once move predetermined resettlement position
Put, it is to avoid the secondary resettlement to the page data of the first kind, realize the effect of the expense of reduction solid state hard disc.
As a kind of optional scheme, in addition to:
1) the second determining unit, for by the page data of the first kind from caching resettlement into solid state hard disc it is predetermined
Before resettlement position, according to the size for not writing page data in other data blocks in solid state hard disc in addition to data record block
Determine predetermined resettlement position.
For example, statistics reclaims the size of effective page data in block, the FTL of real-time update is checked, inquiry solid-state is hard
The size that effective page data is met in other data blocks of disk does not write page of data, regard the data block found as this
The predetermined resettlement position of effective page data of data record block.
The embodiment provided by the application, by according in other data blocks in solid state hard disc in addition to data record block
The size for not writing page data determines predetermined resettlement position, can be complete with the effective page data ensured in data record block
Move in portion.
It should be noted that above-mentioned modules can be by software or hardware to realize, for the latter, Ke Yitong
Cross in the following manner realization, but not limited to this:Above-mentioned module is respectively positioned in same processor;Or, above-mentioned module distinguishes position
In multiple processors.
Embodiment 3
Embodiments of the invention additionally provide a kind of storage medium.Alternatively, in the present embodiment, above-mentioned storage medium can
The program code for performing following steps to be arranged to storage to be used for:
S1, obtains and reclaims request, wherein, recovery request is used to ask to carry out data time to the page data in solid state hard disc
Receive;
The page data that request obtains the first kind from effective page data of caching is reclaimed in S2, response, wherein, first
The page data of type is used to indicate to replace from caching storage to the page data of solid state hard disc;
S3, by the page data of the first kind from the caching resettlement resettlement position predetermined into solid state hard disc, wherein, make a reservation for
Resettlement position for perform data record after effectively page data storage location.
Alternatively, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only storage (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic
Dish or CD etc. are various can be with the medium of store program codes.
Alternatively, the specific example in the present embodiment may be referred to showing described in above-described embodiment and optional embodiment
Example, the present embodiment will not be repeated here.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with general
Computing device realizes that they can be concentrated on single computing device, or is distributed in multiple computing devices and is constituted
Network on, alternatively, the program code that they can be can perform with computing device be realized, it is thus possible to by they
Storage is performed by computing device in the storage device, and in some cases, can be to be held different from order herein
They, are either fabricated to each integrated circuit modules or will be many in them by the shown or described step of row respectively
Individual module or step are fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific hardware
Combined with software.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the technology of this area
For personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made is any
Modification, equivalent substitution, improvement etc., should be included in the scope of the protection.
Claims (16)
1. a kind of data processing method, it is characterised in that including:
Obtain and reclaim request, wherein, described reclaim asks to be used to ask to enter line number to the page data in solid state hard disc
According to recovery;
Response is described to reclaim the page data that request obtains the first kind from effective page data of caching, wherein,
The page data of the first kind is used to indicate to replace from the caching storage to the solid state hard disc
Page data;
The page data of the first kind is moved to the resettlement position predetermined into the solid state hard disc from the caching
Put, wherein, the predetermined resettlement position is the storage position for performing effective page data after the data record
Put.
2. according to the method described in claim 1, it is characterised in that response is described to reclaim effective page number of the request from caching
Page data according to the middle acquisition first kind includes:
Obtain the access frequency and modified logo to effective page data in the caching;
The page type of effective page data is obtained according to the access frequency and the modified logo, wherein,
The page type of effective page data includes the page data of the first kind and the page number of Second Type
According to the page data of the Second Type is used to indicate that displacement to be stored to the solid state hard disc not from the caching
Page data;
Effective page data is separated according to the page type of effective page data, described is obtained
The page data of one type.
3. method according to claim 2, it is characterised in that the page data of the Second Type includes first page
Data and second page data, wherein, effective page is obtained according to the access frequency and the modified logo
The page type of data includes:
Using the modified logo be the page data do not changed as the first page data, the modification is marked
Know for changed and the access frequency be more than or equal to the first predetermined threshold page data as the second page
Face data, by the modified logo be change and the access frequency less than first predetermined threshold the page
Data as the first kind page data.
4. method according to claim 2, it is characterised in that delay by the page data of the first kind from described
Deposit before moving the resettlement position predetermined into the solid state hard disc, in addition to:
The data record block of the solid state hard disc is determined according at least to the page data of the first kind, wherein, institute
Stating the page type of the page data in the data block of each in solid state hard disc includes:Page data, the failure page are not write
Data, effective page data, each described data block include the data record block;
The data record is carried out to the data record block.
5. method according to claim 4, it is characterised in that determined according at least to the page data of the first kind
The data record block of the solid state hard disc includes:
In the page data of the first kind according to the caching and the solid state hard disc in each data block
Page data obtains the data record rate of each data block;
The data record block is determined according to the data record rate.
6. method according to claim 5, it is characterised in that the page number of the first kind according to the caching
According to and the solid state hard disc in page data in each data block obtain the data record rate of each data block
Including:
Following steps are repeated, until having traveled through each described data block in the solid state hard disc:
Obtain the block identification of current data block;
Obtain the page data and the failure page data for the first kind that the block identification is identified;
The data record rate of the current data block is obtained in the following manner:
<mrow>
<mi>r</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo>(</mo>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
<mo>)</mo>
<mo>*</mo>
<mi>P</mi>
</mrow>
<mi>B</mi>
</mfrac>
<mo>,</mo>
</mrow>
Wherein, the r represents the data record rate of the current data block, and a represents described solid
The page quantity of the failure page data of current data block described in state hard disk, the b represents described slow
The page quantity of the page data of the first kind in depositing, the P representation pages size, the B tables
Show block size.
7. method according to claim 4, it is characterised in that the data record bag is carried out to the data record block
Include:
Effective page data in the data record block is moved to the predetermined resettlement position, and by institute
Effective page data markers are stated for the failure page data;
The failure page data in the data record block is wiped.
8. method according to claim 7, it is characterised in that delay by the page data of the first kind from described
Deposit before moving the resettlement position predetermined into the solid state hard disc, in addition to:
Page number is not write according to other data blocks in the solid state hard disc in addition to the data record block
According to size determine the predetermined resettlement position.
9. a kind of data processing equipment, it is characterised in that including:
First acquisition unit, request is reclaimed for obtaining, wherein, described reclaim asks to be used to ask to solid state hard disc
In page data carry out data record;
Second acquisition unit, asks to obtain the first kind from effective page data of caching for responding described reclaim
Page data, wherein, the page data of the first kind is used for instruction will replace storage from the caching
To the page data of the solid state hard disc;
Unit is moved, for the page data of the first kind to be moved into the solid state hard disc from the caching
Predetermined resettlement position, wherein, the predetermined resettlement position is effective page after the execution data record
The storage location of data.
10. device according to claim 9, it is characterised in that second acquisition unit includes:
First acquisition module, for obtaining access frequency and modification to effective page data in the caching
Mark;
Second acquisition module, for obtaining effective page data according to the access frequency and the modified logo
Page type, wherein, the page type of effective page data include the first kind page data and
The page data of Second Type, the page data of the Second Type is used to indicate to replace storage not from the caching
To the page data of the solid state hard disc;
Separation module, is divided effective page data for the page type according to effective page data
From obtaining the page data of the first kind.
11. device according to claim 10, it is characterised in that the page data of the Second Type includes first page
Face data and second page data, wherein, second acquisition module obtains effective page in the following manner
The page type of data includes:
Using the modified logo be the page data do not changed as the first page data, the modification is marked
Know for changed and the access frequency be more than or equal to the first predetermined threshold page data as the second page
Face data, by the modified logo be change and the access frequency less than first predetermined threshold the page
Data as the first kind page data.
12. device according to claim 10, it is characterised in that also include:
First determining unit, for being moved by the page data of the first kind from the caching to the solid-state
In hard disk before predetermined resettlement position, the solid state hard disc is determined according at least to the page data of the first kind
Data record block, wherein, the page type of the page data in the solid state hard disc in each data block includes:
Page data, failure page data, effective page data are not write, and each described data block includes the number
According to recovery block;
Recovery unit, for carrying out the data record to the data record block.
13. device according to claim 12, it is characterised in that the first determining unit includes:
3rd acquisition module, for the page data of the first kind according to the caching and the solid state hard disc
In page data in each data block obtain the data record rate of each data block;
Determining module, for determining the data record block according to the data record rate.
14. device according to claim 13, it is characterised in that the 3rd acquisition module includes:
Handle submodule, for repeating following steps, until traveled through in the solid state hard disc it is described each
Data block:
Obtain the block identification of current data block;
Obtain the page data and the failure page data for the first kind that the block identification is identified;
The data record rate of the current data block is obtained in the following manner:
<mrow>
<mi>r</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo>(</mo>
<mi>a</mi>
<mo>+</mo>
<mi>b</mi>
<mo>)</mo>
<mo>*</mo>
<mi>P</mi>
</mrow>
<mi>B</mi>
</mfrac>
<mo>,</mo>
</mrow>
Wherein, the r represents the data record rate of the current data block, and a represents described solid
The page quantity of the failure page data of current data block described in state hard disk, the b represents described slow
The page quantity of the page data of the first kind in depositing, the P representation pages size, the B tables
Show block size.
15. device according to claim 12, it is characterised in that the recovery unit includes:
Module is moved, is removed for effective page data in the data record block to be moved to described predetermined
Position is moved, and is the failure page data by effective page data markers;
Module is wiped, for wiping the failure page data in the data record block.
16. device according to claim 15, it is characterised in that also include:
Second determining unit, for being moved by the page data of the first kind from the caching to the solid-state
In hard disk before predetermined resettlement position, according to other numbers in the solid state hard disc in addition to the data record block
The predetermined resettlement position is determined according to the size for not writing page data described in block.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610103929.6A CN107122124B (en) | 2016-02-25 | 2016-02-25 | Data processing method and device |
PCT/CN2017/074290 WO2017143972A1 (en) | 2016-02-25 | 2017-02-21 | Data processing method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610103929.6A CN107122124B (en) | 2016-02-25 | 2016-02-25 | Data processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107122124A true CN107122124A (en) | 2017-09-01 |
CN107122124B CN107122124B (en) | 2021-06-15 |
Family
ID=59684803
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610103929.6A Active CN107122124B (en) | 2016-02-25 | 2016-02-25 | Data processing method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107122124B (en) |
WO (1) | WO2017143972A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109739776A (en) * | 2018-12-06 | 2019-05-10 | 天津津航计算技术研究所 | Greedy garbage retrieving system for NAND Flash main control chip |
CN112905129A (en) * | 2021-05-06 | 2021-06-04 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109710541B (en) * | 2018-12-06 | 2023-06-09 | 天津津航计算技术研究所 | Optimization method for Greedy garbage collection of NAND Flash main control chip |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110072198A1 (en) * | 2009-09-23 | 2011-03-24 | Lsi Corporation | Accessing logical-to-physical address translation data for solid state disks |
CN102508788A (en) * | 2011-09-28 | 2012-06-20 | 成都市华为赛门铁克科技有限公司 | SSD (solid state drive) and SSD garbage collection method and device |
CN102567218A (en) * | 2010-12-17 | 2012-07-11 | 微软公司 | Garbage collection and hotspots relief for a data deduplication chunk store |
CN102841850A (en) * | 2012-06-19 | 2012-12-26 | 记忆科技(深圳)有限公司 | Method and system for reducing solid state disk write amplification |
CN103136121A (en) * | 2013-03-25 | 2013-06-05 | 中国人民解放军国防科学技术大学 | Cache management method for solid-state disc |
CN103455435A (en) * | 2013-08-29 | 2013-12-18 | 华为技术有限公司 | Data writing method and device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8285918B2 (en) * | 2009-12-11 | 2012-10-09 | Nimble Storage, Inc. | Flash memory cache for data storage device |
CN102279809A (en) * | 2011-08-10 | 2011-12-14 | 郏惠忠 | Method for redirecting write in and garbage recycling in solid hard disk |
CN104424103B (en) * | 2013-08-21 | 2018-05-29 | 光宝科技股份有限公司 | Solid state storage device medium-speed cached management method |
-
2016
- 2016-02-25 CN CN201610103929.6A patent/CN107122124B/en active Active
-
2017
- 2017-02-21 WO PCT/CN2017/074290 patent/WO2017143972A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110072198A1 (en) * | 2009-09-23 | 2011-03-24 | Lsi Corporation | Accessing logical-to-physical address translation data for solid state disks |
CN102567218A (en) * | 2010-12-17 | 2012-07-11 | 微软公司 | Garbage collection and hotspots relief for a data deduplication chunk store |
CN102508788A (en) * | 2011-09-28 | 2012-06-20 | 成都市华为赛门铁克科技有限公司 | SSD (solid state drive) and SSD garbage collection method and device |
CN102841850A (en) * | 2012-06-19 | 2012-12-26 | 记忆科技(深圳)有限公司 | Method and system for reducing solid state disk write amplification |
CN103136121A (en) * | 2013-03-25 | 2013-06-05 | 中国人民解放军国防科学技术大学 | Cache management method for solid-state disc |
CN103455435A (en) * | 2013-08-29 | 2013-12-18 | 华为技术有限公司 | Data writing method and device |
Non-Patent Citations (2)
Title |
---|
YOUNGJAE LEE 等: "Zombie Chasing: Efficient Flash Management Considering Dirty Data in the Buffer Cache", 《IEEE TRANSACTIONS ON COMPUTERS》 * |
侯奎: "固态硬盘的闪存转换层映射策略研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109739776A (en) * | 2018-12-06 | 2019-05-10 | 天津津航计算技术研究所 | Greedy garbage retrieving system for NAND Flash main control chip |
CN109739776B (en) * | 2018-12-06 | 2023-06-30 | 天津津航计算技术研究所 | Greedy garbage collection system for NAND Flash main control chip |
CN112905129A (en) * | 2021-05-06 | 2021-06-04 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
CN112905129B (en) * | 2021-05-06 | 2021-08-13 | 蚂蚁金服(杭州)网络技术有限公司 | Method and device for eliminating cache memory block and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
WO2017143972A1 (en) | 2017-08-31 |
CN107122124B (en) | 2021-06-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102576333B (en) | Data cache in nonvolatile memory | |
US10810127B2 (en) | Solid-state hard disk and data access method for use with solid-state hard disk | |
CN108763110B (en) | Data caching method and device | |
CN110032521B (en) | Method and system for enhancing mapping flexibility of flash memory conversion layer | |
CN109947363B (en) | Data caching method of distributed storage system | |
CN106502587B (en) | Hard disk data management method and hard disk control device | |
KR100772863B1 (en) | Method and apparatus for shortening operating time of page replacement in demand paging applied system | |
CN107391774B (en) | The rubbish recovering method of log file system based on data de-duplication | |
CN108205473B (en) | Memory processing method and device, computer device and computer readable storage medium | |
WO2012106362A2 (en) | Apparatus, system, and method for managing eviction of data | |
EP2842040B1 (en) | Collaborative caching | |
CN103984648A (en) | Method to throttle rate of data caching for improved I/O performance | |
CN101644996A (en) | Storage method of index data and storage control device | |
CN109446117B (en) | Design method for page-level flash translation layer of solid state disk | |
CN102981963A (en) | Implementation method for flash translation layer of solid-state disc | |
CN107015763A (en) | Mix SSD management methods and device in storage system | |
US8862838B1 (en) | Low overhead memory space management | |
CN107797772A (en) | A kind of garbage retrieving system and method based on flash media | |
CN108205471B (en) | Memory recovery method and device, computer device and computer readable storage medium | |
Wang et al. | Separating data via block invalidation time inference for write amplification reduction in {Log-Structured} storage | |
CN107451071A (en) | A kind of caching replacement method and system | |
CN107122124A (en) | Data processing method and device | |
CN110968269A (en) | SCM and SSD-based key value storage system and read-write request processing method | |
US8402198B1 (en) | Mapping engine for a storage device | |
CN102314397A (en) | Method for processing cache data block |
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 |