A kind of data processing method and device of SSD hard disks
Technical field
The present invention relates to technical field of information processing more particularly to a kind of data processing method and device of SSD hard disks.
Background technology
Most efficient garbage reclamation mechanism in the prior art is all desirable to choose depositing comprising effective minimum data every time
Block is stored up, so as to improve the efficiency of garbage reclamation.
But present inventor has found that the above-mentioned prior art at least exists such as during technical solution of the present invention is realized
Lower technical problem:
Cold and hot data write not subregion in the prior art, lead to the inefficient of garbage reclamation, cold data also can be with rubbish
Rubbish recycling is shifted from one place to another, and is not only reduced read-write efficiency, can also be reduced the service life of disk.
Invention content
An embodiment of the present invention provides a kind of data processing method and device of SSD hard disks, solve cold in the prior art
Dsc data writes not subregion, leads to the inefficient of garbage reclamation, not only reduces read-write efficiency, can also reduce the service life of disk
Technical problem.
In view of the above problems, it is proposed that the embodiment of the present application is in order to provide a kind of data processing method and dress of SSD hard disks
It puts.
In a first aspect, the present invention provides a kind of data processing method of SSD hard disks, the data include cold data and heat
Data, the method includes:Cold data caching storage area and dsc data caching storage area are divided into buffer zone;By institute
It states and dsc data region, cold data region, dsc data garbage reclamation region, cold data garbage reclamation area is divided into user regions
Domain;When data are cold data, cold data caching storage area is placed the data in;When cold data caching storage area
When data are fill-status, cold data region is write data into;When needing to carry out garbage collection operation, from all user regions
The middle block for choosing valid data quantity minimum;It, will be described effective when the block of the valid data quantity minimum is hot data block
The dsc data garbage reclamation region is written in the block of data bulk minimum.
Preferably, the method further includes:When the block of the valid data quantity minimum is cold data block, have described
The cold data garbage reclamation region is written in the block for imitating data bulk minimum.
Preferably, the method further includes:When data are dsc data, dsc data caching storage area is placed the data in
Domain.
Preferably, the method further includes:When the data of dsc data caching storage area are fill-status, by number
According to write-in dsc data region.
Second aspect, the present invention provides a kind of data processing equipment of SSD hard disks, described device includes:
First zoning unit, first zoning unit be used for by buffer zone divide into cold data caching storage area and
Dsc data caches storage area;Dsc data region, cold data region, dsc data garbage reclamation will be divided into the user regions
Region, cold data garbage reclamation region;
First storage unit, first storage unit are used to, when data are cold data, place the data in cold data
Cache storage area;
First writing unit, first writing unit are used for the data when cold data caching storage area to be filled with
During state, cold data region is write data into;
First selection unit, first selection unit are used for when needing to carry out garbage collection operation, from all user
The block of valid data quantity minimum is chosen in region;
Second writing unit, it is hot data block that second writing unit, which is used for when the block of the valid data quantity minimum,
When, the dsc data garbage reclamation region is written into the block of the valid data quantity minimum.
Preferably, described device further includes:
Third writing unit, it is cold data block that the third writing unit, which is used for when the block of the valid data quantity minimum,
When, the cold data garbage reclamation region is written into the block of the valid data quantity minimum.
Preferably, described device further includes:
Second storage unit, second storage unit are used to, when data are dsc data, place the data in dsc data
Cache storage area.
Preferably, described device further includes:
4th writing unit, the 4th writing unit are used for the data when dsc data caching storage area to be filled with
During state, dsc data region is write data into.
The third aspect, the present invention provides a kind of data processing equipments of SSD hard disks, including memory, processor and deposit
The computer program that can be run on a memory and on a processor is stored up, the processor realizes following walk when performing described program
Suddenly:Cold data caching storage area and dsc data caching storage area are divided into buffer zone;By area in the user regions
It is divided into dsc data region, cold data region, dsc data garbage reclamation region, cold data garbage reclamation region;When data are cold number
According to when, place the data in cold data caching storage area;When the data of cold data caching storage area are fill-status
When, write data into cold data region;When needing to carry out garbage collection operation, valid data are chosen from all user regions
The block of quantity minimum;When the block of the valid data quantity minimum is hot data block, the valid data quantity is minimum
The dsc data garbage reclamation region is written in block.
Said one or multiple technical solutions in the embodiment of the present application at least have following one or more technology effects
Fruit:
The data processing method and device of a kind of SSD hard disks provided by the embodiments of the present application, by the way that buffer zone is distinguished
Storage area is cached for cold data and dsc data caches storage area;Dsc data region, cold will be divided into the user regions
Data area, dsc data garbage reclamation region, cold data garbage reclamation region;When data are cold data, place the data in
Cold data caches storage area;When the data of cold data caching storage area are fill-status, cold number is write data into
According to region;When needing to carry out garbage collection operation, the block of valid data quantity minimum is chosen from all user regions;Work as institute
When the block for stating valid data quantity minimum is hot data block, the dsc data rubbish is written into the block of the valid data quantity minimum
Rubbish recovery zone.Solve cold and hot data in the prior art writes not subregion, leads to the inefficient of garbage reclamation, not only reduces
Read-write efficiency, the technical issues of also reducing the service life of disk.Reach raising garbage reclamation efficiency, while reduce SSD hard disks
Erasable number technique effect.
Above description is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, below the special specific embodiment for lifting the present invention.
Description of the drawings
Fig. 1 is a kind of flow diagram of the data processing method of SSD hard disks in the embodiment of the present invention;
Fig. 2 is a kind of structure diagram of the data processing equipment of SSD hard disks in the embodiment of the present invention;
Fig. 3 is the structure diagram of the data processing equipment of another kind SSD hard disks in the embodiment of the present invention
Specific embodiment
An embodiment of the present invention provides a kind of data processing method and device of SSD hard disks, for cold and hot in the prior art
Data write not subregion, lead to the inefficient of garbage reclamation, not only reduce read-write efficiency, can also reduce the skill in the service life of disk
Art problem.Technical solution general thought provided by the invention is as follows:
In the technical solution of the embodiment of the present invention, cold data caching storage area and dsc data are divided into buffer zone
Cache storage area;To be divided into the user regions dsc data region, cold data region, dsc data garbage reclamation region,
Cold data garbage reclamation region;When data are cold data, cold data caching storage area is placed the data in;When the cold number
When data according to caching storage area are fill-status, cold data region is write data into;When need carry out garbage collection operation
When, the block of selection valid data quantity minimum from all user regions;When the block of the valid data quantity minimum is hot number
During according to block, the dsc data garbage reclamation region is written into the block of the valid data quantity minimum.Reach raising rubbish to return
It produces effects rate, while reduces the technique effect of the erasable number of SSD hard disks.
Technical solution of the present invention is described in detail below by attached drawing and specific embodiment, it should be understood that the application
Specific features in embodiment and embodiment are to the detailed description of technical scheme rather than to present techniques
The restriction of scheme, in the absence of conflict, the technical characteristic in the embodiment of the present application and embodiment can be combined with each other.
The terms "and/or", only a kind of incidence relation for describing affiliated partner, expression may have three kinds of passes
System, for example, A and/or B, can represent:Individualism A exists simultaneously A and B, these three situations of individualism B.In addition, herein
Middle character "/", it is a kind of relationship of "or" to typically represent forward-backward correlation object.
The application is illustrated in order to clearer, the professional term involved by the application is explained below:
1.SSD hard disks:Solid state disk (Solid State Drives) referred to as consolidates disk, solid state disk (SolidState
Drive) the manufactured hard disk with solid-state electronic storage chip array, by control unit and storage unit (FLASH chip, DRAM
Chip) composition.Solid state disk is identical with common hard disc in the specification and definition, function and application method of interface,
It is also completely consistent with common hard disc in product design and size.It is widely used in military, vehicle-mounted, industry control, video monitoring, network
The fields such as monitoring, the network terminal, electric power, medical treatment, aviation, navigation equipment.
2.user regions:User area.
Embodiment one
The embodiment of the present application provides a kind of data processing method of SSD hard disks, and Fig. 1 is a kind of in the embodiment of the present invention
The flow diagram of the data processing method of SSD hard disks.As shown in Figure 1, the data include cold data and dsc data, method is stated
Including:
Step 110:Cold data caching storage area and dsc data caching storage area are divided into buffer zone;By described in
Dsc data region, cold data region, dsc data garbage reclamation region, cold data garbage reclamation region are divided into user regions;
Step 120:When data are cold data, cold data caching storage area is placed the data in;
Step 130:When the data of cold data caching storage area are fill-status, cold data area is write data into
Domain;
Step 140:When needing to carry out garbage collection operation, it is minimum that valid data quantity is chosen from all user regions
Block;
Step 150:When the block of the valid data quantity minimum is hot data block, by valid data quantity minimum
Block the dsc data garbage reclamation region is written.
Further, the method further includes:When the block of the valid data quantity minimum is cold data block, by described in
The cold data garbage reclamation region is written in the block of valid data quantity minimum.
Further, the method further includes:When data are dsc data, dsc data caching storage area is placed the data in
Domain;When the data of dsc data caching storage area are fill-status, dsc data region is write data into.
Specifically, according to the rule pre-established, cold and hot subregion is carried out to the data of buffer zone, wherein, access frequency
Numerous data are considered dsc data, conversely, it is considered as cold data to access data infrequently.The data quilt of write-in for the first time
It is considered cold data;Correspondingly, caching storage area is also classified into the caching storage area of storage cold data and stores dsc data
Cache storage area;Cold data is written into cold data caching storage area, and dsc data is written into dsc data caching storage area;
The USER of SSD hard disks divides into 4 regions, is dsc data region respectively, cold data region, and dsc data garbage reclamation region is cold
Data garbage recovery zone;When data are judged as cold data, cold data caching storage area is first temporarily stored into, when caching storage area
When domain is full, data write-in cold data region similarly, when data are judged as dsc data, is first temporarily stored into dsc data caching storage area
Domain, when caching storage area completely, data write-in dsc data region;When needing to start garbage reclamation, from all user areas
The block of valid data quantity minimum is chosen in block (with the operation of system, block of the maximum probability for dsc data, because dsc data does not stop
Coating overwrite), if what is chosen is hot data block, then the data moved write-in dsc data garbage reclamation region, similarly
, if what is chosen is cold data block, then the data write-in cold data garbage reclamation region moved;Cold and hot data may
It changes, for example, for example was cold data originally, but certain is frequently write into a period of time, then this period section
It is interior according to rule, cold data can become dsc data;Originally it was dsc data, but a very long time is not written again, that
Cold data can be become again according to rule;It is write because covering can frequently occur for dsc data area, is selecting the sacrificial of garbage reclamation
During domestic animal block, can maximum probability choose such block, since the valid data that such block includes are seldom, raising rubbish that can be very big
The efficiency of recycling generates seldom not even generation of moving and moves direct erasing;To the block where cold data, due to seldom covering
It writes, this partial block will not be written by erasing repeatedly, the erasable number of a very little can be maintained, so as to reduce whole system
Erasable number, it is only necessary to ensure the erasable balanced of each block with algorithm.Solve writing for cold and hot data in the prior art
The technical issues of not subregion leads to the inefficient of garbage reclamation, not only reduces read-write efficiency, can also reduce the service life of disk.
Reach raising garbage reclamation efficiency, while reduce the technique effect of the erasable number of SSD hard disks.
Embodiment 2
Based on the same inventive concept of data processing method with SSD hard disks a kind of in previous embodiment, the present invention also carries
For a kind of data processing equipment of SSD hard disks, as shown in Fig. 2, including:
First zoning unit 11, first zoning unit 11 are used to buffer zone dividing into cold data caching storage area
Domain and dsc data caching storage area;Dsc data region, cold data region, dsc data rubbish will be divided into the user regions
Recovery zone, cold data garbage reclamation region;
First storage unit 12, first storage unit 12 are used to, when data are cold data, place the data in cold
Data buffer storage storage area;
First writing unit 13, the data that first writing unit 13 is used to work as cold data caching storage area are
During fill-status, cold data region is write data into;
First selection unit 14, first selection unit 14 are used for when needing to carry out garbage collection operation, from all
The block of valid data quantity minimum is chosen in user regions;
Second writing unit 15, it is hot number that second writing unit 15, which is used for when the block of the valid data quantity minimum,
During according to block, the dsc data garbage reclamation region is written into the block of the valid data quantity minimum.
Further, described device further includes:
Third writing unit, it is cold data block that the third writing unit, which is used for when the block of the valid data quantity minimum,
When, the cold data garbage reclamation region is written into the block of the valid data quantity minimum.
Further, described device further includes:
Second storage unit, second storage unit are used to, when data are dsc data, place the data in dsc data
Cache storage area.
Further, described device further includes:
4th writing unit, the 4th writing unit are used for the data when dsc data caching storage area to be filled with
During state, dsc data region is write data into.
The various change mode and specific example of a kind of data processing method of SSD hard disks in 1 embodiment 1 of earlier figures are same
Sample is suitable for a kind of data processing equipment of SSD hard disks of the present embodiment, by aforementioned to a kind of data processing side of SSD hard disks
The detailed description of method, those skilled in the art are clear that a kind of data processing equipment of SSD hard disks in the present embodiment
Implementation, so in order to illustrate the succinct of book, this will not be detailed here.
Embodiment 3
Based on the same inventive concept of data processing method with SSD hard disks a kind of in previous embodiment, the present invention also carries
For a kind of data processing equipment of SSD hard disks, computer program is stored thereon with, is realized above when which is executed by processor
A kind of the step of either method of the data processing method of SSD hard disks.
Wherein, in figure 3, bus architecture (being represented with bus 300), bus 300 can include any number of interconnection
Bus and bridge, bus 300 deposited what the one or more processors including being represented by processor 302 and memory 304 represented
The various circuits of reservoir link together.Bus 300 can also will peripheral equipment, voltage-stablizer and management circuit etc. it
Various other circuits of class link together, and these are all it is known in the art, and therefore, no longer it is carried out further herein
Description.Bus interface 306 provides interface between bus 300 and receiver 301 and transmitter 303.Receiver 301 and transmitter
303 can be same element, i.e. transceiver, provide the unit for communicating over a transmission medium with various other devices.
Processor 302 is responsible for bus 300 and common processing, and memory 304 can be used to store processor
302 perform operate when used data.
Said one or multiple technical solutions in the embodiment of the present application at least have following one or more technology effects
Fruit:
The data processing method and device of a kind of SSD hard disks provided by the embodiments of the present application, by the way that buffer zone is distinguished
Storage area is cached for cold data and dsc data caches storage area;Dsc data region, cold will be divided into the user regions
Data area, dsc data garbage reclamation region, cold data garbage reclamation region;When data are cold data, place the data in
Cold data caches storage area;When the data of cold data caching storage area are fill-status, cold number is write data into
According to region;When needing to carry out garbage collection operation, the block of valid data quantity minimum is chosen from all user regions;Work as institute
When the block for stating valid data quantity minimum is hot data block, the dsc data rubbish is written into the block of the valid data quantity minimum
Rubbish recovery zone.Solve cold and hot data in the prior art writes not subregion, leads to the inefficient of garbage reclamation, not only reduces
Read-write efficiency, the technical issues of also reducing the service life of disk.Reach raising garbage reclamation efficiency, while reduce SSD hard disks
Erasable number technique effect.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the present invention
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the present invention
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.