更新时间:2022-03-25 23:12:43
Ie:假设记录#125在服务器上被更改了,那么你必须决定的事情是关于哪一侧在更改冲突的情况下被认为是 1月5日晚上10点,同一条记录在1月5日晚上11点更改了其中一部手机(我们称之为客户A)。
最后一次同步是在1月3日。然后用户重新连接,例如1月8日。
I.e.: suppose Record #125 is changed on the server on January 5th at 10pm and the same record is changed on one of the phones (let's call it Client A) on January 5th at 11pm. Last synch was on Jan 3rd. Then the user reconnects on, say, January 8th.
识别需要更改的是简单,客户端和服务器都知道日期
Identifying what needs to be changed is "easy" in the sense that both the client and the server know the date of the last synch, so anything created or updated (see below for more on this) since the last synch needs to be reconciled.
因此,最后一次同步是最后一次同步,所以任何创建或更新假设唯一改变的记录是#125。
您可以决定两者之一自动胜利并覆盖另一个,或者您需要支持一个协调阶段,用户可以决定哪个版本(服务器或客户端)是正确的,覆盖另一个版本。
So, suppose that the only changed record is #125. You either decide that one of the two automatically "wins" and overwrites the other, or you need to support a reconcile phase where a user can decide which version (server or client) is the correct one, overwriting the other.
这个决定是非常重要的,你必须重视客户的角色。特别是如果不仅在客户端和服务器之间存在潜在冲突,而且在不同的客户端可以更改相同的记录的情况下。
This decision is extremely important and you must weight the "role" of the clients. Especially if there is a potential conflict not only between client and server, but in case different clients can change the same record(s).
[假设#125可以由第二客户端(客户端B)修改,有可能尚未同步的客户端B将提供同一记录的另一版本,使得先前的冲突解决方案
[Assuming that #125 can be modified by a second client (Client B) there is a chance that Client B, which hasn't synched yet, will provide yet another version of the same record, making the previous conflict resolution moot]
关于创建或更新上面的...如何在一个客户端上创建记录(假设这在您的问题中是有意义的)域)?
假设您的应用程序管理业务联系人列表。如果客户A说你必须添加一个新创建的约翰·史密斯,并且服务器有一个约翰史密斯昨天由客户端D创建...你创建两个记录,因为你不能确定他们不是不同的人?
Regarding the "created or updated" point above... how can you properly identify a record if it has been originated on one of the clients (assuming this makes sense in your problem domain)? Let's suppose your app manages a list of business contacts. If Client A says you have to add a newly created John Smith, and the server has a John Smith created yesterday by Client D... do you create two records because you cannot be certain that they aren't different persons? Will you ask the user to reconcile this conflict too?
客户端是否拥有数据子集的所有权?也就是说如果客户端B被设置为区域#5的数据的权威,客户端A是否可以修改/创建区域#5的记录?
Do clients have "ownership" of a subset of data? I.e. if Client B is setup to be the "authority" on data for Area #5 can Client A modify/create records for Area #5 or not? (This would make some conflict resolution easier, but may prove unfeasible for your situation).
总而言之,主要的问题是:
To sum it up the main problems are:
参考书目:
更多关于这一点,当然, Wikipedia 。
SyncML®:同步和管理您的移动数据(O'Reilly Safari上的书)
SyncML®: Synchronizing and Managing Your Mobile Data (Book on O'Reilly Safari)
乐观复制 YASUSHI SAITO(HP实验室)和MARC SHAPIRO(微软研究有限公司) - ACM Computing Surveys, V,No.N,3 2005。
Optimistic Replication YASUSHI SAITO (HP Laboratories) and MARC SHAPIRO (Microsoft Research Ltd.) - ACM Computing Surveys, Vol. V, No. N, 3 2005.
Alexander Traud,Juergen Nagler-Ihlein,Frank Kargl和Michael Weber。通过重用SyncML的循环数据同步。在第九届国际移动数据管理会议(MDM '08)。 IEEE Computer Society,Washington,DC,USA,165-172。 DOI = 10.1109 / MDM.2008.10 http://dx.doi.org/10.1109/MDM.2008.10
Alexander Traud, Juergen Nagler-Ihlein, Frank Kargl, and Michael Weber. 2008. Cyclic Data Synchronization through Reusing SyncML. In Proceedings of the The Ninth International Conference on Mobile Data Management (MDM '08). IEEE Computer Society, Washington, DC, USA, 165-172. DOI=10.1109/MDM.2008.10 http://dx.doi.org/10.1109/MDM.2008.10
Lam,F.,Lam,N.和Wong,R.2002.Efficient synchronization for mobile XML data。在第十一届国际信息与知识管理大会会议记录(麦克莱恩,美国弗吉尼亚,2002年11月4日 - 09日)。 CIKM'02。 ACM,New York,NY,153-160。 DOI = http://doi.acm.org/10.1145/584792.584820
Lam, F., Lam, N., and Wong, R. 2002. Efficient synchronization for mobile XML data. In Proceedings of the Eleventh international Conference on information and Knowledge Management (McLean, Virginia, USA, November 04 - 09, 2002). CIKM '02. ACM, New York, NY, 153-160. DOI= http://doi.acm.org/10.1145/584792.584820
Cunha,PR和Maibaum,TS 1981. Resource&equil;抽象数据类型+同步 - 面向消息的编程的一种方法。在Proceedings of the 5th international Conference on Software Engineering(San Diego,California,United States,March 09 - 12,1981)中。国际软件工程会议。 IEEE Press,Piscataway,NJ,263-272。
Cunha, P. R. and Maibaum, T. S. 1981. Resource &equil; abstract data type + synchronization - A methodology for message oriented programming -. In Proceedings of the 5th international Conference on Software Engineering (San Diego, California, United States, March 09 - 12, 1981). International Conference on Software Engineering. IEEE Press, Piscataway, NJ, 263-272.
从 Dr.Dobbs 网站:
从arxiv.org :
From arxiv.org: