CN109343796A - A kind of data processing method and device - Google Patents
A kind of data processing method and device Download PDFInfo
- Publication number
- CN109343796A CN109343796A CN201811105669.1A CN201811105669A CN109343796A CN 109343796 A CN109343796 A CN 109343796A CN 201811105669 A CN201811105669 A CN 201811105669A CN 109343796 A CN109343796 A CN 109343796A
- Authority
- CN
- China
- Prior art keywords
- physical block
- data
- effective physical
- effective
- state information
- 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
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- 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/062—Securing 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/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/064—Management of blocks
-
- 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/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
The application provides a kind of data processing method and device, this method comprises: obtaining the effective physical block for being fully written data of solid state hard disk;The first data are read from the first designated sector of effective physical block, determine the damage data in first data, the first state information of effective physical block is determined according to the quantity of the damage data;If effective physical block is real exception described in the first state information representation, garbage reclamation is carried out to effective physical block.By the technical solution of the application, garbage reclamation can be carried out to effective physical block in time, guarantee the stability of effective physical block, improve the safety of data storage.
Description
Technical field
This application involves fields of communication technology, more particularly, to a kind of data processing method and device.
Background technique
SSD (Solid State Drives, solid state hard disk) is a kind of novel hard disk, the fast, quake-resistant safety with speed
Property it is high, stability is good, high integration, vast capacity, read or write speed are fast, read-write postpones small, low in energy consumption, non-volatile storage Jie
The characteristics such as matter, thus be widely used in life every field, for example, consumer electronics, military equipment, monitoring security protection, network,
Server, handheld device, Industry Control etc..
In the use process of SSD, data can constantly be written into Block (physical block, also referred to as data block), always
It is fully written to physical block, data then is written in a physical block still further below, and so on.Further, using in SSD
Cheng Zhong, can be with then for having write the physical blocks (i.e. effective physical block) of full data in order to guarantee to have available physical block
Garbage reclamation is carried out to effective physical block, so that effectively physical block becomes free physical block, in this manner it is possible to again to idle object
Data are written in reason block.
For the effective physical block of selected part from mass efficient physical block, and rubbish is carried out to the effective physical block in part and is returned
It receives, it can be in the following way: after physical block becomes effective physical block, over time, having in effective physical block
Effect data are fewer and fewer, and state is more and more unstable, accordingly, it is determined that the Data writing time of each effectively physical block, and logarithm
Garbage reclamation is carried out according to write time long effective physical block.
But due to the uncertainty of environmental factor, such as the variation of temperature change, humidity, extraneous radiation, vibration, even if
Time as effective physical block is shorter, and the state of effective physical block may also be unstable, if not carrying out to effective physical block
Garbage reclamation, then the safety of data can be very low in effective physical block.
Summary of the invention
The application provides a kind of data processing method, is applied to storage equipment, which comprises
Obtain the effective physical block for being fully written data of the solid state hard disk of the storage equipment;
The first data are read from the first designated sector of effective physical block, determine the damage in first data
Data, and the first state information of effective physical block is determined according to the quantity of the damage data;
If effective physical block is real exception described in the first state information representation, effective physical block is carried out
Garbage reclamation.
The application provides a kind of data processing equipment, is applied to storage equipment, and described device includes:
Module is obtained, the effective physical block for being fully written data of the solid state hard disk for obtaining storage equipment;
Read module, for reading the first data from the first designated sector of effective physical block;
Determining module, for determining the damage data in first data;
The first state information of effective physical block is determined according to the quantity of the damage data;
Processing module, for when effectively physical block is real abnormal described in the first state information representation, then to institute
It states effective physical block and carries out garbage reclamation.
Based on the above-mentioned technical proposal, in the embodiment of the present application, it can determine the current degree of stability of effective physical block, have
When effect physical block is unstable, garbage reclamation is carried out to effective physical block in time, guarantees the stability of effective physical block, improves data
The safety of storage thereby may be ensured that the steady fixed sum data safety of the performance of SSD.Even if there are unstable factors (such as temperature in the external world
Degree variation, humidity variation, extraneous radiation, vibration etc.), effective physical block can also be protected, that reduces loss of data can
Energy property, guarantees data security, weakens the risk of loss of data, guarantee the safety and stability of effective physical block, it is hard can to extend solid-state
The service life of disk.
Detailed description of the invention
It, below will be to the application in order to clearly illustrate the embodiment of the present application or technical solution in the prior art
Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below
Attached drawing is only some embodiments as described in this application, for those of ordinary skill in the art, can also be according to this Shen
Please these attached drawings of embodiment obtain other attached drawings.
Fig. 1 is the flow chart of the data processing method in a kind of embodiment of the application;
Fig. 2 is the structural schematic diagram of the solid state hard disk in a kind of embodiment of the application;
Fig. 3 is the structural schematic diagram of the physical block in a kind of embodiment of the application;
Fig. 4 is the flow chart of the data processing method in the application another embodiment;
Fig. 5 is the structure chart of the data processing equipment in a kind of embodiment of the application;
Fig. 6 is the hardware structure diagram of the storage equipment in a kind of embodiment of the application.
Specific embodiment
In the term that the embodiment of the present application uses merely for the sake of for the purpose of describing particular embodiments, rather than limit this Shen
Please.The "an" of singular used in the application and claims, " described " and "the" are also intended to including most shapes
Formula, unless context clearly shows that other meanings.It is also understood that term "and/or" used herein refers to comprising one
A or multiple associated any or all of project listed may combine.
It will be appreciated that though various letters may be described using term first, second, third, etc. in the embodiment of the present application
Breath, but these information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example,
In the case where not departing from the application range, the first information can also be referred to as the second information, and similarly, the second information can also be with
The referred to as first information.Depending on context, in addition, used word " if " can be construed to " ... when " or
" when ... " or " in response to determination ".
The embodiment of the present application proposes that a kind of data processing method, this method can be applied to storage equipment, and storage equipment can
To be the equipment using solid state hard disk (i.e. SSD) storing data.Wherein, solid state hard disk can by a large amount of Block (physical block,
It is properly termed as data block) composition, it is subsequent to be illustrated by taking physical block as an example.
Wherein, solid state hard disk can be a kind of novel hard disk, storage medium may include Flash (flash memory) medium (such as
NAND Flash medium), by the way that multiple storage units are formed a storage array, and control unit and some additional function is added
Energy device, can form one piece of solid state hard disk.Solid state hard disk is with speed is fast, seismic seeurity is high, stability is good, highly integrated
Degree, vast capacity, read or write speed are fast, read-write postpones the characteristics such as small, low in energy consumption, non-volatile storage medium, thus extensive
Every field applied to life.
In one example, solid state hard disk may include a large amount of physical blocks, using the process of solid state hard disk storing data, just
It is the process constantly to physical block write-in data, until physical block is fully written, continues that data are written to next physical block, with
This analogizes.Wherein, solid state hard disk may include following types of physical block:
The first, the physical block of (FREE state), that is, the object that there is invalid data and be currently not used by are in idle condition
Manage block, that is to say, that physical block does not store valid data, can be written into new data, but there are invalid datas for physical block, need
After invalid data is wiped, new data can just be written in physical block.
The second, it is in the physical block of erase status (ERASE state), i.e., erased clean and that data are not written physics
Block, that is to say, that all data in physical block have been wiped free of, and after data erasure completion, have not been written to new data, i.e.,
New data can be written to the physical block.For example, being wiped for the physical block being in idle condition by the data in physical block
Afterwards, what is obtained is the physical block in erase status.
Third, the physical block for being in programming state (PROGRAM state) do not write full data and are not empty physical block,
It is the physical block being being currently used, that is to say, that data are currently written into the physical block, and still, data are filled up not yet
This physical block.For example, for the physical block in erase status, when using this physical block write-in data, the physical block
It can be the physical block in programming state.
4th, it is in the physical block of use state (USED state), that is, the physical block of full data has been write, in the physical block
Data be valid data, some data may be invalid data, which has been fully written data, cannot write again
New data can be written, and the performance of physical block is more steady after only wiping the data of the physical block by entering new data
It is fixed.For example, after this physical block is fully written data, this physical block can be place for the physical block in programming state
In the physical block of use state.
5th, it is in the physical block of transition state (GC state), that is, needs to carry out garbage reclamation (valid data are moved)
Physical block is needed to carry out garbage reclamation to the valid data in physical block, i.e., is migrated valid data from physical block, to this rubbish
Rubbish removal process is with no restrictions.For example, if desired carrying out rubbish for the physical block in use state to this physical block and returning
It receives, then physical block can be the physical block in transition state.Further, rubbish is being carried out to the valid data in physical block
After recycling, if this physical block can also normal use, this physical block can become the physics that is in idle condition
Block, if this physical block can not normal use, this physical block can become in damaged condition physical block.
6th, the physical block of in damaged condition (BAD state), i.e., can not normal use physical block, be
The physical block of damage.Wherein, the source of damage may include: factory before just damaged, service life reaches the limit of, erasing times
Reach threshold value, data write number more than threshold value, without limitation.
7th, the physical block in migration distress condition (GC BAD state), that is, need to carry out garbage reclamation (valid data
Move) damage physical block, need to carry out garbage reclamation to the valid data in the physical block, i.e., by valid data from this object
It is migrated in reason block, with no restrictions to this process.Moreover, after carrying out garbage reclamation to the valid data in the physical block, this
Physical block can not normal use, therefore, this physical block can be in migration distress condition physical block.For example,
For the physical block for being in programming state, in the data writing process of this physical block, if data write-in failure, due to this
Valid data are had been written into physical block, therefore, it is necessary to move out by the valid data in the physical block, and due to this object
Reason block has damaged, and therefore, after moving out by valid data, which be will not be used.
In conclusion at any moment that solid state hard disk uses, all physical blocks there is above-mentioned various states, moreover,
It is also mutually being converted between the physical block of various states, with no restrictions to this state conversion process.
From the above, it is seen that data can be written in idle state/erase status physical block, to idle shape
After data are written in state/erase status physical block, until physical block is fully written, then physical block becomes the physics of use state
Block, and data cannot be written in the physical block of use state.Obviously, in data writing process, idle state/erase status physics
The quantity of block is reduced, and the quantity of the physical block of use state increases, therefore, it is necessary to a kind of mechanism come guarantee there are idle state/
The physical block of erase status, this mechanism are garbage reclamations.
Wherein, the realization process of garbage reclamation may is that the physical block for use state, it is understood that there may be valid data,
Valid data and invalid data are also likely to be present, therefore, valid data can be migrated from the physical block and (be moved to other
Physical block), without migrating invalid data from the physical block, after the completion of migration, so that it may wipe the physical block
Operation, so that no longer there are data in the physical block.
Further, to physical block carry out garbage reclamation after, if the physical block can also normal use, the physical block
The physical block being in idle condition can be converted to, data can be written into the physical block.
In one example, solid state hard disk may include the physical block of a large amount of use states, need from these physical blocks
Selected part physical block, and garbage reclamation is carried out to part physical block.It, can for the selected part physical block from these physical blocks
With in the following way: in some period, once being traversed to the physical block of all use states, obtain each physical block
Data writing time chooses the longest physical block of Data writing time, carries out garbage reclamation to this physical block.In next week
Phase, repeat aforesaid operations, and so on, that is to say, that in each period, selection the longest physical block of Data writing time into
Row garbage reclamation.
But due to the uncertainty of environmental factor, such as the variation of temperature change, humidity, extraneous radiation, vibration, even if
The Data writing time of physical block is shorter, then the state of the physical block may also be unstable, if not in time to the physical block into
Row garbage reclamation, then the safety of data can be very low in the physical block.
For above-mentioned discovery, a kind of data processing method is proposed in the embodiment of the present application, this method can be applied to deposit
Equipment is stored up, which can be using solid state hard disk come storing data.It is shown in Figure 1, to be proposed in the embodiment of the present application
Data processing method flow diagram, this method may include:
Step 101, the effective physical block for being fully written data of the solid state hard disk is obtained.
In order to distinguish conveniently, the above-mentioned physical block in use state can be known as effective physical block, effective physics
Block has been fully written data, and the data effectively having in physical block are valid data, and some data may be invalid data.Its
In, which new data cannot be written again and can be written after only wiping the data of effective physical block
New data, and the performance of effectively physical block is more stable.
It is shown in Figure 2, it is the structural schematic diagram of solid state hard disk, which may include multiple channels, Mei Getong
There are multiple cores unit (being properly termed as Die) under road, there are multiple flat units (to be properly termed as under each core cell
Palne), multiple physical blocks are dispersed under each flat unit, there are effective physical blocks in these physical blocks, that is to say, that
Multiple effective physical blocks are dispersed under different flat units.
In the present embodiment, the effective physical block for being fully written data of the solid state hard disk is obtained, may include: on determining
First flat unit locating for the effective physical block once obtained determines the second plane list different from first flat unit
Member, and the effective physical block for being fully written data is obtained from the second flat unit.For example, the last effective physical block obtained
The first locating flat unit is flat unit 1, it is determined that second flat unit different from flat unit 1, such as flat unit
2, and effective physical block is obtained from flat unit 2.
In one example, all flat units of solid state hard disk can be ranked up, such as flat unit 1, plane list
Member 2 ..., flat unit 8 obtain first effective physical block 11 of flat unit 1, for effective physics in a polling period
Block 11 carries out subsequent processing;After the completion of the processing of effective physical block 11, first effective physical block 21 of flat unit 2 is obtained,
Subsequent processing is carried out for effective physical block 21;And so on, first effective physical block 81 of flat unit 8 is obtained, for
Effective physical block 81 carries out subsequent processing;After the completion of the processing of effective physical block 81, second effective substance of flat unit 1 is obtained
Block 12 is managed, carries out subsequent processing for effective physical block 12;And so on, until obtaining out all effective substances of solid state hard disk
Block is managed, terminates the processing of current polling period, waits next polling period, repeat the above steps.
Step 102, the first data are read from the first designated sector of effective physical block, and are determined in first data
Data are damaged, and determine the first state information of effective physical block according to the quantity of the damage data.Wherein, first state information
Characterizing effective physical block is that really exception or the effective physical block of characterization are not abnormal.
In one example, which can include but is not limited to: first sector of effective physical block or
The last one sector of the effective physical block of person.Certainly, the first designated sector can also be other sectors of effective physical block, if any
Second sector etc. of physical block is imitated, it is without limitation.
It is shown in Figure 3, be physical block structural schematic diagram, each physical block may include multiple sectors (such as
Sector), sector is the minimum data unit of solid state hard disk, is to each of physical block to the process of physical block write-in data
Data are written in sector.After all sectors of physical block are written into data, this physical block is fully written data, and this physical block
As effective physical block, at this point, the data in all sectors of effectively physical block are all valid data, all sectors are all effective
Sector.In the follow-up process, user may carry out delete operation to the valid data in effective sector, so that this effective sector
As invalidated sector, the data in effective sector become invalid data.Due to the characteristic of solid state hard disk, in effective sector
When valid data carry out delete operation, instead of deletion valid data do not indicate this effective sector setting invalid flag position
This effective sector becomes invalidated sector, and the data in this effective sector become invalid data.
Obviously, over time, effective number of sectors in effective physical block is fewer and fewer, and invalidated sector quantity is got over
Carry out more, the i.e. longer effective physical block of Data writing time, invalidated sector quantity is more, therefore, when data can be written
Between long effective physical block carry out garbage reclamation.But in some cases, even if the Data writing time ratio of effectively physical block
Shorter, then the data stability of this effective physical block is also poor;Alternatively, even if the Data writing time ratio of effectively physical block
Longer, then the data stability of this effective physical block is also relatively good.Therefore, in the present embodiment, can directly analyze effectively
The data stability of physical block, and determine based on the data stability of effective physical block the first state information of effective physical block.
In practical applications, when the data stability of effective physical block is poor, then each sector of effective physical block
Data stability it is all poor, when the data stability of effective physical block is relatively good, then each sector of effective physical block
Data stability it is all relatively good, hence, it can be determined that the data stability of sector of effectively physical block, and the sector
Data stability is exactly the data stability of effective physical block.
Based on this, can be read from a sector (this sector can rule of thumb be set) for effective physical block all
Data (in order to distinguish conveniently, these data are known as the first data), determine the damage data in the first data, and according to damage
The quantity of bad data determines the first state information of effective physical block.If the effective physical block of first state information representation is really different
Often, then it represents that the data stability of the sector is poor, i.e., the data stability of effective physical block is poor;If first state is believed
Breath characterize effective physical block be it is not abnormal, indicate that the data stability of the sector is relatively good, i.e., the data stabilization of effective physical block
Property is relatively good.
Wherein, in all sectors of effective physical block, edge sector (first sector of effective physical block and last
A sector) stability it is worst, i.e. the data of edge sector are easily damaged, therefore, can use edge sector data determine
The first state information of effective physical block.That is, reading all first data in a sector from effective physical block
When, all first data can be read from first sector of effective physical block, alternatively, from effective physical block the last one
All first data are read in sector.
Wherein, for all first data read from sector, it is understood that there may be partial destruction data damage data to this
Method of determination with no restrictions.For example, there are 4000 data in sector, it is 0110 that the 1st data, which are the 1100, the 2nd data,
And so on.But first data (the first data) read from sector are 1111, second number read from sector
It is 0110 according to (the first data), and so on, therefore, first data 1111 is damage data, and second data 0110 is not
It is damage data.
Wherein, the first state information of effective physical block is determined according to the quantity of damage data, may include:
If mode one, the quantity of the damage data are greater than preset quantity threshold value, first state information representation can be determined
Effective physical block is real exception;If the quantity of the damage data is not more than the preset quantity threshold value, first can be determined
Status information characterization effective substance reason block is not abnormal.
For example, preset quantity threshold value can rule of thumb be configured, such as 90, with no restrictions to this preset quantity threshold value.It is false
If reading 4000 the first data from sector, in this 4000 first data, 200 the first data are damage data,
Since the quantity 200 of damage data is greater than preset quantity threshold value 90, hence, it can be determined that the effective physics of first state information representation
Block is real exception.Alternatively, in this 4000 first data, 30 damage data if it exists, due to damaging the quantity of data
30 are less than preset quantity threshold value 90, hence, it can be determined that the effective physical block of first state information representation is not abnormal.
Ratio between mode two, the quantity for determining damage data and the quantity of the first data;If the ratio is greater than default
Proportion threshold value, it is determined that the effective physical block of first state information representation is real exception;If the ratio is not more than preset ratio threshold
Value, it is determined that the effective physical block of first state information representation is not abnormal.
For example, preset ratio threshold value can be rule of thumb configured, and such as 2%, it is without limitation.Assuming that being read from sector
4000 the first data, and having 200 in 4000 the first data is damage data, it is determined that damage the quantity 200 of data with
The ratio 5% of the quantity 4000 of first data, since ratio 5% is greater than preset ratio threshold value 2%, accordingly, it is determined that first state
The effective physical block of information representation is real exception.
In the above-described embodiments, when damage data are more, determine that the effective physical block of first state information representation is
It is really abnormal, when damage data are fewer, determine that the effective physical block of first state information representation is that exception, reason do not exist
In: when damage data are fewer, damage data can be repaired based on algorithm (such as redundant data algorithm, checking algorithm)
It is multiple, accordingly, it is determined that the effective physical block of first state information representation is not abnormal;When damage data are more, (such as based on algorithm
Redundant data algorithm, checking algorithm etc.) damage data can not be repaired, that is to say, that the data in effective physical block are deposited
In the risk of loss, accordingly, it is determined that the effective physical block of first state information representation is real exception.
Step 103, if the effective physical block of first state information representation is real exception, rubbish is carried out to effective physical block
Recycling.If the effective physical block of first state information representation is that exception, return step 101 do not obtain next effective physical block,
Then step 101- step 103 is repeated.
Wherein, effective physical block is the physical block in use state;Garbage reclamation is carried out to effective physical block, can wrap
It includes but is not limited to: the use state of effective physical block is converted into transition state, rubbish is carried out to effective physical block after conversion
Recycling, the garbage reclamation mode is referring to above-described embodiment.After the use state of effective physical block is converted to transition state, also
Next effective physical block can be obtained with return step 101.
Based on the above-mentioned technical proposal, in the embodiment of the present application, it can determine the current degree of stability of effective physical block, have
When effect physical block is unstable, garbage reclamation is carried out to effective physical block in time, guarantees the stability of effective physical block, improves data
The safety of storage thereby may be ensured that the steady fixed sum data safety of the performance of SSD.Even if there are unstable factors (such as temperature in the external world
Degree variation, humidity variation, extraneous radiation, vibration etc.), effective physical block can also be protected, that reduces loss of data can
Energy property, guarantees data security, weakens the risk of loss of data, guarantee the safety and stability of effective physical block, it is hard can to extend solid-state
The service life of disk.
The embodiment of the present application also proposes another data processing method, can be applied to storage equipment, and hard using solid-state
Disk storage data.It is shown in Figure 4, it is the flow diagram of this method, this method may include:
Step 401, the effective physical block for being fully written data of the solid state hard disk is obtained.
Step 402, the first data are read from the first designated sector of effective physical block, and are determined in first data
Data are damaged, and determine the first state information of effective physical block according to the quantity of the damage data.
Wherein, the effective physical block of first state information representation is real exception, alternatively, first state information representation effective substance
Managing block is doubtful exception, alternatively, the effective physical block of first state information representation is not abnormal.
Step 403, if the effective physical block of first state information representation is real exception, rubbish is carried out to effective physical block
Recycling.If the effective physical block of first state information representation is that exception, return step 401 do not obtain next effective physical block,
Then step 401- step 403 is repeated.
Wherein, the implementation process of step 401- step 403 may refer to step 101- step 103, be not repeated to go to live in the household of one's in-laws on getting married herein
It states, and the difference is that, first state information is not in addition to the effective physical block of characterization is real abnormal, the effective physical block of characterization
Abnormal, can also characterize effective physical block is doubtful exception.
Step 404, if the effective physical block of first state information representation is doubtful exception, refer to from the second of effective physical block
Determine to read the second data in sector (any sectors different from the first designated sector), and determines the damage number in the second data
According to.Wherein, the realization of step 404 may refer to step 102, the difference is that, from the second designated sector of effective physical block
Middle reading data, rather than data are read from the first designated sector.
In one example, the second designated sector can be any sector of effective physical block, as long as with the first specified fan
Area is different.For example, the second designated sector can be effective physical block most if the first designated sector is first sector
The latter sector;If the first designated sector is the last one sector, the second designated sector can be the first of effective physical block
A sector.Certainly, the second designated sector can also be other sectors of effective physical block, and such as effective physical block is second from the bottom
A sector etc., it is without limitation.
In one example, if the effective physical block of first state information representation is real exception, first state information representation
Effectively physical block is not abnormal, and the effective physical block of first state information representation is doubtful exception, then according to the quantity of damage data
The first state information for determining effective physical block, can include but is not limited to:
If mode one, the quantity are greater than the first amount threshold, it is determined that the effective physical block of first state information representation is true
Normal anomaly;If the quantity is greater than the second amount threshold, is not more than the first amount threshold, it is determined that first state information representation is effective
Physical block is doubtful exception;If the quantity is not more than the second amount threshold, it is determined that the effective physical block of first state information representation
It is not abnormal.
For example, the first amount threshold and the second amount threshold can be configured rule of thumb, and the first amount threshold is greater than the
Two amount thresholds, such as the first amount threshold are 90, and the second amount threshold is 70, to this first amount threshold and the second amount threshold
With no restrictions.Assuming that reading 4000 the first data from sector has 200 the first data in this 4000 first data
It is damage data, since the quantity 200 of damage data is greater than the first amount threshold 90, hence, it can be determined that first state information
Characterizing effective physical block is real exception.
Ratio between mode two, the quantity that can first determine damage data and the quantity of the first data;Further, if
The ratio is greater than the first proportion threshold value, then can determine that the effective physical block of first state information representation is real exception;If this ratio
Example is greater than the second proportion threshold value, is not more than first proportion threshold value, then can determine the effective physical block of first state information representation
It is doubtful exception;If the ratio is not more than second proportion threshold value, the effective physical block of first state information representation can be determined
It is not abnormal.
For example, the first proportion threshold value and the second proportion threshold value can be configured rule of thumb, and first proportion threshold value can be with
It is 2% greater than second proportion threshold value, such as first proportion threshold value, which is 1%, to this first proportion threshold value
With no restrictions with the second proportion threshold value.Further, it is assumed that 4000 the first data are read from sector, at described 4000 the
In one data, 200 the first data are damage data, then can determine the quantity 200 of damage data and the number of the first data
The ratio of amount 4000 is 5%, since ratio 5% is greater than the first proportion threshold value 2%, accordingly, it is determined that first state information representation has
Imitating physical block is real exception.
Step 405, the second status information of effective physical block is determined according to the quantity of the damage data in the second data;Its
In, it is real exception that the second status information, which characterizes effective substance reason block, alternatively, the second status information characterization effective substance reason block is doubtful
It is abnormal, alternatively, the second status information characterization effective substance reason block is not abnormal.
Wherein it is determined that the mode of the second status information of effectively physical block, may refer to determine the first of effective physical block
The mode of status information, i.e., referring to shown in step 404, it is no longer repeated herein.
Step 406, if the second status information characterization effective substance reason block is real abnormal or the effective physical block of characterization is doubtful
Like exception, then garbage reclamation is carried out to effective physical block.If the second status information characterization effective substance reason block be it is not abnormal, return
Step 401, next effective physical block is obtained.
Wherein, garbage reclamation is carried out to effective physical block, can include but is not limited to: by the use state of effective physical block
Transition state is converted to, and garbage reclamation is carried out to effective physical block after conversion.Turn by the use state of effective physical block
After being changed to transition state, return step 401 obtains next effective physical block.
Based on similarly applying conceiving with the above method, a kind of data processing equipment is also proposed in the embodiment of the present application, is answered
For storing equipment, as shown in figure 5, being the structure chart of described device, described device is specifically included:
Module 51 is obtained, the effective physical block for being fully written data of the solid state hard disk for obtaining storage equipment;It reads
Modulus block 52, for reading the first data from the first designated sector of effective physical block;
Determining module 53, for determining the damage data in first data;
The first state information of effective physical block is determined according to the quantity of the damage data;
Processing module 54 is for when effectively physical block is real abnormal described in the first state information representation, then right
Effective physical block carries out garbage reclamation.
The read module 52, being also used to work as effectively physical block described in the first state information representation is doubtful exception
When, then the second data are read from the second designated sector of effective physical block;
The determining module 53 is also used to determine the damage data in second data, and according to second data
In the quantity of damage data determine the second status information of effective physical block;
The processing module 54, be also used to when second status information characterize effective physical block be it is real abnormal or
When person is doubtful abnormal, then garbage reclamation is carried out to effective physical block.
In one example, the determining module 53 determines effective physical block according to the quantity of the damage data
It is specifically used for when first state information:
If the quantity is greater than the first amount threshold, it is determined that effective physical block described in the first state information representation is
It is really abnormal;If the quantity is greater than the second amount threshold, is not more than the first amount threshold, it is determined that the first state information
Characterizing effective physical block is doubtful exception;Alternatively, if the quantity and the quantity of first data of the damage data
Ratio is greater than the first proportion threshold value, it is determined that effective physical block is real exception described in the first state information representation;If institute
It states ratio and is greater than the second proportion threshold value, no more than the first proportion threshold value, it is determined that described in the first state information representation effectively
Physical block is doubtful exception.
In one example, effective physical block is the physical block in use state;54 pairs of institutes of the processing module
It states effective physical block be specifically used for when garbage reclamation: the use state of effective physical block is converted into transition state;
Garbage reclamation is carried out to effective physical block after conversion.
In one example, it is described obtain module 51 and obtain the solid state hard disk of the storage equipment be fully written data
Effective physical block when be specifically used for:
Determine the first flat unit locating for the last effective physical block obtained;Wherein, the solid state hard disk includes more
A flat unit, each flat unit include multiple effective physical blocks;
Determine second flat unit different from first flat unit;
The effective physical block for being fully written data is obtained from second flat unit.
Storage equipment provided by the embodiments of the present application, for hardware view, hardware structure schematic diagram specifically be may refer to
It may include: machine readable storage medium and processor shown in Fig. 6, in which:
Machine readable storage medium: store instruction code.
Processor: communicating with machine readable storage medium, read and execute stored in machine readable storage medium it is described
Instruction code realizes data processing operation disclosed in the application above-mentioned example.
Here, machine readable storage medium can be any electronics, magnetism, optics or other physical storage devices, can be with
Include or store information, such as executable instruction, data, etc..For example, machine readable storage medium may is that RAM (Radom
Access Memory, random access memory), volatile memory, nonvolatile memory, flash memory, memory driver is (as hard
Disk drive), solid state hard disk, any kind of storage dish (such as CD, dvd) perhaps similar storage medium or they
Combination.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when application.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes computer usable program code that the embodiment of the present application, which can be used in one or more,
The computer implemented in computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of program product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It is generally understood that being realized by computer program instructions each in flowchart and/or the block diagram
The combination of process and/or box in process and/or box and flowchart and/or the block diagram.It can provide these computer journeys
Sequence instruct to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices processor with
A machine is generated, so that the instruction generation executed by computer or the processor of other programmable data processing devices is used for
Realize the dress for the function of specifying in one or more flows of the flowchart and/or one or more blocks of the block diagram
It sets.
Moreover, these computer program instructions also can store be able to guide computer or other programmable datas processing set
In standby computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates
Manufacture including command device, the command device are realized in one process of flow chart or multiple processes and/or block diagram one
The function of being specified in a box or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing devices, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer
Or the instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram
The step of function of being specified in one box or multiple boxes.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.
Claims (11)
1. a kind of data processing method, which is characterized in that be applied to storage equipment, which comprises
Obtain the effective physical block for being fully written data of the solid state hard disk of the storage equipment;
The first data are read from the first designated sector of effective physical block, determine the damage number in first data
According to, and the first state information of effective physical block is determined according to the quantity of the damage data;
If effective physical block is real exception described in the first state information representation, rubbish is carried out to effective physical block
Recycling.
2. the method according to claim 1, wherein described have according to the quantity determination of the damage data
After the first state information for imitating physical block, the method also includes:
If effective physical block is doubtful exception described in the first state information representation, refer to from the second of effective physical block
Determine to read the second data in sector, and determines the damage data in second data, and according to the damage in second data
The quantity of bad data determines the second status information of effective physical block;
If it is real abnormal or doubtful exception that second status information, which characterizes effective physical block, to the effective substance
It manages block and carries out garbage reclamation.
3. according to the method described in claim 2, it is characterized in that,
First designated sector is first sector or the last one sector;
If first designated sector is first sector, second designated sector is the last one sector;
If first designated sector is the last one sector, second designated sector is first sector.
4. method according to claim 1 or 2, which is characterized in that
The first state information of effective physical block is determined according to the quantity of the damage data, comprising:
If the quantity is greater than the first amount threshold, it is determined that effective physical block is real described in the first state information representation
It is abnormal;If the quantity is greater than the second amount threshold, is not more than the first amount threshold, it is determined that the first state information representation
Effective physical block is doubtful exception;Alternatively, if the ratio of the quantity of the quantity and first data of the damage data
Greater than the first proportion threshold value, it is determined that effective physical block is real exception described in the first state information representation;If the ratio
Example is greater than the second proportion threshold value, is not more than the first proportion threshold value, it is determined that effective physics described in the first state information representation
Block is doubtful exception.
5. the method according to claim 1, wherein effective physical block is the physics in use state
Block;It is described that garbage reclamation is carried out to effective physical block, comprising:
The use state of effective physical block is converted into transition state;
Garbage reclamation is carried out to effective physical block after conversion.
6. the method according to claim 1, wherein
Obtain the effective physical block for being fully written data of the solid state hard disk of the storage equipment, comprising:
Determine the first flat unit locating for the last effective physical block obtained;Wherein, the solid state hard disk includes multiple flat
Face unit, each flat unit include multiple effective physical blocks;
Determine second flat unit different from first flat unit;
The effective physical block for being fully written data is obtained from second flat unit.
7. a kind of data processing equipment, which is characterized in that be applied to storage equipment, described device includes:
Module is obtained, the effective physical block for being fully written data of the solid state hard disk for obtaining storage equipment;
Read module, for reading the first data from the first designated sector of effective physical block;
Determining module, for determining the damage data in first data;
The first state information of effective physical block is determined according to the quantity of the damage data;
Processing module, for when effectively physical block is real abnormal described in the first state information representation, then having to described
It imitates physical block and carries out garbage reclamation.
8. device according to claim 7, which is characterized in that
The read module, when being also used to that effectively physical block is doubtful abnormal described in the first state information representation, then from
The second data are read in second designated sector of effective physical block;
The determining module is also used to determine the damage data in second data, and according to the damage in second data
The quantity of bad data determines the second status information of effective physical block;
The processing module is also used to when second status information characterizes effective physical block be really abnormal or doubtful
When abnormal, then garbage reclamation is carried out to effective physical block.
9. device according to claim 7 or 8, which is characterized in that the determining module is according to the number for damaging data
Amount is specifically used for when determining the first state information of effective physical block:
If the quantity is greater than the first amount threshold, it is determined that effective physical block is real described in the first state information representation
It is abnormal;If the quantity is greater than the second amount threshold, is not more than the first amount threshold, it is determined that the first state information representation
Effective physical block is doubtful exception;Alternatively, if the ratio of the quantity of the quantity and first data of the damage data
Greater than the first proportion threshold value, it is determined that effective physical block is real exception described in the first state information representation;If the ratio
Example is greater than the second proportion threshold value, is not more than the first proportion threshold value, it is determined that effective physics described in the first state information representation
Block is doubtful exception.
10. device according to claim 7, which is characterized in that effective physical block is the physics in use state
Block;The processing module is specifically used for when carrying out garbage reclamation to effective physical block:
The use state of effective physical block is converted into transition state;
Garbage reclamation is carried out to effective physical block after conversion.
11. device according to claim 7, which is characterized in that the solid-state for obtaining module and obtaining the storage equipment
It is specifically used for when the effective physical block for being fully written data of hard disk:
Determine the first flat unit locating for the last effective physical block obtained;Wherein, the solid state hard disk includes multiple flat
Face unit, each flat unit include multiple effective physical blocks;
Determine second flat unit different from first flat unit;
The effective physical block for being fully written data is obtained from second flat unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811105669.1A CN109343796B (en) | 2018-09-21 | 2018-09-21 | Data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811105669.1A CN109343796B (en) | 2018-09-21 | 2018-09-21 | Data processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109343796A true CN109343796A (en) | 2019-02-15 |
CN109343796B CN109343796B (en) | 2022-03-01 |
Family
ID=65306092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811105669.1A Active CN109343796B (en) | 2018-09-21 | 2018-09-21 | Data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109343796B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112051964A (en) * | 2019-06-06 | 2020-12-08 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN112783656A (en) * | 2021-01-29 | 2021-05-11 | 网易(杭州)网络有限公司 | Memory management method, medium, device and computing equipment |
CN113190179A (en) * | 2021-05-26 | 2021-07-30 | 北京自由猫科技有限公司 | Method for prolonging service life of mechanical hard disk, storage device and system |
CN114356211A (en) * | 2021-11-19 | 2022-04-15 | 苏州浪潮智能科技有限公司 | Storage space processing method and device, electronic equipment and storage medium |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080301448A1 (en) * | 2007-06-01 | 2008-12-04 | Microsoft Corporation | Security Against Corruption for Networked Storage |
CN101477492A (en) * | 2009-01-21 | 2009-07-08 | 华中科技大学 | Circulating rewriting flash memory equalization method used for solid state disk |
CN102799535A (en) * | 2012-06-29 | 2012-11-28 | 记忆科技(深圳)有限公司 | Solid-state disk and data processing method thereof |
CN103336744A (en) * | 2013-06-20 | 2013-10-02 | 华中科技大学 | Garbage recovery method for solid-state storage device and system for garbage recovery method |
CN106776095A (en) * | 2016-12-22 | 2017-05-31 | 湖南国科微电子股份有限公司 | SSD solid state hard disc data reliability intelligent detecting methods and detection means |
CN106990926A (en) * | 2017-06-14 | 2017-07-28 | 郑州云海信息技术有限公司 | A kind of processing method of solid state hard disc abrasion equilibrium |
CN107092563A (en) * | 2017-04-20 | 2017-08-25 | 紫光华山信息技术有限公司 | A kind of rubbish recovering method and device |
CN107844432A (en) * | 2017-11-22 | 2018-03-27 | 深圳忆联信息系统有限公司 | A kind of method and solid state hard disc of solid state hard disc dynamic garbage reclamation |
CN108415853A (en) * | 2018-03-15 | 2018-08-17 | 深圳市江波龙电子有限公司 | A kind of method, apparatus and storage device of garbage reclamation |
-
2018
- 2018-09-21 CN CN201811105669.1A patent/CN109343796B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080301448A1 (en) * | 2007-06-01 | 2008-12-04 | Microsoft Corporation | Security Against Corruption for Networked Storage |
CN101477492A (en) * | 2009-01-21 | 2009-07-08 | 华中科技大学 | Circulating rewriting flash memory equalization method used for solid state disk |
CN102799535A (en) * | 2012-06-29 | 2012-11-28 | 记忆科技(深圳)有限公司 | Solid-state disk and data processing method thereof |
CN103336744A (en) * | 2013-06-20 | 2013-10-02 | 华中科技大学 | Garbage recovery method for solid-state storage device and system for garbage recovery method |
CN106776095A (en) * | 2016-12-22 | 2017-05-31 | 湖南国科微电子股份有限公司 | SSD solid state hard disc data reliability intelligent detecting methods and detection means |
CN107092563A (en) * | 2017-04-20 | 2017-08-25 | 紫光华山信息技术有限公司 | A kind of rubbish recovering method and device |
CN106990926A (en) * | 2017-06-14 | 2017-07-28 | 郑州云海信息技术有限公司 | A kind of processing method of solid state hard disc abrasion equilibrium |
CN107844432A (en) * | 2017-11-22 | 2018-03-27 | 深圳忆联信息系统有限公司 | A kind of method and solid state hard disc of solid state hard disc dynamic garbage reclamation |
CN108415853A (en) * | 2018-03-15 | 2018-08-17 | 深圳市江波龙电子有限公司 | A kind of method, apparatus and storage device of garbage reclamation |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112051964A (en) * | 2019-06-06 | 2020-12-08 | 阿里巴巴集团控股有限公司 | Data processing method and device |
CN112783656A (en) * | 2021-01-29 | 2021-05-11 | 网易(杭州)网络有限公司 | Memory management method, medium, device and computing equipment |
CN112783656B (en) * | 2021-01-29 | 2024-04-30 | 杭州网易智企科技有限公司 | Memory management method, medium, device and computing equipment |
CN113190179A (en) * | 2021-05-26 | 2021-07-30 | 北京自由猫科技有限公司 | Method for prolonging service life of mechanical hard disk, storage device and system |
CN114356211A (en) * | 2021-11-19 | 2022-04-15 | 苏州浪潮智能科技有限公司 | Storage space processing method and device, electronic equipment and storage medium |
CN114356211B (en) * | 2021-11-19 | 2023-08-29 | 苏州浪潮智能科技有限公司 | Storage space processing method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109343796B (en) | 2022-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8046526B2 (en) | Wear leveling method and controller using the same | |
US8103820B2 (en) | Wear leveling method and controller using the same | |
US10445005B2 (en) | Memory system and operating method thereof | |
JP4859837B2 (en) | Information recording medium access device and data recording method | |
CN109343796A (en) | A kind of data processing method and device | |
US8484432B2 (en) | Memory system | |
US20140129758A1 (en) | Wear leveling in flash memory devices with trim commands | |
US20120239851A1 (en) | Prioritized erasure of data blocks in a flash storage device | |
US7649794B2 (en) | Wear leveling method and controller using the same | |
CN108897492B (en) | Data writing method and device | |
US20090094409A1 (en) | Wear leveling method and controller using the same | |
EP2665065A2 (en) | Electronic device employing flash memory | |
US20100125694A1 (en) | Memory device and management method of memory device | |
US20100318760A1 (en) | Memory controller, nonvolatile storage device, and nonvolatile storage system | |
CN108874309B (en) | Method and device for managing physical blocks in solid state disk | |
CN112749101A (en) | Controller and memory system | |
CN107179880B (en) | Storage device, control unit thereof and data moving method for storage device | |
CN102096561A (en) | Hierarchical data storage processing method, device and storage equipment | |
TWI556103B (en) | Memory apparatus and data accessing method thereof | |
CN104408126B (en) | A kind of persistence wiring method of database, device and system | |
KR101070511B1 (en) | Solid state drive controller and method for operating of the solid state drive controller | |
KR20180042699A (en) | Data storage device and operating method thereof | |
CN110007861A (en) | A kind of method for reading data and device | |
CN110286848B (en) | Data processing method and device | |
CN111324284B (en) | Memory device |
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 |