CN104967658B - A kind of method of data synchronization on multi-terminal equipment - Google Patents
A kind of method of data synchronization on multi-terminal equipment Download PDFInfo
- Publication number
- CN104967658B CN104967658B CN201510229300.1A CN201510229300A CN104967658B CN 104967658 B CN104967658 B CN 104967658B CN 201510229300 A CN201510229300 A CN 201510229300A CN 104967658 B CN104967658 B CN 104967658B
- Authority
- CN
- China
- Prior art keywords
- transaction journal
- local
- data
- terminal equipment
- synchronization
- 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.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- 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
-
- 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/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
- G06F16/285—Clustering or classification
Abstract
The present invention provides the method for data synchronization on a kind of multi-terminal equipment, step includes:Identification changes object and is labeled in terminal device;Local data base is written into the variation object of mark, timestamp is stamped and is abstracted as transaction journal;Transaction journal is written in local synchronization table;Terminal device background loop reads the transaction journal in local synchronization table, submits and is stored in server-side database;It is deleted from local synchronization table and submits successful transaction journal;Server end circulation reads transaction journal, carries out parsing reduction one by one;Other terminal devices obtain transaction journal from server end;Transaction journal is played back in the local database;Record the current time stamp of transaction journal;Notify upper interface more new data.Invention is suitable for data of a variety of mobile devices under no net environment and synchronizes, and after supporting user to edit, synchrodata is to from the background after network recovery.In addition, the present invention improves network utilization, data access is more efficiently smooth.
Description
Technical field
Belong to mobile communication technology field, more particularly to based on the number between multiple mobile terminal devices under off-network environment
According to synchronous method.
Technical background
The nineties, data, which synchronize, did not started from wired connection, logical with terminal device (iPod) if MAC machine is as data center
FireWire is crossed to synchronize.After 2000, cloud service is rapidly developed, and is gradually turned by the data center of representative of PC/MAC machine
As long as having network to cloud equipment, so that it may use, such as address list, the message backup and recovery of wechat, App Store.
In recent years along with the high speed development of internet and chip technology, the type of mobile terminal device is also more and more.
Mobile terminal device refers to the computer equipment that can be used on the move, such as mobile phone, notebook, tablet computer, POS machine are very
To including that vehicle-mounted computer belongs to mobile terminal device, the appearance of these equipment greatly facilitates and enriches the work of people
And life, significant advantage promote people to select the intelligent terminal for being suitble to oneself according to their own needs.
However people are frequently necessary to modify to various information in use, lead to stored number in a device
It is believed that breath is needed than periodically changing, and same type of data need to be stored in multiple terminal equipment, thus generate
One needs to keep the consistency and integrity issue of same type data in various terminals.Certainly due to wireless communication ability
Limitation existing for body cannot connect network and carry out data exchange, at any time so that the demand applied offline is gradually popularized.
In existing technology, the method for solving the problems, such as this is mainly the cloud service access mode of synchronous mode, although this
Method is more convenient, but existing most of cloud service does not fully consider the characteristic of mobile client, and transmitted data amount is very
Greatly, it brings biggish computing resource consumption and network bandwidth to occupy for mobile device, keeps its response not smooth, it can not efficiently just
Cloud service is accessed promptly.
Therefore data are synchronized between each terminal device when multiple mobile terminal devices to meet people
It is required that and more smooth, efficient experience requirements during accessing data, need to find a kind of novel data side of synchronization
Method, to realize the fluency of the consistency of data synchronization and user experience between multiple mobile terminal devices.Such application is no longer
Synchronously interacted with cloud, but directly access local file system exchanges data, instead, data are in backstage and cloud
It is communicated, data access is asynchronous execution with synchronous two processes.
Summary of the invention
On the basis of in view of the shortcomings of the prior art, the purpose of the present invention is to provide one kind can satisfy in off-network environment
The settling mode of holding data final consistency between lower multi-terminal equipment.
To achieve the above object, the present invention provides the method for data synchronization on a kind of multi-terminal equipment, mainly includes following
Several steps:
(1) corresponding variation object is identified in terminal device and is labeled;
(2) the variation object of mark is written to local data base;
(3) in the local database, the variation object for transferring mark, is stamped timestamp and is abstracted as transaction journal;
(4) transaction journal is written in local synchronization table;
(5) terminal device backstage starting synchronous service, circulation read the transaction journal in local synchronization table, and by its batch
It is submitted to server end, is stored in server-side database;
(6) successful log is submitted, transaction journal is deleted from local synchronization table;
(7) server end circulation reads transaction journal, carries out parsing reduction variation object one by one;
(8) after another terminal device access, newest transaction journal is obtained from server end;
(9) transaction journal that will acquire plays back in the local database;
(10) by transaction journal new in access local database, the current time stamp of transaction journal is recorded;
(11) after the completion of data synchronous working, upper interface can be notified to remove more new data.
Further, the step(1)In, variation object is divided according to service logic, variation object is accorded with by global description
GUID mark, the relationship changed between object pass through variation object ID association.
Further, the step(2)In, local data base uses Sqlite database.
Further, the step(3)In, the one-shot change of setting variation object stamps timestamp and is encapsulated as an affairs day
Will.
Further, the step(4)In, local synchronization table is the incremental update table safeguarded in terminal device, is used for
Record transaction journal.
Further, the step(5)In, server-side database is the non-relational databases such as MySQL or MongoDB.
Further, the step(7)In, if server end does other processing in object variation, it is only necessary to be arranged a series of
Event is separated processing by data processor.
Further, set data processor further includes following steps:
The transaction journal of reading is submitted to processor;
The transaction journal that processing is completed is stored into local data base;
It waits other terminal devices to obtain and is synchronized to local.
Further, the step(10)In, current time stamp is recorded, when for obtaining transaction journal next time, server
End calculates the Incremental Log list in this period.
After the detailed description of embodiment of the present invention is read in conjunction with the figure, the other features and advantages of the invention will become more
Add clear.
This method has following advantage compared with available data synchronization scheme:Data access and data separated in synchronization,
The displaying of user information and the modification operation of user can be completed offline, and local operation is quickly experienced;Server end does not need
There is provided several variation object read-write interfaces, it is only necessary to a series of task processing after safeguarding a Data synchronization interface and registrations
Device, operation expanding only increase task processor, embody the opening and closing principle in software design;Transaction journal is abstracted into variation object
Transaction journal, rather than SQL statement, transaction journal can dock sqlite in client, server end dock MySQL or
The non-relational databases such as MongoDB;Server end major function is transaction journal transparent transmission and data backup, can be answered multiple
With middle multiplexing, backstage development cost and development time are saved.
Detailed description of the invention
Present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments:
Fig. 1 is the flow chart for method of data synchronization on multi-terminal equipment of the invention
Fig. 2 is server-side transaction log processing flow chart.
Specific embodiment
It to make the objectives, technical solutions, and advantages of the present invention clearer, below will be to specific embodiment party of the invention
Formula is described in further detail.
Referring to Fig. 1, the method for data synchronization being suitable on multi-terminal equipment of the present embodiment includes the following steps:
(1) corresponding variation object is identified in terminal device and is labeled;
Variation object is divided with specific reference to service logic, variation object accords with GUID mark by global description, changes object
Between relationship by variation object ID association.
(2) the variation object of mark is written to local data base;
Local data base uses Sqlite database.
(3) in the local database, the variation object of mark is transferred, and is stamped timestamp, to be abstracted as affairs
Log;
Specifically, the one-shot change of setting variation object stamps timestamp and is encapsulated as a transaction journal.
Such as:Object type, object ID, action type, 1 object properties 2 ... object properties N of object properties, timestamp.
(4) transaction journal is written in local synchronization table;
Specific local synchronization table, is an incremental update table of mobile terminal device maintenance, for recording transaction journal.
, if user is added to a photo, the shooting time of existing two photos is had modified so that photo is synchronous for example, and
A photo is deleted, then can retain 4 transaction journals in local synchronization table, it is such as shown below:
INSERT INTO T_Photo (V0, V1, …, VN);
UPDATE T_ Photo SET F_ExifTime = XX WHERE ID=XX;
UPDATE T_ Photo SET F_ ExifTime = XX WHERE ID=X;
DELETE T_ Photo WHERE ID=XXXX;
The purpose of local synchronization table is the object for saving variation, and general table structure is as follows:
Field name | Field purposes | Field type |
F_ID | Log ID | Integer, automatic increase |
F_CreateTime | The log creation time | Date-time |
F_Statement | Synchronization log SQL statement | Text |
(5) terminal device backstage starting synchronous service, circulation read the transaction journal in local synchronization table, and by its batch
It is submitted to server end, is stored in server-side database;
Specific service device client database is the non-relational databases such as MySQL or MongoDB.
(6) successful log is submitted, transaction journal is deleted from local synchronization table;
(7) server end circulation reads transaction journal, carries out parsing reduction variation object one by one;
If specially server end does other processing when transaction journal changes(Transmission push disappears after adding photo such as user
Breath), it is only necessary to volume of data processor is set, each transaction journal is separately handled.
It specifically further include as shown in Figure 2 following steps:
The transaction journal of reading is submitted in processor chained list;
The transaction journal that processing is completed is stored into local data base;
It waits other terminal devices to obtain and is synchronized to local synchronization table.
(8) after another terminal device access, newest transaction journal is obtained from server end;
(9) transaction journal that will acquire plays back in the local database;
(10) by transaction journal new in access local database, the current time stamp of transaction journal is recorded;
Physical record current time stamp, when for obtaining synchronized transaction log next time, server end calculates this period
Interior Incremental Log list.
(11) after the completion of data synchronous working, upper interface can be notified to remove more new data.
Finally, it is stated that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although referring to compared with
Good embodiment describes the invention in detail, those skilled in the art should understand that, it can be to skill of the invention
Art scheme is modified or replaced equivalently, and without departing from the objective and range of technical solution of the present invention, should all be covered at this
In the scope of the claims of invention.
Claims (9)
1. the method for data synchronization on a kind of multi-terminal equipment, it is characterised in that including following steps:
1)Variation object is identified in terminal device and is labeled;
2)The variation object of mark is written to local data base;
3)In the local database, the variation object for transferring mark, is stamped that timestamp is abstract to form transaction journal;
4)Transaction journal is written in local synchronization table;
5)Terminal device backstage starting synchronous service, circulation reads the transaction journal in local synchronization table, and its batch is submitted
To server end, it is stored in server-side database;
6)It is deleted in local synchronization table and submits successful transaction journal;
7)Server end circulation reads transaction journal, carries out parsing reduction variation object one by one;
8)After another terminal device access, newest transaction journal is obtained from server end;
9)The transaction journal that will acquire plays back in the local database;
10)By transaction journal new in access local database, the current time stamp of transaction journal is recorded;
11)Notify upper interface more new data.
2. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(1)In, according to industry
Business logical partitioning changes object, and variation object accords with GUID mark by global description, and the relationship between variation object passes through variation
Object ID association.
3. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(2)In, local number
Sqlite database is used according to library.
4. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(3)In, setting becomes
The one-shot change for changing object stamps timestamp and is encapsulated as a transaction journal.
5. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(4)In, it is local same
Step table is the incremental update table safeguarded in terminal device, for recording transaction journal.
6. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(5)In, server
Client database is MySQL or MongoDB non-relational database.
7. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(7)In, if service
Device end needs to do additional processing when reading transaction journal, then data processor is arranged, and transaction journal is separated processing.
8. the method for data synchronization on multi-terminal equipment according to claim 7, it is characterised in that:The step(7)Specifically
Steps are as follows:
The transaction journal of reading is submitted to data processor;
The transaction journal that processing is completed is stored into local data base;
It waits another terminal device to obtain and is synchronized to local synchronization table.
9. the method for data synchronization on multi-terminal equipment according to claim 1, which is characterized in that step(10)In, record
Current time stamp, when for obtaining transaction journal next time, server end calculates the Incremental Log list in this period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510229300.1A CN104967658B (en) | 2015-05-08 | 2015-05-08 | A kind of method of data synchronization on multi-terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510229300.1A CN104967658B (en) | 2015-05-08 | 2015-05-08 | A kind of method of data synchronization on multi-terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104967658A CN104967658A (en) | 2015-10-07 |
CN104967658B true CN104967658B (en) | 2018-11-30 |
Family
ID=54221599
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510229300.1A Active CN104967658B (en) | 2015-05-08 | 2015-05-08 | A kind of method of data synchronization on multi-terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104967658B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897288A (en) * | 2015-12-18 | 2017-06-27 | 阿里巴巴集团控股有限公司 | The service providing method and system of database |
Families Citing this family (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105279285B (en) * | 2015-11-23 | 2018-07-24 | 上海斐讯数据通信技术有限公司 | A kind of synchronization system and method for relevant database and non-relational database |
CN105426512A (en) * | 2015-12-01 | 2016-03-23 | 广东电网有限责任公司电网规划研究中心 | Offline editing synchronization method |
CN105701218B (en) * | 2016-01-14 | 2019-05-07 | 四川长虹电器股份有限公司 | Realize that different terminals carry out the synchronous method of data on the database |
CN107515874B (en) * | 2016-06-16 | 2021-07-27 | 阿里巴巴集团控股有限公司 | Method and equipment for synchronizing incremental data in distributed non-relational database |
CN106485784B (en) * | 2016-11-28 | 2020-05-19 | 重庆上丞科技有限公司 | Indoor design imaging processing method based on multi-terminal equipment data synchronization |
CN108509462B (en) | 2017-02-28 | 2021-01-29 | 华为技术有限公司 | Method and device for synchronizing activity transaction table |
CN107992515A (en) * | 2017-10-27 | 2018-05-04 | 大唐网络有限公司 | Implementation method, device and the storage medium of mongodb affair mechanisms |
CN108717426B (en) * | 2018-05-04 | 2021-01-05 | 苏州朗动网络科技有限公司 | Enterprise data updating method and device, computer equipment and storage medium |
CN109271448A (en) * | 2018-09-25 | 2019-01-25 | 武汉达梦数据库有限公司 | It is the data synchronous system and method for platform based on database |
CN109614444B (en) * | 2018-11-12 | 2023-05-16 | 武汉达梦数据库股份有限公司 | Data initialization method during data synchronization |
CN112347186B (en) * | 2019-08-09 | 2023-02-28 | 安徽寒武纪信息科技有限公司 | Data synchronization method and device and related product |
CN112306945B (en) * | 2019-07-30 | 2023-05-12 | 安徽寒武纪信息科技有限公司 | Data synchronization method and device and related products |
CN110704532A (en) * | 2019-09-18 | 2020-01-17 | 南方电网数字电网研究院有限公司 | Method and device for synchronizing data among databases, computer equipment and storage medium |
CN110888777A (en) * | 2019-11-14 | 2020-03-17 | 艾体威尔电子技术(北京)有限公司 | Method for storing log by using database of POS machine |
CN111259022A (en) * | 2020-01-13 | 2020-06-09 | 京东方科技集团股份有限公司 | Information synchronization method, synchronization system, computer equipment and medium |
CN112507027B (en) * | 2020-12-16 | 2024-04-16 | 平安科技(深圳)有限公司 | Kafka-based incremental data synchronization method, device, equipment and medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101902473A (en) * | 2010-07-22 | 2010-12-01 | 武汉中地数码科技有限公司 | Method for synchronously updating data based on grid GIS (Geographic Information System) |
CN102289469A (en) * | 2011-07-26 | 2011-12-21 | 国电南瑞科技股份有限公司 | Method for supporting universal database to synchronize data based on physical isolating equipment |
CN103916482A (en) * | 2014-04-21 | 2014-07-09 | 合肥盈云信息科技有限公司 | Data synchronous transmission method based on sqlite |
CN104572689A (en) * | 2013-10-17 | 2015-04-29 | 腾讯科技(深圳)有限公司 | Data synchronizing method, device and system |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006018843A2 (en) * | 2004-08-16 | 2006-02-23 | Beinsync Ltd. | A system and method for the synchronization of data across multiple computing devices |
CN1968281A (en) * | 2006-11-21 | 2007-05-23 | 华为技术有限公司 | Method for word library data synchronization between terminals and terminal thereof |
KR101430517B1 (en) * | 2008-01-31 | 2014-08-19 | 삼성전자주식회사 | Device and mehtod for synchronizing data in data communication devices |
CN102917020B (en) * | 2011-09-24 | 2016-02-17 | 国网电力科学研究院 | A kind of method of mobile terminal based on packet and operation system data syn-chronization |
CN103297529B (en) * | 2013-06-06 | 2016-01-20 | 浙江大学 | Based on the tree-type structure data synchronous method of timestamp |
-
2015
- 2015-05-08 CN CN201510229300.1A patent/CN104967658B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101902473A (en) * | 2010-07-22 | 2010-12-01 | 武汉中地数码科技有限公司 | Method for synchronously updating data based on grid GIS (Geographic Information System) |
CN102289469A (en) * | 2011-07-26 | 2011-12-21 | 国电南瑞科技股份有限公司 | Method for supporting universal database to synchronize data based on physical isolating equipment |
CN104572689A (en) * | 2013-10-17 | 2015-04-29 | 腾讯科技(深圳)有限公司 | Data synchronizing method, device and system |
CN103916482A (en) * | 2014-04-21 | 2014-07-09 | 合肥盈云信息科技有限公司 | Data synchronous transmission method based on sqlite |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897288A (en) * | 2015-12-18 | 2017-06-27 | 阿里巴巴集团控股有限公司 | The service providing method and system of database |
CN106897288B (en) * | 2015-12-18 | 2021-01-08 | 阿里巴巴集团控股有限公司 | Service providing method and system for database |
Also Published As
Publication number | Publication date |
---|---|
CN104967658A (en) | 2015-10-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104967658B (en) | A kind of method of data synchronization on multi-terminal equipment | |
CN111124277B (en) | Deep learning data set caching method, system, terminal and storage medium | |
CN107977396B (en) | Method and device for updating data table of KeyValue database | |
CN103379159B (en) | A kind of method that distributed Web station data synchronizes | |
CN102609479B (en) | A kind of memory database node clone method | |
CN106503158B (en) | Data synchronization method and device | |
CN106599104A (en) | Mass data association method based on redis cluster | |
CN104361030A (en) | Distributed cache architecture with task distribution function and cache method | |
RU2014139981A (en) | Method and device for data synchronization | |
CN107665246B (en) | Dynamic data migration method based on graph database and graph database cluster | |
CN103457905A (en) | Data synchronizing method, data synchronizing system and data synchronizing device | |
US20160088077A1 (en) | Seamless binary object and metadata sync | |
CN103312751A (en) | Instant messaging method based on browser | |
WO2010028529A1 (en) | A method and device for maintaining a changelog in data synchronization | |
CN108694218A (en) | A kind of method and apparatus data write-in and read | |
CN106156227A (en) | A kind of data transmission method and device | |
CN109873857A (en) | Mobile terminal method of data synchronization and device under a kind of no network state | |
CN115146002A (en) | Cross-data-center data synchronization method and device | |
US9195664B2 (en) | Method and device based on android system for tracking imported file | |
CN110365797B (en) | Method and device for synchronizing contact information | |
CN105574026A (en) | Method and device for service supporting by using non-relational database | |
CN106383901B (en) | One-way data synchronous method between a kind of multi-data source | |
CN103281383B (en) | A kind of time sequence information recording method of Based on Distributed data source | |
US10169380B1 (en) | Universal database import platform | |
CN103312743A (en) | Data synchronization device and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP02 | Change in the address of a patent holder |
Address after: 610041 the 13 floor of No. 1 middle Tianfu Avenue, No. 1268, high-tech zone, Chengdu, Sichuan. Patentee after: Chengdu PinGuo Digital Entertainment Ltd. Address before: 610041 No. 216 South City Road, Chengdu hi tech Zone, Sichuan Patentee before: Chengdu PinGuo Digital Entertainment Ltd. |
|
CP02 | Change in the address of a patent holder |