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
In SSD hard disks, write-in block and garbage reclamation block are divided into cold and hot region, hard to reduce SSD by its separate management
Disk startup failure probability.
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:
The erasable number of the memory block of thermal region can significantly be higher than cold-zone domain in the prior art, can cause certain memory blocks
Erasable number it is excessive, lead to increasing for number of bad blocks.
Invention content
An embodiment of the present invention provides a kind of data processing method and device of SSD hard disks, solve hot in the prior art
The erasable number of the memory block in region can significantly be higher than cold-zone domain, and the erasable number that can cause certain memory blocks is excessive, causes
The technical issues of increasing of number of bad blocks.
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 method includes:Described in acquisition
Full region has been write in SSD hard disks;In the block of the block and PE minimums for having write acquisition PE maximums in full region;By institute
The data in the block for stating data and PE minimums in the block of PE maximums are interchangeable.
Preferably, the data in the block of data in the block of PE maximums and PE minimums are interchangeable, the side
Method further includes:Judge the first difference between the block of the PE maximums and the block of PE minimums;When first difference is less than
During the first predetermined threshold, stop data interchange.
Preferably, the method further includes:It is second poor between the block of the PE maximums and the block of PE minimums to judge
Value;When second difference is more than the second predetermined threshold, continue data interchange.
Preferably, before having write full region in the acquisition SSD hard disks, the method further includes:Judge
Whether the system is idle;When the system free time, obtain in the SSD hard disks and write full region.
Preferably, described obtain has been write in the SSD hard disks in full region, and the region is write-in block and/or GC
Block.
Second aspect, the present invention provides a kind of data processing equipment of SSD hard disks, described device includes:
First obtains unit, the first obtains unit have write full region for obtaining in the SSD hard disks;
Second obtaining unit, second obtaining unit are used in the block for having write acquisition PE maximums in full region
With the block of PE minimums;
First exchange unit, first exchange unit are used for data in the block of PE maximums and the PE are minimum
Data in the block are interchangeable.
Preferably, described device further includes:
First judging unit, first judging unit be used for judge the PE maximums block and PE minimums block it
Between the first difference;
Second exchange unit, second exchange unit are used to, when first difference is less than the first predetermined threshold, stop
Only data interchange.
Preferably, described device further includes:
Second judgment unit, the second judgment unit be used for judge PE maximum block and PE minimums block it
Between the second difference;
Third exchange unit, the third exchange unit are used for when second difference is more than the second predetermined threshold, after
Continuous data interchange.
Preferably, described device further includes:
Third judging unit, the third judging unit are used to judge whether the system is idle;
Third obtaining unit, the third obtaining unit are used for when the system free time, obtain in the SSD hard disks
Through writing full region.
Preferably, described device further includes, and described obtain has been write in the SSD hard disks in full region, the region
For write-in block and/or GC blocks.
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:It obtains in the SSD hard disks and has write full region;In the block for having write acquisition PE maximums in full region and PE most
Small block;The data in the block of data in the block of PE maximums and PE minimums are interchangeable.
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 obtaining the SSD hard disks
In write full region;In the block of the block and PE minimums for having write acquisition PE maximums in full region;By the PE most
The data in the block of data and PE minimums are interchangeable in big block.Solves the memory block of thermal region in the prior art
Erasable number can significantly be higher than cold-zone domain, and the erasable number that can cause certain memory blocks is excessive, leads to increasing for number of bad blocks
The technical issues of.Reach cold and hot piece of data exchange of balanced cold and hot piece of erasable number, reduce the technique effect of bad number of blocks.
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 solving in the prior art
The erasable number of the memory block of thermal region can significantly be higher than cold-zone domain, and the erasable number that can cause certain memory blocks is excessive, leads
Cause the technical issues of increasing of number of bad blocks.Technical solution general thought provided by the invention is as follows:
In the technical solution of the embodiment of the present invention, a kind of data processing side of SSD hard disks provided by the embodiments of the present application
Method and device have write full region by obtaining in the SSD hard disks;In the acquisition PE maximums in having write full region
Block and PE minimums block;The data in the block of data in the block of PE maximums and PE minimums are interchangeable.Reach
Cold and hot piece of data exchange of balanced cold and hot piece of erasable number reduces the technique effect of bad number of blocks.
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 (Solid State
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.GC:Garbage reclamation mechanism Garbage collection (English writes a Chinese character in simplified form GC):When the memory headroom that needs distribute
When not using, JVM recycles memory headroom by garbage reclamation mechanism is called.
3.PE:The erasable number of hard disk.
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:It obtains in the SSD hard disks and has write full region;Described obtain has been write completely in the SSD hard disks
Region in, the region be write-in block and/or GC blocks.
Further, before having write full region in the acquisition SSD hard disks, the method further includes:Sentence
Whether the system of breaking is idle;When the system free time, obtain in the SSD hard disks and write full region.
Specifically, it is preferred, judge whether the system is in idle condition, i.e., whether be carrying out other tasks, such as
System described in fruit is not carried out other tasks, is in idle condition, and obtains in the SSD hard disks and has write full region.It is described
Write in SSD hard disks full region can be write-in memory block and garbage reclamation memory block or write-in memory block or
Person's garbage reclamation memory block, the application do not do this any restrictions.
Step 120:In the block of the block and PE minimums for having write acquisition PE maximums in full region;
Step 130:The data in the block of data in the block of PE maximums and PE minimums are interchangeable.
Further, judge the first difference between the block of the PE maximums and the block of PE minimums;When described first
When difference is less than the first predetermined threshold, stop data interchange;Judge between the block of the PE maximums and the block of PE minimums
Second difference;When second difference is more than the second predetermined threshold, continue data interchange.
Specifically, it can significantly be higher than cold-zone to solve the erasable number of the memory block of thermal region in the prior art
Domain, the erasable number that can cause certain memory blocks is excessive, leads to the technical issues of increasing of number of bad blocks.The embodiment of the present application will
The data stored in the data stored in the most memory block of erasable number the memory block minimum with the erasable number are handed over
It changes, wherein setting the first predetermined threshold, the setting of first predetermined threshold can be according to parameters such as the performances of the SSD hard disks
Rational setting is carried out, the application is not intended to be limited in any this.Second predetermined threshold is also such.First difference
The difference of the erasable number of the memory block most for the erasable number and the minimum memory block of the erasable number;If described
One difference is less than first predetermined threshold, then does not need to carry out data interchange, that is, stop data interchange;If described erasable time
The difference of the erasable number of the minimum memory block of number most memory blocks and the erasable number is more than second predetermined threshold, i.e.,
When second difference is more than the second predetermined threshold, continue data interchange.So as to reach balanced cold and hot piece of erasable number
Cold and hot piece of data exchange reduces the technique effect of bad number of blocks.
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 obtains unit 11, the first obtains unit 11 have write full region for obtaining in the SSD hard disks;
Second obtaining unit 12, second obtaining unit 12 are used in the acquisition PE maximums in having write full region
Block and PE minimums block;
First exchange unit 13, first exchange unit 13 are used for data in the block of the PE maximum and the PE most
Small data in the block are interchangeable.
Further, described device further includes:
First judging unit, first judging unit be used for judge the PE maximums block and PE minimums block it
Between the first difference;
Second exchange unit, second exchange unit are used to, when first difference is less than the first predetermined threshold, stop
Only data interchange.
Further, described device further includes:
Second judgment unit, the second judgment unit be used for judge PE maximum block and PE minimums block it
Between the second difference;
Third exchange unit, the third exchange unit are used for when second difference is more than the second predetermined threshold, after
Continuous data interchange.
Further, described device further includes:
Third judging unit, the third judging unit are used to judge whether the system is idle;
Third obtaining unit, the third obtaining unit are used for when the system free time, obtain in the SSD hard disks
Through writing full region.
Further, described device further includes, and described obtain has been write in the SSD hard disks in full region, the area
Domain is write-in block and/or GC blocks.
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 obtaining the SSD hard disks
In write full region;In the block of the block and PE minimums for having write acquisition PE maximums in full region;By the PE most
The data in the block of data and PE minimums are interchangeable in big block.Solves the memory block of thermal region in the prior art
Erasable number can significantly be higher than cold-zone domain, and the erasable number that can cause certain memory blocks is excessive, leads to increasing for number of bad blocks
The technical issues of.Reach cold and hot piece of data exchange of balanced cold and hot piece of erasable number, reduce the technique effect of bad number of blocks.
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.