[0001] The application claims the benefit of priority to China Patent Application No.
200810026009.4, filed on January 24, 2008, and entitled "METHOD, DEVICE, AND SYSTEM FOR REALIZING FINGERPRINT TECHNOLOGY",
which is incorporated herein by reference in its entirety.
FIELD OF THE TECHNOLOGY
[0002] The present invention relates to a data synchronization (DS) technology, and more
particularly to a method and a system for realizing a fingerprint technology, a data
sending device, and a data receiving device.
BACKGROUND OF THE INVENTION
[0003] Modern society is information society. A user is able to receive and send information
at any time and at any place, and is able to execute application programs with a handheld
device. The results of the data interaction and the application programs need to be
stored in the handheld device, and also need to accord with the data of the type in
other data devices. When the data in one device changes, data in other devices can
be changed accordingly. This is called data synchronization (DS).
[0004] The DS technology uses a method called fingerprint, which is a value obtained from
a set of data that is processed through a certain algorithm. Any change of the data
may result in different fingerprints, and thus the fingerprints can effectively identify
the data. Based on any data from a data element to a database a corresponding fingerprint
may be generated. A server uses fingerprints to determine whether the data received
from a terminal is the same as the data stored on the server. No matter the data on
the server or the terminal changes, the fingerprints are different. If the fingerprint
that is received is the same as that is stored, it indicates that the data on the
server and the terminal are the same, and the terminal does not need to send the data.
If the fingerprints are different, it indicates that the data is changed. At this
time, a collision detection strategy is checked, and if the strategy is based on the
data on the server, the terminal does not need to send the data either. In this way,
some unnecessary data can prevent from being sent by comparing the fingerprints, and
therefore, the traffic is saved. In addition, fingerprints may also be used in resumable
downloading.
[0005] Various algorithms may be adopted for fingerprints. Algorithm negotiation is required
to make both of the communicating parties use the same algorithm. One party sends
a set of supported algorithms to the other party, and the other party finds the supported
fingerprint algorithm and notifies the peer party, thus completing the algorithm negotiation.
A synchronous flow used currently is as shown in FIG. 1.
- 1) Negotiation over the fingerprint use manner is added to PKG 1 and PKG 2.
- 2) The ID and the fingerprint of the data are sent in PKG 3.
- 3) After receiving PKG 3, the server compares fingerprints, and indicates an identification
of a data element that needs to be sent by a client via PKG 4.
- 4) After receiving PKG 4, the client sends the required data element according the
indication of the server via PKG 5.
- 5) After receiving PKG 5, the server returns information about a receiving state via
PKG 6, and optionally sends the changed data on the server.
[0006] In the implementation of the present invention, the inventors found that the existing
fingerprint technology has the following disadvantages.
[0007] The fingerprints are configured to replace long data elements with short fingerprints,
and thus reduce the amount of transmitted data transmission. However, some fingerprints
obtained through certain algorithms are longer than the corresponding data when a
comparison is performed. At this time, it is meaningless to calculate and send the
fingerprints. If the fingerprints are calculated and sent, the calculation amount
of the device (particularly, a client device) is increased. Moreover, an additional
interaction between the client and the server occurs for certain data items, thus
wasting air interface resources. Currently, no technology has been proposed to overcome
the disadvantages.
SUMMARY OF THE INVENTION
[0008] The present invention is directed to a method and a system for realizing a fingerprint
technology, a data sending device, and a data receiving device, so as to avoid fingerprint
calculation for data items with short length and undesired data transmission during
the DS. Therefore, the efficiency of the DS is improved.
[0009] In an embodiment, the present invention provides a method for realizing a fingerprint
technology, which includes the following steps.
[0010] Whether a corresponding fingerprint needs to be generated according to a data item
is determined based on preset rules.
[0011] If it is determined that the corresponding fingerprint needs to be generated according
to the data item, fingerprint calculation is performed for the data item, and an obtained
fingerprint is sent to a data receiver. If it is determined that the corresponding
fingerprint does not need to be generated a data element is sent to the data receiver.
[0012] In an embodiment, the present invention further provides a method for realizing a
fingerprint technology, which includes the following steps.
[0013] A data item is received from a data sender.
[0014] Whether the data item is a fingerprint or a data element is determined based on preset
rules. If the data item is a fingerprint, the fingerprint is compared with a stored
fingerprint, and subsequent processes are implemented according to a comparison result.
If the data item is a data element, the data element is compared with a stored data
element, and subsequent processes are implemented according to a comparison result.
[0015] In an embodiment, the present invention further provides a data sending device, which
includes a determining module, a fingerprint calculating module, and a data sending
module.
[0016] The determining module is configured to determine whether a length value of a sent
data item is greater than or equal to a preset minimum length value.
[0017] The fingerprint calculating module is configured to generate a corresponding fingerprint
according to the data item when the determining module determines that the length
value of the data item is greater than or equal to the preset minimum length value.
[0018] The data sending module is configured to send the fingerprint generated by the fingerprint
calculating module to a data receiving device; or send a data element to the data
receiving device when the determining module determines that the length value of the
data item is smaller than the preset minimum length value.
[0019] Accordingly, in an embodiment, the present invention further provides a data receiving
device, which includes a data storing module, a data receiving module, a data determining
module, and a data processing module.
[0020] The data storing module is configured to store a data element or a fingerprint, in
which the data element or fingerprint is compared with a received data element or
fingerprint, so as to determine whether the received data element or fingerprint is
changed.
[0021] The data receiving module is configured to receive a data item sent by a data sending
device.
[0022] The data determining module is configured to determine whether the data item received
by the data receiving module is a fingerprint or a data element based on preset rules.
[0023] The data processing module is configured to compare the fingerprint with a stored
fingerprint when the data determining module determines that the received data item
is the fingerprint, and implement subsequent processes according to a comparison result;
or to compare the data element with stored data when the data determining module determines
that the received data item is the data element, and implement subsequent processes
according to a comparison result.
[0024] In an embodiment, the present invention further provides a system for realizing a
fingerprint technology, which includes a data sending device and a data receiving
device.
[0025] The data sending device is configured to determine whether a corresponding fingerprint
needs to be generated according to a data item based on preset rules. If it is determined
that the corresponding fingerprint needs to be generated according to the data item,
fingerprint calculation is performed for the data item, and an obtained fingerprint
is sent to a data receiving device. If it is determined that the corresponding fingerprint
does not need to be generated, a data element is sent to the data receiving device.
[0026] The data receiving device is configured to receive the data item from the data sending
device, and determine whether the data item is a fingerprint or a data element based
on the preset rules. If the data item is a fingerprint, the fingerprint is compared
with a stored fingerprint, and subsequent processes are implemented according to a
comparison result. If the data item is a data element, the data element is compared
with a stored data element, and subsequent processes are implemented according to
a comparison result.
[0027] The embodiments of the present invention have the following beneficial effects.
[0028] By presetting a minimum length value for the data that requires fingerprint calculation,
whether a fingerprint needs to be generated for the data item is determined, and whether
the fingerprint or the data item is sent is determined accordingly. In this way, fingerprint
calculation for data items with short length and undesired data transmission during
the DS are avoided, and therefore, the efficiency of the DS is improved.
BRIEF DESCRIPTION OF THE DRAWINGS
[0029] To make the technical solution under the present invention clearer, the accompanying
drawings for illustrating the embodiments of the present invention or the prior art
are outlined below. Apparently, the accompanying drawings are for the exemplary purpose
only, and person having ordinary skill in the art can derive other drawings from such
accompanying drawings without any creative effort.
FIG. 1 is a schematic flow chart of realizing a fingerprint technology in the prior
art;
FIG. 2 is a schematic flow chart of a method for realizing a fingerprint technology
according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a system for realizing a fingerprint technology
according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a data sending device according to an
embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a data receiving device according to an
embodiment of the present invention; and
FIG. 6 is a schematic structural diagram of a data processing module in the data receiving
device as shown in FIG. 5.
DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] The following detailed description is directed to the technical solution of the present
invention with reference to the accompanying drawings. However, the embodiments to
be described are only some embodiments of the present invention. Person having ordinary
skill in the art can derive other embodiments from the embodiments given herein without
making any creative effort, and all such embodiments are covered in the protection
scope of the present invention.
[0031] In the embodiments, the present invention provides a method and a system for realizing
a fingerprint technology, a data sending device, and a data receiving device, so as
to avoid fingerprint calculation for data items with short length and undesired data
transmission during the DS, and improve the efficiency of the DS.
[0032] FIG. 2 is a schematic flow chart of a first embodiment for realizing a fingerprint
technology according to the present invention.
[0033] The embodiment of the present invention is described by taking a client and a server
as two sides of the communication, that is, the client serves as a data sender, and
the server serves as a data receiver.
[0034] Firstly, a minimum length value is preset on the client, and is indicated by an identification
FPLimit. FPLimit is integer data, which indicates that fingerprint calculation is
performed for a data item only when the length of the data item is longer than or
equal to a length specified by FPLimit. If FPLimit does not exist, fingerprint calculation
is performed for all the data items. The identification is stored in Device Info,
which is related to a device, and Schema is similar to:
<xs: element name ="FPLimit" type ="xs:int" minOccurs="0" />
[0035] The identification may also be stored in DS MO, and at this time, a newly-added tree
structure in DS MO is as follows.

A minimum length of the data item that requires fingerprint calculation is recorded
in FPLimit.
<x>/FP
| State |
Occurrence
number |
Format |
Access
mode |
| Needed |
1 |
Node |
Acquire |
<x>/FP is an intermediate node, which records fingerprint-related information of the
DS client.
<x>/FP/FPLimit
| State |
Occurrence
number |
Format |
Access
mode |
| Needed |
0 or 1 |
Integer |
Acquire |
The node, <x>/FP/FPLimit, defines the minimum length of the data item that requires
fingerprint calculation during the DS process.
[0036] In step 100, the client sends PKG 1 to the server. PKG 1 is an initial package, which
carries information of synchronous negotiation parameters, including synchronous direction,
synchronous behavior, ID validity, ChangeLog validity, and so on. It is well known
to persons skilled in the art, and the details will not be given herein again. In
the embodiment of the present invention, PKG 1 sent by the client to the server further
includes FPlimit.
[0037] In step 101, the server receives PKG 1 and stores FPLimit. After determining based
on preset rules, the server returns agreed or changed synchronous parameters, including
synchronous direction, synchronous behavior, ID validity, ChangeLog validity, and
so on, and indicates the client to send the data item.
[0038] In step 102, the client determines whether the length value of the sent data item
is greater than or equal to the preset minimum length value according to the indication
of the server and the preset minimum length value of the data. If the length value
of the sent data item is greater than or equal to the preset minimum length value,
a corresponding fingerprint is generated according to the data item, that is, fingerprint
calculation is performed for the data item, and the obtained fingerprint with a preset
fingerprint length is sent to the server. If the length value of the sent data item
is smaller than the preset minimum length value, the data element (that is, the data
item) is sent to the server. If the length of the data item is equal to the preset
fingerprint length, zeros are added to the data item to make its length value equal
to the preset minimum length value, and then the data item is sent to the server.
[0039] After the server receives the data item from the client, if the length of the received
data item is shorter than the preset fingerprint length, or is longer than the preset
fingerprint length and shorter than the preset minimum length value, it can be directly
determined that it is a data item, that is, the data element, and is directly compared
with data stored on the server. If the data length is the preset fingerprint length,
the data item is compared with the fingerprint. If the data length is the preset minimum
length value, the data item is truncated to the preset fingerprint length value, and
is directly compared with the data stored on the server.
[0040] The data item determined to be the data element is compared with the data item stored
on the server. If the two data items are the same, it indicates that the data on the
server and the data on the client are the same, and the client does not need to send
the data. If the two data items are different, it indicates that the data is changed.
At this time, a collision detection strategy is checked, and if the strategy is based
on the data on the server, the server does not need to update the data either. If
the strategy is based on the data on the client, the server updates the stored data
according to the data item sent by the client.
[0041] The data item determined to be the fingerprint is compared with the fingerprint on
the server, and subsequent processes are implemented. If the two data items are the
same, it indicates that the data on the server and the data on the client are the
same, and the terminal does not need to send the data. If the two data items are different,
it indicates that the data is changed. At this time, a collision detection strategy
is checked, and if the strategy is based on the data on the server, the client does
not need to send the data either.
[0042] If the strategy is based on the data on the client, in step 103, the server indicates
the client to send a data item. In this manner, some unnecessary data transmission
can be avoided by comparing the fingerprints, and thus the traffic is saved.
[0043] Optionally, an identification FPFlag may be added to the data item sent by the client
to the server. FPFlag is an integer data. If FPFlag=0, it indicates that the data
item is to be sent. If FPflag≠0, it indicates that the fingerprint of the data item
is to be sent. Different values of FPFlag are adopted to identify different fingerprint
algorithms.
[0044] It should be noted that, the set of the fingerprint algorithms supported by both
the client and the server may be pre-determined through negotiation. In this case,
the newly-added structure in DS MO is as follows.

<x>/FP/<x>
| State |
Occurrence
number |
Format |
Access
mode |
| Needed |
One or more |
Node |
Acquire |
<x>/FP/<x>is an intermediate node, which records one or more fingerprint algorithms
supported by the DS client.
<x>/FP/<x>/Algorithm
| State |
Occurrence
number |
Format |
Access
mode |
| Needed |
1 |
Integer |
Acquire |
<x>/FP/<x>/Algorithm is a leaf node, which records the fingerprint algorithms supported
by the DS client. The following is the definitions of the numbers.
| Value |
Description |
| 1 |
Changed Log |
| 2 |
Changed Count |
| 3 |
Hash |
| 4 |
Fingerprint calculation is performed for partial data items (Sub-Item specific) |
Definitely, the information may also be stored in Device Info. The following is Schema
of a fingerprint generation algorithm:
<xs:element name="FPAlgorithm" type="xs:integer" />
The values are configured to indicate the types of the fingerprint algorithms, and
the definitions of the values may be the same as those in the above table.
[0045] It should be noted that, the client and the server select a sub-set of fingerprint
algorithms supported by both sides from the set of supported fingerprint algorithms
during the DS. When fingerprint calculation is needed for the data item on the client,
a fingerprint algorithm is selected from the sub-set to perform the calculation, and
is identified by FPFlag. The obtained fingerprint is sent to the server.
[0046] After receiving the data item from the client, the server determines whether the
data item is a fingerprint or a data item according to the identification FPFlag of
the data item. If the server receives a data item, the data item is compared with
the stored data item, and subsequent processes are implemented according to a comparison
result. If the two data items are the same, it indicates that the data on the server
and the data on the client are the same, and the server does not need to update the
data. If the two data items are different, it indicates that the data is changed.
At this time, a collision detection strategy is checked, and if the strategy is based
on the data on the server, the server does not need to update the data either. If
the strategy is based on the data on the client, the server updates the stored data
according to the data item sent by the client.
[0047] If the server receives a fingerprint, the server compares the received fingerprint
and the stored fingerprint, and subsequent processes are implemented according to
a comparison result. If the two fingerprints are the same, it indicates that the data
on the server and the data on the client are the same, and the terminal does not need
to send the data. If fingerprints are different, it indicates that the data is changed.
At this time, a collision detection strategy is checked, and if the strategy is based
on the data on the server, the client does not need to send the data either.
[0048] If the strategy is based on the data on the client, in step 103, the server indicates
an identification of the data element that needs to be sent by the client.
[0049] In step 104, the client sends the data element indicated by the server.
[0050] In step 105, the server returns information about a receiving state to the client,
and optionally, returns the changed data.
[0051] In step 106, the client returns a data receiving state to the client, and sends a
mapping command to the server.
[0052] In step 107, the server returns state information for the mapping command to the
client.
[0053] In step 108, the client returns a DS result to the user.
[0054] In the method for realizing a fingerprint technology provided in the embodiment of
the present invention, by presetting a minimum length value for the data that requires
fingerprint calculation, whether a corresponding fingerprint needs to be generated
for the data item is determined, and whether the fingerprint or the data item is sent
is determined accordingly. Moreover, an identification is set for each data item to
notify the receiver whether a fingerprint or a data item is sent, and to notify the
receiver of the used fingerprint algorithm. In this way, fingerprint calculation for
data items with short length and undesired data transmission during the DS are avoided,
and the efficiency of the DS is improved.
[0055] FIG. 2 is a schematic flow chart of a second embodiment for realizing a fingerprint
technology according to the present invention.
[0056] As shown in FIG. 2, it is assumed that the data in Table 1 needs to be sent on the
client, the fingerprint length after a fingerprint algorithm is 8 bytes, and FPLimit
is set to 20 bytes. The third column in Table 1 is fingerprint, and it should be noted
that fingerprint calculation is only performed for data items with a length longer
than or equal to FPLimit (20 bytes). It should be noted that, if the data item is
8 bytes, zeros are added to the data till it reaches 20 bytes. When the server finds
a data of 20 bytes, the data is directly truncated to 8 bytes, and is treated as a
data element.
Table 1
| LUID |
Data |
FingerPrint |
| 1012 |
Tom |
- |
| 1013 |
BEGIN:VCARD VERSION:2.1 EMAIL: [email protected] TEL;HOME:(123) 456-789 END:VCARD |
0xBDEFEOFFAAFFBBAA |
| 1014 |
Bike |
- |
| 1015 |
A File with length 10000 bytes |
0xAAEF3111577566DD |
| 1017 |
abcd.com |
abcd.com000000000000 |
[0057] In step 100, the client sends PKG 1 to the server. PKG 1 is an initial package, which
carries information of synchronous negotiation parameters, including synchronous direction,
synchronous behavior, ID validity, ChangeLog validity, and so on. It is well known
to persons skilled in the art, and the details will not be given herein again. In
the embodiment of the present invention, PKG 1 sent by the client to the server further
includes FPlimit.
Pkg#1:
<FPLimit> 20 </FPLimit>
[0058] In step 101, the server receives PKG 1 and stores FPLimit. After determining based
on preset rules, the server returns agreed or changed synchronous parameters.
[0059] In step 102, the client sends PKG 3, and according to Table 1, if a fingerprint is
found, the ID and the fingerprint are sent; if no fingerprint is found, the ID and
the data item are sent.
[0060] After the server receives PKG 3, if the length of the data in the received data item
is shorter than the fingerprint length (8 bytes), or is longer than 8 bytes and shorter
than 20 bytes, it can be directly determined that it is a data item, and is directly
compared with the data item stored on the server. If the data length is 8 bytes, the
data item is compared with the fingerprint stored on the server. If the length is
20 bytes, the data item is truncated to 8 bytes, and is directly compared with the
data item stored on the server.
[0061] Data items 1012 and 1014 may be determined as data items, and are compared with the
data items stored on the server. If the two data items are different, and the client
is superior in a collision strategy, subsequent processes can be directly performed,
and the server does not need to notify the client to send the two data items via PKG
4.
[0062] For a data item 1017 having a length of 20 bytes, the data item 1017 is truncated
to 8 bytes and then compared with the data item, and subsequent processes are implemented
afterwards. If the data items are the same, it indicates that the data on the server
and the data on the client are the same, and the server does not need to update the
data. If the data items are different, it indicates that the data is changed. At this
time, a collision detection strategy is checked, and if the strategy is based on the
data on the server, the server does not need to update the data either. If the strategy
is based on the data on the client, the server updates the stored data according to
the data item sent by the client.
[0063] For data items 1013 and 1015, since the length of the data in the data item is 8
bytes, the data item is compared with the fingerprints on the server, and subsequent
processes are implemented. If the fingerprints are the same, it indicates that the
data on the server and the data on the client are the same, and the terminal does
not need to send the data. If the fingerprints are different, it indicates that the
data is changed. At this time, a collision detection strategy is checked, and if the
strategy is based on the data on the server, the client does not need to send the
data either.
[0064] If the strategy is based on the data on the client, in step 103, the server indicates
the client to send the data item. In this manner, some unnecessary data transmission
can be avoided by comparing the fingerprints, and thus the traffic is saved.
[0065] The following steps are the same with those in the first embodiment, which is also
well known to persons skilled in the art, and the details will not be given herein
again.
[0066] FIG. 2 is a schematic structural view of a third embodiment for realizing a fingerprint
technology according to the present invention.
[0067] It is assumed that the data in Table 2 needs to be sent on the client. The third
column in Table 2 is an identification FPFlag, and the values in the column are set
by the device. "0" represents the data item, and the other values represent that fingerprints
are sent, and indicate different fingerprint algorithms. Table 3 shows a set of fingerprint
algorithms supported by a client and a server through negotiation.
Table 2
| LUID |
Data |
FPFlag |
| 1012 |
Tom |
0 |
| 1013 |
BEGIN:VCARD VERSION:2.1 EMAIL: [email protected] TEL;HOME:(123) 456-789 END:VCARD |
1 |
| 1014 |
Bike |
0 |
| 1015 |
A File with length 10000 bytes |
3 |
| 1017 |
abcd.com |
0 |
Table 3
| Value |
Description |
| 1 |
Changed Log |
| 2 |
Changed Count |
| 3 |
Hash |
| 4 |
Fingerprint calculation is performed for partial data items (Sub-Item specific) |
In step 100, the client sends PKG 1 to the server. PKG 1 is an initial package, which
carries information of synchronous negotiation parameters, including synchronous direction,
synchronous behavior, ID validity, ChangeLog validity, and so on. It is well known
to persons skilled in the art, and the details will not be given herein again.
Pkg#1:
<FPLimit> 20 </FPLimit>
[0068] In step 101, after determining based on preset rules, the server returns agreed or
changed synchronous parameters.
[0069] In step 102, the client sends PKG 3, which includes a data item. According to Table
2, if FPflag#0, fingerprint calculation is performed for the data item, and the ID
and the fingerprint are sent; if FPFlag=0, the ID and the data item are sent. It should
be noted that, the values of FPFlag are determined according to the result whether
the length value of the data item is greater than or equal to the preset minimum length.
[0070] After receiving PKG 3, the server determines that 1012, 1014, and 1017 receive the
data item according to the values of FPFlag. Comparing the data item with the one
stored on the server, if the two items are different and the client is superior in
a collision strategy, subsequent processes can be directly performed, and the server
does not need to notify the client to send data via PKG 4.
[0071] 1013 and 1015 receive fingerprints, in which 1013 receives a fingerprint obtained
through Change Log algorithm, and 1015 receives a fingerprint obtained through Hash
algorithm. Therefore, the fingerprint is compared with the one stored on the server,
and subsequent processes are implemented. If the two fingerprints are the same, it
indicates that the data on the server and the data on the client are the same, and
the terminal does not need to send the data. If the two fingerprints are different,
it indicates that the data is changed. At this time, a collision detection strategy
is checked, and if the strategy is based on the data on the server, the client does
not need to send the data either.
[0072] If the strategy is based on the data on the client, in step 103, the server indicates
the client to send the data item. In this manner, some unnecessary data transmission
can be avoided by comparing the fingerprints, and thus the traffic is saved.
[0073] The following steps are the same with those in the first embodiment, which is also
well known to persons skilled in the art, and the details will not be given herein
again.
[0074] FIG. 3 is a schematic structural diagram of a system for realizing a fingerprint
technology according to an embodiment of the present invention.
[0075] As shown in FIG. 3, the system includes a data sending device 1 and a data receiving
device 2.
[0076] The data sending device 1 is configured to determine whether a corresponding fingerprint
needs to be generated according to a data item based on preset rules. If it is determined
that the corresponding fingerprint needs to be generated according to the data item,
fingerprint calculation is performed for the data item, and an obtained fingerprint
is sent to the data receiving device 2. If it is determined that the corresponding
fingerprint does not need to be generated, a data element is sent to the data receiving
device 2.
[0077] Specifically, the data sending device 1 includes a determining module 10, a fingerprint
calculating module 11, and a data sending module 12, the structures and functions
of which will be described in detail below with FIG. 4.
[0078] The data receiving device 2 is configured to receive the data item from the data
sending device 1, and determine whether the data item is a fingerprint or a data element
based on the preset rules. If the data item is a fingerprint, the fingerprint is compared
with a stored fingerprint, and subsequent processes are implemented according to a
comparison result. If the data item is a data element, the data element is compared
with a stored data element, and subsequent processes are implemented according to
a comparison result.
[0079] Specifically, the data receiving device 2 includes a data storing module 20, a data
receiving module 21, a data determining module 22, and a data processing module 23,
the structures and functions of which will be described in detail below with FIG.
5.
[0080] FIG. 4 is a schematic structural diagram of the data sending device according to
an embodiment of the present invention.
[0081] The embodiment of the present invention is described by taking a client as the data
sending device.
[0082] As shown in FIG. 4, the client includes the determining module 10, the fingerprint
calculating module 11, and the data sending module 12.
[0083] The determining module 10 is configured to determine whether a length value of a
sent data item is greater than or equal to a preset minimum length value. It should
be noted that, the preset minimum length value on the server is indicated with an
identification FPLimit. FPLimit is an integer data, which indicates that a corresponding
fingerprint is generated according to the data item only when the length of the data
item is longer than or equal to a length specified by FPLimit.
[0084] The fingerprint calculating module 11 is configured to generate a corresponding fingerprint
according to the data item, that is, to perform fingerprint calculation for the data
item, when the determining module determines that the length value of the data item
is greater than or equal to the preset minimum length value. The set of fingerprint
algorithms supported by the client and the server may be determined through negotiation.
During the DS, the client and the server select a sub-set of fingerprint algorithms
supported by both sides from the set of supported fingerprint algorithms. When fingerprint
calculation is needed for the data item, a fingerprint algorithm is selected from
the sub-set to perform the fingerprint calculation, and an obtained fingerprint is
sent to the server.
[0085] The data sending module 12 is configured to send the fingerprint generated by the
fingerprint calculating module 11 to the data receiving device; or to send the data
item (that is, the data element) to the data receiving device when the determining
module 10 determines that the length value of the data item is smaller than the preset
minimum length value. If the length of the data item is equal to the preset fingerprint
length, zeros are added to the data item to make its length value equal to the preset
minimum length value FPLimit, and then the data item is sent to the data receiving
device. Herein, the data receiving device is a server.
[0086] Optionally, the data sending device (that is, the client 1) further includes an identifying
module 13, configured to add an identification FPFlag to the data item sent by the
data sending module 12 to the data receiving device. The identification FPFlag indicates
whether the data item is the fingerprint obtained through fingerprint calculation
or the data item.
[0087] The fingerprint calculating module 11 includes an algorithm negotiating unit 110,
an algorithm selecting unit 111, and a fingerprint calculating unit 112.
[0088] The algorithm negotiating unit 110 is configured to negotiate with the data receiving
device over the set of fingerprint algorithms supported by both sides. The set of
fingerprint algorithms supported by both sides through negotiation between the client
and the server is as shown in Table 3.
[0089] The algorithm selecting unit 111 is configured to select a fingerprint algorithm
from the set of fingerprint algorithms supported by both sides to calculate the data
item when fingerprint calculation needs to be performed for the data item.
[0090] The fingerprint calculating unit 112 is configured to perform fingerprint calculation
for the data item that needs to generate a fingerprint with the algorithm selected
by the algorithm selecting unit 111. An algorithm type of the data item when the fingerprint
calculation is performed is indicated by the identification.
[0091] FIG. 5 is a schematic structural diagram of the data receiving device according to
an embodiment of the present invention.
[0092] The embodiment of the present invention is described by taking a server as the data
receiving device.
[0093] As shown in FIG. 5, the server includes the data storing module 20, the data receiving
module 21, the data determining module 22, and the data processing module 23.
[0094] The data storing module 20 is configured to store data or a fingerprint, in which
the data or fingerprint is used to be compared with a received data element or fingerprint,
so as to determine whether the received data element or fingerprint is changed.
[0095] The data receiving module 21 is configured to receive a data item sent from the data
sending device (that is, the client).
[0096] The data determining module 22 is configured to determine whether the data item received
by the data receiving module 21 is a fingerprint or a data item. If the length of
the received data item is shorter than the preset fingerprint length, or is longer
than the preset fingerprint length and shorter than the preset minimum length value,
it can be directly determined that it is the data item, that is, the data element.
If the data length is the preset fingerprint length, it is determined that the data
item is a fingerprint. If the data length is the preset minimum length value, it is
determined that the data item is a data element (that is, the data item), and the
data item is truncated to the preset fingerprint length value, and directly compared
with the data stored in the data storing module 20.
[0097] It should be noted that, the set of the fingerprint algorithms supported by the client
and the server may be determined through negotiation. The client and the server select
a sub-set of fingerprint algorithms supported by both sides from the set of supported
fingerprint algorithms. When fingerprint calculation is needed for the data item,
a fingerprint algorithm is selected from the sub-set to perform the calculation, and
is optionally identified by FPFlag. The obtained fingerprint is sent to the server.
FPFlag is an integer data. If FPFlag=0, it indicates that the data item is to be sent.
If FPFlag≠0, it indicates that the fingerprint of the data item is to be sent. Different
values of FPFlag are adopted to identify different fingerprint algorithms.
[0098] The data processing module 23 is configured to compare the fingerprint with a stored
fingerprint when the data determining module 22 determines that the received data
item is the fingerprint, and subsequent processes are implemented according to a comparison
result. If the data item is a data element, the data element is compared with data
stored in the data storing module 20. If the length of the data item is the minimum
present length value, the data item is truncated to the preset fingerprint length
value and directly compared with the data stored in the data storing module 20, and
subsequent processes are implemented according to a comparison result.
[0099] FIG. 6 is a schematic structural diagram of the data processing module 23 in the
data receiving device 2 as shown in FIG. 5. As shown in FIG. 6, the data processing
module 23 includes a fingerprint processing unit 230 and a data processing unit 231.
[0100] The fingerprint processing unit 230 is configured to compare the fingerprint with
the one stored in the data storing module 20 when the data determining module 22 determines
that the data item received by the data receiving module 21 is a fingerprint, and
implement subsequent processes according to the comparison result.
[0101] The data processing unit 231 is configured to compare the data item with the data
stored in the data storing module 20 when the data determining module 22 determines
that the data item received by the data receiving module 21 is a data element (that
is, the data item), and implement subsequent processes according to the comparison
result.
[0102] The fingerprint processing unit 230 includes a fingerprint comparing sub-unit 2300.
[0103] The fingerprint comparing sub-unit 2300 is configured to compare the fingerprint
with the stored fingerprint when the data determining module 22 determines that the
received data item is the fingerprint. If the two fingerprints are the same, the data
stored in the data storing module 20 does not need to be updated; if the two fingerprints
are different, it indicates that the data item of the data sending device is changed.
[0104] The fingerprint processing unit 230 further includes a determining sub-unit 2301,
configured to check a collision detection strategy and determine whether the data
sending device needs to send the data item. If the collision detection strategy is
based on the data on the data receiving device, the data sending device does not need
to send the data item. If the collision detection strategy is based on the data on
the data sending device, the fingerprint processing unit 230 further includes an indicating
sub-unit 2302 and a data updating sub-unit 2303.
[0105] The indicating sub-unit 2302 is configured to indicate the data sending device to
send the data element.
[0106] The data updating sub-unit 2303 is configured to update the data stored in the data
storage unit 20 into the received data element.
[0107] The data processing unit 231 includes a data comparing sub-unit 2310.
[0108] The data comparing sub-unit 2310 is configured to compare the data element with the
data stored in the data storing module 20 when the data determining module 22 determines
that the received data item is a data element. If the two fingerprints are the same,
the data stored in the data storing module 20 does not need to be updated; if the
two fingerprints are different, it indicates that the data item of the data sending
device is changed.
[0109] The data processing unit 231 further includes a determining sub-unit 2311, configured
to check a collision detection strategy and determine whether the data sending device
needs to send the data item. If the collision detection strategy is based on the data
of the data receiving device, the data stored in the data storage device 20 does not
need to be updated. If the collision detection strategy is based on the data of the
data sending device, the data processing unit 231 further includes a data updating
sub-unit 2312.
[0110] The data updating sub-module 2312 is configured to update the data stored in the
data storage unit 20 into the received data element.
[0111] Through the descriptions of the preceding embodiments, those skilled in the art may
understand that the present invention may be implemented by hardware only or by software
and a necessary universal hardware platform. Based on such understandings, all or
part of the technical solution under the present invention that makes contributions
to the prior art may be essentially embodied in the form of a software product. The
software product may be stored in a storage medium, which can be a magnetic disk,
a Compact Disk Read-Only Memory (CD-ROM), a Read-Only Memory (ROM) or a Random Access
Memory (RAM). The software product includes a number of instructions that enable a
computer device (personal computer, server, or network device) to execute the methods
provided in the embodiments of the present invention.
[0112] In the method and system for realizing a fingerprint technology, the data sending
device, and the data receiving device provided in the embodiments of the present invention,
by presetting a minimum length for the data that requires fingerprint calculation,
whether a corresponding fingerprint needs to be generated for the data item is determined,
and whether the fingerprint or the data item is sent is determined accordingly. Moreover,
an identification is set for each data item to notify the receiver whether a fingerprint
or a data item is sent, and to notify the receiver of the used fingerprint algorithm.
In this way, fingerprint calculation for data items with short length and undesired
data transmission during the DS are avoided, and the efficiency of the DS is improved.
[0113] It should be noted that the above descriptions are merely preferred embodiments of
the present invention, and those skilled in the art may make various improvements
and refinements without departing from the spirit of the invention. All such modifications
and refinements are intended to be covered by the present invention.
1. A method for realizing a fingerprint technology, comprising:
determining whether a corresponding fingerprint needs to be generated according to
a data item based on preset rules; and
if it is determined that the corresponding fingerprint needs to be generated according
to the data item, fingerprint calculation is performed for the data item, and an obtained
fingerprint is sent to a data receiver; or if it is determined that the corresponding
fingerprint does not need to be generated according to the data item, a data element
is sent to the data receiver.
2. The method according to claim 1, wherein the determining whether the corresponding
fingerprint needs to be generated according to the data item based on the preset rules
comprises:
determining whether a length value of the data item is greater than or equal to a
preset minimum length value, and if the length value of the data item is greater than
or equal to the preset minimum length value, the corresponding fingerprint needs to
be generated according to the data item; or if the length value of the data item is
smaller than the preset minimum length value, the corresponding fingerprint does not
need to be generated according to the data item.
3. The method according to claim 2, wherein fingerprint calculation is performed for
the data item with a length value greater than or equal to the preset minimum length
value to obtain a fingerprint with a preset fingerprint length value; and as for the
data item with the preset fingerprint length value, zeros are added to the data item
till the length of the data item increases to the minimum length value.
4. The method according to any one of claims 1 to 3, wherein a data sender adds an identification
to the data item so as to indicate to the data receiver whether the data item is a
data element or a fingerprint.
5. The method according to claim 4, further comprising:
negotiating, by the data sender and the data receiver, over a set of fingerprint algorithms
supported by both sides; and
when fingerprint calculation needs to be performed for the data item, selecting, by
the data sender, a fingerprint algorithm from the set of fingerprint algorithms supported
by both sides to calculate the data item, wherein an algorithm type used in the fingerprint
calculation for the data item is indicated by the identification.
6. A method for realizing a fingerprint technology, comprising:
receiving a data item from a data sender; and
determining whether the data item is a fingerprint or a data element based on preset
rules, wherein if the data item is a fingerprint, the fingerprint is compared with
a stored fingerprint, and subsequent processes are implemented according to a comparison
result; or if the data item is a data element, the data element is compared with a
stored data element, and subsequent processes are implemented according to a comparison
result.
7. The method according to claim 6, wherein the determining whether the data item is
a fingerprint or a data element based on the preset rules comprises:
determining whether a length value of the data item is equal to a preset fingerprint
length value after fingerprint calculation, wherein if the length value of the data
item is equal to the preset fingerprint length value, it is determined that the data
item is the fingerprint obtained through fingerprint calculation; or if the length
value of the data item is unequal to the preset fingerprint length value, it is determined
that the data item is the data element.
8. The method according to claim 6, wherein the determining whether the data item is
a fingerprint or a data element based on the preset rules comprises:
determining whether the data item indicated by the identification carried in the data
item is the fingerprint obtained through fingerprint calculation or the data element,
wherein the identification also indicates an algorithm type of the fingerprint calculation
for the data item.
9. The method according to any one of claims 6 to 8, wherein the comparing the fingerprint
with the store fingerprint, and implementing subsequent processes according to the
comparison result comprises:
comparing the fingerprint with the stored fingerprint, wherein if the two fingerprints
are the same, the data stored by the data receiver does not need to be updated; or
if the two fingerprints are different, it indicates that the data item of the data
sender is changed, a collision detection strategy is checked, and whether the data
sender needs to send the data item is determined.
10. The method according to claim 9, wherein the checking the collision detection strategy
and determining whether the data sender needs to send the data item comprises:
checking the collision detection strategy, wherein if the strategy is based on the
data on the data receiver, it is determined that the data sender does not need to
send the data item; or if the strategy is based on the data on the data sender, it
is determined that the data sender needs to send the data item, and the data sender
is indicated to send the data item.
11. A data sending device, comprising:
a determining module, configured to determine whether a length value of a sent data
item is greater than or equal to a preset minimum length value;
a fingerprint calculating module, configured to generate a corresponding fingerprint
according to the data item when the determining module determines that the length
value of the data item is greater than or equal to the preset minimum length value;
and
a data sending module, configured to send the fingerprint generated by the fingerprint
calculating module to a data receiving device; or send a data element to the data
receiving device when the determining module determines that the length value of the
data item is smaller than the preset minimum length value.
12. The data sending device according to claim 11, further comprising:
an identifying module, configured to add an identification to the data item sent by
the data sending module, wherein the identification indicates whether the data item
is a fingerprint or a data element.
13. The data sending device according to claim 11 or 12, wherein the fingerprint calculating
module comprises:
an algorithm negotiating unit, configured to negotiate with the data receiving device
over a set of fingerprint algorithms supported by both sides;
an algorithm selecting unit, configured to select a fingerprint algorithm from the
set of fingerprint algorithms supported by both sides to calculate the data item when
fingerprint calculation needs to be performed for the data item; and
a fingerprint calculating unit, configured to perform fingerprint calculation for
the data item that needs to generate a fingerprint with the algorithm selected by
the algorithm selecting unit, wherein an algorithm type of the data item is indicated
by the identification when the fingerprint calculation is performed.
14. A data receiving device, comprising:
a data storing module, configured to store data or a fingerprint, wherein the data
or the fingerprint is used to be compared with a received data element or a received
fingerprint, so as to determine whether the received data element or the received
fingerprint is changed;
a data receiving module, configured to receive a data item sent by a data sending
device;
a data determining module, configured to determine whether the data item received
by the data receiving module is a fingerprint or a data element based on preset rules;
and
a data processing module, configured to compare the fingerprint with a stored fingerprint
when the data determining module determines that the received data item is a fingerprint,
and implement subsequent processes according to a comparison result; or to compare
the data element with stored data when the data determining module determines that
the received data item is a data element, and implement subsequent processes according
to a comparison result.
15. The data receiving device according to claim 14, wherein the data processing module
comprises:
a fingerprint processing unit, configured to compare the fingerprint with the stored
fingerprint when the data determining module determines that the received data item
is the fingerprint, and implement subsequent processes according to the comparison
result; and
a data processing unit, configured to compare the data element with the stored data
when the data determining module determines that the received data item is the data
element, and implement subsequent processes according to the comparison result.
16. The data receiving device according to claim 15, wherein the fingerprint processing
unit comprises:
a fingerprint comparing sub-unit, configured to compare the fingerprint with the stored
fingerprint when the data determining module determines that the received data item
is the fingerprint, wherein if the two fingerprints are the same, the data stored
in the data receiving device does not need to be updated; or if the two fingerprints
are different, it indicates that the data item of the data sending device is changed;
and
the fingerprint processing unit further comprises: a determining sub-unit, configured
to check a collision detection strategy and determine whether the data sending device
needs to send the data item, wherein if the collision detection strategy is based
on the data on the data receiving device, the data sending device does not need to
send the data item; or if the collision detection strategy is based on the data on
the data sending device, the fingerprint processing unit further comprises:
an indicating sub-unit, configured to indicate the data sending device to send the
data element; and
a data updating sub-unit, configured to update the stored data item into the received
data element.
17. The data receiving device according to claim 15 or 16, wherein the data processing
unit comprises:
a data comparing sub-unit, configured to compare the data element with the stored
data when the data determining module determines that the received data item is the
data element, wherein if the two data elements are the same, the data stored in the
data receiver does not need to be updated; or if the two data elements are different,
it indicates that the data item of the data sending device is changed; and
the data processing unit further comprises: a determining sub-unit, configured to
check the collision detection strategy and determine whether the data stored in the
data receiving device needs to be updated, wherein if the collision detection strategy
is based on the data on the data receiving device, the data on the data receiving
device does not need to be updated; or if the collision detection strategy is based
on the data on the data sending device, the data processing unit further comprises:
a data updating sub-unit, configured to update the data item stored in the data receiving
device into the received data.
18. A system for realizing a fingerprint technology, comprising:
a data sending device, configured to determine whether a corresponding fingerprint
needs to be generated according to a data item based on preset rules, wherein if it
is determined that the corresponding fingerprint needs to be generated according to
the data item, fingerprint calculation is performed for the data item, and an obtained
fingerprint is sent to a data receiving device; or if it is determined that the corresponding
fingerprint does not need to be generated , a data element is sent to the data receiving
device; and
the data receiving device, configured to receive the data item from the data sending
device, and determine whether the data item is a fingerprint or a data element based
on the preset rules, wherein if the data item is a fingerprint, the fingerprint is
compared with a stored fingerprint, and subsequent processes are implemented according
to a comparison result; or if the data item is a data element, the data element is
compared with a stored data element, and subsequent processes are implemented according
to a comparison result.