Summary of the invention
Purpose of the present invention is intended to solve at least one of described technological deficiency.
For this reason, one object of the present invention is to propose a kind of method of data synchronization, this method has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, and have agility, real-time, high efficiency and applicability.Second purpose of the present invention is to propose a kind of data synchronization unit.The 3rd purpose of the present invention is to propose a kind of data synchronous system.
To achieve these goals, the embodiment of first aspect present invention provides a kind of method of data synchronization, may further comprise the steps: obtaining will be by the first synchronous data; Based on data number and data characteristics information, judge one of in described first data and second data, whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in another of described first data and second data; And when in judging described first data and second data, having described different data message, the different pieces of information information of judging is sent to server, the corresponding data of storing in the described server is carried out three data of acquisition after preamble is handled of more newly arriving synchronously, wherein, the data structure of the data message in described first data and the 3rd data comprises data number at least, data content and data characteristics information, and described second data are based on that the 3rd data that obtain after data synchronization processing last time generate, and the data structure of the data message in described second data comprises data number and data characteristics information at least.
In one embodiment of the invention, described data characteristics information one of is based in data content, timestamp information and the data length information of this data-message at least the unique identification information of determining.
In one embodiment of the invention, the corresponding data of storing in the described server the 3rd data that obtain when after the preamble processing of carrying out more newly arriving are synchronously comprised: when the different pieces of information information of judging does not exist in second data from first data and the data number that has, this data message is increased in the corresponding data of storing in the described server.
In one embodiment of the invention, the corresponding data of storing in the described server the 3rd data that obtain after the preamble processing of carrying out more newly arriving are synchronously comprised: in the different pieces of information information of judging from first data, and when in second data, having identical but the data message that data characteristics information is different of the data number that has, the data message that utilizes this different data message to replace to have the identical data numbering in the corresponding data of storing in the described server.
In one embodiment of the invention, the corresponding data of storing in the described server the 3rd data that obtain after preamble is handled of carrying out more newly arriving are synchronously comprised: when the different pieces of information information of judging did not exist in first data from second data and the data number that has, deletion had the data message that identical data is numbered in the corresponding data of storing from described server.
In one embodiment of the invention, described method of data synchronization also comprises three data sync first data of process after preamble is handled that utilization is returned from server; And generate described second data based on the 3rd data of returning.
According to the method for data synchronization of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This method has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, has agility, real-time, high efficiency and applicability.
The embodiment of second aspect present invention proposes a kind of data synchronization unit, comprising: acquiring unit, and being used for obtaining will be by the first synchronous data; Judging unit, be used for based on data number and data characteristics information, judge one of in described first data and second data, whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in another of described first data and second data; Transmitting element, be used for when judging described first data and second data and have described different data message, the different pieces of information information of judging is sent to server, obtain the 3rd data after preamble is handled the corresponding data of storing in the described server is carried out more newly arrive synchronously; And generation unit, be used for generating second data based on the 3rd data that obtained after the data synchronization processing last time, wherein, the data structure of the data message in described first data and the 3rd data comprises data number, data content and data characteristics information at least, and described second data are based on that the 3rd data that obtain after data synchronization processing last time generate, and the data structure of the data message in described second data comprises data number and data characteristics information at least.
In one embodiment of the invention, described data synchronous system also comprises: the data characteristics information generating unit is used for generating one of at least described data characteristics information based on data content, timestamp information and the data length information of this data-message.
In one embodiment of the invention, described data synchronous system also comprises: lock unit is used for utilizing three data sync first data of process after preamble is handled of returning from server.
According to the data synchronization unit of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This device solves sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that need to participate in data in synchronization, have agility, real-time, high efficiency and applicability.
The embodiment of third aspect present invention proposes a kind of data synchronous system, comprising: comprise the portable terminal of described data synchronization unit; And be used for utilizing the different pieces of information information that receives, the corresponding data of storing in the described server is carried out synchronous more newly arriving obtain the server of the 3rd data after preamble is handled.
According to the data synchronous system of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This system has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, has agility, real-time, high efficiency and applicability.
The aspect that the present invention adds and advantage part in the following description provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Embodiment
Describe embodiments of the invention below in detail, the example of described embodiment is shown in the drawings, and wherein identical or similar label is represented identical or similar elements or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, be intended to for explaining the present invention, and can not be interpreted as limitation of the present invention.
In the present invention, unless clear and definite regulation and restriction are arranged in addition, broad understanding should be done in terms such as term " installation ", " linking to each other ", " connection ", " fixing ", for example, can be fixedly connected, also can be to removably connect, or connect integratedly; Can be mechanical connection, also can be to be electrically connected; Can be directly to link to each other, also can link to each other indirectly by intermediary, can be the connection of two element internals.For the ordinary skill in the art, can understand above-mentioned term concrete implication in the present invention as the case may be.
In addition, term " first ", " second " only are used for describing purpose, and can not be interpreted as indication or hint relative importance or the implicit quantity that indicates indicated technical characterictic.Thus, one or more these features can be expressed or impliedly be comprised to the feature that is limited with " first ", " second ".In description of the invention, the implication of " a plurality of " is two or more, unless clear and definite concrete restriction is arranged in addition.
As shown in Figure 1, the flow chart of the method for data synchronization of the embodiment of the invention comprises the steps:
Step S101 is that obtain will be by the first synchronous data;
Step S102 is based on data number and data characteristics information, judges one of whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in another of first data and second data in first data and second data.
Step S103 sends to server with the different pieces of information information of judging when having different data messages in judging first data and second data.
Step S104 obtains the 3rd data after preamble is handled for the corresponding data of storing in the server being carried out more newly arrive synchronously.
In one embodiment of the invention, the data structure of the data message in first data and the 3rd data comprises data number, data content and data characteristics information at least, and second data be based on that the 3rd data that obtain after data synchronization processing last time generate, the data structure of the data message in second data comprises data number and data characteristics information at least.
In one embodiment of the invention, data characteristics information one of is based in data content, timestamp information and the data length information of this data-message at least the unique identification information of determining.Thus, uniqueness and the accuracy of data characteristics information have been improved.
In one embodiment of the invention, the corresponding data of storing in the server being carried out synchronous the 3rd data that obtain after preamble is handled of more newly arriving comprises:
When the different pieces of information information of judging does not exist in second data from first data and the data number that has, this data message is increased in the corresponding data of storing in the server.
In one embodiment of the invention, the corresponding data of storing in the server being carried out synchronous the 3rd data that obtain after preamble is handled of more newly arriving comprises:
In the different pieces of information information of judging from first data, and when in second data, having identical but the data message that data characteristics information is different of the data number that has, utilize this different data message to replace the data message that has the identical data numbering in the corresponding data of storing in server.
In one embodiment of the invention, the corresponding data of storing in the server being carried out synchronous the 3rd data that obtain after preamble is handled of more newly arriving comprises:
When the different pieces of information information of judging did not exist in first data from second data and the data number that has, deletion had the data message of identical data numbering in the corresponding data of storing from server.
In one embodiment of the invention, utilize three data sync first data of process after preamble is handled of returning from server; And generate second data based on the 3rd data of returning.
In one embodiment of the invention, the data message in first data, second data and the 3rd data may be many and also may be 0.
According to the method for data synchronization of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This method has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, has agility, real-time, high efficiency and applicability.
Fig. 2 is the structural representation according to the data synchronization unit 20 of the embodiment of the invention.
The data synchronization unit 20 of the embodiment of the invention comprises: acquiring unit 201, and being used for obtaining will be by the first synchronous data; Judging unit 202, be used for based on data number and data characteristics information, judge one of in first data and second data, whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in another of first data and second data; Transmitting element 203, be used for when judging first data and have different data messages with second data, the different pieces of information information of judging is sent to server, obtain the 3rd data after preamble is handled the corresponding data of storing in the server is carried out more newly arrive synchronously; And generation unit 204, be used for generating second data based on the 3rd data that obtained after the data synchronization processing last time.
In one embodiment of the invention, data synchronization unit 20 also comprises data characteristics information generating unit 205, is used for generating one of at least data characteristics information based on data content, timestamp information and the data length information of this data-message.
In one embodiment of the invention, data synchronization unit 20 also comprises lock unit 206, is used for utilizing three data sync first data of process after preamble is handled of returning from server.
According to the data synchronization unit of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This device solves sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that need to participate in data in synchronization, have agility, real-time, high efficiency and applicability.
Fig. 3 is the data synchronous system 30 according to the embodiment of the invention.
The data synchronous system 30 of the embodiment of the invention comprises: portable terminal 301 comprises data synchronization unit 20; And server 302, be used for utilizing the different pieces of information information that receives, the corresponding data of storing in the server is carried out synchronous three data of acquisition after preamble is handled of more newly arriving.
In one embodiment of the invention, after the different pieces of information information that the transmitting element 203 of server 302 reception data synchronization units 20 sends, corresponding data to storage in the server 302 carries out synchronous three data of acquisition after preamble is handled of more newly arriving, and will return to data synchronization unit 20 through the 3rd data after handling when preamble, so that 206 pairs of first data of the lock unit of data synchronization unit 20 carry out reaching the purpose of first data and the 3rd data consistent synchronously.
According to the data synchronous system of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This system has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, has agility, real-time, high efficiency and applicability.
As shown in Figure 4, for realizing the particular flow sheet of method of data synchronization.
Step S401 is for initiating data synchronization request.
Initiate data synchronization request and can be to be triggered by user's operation, also can regularly be initiated automatically according to cycle predetermined time by portable terminal 301 or server 302.
Step S402 is that acquiring unit 201 obtains will be by the first synchronous data.
First data are to obtain from portable terminal 301 this locality.
Step S403 is based on data number and data characteristics information, judges one of whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in another of first data and second data in first data and second data.
In one embodiment of the invention, the data structure of the data message in first data and the 3rd data comprises data number, data content and data characteristics information at least, and second data be based on that the 3rd data that obtain after data synchronization processing last time generate, the data structure of the data message in second data comprises data number and data characteristics information at least.
In one embodiment of the invention, data characteristics information one of is based in data content, timestamp information and the data length information of this data-message at least the unique identification information of determining.Data characteristics information will calculate according to specific formulation one of at least in data content, timestamp information and the data length information of this data-message.
In one embodiment of the invention, the data message in first data, second data and the 3rd data may be many and also may be 0.
Particularly, be to judge one of in first data, whether to have in the data number that comprises and the data characteristics information at least the data message different with any data message in second data and to judge one of in second data, whether there be in the data number that comprises and the data characteristics information at least the data message different with any data message in first data.
Step S404 is not when to be the different pieces of information information judged from first data and the data number that has exist in second data, and server is increased to this data message in the corresponding data of storing in the server.
Step S405 is that the different pieces of information information judged is from first data, and when in second data, having identical but the data message that data characteristics information is different of the data number that has, utilize this different data message to replace the data message that has the identical data numbering in the corresponding data of storing in server.
Step S406 is not when to be the different pieces of information information judged from second data and the data number that has exist in first data, this different pieces of information information of deletion in the corresponding data of storing from server.
Step S407 is that the 3rd data after server 302 will be handled synchronously return to portable terminal 301.
Step S408 is that portable terminal 301 is according to the 3rd data sync first data of returning.
Step S409 generates second data for data number and the data characteristics information according to first data after synchronous.
Particularly, data number and the data characteristics information of first data of portable terminal after will this subsynchronous finishing store as second data, so that first data carry out identifying the data message that needs carry out data sync according to second data when synchronous next time.
Further, be that example describes the process that identification needs data in synchronization with synchronous android system mobile phone address list.
Data in the cell phone address book are first data, and every address book data has unique data number DATAID in android system mobile phone address list, and data content DATE and data characteristics information FP.
Example one:
Never carried out data sync before supposing, this moment, second data were empty.At this moment,
The data structure of first data:
1 |
139139 |
2zvgSn1k6PBY37zTH94yy0EX |
2 |
139138 |
1cAYTS3rtsPy3AnXGlA26Z1 |
3 |
139130 |
2rxjvV4rsAIlBvKuW1GjbIc |
The data structure of second data:
The synchrodata identifying is as follows:
At this time data numbering DATAID and data characteristics information FP are searched one by one and check in first data and second data, discovery all can not find the data of dataid=1 or dataid=2 or dataid=3 in second data, can reach a conclusion: 3 of dataid=1, dataid=2 and dataid=3 data all will participate in synchronously in the cell phone address book, the data synchronization unit of mobile phone is issued server with these 3 data messages, increase these 3 data messages in the corresponding data that server is stored in server, obtain the 3rd data.
Server returns to portable terminal with the 3rd data, portable terminal according to the 3rd Data Update first data to realize data sync.After first data sync with the 3rd data consistent.Data number and data characteristics information that portable terminal is incited somebody to action first data after this subsynchronous finishing store as second data.
Example two:
Suppose that portable terminal carried out data sync in the past, at this moment,
The data structure of first data:
DATAID |
DATA |
FP |
1 |
139139 |
2zvgSn1k6PBY37zTH94yy0EX |
2 |
138139 |
3Bd5ii3ALxzOsPHQw3De58I |
4 |
133131 |
3r2OwR4sxrpg1iXk4Q2z5eEI |
5 |
0201234567 |
v9kB64oO4GmhuFWv14JqCL |
The data structure of second data:
DATAID |
FP |
1 |
2zvgSn1k6PBY37zTH94yy0EX |
2 |
1cAYTS3rtsPy3AnXGlA26Z1 |
3 |
2rxjvV4rsAIlBvKuW1GjbIc |
The synchrodata identifying is as follows:
Data number in first data is that the data message of dataid=1 can find in second data, and in first data in the data of dataid=1 and second data data characteristics information of the data of dataid=1 the same, all be FP=2zvgSn1k6PBY37zTH94yy0EX, so this data message need not participate in data sync.
In first data and second data, can both find the data message of data number dataid=2, but the data characteristics information inconsistency of the two, the fp=1cAYTS3rtsPy3AnXGlA26Z1 of the data message correspondence of dataid=2 in fp=3Bd5ii3ALxzOsPHQw3De58I second data of the data message correspondence of dataid=2 in first data, so these data will participate in synchronously, the data message of dataid=2 is replaced the data message that has the identical data numbering in the corresponding data of storing in the described server in server by utilizing first data.
Data number in second data is the data message of dataid=3 owing to can not find the data message of the dataid=3 consistent with its data number in first data, so these data will participate in synchronously, this data message of deletion in the corresponding data that server is stored in server.
Data number is that the data message of dataid=4 can not find in second data in first data, so this data message will participate in synchronously, increases this data message in the corresponding data that server is stored in server.
Same, data number is that the data message of dataid=5 can not find in second data in first data, so this data message will participate in synchronously this data message of increase in the corresponding data that server is stored in server.
At this moment, server obtains the 3rd data, and server returns to portable terminal with the 3rd data, portable terminal according to the 3rd Data Update first data to realize data sync.After first data sync with the 3rd data consistent.Data number and data characteristics information that portable terminal is incited somebody to action first data after this subsynchronous finishing store as second data.
The method of data synchronization of the embodiment of the invention, based on data number and data characteristics information, drawing this needs data in synchronization, finishes the synchronization of local and server data.This method has solved sync client under the situation that does not have the data manipulation daily record, also can accurately find out the problem that needs to participate in data in synchronization, has agility, real-time, high efficiency and applicability.
Describe and to be understood that in the flow chart or in this any process of otherwise describing or method, expression comprises module, fragment or the part of code of the executable instruction of the step that one or more is used to realize specific logical function or process, and the scope of preferred implementation of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by opposite order, carry out function, this should be understood by the embodiments of the invention person of ordinary skill in the field.
In flow chart the expression or in this logic of otherwise describing and/or step, for example, can be considered to the sequencing tabulation for the executable instruction that realizes logic function, may be embodied in any computer-readable medium, use for instruction execution system, device or equipment (as the computer based system, comprise that the system of processor or other can be from the systems of instruction execution system, device or equipment instruction fetch and execution command), or use in conjunction with these instruction execution systems, device or equipment.With regard to this specification, " computer-readable medium " can be anyly can comprise, storage, communication, propagation or transmission procedure be for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically of computer-readable medium (non-exhaustive list) comprises following: the electrical connection section (electronic installation) with one or more wirings, portable computer diskette box (magnetic device), random-access memory (ram), read-only memory (ROM), can wipe and to edit read-only memory (EPROM or flash memory), fiber device, and portable optic disk read-only memory (CDROM).In addition, computer-readable medium even can be paper or other the suitable media that to print described program thereon, because can be for example by paper or other media be carried out optical scanner, then edit, decipher or handle to obtain described program in the electronics mode with other suitable methods in case of necessity, then it is stored in the computer storage.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, a plurality of steps or method can realize with being stored in the memory and by software or firmware that suitable instruction execution system is carried out.For example, if realize with hardware, the same in another embodiment, in the available following technology well known in the art each or their combination realize: have for the discrete logic of data-signal being realized the logic gates of logic function, application-specific integrated circuit (ASIC) with suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that and realize that all or part of step that above-described embodiment method is carried is to instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, this program comprises one of step or its combination of method embodiment when carrying out.
In addition, each functional unit in each embodiment of the present invention can be integrated in the processing module, also can be that the independent physics in each unit exists, and also can be integrated in the module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, also can adopt the form of software function module to realize.If described integrated module realizes with the form of software function module and during as independently production marketing or use, also can be stored in the computer read/write memory medium.
The above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
In the description of this specification, concrete feature, structure, material or characteristics that the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means in conjunction with this embodiment or example description are contained at least one embodiment of the present invention or the example.In this manual, the schematic statement to above-mentioned term not necessarily refers to identical embodiment or example.And concrete feature, structure, material or the characteristics of description can be with the suitable manner combination in any one or more embodiment or example.
Although illustrated and described embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, those of ordinary skill in the art can change above-described embodiment under the situation that does not break away from principle of the present invention and aim within the scope of the invention, modification, replacement and modification.Scope of the present invention extremely is equal to by claims and limits.