Embodiment
For making the object of the invention, technical scheme and advantage clearer; To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention carried out clear, intactly description, obviously; Described embodiment is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, the every other embodiment that those of ordinary skills are obtained under the prerequisite of not making creative work belongs to the scope that the present invention protects.
The online moving method schematic flow sheet of the file that Fig. 1 provides for the embodiment of the invention one.Present embodiment can be realized two online migrations of the file between the NAS equipment, and is as shown in Figure 1, and the online moving method of present embodiment file can may further comprise the steps:
Step 101, share agreement through network file source device is mounted to target device;
Wherein, source device and target device are NAS equipment.
Network file is shared agreement specifically can be Server Message Block (Server Message Block, SMB) agreement, or NFS (Network File System, NFS) agreement.It will be appreciated by persons skilled in the art that in the practical application, can on NAS equipment, be provided with as required and support SMB agreement or NFS agreement, share so that set up network file through this agreement and other equipment.It will be understood by those skilled in the art that source device is mounted to target device after, the file system of target device on just can access originator equipment.
Step 102, at the image file of setting up file on the source device on the target device, this image file is initially empty file;
Step 103, share agreement through network file the data in the file on the source device are migrated in the image file corresponding on the target device through Network Transmission;
Step 104, in data migration process by the access request of target device process user.
In the present embodiment; Source device and target device are NAS equipment; In the time of need be with the file migration on the source device to target device, can share agreement through network file source device is mounted to target device, then by target device at the image file of self setting up file on the source device; And after image file foundation finishes; Through Network Transmission the data in each file on the source device are migrated in the corresponding migrated file of setting up on the target device, and in data migration process, user's access request is handled, need not interrupt customer service by target device.
The online moving method of the file that present embodiment provides; Utilize network file to share agreement source device is mounted to target device; And, target device utilize Network Transmission to carry out the migration of file data after establishing mirror image file; And in the file migration process, user's access request is handled, thereby can be realized the online migration of file, need not interrupt customer service in the file migration process by target device; The online moving method of the file that present embodiment provides does not receive the restriction of file migration equipment self, has higher compatibility, can be fit to the online migration of file between the NAS equipment of various criterion or manufacturer, improves the practicality and the applicability of the online migration of file.
The online moving method schematic flow sheet of the file that Fig. 2 provides for the embodiment of the invention two.The online moving method of present embodiment file can may further comprise the steps:
Step 201, target device are shared agreement carry source device through network file;
Step 202, target device are shared the metadata of agreement file on source device acquisition request source device through network file;
Step 203, target device be according to the metadata of file on the source device that obtains, set up with source device on the corresponding image file of file, each image file initially is empty file;
Step 204, target device notify the keeper that customer service is switched in the image file corresponding on the target device after image file foundation finishes;
Step 205, target device are shared agreement through network file the data in the file on the source device are migrated to target device through Network Transmission;
Step 206, target device are handled user's access request in data migration process;
After the data of each file are all moved on the target device corresponding image file on step 207, the source device, but the verification msg content rolls off the production line source device from target device.
In the above-mentioned steps 201, target device and source device are NAS equipment, and these two NAS equipment can be the equipment that adopts identical standard; Perhaps adopt the equipment of various criterion; Also can be that different vendor makes, and these two NAS equipment all support the identical network file sharing protocol, like this; Target device just can be shared agreement through network file source device is mounted to target device, makes target device to visit the information in the source device through network.
In above-mentioned steps 202 and the step 203, during with source device carry to target device, specifically can pass through Server Message Block (Server Message Block; SMB) agreement, or NFS (Network File System, NFS) agreement is mounted to target device with source device; It will be understood by those skilled in the art that; In the practical application, can on NAS equipment, be provided with as required and support SMB agreement or NFS agreement, share so that set up network file through this agreement and other equipment.Target device with the source device carry after, just can send metadata request information, after source device receives this metadata request information to source device; Just can the metadata of self files stored be returned to target device, wherein, the metadata of file is the attribute information of file; Be the associated description information of file, comprise file size, file modification information and file extent attribute etc., wherein the file extent attribute comprises information such as file access path; Like this, after the metadata of the file on the target device acquisition source device, just can set up and the identical image file of its attribute; Wherein, the image file of foundation is an empty file, it is understandable that; When on the source device a plurality of file being arranged, need to set up a plurality of image files accordingly on the target device again, and these image files are empty file.
In the practical application; Above-mentioned steps 202 and step 203 are in the file process that establishes mirror image; Also can on target device, set up the target monitoring point, with the situation of change of file on the monitor source equipment, and at the synchronous image file corresponding with the file that changes of target device.Because in the process of file that establishes mirror image, the file on the source device might change, and has for example increased data etc. newly; Cause the metadata of file to change; Therefore, through the situation of change of file on the monitor source equipment, can set up in the process at image file; The metadata of the file that source device is changed carries out guaranteeing the unanimity of file attribute synchronously to corresponding image file on the target device.
Particularly, to the monitoring of the situation of change of file on the source device, can realize through the index node monitoring (inotify) of Linux; Wherein, Inotify is a Linux characteristic, can monitor file system operation; For example read, write and establishment etc.; Thereby the variation of file on the monitor source equipment in real time, this monitoring can be arranged on the target device, and shares the variation that agreement is come file on the monitor source equipment through network file.
In the above-mentioned steps 204,, just can notify the manager that customer service is switched to target device, so that user's request is handled by target device when target device establishes mirror image after file finishes.It will be understood by those skilled in the art that customer service is switched to target device, can be through with the domain name of user capture, i.e. the visit domain name of files stored on the source device, the IP address of definite object equipment.In the practical application, can notify domain name system change domain name corresponding IP address automatically by target device or source device yet, be directed to target device with the visit with the user, present embodiment not be done special restriction to this.
In above-mentioned steps 205 and the step 206; After customer service switches to target device; Just can share agreement, the data in each file on the source device are copied on the target device in the corresponding image file, to realize the data migration of image file through network file.In addition; In data migration process; Target device can receive user's access request, user's access request is handled, for example when user's read data; Can corresponding data be read from target device this locality and offer the user, perhaps share offering the user again after agreement is read from source device by target device through network file.
In the above-mentioned steps 207; After the source device data all migrate to target device, just can verify, for example the data on the target device; Can through the mode of manual work checking verify on the target device data whether with target device on data consistent; And after verifying, source device being uninstalled from target device, thereby the online migration of completion file.
In addition; When establishing mirror image file in the above-mentioned steps 203 and 204; Also can not set up the control point file situation of change on the source device is monitored, but before target device has not also been set up image file, user's access request handled but target device notification source equipment suspends.Because it is shorter that image file is set up process time, in this short period, suspend processing to access request, therefore less to the normal influence on system operation of customer service.
The schematic flow sheet that the target device that Fig. 3 provides for the embodiment of the invention three is handled user's access request.On above-mentioned Fig. 1 or technical scheme embodiment illustrated in fig. 2 basis; Set up the image file and access request definite object equipment of file on the source device when target device after with the user; Target device just can process user access request, particularly, as shown in Figure 3; Target device can may further comprise the steps when the read request in user's the access request is handled:
Step 301, target device receive the read request that the user sends;
Step 302, search whether exist on the target device read request the data that will read, be execution in step 303 then, otherwise, execution in step 304;
Step 303, from the image file reading of data of target device, and return to the user, finish.
Step 304, target device are shared agreement through network file and are read the data that read request institute will read from source device, return to the user, end.
In the present embodiment; After customer service switches to target device, target device according to read request to ask the data that read, confirm whether these data have existed in the corresponding image file; Be then directly from local reading of data; Otherwise, can share agreement through network file, reading corresponding data in the corresponding file from source device.
When it will be understood by those skilled in the art that the data of target device on reading source device, can share agreement through network file, read file data from source device according to the access path information in the extended attribute of putting down in writing in the file metadata.
Migrate in the process of target device in data the source device file; Because the data of user's request possibly migrate in the image file of target device, also might also not migrate to target device, therefore; When present embodiment receives the read request of user's transmission; Can judge the data that will ask to read whether be present in target device obtain from source device so that need to determine whether target device to share agreement, to guarantee carrying out smoothly of customer service through network file.
The schematic flow sheet that the target device that Fig. 4 provides for the embodiment of the invention four is handled user's access request.Different with above-mentioned technical scheme embodiment illustrated in fig. 3 is; Present embodiment is on above-mentioned Fig. 1 or technical scheme embodiment illustrated in fig. 2 basis; When read request is handled, if need obtain data from source device, can be on image file with the storage of obtaining; And then return to the user, specifically can may further comprise the steps:
Step 401, target device receive the read request that the user sends;
Step 402, search whether exist on the target device read request the data that will read, be execution in step 403 then, otherwise, execution in step 404;
Step 403, from the image file reading of data of target device, and return to the user, finish.
Step 404, target device through network file share agreement from source device read read request the data that will read;
Step 405, the storage that will read from source device are on target device the corresponding image file;
Step 406, these data are returned to the user, finish.
In the present embodiment; When the user the data that will read not on target device; When needing to pass through the shared agreement of network file, can after the storage that reads from source device is the corresponding image file that target device is set up, again the data that read be returned to the user, like this from the source device reading corresponding data; Can avoid follow-up the repetition to read this data, to save the data transit time from source device; In addition because the data of user capture often are to need to revise or the data of visit, it is stored in target device after, can be convenient to the once more visit of user, to improve the treatment effeciency of user access request to these data.
The schematic flow sheet that the target device that Fig. 5 provides for the embodiment of the invention five is handled user's access request.On the arbitrary illustrated embodiment technical scheme of above-mentioned Fig. 1 to Fig. 4 basis; Also comprised when request write that receives the user when target device; To user's the handling process that request is handled of writing, particularly, as shown in Figure 5; The present embodiment target device is handled the request of writing in user's the access request, can may further comprise the steps:
Step 501, target device receive the request of writing that the user sends;
Whether step 502, the data of searching in the image file of writing the data correspondence that request institute will write at target device move completion, are execution in step 503 then, otherwise execution in step 504;
Step 503, directly will write the data that request institute will write and write in the corresponding image file end;
Step 504, will write the data that request institute will write and write in the temporary file, so that write in the image file again after the data migration completion in corresponding image file.
In the above-mentioned steps 502; When receive that the user sends write request the time; Can confirm at first whether the data in this image file of writing the data correspondence that request institute will write move completion; Wherein, the data with this image file corresponding file on the source device all copy this image file to, explain that then the data migration in the image file is accomplished.
In the present embodiment; When user's the request of writing is handled; Can needs be write the data in the still uncompleted image file of data migration, temporarily write in the temporary file, accomplish up to the data migration of corresponding image file; Perhaps the data of whole source device all migrate to target device, and the data that will write on again in the temporary file write corresponding image file.
The schematic flow sheet that the target device that Fig. 6 provides for the embodiment of the invention six is handled user's access request.On the arbitrary illustrated embodiment technical scheme of above-mentioned Fig. 1 to Fig. 4 basis, also comprised when request write that receives the user when target device, to user's the handling process that request is handled of writing; But what embodiment illustrated in fig. 6 and above-mentioned technical scheme embodiment illustrated in fig. 5 was different is; When present embodiment is handled in the request of writing that the user is sent, accomplish, then can preferentially the data in the corresponding document of source device be copied to image file if the data in the image file of the data that need write correspondence are also moved; After making the data migration completion of this image file; Directly will write again request the data that will write write in this image file, particularly, as shown in Figure 6; When the present embodiment target device is handled the request of writing in user's the access request, can may further comprise the steps:
Step 601, target device receive the request of writing that the user sends;
Whether step 602, the data of searching in the image file of writing the data correspondence that request institute will write at target device move completion, are execution in step 603 then, otherwise execution in step 604;
Step 603, directly will write the data that request institute will write and write in the corresponding image file end;
Step 604, target device are shared agreement through network file the high priority data in the image file corresponding file corresponding with writing request on the source device are migrated to target device;
After step 605, the data migration in writing the corresponding image file corresponding file of request are accomplished, with write request the data that will write directly write in the image file.
In the present embodiment, when the user the data in the corresponding image file of the data that will write do not move when accomplishing, can preferentially carry out the data migration to this image file; Promptly preferentially sharing agreement through network file is copied to the data in the corresponding file on the source device in this image file; Directly write in this image file so that will write the data that request institute will write, like this, can avoid follow-up and still need carry out data and move image file; Save the data transit time; Simultaneously, also can avoid image file migration to accomplish after, the data that also need from temporary file, will temporarily write are again write image file again; In addition because the data of user capture often are to need to revise or the data of visit, it is stored in target device after, can be convenient to the once more visit of user, to improve the treatment effeciency of user access request to these data.
The online moving apparatus structural representation of the file that Fig. 7 provides for the embodiment of the invention seven.The online moving apparatus of present embodiment file is a NAS equipment, can realize the online migration of file, and is as shown in Figure 7 particularly, and this device for carrying out said can comprise carry module 11, mirror image module 12, data transferring module 13 and Service Processing Module 14, wherein:
Carry module 11 is used for sharing agreement through network file source device is mounted to target device;
Mirror image module 12 is used at the image file of setting up file on the source device on the target device, and this image file is initially empty file;
Data transferring module 13 is used for migrating in the image file corresponding on the target device through Network Transmission through the data of the shared agreement of network file with file on the source device;
Service Processing Module 14 is used in the access request of data migration process by the target device process user.
The online moving apparatus of present embodiment file can be integrated on the target device, so that with the online target device that migrates to of the file on the source device, wherein target device and source device are NAS equipment.
Present embodiment can be realized the online migration of file between the NAS equipment, and its concrete realization can be repeated no more at this referring to the explanation of the invention described above method embodiment.
The online moving apparatus structural representation of the file that Fig. 8 provides for the embodiment of the invention eight.On above-mentioned technical scheme embodiment illustrated in fig. 7 basis, as shown in Figure 8, mirror image module 12 specifically can comprise metadata acquiring unit 121 and mirror image unit 122, wherein:
Metadata acquiring unit 121 is used for the metadata through the shared agreement file on source device acquisition request source device of network file;
Mirror image unit 122 is used for the metadata according to file on the source device that obtains, set up with source device on the corresponding image file of file.
In addition, can also comprise in the device that the embodiment of the invention provides:
Monitoring module 123 is used for the situation of change of file on the monitor source equipment, and in target device the image file corresponding synchronously with the file that changes.
Concrete, this monitoring module can be set up in the process at image file, the situation of change of file on the source device is monitored, to guarantee image file and the consistency of the file on the source device on the target device.
The structural representation of Service Processing Module in the online moving apparatus of file that Fig. 9 provides for the embodiment of the invention nine.On above-mentioned Fig. 7 or technical scheme embodiment illustrated in fig. 8 basis; As shown in Figure 9; Service Processing Module 14 comprises in the present embodiment: read request receiving element 141, read request are searched unit 142, the first read request processing unit 143 and second reading requesting processing 144, wherein:
Read request receiving element 141 is used to receive the read request that the user sends;
Read request is searched unit 142, be used to search target device whether exist this read request the data that will read;
The first read request processing unit 143 is used for when there are the data that this read request institute will read in target device, and image file reading of data accordingly from the target device returns to the user;
Second reading requesting processing 144; Be used for target device do not exist this read request to read data the time; Through network file share agreement from source device read this read request the data that will read; Return to the user, or be used for through network file share agreement from source device read read request the data that will read, and return to the user after being stored in the corresponding image file of setting up on the target device.
Present embodiment can be handled the read request that the user sends, and to guarantee user's normal operation, its concrete realization can be repeated no more at this referring to the invention described above method embodiment three or four explanation.
The structural representation of Service Processing Module in the online moving apparatus of file that Figure 10 provides for the embodiment of the invention ten.On above-mentioned Fig. 7, Fig. 8 or technical scheme embodiment illustrated in fig. 9 basis; Shown in figure 10; In the present embodiment Service Processing Module 14 specifically can also comprise write request receiving element 145, the request write is searched unit 146, first and is write requesting processing 147 and second and write requesting processing 148, wherein:
Write request receiving element 145, be used to receive the request of writing that the user sends;
Unit 146 is searched in the request write, and is used for whether moving completion in the data that target device is searched in this image file of writing the data correspondence that request institute will write;
First writes requesting processing 147, is used for when the data migration of writing the corresponding image file of data that request institute will write is accomplished, directly will write ask the data that will write write in the corresponding image file;
Second writes requesting processing 148; Be used for searching these data of writing the corresponding image file of data that request institute will write when not moving completion at target device; With this write request the data that will write write in the temporary file; So that write in the image file again after the data migration in corresponding image file is accomplished; Or after being used for sharing agreement the high priority data of image file corresponding file corresponding with writing request on the source device being migrated to target device through network file, with write ask the data that will write write in the image file.
Present embodiment can be handled the request of writing that the user sends, and its concrete realization can be repeated no more at this referring to the invention described above method embodiment five or six explanation.
The online migration system architecture sketch map of the file that Figure 11 provides for the embodiment of the invention 11.The online migratory system of this enforcement file can comprise target device 10 and source device 20; This target device 10 is NAS equipment with source device 20; Wherein this target device 10 can comprise the online moving apparatus of file that the arbitrary embodiment of above-mentioned Fig. 7 to Figure 10 provides, and can between target device 10 and source device 20, realize the online migration of file.
It will be understood by those skilled in the art that above-mentioned source device 20 also can comprise the online moving apparatus of file that above-mentioned Fig. 7-8 any embodiment provides, and does not do special restriction to this present embodiment.
One of ordinary skill in the art will appreciate that: all or part of step that realizes above-mentioned each method embodiment can be accomplished through the relevant hardware of program command.Aforesaid program can be stored in the computer read/write memory medium.This program the step that comprises above-mentioned each method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
What should explain at last is: above each embodiment is only in order to explaining technical scheme of the present invention, but not to its restriction; Although the present invention has been carried out detailed explanation with reference to aforementioned each embodiment; Those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, perhaps to wherein part or all technical characteristic are equal to replacement; And these are revised or replacement, do not make the scope of the essence disengaging various embodiments of the present invention technical scheme of relevant art scheme.