A need exists for a method to efficiently synchronize data sets between network devices having related data stored therein. The need is particularly acute in disconnect, intermittent, and low-bandwidth environments.
Reference in the specification to “one embodiment” or to “an embodiment” means that a particular element, feature, structure, or characteristic described in connection with the embodiments is included in at least one embodiment. The appearances of the phrases “in one embodiment”, “in some embodiments”, and “in other embodiments” in various places in the specification are not necessarily all referring to the same embodiment or the same set of embodiments.
Some embodiments may be described using the expression “coupled” and “connected” along with their derivatives. For example, some embodiments may be described using the term “coupled” to indicate that two or more elements are in direct physical or electrical contact. The term “coupled,” however, may also mean that two or more elements are not in direct contact with each other, but yet still co-operate or interact with each other. The embodiments are not limited in this context.
As used herein, the terms “comprises,” “comprising,” “includes,” “including,” “has,” “having” or any other variation thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, article, or apparatus that comprises a list of elements is not necessarily limited to only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Further, unless expressly stated to the contrary, “or” refers to an inclusive or and not to an exclusive or.
Additionally, use of the “a” or “an” are employed to describe elements and components of the embodiments herein. This is done merely for convenience and to give a general sense of the invention. This detailed description should be read to include one or at least one and the singular also includes the plural unless it is obviously meant otherwise.
The embodiments disclosed herein resolve the problem of synchronizing two sets of data where the size of the symmetric difference between the sets is small and, in addition, the elements in the symmetric difference are related through a metric such as the Hamming distance metric.
Let SA denote the set of strings on Host A 110 and let SB denote the set of strings on Host B 120. The set reconciliation problem is to determine the minimum information 140 and 150 that must be sent from Host A 110 to Host B 120 with a single round of communication so that Host A 110 and Host B 120 can compute their symmetric difference SA Δ SB=(SA\SB) ∪ (SB\SA) where |SA Δ SB|≦t. Disclosed herein is a variant of the traditional set reconciliation problem whereby the elements in the symmetric difference SA Δ SB are related. In particular, some embodiments involve a setup where this symmetric difference can be partitioned into subsets such that elements in each of these subsets are within a certain Hamming distance of each other. The disclosed embodiments provide transmission schemes that minimize the amount of information exchanged between two hosts.
This model is motivated by the scenario where two hosts are storing a large number of documents/files, some or all of which may be large in file size. Under this setup, information is rarely or never deleted so that each database contains many different versions of the documents. Each document may have a fixed number of fields and each field may have a fixed size. When synchronizing sets of documents between two hosts, a set of hashes is produced for every document on both hosts. As an example, the hashes performed may include the CRC-32 redundancy check or the MD5 checksum. For every document, a single hash is then formed by concatenating in a systematic fashion the result of hashing each field of the document.
Suppose ha=(0, 9, 5, 4, 3) ∈105 is a non-binary string vector that is the result of performing the hash described above on document a. Suppose a single field on document a is updated resulting in the document a′ and that ha′=(0, 9, 5, 4, 5) ∈105 is a non-binary string vector representing the hash for a′. By the previous discussion, ha and ha′ differ only in the portion of ha′ which corresponds to the field that was updated. Further, the Hamming distance between ha and ha′ is one.
The documents stored in database A 310 and database B 330 each have a fixed structure. For example, the documents may have a fixed number of fields such as Field 1 to Field M as shown. Further, the documents may contain images in addition to text. As an example, if the fields represent images, the hash may be run on the binary data representing the hash itself.
As shown, database A 310 has a document 312 stored therein, which corresponds to row 314 shown. Database A 310 further has a document 316 stored therein corresponding to row 318 and a document 320 stored therein corresponding to row 322. Database B 330 has a document 332 stored therein corresponding to row 334.
Document 316 differs in content from document 312 in that there is new data included within Field 1 of document 316 compared to document 312, as shown by the corresponding fields in rows 314 and 318. Document 320 differs in content from document 316 in that there is new content included within Field 2 of document 320 compared to document 316, as shown by the corresponding fields in rows 322 and 318. Document 320 further differs from document 312 in that document 320 contains new data in both Field 1 and Field 2 compared to document 312, as shown by the corresponding fields in rows 322 and 314. Document 332 differs in content from documents 312, 316, and 320 in that there is new data in Field M of document 332 compared to documents 312, 316, and 320, as shown by the corresponding fields in rows 334, 314, 318, and 322.
String vectors may be created for each document within the databases. String vectors may comprise any set of non-binary numbers. As an example, the string vectors comprise the output of concatenating hash functions together. For instance, if the document has the following name-value pairs ((ID, 2) (Location, 2)), and F is any hash function, then the string vector is (F(ID, 2), F(Location, 2)).
Motivated by this setup, the embodiments disclosed herein resolve the problem of reconciling sets of data elements, in particular where subsets of data elements in the symmetric difference are within a bounded Hamming distance from each other.
The fact that the elements in the symmetric difference can be partitioned into subsets is a property of the data that is being synchronized and it is a function of the fact that the documents are related. Within the subsets 420, 430, and 440, the separation of the data elements corresponds to how different in content the data is from each other. Data 450 is not partitioned into a subset, as the respective data elements from Host A 110 and Host B 120 do not differ, as shown for example by data elements 452, which are shown as an overlapping circle and triangle.
Using subset 420 as an example, any pair of data elements, such as data elements 422 and 424, are located within a specified Hamming distance d of each other. In some embodiments, the distance d may be specified in advance by a manufacturer or user/operator of the system. As an example, d may be a number less than four, such as three, but may be any number. If the Hamming distance between elements in the symmetric difference is lower, better compression is achieved.
For two strings x, y ∈ qa, let dH(x,y) denote their Hamming distance. We denote the Hamming weight of x as wt(x). We assume q is a constant. Let SA ⊂ GF(q)n and SB ⊂ GF(q)n. We say that (SA,SB) are (t,h,1)-sets if SA Δ SB can be be written SA Δ SB={X1,1, . . . , x1,k1} ∪ {x2,1, . . . , x2,k2} ∪ . . . ∪ {xj,kj, . . . , xj,kj}, where j≦t, for 1≦i≦j, ki≦h, and for any u,w ∈ {xi,1, . . . , xi,ki}, we have dH (u,w)≦1. As an example, suppose SA,SB ∈ GF(2)5 where SA={(0,0,0,0,0),(1,0,1,1,1)} and SB{(0,0,0,0,0),(1,1,0,0,1)}. Then we say that (SA,SB) are (1,2,3)-sets since SA Δ SB={(1,0,1,1,1),(1,1,0,0,1)} can be decomposed into 1 set of size 2 whereby the Hamming difference between any two elements is at most 3.
Disclosed herein are transmission schemes for the problem of reconciling (1,h,l)-sets, where |SA Δ SB|≦h and for all u,w ∈ SA Δ SB, we have dH(u,w)≦l. Discussed below is the encoding procedure that is performed on Host A. Also discussed is the decoding procedure, which is performed on Host B. The goal, after the decoding procedure, is to compute SA Δ SB where (SA, SB) are (1,h,l)-sets consisting of elements from GF(q)n.
The idea behind the encoding and decoding is to encode the symmetric difference SA Δ SB by specifying one element say X ∈ SA Δ SB and then specifying the remaining elements in SA Δ SB by describing their location relative to X As a result, as will be described shortly, the information transmitted from Host A to Host B can be decomposed into two parts denoted w1 and w2. The information in the w1 part describes the locations of the elements in SA Δ SB relative to X. The information in the w2 part will be used to fully recover X. Once X is known and the locations of the other elements in SA Δ SB are known relative to X, then the symmetric difference SA Δ SB can be recovered.
Some useful notation is first introduced. An [n,d]q code is a linear code over GF(q) of length n with minimum Hamming distance d. Suppose r is a positive integer where r<n. Let α be a primitive element in GF(q′) where q is prime. Furthermore, let H be an r×n matrix with elements from GF(q). Suppose S={x1,x2, . . . , xs} ⊂ GF(q)n. For shorthand, we denote the set {H·x1,H·x2, . . . , H·xs} as H·S. We define SH,i where 1≦i≦q′ so that SH,i={x ∈ S:H·x=αi}, where with an abuse of notation, αqr=0. We refer to the j-th element in SH,i, when ordered in lexicographic order, as SH,i,j. Finally, let IH:{GF(q)n}→q
Suppose q=2,n=3, S={(0,0,0), (1,1,0), (1,0,1), (0,0,1)}, and
Representing the elements of GF(4) as α1=(0,1)T, α2=(1,1)T, α3=(1,0), and α4=(0,0)T, we have IH1(S)=(1,2,0,1). In this case, SH1,1={(1,0,1)}, SH1,2={(0,0,1),(1,1,0)}, SH1,4={(0,0,0)}, and SH1,2,2=(1,1,0). To describe the encoding (and subsequent decoding) procedure, the following matrices are used:
1) H·∈ GF(q)r×n, for some positive integer r, is the parity check matrix for an [n,2′+1]q code Cl;
2) H1 ∈ GF(2)u×qr, for some positive integer u, is the parity check matrix for an [qr,2h+1]2 code C1;
3) HF ∈ GF(q)n×n, and H−·∈ GF(q)(n−r)×n are such that
has full rank.
In addition to the matrix H−l, one more tool is required to encode w2. Some additional notation is first introduced. Let b=(b1,b2, . . . , bm) be a sequence of length m with elements from GF(qn−r) such that for any positive integer k where k≦s Σj=1k ajbi
Discussed below is an embodiment of the encoding procedure followed by the decoding procedure. For encoding, the following procedure may be performed on both Host A and Host B. For shorthand, the set SA or SB is referred to as S. The operations in step 3) take place over the field GF(qn−r) where n−r>r and also that m>qr where b=(b1,b2, . . . , bm) is a Bh sequence.
1) Let z=IH·(S) mod 2;
2) Define w1=H1·z; and
The information (w1,w2) is then transmitted from the host device performing the encoding to the other host device.
For decoding, suppose (q1A, w2A) is the information transmitted by Host A to Host B and suppose (w1B, w2B) is the result of the encoding procedure if it is performed on Host B. Next, it is illustrated how to recover SA Δ SB given (w1A, w2A), (w1B, w2B). The decoding procedure has two broad stages. In the first stage, the locations of the elements in SA Δ SB relative to some X ∈ SA Δ SB are determined. In the second stage, the element X is recovered. The decoding begins by first recovering the syndromes of the elements in the set SA Δ SB. More precisely, as a result of the error correction ability of the code with a parity check matrix H1, the set SS={HL·y:y ∈ SA Δ SB} is first recovered. Next, an element is arbitrarily chosen, say XS ∈ SS. Given this setup, X (described earlier) is precisely equal to the element in X which maps to XS under the map HL so that X=X ∈ SA Δ SB:XS=X·HL.
To determine the locations of the other elements in SA Δ SB relative to X every element in the set SS is added to XS. Let SL={YS+XS:YS ∈ SS}. As will be described below in more detail from the set SL, the values of the elements in SA Δ SB relative to X can be determined. Next, the value of X is determined by canceling out some of the contributions of the elements in (SA Δ SB)\X from the vector w2.
Suppose D1:GF(2)u→GF(2)qr is the decoder for the code C1 which by assumption has minimum Hamming distance at least 2h+1. D1 takes as input a syndrome and outputs an error vector with Hamming weight at most h. Let Dl:GF(q)r→GF(q)n be the decoder for CL, which has Hamming distance 2l+1. The decoder Dl takes as input a syndrome and outputs an error vector with Hamming weight at most l. In the following, α is a primitive element of GF(qr).
1) Let {circumflex over (z)}=1(w1A+w1B).
2) Suppose {circumflex over (z)} has is in positions {k1,k2, . . . , kv}. If {circumflex over (z)}=0, then let F=Ø, and stop.
3) Define ê2=Dl(αkl+αk2), ê3=Dl(αk1+αk3), . . . , êv=Dl(αk1+αkv).
4) Let z′=w2A+w2B+Σi=2r bk
5) Define s2=z′/(bk1+bk2+ . . . +bkv).
6) Let {circumflex over (x)}=HF−1·(αk1,s2)T.
7) F={{circumflex over (x)}, {circumflex over (x)}+{circumflex over (x)}2, . . . , {circumflex over (x)}+êv}.
Discussed below is an example illustrating the encoding and decoding procedures.
1) Setup: Suppose Host A has the set SA={(1,1,1,0,0,0,1),(1,1,0,0,1,1,0), (1,0,0,0,0,1,1),(0,0,0,1,0,0,1)}, and Host B has the set SB={(1,1,1,0,0,0,1),(1,1,0,0,1,1,0),(1,0,0,0,0,1,1), (1,0,0,1,0,0,1)}. In this case, SA Δ SB={(0,0,0,1,0,0,1), (1,0,0,1,0,0,1)} and dH((0,0,0,1,0,0,1), (1,0,0,1,0,0,1))=1 so that (SA, SB) are (1,2,1)-sets. In this case x=(0,0,0,1,0,0,1) ∈ SA\SB and y=(1,0,0,1,0,0,1) ∈ SB\SA.
2) Encoding: We let zA, zB be the result of performing step 1) on Hosts A and B respectively. Similarly let w1A, w1B, w2A, w2B be the result of performing steps 2) and 3) on Hosts A and B respectively. Suppose ζ is a primitive element of GF(8) and β is a primitive element of GF(16) where we use the primitive polynomial x3+x+1 to represent elements over GF(8) as binary vectors and we use the primitive polynomial x4+x+1 to represent the elements over GF(16) as binary vectors.
The following matrices may be used:
is the parity check matrix for an [8,3]2 code. This matrix plays the same role as the matrix H1 described in the encoding procedure.
In this case, H′1 is analogous to the matrix H1 described in the encoding procedure. Notice that H′1 is a parity check matrix for an [8,5]2 code. Let
and note that
has full rank as desired. The B2 sequence b=(β,β2, . . . ,β15) is used for the example.
At step 1) of the encoding, zA=(0,2,0,1,1,0,0,0) mod 2=(0,0,0,1,1,0,0,0) and zB=(0,2,0,1,0,1,0,0) mod 2=(0,0,0,1,0,1,0,0) so that zA+zB=(0,0,0,0,1,1,0,0). At step 2) of the encoding, w1A=(1,1,1,0,0,0) and w1B=(0,0,0,1,1,0). At step 3) of the encoding w2A=β2·β5+β2·β2+β4·β14+β5·β6. Similarly w2B=β2·β5+β2·β2+β4·β14+β6·β7.
3) Decoding: The decoding is performed on Host B and the information (w1A, w2A), (w1B, w2B), and SB is known. Let Dl be the decoder for the code with a parity check matrix Hl and suppose′1 is the decoder for the code with a parity check matrix H′1. At step 1) of the decoding, z=′1 (w1B+w1A)=(0,0,0,0,1,1,0,0)=zA+zB as desired. In this case z has 1 s in positions ζ5 and ζ6 so we let k1=6 and k2=5.
At step 3) of the decoding, ê=Di(ζ5+ζ6)=Di(ζ1)=(1,0,0,0,0,0,0)=x+y. Now at step 4), we have z0=w2+w2B+β5·
At step 6), we find that ŷ=(1,0,0,1,0,0,1) since Hl·ŷ=ζ6 and
Under the procedure described above, 10 bits of information have been transmitted between Host A and B. Alternative methods used require at least 14 bits of information exchange. Less information is transmitted because the method encodes the differences between the elements in the symmetric difference along with only one element in the symmetric difference, rather than encoding all elements in the symmetric difference. Thus, the disclosed embodiments allow for a more efficient transmittal of information between networked devices, which is especially useful in DIL network environments.
Method 500 may begin with step 510, which involves providing a first host device 110 connected to a second host device 120 via a communication network 130, the first host device 110 and the second host device 120 each having a plurality of documents stored therein (see documents 222 in
Step 520 involves creating a string vector for each document contained therein. The string vector is formed by concatenating a hash of each field of the respective document, where Sa is a set of string vectors for the plurality of documents stored on the first host device 110 and Sb is a set of string vectors for the plurality of documents stored on the second host device 120. In some embodiments, the string vectors are non-binary string vectors, as discussed in the example above.
Step 530 involves encoding, using encode/decode module 226 shown in
In some embodiments, w1 is determined according to the equation w1=H1·z, where z=IH
In some embodiments, w2 is determined according to the equation
where matrix
has full rank and
Step 540 involves transmitting, using transmitter/receiver 230, the respective encoded set of string vectors Sa or Sb to the other of the first host device 110 and the second host device 120, such as shown by arrows 140 and 150 in
Step 560 involves determining, using processor 210, at each of the respective first host device and the second host device using information from SaΔSb, which string vectors are missing from the respective first host device and the second host device, such as by comparing the string vectors with those stored on the host device. Step 570 involves requesting, using processor 210 and transmitter/receiver 230, missing documents pertaining to the missing string vectors from the other of the first host device 110 and the second host device 120. Step 580 involves receiving, shown by arrows 140 and 150 in
Method 500 may be implemented as a series of modules, either functioning alone or in concert, with physical electronic and computer hardware devices. Method 500 may be computer-implemented as a program product comprising a plurality of such modules, which may be displayed for a user.
Various storage media, such as magnetic computer disks, optical disks, and electronic memories, as well as non-transitory computer-readable storage media and computer program products, can be prepared that can contain information that can direct a device, such as a micro-controller, to implement the above-described systems and/or methods. Once an appropriate device has access to the information and programs contained on the storage media, the storage media can provide the information and programs to the device, enabling the device to perform the above-described systems and/or methods.
For example, if a computer disk containing appropriate materials, such as a source file, an object file, or an executable file, were provided to a computer, the computer could receive the information, appropriately configure itself and perform the functions of the various systems and methods outlined in the diagrams and flowcharts above to implement the various functions. That is, the computer could receive various portions of information from the disk relating to different elements of the above-described systems and/or methods, implement the individual systems and/or methods, and coordinate the functions of the individual systems and/or methods.
Many modifications and variations of the disclosed embodiments are possible in light of the above description. Within the scope of the appended claims, the embodiments of the systems described herein may be practiced otherwise than as specifically described. The scope of the claims is not limited to the implementations and the embodiments disclosed herein, but extends to other implementations and embodiments as may be contemplated by those having ordinary skill in the art.
This application claims the benefit of U.S. Provisional Patent Application Ser. No. 62/351,717 filed Jun. 17, 2016, entitled “Method for Efficient Synchronization of Similar Data Sets”, the content of which is fully incorporated by reference herein.
This invention is assigned to the United States Government and is available for licensing for commercial purposes. Licensing and technical inquiries may be directed to the Office of Research and Technical Applications, Space and Naval Warfare Systems Center, Pacific, Code 72120, San Diego, Calif., 92152; voice (619) 553-5118; email ssc_pac_T2@navy.mil; reference Navy Case Number 103761.
Number | Date | Country | |
---|---|---|---|
62351717 | Jun 2016 | US |