Summary of the invention
The invention provides online file synchronisation method in a kind of multiple terminals and system, can improve the real-time of multiple terminals on-line synchronous, solve the problem that the multiple terminals file synchronization is made mistakes.
The invention provides the online file synchronisation method in a kind of multiple terminals, comprising:
Obtain server file tabulation snapshot, described server file tabulation snapshot comprises last server file list information during with EOS;
The described server file tabulation snapshot and the first terminal document list information are compared, obtain first terminal document tabulation snapshot, described first terminal document tabulation snapshot comprises described first terminal document list update operation;
Obtain second terminal document tabulation snapshot by described server, described second terminal document tabulation snapshot comprises the operation of the second terminal document list update;
According to described first terminal document tabulation snapshot and described second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, treat synchronous file identification and operation according to described, described first terminal and described second terminal and described server carry out file synchronization.
Simultaneously, the present invention goes back embodiment also provides a kind of multiple terminals online file syn chronizing system, comprises at least the first terminal, and with the server and second terminal of described first terminal called;
Described first terminal is used to obtain server file tabulation snapshot, and described server file tabulation snapshot comprises last server file list information during with EOS;
Described first terminal also is used for the described server file tabulation snapshot and the first terminal document list information are compared, and obtains first terminal document tabulation snapshot, and described first terminal document tabulation snapshot comprises described first terminal document list update operation;
Described first terminal also is used for obtaining second terminal document tabulation snapshot by described server, and described second terminal document tabulation snapshot comprises the operation of the second terminal document list update;
Described first terminal, be further used for according to described first terminal document tabulation snapshot and described second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, treat synchronous file identification and operation, carry out file synchronization with described second terminal and described server according to described.
Simultaneously, the embodiment of the invention also provides a kind of server, comprising:
The listed files snapshot module is used for storage server listed files snapshot, and described server file tabulation snapshot comprises last server file list information during with EOS;
Upgrade operational module, be used for according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, after determining to treat synchronous file identification and operation, treat synchronous file identification and operation, carry out file synchronization with described first terminal and described second terminal according to described.
Simultaneously, the embodiment of the invention also provides a kind of terminal equipment, comprising:
Server file tabulation acquisition module is used to obtain server file tabulation snapshot, and described server file tabulation snapshot comprises last server file list information during with EOS;
The local file comparison module is used for described server file tabulation snapshot and local file list information are compared, and obtains first terminal document tabulation snapshot, and described first terminal document tabulation snapshot comprises described first terminal document list update operation;
Far-end file snapshot acquisition module is used for obtaining second terminal document tabulation snapshot by described server, and described second terminal document tabulation snapshot comprises the operation of the second terminal document list update;
The file synchronization module, be used for according to described first terminal document tabulation snapshot and described second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, treat synchronous file identification and operation, carry out file synchronization with described second terminal and described server according to described.
From technique scheme as can be seen, because the embodiment of the invention adopts tabulate snapshot and the first terminal document list information of server file compared, obtain first terminal document tabulation snapshot, first terminal document tabulation snapshot comprises described first terminal document list update operation; Obtain second terminal document tabulation snapshot by server, second terminal document tabulation snapshot comprises the operation of the second terminal document list update; According to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, according to treating synchronous file identification and operation, first terminal and second terminal and described server carry out file synchronization.Therefore, when effectively having avoided first terminal and second terminal simultaneously online, make mistakes, also make the online file synchronization in multiple terminals to carry out in real time, avoided user's wait, the fine user experience that improved because file synchronization appears in local file tabulation difference.
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 only 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 all other embodiment that obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of multiple terminals online file synchronisation method, in the time of can effectively avoiding the multiple terminals simultaneously online, because local file tabulation difference file synchronization occurs and makes mistakes, also make the online file synchronization in multiple terminals to carry out in real time, avoided user's wait, the fine user experience that improved.The embodiment of the invention also provides the online file syn chronizing system in multiple terminals, server and terminal equipment.Below be elaborated respectively.
Please in conjunction with referring to Fig. 1, the online file synchronisation method in embodiment of the invention multiple terminals comprises the steps:
Step 102 is obtained server file tabulation snapshot, and this server file tabulation snapshot comprises last server file list information during with EOS.The listed files snapshot of server can the include file title, the temporal information of document creation and modification, and file identification information, the size of file, and last hyposynchronous temporal information etc.
Particularly, the information of one or more files in the tabulation of server file list information include file.The listed files snapshot is meant the map information of some time listed files.Wherein, listed files snapshot include file list information and file status, file status can be provided with an initial condition, in the later stage comparison procedure, are used for reflecting the renewal operation of file in the listed files, thus the operation of decision back expectation synchronous documents.
Step 104 compares tabulate snapshot and the first terminal document list information of server file, obtains first terminal document tabulation snapshot, and first terminal document tabulation snapshot comprises the operation of the first terminal document list update.
Particularly, the first terminal scanning local file list information, compare with server listed files snapshot, obtain the renewal operation that the local file tabulation has been finished with respect to the server file tabulation, this renewal operation is meant with respect to the renewal operation of server file tabulation snapshot, for example adds, deletion and modification etc.Wherein first terminal document tabulation snapshot can comprise all files list information, also can only comprise the more listed files information of new portion.
Step 106, obtain second terminal document tabulation snapshot by server, second terminal document tabulation snapshot comprises the operation of the second terminal document list update, and this renewals operation is meant with respect to the renewal of server file tabulation snapshot and operates, and for example adds, deletion and modification etc.Wherein second terminal document tabulation snapshot can comprise all files list information, also can only comprise the more listed files information of new portion.
Particularly, first terminal to server sends second terminal document tabulation snapshot request, and server is asked according to this, sends the listed files snapshot request to second terminal.Second terminal to server returns local second terminal document tabulation snapshot.
Step 108 according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determines to treat synchronous file identification and operation, and according to treating synchronous file identification and operation, first terminal and second terminal and server carry out file synchronization.
Particularly, according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, need to determine the listed files of renewal, comprising file identification and file operation.According to these file identifications and operation, file and server on first terminal and second terminal are consistent.For example, have the abc.doc file on first terminal, not exist, and belong to the new file of creating on second terminal, then be synchronized to abc.doc on the server after, be synchronized to again on first terminal.
Preferably, according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, specifically comprise: the operating time of first terminal document tabulation and institute's second terminal document operating time of tabulating relatively, with the operating time later as treating synchronous file identification and operation.Can finely avoid the file conflict like this, improve user's experience, prevent losing of user's update content.
Preferably, according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, specifically comprise: merge first terminal document tabulation snapshot and second terminal document tabulation snapshot, according to the listed files snapshot after merging, determine to treat synchronous file identification and operation.Can so that the listed files snapshot of user after according to a merging determine fast with synchronous file identification and operation, carry out file synchronization fast.
Preferably, according to treating synchronous file identification and operation, first terminal and second terminal and server carry out file synchronization, specifically comprise: if a plurality of same files are arranged, and the early stage file and the file identification of then deletion redundancy.Can improve the disposal ability of system well, reduce redundant garbage files, improve user experience for file.
Preferably, before the early stage file and file identification of deletion redundancy, the early stage file and the file identification of redundancy are backuped on the server, when the early stage file of the redundancy that undeletes when needs and file identification, utilize the version that backups on the server to be synchronized to and treat synchronous terminal equipment.Prevent from synchronous process the file mistake is deleted, cause the user can't find before synchronous file, make that the ray machine function found the own file of deleting when the user can utilize, comprehensively provide file synchronization and backup for the user.
Server file tabulation snapshot comprises terminal and server last time with the EOS information of part tabulation hereinafter, can be stored on the server, and first terminal is obtained this server file tabulation snapshot from server.In addition, whether server file tabulation snapshot can include file sign, file path, document creation time, be catalogue, or file status, and wherein, file identification can be a filename, also can be the alternative document flag information; File status is used for reflecting the renewal operation at the file in the listed files.In addition, server file tabulation snapshot can further include version number, this version number's sign be last during with EOS, the version information for the treatment of listed files under the synchronous directory of terminal and server.
Need to prove, if first terminal is that operation is synchronous for the first time, promptly there is not last synchronizing process, then there is not server file tabulation snapshot on the server, perhaps, even there is server file tabulation snapshot on the server, but read failure, such as losing or damaging, all need file and catalogue under the direct scanning of home synchronous directory of server, rebuild server file tabulation snapshot.
For example, provide the example of a server file tabulation snapshot below:
In this example, server file tabulation snapshot comprises the relevant information of a.txt file under A.txt, B.txt, abc catalogue and the abc catalogue, every whether record comprises file identification, file path, document creation time, is catalogue and file status, wherein, whether is catalogue one row, 0 representation file, 1 represents catalogue; File status is initially set to initial.
By the above embodiment of the invention, when effectively having avoided first terminal and second terminal simultaneously online, make mistakes, also make the online file synchronization in multiple terminals to carry out in real time because file synchronization appears in local file tabulation difference, avoided user's wait, the fine user experience that improved.
Please in conjunction with referring to Fig. 2, the embodiment of the invention, a kind of multiple terminals on-line synchronous system 200 comprises:
Comprise at least the first terminal 202, and with the server 204 and second terminal 206 of first terminal called;
First terminal 202 is used to obtain server 204 listed files snapshots, and server file tabulation snapshot comprises last server file list information during with EOS.First terminal 202 compares tabulate snapshot and the first terminal document list information of server file, obtains first terminal document tabulation snapshot, and this first terminal document tabulation snapshot comprises the operation of the first terminal document list update.First terminal 202 is obtained second terminal document tabulation snapshot by server 204, and second terminal document tabulation snapshot comprises the operation of the second terminal document list update; First terminal 202 further according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determines to treat synchronous file identification and operation, according to treating synchronous file identification and operation, carries out file synchronization with second terminal 206 and server 204.
Particularly, the file synchronization of first terminal 202 and second terminal 206, after can earlier file loading being arrived server 204 based on second terminal 206, download this document by first terminal 202 from server 204 again, to guarantee the consistency of first terminal 202 and second terminal, 206 files.
Please in conjunction with referring to Fig. 3, server 204 further comprises:
Listed files snapshot module 302 is used for storage server listed files snapshot, and server file tabulation snapshot comprises last server file list information during with EOS.
Upgrade operational module 304, be used for after determining to treat synchronous file identification and operating,, carrying out file synchronization with first terminal and second terminal according to treating synchronous file identification and operation according to first terminal document tabulation snapshot and second terminal document tabulation snapshot.
Alternatively, server 204 can also comprise backup module 306, be used for if a plurality of same files are arranged, the early stage file and the file identification of then deletion redundancy, before the early stage file and file identification of deletion redundancy, the early stage file of redundancy is backuped on the server 204, when the early stage file of the redundancy that undeletes when needs and file identification, utilize the version that backups on the server 204 to be synchronized to and treat synchronous terminal equipment.The implication of this same file is that the title of file is identical, and file size is also identical.
Please in conjunction with referring to Fig. 4, a kind of terminal equipment 400 comprises:
Server file tabulation acquisition module 402 is used to obtain server file tabulation snapshot, and server file tabulation snapshot comprises last server file list information during with EOS;
Local file comparison module 404 is used for tabulate snapshot and local file list information of server file compared, and obtains first terminal document tabulation snapshot, and first terminal document tabulation snapshot comprises the operation of the first terminal document list update;
Far-end file snapshot acquisition module 406 is used for obtaining second terminal document tabulation snapshot by server, and second terminal document tabulation snapshot comprises the operation of the second terminal document list update;
File synchronization module 408 is used for determining to treat synchronous file identification and operation according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, according to treating synchronous file identification and operation, carries out file synchronization with second terminal and server.
Alternatively, terminal equipment 400 can also comprise: notification module 410, be used for after file synchronization is finished, and send a notification message to second terminal by server, notification message comprises file identification and the operation that this is subsynchronous.
Please in conjunction with referring to Fig. 5, the online file synchronisation method in the multiple terminals of the embodiment of the invention comprises the steps:
Step 502, first terminal to server sends logging request.
Particularly, first terminal to server sends logging request, and this logging request comprises user ID, and wherein, user ID can be user name or password.This logging request can further include the terminal iidentification of first terminal eventually, and when a plurality of terminals utilized same user name to login simultaneously, server can come distinguishing terminal according to terminal iidentification.
Step 504, server carries out login authentication to the first terminal logging request, and auth response is returned to first terminal in the checking back.
Particularly, after server receives logging request, obtain the user ID in the logging request, by query subscriber database information, the authority of checking user ID, and send the checking result to terminal.Server can also further be verified terminal iidentification, to distinguish different terminals.
Step 506, acquisition request server file tabulation snapshot, this server file tabulation snapshot comprise last server file list information during with EOS.The listed files snapshot of server can the include file title, the temporal information of document creation and modification, and file identification information, the size of file, and last hyposynchronous temporal information etc.
Particularly, the information of one or more files in the tabulation of server file list information include file.The listed files snapshot is meant the map information of some time listed files.Wherein, listed files snapshot include file list information and file status, file status can be provided with an initial condition, in the later stage comparison procedure, are used for reflecting the renewal operation of the many files of listed files, thus the operation of decision back expectation synchronous documents.
Step 508, server returns server file tabulation snapshot to first terminal, and this server file tabulation snapshot comprises last server file list information during with EOS.The listed files snapshot of server can the include file title, the temporal information of document creation and modification, and file identification information, the size of file, and last hyposynchronous temporal information etc.
Particularly, the information of one or more files in the tabulation of server file list information include file.The listed files snapshot is meant the map information of some time listed files.Wherein, listed files snapshot include file list information and file status, file status can be provided with an initial condition, in the later stage comparison procedure, are used for reflecting the renewal operation of the many files of listed files, thus the operation of decision back expectation synchronous documents.
Step 510, the tabulation of the first terminal scanning local file, to scan the relevant information of file (such as file identification, file path, the document creation time, whether be catalogue, or file status etc.) and the information in the server listed files snapshot (such as file identification, file path, the document creation time, whether be catalogue, or file status etc.) compare, judge the situation of change of current file with respect to corresponding informance in the server file tabulation snapshot, and generate the first listed files snapshot, the first listed files snapshot can be the first listed files snapshot that upgrades, and also can be a snapshot that regenerates.
Preferably, with the file status of renewal operation note in the first listed files snapshot of each file, file status becomes the renewal operation by initial initial state at this moment, upgrades operation and comprises this locality interpolation, local deletion or local modification etc.
Step 512, the first terminal to server request, second terminal document tabulation snapshot.
Particularly, first terminal to server is initiated a listed files request of obtaining other online terminals, first terminal can directly be obtained online second terminal document tabulation snapshot to server, also can just initiate a non-directional listed files snapshot request to server, and judge which is arranged by the online terminal under the same number of the account by server, judge online terminal according to log-on message.
Step 514, server sends the listed files snapshot to the second online terminal and obtains request.
Step 516, second terminal to server are returned second terminal document tabulation snapshot.
Step 518, server returns second terminal document tabulation snapshot to first terminal.
Step 520 according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determines to treat synchronous file identification and operation.
Step 522, according to treating synchronous file identification and operation, first terminal and second terminal and server carry out file synchronization.
Particularly, according to first terminal document tabulation snapshot and second terminal document tabulation snapshot, need to determine the listed files of renewal, comprising file identification and file operation.According to these file identifications and operation, file and server on first terminal and second terminal are consistent.For example, have the abc.doc file on first terminal, not exist, and belong to the new file of creating on second terminal, then be synchronized to abc.doc on the server after, be synchronized to again on first terminal.
Need to prove, contents such as the information interaction between said apparatus and intrasystem each unit, implementation since with the inventive method embodiment based on same design, particular content can repeat no more referring to the narration among the inventive method embodiment herein.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, storage medium can comprise: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
Because the embodiment of the invention adopts tabulate snapshot and the first terminal document list information of server file compared, obtain first terminal document tabulation snapshot, first terminal document tabulation snapshot comprises described first terminal document list update operation; Obtain second terminal document tabulation snapshot by server, second terminal document tabulation snapshot comprises the operation of the second terminal document list update; According to first terminal document tabulation snapshot and second terminal document tabulation snapshot, determine to treat synchronous file identification and operation, according to treating synchronous file identification and operation, first terminal and second terminal and described server carry out file synchronization.Therefore, when effectively having avoided first terminal and second terminal simultaneously online, make mistakes, also make the online file synchronization in multiple terminals to carry out in real time, avoided user's wait, the fine user experience that improved because file synchronization appears in local file tabulation difference.
More than the online file synchronisation method in the multiple terminals that the embodiment of the invention provided, system, server and terminal equipment are described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.