A kind of data management system of hybrid hard disk
Technical field
The present invention relates to technical field of data storage, particularly a kind of data management system of hybrid hard disk.
Background technology
Disk is present most popular external equipment, and the medium of wherein storing data is a magnetic medium.In disk, data are conducted interviews through the tracking of magnetic head and the rotation of disc.Using the major defect of magnetic medium is the mechanical motion that visit needs magnetic head and disc to data, so the random access performance is relatively poor.Flash memory has that speed of random access is fast, anti-vibration, low power consumption and other advantages.In recent years, along with the increase of flash memory storage capacity and the reduction of price, flash memory has obtained application more and more widely.In a large amount of desktop computers, having equipped with the flash memory is the solid state hard disc of medium.Yet the storage unit of flash memory is ability write data after wiping only, therefore can not carry out the local update operation.In addition, the cell erase number of times of flash memory also is limited.In addition, for the visit of succession, the performance of flash memory is not as disk.In current hybrid hard disk, seldom consider the how reasonable distribution on two media of data.Therefore, how to fully utilize magnetic medium and flash media advantage separately, avoid the inferior position of the two, become important problem.
Summary of the invention
The technical matters that (one) will solve
The technical matters that the present invention will solve is: how a kind of data management system of hybrid hard disk is provided, to give full play to magnetic medium and flash media advantage separately, avoids the inferior position of the two, thereby improve the performance of hybrid hard disk.
(2) technical scheme
For solving the problems of the technologies described above, the present invention provides a kind of data management system of hybrid hard disk, and it comprises: read processing module, write processing module and data migtation module; The said processing module of reading is used to read the data on magnetic medium or the flash media; The said processing module of writing is used for data are write magnetic medium or flash media; Said data migtation module connects the said processing module of reading, be used for reading calling of processing module according to said, with the data migtation on the magnetic medium to flash media.
Preferably, said system also comprises: address conversion module; Said address conversion module connects and saidly reads processing module and write processing module, is used to realize the conversion of the logical address of data to physical address.
Preferably, said address conversion module adopts the B+ tree that logical address is managed to the transitional information of physical address.
Preferably, the leaf node information recorded comprises in the said B+ tree: initial logical page number (LPN), logical page (LPAGE) number, address, and whether preset value time operation recently all is read operation.
Preferably, said address information comprises: data storage is in the zone bit of flash media or magnetic medium; And, if data storage in flash media, said address information also comprises on the flash media corresponding physical page number; If data storage is in magnetic medium, said address information also comprises corresponding physical address on the magnetic medium.
Preferably; Said when reading processing module and reading the data on the magnetic medium; If to the read request of single logical page (LPAGE); And time request all is a read request to the nearest preset value of said logical page (LPAGE), then said read processing module call said data migtation module with the data migtation of said logical page (LPAGE) to flash media.
Preferably, said preset value is 5.
Preferably, the said processing module of writing if carry out the write operation to single logical page (LPAGE), is then write the data of said single logical page (LPAGE) on the flash media; If carry out write operation, then the data of said a plurality of logical page (LPAGE)s write on the magnetic medium to a plurality of logical page (LPAGE)s.
Preferably, said system also comprises: the free block distribution module; Said free block distribution module connects the said processing module of writing, and is used for when writing processing module flash media being carried out write operation, distributing corresponding free block said.
Preferably, said system also comprises: the garbage reclamation module; Said garbage reclamation module connects said free block distribution module, is used on flash media free block when not enough, reclaims busy, with the releasing idling piece.
(3) beneficial effect
The data management system of hybrid hard disk according to the invention; The data storage of single logical page (LPAGE) on flash media, on magnetic medium, and is transferred to the data storage of a plurality of logical page (LPAGE)s on the flash media with the frequent data of visit on the magnetic medium in good time; It is fast to the single page data access speed to have given full play to flash media; The advantage that magnetic medium sequential access performance is strong has been avoided the inferior position of the two, thereby has improved the performance of hybrid hard disk.
Description of drawings
Fig. 1 is the data management system modular structure synoptic diagram of the described hybrid hard disk of the embodiment of the invention.
Embodiment
Below in conjunction with accompanying drawing and embodiment, specific embodiments of the invention describes in further detail.Following examples are used to explain the present invention, but are not used for limiting scope of the present invention.
Fig. 1 is the data management system modular structure synoptic diagram of the described hybrid hard disk of the embodiment of the invention.As shown in Figure 1, said system comprises: read processing module 200, address conversion module 300, write processing module 400, free block distribution module 500, garbage reclamation module 600 and data migtation module 700.
The said processing module 200 of reading connects magnetic medium 100 and flash media 800, is used to read the data on said magnetic medium 100 or the flash media 800.Said address conversion module 300 connects and saidly reads processing module 200 and write processing module 400, is used to realize the conversion of the logical address of data to physical address.The said processing module 400 of writing connects said magnetic medium 100, and connects said flash media 800 through said free block distribution module 500, is used for data are write said magnetic medium 100 or flash media 800.Said free block distribution module 500 is used for when writing the said flash medias 800 of 400 pairs of processing modules and carrying out write operations, distributing corresponding free block (being the idle physical block that the idle Physical Page on the flash media constitutes) said.Said garbage reclamation module 600 connects said free block distribution module 500 and flash media 800, when being used for that free block is not enough on said flash media 800, reclaims busy (being the physical block that flash media includes active page), with the releasing idling piece.Said data migtation module 700 connects said processing module 200 and the flash media 800 read, be used for reading calling of processing module 200 according to said, with the data migtation on the said magnetic medium 100 to said flash media 800.
For the said processing module 200 of reading, when receiving a read request, at first from said address conversion module 300, read the physical address of deposit data.According to physical address, read from said flash media 800 or magnetic medium 100.If read the data on the said magnetic medium 100; And be read request to single logical page (LPAGE); Nearest preset value time request to said logical page (LPAGE) all is a read request simultaneously; Then use said data migtation module 700 to store the data transfer of said logical page (LPAGE) into said flash media 800, and in said address conversion module 300, upgrade said logical page (LPAGE) physical address corresponding.Said preset value is generally 5.Transfer to said flash media 800 through visiting frequent single logical page (LPAGE), can give full play to flash memory for the fast advantage of single page data access speed.
For the said processing module 400 of writing; Write when request when receiving one; If the request write is the write operation to single logical page (LPAGE), then the data of said single logical page (LPAGE) is write said flash media 800, and notify said address conversion module 300 said logical page (LPAGE) physical address corresponding; If said write the request be write operation to a plurality of logical page (LPAGE)s, then the data of said a plurality of logical page (LPAGE)s are write said magnetic medium 100, and notify the physical address of said address conversion module 300 said a plurality of logical page (LPAGE)s.
Particularly; When said when writing processing module 400 data of single logical page (LPAGE) being write said flash media 800; At first call said free block distribution module 500 and on said flash media 800, distribute a free block, and the data of said logical page (LPAGE) are write said free block.If the free block number reaches or is lower than 3 on the current said flash media 800, then call 600 pairs of said flash medias 800 of said garbage reclamation module and put in order, thereby obtain some new free blocks.
600 pairs of said flash medias 800 of said garbage reclamation module carry out finishing processes and comprise: at first call said free block distribution module 500 and on said flash media 800, distribute one first free block; And select minimum first busy of active page; Active page on said first busy is copied on said first free block, and said first busy is wiped; After accomplishing aforesaid operations,, then select minimum second busy of active page again, the active page on said second busy is copied on said first free block if current free block number still reaches or is lower than 3.If in the copy procedure, there are not enough free page on said first free block, then continue to distribute one second free block, be used to deposit the data of needs copy.Repeat said process, the free block number on said flash media 800 is 4.Said process is notified said address conversion module 300 after accomplishing, and revises the mapping relations of corresponding logical address to physical address.
In said address conversion module 300, use the B+ tree that logical address is managed to the information of address conversion of physical address.The leaf node information recorded comprises in the B+ tree: initial logical page number (LPN), logical page (LPAGE) number, address, and whether 5 times nearest operations all are read operations.Wherein, said address information comprises: data be positioned at said flash media 800 or magnetic medium 100 zone bit (such as, this zone bit is that 1 expression data are positioned at said flash media 800, this zone bit is that 0 expression data are positioned at said magnetic medium 100); If be positioned at said flash media 800, then also comprise corresponding physical page number on the said flash media 800, and this moment, the logical page (LPAGE) information of number was fixed as 1; If be positioned at said magnetic medium 100, then also be included in the concrete physical address on the said magnetic medium 100, this moment, the logical page (LPAGE) information of number maybe be greater than 1.When data migtation took place, if the data of other logical page (LPAGE)s of the leaf node that the logical page (LPAGE) that takes place to move belongs to still are positioned at said magnetic medium 100, then said leaf node was split into two leaf nodes, and the B+ tree is adjusted accordingly.When said write operation processing module 400 is write magnetic medium 100 with a plurality of logical page (LPAGE)s; If these logical page (LPAGE)s have a plurality of leaf nodes (being stored on the flash media 100 before being the partial logic page or leaf in these logical page (LPAGE)s) in the B+ tree; Then these leaf nodes are merged into one, the B+ tree is adjusted accordingly.
The data management system of the said hybrid hard disk of the embodiment of the invention; On flash media, on magnetic medium, and in good time that visit on the magnetic medium is frequent data migtation is to flash media with the data storage of a plurality of logical page (LPAGE)s with the data storage of single logical page (LPAGE); It is fast to the single page data access speed to have given full play to flash media; The advantage that magnetic medium sequential access performance is strong has been avoided the inferior position of the two, thereby has improved the performance of hybrid hard disk.
Above embodiment only is used to explain the present invention; And be not limitation of the present invention; The those of ordinary skill in relevant technologies field under the situation that does not break away from the spirit and scope of the present invention, can also be made various variations and modification; Therefore all technical schemes that are equal to also belong to category of the present invention, and scope of patent protection of the present invention should be defined by the claims.