CN103312743A - Data synchronization device and method - Google Patents

Data synchronization device and method Download PDF

Info

Publication number
CN103312743A
CN103312743A CN2012100626196A CN201210062619A CN103312743A CN 103312743 A CN103312743 A CN 103312743A CN 2012100626196 A CN2012100626196 A CN 2012100626196A CN 201210062619 A CN201210062619 A CN 201210062619A CN 103312743 A CN103312743 A CN 103312743A
Authority
CN
China
Prior art keywords
data
differential data
differential
synchronized
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2012100626196A
Other languages
Chinese (zh)
Inventor
邢学智
潘爱民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shengle Information Technolpogy Shanghai Co Ltd
Original Assignee
Shengle Information Technolpogy Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shengle Information Technolpogy Shanghai Co Ltd filed Critical Shengle Information Technolpogy Shanghai Co Ltd
Priority to CN2012100626196A priority Critical patent/CN103312743A/en
Publication of CN103312743A publication Critical patent/CN103312743A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides data synchronization device and method. The device comprises an interface module which is used for receiving a differential data calculation request and instructing a differential calculation module to carry out differential calculation, the differential calculation module which is used for receiving an instruction, extracting data to be synchronized from a terminal device database, calling synchronized data, carrying out comparison calculation on the synchronized data and the data to be synchronized to acquire differential data, and sending the differential data to a differential synchronization module, and the differential synchronization module which is used for receiving the differential data and synchronizing the differential data to a receiving end database. The method comprises the steps of receiving the differential data calculation request; extracting the data to be synchronized according to the differential data calculation request, calling the synchronized data, and carrying out comparison calculation on the synchronized data and the data to be synchronized to acquire the differential data; and synchronizing the differential data to the receiving end database.

Description

A kind of data synchronization unit and method
Technical field
The present invention relates to technical field of data storage, particularly a kind of data synchronization unit and method.
Background technology
Network-termination device comprises the products such as mobile InterWorking Equipment (Mobile Intemet Device is called for short MID) smart mobile phone or net book, by network and Full Featured browser, send and receive e-mail in the high speed access the Internet, understand topical news or with kith and kin's Video chat; Use office software editor form, watch the PDF document, arrange busy commercial affairs plan; Play one section music, appreciate a sheet, perhaps the music lantern slide is shared a good time; More can utilize global positioning system (Global PositioningSystem is called for short GPS) own intransit position, location, with the drop of camera record life.
Along with the fast development of mobile Internet business, network-termination device also all has this wide market space all over the world at present.Network-termination device itself can be preserved the needed various data informations of user.Under a lot of application scenarioss, for preventing loss of data, make things convenient for data transfer or backup, network-termination device need to be synchronized to other databases with the form of showing with the data in its data storehouse; For example in the real life, a lot of users can be the address list synchronization of preserving in the network-termination device in the database of high in the clouds, even network-termination device is lost or the system failure accidentally like this, also can from the database of high in the clouds, again obtain the address list of oneself, be unlikely to and at one's side kith and kin lose contact.
And along with data variation at any time in the terminal database of network-termination device, the data that are synchronized in other databases also need constantly to upgrade synchronously.In the middle of prior art, most data synchronization process all is the direct synchronous more file of new database form, and namely the database of receiving isochronous data (for example high in the clouds database) is preserved network-termination device synchrodata that database remains once again.According to the scheme of prior art, even the user of network-termination device only makes modification to low volume data, still need all data are all upgraded one time synchronously, not only lose time but also waste network traffics.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of data synchronization unit and method, realize upgrading synchronously for differential data.
For achieving the above object, the concrete technical scheme of the present invention is as follows:
A kind of data synchronization unit, described device comprises:
Interface module be used for receiving the differential data computation requests, and instruction Difference Calculation module is carried out Difference Calculation;
The Difference Calculation module be used for to receive instruction, extracts from terminal equipment database and treats synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtains differential data, and differential data is sent to the difference synchronization module;
The difference synchronization module is used for receiving differential data, and differential data is synchronized to the receiving terminal database.
Described Difference Calculation module comprises:
Control unit is used for the instruction that the receiving interface module sends, and extracts the synchrodata for the treatment of in the terminal equipment database, will treat that synchrodata converts text representation form Data Concurrent to and delivers to computing unit;
Computing unit, be used for receiving text representation form data, and access synchronized data and described text representation form data compare calculating from memory cell, obtain the data distinct with synchronized data in the described text representation form data, described distinct data are sent to the difference synchronization module as differential data;
Memory cell is used for the storage synchronized data.
Described control unit comprises:
Scheduling unit is used for the instruction that the receiving interface module sends, and the indication adaptation unit extracts and change the synchrodata for the treatment of in the terminal equipment database, receives treating synchrodata and sending to the first converting unit through the adaptation unit conversion;
Adaptation unit is used for treating synchrodata from the terminal equipment database extraction, will treat that synchrodata converts mathematical expression form data to, and the data after will changing sends to scheduling unit;
The first converting unit is used for receiving mathematical expression form data from scheduling unit, convert mathematical expression form data to text representation form data, and the data after will changing sends to computing unit.
The text representation form of described text representation form data and described differential data is specially:
Extend markup language form, SQL are derived form or JSON form.
Described computing unit compares to calculate and is specially:
Computing function is set in computing unit in advance, and computing unit calls described computing function described synchronized data and text representation form data is compared calculating.
Described difference synchronization module comprises:
Command unit is used for receiving the differential data that the Difference Calculation module sends, and draws merge command according to differential data, and merge command is sent to lock unit;
Lock unit, be used for receiving merge command, obtain differential data from command unit simultaneously, and convert differential data to the data corresponding with the data format of receiving terminal database, be synchronized to the receiving terminal database according to the data of described merge command after with format transformation.
Described command unit comprises:
The second converting unit is used for receiving the differential data that the Difference Calculation module sends, and converts differential data to mathematical expression form differential data, and mathematical expression form differential data is sent to merge cells;
Merge cells is used for receiving mathematical expression form differential data, draws merge command according to mathematical expression form differential data, and merge command is sent to lock unit;
Then described lock unit obtains differential data and is specially and obtains mathematical expression form differential data.
Described merge cells draws merge command and is specially:
Pooled function is set in merge cells in advance, described mathematical expression form differential data substitution pooled function is calculated, draw merge command.
The method that a kind of data are synchronous said method comprising the steps of:
Receive the differential data computation requests;
Extract according to the Difference Calculation request and to treat synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtain differential data;
Differential data is synchronized to the receiving terminal database.
Described extraction treats that synchrodata also comprises:
To treat that synchrodata converts text representation form data to.
The described text representation form data that will convert to are specially:
To treat that synchrodata converts mathematical expression form data to; Convert mathematical expression form data to text representation form data.
Described comparing calculation obtains differential data and is specially:
Synchronized data and the described text representation form data of preserving are compared calculating, obtain data distinct with synchronized data in the text representation form data, with described distinct data as differential data.
Described differential data is specially synchronously:
Draw merge command according to differential data;
Convert differential data to the data corresponding with the data format of receiving terminal database, be written to the receiving terminal database according to the data of described merge command after with format transformation.
The described merge command that draws is specially:
Convert differential data to mathematical expression form differential data, draw merge command according to mathematical expression form differential data;
Describedly convert differential data to the data corresponding with the data format of receiving terminal database and be specially:
Convert mathematical expression form differential data to the data corresponding with the data format of receiving terminal database.
As seen through the above technical solutions, the beneficial effect that the present invention exists is, by the Difference Calculation module in the device of the present invention and difference synchronization module, differential data in the computing terminal device databases, and differential data is synchronized in the receiving terminal database, realized only upgrading synchronously for differential data, but not the synchrodata that remains in the terminal equipment database has been upgraded synchronously, for the user has saved time and network traffics, improved practicality and user and experienced; In addition device of the present invention by described the first adaptation unit and the second adaptation unit with data multi-form in the distinct type data-base, convert unified mathematical expression form to, thereby make device of the present invention can be applied to data synchronization updating between the multiple types of data storehouse, so that device of the present invention has more widely applicability, be not subject to the restriction of type of database.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is data synchronization unit structural representation shown in the one embodiment of the invention;
Fig. 2 is data synchronization unit structural representation shown in the another embodiment of the present invention;
Fig. 3 is data synchronization unit structural representation shown in another embodiment of the present invention;
Fig. 4 is Difference Calculation modular structure schematic diagram in the embodiment of the invention;
Fig. 5 is that difference merges the modular structure schematic diagram in the embodiment of the invention;
Fig. 6 is the inventive method embodiment flow chart;
Fig. 7 extracts among the inventive method embodiment to treat synchrodata and calculate the differential data flow chart;
Fig. 8 is synchronous difference data flowchart among the inventive method embodiment;
Fig. 9 is another embodiment of the method flow chart of the present invention.
Embodiment
In the present invention, represent in the terminal database partial data that changes through revising with " differential data " this concept, namely the data upgraded synchronously of last version and current version are treated the part that there are differences in the synchronous data.
Existing database is in data synchronization process, can not directly calculate differential data, there are not other apparatus and method can effectively realize calculating differential data yet, so present data synchronization updating can't be realized only upgrading synchronously for differential data, and can only upgrade synchronously total data.
In view of the foregoing, the specific embodiment of described data synchronization unit provided by the present invention and method has been realized by calculating differential data, and has been upgraded synchronously for differential data.
For the purpose, technical scheme and the advantage that make the embodiment of the invention clearer, below in conjunction with the accompanying drawing in the embodiment of the invention, 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.
With reference to shown in Figure 1, in the middle of first specific embodiment disclosed in this invention, a kind of data synchronization unit has been described, can realize the function of synchronous difference data, 100 representatives device of the present invention among the figure specifically comprises:
Interface module 110 be used for receiving the differential data computation requests, and instruction Difference Calculation module is carried out Difference Calculation;
Difference Calculation module 120 be used for to receive instruction, extracts from terminal equipment database and treats synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtains differential data, and differential data is sent to the difference synchronization module;
Difference synchronization module 130 is used for receiving differential data, and differential data is synchronized to the receiving terminal database.
The beneficial effect that the described device of above embodiment exists is: utilize described Difference Calculation module to calculate differential data, and utilize described difference synchronization module that differential data is synchronized in the receiving terminal database, the described device of the present embodiment has been realized upgrading synchronously for differential data, for the user has saved time and network traffics, improved practicality and user and experienced.
Expand embodiment illustrated in fig. 1, then obtain following examples, with reference to shown in Figure 2.The present embodiment is made following restriction to described Difference Calculation module and difference synchronization module on basis embodiment illustrated in fig. 1:
Difference Calculation module 220 comprises:
Control unit 221 is used for the instruction that the receiving interface module sends, and extracts the synchrodata for the treatment of in the terminal equipment database, will treat that synchrodata converts text representation form Data Concurrent to and delivers to computing unit;
Computing unit 222, be used for receiving text representation form data, and access synchronized data and described text representation form data compare calculating from memory cell, obtain the data distinct with synchronized data in the described text representation form data, described distinct data are sent to the difference synchronization module as differential data; Set in advance computing function in the computing unit, utilize described computing function that described synchronized data and text representation form data are compared calculating;
Memory cell 223 is used for the storage synchronized data;
Difference synchronization module 230 comprises:
Command unit 231 is used for receiving the differential data that computing unit sends, and draws merge command according to differential data, and merge command is sent to lock unit; Set in advance pooled function in the merge cells, described differential data substitution pooled function is calculated, draw merge command;
Lock unit 232, be used for receiving merge command, obtain differential data from command unit simultaneously, and convert differential data to the data corresponding with the data format of receiving terminal database, be synchronized to the receiving terminal database according to the data of described merge command after with format transformation.
Carried out further optimization on basis embodiment illustrated in fig. 1 in the present embodiment.Be provided with a memory cell in the described Difference Calculation module and be used for the storage synchronized data, in order in computational process, directly call, transfer synchronized data to the receiving terminal database when need not to calculate at every turn; Described memory cell is with text representation form storage synchronized data, thus treat that in order to make synchrodata can calculate with synchronized data, must be with the two uniform format; The treat synchrodata corresponding with the terminal equipment database form that control unit described in the present embodiment will extract converts text representation form data to, realized treating the Difference Calculation of synchronized data in synchrodata and the memory cell; Corresponding, the text representation form treat that synchrodata and synchronized data calculate after, the differential data that obtains is similarly the text representation form, described lock unit converts the differential data of text representation form to the data corresponding with the data format of receiving terminal database, and be synchronized to the receiving terminal database, complete realization the synchronous renewal of differential data.Described text representation form data exist simple and clear compact, are easy to read, send or the advantage such as encryption.The present embodiment is one and optimizes embodiment, improved the present invention program's feasibility and practicality.
With reference to shown in Figure 3, among another embodiment disclosed in this invention, described device there is following description:
In the present embodiment, the application scenarios of choosing is: variation has occured in the address book data that had been synchronized to the high in the clouds database before the address book data of the current preservation of mobile InterWorking Equipment MID is compared, and MID namely utilizes device of the present invention to obtain differential data.Described differential data represents in the terminal database (in the MID equipment protect stored database 031) through revising the partial data that changes, and namely has been updated to synchronously address book data and the current part that there are differences in the synchrodata treated in the receiving terminal database (high in the clouds database 032).
Device comprises described in the present embodiment:
Interface module 310 be used for receiving the differential data computation requests that the user sends, and instruction Difference Calculation module is carried out Difference Calculation;
Difference Calculation module 320 with reference to shown in Figure 4, be used for treating synchrodata from the terminal equipment database extraction, and calculate differential data, specifically comprises:
Scheduling unit 321 is used for the instruction that the receiving interface module sends, and the indication adaptation unit extracts and change the synchrodata for the treatment of in the terminal equipment database, receives treating synchrodata and sending to the first converting unit through the adaptation unit conversion;
Adaptation unit 322 is used for treating synchrodata from the terminal equipment database extraction, will treat that synchrodata converts mathematical expression form data to, and the data after will changing sends to scheduling unit;
The first converting unit 323 is used for receiving mathematical expression form data from scheduling unit, convert mathematical expression form data to text representation form data, and the data after will changing sends to computing unit;
Computing unit 324, be used for receiving text representation form data, and access synchronized data and described text representation form data compare calculating from memory cell, obtain the data distinct with synchronized data in the described text representation form data, described distinct data are sent to the difference synchronization module as differential data;
Memory cell 325 is used for the storage synchronized data;
Difference Calculation module 330 with reference to shown in Figure 5, be used for receiving differential data, and differential data is synchronized to the receiving terminal database, specifically comprises:
The second converting unit 331 is used for receiving the differential data that the Difference Calculation module sends, and converts differential data to mathematical expression form differential data, and mathematical expression form differential data is sent to merge cells;
Merge cells 332 is used for receiving mathematical expression form differential data, draws merge command according to mathematical expression form differential data, and merge command is sent to lock unit;
Lock unit 333, be used for receiving merge command, obtain mathematical expression form differential data from merge cells simultaneously, and convert mathematical expression form differential data to the data corresponding with the data format of receiving terminal database, be synchronized to the receiving terminal database according to the data of described merge command after with format transformation.
In the present embodiment, described terminal equipment database is to protect stored database 031 among the MID, and terminal equipment database is preserved with the form of table and treated synchrodata; Described receiving terminal database is high in the clouds database 032; The described synchrodata for the treatment of is the address book data of current version among the MID; Described synchronous data are the address book data that the MID last time is updated to synchronously the high in the clouds database.
In the present embodiment, described mathematical expression form data and mathematical expression form differential data concrete form are as follows:
D=(DN,{T 1,T 2,...,T k}),1<=k
T i=(TN,PK={H j},TH={H 1,H 2,...,H n},{R 1,R 2,...,R m}),0<=m,1<=n,H j∈TH
R u={C 1,C 2,...,C n},1<=n
H w=(N,Type)
C l=V
Its implication is:
D representative data library information also is the information of first level in the mathematical expression form data; Its information D N that comprises represents the name of this database; { T 1, T 2..., T kRepresent in this database k and protect stored table, wherein 1<=k;
T iRepresent i information of protecting stored table; Its information TN that comprises represents the name of this table; TH represents the gauge outfit information aggregate, and gauge outfit information shows the data type of this column data, { H 1, H 2..., H nThe gauge outfit set of the n column data that comprises for this table; PK is the abbreviation of Primary Key, and representative is value mainly, and every data line must comprise a main value makes the row data be different from other row data, and the main value of any two row can not be identical, and j the main value of data record of every delegation is namely with { H jRepresent that j column data in this form has recorded the main value of each row; { R 1, R 2..., R mRepresent the capable data of m in this table; 0<=m wherein, 1<=n, H j∈ TH;
H wRepresent the gauge outfit information of w row, N represents the name of these row, and Type represents the data type of these row;
R uRepresent the information of the capable data of u, { C 1, C 2..., C nN data, wherein 1<=n comprising for this row;
C 1Represent the information of the 1st data, V represents the value of these data.
In the present embodiment, described text representation form data have specifically adopted extend markup language form (XML form).Transfer function (trans function) is set in described the first modular converter, utilizes the trans function to convert mathematical expression form data to the XML formatted data.
The computational methods of the trans function in the present embodiment can be expressed as:
trans(a,b,c)=trans(a)trans(b)trans(c)
trans({A})=trans(A)
Implication is, comprises a, b, three data item of c in the data that the trans function is changed, and then changes respectively three data item; The data that the trans function is changed then need to change each in the set for set.Need in the present embodiment to convert mathematical expression form data to the XML formatted data, with the information D substitution trans function of first level, be expressed as first:
trans(D)=<database>trans(DN,T 1,T 2,...,T n)</database>
The data of above formal representation are the XML formatted data, comprise beginning label (in above-mentioned equation for<database 〉); End-tag (in the above-mentioned equation be</database 〉), the content in the middle of beginning label and the end-tag is the data message content.
According to above-mentioned mathematical expression form in the present embodiment, database information D comprises two data item, DN and set { T 1, T 2..., T k, according to the computational methods of trans function, need to change respectively this two data item; Transformation result is similarly and comprises the XML formatted data that begins label, end-tag and data message content; Be expressed as:
trans(D)=trans(DN)trans(T i)
trans(DN)=<databasename>DN</databasename>
trans(T i)=<table>trans(TN,PK,TH,R 1,R 2,...,R m)</table>
Wherein DN includes only a data item, does not need further to change again; T iComprise a plurality of data item, so the trans function also needs to continue T according to above-mentioned computational methods iEach data item that comprises is changed.
Convert mathematical expression form data to the XML formatted data according to said method in the present embodiment, final transformation result is expressed as:
trans(D)=<database>trans(DN,T 1,T 2,...,T n)</database>
trans(T i)=<table>trans(TN,PK,TH,R 1,R 2,...,R m)</table>
trans(PK)=<primarykey>trans(H j)</primarykey>
trans(TH)=<tableheader>trans(H 1,H 2,...,H n)</tableheader>
trans(H w)=<header>trans(N,Type)</header>
trans(R u)=<row>trans(C 1,C 2,...,C p)</row>
trans(C l)=<column>trans(V)</column>
trans(V)=<value>V</value>
trans(Type)=<type>Type</type>
trans(N)=<name>N</name>
trans(TN)=<tablename>TN</tablename>
trans(DN)=<databasename>DN</databasename>
In the present embodiment, computing unit accesses synchronized data from memory cell after receiving text representation form data, compares calculating with described text representation form data, and wherein said synchronized data is similarly the XML form; Obtain in the described text representation form data with the concrete mode of the distinct data of synchronized data be:
Computing function is set in computing unit in advance, and computing unit calls described computing function described synchronized data and text representation form data is compared calculating, and computational methods are as follows:
Described text representation form data are defined as D 1, described synchronized data is defined as D 2, with D Diff=D 1-D 2The expression differential data; Function DIFF (D 1, D 2) be described computing function, D is calculated in expression DiffProcess.Other D DiffIn the particular term that comprises have: list deletion item T RemovedBe illustrated in D 2The a certain table of middle existence is at D 1In deleted, row deleted entry R RemovedBe used for being illustrated in D 2Certain delegation of middle existence is at D 1In deleted.Should show maybe this row with the name of deleted table or the main value representation of deleted row, be designated as:
T removed=(TN)
R Removed=(PKV=C j), PKV represents the main value of deleted row, its numerical value is C j
Corresponding trans rule is as follows:
trans(T removed)=<removedtable>TN</removedtable>
trans(R removed)=<removedrow>C j</removedrow>
DIFF (D 1, D 2) computational process be: receive D 1After with D 1Full content writes a transient state D Diff, access again D 2Traversal D 2In all data item, with D 2In each data item and transient state D DiffData item corresponding to this data item position that neutralize compares;
For D 2In a data item, if transient state D DiffIn the data item corresponding with this data item position do not change, then at transient state D DiffThis data item of middle deletion; If at transient state D DiffIn do not find the data item corresponding with this data item position, illustrate that this data item is deleted, then at transient state D DiffMiddle interpolation T RemovedOr R RemovedIf transient state D DiffIn the data item corresponding with this data item position change transient state D then DiffIn data item constant; For D 2In after all data item finish above-mentioned contrast, the transient state D that finally obtains DiffBe D Diff=D 1-D 2, the differential data that namely required calculating is obtained.Because D 1And D 2Be the XML formatted data, so according to D 1And D 2The D that calculates DiffBe essentially the XML formatted data.
DIFF (D 1, D 2) expression formula as follows:
Figure BDA0000142152940000121
Figure BDA0000142152940000131
The second converting unit described in the present embodiment converts differential data to mathematical expression form differential data, namely with D DiffThe XML format conversion become the mathematical expression form, namely obtain mathematical expression form differential data.
Above-mentioned transfer process is in fact the inverse process of described the first converting unit transfer process, is the inverse operation of trans function in the present embodiment, and with reference to the conversion method of the first converting unit, the computation rule of trans function inverse operation can adopt following expression:
trans(a)trans(b)trans(c)=trans(a,b,c)
trans(A)=trans({A})
Implication is, is equal to the item number certificate that conversion comprises a, b, three data item of c for the conversion of a, b, three data item of c; Can wait for all data item in set of conversion and to be all this set of direct conversion.
For example, the computational process with reference to the trans function can get:
<name>N</name>=trans(N)
<type>Type</type>=trans(Type)
trans(N)trans(Type)=<header>trans(N,Type)</header>=trans(H w)
The second converting unit converts differential data to mathematical expression form differential data in the manner described above.
In the present embodiment, described merge cells sets in advance pooled function (DBize function), and described mathematical expression form differential data substitution pooled function is calculated, and draws merge command.Concrete mode is:
Judge for each data item in the mathematical expression form differential data; If this data item is list deletion item T Removed, then generate the instruction of the corresponding table of deletion; If this data item is row deleted entry R Removed, then generate the instruction of deletion corresponding row; If for other generate the instruction that writes this data item; , the data item that need write generates the instruction of replacing the legacy data item if having existed.In merge cells the instruction set that all data item in the mathematical expression form differential data are corresponding, and it is sent to the second adaptation unit as merge command.
The expression formula of DBize function is as follows:
Figure BDA0000142152940000141
Figure BDA0000142152940000151
The present embodiment be a kind of can blanket preferred embodiment, on the basis of the beneficial effect that possesses two embodiment illustrated in figures 1 and 2, further realized and the docking of multiple disparate databases.In the middle of the present embodiment, described adaptation unit and lock unit comprise the several data bank interface, and for example SQLite database interface or MySQL database interface extract data with realization, or differential data is write multitype database from multitype database.Therefore not to repeat here for known in existing this technical field of stage for the described technological means of utilizing database interface to extract or writing.The present invention is by being applied to this technology in the middle of the described device, and utilizes described mathematical expression form that the data in the disparate databases are unified in form, realized and the docking of multiple types of data storehouse, but not has been confined to the database of a certain type.
The effect of the form of mathematical expression described in the present embodiment is the data of unified disparate databases form, to improve the general applicability of described scheme, the mathematical expression form that provides in the present embodiment is a kind of concrete preferred version, also can take other forms to realize the unification of data format under the prerequisite that does not affect overall plan.
The text representation form data of selecting in the present embodiment are the XML formatted data; In fact also can select extended formatting under the prerequisite that does not affect overall plan, for example SQL is derived form (SQL derives form) or JSON form.
Corresponding data synchronization unit of the present invention the invention also discloses the synchronous embodiment of the method for a kind of data, and with reference to shown in Figure 6, the method may further comprise the steps:
Step 901, reception differential data computation requests;
Step 902, extract according to the Difference Calculation request and to treat synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtain differential data;
Step 903, differential data is synchronized to the receiving terminal database.
Embodiment of the method shown in Figure 6 is expanded, then obtain following another embodiment of the method.This method embodiment makes further restriction on basis embodiment illustrated in fig. 6, is specially:
As shown in Figure 7, described extraction treats that synchrodata also comprises:
Step 9021, will treat that synchrodata converts text representation form data to;
Described comparing calculation obtains differential data and is specially:
Step 9022, synchronized data and the described text representation form data of preserving are compared calculating, obtain data distinct with synchronized data in the text representation form data, with described distinct data as differential data.
As shown in Figure 8, described differential data is specially synchronously:
Step 9031, draw merge command according to differential data;
Step 9032, convert differential data to the data corresponding with the data format of receiving terminal database, be written to the receiving terminal database according to the data of described merge command after with format transformation.
In addition, corresponding diagram 3 shown device embodiment, the present invention is corresponding discloses another embodiment of the method, and as shown in Figure 9, concrete steps are as follows:
Step 1001, reception differential data computation requests are carried out Difference Calculation;
Synchrodata is treated in step 1002, extraction, will treat that synchrodata converts mathematical expression form data to;
Step 1003, convert mathematical expression form data to text representation form data;
Step 1004, synchronized data and the described text representation form data of preserving are compared calculating, obtain data distinct with synchronized data in the text representation form data, with described distinct data as differential data;
Step 1005, convert differential data to mathematical expression form differential data;
Step 1006, draw merge command according to mathematical expression form differential data;
Step 1007, convert mathematical expression form differential data to the data corresponding with the data format of receiving terminal database, be written to the receiving terminal database according to the data of described merge command after with format transformation.
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (15)

1. a data synchronization unit is characterized in that, described device comprises:
Interface module be used for receiving the differential data computation requests, and instruction Difference Calculation module is carried out Difference Calculation;
The Difference Calculation module is used for the instruction of receiving interface module, extracts from terminal equipment database and treats synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtains differential data, and differential data is sent to the difference synchronization module;
The difference synchronization module is used for receiving differential data, and differential data is synchronized to the receiving terminal database.
2. described device according to claim 1 is characterized in that, described Difference Calculation module comprises:
Control unit is used for the instruction that the receiving interface module sends, and extracts the synchrodata for the treatment of in the terminal equipment database, will treat that synchrodata converts text representation form Data Concurrent to and delivers to computing unit;
Computing unit, be used for receiving text representation form data, and access synchronized data and described text representation form data compare calculating from memory cell, obtain the data distinct with synchronized data in the described text representation form data, described distinct data are sent to the difference synchronization module as differential data;
Memory cell is used for the storage synchronized data.
3. described device according to claim 2 is characterized in that, described control unit comprises:
Scheduling unit is used for the instruction that the receiving interface module sends, and the indication adaptation unit extracts and change the synchrodata for the treatment of in the terminal equipment database, receives treating synchrodata and sending to the first converting unit through the adaptation unit conversion;
Adaptation unit is used for treating synchrodata from the terminal equipment database extraction, will treat that synchrodata converts mathematical expression form data to, and the data after will changing sends to scheduling unit;
The first converting unit is used for receiving mathematical expression form data from scheduling unit, convert mathematical expression form data to text representation form data, and the data after will changing sends to computing unit.
4. described device according to claim 2 is characterized in that, the text representation form of described text representation form data and described differential data is specially:
Extend markup language form, SQL are derived form or JSON form.
5. described device according to claim 2 is characterized in that, described computing unit compares to calculate and is specially:
Computing function is set in computing unit in advance, and computing unit calls described computing function described synchronized data and text representation form data is compared calculating.
6. the described device of any one is characterized in that according to claim 1-5, and described difference synchronization module comprises:
Command unit is used for receiving the differential data that the Difference Calculation module sends, and draws merge command according to differential data, and merge command is sent to lock unit;
Lock unit, be used for receiving merge command, obtain differential data from command unit simultaneously, and convert differential data to the data corresponding with the data format of receiving terminal database, be synchronized to the receiving terminal database according to the data of described merge command after with format transformation.
7. described device according to claim 6 is characterized in that, described command unit comprises:
The second converting unit is used for receiving the differential data that the Difference Calculation module sends, and converts differential data to mathematical expression form differential data, and mathematical expression form differential data is sent to merge cells;
Merge cells is used for receiving mathematical expression form differential data, draws merge command according to mathematical expression form differential data, and merge command is sent to lock unit;
Then described lock unit obtains differential data and is specially and obtains mathematical expression form differential data.
8. described device according to claim 7 is characterized in that, described merge cells draws merge command and is specially:
Pooled function is set in merge cells in advance, described mathematical expression form differential data substitution pooled function is calculated, draw merge command.
9. the method that data are synchronous is characterized in that, said method comprising the steps of:
Receive the differential data computation requests;
Extract according to the Difference Calculation request and to treat synchrodata, and access synchronized data and the described synchrodata for the treatment of compares calculating, obtain differential data;
Differential data is synchronized to the receiving terminal database.
10. described method according to claim 9 is characterized in that, described extraction treats that synchrodata also comprises:
To treat that synchrodata converts text representation form data to.
11. described method is characterized in that according to claim 10, the described text representation form data that will convert to are specially:
To treat that synchrodata converts mathematical expression form data to; Convert mathematical expression form data to text representation form data.
12. described method is characterized in that according to claim 10, described comparing calculation obtains differential data and is specially:
Synchronized data and the described text representation form data of preserving are compared calculating, obtain data distinct with synchronized data in the text representation form data, with described distinct data as differential data.
13. the described method of any one is characterized in that according to claim 9-12, described differential data is specially synchronously:
Draw merge command according to differential data;
Convert differential data to the data corresponding with the data format of receiving terminal database, be written to the receiving terminal database according to the data of described merge command after with format transformation.
14. described method is characterized in that according to claim 13, the described merge command that draws is specially:
Convert differential data to mathematical expression form differential data, draw merge command according to mathematical expression form differential data.
15. described method is characterized in that according to claim 14, describedly converts differential data to the data corresponding with the data format of receiving terminal database and is specially:
Convert mathematical expression form differential data to the data corresponding with the data format of receiving terminal database.
CN2012100626196A 2012-03-09 2012-03-09 Data synchronization device and method Pending CN103312743A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100626196A CN103312743A (en) 2012-03-09 2012-03-09 Data synchronization device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100626196A CN103312743A (en) 2012-03-09 2012-03-09 Data synchronization device and method

Publications (1)

Publication Number Publication Date
CN103312743A true CN103312743A (en) 2013-09-18

Family

ID=49137526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100626196A Pending CN103312743A (en) 2012-03-09 2012-03-09 Data synchronization device and method

Country Status (1)

Country Link
CN (1) CN103312743A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302642A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 A kind of method and apparatus of synchrodata
CN106339408A (en) * 2016-08-10 2017-01-18 深圳中兴网信科技有限公司 Data synchronization method, data synchronization device and server
CN107018150A (en) * 2017-05-24 2017-08-04 维沃移动通信有限公司 Data transmission method and device
CN107679195A (en) * 2017-10-09 2018-02-09 杭州安恒信息技术有限公司 Half master-slave database synchronous method and system based on the transmission of HTTPS agreements

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650677A (en) * 2009-07-27 2010-02-17 浪潮电子信息产业股份有限公司 File data backup method based on Delta increment
CN101730297A (en) * 2008-10-13 2010-06-09 北京摩软科技有限公司 Mobile terminal, method and server for realizing data management
CN101989305A (en) * 2010-11-09 2011-03-23 福州星网视易信息系统有限公司 Data incremental backup method and system
CN102096615A (en) * 2011-01-25 2011-06-15 上海爱数软件有限公司 Remote incremental backup method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101730297A (en) * 2008-10-13 2010-06-09 北京摩软科技有限公司 Mobile terminal, method and server for realizing data management
CN101650677A (en) * 2009-07-27 2010-02-17 浪潮电子信息产业股份有限公司 File data backup method based on Delta increment
CN101989305A (en) * 2010-11-09 2011-03-23 福州星网视易信息系统有限公司 Data incremental backup method and system
CN102096615A (en) * 2011-01-25 2011-06-15 上海爱数软件有限公司 Remote incremental backup method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302642A (en) * 2016-07-27 2017-01-04 乐视控股(北京)有限公司 A kind of method and apparatus of synchrodata
CN106339408A (en) * 2016-08-10 2017-01-18 深圳中兴网信科技有限公司 Data synchronization method, data synchronization device and server
CN106339408B (en) * 2016-08-10 2019-08-23 深圳中兴网信科技有限公司 Method of data synchronization, data synchronization unit and server
CN107018150A (en) * 2017-05-24 2017-08-04 维沃移动通信有限公司 Data transmission method and device
CN107679195A (en) * 2017-10-09 2018-02-09 杭州安恒信息技术有限公司 Half master-slave database synchronous method and system based on the transmission of HTTPS agreements

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
CN104395884B (en) The data storage layer grade extended for Web page application program and browser
CN102082818B (en) Method and system for storing and managing graphical data and structured data based on cloud storage
WO2017028514A1 (en) Method and device for storing and reading data
CN104967658A (en) Data synchronization method on multiple devices
WO2019134340A1 (en) Salary calculation method, application server, and computer readable storage medium
CN109413127A (en) A kind of method of data synchronization and device
CN102142032B (en) Method and system for reading and writing data of distributed file system
CN102272751B (en) Data integrity in a database environment through background synchronization
CN106599104A (en) Mass data association method based on redis cluster
CN105376502A (en) All media on-line editing tool
CN103200224A (en) Method and device and terminal of information sharing
CN103825918B (en) Method of data synchronization, terminal device, server and system
CN104156381A (en) Copy access method and device for Hadoop distributed file system and Hadoop distributed file system
CN105900093A (en) Keyvalue database data table updating method and data table updating device
CN103324605A (en) Method, equipment and system for collaborative editing of multiple users
CN108733317A (en) Date storage method and device
CN100471127C (en) Digital rights management method and system for content copyright protection
CN103312743A (en) Data synchronization device and method
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN110334145A (en) The method and apparatus of data processing
CN103414762A (en) Cloud backup method and cloud backup device
CN114416868B (en) Data synchronization method, device, equipment and storage medium
CN103246729A (en) Method and system for processing multi-media files of android mobile terminal
US9063949B2 (en) Inferring a sequence of editing operations to facilitate merging versions of a shared document

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130918