Background technology
Along with developing rapidly of information-intensive society, people expect that urgently personal information (like Email, calendar, address list etc.) can obtain upgrading simultaneously on different equipment (comprising palmtop PC, mobile phone, PDA, desktop computer), keep the consistency of data.For example, user expectation has been read the mail that an envelope is newly received on palmtop PC, can in his desktop computer, automatically this envelope mail be shown as and read mail; When for example mobile device user is received order through Email again, just can use the inventory system of same mobile device visited company immediately, to confirm Shipping Date.This carries out synchronization of data with regard to requiring the needs between distinct device.
SyncML (Synchronization Markup Language) is a kind of information synchronization standard agreement.The SyncML protocol definition between client and server the reciprocal process of message and the type of data sync.A kind of wheel synchronization type wherein is synchronously slow, is meant that client and server end all send to the other side to all data of oneself, and it is synchronous to carry out man-to-man comparison.In addition, thus also have in the prior art and a kind ofly utilize fingerprint to come data are compared to carry out the method for data sync.
Utilize fingerprint to carry out in the method for data sync (DS) in prior art, fingerprint is the numerical value that one group of data is obtained after through certain algorithm process.Any variation of data all can cause the difference of fingerprint, so the effective identification data of fingerprint.Can produce corresponding fingerprint from association element to a database, wherein the fingerprint of database is called Container in the DS agreement.Fingerprint can only be produced by the terminal, also can be produced by terminal and server both sides.The purposes of fingerprint is to be used for server whether differentiate data that it receives from the terminal identical with the data of self storage.Because no matter data have been revised on which limit, fingerprint all can be inconsistent.If fingerprint is consistent, show that server is the same with the data at terminal, the terminal does not need to send, if fingerprint is different, shows that data have modification, at this moment will see the collision detection strategy, if be as the criterion with the data of server end, that terminal also there is no need to send data.Like this, can avoid sending some unnecessary data through comparing fingerprint, thereby save flow.In addition, fingerprint also can be used as breakpoint transmission.This method for synchronous of fingerprint that utilizes is also referred to as intelligent synchronization (SmartSync).The once time synchronization process is divided into three phases usually, needs six packets to accomplish, promptly from message bag 1 to message bag 6 (PKG1 is to PKG6).Fingerprint has multiple algorithm, for communicating pair uses consistent algorithm, need carry out negotiating algorithm.One side sends to the opposing party with its set of algorithms of supporting, and the opposing party therefrom finds the fingerprint algorithm of its support, and informs the other side, thereby accomplishes the negotiation of fingerprint algorithm.
As shown in Figure 1, the method flow diagram for intelligent synchronization comprises:
1, the synchronous initiation stage (PKG1 and PKG2 shown in figure)
Synchronous initiation is mainly accomplished identification authentication, is needed the negotiation in data in synchronization storehouse, the negotiation of synchronizing capacity, such as, support synchronously which data, support which wheel synchronization type etc.
No matter certain once time synchronization process by which side is initiated, and client all can at first be sent synchronous initiation bag (PKG1) to server, in PKG1, mainly comprises client authentication information, capacity of equipment, fingerprint occupation mode etc.;
After server was received PKG1, meeting checking client account returned to client to the checking result, i.e. PKG2 simultaneously.
2, synchronous phase (PKG3 to PKG6 shown in figure)
Through analyzing the wheel synchronization type of appointment among the PKG2, client can be encapsulated into the local data base total data perhaps took place to change after last subsynchronous completing successfully all data (comprise and increase, delete, change data) and send to server among the PKG3.After server is received PKG3, carry out wherein each kind of operational order with Data Update in correspondence database.When will instructing executing state to return to client; Server also can be encapsulated into all data (comprise and increase, delete, change data) that change took place in the database own and return to client among the PKG4 after last subsynchronous completion; Wherein, what PKG3 sent is the ID and the fingerprint of data, after server is received PKG3; Carry out fingerprint comparison, the sign of the data element that need send through PKG4 indication client.
After client receives PKG4, pass through the data element of PKG5 transmission needs according to the indication of server.After server is received PKG5, return receiving status information through PKG6, alternatively, the modification data of send server end.
3, accomplish the stage (PKG7 and PKG8 shown in figure) synchronously
The client and server end is confirmed mutually to accomplish synchronously.
Client is returned the state that sends data, sends mapping directive (MAP order) and gives server (PKG7);
Server returns the state information (PKG8) to mapping directive
In existing intelligent synchronization method; In synchronizing process generation aborted; After synchronous fault occurring, can initiate a synchronous recovery process (Resume) usually, at this moment both sides will use Smar tSync method for synchronous synchronously; Calculate the fingerprint of data item in the sync database Changelog tabulation and issue the other side, thereby need to confirm the data item of transmission.
The inventor finds that there is following defective at least in prior art in the process of embodiment of the present invention: residing state is different during owing to interruption, if adopt identical processing method will cause the transmission of unnecessary information, thereby wastes Internet resources.
Summary of the invention
The embodiment of the invention provides a kind of synchronous fault processing method, system and device, with the amount of information of sending in the minimizing synchronization failure recovery process, thus conserve network resources.
The embodiment of the invention provides a kind of synchronous fault processing method, comprising:
Generate the synchronized process identification information according to synchronized process, be used for the residing concrete stage of synchronizing process is identified, said synchronized process identification information comprises client synchronized process identification information and server synchronized process identification information;
If synchronous fault takes place, recover the synchronous concrete simultaneous operation of synchronous said recovery according to said client synchronized process identification information and server synchronized process identification information and comprise: initiate new synchronously, or
User end to server sends the corresponding fingerprint of data item in the client sync database, or
Server is the corresponding fingerprint of data item in client send server sync database.
The embodiment of the invention provides a kind of synchronization failure recovery to handle client, comprising:
The synchronized process identify unit is used for generating according to synchronized process the synchronized process identification information of client, the residing concrete stage in the synchronizing process identified,
Sync id information interaction unit, the synchronized process identification information of server when being used for the synchronous fault of server interaction,
Synchronously recovery unit is used for recovering synchronously according to the synchronized process identification information of said server and the synchronized process identification information of said client, and the synchronous concrete simultaneous operation of said recovery comprises: initiates new synchronous, or
User end to server sends the corresponding fingerprint of data item in the client sync database, or
Server is the corresponding fingerprint of data item in client send server sync database.
The present invention implements a kind of synchronization failure recovery processing server is provided, and comprising:
The synchronized process identify unit is used for generating according to synchronized process the synchronized process identification information of server, the residing concrete stage in the synchronizing process identified,
Sync id information interaction unit, the synchronized process identification information of server when being used for the synchronous fault of server interaction,
Synchronously recovery unit is used for recovering synchronously according to the synchronized process identification information of said server and the synchronized process identification information of said client, and the synchronous concrete simultaneous operation of said recovery comprises: initiates new synchronous, or
User end to server sends the corresponding fingerprint of data item in the client sync database, or
Server is the corresponding fingerprint of data item in client send server sync database.
The embodiment of the invention provides a kind of synchronization failure recovery treatment system, comprises client and server,
Said client comprises:
The synchronized process identify unit is used for generating according to synchronized process the synchronized process identification information of client, the residing concrete stage in the synchronizing process identified,
Sync id information interaction unit, the synchronized process identification information of the client when being used for client synchronisation fault,
Recovery unit is used for recovering synchronously according to the synchronized process identification information of said server and the synchronized process identification information of said client synchronously,
Said server comprises:
The synchronized process identify unit is used for generating according to synchronized process the synchronized process identification information of server, the residing concrete stage in the synchronizing process identified,
Sync id information interaction unit, the synchronized process identification information of the client when being used for client synchronisation fault,
Recovery unit is used for recovering synchronously according to the synchronized process identification information of said server and the synchronized process identification information of said client synchronously,
The synchronous concrete simultaneous operation of said recovery comprises: initiate new synchronously, or
User end to server sends the corresponding fingerprint of data item in the client sync database, or
Server is the corresponding fingerprint of data item in client send server sync database.
In the embodiment of the invention,, reduced the amount of information of sending in the synchronization failure recovery process through recovering synchronous according to the synchronized process identification information, thus conserve network resources.
Embodiment
The embodiment of the invention provides a kind of method, client, server and system thereof of synchronous fault treatment.Wherein, the method for synchronous fault treatment comprises: generate the synchronized process identification information according to synchronized process; If synchronous fault takes place, recover synchronously according to said synchronized process identification information.The embodiment of the invention is recovered to have reduced the amount of information of sending in the synchronization failure recovery process synchronously according to the synchronized process identification information, thus conserve network resources.Further understand for the ease of the embodiment of the invention, embodiment of the invention method is described in detail below in conjunction with accompanying drawing.
As shown in Figure 2, be embodiment of the invention synchronous fault processing method flow chart, comprising:
S201 generates the synchronized process identification information according to synchronized process.
In embodiments of the present invention, client and server all can be according to the residing concrete stages in the synchronizing process, and promptly synchronized process generates the corresponding synchronous process identity information, so that client in the synchronizing process and residing concrete stage of server are identified.
S203 if synchronous fault takes place, recovers synchronously according to said synchronized process identification information.
In embodiments of the present invention; When synchronous fault takes place when; Because all there is the corresponding synchronous process identity information in each stage of synchronizing process, therefore, can confirm guest room end and the residing concrete synchronous phase of server according to the corresponding synchronous process identity information; And the respective synchronization operation of taking according to concrete synchronous phase decision synchronization failure recovery; Recover in the synchronizing process simultaneous operation can for: initiates new synchronously, user end to server sends the corresponding fingerprint of data item in the client sync database, the fingerprint of server data item correspondence in client send server sync database etc.
As shown in Figure 3, be another embodiment of the present invention synchronous fault processing method flow chart, comprising:
S301 is provided with the corresponding relation of synchronized process and synchronized process identification information in advance.
In embodiments of the present invention, for client and server, with the ident value that oneself is set respectively, for client, the synchronizing process ident value can identify with CFlag, and its Schema stipulates as follows:
<xs:element?name=″CFlag″type=″xs:positiveInteger″/>
Its value is as shown in table 1 below:
Table 1
For the server section, the synchronizing process ident value can identify with SFlag, and its Schema stipulates as follows:
<xs:element?name=″SFlag″type=″xs:positiveInteger″/>
Its value is as shown in table 2 below:
Table 2
S303 generates the synchronized process identification information corresponding with synchronized process according to said synchronized process with the corresponding relation of synchronized process identification information
In an embodiment of the present invention; In synchronizing process; When client and server get into concrete synchronous phase respectively, will generate the synchronized process identification information corresponding respectively according to above table 1 and form 2 with the respective synchronization stage, such as;, server when (being initial phase), will generate the synchronized process identification information SFlag=00 of this synchronized process according to corresponding form before receiving first PKG3.
S305, the synchronized process identification information during the synchronisation fault
In embodiments of the present invention; After synchronous fault took place, when both sides initiated to recover synchronous synchronously, client and server were with mutual both sides' synchronized process identification information; The corresponding synchronous process identity information can be carried out alternately through message bag between client and the server; Such as, before client is being sent PKG3, promptly during initial phase; To client be sent to server according to the synchronized process identification information CFlag=00 that the corresponding relation between synchronized process and the synchronized process identification information generates through PKG1; Server is after receiving PKG1, and client is sent before the PKG3, and the respective synchronization process identity information SFlag=00 of own synchronized process of living in is sent to client through PKG2.
S307 confirms the concrete simultaneous operation that recovery is synchronous according to the synchronized process identification information of client and server.
In embodiments of the present invention, the corresponding relation of synchronized process identification information and simultaneous operation can be set in advance, such as, like following table 3 as show:
Table 3
After client and server both sides synchronisation process identity information, will determine concrete simultaneous operation according to the corresponding relation of synchronized process identification information and simultaneous operation.
Such as, an existing station terminal equipment need carry out synchronously with server, and corresponding Changelog tabulation is as shown in table 4 below:
LUID |
ChangeType |
GUID |
ChangeType |
0012 |
Replace |
ABCD001 |
Replace |
0015 |
Add |
ABCD003 |
Replace |
0020 |
Replace |
ABCD030 |
Add |
Table 4
Wherein, in order can the same data clauses and subclauses that both sides will operate to be mapped, also can safeguard an ID mapping table at server end, the global identifier of promptly safeguarding at server side (GUID) is corresponding with this identifiers (LUID) of safeguarding in end side.
Existing associative list 4 is done further to set forth to the embodiment of the invention with regard to concrete applicating example:
The first step: client is initiated a bi-directional synchronization, and after PKG1,2 initialization, PKG3 issues server to the data (LUID:0012,0015,0020) of client change, and at this moment client is provided with CFlag=01; After server is received PKG3, carry out wherein each kind of operational order with Data Update in correspondence database.When will instructing executing state to return to client; Server also can be all data (GUID:ABCD001 that change takes place in the database own; ABCD003 ABCD030) is encapsulated into and returns to client among the PKG4, and server end is provided with SFlag=10 simultaneously.
Second step: send PKG4 at server and in the process of client, interruption has taken place, PKG4 do not receive by client, and the original value of CFlag and SFlag maintenance at this moment is constant.
The 3rd step: in the client of having no progeny will initiate recovery process, that at first mutual is exactly the value of CFlag and SFlag, at this moment CFlag=01; SFlag=10, according to table 3, client will be sent data item among the Changelog: 0012; 0015 and 0020 fingerprint is given server; If all do not having new variation to these data item between the initiation recovery process after the fault interrupting, server end is found all completion synchronously of these data item through the contrast fingerprint so; So the Spoke-to-Client end need not sent any data, follow-up the data that need the server handle to change are issued client and are got final product.
For the 3rd step; Also have a kind of situation to be: after the fault interrupting to initiating to have new data item to join in the Changelog tabulation between the recovery process; And variation has taken place in original some data item once more in the Changelog tabulation, supposes at this moment that the Changelog of client changes as shown in table 5 belowly to be:
LUID |
ChangeType |
0012 |
Replace |
0015 |
Add、Replace |
0020 |
Replace |
0027 |
Replace |
Table 5
At this moment client will be issued server to the fingerprint of all data item among the Changelog, and server finds that through contrast 0015 and 0,027 two data item needs synchronously the Spoke-to-Client end to be sent this two association.
And for example, an existing station terminal equipment need carry out synchronously with server, and corresponding Changelog tabulation is as shown in table 6 below:
LUID |
ChangeType |
GUID |
ChangeType |
0012 |
Replace |
ABCD001 |
Replace |
0015 |
Add |
ABCD003 |
Replace |
0020 |
Replace |
ABCD030 |
Add |
Table 6
Existing associative list 6 is done further to set forth to the embodiment of the invention with regard to concrete applicating example:
The first step: client is initiated a bi-directional synchronization, and after PKG1,2 initialization, PKG3 issues server to the data (LUID:0012,0015,0020) of client change; After server is received PKG3, carry out wherein each kind of operational order with Data Update in correspondence database.When will instructing executing state to return to client, server also can (GUID:ABCD001, ABCD003 ABCD030) be encapsulated into and return to client among the PKG4 all data that change takes place in the database own; After client is received PKG4, carry out wherein each kind of operational order with Data Update in correspondence database, be encapsulated in instruction executing state and MAP order (being directed against data item GUID:ABCD030) to issue server among the PKG5 then.At this moment CFlag=11, SFlag=10.
Second step: client is sent PKG5 and in the process of server, interruption has been taken place, and PKG5 do not receive by server, and the original value of CFlag and SFlag maintenance at this moment is constant.
The 3rd step: in the client of having no progeny will initiate recovery process, that at first mutual is exactly the value of CFlag and SFlag, at this moment CFlag=11; SFlag=10, according to table 3, server will send data item among the Changelog: ABCD001; The fingerprint of ABCD003 and ABCD030 (if any; Direct transmission data that it's not true) give client (from interrupting during recovery process, having new data item to join the client Changelog tabulation, these data do not need transmission yet immediately), if all do not having new variation to these data item between the initiation recovery process after the fault interrupting; Client is through the contrast fingerprint so; Find all completion synchronously of these data item, so the notification server end need not sent any data, at this moment client only need be sent out the MAP of buffer memory order and get final product in the past.
For the 3rd step; Also have a kind of situation to be: after the fault interrupting to initiating to have new data item to join in the server end Changelog tabulation between the recovery process; And variation has taken place in original some data item once more in the Changelog tabulation, supposes at this moment that the Changelog of server end changes as shown in table 7 belowly to be:
GUID |
ChangeType |
ABCD001 |
Replace |
ABCD003 |
Replace |
ABCD030 |
Add |
ABCD047 |
Replace |
Table 7
Server end will be issued server to the fingerprint of all data item among the Changelog so, and client finds that through contrast two data item of ABCD003 and ABCD047 need synchronously notification server to be sent this two association.
The embodiment of the invention has reduced the amount of information of sending in the synchronization failure recovery process through recovering synchronous according to the synchronized process identification information, thus conserve network resources.Such as; When if both sides' synchronized process all is in initial phase synchronously,, send fingerprint like elder generation according to prior art because the data in the Changelog tabulation also are not sent out; Be undoubtedly a kind of waste so, at this moment not as directly initiating a new synchronous flow process; If arrived the stage that server end sends the change data, even among the client Changelog new data item has been arranged again so, also needn't manage, and only need comprehend the Changelog item of server end; If arrived the stage of sending the MAP order, the data item among the both sides Changelog all needn't be comprehended so, and the MAP order of only sending buffer memory gets final product.
As shown in Figure 4, handle the client sketch map for embodiment of the invention synchronization failure recovery, comprising:
Synchronized process identify unit 42 is used for generating the synchronized process identification information according to synchronized process.
In embodiments of the present invention; The synchronized process identify unit will be according to the concrete stage in the synchronizing process; Be that synchronized process generates the corresponding synchronous process identity information, wherein, can be through the corresponding relation that unit 41 is provided with synchronized process and synchronized process identification information in advance be set; When synchronizing process is in corresponding synchronous during the stage, will generate the corresponding synchronous process identity information according to the corresponding relation of synchronized process and synchronized process identification information.
Recovery unit 44 is used for recovering synchronously according to said synchronized process identification information synchronously.
In embodiments of the present invention; Recovery unit 44 will be through sync id information interaction unit 43 synchronisation both sides' synchronized process identification information synchronously; Thereby the residing synchronous phase of synchronous both sides when obtaining synchronous fault; And according to the synchronized process identification information that unit 41 is provided with in advance and the corresponding relation of simultaneous operation are set, determine concrete simultaneous operation, such as: initiate new synchronously; User end to server sends the corresponding fingerprint of data item in the client sync database, the fingerprint that server data item in client send server sync database is corresponding etc.
In embodiments of the present invention; Because both sides relate to server and client synchronously, therefore, server exists and client is improved accordingly; Server should comprise units corresponding; Such as synchronized process identify unit and synchronous recovery unit, relate to the same client of sketch map of server, repeat no more at this.
The embodiment of the invention identifies the concrete stage of synchronizing process through the synchronized process identify unit that utilizes client; In the synchronization failure recovery process, initiate the corresponding synchronous operation according to the concrete stage; Reduced the amount of information of sending in the synchronization failure recovery process, thus conserve network resources.
As shown in Figure 5; Be embodiment of the invention synchronization failure recovery treatment system sketch map, comprise: client 51 and server 52, wherein; Client 51 comprises: synchronized process identify unit 511; Be used for generating the synchronized process identification information according to synchronized process, recovery unit 512 is used for recovering synchronously according to said synchronized process identification information synchronously.Server 52 comprises: synchronized process identify unit 521, be used for generating the synchronized process identification information according to synchronized process, and recovery unit 522 is used for recovering synchronously according to said synchronized process identification information synchronously.
In embodiments of the present invention; 511 pairs of clients of the synchronized process identify unit of client 51,51 residing synchronized process signs; Simultaneously, synchronous fault when taking place in 521 pairs of servers of the synchronized process identify unit of server 52,52 residing synchronized process signs; Both sides' synchronisation process identification (PID) synchronously, and both sides' synchronous recovery unit according to corresponding synchronous process identification (PID) confirm concrete simultaneous operation.
The embodiment of the invention identifies synchronized process through synchronous both sides, and according to the concrete simultaneous operation in the synchronous recovery process of synchronized process sign decision, has reduced the amount of information of sending in the synchronization failure recovery process, thus conserve network resources.
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 accomplish through following program:
Generate the synchronized process identification information according to synchronized process;
If synchronous fault takes place, recover synchronously according to said synchronized process identification information.
This program can be stored in the computer-readable recording medium, and storage medium can comprise: ROM, RAM, disk or CD etc.
More than synchronization processing method, system and device that the embodiment of the invention provided have been carried out detailed introduction; Used concrete embodiment among this paper the principle and the execution mode of the embodiment of the invention are set forth, the explanation of above embodiment just is used to help to understand the method and the core concept thereof of the embodiment of the invention; Simultaneously, for one of ordinary skill in the art, according to the thought of the embodiment of the invention, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as the restriction to the embodiment of the invention.