CN106055559A - Data synchronization method and data synchronization device - Google Patents
Data synchronization method and data synchronization device Download PDFInfo
- Publication number
- CN106055559A CN106055559A CN201610325706.4A CN201610325706A CN106055559A CN 106055559 A CN106055559 A CN 106055559A CN 201610325706 A CN201610325706 A CN 201610325706A CN 106055559 A CN106055559 A CN 106055559A
- Authority
- CN
- China
- Prior art keywords
- data
- master data
- version number
- serial number
- variance
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The invention provides a data synchronization method and a data synchronization device. The method comprises the steps that whether main data is changed is monitored; if any change is monitored, discrepant data existing before and after the data change is determined according to a version number and a sequence number of the main data, wherein the version number denotes compatibility of the data, and the sequence number denotes a length of the data; and the discrepant data is sent to a data synchronization node for data synchronization. The data synchronization method and the data synchronization device provided by the invention support discrepant data transmission; a client slide can obtain the discrepant data without polling, and a server can implement active pushing; and built-in compression is supported, so that a data transmission quantity is reduced, and concurrence is enhanced.
Description
Technical field
The invention belongs to data processing field, particularly relate to a kind of method of data synchronization and device.
Background technology
The data base of main flow on line at present, obtains as Redis can only do full dose, therefore when data base changes, with
Its other nodes synchronized need again full dose to obtain renewal, cause data volume big, take a large amount of Internet resources;And it is existing
After data base changes, actively data base will not be pushed to other synchronous nodes, but need each node to take turns
Ask and obtain.
Summary of the invention
In view of this, in order to solve to need full dose to obtain after prior art exists database update, and do not support to push away
The problem sending function, the purpose of the present invention is to propose to a kind of method of data synchronization.For some aspects to the embodiment disclosed
There is a basic understanding, shown below is simple summary.This summarized section is not extensive overview, is not pass to be determined
Key/important composition element or describe the protection domain of these embodiments.Its sole purpose is that to present some by simple form general
Read, in this, as the preamble of following detailed description.
In some optional embodiments, described method of data synchronization, including:
Whether monitoring master data changes;Change if monitoring, then:
Version number according to described master data and serial number, determine the variance data before and after data variation;Wherein, described version
This number compatibility representing data, described serial number represents the length of data;
Described variance data is sent to data syn-chronization node, so that it carries out data syn-chronization.
Another object of the present invention is to provide a kind of data synchronization unit;
In some optional embodiments, described data synchronization unit, including:
Monitoring means, is used for monitoring whether master data changes;Change if monitoring, then:
Variance data determines unit, for the version number according to described master data and serial number, before and after determining data variation
Variance data;Wherein, described version number represents that the compatibility of data, described serial number represent the length of data;
Lock unit, for being sent to data syn-chronization node by described variance data, so that it carries out data syn-chronization.
Use above-described embodiment, can reach following effect:
1, variance data transmission is supported;
2, client obtains variance data without poll, and server can active push;
3, support built-in compression, reduce volume of transmitted data, improve concurrent.
For above-mentioned and relevant purpose, one or more embodiments include will be explained in below and in claim
In the feature that particularly points out.Description below and accompanying drawing describe some illustrative aspects in detail, and its instruction is only
Some modes in the utilizable various modes of principle of each embodiment.Other benefit and novel features will along with under
The detailed description in face is considered in conjunction with the accompanying and becomes obvious, the disclosed embodiments be intended to include all these aspect and they
Equivalent.
Accompanying drawing explanation
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes the part of the application, this
Bright schematic description and description is used for explaining the present invention, is not intended that inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 shows the schematic flow sheet of a kind of method of data synchronization of the embodiment of the present invention;
Fig. 2 shows the functional block diagram of a kind of data synchronization unit of the embodiment of the present invention.
Detailed description of the invention
The following description and drawings illustrate specific embodiments of the present invention fully, to enable those skilled in the art to
Put into practice them.Other embodiments can include structure, logic, electric, process and other change.Implement
Example only represents possible change.Unless explicitly requested, otherwise individually components and functionality is optional, and the order operated can
With change.The part of some embodiments and feature can be included in or replace part and the feature of other embodiments.This
The scope of the embodiment of invention includes the gamut of claims, and all obtainable equivalent of claims
Thing.In this article, these embodiments of the present invention can be represented by " inventing " individually or generally with term, and this is only
For convenience, and if in fact disclose the invention more than, it is not meant to automatically limit this application in the range of appointing
What single invention or inventive concept.
Fig. 1 shows the schematic flow sheet of a kind of method of data synchronization of the embodiment of the present invention;As it is shown in figure 1, described method
Including:
Step S101, whether monitoring master data changes;Change if monitoring, then:
Step S102, according to version number and the serial number of described master data, determines the variance data before and after data variation;Its
In, described version number represents that the compatibility of data, described serial number represent the length of data;
Step S103, is sent to data syn-chronization node by described variance data, so that it carries out data syn-chronization;
Described method can apply to big concurrent network multinode data synchronization server, the data of main flow in prior art
When the data of storehouse such as Redis change, full dose is needed to transmit when data syn-chronization, it is impossible to realize Diversity Transmit, and service
Active push do not supported by device, needs clients poll to obtain data;By said method, this node is actively monitored master data and is become
Change, and by judging that version number and two marks of serial number determine that data there occurs that essence changes or there occurs that increment changes
Become, still increase data newly so that it is determined that variance data is full dose data, then actively variance data is transferred to data syn-chronization joint
Point, whole process is succinctly efficient, reduces bandwidth occupancy, high concurrent;
In some optional embodiments, the amendment mode of described master data includes replacing and newly-increased two kinds;
If described master data being carried out the operation of described replacement, then: described version number, or, described version number and described sequence
Row number change;
If described master data to be carried out described newly-increased operation, then: described version number is constant, described serial number increment;
In some optional embodiments, the operation whether described monitoring master data changes, including:
Whether version number and the serial number of monitoring described master data change;If both does not changes, the most described master data is not
Change;If changing, then trigger the operation determining described variance data;
In some optional embodiments, the described version number according to described master data and serial number, determine data variation
The operation of variance data front and back, including:
Judge whether described version number changes;The most described variance data is the full dose of described master data;If it is not, then:
Judge whether described serial number rises in value;The most described variance data is the newly-increased data of described master data, and root
According to the increment of described serial number, described master data determines newly-increased data waiting for transmission;
In some optional embodiments, the described operation that described variance data is sent to data syn-chronization node, including:
The information of the described data syn-chronization node according to record, by described master data full dose or the newly-increased number of described master data
According to compressing and being sent to described data syn-chronization node;
During described transmission data, also carry the described version number and/or described serial number changed.
Following example give specific embodiment, and described method of data synchronization is applied to big concurrent network multinode
Data synchronization server, in big concurrent network, book server can provide data synchronization service to multiple network nodes, works as master
When data change, quickly can push corresponding variance data to the network node that local terminal synchronizes;
Concrete design is as follows:
It is possible, firstly, to the master data of this node is arranged version number version and two parameter marks of serial number sequence
Know;Wherein, the compatibility before and after version mark master data change, such as: master data is AB, version=1;If master data
Become ABC, then master data simply there occurs the increase of length, then version is constant;If master data becomes AA, then main
Data there occurs essential change, then version becomes 2.Sequence represents the length of data, if master data there occurs length
Newly-increased, then this value increases corresponding quantity, if master data there occurs the change of essence, then this value record is the data after changing
Length, such as: master data is AB, sequence=2, if master data becomes ABCD, then seuqence=4, if master data
Become AA, then sequence is constant;
Secondly, when master data there occurs that change, amendment data can be two kinds, and one is to replace replace operation, Yi Zhongshi
Newly-increased append operation, disapproves and inserts in the middle of data.Every time after append, sequence is that the data after increasing data are long
Degree, version does not changes;If version change after replace, sequence is data length;
3rd, by judging the change of two parameters of version and sequence, it may be determined that optimal synchrodata
Scheme, i.e. determines variance data;If sequence is for increasing, version is constant, the most only carries out newly-increased part data together
Step;If version changes, then need to synchronize master data entirety;
4th, according to the information of described data syn-chronization node of record, by the variance data active push that determines to described
Node, and in transmitting procedure, add compression mark, data are compressed, reduce bandwidth occupancy.
Fig. 2 shows the functional block diagram of a kind of data synchronization unit of the embodiment of the present invention;Described data syn-chronization fills
Put 200, including:
Monitoring means 201, is used for monitoring whether master data changes;Change if monitoring, then:
Variance data determines unit 201, for the version number according to described master data and serial number, before determining data variation
After variance data;Wherein, described version number represents that the compatibility of data, described serial number represent the length of data;
Lock unit 203, for being sent to data syn-chronization node by described variance data, so that it carries out data syn-chronization;
In some optional examples, the amendment mode of described master data includes replacing and newly-increased two kinds;
If described master data being carried out the operation of described replacement, then: described version number, or, described version number and described sequence
Row number change;
If described master data to be carried out described newly-increased operation, then: described version number is constant, described serial number increment;
In some optional examples, described monitoring means 201, including:
Whether monitoring subelement 2011, change for the version number and serial number monitoring described master data;If both is not
Changing, the most described master data does not changes;If changing, then trigger the operation determining described variance data;
In some optional examples, described variance data determines unit 202, including:
First judging unit 2021, is used for judging whether described version number changes;The most described variance data is described
The full dose of master data;If it is not, then:
Second judging unit 2022, is used for judging whether described serial number rises in value;The most described variance data is described
The newly-increased data of master data, and according to the increment of described serial number, described master data determines newly-increased data waiting for transmission;
In some optional examples, described lock unit 203, including:
Synchronize subelement 2031, for the information of the described data syn-chronization node according to record, by described master data full dose
Or the newly-increased data compression of described master data be sent to described data syn-chronization node;
Send during data at described synchronization subelement, also carry the described version number changed and/or described
Serial number.
In sum, use method of data synchronization of the present invention and device, may be such that
1, variance data transmission is supported;
2, client obtains variance data without poll, and server can active push;
3, support built-in compression, reduce volume of transmitted data, improve concurrent.
It should also be appreciated by one skilled in the art that and the foregoing is only the preferred embodiments of the present invention, be not used to
Limiting the present invention, for a person skilled in the art, the present invention can have various modifications and variations.All essences in the present invention
Within god and principle, any modification, equivalent substitution and improvement etc. made, should be included within the scope of the present invention.
Claims (10)
1. a method of data synchronization, it is characterised in that including:
Whether monitoring master data changes;Change if monitoring, then:
Version number according to described master data and serial number, determine the variance data before and after data variation;Wherein, described version number
Representing the compatibility of data, described serial number represents the length of data;
Described variance data is sent to data syn-chronization node, so that it carries out data syn-chronization.
2. the method for claim 1, it is characterised in that the amendment mode of described master data includes replacing and increasing two newly
Kind;
If described master data being carried out the operation of described replacement, then: described version number, or, described version number and described serial number
Change;
If described master data to be carried out described newly-increased operation, then: described version number is constant, described serial number increment.
3. method as claimed in claim 2, it is characterised in that the operation whether described monitoring master data changes, including:
Whether version number and the serial number of monitoring described master data change;If both does not changes, the most described master data does not changes;
If changing, then trigger the operation determining described variance data.
4. method as claimed in claim 2, it is characterised in that the described version number according to described master data and serial number, really
The operation of the variance data before and after given data change, including:
Judge whether described version number changes;The most described variance data is the full dose of described master data;If it is not, then:
Judge whether described serial number rises in value;The most described variance data is the newly-increased data of described master data, and according to institute
State the increment of serial number, described master data determines newly-increased data waiting for transmission.
5. method as claimed in claim 4, it is characterised in that described described variance data is sent to data syn-chronization node
Operation, including:
The information of the described data syn-chronization node according to record, by described master data full dose or the newly-increased data pressure of described master data
Contract and be sent to described data syn-chronization node;
During described transmission data, also carry the described version number and/or described serial number changed.
6. a data synchronization unit, it is characterised in that including:
Monitoring means, is used for monitoring whether master data changes;Change if monitoring, then:
Variance data determines unit, for the version number according to described master data and serial number, determines the difference before and after data variation
Heteromerism evidence;Wherein, described version number represents that the compatibility of data, described serial number represent the length of data;
Lock unit, for being sent to data syn-chronization node by described variance data, so that it carries out data syn-chronization.
7. device as claimed in claim 6, it is characterised in that the amendment mode of described master data includes replacing and increasing two newly
Kind;
If described master data being carried out the operation of described replacement, then: described version number, or, described version number and described serial number
Change;
If described master data to be carried out described newly-increased operation, then: described version number is constant, described serial number increment.
8. device as claimed in claim 7, it is characterised in that described monitoring means, including:
Whether monitoring subelement, change for the version number and serial number monitoring described master data;If both does not changes, then institute
State master data not change;If changing, then trigger the operation determining described variance data.
9. device as claimed in claim 7, it is characterised in that described variance data determines unit, including:
First judging unit, is used for judging whether described version number changes;The most described variance data is described master data
Full dose;If it is not, then:
Second judging unit, is used for judging whether described serial number rises in value;The most described variance data is described master data
Newly-increased data, and according to the increment of described serial number, described master data determines newly-increased data waiting for transmission.
10. device as claimed in claim 9, it is characterised in that described lock unit, including:
Synchronize subelement, for the information of the described data syn-chronization node according to record, by described master data full dose or described master
The newly-increased data compression of data is also sent to described data syn-chronization node;
During described synchronization subelement sends data, also carry the described version number and/or described sequence changed
Number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610325706.4A CN106055559A (en) | 2016-05-17 | 2016-05-17 | Data synchronization method and data synchronization device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610325706.4A CN106055559A (en) | 2016-05-17 | 2016-05-17 | Data synchronization method and data synchronization device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106055559A true CN106055559A (en) | 2016-10-26 |
Family
ID=57177051
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610325706.4A Pending CN106055559A (en) | 2016-05-17 | 2016-05-17 | Data synchronization method and data synchronization device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106055559A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106603640A (en) * | 2016-12-05 | 2017-04-26 | 北京中交兴路信息科技有限公司 | Data synchronizing method and device |
CN108183965A (en) * | 2018-01-15 | 2018-06-19 | 郑州云海信息技术有限公司 | A kind of method of data synchronization, device, equipment, system and readable storage medium storing program for executing |
CN108733680A (en) * | 2017-04-14 | 2018-11-02 | 徐州瑞晨矿业科技发展有限公司 | A method of engineering drawing is carried out based on vector figure data and is remotely shared |
CN108924206A (en) * | 2018-06-26 | 2018-11-30 | 郑州云海信息技术有限公司 | A kind of cluster event synchronizing method, device and the equipment of distributed system |
CN110019504A (en) * | 2017-09-13 | 2019-07-16 | 北京国双科技有限公司 | Method of data synchronization and device |
CN110750546A (en) * | 2019-10-21 | 2020-02-04 | 中国民航信息网络股份有限公司 | Database updating method and device |
CN110769053A (en) * | 2019-10-21 | 2020-02-07 | 深圳震有科技股份有限公司 | Data pushing method, system and storage medium |
CN110795288A (en) * | 2019-11-06 | 2020-02-14 | 杭州复杂美科技有限公司 | Data acquisition method, device and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103002010A (en) * | 2012-10-29 | 2013-03-27 | 北京奇虎科技有限公司 | Method, device and system for updating data based on incremental data |
CN103490937A (en) * | 2013-10-12 | 2014-01-01 | 北京奇虎科技有限公司 | Method and device for filtering monitoring data |
CN103581231A (en) * | 2012-07-25 | 2014-02-12 | 腾讯科技(北京)有限公司 | UGC primary standby data synchronization method and system thereof |
-
2016
- 2016-05-17 CN CN201610325706.4A patent/CN106055559A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581231A (en) * | 2012-07-25 | 2014-02-12 | 腾讯科技(北京)有限公司 | UGC primary standby data synchronization method and system thereof |
CN103002010A (en) * | 2012-10-29 | 2013-03-27 | 北京奇虎科技有限公司 | Method, device and system for updating data based on incremental data |
CN103490937A (en) * | 2013-10-12 | 2014-01-01 | 北京奇虎科技有限公司 | Method and device for filtering monitoring data |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106603640A (en) * | 2016-12-05 | 2017-04-26 | 北京中交兴路信息科技有限公司 | Data synchronizing method and device |
CN108733680A (en) * | 2017-04-14 | 2018-11-02 | 徐州瑞晨矿业科技发展有限公司 | A method of engineering drawing is carried out based on vector figure data and is remotely shared |
CN110019504A (en) * | 2017-09-13 | 2019-07-16 | 北京国双科技有限公司 | Method of data synchronization and device |
CN110019504B (en) * | 2017-09-13 | 2021-01-22 | 北京国双科技有限公司 | Data synchronization method and device |
CN108183965A (en) * | 2018-01-15 | 2018-06-19 | 郑州云海信息技术有限公司 | A kind of method of data synchronization, device, equipment, system and readable storage medium storing program for executing |
CN108924206A (en) * | 2018-06-26 | 2018-11-30 | 郑州云海信息技术有限公司 | A kind of cluster event synchronizing method, device and the equipment of distributed system |
CN110750546A (en) * | 2019-10-21 | 2020-02-04 | 中国民航信息网络股份有限公司 | Database updating method and device |
CN110769053A (en) * | 2019-10-21 | 2020-02-07 | 深圳震有科技股份有限公司 | Data pushing method, system and storage medium |
CN110769053B (en) * | 2019-10-21 | 2022-04-19 | 深圳震有科技股份有限公司 | Data pushing method, system and storage medium |
CN110795288A (en) * | 2019-11-06 | 2020-02-14 | 杭州复杂美科技有限公司 | Data acquisition method, device and storage medium |
CN110795288B (en) * | 2019-11-06 | 2023-02-10 | 杭州复杂美科技有限公司 | Data acquisition method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106055559A (en) | Data synchronization method and data synchronization device | |
CN103442042B (en) | Incremental data synchronization method and system | |
CN103369051B (en) | A kind of data server cluster system and method for data synchronization | |
KR101595526B1 (en) | Synchronous transmission system and method for contents | |
CN101079869B (en) | A data synchronization method and system based on distribution | |
CN100502324C (en) | Method for obtaining chain circuit evaluating parameter | |
CN101635728B (en) | Method and system for data synchronization in content distribution network | |
EP2346210A1 (en) | Method for addressing management object in management tree and associated device management system | |
CN101867613B (en) | Content delivery CDN sub system and data synchronization method | |
JP2010509813A (en) | Notification message processing method and apparatus | |
EP2597821B1 (en) | Method and system for auto-configuration, and network node | |
CN103188064A (en) | Clock synchronization method and clock synchronization device | |
CN110012115A (en) | The update method and system of direct broadcasting room pushed information | |
US20110167040A1 (en) | Method, apparatus and system for executing synchronization | |
CN103281356B (en) | File distribution method and system | |
US20160308964A1 (en) | Method, server, and system for synchronizing group member information | |
EP2913977A2 (en) | Resource information acquisition method, system and device for internet of things terminal device | |
CN103647833A (en) | Continuous sequence number generation system and continuous sequence number generation method | |
CN107634975A (en) | A kind of method of data synchronization, equipment and system | |
CN101018148A (en) | Data increment synchronization method between the network management system and network element management system | |
CN101447874A (en) | Data synchronization method, client and server | |
CN101159676B (en) | Data transmission method and system | |
CN101707785A (en) | Data synchronization method for mobile communication terminal | |
CN104639399A (en) | Method and device for detecting plurality of primary time servers | |
EP2868027A1 (en) | User-selectable ieee 1588 clock class and quality level mapping |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20161026 |