CN104915381A - Perceiving and rapid synchronizing method for data changing - Google Patents

Perceiving and rapid synchronizing method for data changing Download PDF

Info

Publication number
CN104915381A
CN104915381A CN201510250796.0A CN201510250796A CN104915381A CN 104915381 A CN104915381 A CN 104915381A CN 201510250796 A CN201510250796 A CN 201510250796A CN 104915381 A CN104915381 A CN 104915381A
Authority
CN
China
Prior art keywords
hash value
data
node
server
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510250796.0A
Other languages
Chinese (zh)
Inventor
姜晓丹
王双
吕翊
戴宇升
李学恩
林明
韩国权
黄海峰
李庆
袁双
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lianxin Yongtong Information Technology Co Ltd
Original Assignee
Beijing Lianxin Yongtong Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Lianxin Yongtong Information Technology Co Ltd filed Critical Beijing Lianxin Yongtong Information Technology Co Ltd
Priority to CN201510250796.0A priority Critical patent/CN104915381A/en
Publication of CN104915381A publication Critical patent/CN104915381A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a perceiving and rapid synchronizing method for data changing, and belongs to the technical field of computer instant messaging. The method comprises the steps that when data are changed, a server calculates an hash value of an attribute name sum value of the data; the server calculates an hash value of parent node data of the data; when parent nodes update the hash value, dictionary order sequencing is performed on all child nodes according to attribute names, then the attribute names and the hash value of the child nodes are combined into a character string, and an hash value of the character string is calculated; in this way, calculation is performed step by step until an hash value of a top node; a client side also calculates an own hash value in this way, the own hash value is compared with the hash value of the top node in the server after logging in, if the own hash value is in accordance with the hash value of the top node in the server, then the data are not changed, if the own hash value is not in accordance with the hash value of the top node in the server, an original value is acquired to be compared with the hash value of the top node in the server, the changed child node or changed attribute is found out, and a value corresponding to the child node is acquired and synchronized.

Description

A kind of data change the method for perception and Fast synchronization
Technical field
The present invention relates to a kind of method that user profile data difference alienation upgrades, be specifically related to a kind of method that data change perception and Fast synchronization, belong to computer instant communication technical field.
Background technology
In instantaneous communication system, a user has multiple equipment, need in user logs on equipment to get up-to-date personal information, comprise essential information (name, date of birth, post etc.), group information (group list, group's essential information, group member information etc.), friend information (buddy list, good friend's personal information etc.), white list information etc.In these information, individual essential information has active user to safeguard, and the personal information of a lot of information, particularly member such as group, good friend is safeguarded by other staff oneself; The associated metadata of personal information likely can carry out dynamic conditioning according to the development of business simultaneously; These information needs to carry out synchronously, keeping the consistance of data on all devices of active user.
In current instantaneous communication system, the renewal for personal information data mainly contains following several way:
1, update all, namely the backward server of client logs obtains up-to-date total data, comprises the essential information of personnel, group list belonging to these personnel, the members list of each group, the individual essential information of each group members, buddy list, the essential information etc. of good friend.
2. carry out differentiation renewal according to version number, namely obtain the latest edition of this people's information from server, and the change conditions of difference version between obtaining to server according to the version number of buffer memory on equipment, and the amendment of local data is carried out according to change conditions.
In two kinds of ways recited above, we can see that the benefit of the first way is to guarantee the consistance of data, but it is large but to there is synchrodata amount, if such as the base attribute of personnel has 20, amount to database about 200 byte; If these personnel have 20 groups (average each group 20 personnel, essential information about 300 byte of group) and 50 good friends, then about summary data amount size is about 100k byte, can be larger if add the data volumes such as white list.Can repeatedly synchrodata when unstable networks for mobile device, and each data volume add up can be very large.
The benefit of second method is if data volume can be much little when the data difference between client and server is little, if there is no data modification between twice synchronizing process, then synchronous data are exactly mainly version number information, data volume can be lacked a lot, comes lecture save a lot of flow information for mobile device.
But the problem of this method is the consistance being difficult to guarantee both data, no matter be server or client, if once data synchronization errors, then this data difference can not follow-up by process in revised, the accumulation inconsistent probability of data that gets up can obviously increase.
Summary of the invention
The object of the invention is the defect in order to overcome prior art, in order to solve data volume in data synchronization process and consistency problem, proposing a kind of method that data change perception and Fast synchronization.
Data change a method for perception and Fast synchronization, and implementation step is as follows:
Time step one, data change, server calculates the hash value of its attribute-name and value;
Step 2, server calculate the hash value of the parent node data of these data;
All child nodes, when renewal hash value, are first carried out lexcographical order sequence according to Property Name, then the hash value of the attribute-name of child node and child node are merged into a character string, and calculate its hash value by step 3, father node;
Step 4, in this way step by step calculation are to the hash value of top node;
Step 5, client also calculate the hash value of oneself in this way, and the top node hash value on this hash value and server are contrasted after the login, if hash value is consistent, illustrates that data do not change, comprise child node; If hash value is inconsistent, then obtains initial value and compare, finding out the child node or attribute that change, then obtain value corresponding to this child node and carry out synchronous.
Since then, after synchronous, the hash value between client and server is consistent, and data are also consistent simultaneously, and achieves the update mechanism of differentiation.
Beneficial effect:
1, the present invention is by the quick comparison to hash tree, and can carry out the location of difference node fast with synchronous, instead of carry out the comparison one by one of initial value for all nodes, therefore when big data quantity, data-handling efficiency is high,
2, owing to have employed hash tree, the change of any node can feed back on corresponding all father nodes, by synchronized algorithm of the present invention, ensure that hash sets conforming while, we also can ensure the consistance of data initial value.
Embodiment
The invention provides a kind of method that data change perception and Fast synchronization, implementation step is as follows:
Time step one, data change, server calculates the hash value of its attribute-name and value;
Step 2, server calculate the hash value of the parent node data of these data, such as, after have modified telephone number, also need the hash value thereupon upgrading these personnel;
All child nodes, when renewal hash value, are first carried out lexcographical order sequence according to Property Name, then the hash value of the attribute-name of child node and child node are merged into a character string, and calculate its hash value by step 3, father node;
Step 4, in this way step by step calculation are to the hash value of top node;
Step 5, client also calculate the hash value of oneself in this way, and the top node hash value on this hash value and server are contrasted after the login, if consistent, illustrate that data do not change, comprise child node; If hash value is inconsistent, then obtains initial value and compare, finding out the child node or attribute that change, then obtain value corresponding to this child node and carry out synchronous.
In sum, these are only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (1)

1. data change a method for perception and Fast synchronization, and it is characterized in that, performing step is as follows:
Time step one, data change, server calculates the hash value of its attribute-name and value;
Step 2, server calculate the hash value of the parent node data of these data;
All child nodes, when renewal hash value, are first carried out lexcographical order sequence according to Property Name, then the hash value of the attribute-name of child node and child node are merged into a character string, and calculate its hash value by step 3, father node;
Step 4, in this way step by step calculation are to the hash value of top node;
Step 5, client also calculate the hash value of oneself in this way, and the top node hash value on this hash value and server are contrasted after the login, if hash value is consistent, illustrates that data do not change, comprise child node; If hash value is inconsistent, then obtains initial value and compare, finding out the child node or attribute that change, then obtain value corresponding to this child node and carry out synchronous.
CN201510250796.0A 2015-05-18 2015-05-18 Perceiving and rapid synchronizing method for data changing Pending CN104915381A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510250796.0A CN104915381A (en) 2015-05-18 2015-05-18 Perceiving and rapid synchronizing method for data changing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510250796.0A CN104915381A (en) 2015-05-18 2015-05-18 Perceiving and rapid synchronizing method for data changing

Publications (1)

Publication Number Publication Date
CN104915381A true CN104915381A (en) 2015-09-16

Family

ID=54084444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510250796.0A Pending CN104915381A (en) 2015-05-18 2015-05-18 Perceiving and rapid synchronizing method for data changing

Country Status (1)

Country Link
CN (1) CN104915381A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046155A (en) * 2018-12-07 2019-07-23 阿里巴巴集团控股有限公司 The update of property data base, data characteristics determination method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930442A (en) * 2009-06-24 2010-12-29 侯方勇 Node updating method of Hash tree
CN102428464A (en) * 2009-06-30 2012-04-25 国际商业机器公司 Marking sought after content items on network media devices
CN102693302A (en) * 2012-05-21 2012-09-26 浙江省公众信息产业有限公司 Quick file comparison method, system and client side
CN103902617A (en) * 2012-12-28 2014-07-02 华为技术有限公司 Distributed database synchronization method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930442A (en) * 2009-06-24 2010-12-29 侯方勇 Node updating method of Hash tree
CN102428464A (en) * 2009-06-30 2012-04-25 国际商业机器公司 Marking sought after content items on network media devices
CN102693302A (en) * 2012-05-21 2012-09-26 浙江省公众信息产业有限公司 Quick file comparison method, system and client side
CN103902617A (en) * 2012-12-28 2014-07-02 华为技术有限公司 Distributed database synchronization method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110046155A (en) * 2018-12-07 2019-07-23 阿里巴巴集团控股有限公司 The update of property data base, data characteristics determination method, device and equipment
CN110046155B (en) * 2018-12-07 2023-06-20 创新先进技术有限公司 Method, device and equipment for updating feature database and determining data features

Similar Documents

Publication Publication Date Title
CN105528294B (en) The method and system that a kind of interface testing use-case automatically generates
CN106325933B (en) Batch data synchronous method and device
US20150278030A1 (en) Distributed Database Synchronization Method and System
CN102054035B (en) Data range-based method for synchronizing data in database
CN107977396B (en) Method and device for updating data table of KeyValue database
CN107528872B (en) Data recovery method and device and cloud storage system
WO2015192661A1 (en) Method, device, and system for data synchronization in distributed storage system
CN104134173A (en) Main and distribution network graph/model/data integrated system based on remote retrieval and information interaction
US20180004762A1 (en) User discovery in a location-based messaging platform
US20130218837A1 (en) Cloud data synchronization with local data
CN104967658A (en) Data synchronization method on multiple devices
CN106599104A (en) Mass data association method based on redis cluster
US20160246837A1 (en) Methods, apparatuses and computer program products for enabling intelligent merging of modified data
US20170193070A1 (en) System and method for a distributed replication lock for active-active geo-redundant systems
US20190012362A1 (en) Method and apparatus for processing information
US20170060922A1 (en) Method and device for data search
CN105635215B (en) Synchronous method, device and the Cloud Server of contact information
CN105915636B (en) A kind of synchronous method and device of contact information
Jannes et al. OWebSync: Seamless synchronization of distributed web clients
Choi et al. Improving database system performance by applying NoSQL
CN104283932A (en) File synchronization system and method
CN104915381A (en) Perceiving and rapid synchronizing method for data changing
US9323780B2 (en) Locale-based sorting on mobile devices
CN103812912B (en) A kind of method and device of maintenance organization structural information
Azim et al. Offsite 2-Way Data Replication toward Improving Data Refresh Performance

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
DD01 Delivery of document by public notice

Addressee: BEIJING LIANXIN YONGTONG INFORMATION TECHNOLOGY Co.,Ltd.

Document name: Notification of Publication of the Application for Invention

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150916

WD01 Invention patent application deemed withdrawn after publication
DD01 Delivery of document by public notice

Addressee: He Wei

Document name: Deemed withdrawal notice

DD01 Delivery of document by public notice