Summary of the invention
The embodiment of the invention provides a kind of method and apparatus of data backup, has improved the speed of data backup.
The embodiment of the invention provides a kind of method of data backup, may further comprise the steps:
The backup command of source LBA (Logical Block Addressing) group and purpose LBA (Logical Block Addressing) group is carried in reception;
According to described backup command the data in the LBA (Logical Block Addressing) group of described source are stored in the cache memory of solid state hard disc inside;
Data in the described cache memory are stored in the described purpose LBA (Logical Block Addressing) group, realize the internal data backup of solid state hard disc, the data backup of described realization solid state hard disc inside need not to carry out exchanges data with the buffer memory of main frame.
The embodiment of the invention provides a kind of device of realizing data backup, comprises receiving element, cache memory and processing unit, wherein
Described receiving element is used for receiving and carries the backup command of source LBA (Logical Block Addressing) group and purpose LBA (Logical Block Addressing) group;
Described processing unit, store in the cache memory of solid state hard disc inside for the data of the backup command that receives according to described receiving element with described source LBA (Logical Block Addressing) group, data in the cache memory are stored in the described purpose LBA (Logical Block Addressing) group, realize the internal data backup of solid state hard disc, the data backup of described realization solid state hard disc inside need not to carry out exchanges data with the buffer memory of main frame.
In the embodiments of the invention, utilize the cache memory of solid state hard disc inside to realize that the internal data of solid state hard disc backs up, need not to carry out data interaction with the buffer memory of main frame, improved the speed of data backup.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
The embodiment of the invention provides a kind of method of data backup, as shown in Figure 1, may further comprise the steps:
Step 101 receives and carries the backup command of source LBA (Logical Block Addressing) group and purpose LBA (Logical Block Addressing) group.
Wherein, described backup command can be COPY_BACK order newly-increased in ATA (Advanced Technology Attachment, Advanced Technology Attachment) agreement.
Wherein, can in COPY_BACK order, carry each LBA (Logical Block Addressing) value in the logical address group; Also can in the COPY_BACK order, carry initial logical address value and the data length value of logical address group.
Because need to comprise at least two LBA (Logical Block Address, LBA (Logical Block Addressing)) value in the backup command, and the independent order that main frame issues can only be transmitted a LBA value to solid state hard disc, therefore the transmission of this order can not once be finished.Main frame can resolve into the COPY_BACK order two decomposition orders and issue, the command code of twice transmitting order to lower levels can be the same or different (but command code self-defining), also need simultaneously to have two of expressions to decompose the command id that order belongs to same COPY_BACK order, solid state hard disc can decompose order according to this two of command id identification and belong to same COPY_BACK order.Can set in addition two ordinal numbers that decompose order, source LBA (Logical Block Addressing) group information is carried in the decomposition order that ordinal number is lower, target logic block address group information is carried in the decomposition order that ordinal number is higher, and solid state hard disc can be according to two ordinal number identification source LBA (Logical Block Addressing) group and target logic block address groups of decomposing order.
Table 1 is that a simple COPY_BACK decomposes order.
Table 1.COPY_BACK decomposes order
Wherein, PRE is the ordinal number that COPY_BACK decomposes order;
Wherein, Tag is command id, and two that belong to same COPY_BACK order are decomposed the identical command id of order needs employing;
Wherein, Sector count is for needing the data length of backup;
Wherein, LBA is LBA (Logical Block Addressing);
Wherein, F0 is the COPY_BACK command code.
The COPY_BACK that table 2 and table 3 are based on table 1 definition decomposes two decomposition orders of ordering.
Table 2. article one is decomposed order
Table 3. second decomposes order
Then the COPY_BACK order implication of table 2 and table 3 expression is as follows:
Be 0x0 with initial LBA address, data length is that to backup to initial LBA address be to get in the address of 0xFFFF to the data of 6 SECTOR.
Step 102 stores the data in the LBA (Logical Block Addressing) group of described source in the cache memory of solid state hard disc inside into according to backup command.
Wherein, according to comprising in the described cache memory that data in the LBA (Logical Block Addressing) group of source is stored into solid state hard disc inside of backup command:
Read the data in the LBA (Logical Block Addressing) group of described source;
The data that read are written in the described cache memory.
Step 103 stores the data in the described cache memory in the described purpose LBA (Logical Block Addressing) group into.
Wherein, described data in the cache memory are stored in the described purpose LBA (Logical Block Addressing) group comprises:
Read the data in the described cache memory;
The data that read are written in the described purpose LBA (Logical Block Addressing) group.
In the embodiments of the invention, utilize the cache memory of solid state hard disc inside to realize that the internal data of solid state hard disc backs up, need not to carry out data interaction with the buffer memory of main frame, improved the speed of data backup.
The embodiment of the invention provides a kind of device of realizing data backup, as shown in Figure 2, comprises receiving element 201, cache memory 202 and processing unit 203, wherein,
Receiving element 201 is used for receiving and carries the backup command of source LBA (Logical Block Addressing) group and purpose LBA (Logical Block Addressing) group;
Processing unit 203 stores in the cache memory 202 for the data of the backup command that receives according to receiving element 201 with described source LBA (Logical Block Addressing) group, and the data in the cache memory 202 are stored in the described purpose LBA (Logical Block Addressing) group.
Wherein, described backup command can be COPY_BACK order newly-increased in the ATA agreement.
Wherein, processing unit 203 comprises:
Read subelement 2031, be used for reading the data of described source LBA (Logical Block Addressing) group;
Write subelement 2032, be used for to read the data that subelement 2031 reads and be written to cache memory 202.
Wherein,
Read subelement 2031, also be used for reading the data of cache memory 202;
Write subelement 2032, also be used for to read the data that subelement 2031 reads and write described purpose LBA (Logical Block Addressing) group.
Wherein, the device of described realization data backup can be solid state hard disc.
In the embodiments of the invention, utilize the cache memory of solid state hard disc inside to realize that the internal data of solid state hard disc backs up, need not to carry out data interaction with the buffer memory of main frame, improved the speed of data backup.
Through the above description of the embodiments, those skilled in the art can be well understood to the present invention and can realize by hardware, also can realize by the mode that software adds necessary general hardware platform, based on such understanding, technical scheme of the present invention can embody with the form of software product, it (can be CD-ROM that this software product can be stored in a non-volatile memory medium, USB flash disk, portable hard drive etc.) in, comprise that some instructions are with so that a computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
In a word, the above is preferred embodiment of the present invention only, is not for limiting protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.