CN109788027A - Method of data synchronization, device, server and computer storage medium - Google Patents
Method of data synchronization, device, server and computer storage medium Download PDFInfo
- Publication number
- CN109788027A CN109788027A CN201811525666.3A CN201811525666A CN109788027A CN 109788027 A CN109788027 A CN 109788027A CN 201811525666 A CN201811525666 A CN 201811525666A CN 109788027 A CN109788027 A CN 109788027A
- Authority
- CN
- China
- Prior art keywords
- data
- version number
- server
- new
- background server
- 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.)
- Granted
Links
Abstract
The embodiment of the invention discloses a kind of method of data synchronization, device, server and storage medium, this method is applied to increment synchronization field, wherein, method includes: to receive the update message that data server is sent by incremental update data-interface, the update message includes the mark of data server, more new data and more new version number, the determining mark with data server has the mark of each background server of corresponding relationship, and the mark based on each background server, more new data and more new version number are pushed to each background server, so that each background server carries out incremental update according to aforementioned more new data and more new version number.By implementing the embodiment of the present invention, the data that can be completed between data server and background server are synchronous.
Description
Technical field
The present invention relates to fields of communication technology, and in particular to a kind of method of data synchronization, device, server and computer are deposited
Storage media.
Background technique
Background system exploitation in, it is often necessary to the data that data server medium-high frequency uses be loaded into the memory of application with
Speed up processing, and present background application is often distributed backstage.Therefore, it be easy to cause data server with after
Data in the memory of platform application are inconsistent.
Therefore, the data how completed between data server and background application are synchronous as a technology urgently to be resolved
Problem.
Summary of the invention
The embodiment of the invention discloses a kind of method of data synchronization, device, server and computer storage mediums, can be complete
It is synchronous at the data between data server and background server.
In a first aspect, the embodiment of the invention discloses a kind of method of data synchronization, this method can be applied to synchronous service
Device, this method may include: to receive the update message that data server is sent, update message packet by incremental update data-interface
Mark, more new data and the more new version number of data server are included, more new version number is the version number of more new data;Determining and number
There is the mark of each background server of corresponding relationship according to the mark of server;It, will based on the mark of each background server
More new data and more new version number are pushed to each background server, so that each background server is according to more new data and update
Version number carries out incremental update.
In one implementation, the method can also include: the first request of data for receiving background server and sending,
First request of data is used for request version number target partial data identical with more new version number, and the first request of data is the backstage
What server was sent when partial data is not present in the built-in storage of itself;Obtain target partial data, target partial data
It is sync server according to aforementioned more new data, increment is carried out more to the partial data stored in the external memory of sync server
Newly obtain;Target partial data is sent to the background server.
In one implementation, the method can also include: the second request of data for receiving background server and sending,
For request version number more new data identical with the version number in version number's set, version number gathers includes second request of data
One or more version numbers, the second request of data be the background server in the built-in storage of itself there are partial data, and it is preceding
It is sent when stating the difference between the version number of the partial data in more new version number and built-in storage greater than preset value;It obtains more
New data set, the version number and the version number in version number's set for updating the more new data in data acquisition system correspond phase
Together;Data acquisition system will be updated and be sent to the background server, so that the sequence that the background server is incremented by according to version number, successively
Incremental update is carried out to the partial data after last incremental update according to the more new data received.
Second aspect, the embodiment of the invention discloses another method of data synchronization, this method can be applied to backstage and take
Business device, this method may include: the propelling data for receiving sync server and sending, and propelling data includes more new data and more new edition
This number, more new version number is the version number of more new data, and the connection status between background server and sync server is long connects
It connects;It detects and whether there is partial data in built-in storage;If there are partial datas in built-in storage, the version of partial data is obtained
This number;If more new version number is different from the version number of partial data, incremental update is carried out to partial data according to more new data;
Partial data after incremental update is stored in built-in storage with version number correlation is updated.
In one implementation, if the method can also include: in built-in storage there is no partial data, to same
It walks server and sends the first request of data, the first request of data is complete for request version number target identical with more new version number
Data;Receive the target partial data that sync server is sent;Target partial data and update version number correlation are stored in interior
Memory.
In one implementation, if more new version number is different from the version number of partial data, according to more new data pair
The specific embodiment that partial data carries out incremental update can be with are as follows: if between more new version number and the version number of partial data
Difference is preset value, then carries out incremental update to partial data according to more new data;If the version of more new version number and partial data
Difference between this number is greater than preset value, then sends the second request of data to sync server, the second request of data is for requesting
Version number's more new data identical with the version number in version number's set, version number's set includes one or more version numbers;It receives
The update data acquisition system that sync server is sent updates in the version number and version number's set of the more new data in data acquisition system
Version number corresponds identical;According to the sequence that version number is incremented by, successively according to the more new data received, to last increment
Updated partial data carries out incremental update.
In one implementation, the method can also include: using preset duration as interval, detection background server with
Connection status between sync server, connection status include that length is connected and disconnected from;If connection status is to disconnect, taken to synchronous
Business device sends long connection request, and long connection request is for requesting and the long connection of sync server foundation;Receive sync server hair
The successful connection message sent, which, which is used to indicate between background server and sync server, is successfully established long company
It connects.
The third aspect, the embodiment of the invention discloses a kind of data synchronization unit, which includes for executing above-mentioned
The unit of method described in one side.
Fourth aspect, the embodiment of the invention discloses another data synchronization unit, which includes above-mentioned for executing
The unit of method described in second aspect.
5th aspect, the embodiment of the invention discloses a kind of server, which includes memory and processor, described
Memory is for storing computer program, and the computer program includes program instruction, and the processor is configured for calling
Described program instruction, executes method described in above-mentioned first aspect.
6th aspect, the embodiment of the invention discloses another server, which includes memory and processor, institute
Memory is stated for storing computer program, the computer program includes program instruction, and the processor is configured for adjusting
It is instructed with described program, executes method described in above-mentioned second aspect.
7th aspect, the embodiment of the invention discloses a kind of computer storage medium, the computer storage medium storage
There is computer program, the computer program includes program instruction, and described program instruction makes the place when being executed by a processor
Reason device executes method described in above-mentioned first aspect.
Eighth aspect, the embodiment of the invention discloses another computer storage medium, the computer storage medium is deposited
Computer program is contained, the computer program includes program instruction, and described program instruction makes described when being executed by a processor
Processor executes method described in above-mentioned second aspect.
By implementing the embodiment of the present invention, sync server is in more new data and the update for receiving data server transmission
After version number, the mark for each background server that there is corresponding relationship with the mark of data server, and base can be determined
In the mark of each background server, more new data and more new version number are pushed to each background server, so that after each
Platform server carries out incremental update according to more new data and more new version number, to complete data server and each background service
Data between device are synchronous.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of configuration diagram of communication system provided in an embodiment of the present invention;
Fig. 2 is a kind of flow diagram of method of data synchronization provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of another method of data synchronization provided in an embodiment of the present invention;
Fig. 4 is the flow diagram of another method of data synchronization provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of data synchronization unit provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another data synchronization unit provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of sync server provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of background server provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Referring to Figure 1, Fig. 1 is a kind of configuration diagram of communication system disclosed by the embodiments of the present invention.As shown in Figure 1,
The communication system includes data server 101, sync server 102, the first background server 103, the second background server 104
With third background server 105.Wherein, data server 101 can be used for storing first the 103, second backstage of background server
The data that server 104 and third background server 105 need.Sync server 102 has the function of distribution subscription, data service
Device 101 can be by being sent to sync server 102 for the data of storage, so that sync server 102 will by issuing function
The data-pushing is to the first background server 103, the second background server 104 and third background server 105, to complete number
According to the data between server 101 and the first background server 103, the second background server 104 and third background server 105
It is synchronous.Wherein, sync server 102 can be redis server or other servers with distribution subscription function, this hair
Bright embodiment is not construed as limiting this, be applied to the embodiment of the present invention in, by sync server 102 be redis server for into
Row explanation.
It should be noted that the data-pushing to 3 background servers is only used for illustrating by sync server 102 in Fig. 1,
The restriction to the embodiment of the present invention is not constituted, in the concrete realization, sync server 102 can also be by the data-pushing to 1
A, 2, the background server of 5 or other quantity, the embodiment of the present invention are not construed as limiting this.
It is understood that the communication system of description of the embodiment of the present invention is to more clearly illustrate implementation of the present invention
The technical solution of example, does not constitute the restriction for technical solution provided in an embodiment of the present invention, those of ordinary skill in the art
It is found that technical solution provided in an embodiment of the present invention is for similar with the differentiation of system architecture and the appearance of new business scene
The technical issues of, it is equally applicable.
Based on the configuration diagram of communication system shown in FIG. 1, referring to Fig. 2, Fig. 2 is provided in an embodiment of the present invention one
The flow diagram of kind method of data synchronization.Specifically, as shown in Fig. 2, the method for data synchronization of the embodiment of the present invention can wrap
It includes but is not limited to following steps:
S201, redis server receive the update message that data server is sent by incremental update data-interface, this is more
New information includes mark, more new data and the more new version number of data server, and more new version number is the version number of more new data.
Wherein, the mark of data server is used for the unique identification data server, and update message can be data service
It when device detects that the partial data of itself storage updates, is sent to redis server, it should be noted that this is complete
Data can be all data or partial data stored in data server, but the partial data is that background server needs
The data wanted, as long as the data that background server needs update, data server can be sent more to redis server
New information.More new data is used to indicate the data updated on the basis of partial data, and redis server is receiving number
After the more new data sent according to server, incremental update can be carried out to currently stored partial data according to more new data,
And obtain new partial data.Incremental update refers to when being updated operation, only updates the place for needing to change, does not need more
The place not changed newly, and updated place will not then repeat to update, and update relative to full dose, incremental update disappears
The process resource of consumption is less.Full dose update, which refers to, is updated all data.It should be noted that more new data and complete number
According to being different types of data.
In one implementation, data server can send the partial data of itself storage to redis server, with
Continue after an action of the bowels to redis server send more new data when, redis server can work as redis server according to more new data
The partial data of preceding storage carries out incremental update.It is understood that data server is subsequent to send other to redis server
When more new data, without sending the partial data itself stored to redis server again, redis server only needs basis to work as
Before the more new data that receives, incremental update is carried out to the partial data that last incremental update obtains.
In one implementation, data server can be with the version number of associated storage more new data and more new data (i.e.
More new version number).In one implementation, data server can be with the partial data of associated storage itself storage and itself
The version number of the partial data of storage.The version that the version number of the version number of partial data and more new data all can be incremented by
Number, version number can serve to indicate that the sequence that partial data updates.For example, when version number is the version number being incremented by with 1, and
The version number of partial data 1 is that v1 shows that partial data 2 is the base in partial data 1 when the version number of partial data 2 is v2
On plinth, according to what is obtained after the more new data progress incremental update that version number is v2.Wherein, data server is sent to redis
The more new data of server can serve to indicate that the data that target partial data changes on the basis of the first partial data.First
Partial data can be data server before upper primary data update, the partial data of itself storage.For example, in 8:00:
When 00 (when: point: second), the partial data stored in data server is the first partial data, if (i.e. 8:03:00 after 3 minutes
When), the first partial data stored in data server is updated, and after the completion of update, what is stored in data server is complete
Entire data is target partial data, and data server can be needed by comparing target partial data and the first partial data
It is sent to the more new data of redis server.It should be noted that under any circumstance, one is only stored in data server
Part partial data.In one implementation, it can store more parts of more new datas in data server, and more parts of more new datas
Version number is different, in the version number of all more new datas of data server storage, in maximum version number and data server
The version number of the partial data of storage is identical.
It should be noted that above-mentioned version number is to be only used for illustrating with 1 incremental version number, in other feasible realization sides
In formula, version number can also be for the version number of 2,3 or other ascending numericals, it is not limited in the embodiment of the present invention.
In embodiments of the present invention, when redis server receives the update message of data server transmission, show data
The data stored in server are updated, and redis server is by by the more new data and more new version in update message
It number is pushed to each background server for the data for needing to store in data server, data server can be kept and needs to count
It is synchronous according to the data between each background server of the data stored in server.
In one implementation, the incremental update data-interface of redis server can be only used for receiving update message,
It can be used for receiving other data, the embodiment of the present invention is not construed as limiting this.
In one implementation, data server may include one or more databases, wherein each database can
The relevant data of different application for storage.That is, the data that different background servers need can store in data
In the disparate databases of server, for example, if data server include 2 databases (A and B), wherein background server 1, after
Platform server 2 and background server 3 are required to the data in database A, background server 4, background server 5 and background service
Device 6 is required to the data in database B, and when the data stored in database A update, data server A can be to same
It walking server and sends update message a, the data that update message a is used to indicate in database A are updated, correspondingly,
Redis server can by update message a more new data and more new version number be sent to background server 1, backstage take
Business device 2 and background server 3.Similarly, when the data stored in database B update, data server B can be to
Redis server sends update message b, and the data that update message b is used to indicate in database B are updated, correspondingly,
Redis server can by update message b more new data and more new version number be sent to background server 4, backstage take
Business device 5 and background server 6.
In one implementation, the database in data server can for Oracle, Mysql, redis, HBase or
Other frequently-used data libraries of person, it is not limited in the embodiment of the present invention.
The determining mark with data server of S202, redis server has each background server of corresponding relationship
Mark.Specifically, after redis server receives update message, it can be determining to be taken with data by inquiring mapping table
The mark of business device has the mark of all background servers of corresponding relationship, and the more new data for including by update message and update
Version number is sent to the corresponding background server of mark of each background server.Redis server can be by the data service
Corresponding relationship between the mark and the mark of each background service of device is pre-stored in mapping table, which can
To be to be sent to redis server by data server.In one implementation, redis server can receive difference
The update message that data server is sent, and the mark of the corresponding background server of mark of different data server can not
Together, for example, redis server can receive the update message 1 of the transmission of data server 1, and the transmission of data server 2 is received
Update message 2, and having the background server mark of corresponding relationship with the mark of data server 1 can be background server
Mark 1 and background server mark 2, with the mark of data server 2 there is the background server of corresponding relationship to identify can be
Background server mark 3 and background server mark 4.
In one implementation, the determining mark with data server of redis server has each of corresponding relationship
The specific embodiment of the mark of background server can be with are as follows: redis server determines mesh in used all channels
Channel is marked, and obtains the mark of each background server for subscribing to the destination channel prestored, wherein destination channel is used for data
Data transmission between server and each background server.One or more channels, Mei Gexin can be used in redis server
Road can be used for issuing the data of different data server, alternatively, each channel can be used for issuing same data server
In different data.Therefore, redis server is when receiving the update message of data server transmission, it is thus necessary to determine that is used for
Issue the channel of the update message.Specifically, when redis server only creates a channel for the data server,
The corresponding relationship that can be previously stored in redis server between server identification and channel logo.When redis server connects
When receiving the update message of data server transmission, which includes the mark of the data server, and redis server can
To obtain the mark of the data server, and according to the corresponding relationship between server identification and channel logo, serviced in redis
In all channels that device uses, channel indicated by channel logo corresponding with the mark of the data server is determined as target
Channel, destination channel is for issuing more new data and more new version number.
In one implementation, update message can also include channel logo, when redis server takes for the data
When business device creates multiple channels, the corresponding pass between Database Identification and channel logo can be stored in advance in data server
System, wherein the corresponding different channel logo of disparate databases mark.When the data stored in certain database update, number
Can determine the corresponding channel logo of the database according to server, in turn, data server will more new data and more new version
When number being sent to redis server, the corresponding channel logo in aforementioned data library is sent to redis server together.So as to
Redis server can determine in all channels that redis server uses according to the corresponding channel logo in aforementioned data library
Destination channel, and more new data and more new version number are sent to each background server for having subscribed the destination channel.
In one implementation, redis server can be used one or more channels, and different background servers can be with
Subscribe to same or different channel, that is to say, that each channel can be subscribed to by one or more background servers.Redis clothes
The mark for having subscribed all background servers of each channel can be stored in advance in business device, for example, when redis server uses
When 3 channel (channel 1, channel 2 and channels 3), the mark for subscribing to the background server of each channel of redis server can be with
As shown in table 1.
Table 1 subscribes to the mark of the background server of each channel of redis server
Channel logo | Subscribe to the mark of all background servers of each channel |
Channel 1 | Background server 1, background server 2, background server 3 |
Channel 2 | Background server 4, background server 5 |
Channel 3 | Background server 6 |
Mark of S203, redis server based on aforementioned each background server, by aforementioned more new data and more new version
Number it is pushed to each background server, so that each background server carries out increment according to aforementioned more new data and more new version number
It updates.
Specifically, the determining each background server with the mark of data server with corresponding relationship of redis server
Mark after, aforementioned more new data and more new version number can be pushed to the corresponding backstage of mark of each background server
Server.Correspondingly, more new edition can be compared after each background server receives aforementioned more new data and more new version number
This number and itself storage partial data version number, and according to comparison result judge whether to itself storage partial data into
Row incremental update.Since version number is incremental version number, if comparison result is the complete number of more new version number and itself storage
According to version number it is different, then show that the data stored in data server are updated, background server is needed according to aforementioned
More new data carries out incremental update to the partial data itself stored.
Specifically, when version number is incremented by with preset value, if comparison result is more new version number and itself stores complete
Difference between the version number of data is preset value, then shows that the data stored in data server are updated, and backstage takes
The partial data stored in business device is different from the currently stored partial data of data server, and stores in background server complete
The partial data that stores is identical before entire data and data server last time update, according to version number be more new version number more
New data carries out incremental update to the partial data itself stored, can make in background server after incremental update completion
The partial data of storage is consistent with the currently stored partial data of data server.It should be noted that preset value can be 1,
2,3 or other numerical value, the embodiment of the present invention this is not construed as limiting.
In embodiments of the present invention, due to using incremental version number, so that background server is according to updating number
Before the partial data for updating itself storage, it can be determined that more new version number and the version number of the partial data of itself storage are
It is no consistent, and only when inconsistent, background server just carries out incremental update to the partial data of itself storage.Pass through this side
Formula, can to avoid update version number it is consistent with the version number of partial data that background server itself stores when, background server
Unnecessary update is carried out to the partial data itself stored according to more new data, and leads to the wasting of resources.
By implementing the embodiment of the present invention, redis server is in the more new data for receiving data server transmission and more
After new version number, the determining mark with data server has the mark of each background server of corresponding relationship, and is based on
More new data and more new version number are pushed to each background server, so that each backstage by the mark of each background server
Server carries out incremental update according to more new data and more new version number, to complete data server and each background server
Between data it is synchronous.
Referring to Fig. 3, Fig. 3 is the flow diagram of another method of data synchronization provided in an embodiment of the present invention.Specifically
, as shown in figure 3, another method of data synchronization of the embodiment of the present invention can include but is not limited to following steps:
S301, redis server receive the update message that data server is sent by incremental update data-interface, this is more
New information includes mark, more new data and the more new version number of data server, and more new version number is the version number of more new data.
The determining mark with data server of S302, redis server has each background server of corresponding relationship
Mark.
Mark of S303, redis server based on aforementioned each background server, by aforementioned more new data and more new version
Number it is pushed to each background server.
It should be noted that the implementation procedure of step S301~S303 can distinguish step S201~S203 in referring to fig. 2
In specific descriptions, this will not be repeated here.
Fig. 3 by with data server mark have corresponding relationship background server mark quantity be 1 for, therefore
Redis server is only shown in Fig. 3, more new data and more new version number are pushed to 1 background server.It should be noted that
With the mark of data server there is the mark quantity of the background server of corresponding relationship to be only used for illustrating for 1, it is feasible at other
Implementation in, with data server mark have corresponding relationship background server mark quantity can also be 2,3
Or other quantity, and one background server of the mark unique identification of a background server, the embodiment of the present invention to this not
It limits.
It whether there is partial data in S304, background server detection built-in storage.
When background server receives the propelling data of redis server transmission, it is necessary first to judge whether to hold
Row incremental update, i.e. background server need to detect with the presence or absence of partial data in built-in storage, and then could be in partial data
On the basis of, incremental update is carried out according to the more new data that propelling data includes.Wherein, propelling data includes more new data and more
New version number, and more new version number is the version number of more new data, background server is the connection between redis server
When state is long connection, the propelling data of redis server transmission is received.
In one implementation, background server can detect background server and redis using preset duration as interval
Connection status between server, connection status include that length is connected and disconnected from;If connection status is to disconnect, serviced to redis
Device sends long connection request, which establishes long connection with redis server for requesting;Receive redis server
The successful connection message of transmission, successful connection message are used to indicate between background server and redis server and are successfully established length
Connection.Specifically, background server, using preset duration as interval, whether the long connection between detection and redis server disconnects,
If disconnecting, by sending long connection request to redis server, to re-establish long connection;If not disconnecting, after continuation of insurance
Hold long connection.In this way, it can be ensured that the communication connection between background server and redis server is in long connection
State, and then ensure that background server can be successfully received the propelling data of redis server transmission.
Wherein, long connection, which refers to, can continuously transmit multiple data packets in a connection, and short connection refers to communication two party
When having data interaction, a connection is just established, after data are sent completely, then disconnects this connection, i.e., connection only completes one every time
The transmission of business.Compared to establishing short connection between background server and redis server, by background server with
Long connection is established between redis server, can send a propelling data to background server to avoid redis server is every,
It is required to re-establish primary short connection, advantageously reduces the power consumption of background server and redis server.Wherein, when presetting
Length can be that 5 minutes, 6 minutes or other numerical value, the embodiment of the present invention are not construed as limiting this.
In one implementation, after background server sends long connection request to redis server, if receiving
The connection failure message that redis server is sent, then background server can continue to send long connection request to background server,
Until receiving the successful connection message of redis server transmission.In one implementation, background server takes to redis
It is engaged in after the long connection request of device transmission, if not receiving redis server is directed to any response that long connection request is made,
Show that redis server may and be unsuccessfully received long connection request, at this point, background server can continue to background service
Device sends long connection request, until receiving the successful connection message of redis server transmission.
If background server obtains the version number of the partial data there are partial data in S305, built-in storage.
Specifically, background server also needs further to sentence there are when partial data in the built-in storage of background server
It is disconnected whether to need to carry out incremental update, to avoid in the case where not needing to carry out incremental update, executes incremental update and cause
The wasting of resources.Specifically, background server can be by comparing the complete number stored in more new version number and self EMS memory reservoir
According to version number judge whether to need to carry out incremental update and according to comparison result.
If S306, more new version number are different from the version number of the partial data, background server is according to more new data pair
The partial data carries out incremental update.
Since version number is incremental version number, if the version of more new version number and the partial data of background server storage
Number difference, then show that the data stored in data server are updated, background server need according to more new data to from
The partial data of body storage carries out incremental update.
In one implementation, when version number is incremented by with preset value, more new version number and background server storage
The different reason of the version number of partial data may there are two types of: first, the data stored in data server are updated, this
When, more new version number and background server storage partial data version number between difference be preset value;Second, data clothes
The data stored in business device are updated, also, background server is not successfully received the push pushed before redis server
Data, at this point, the difference between more new version number and the version number of the partial data of background server storage is greater than preset value.
In one implementation, background server can determine the complete number of more new version number and background server storage
According to version number between difference, and determine according to the difference execution number of incremental update.
In one implementation, when version number is incremented by with preset value, if more new version number and background server store
Partial data version number between difference be preset value, show that the data stored in data server are updated, after
The partial data stored in platform server is different from the currently stored partial data of data server, and stores in background server
Partial data and the data server last time update before store partial data it is identical, at this point, background server only needs root
1 incremental update is carried out to the partial data according to more new data, that is, may make the partial data obtained after updating and data service
The currently stored partial data of device is consistent.
In one implementation, when version number is incremented by with preset value, if more new version number and background server store
Partial data version number between difference be greater than preset value, then show background server and be unsuccessfully received redis clothes
All more new datas that business device is sent, alternatively, showing that background server is successfully received all updates of redis server transmission
Data, but be not updated successfully when executing incremental update.At this point, background server can execute following steps:
S1, background server send the second request of data to redis server, and the second request of data is used for request version number
More new data identical with the version number in version number's set, version number's set include one or more version numbers.Background server
The second request of data is sent to redis server, to obtain version number's update identical with the version number in version number's set
Data, in this way, all more new datas that background server can be made not receive before being successfully received.Into
And according to the more new data of acquisition, multiple incremental update is carried out, so that the partial data and data that obtain after the completion of incremental update
The partial data stored in server is consistent.In one implementation, version number's set may include more new version number with after
Version number between the version number of the partial data of platform server storage.For example, ought more new version number be v5, and background server
When the version number of the partial data of storage is v1, version number gathers all version numbers for including are as follows: v2, v3 and v4.
S2, background server receive the update data acquisition system that redis server is sent, and update the update number in data acquisition system
According to version number and version number set in version number's one-to-one correspondence it is identical.
Specifically, after redis server receives the second request of data that background server is sent, available version
Number with the identical more new data of each version number in version number's set, obtain updating data acquisition system, and data acquisition system will be updated
It is sent to the background server.Version number in the version number and version number's set of more new data in update data acquisition system is one by one
Correspondence is identical, for example, if version number gathers all version numbers for including are as follows: v2, v3 and v4, and update the institute that data acquisition system includes
There is more new data are as follows: when the second more new data, third more new data and the 4th more new data, wherein the version of the second more new data
This number identical as v2, and the version number of third more new data is identical as v3, and the version number of the 4th more new data is identical as v4.
The sequence that s3, background server are incremented by according to version number increases the last time successively according to the more new data received
It measures updated partial data and carries out incremental update.Specifically, it is more new version number that update data acquisition system, which may include version number,
More new data, can not also include version number be more new version number more new data.It include version number when updating data acquisition system
For more new version number more new data when, background server is according to the more new data received, after last incremental update
The specific embodiment that partial data carries out incremental update can be with are as follows: background server is according to the update number updated in data acquisition system
According to the partial data progress incremental update after last incremental update.It is to update when update data acquisition system does not include version number
When the more new data of version number, background server is according to the more new data received, to the complete number after last incremental update
It can be with according to the specific embodiment for carrying out incremental update are as follows: background server is according to the more new data and version updated in data acquisition system
This number more new data for more new version number carries out incremental update to the partial data after last incremental update.Compared to more
New data set includes the more new data that version number is more new version number, is more new edition when update data acquisition system does not include version number
When this number more new data, when redis server can be made to send update data acquisition system to background server, the data of transmission
Measure it is less, be conducive to improve efficiency of transmission.
For example, if version number gathers all version numbers for including are as follows: v2, v3 and v4, update data acquisition system include all
More new data are as follows: the second more new data, third more new data and the 4th more new data, and the version number of the more new data of v2 and second
Identical, v3 is identical as the version number of third more new data, and the version number of v4 and the 4th more new data is identical, and more new version number is
V5, when the version number of the currently stored partial data of background server is v1, background server can be updated according to second first
Data, the partial data that background server last time incremental update is obtained (i.e. the currently stored partial data of background server)
Incremental update is carried out, partial data 2 is obtained;Then, according to third more new data, background server last time incremental update is obtained
The partial data (i.e. partial data 2) arrived carries out incremental update, obtains partial data 3;Again, right according to the 4th more new data
The partial data (i.e. partial data 3) that background server last time incremental update obtains carries out incremental update, obtains partial data
4;Finally, according to the more new data of redis server push, the partial data that background server last time incremental update is obtained
(i.e. partial data 4) carries out incremental update, obtains partial data 5.And then by partial data 5 and v5 associated storage in interior storage
Device, when so as to subsequently received more new data newly, background server can be carried out the version number of v5 and new more new data
Compare, and judged whether according to comparison result according to new more new data, incremental update is carried out to partial data 5.Wherein, completely
The version number of data 5 is v5.
In one implementation, the time that can indicate that partial data is updated due to the version number of more new data is suitable
Sequence, therefore, the sequence that background server is incremented by according to version number, successively according to the more new data received, to last increment
Updated partial data carries out incremental update, can be with successful execution incremental update.If not held according to the sequence that version number is incremented by
Row incremental update may cause update failure.For example, if it is v2's that the more new data 2 that version number is v2, which describes version number,
The data that partial data 2 changes on the basis of version number is partial data 1 of v1, if the more new data 3 that version number is v3 is retouched
What is stated is the data that partial data 3 that version number is v3 changes on the basis of partial data 2 that version number is v2, if backstage takes
The currently stored partial data of device of being engaged in is partial data 1, and the more new data that receives of background server is more new data 2 and more
New data 3, at this point, if background server executes incremental update according to the sequence that version number successively decreases, i.e., it is right according to more new data 3
Partial data 1 carries out incremental update, it would be possible to update failure.
S307, background server by after incremental update partial data and update version number correlation be stored in built-in storage.
Partial data after incremental update is stored in the built-in storage of itself by background server with update version number correlation, so as to subsequent
When receiving new more new data, the version number of more new version number and new more new data can be compared, and compared
Relatively result judges whether to incremental update.
By implementing the embodiment of the present invention, redis server is in the more new data for receiving data server transmission and more
After new version number, the mark for the background server that there is corresponding relationship with the mark of data server can be determined, and be based on
More new data and more new version number are pushed to background server by the mark of background server, and background server is in more new version
Number and itself storage partial data version number it is inconsistent when, increased according to the partial data that more new data stores itself
Amount updates.It in this way, can be to avoid the version number for the partial data for updating version number and background server itself storage
When consistent, background server carries out unnecessary update to the partial data itself stored according to more new data and causes resource unrestrained
Take.
In one implementation, if between more new version number and the version number of the partial data of background server storage
Difference is greater than preset value and is less than or equal to preset threshold, then the first background server can execute s1, s2 in step S306
And s3.Wherein, preset threshold is greater than or equal to 2 times of preset values.When the partial data of more new version number and background server storage
Version number between difference be greater than preset value and be less than or equal to preset threshold when, show that background server is not successfully received
The number of the propelling data pushed before redis server is less, completely counts compared to redis server request target
According to since the data that target partial data includes are far longer than the data that updated data package includes, by being sent to redis server
Second request of data, acquisition is 1 part or more parts of more new datas, it is possible to reduce the data volume transmitted in network improves transmission effect
Rate.Also, compared to write-in target partial data, the power consumption for executing the incremental update operation of fewer number is smaller.
In one implementation, if between more new version number and the version number of the partial data of background server storage
Difference is greater than preset threshold, then background server can execute following steps: the first request of data is sent to redis server,
To obtain target partial data, and by target partial data and the built-in storage that version number correlation is stored in itself is updated,
In, the first request of data is used for request version number target partial data identical with more new version number.
Difference between more new version number and the version number of the partial data of background server storage is greater than preset threshold, table
The number for the propelling data that bright background server pushes before being not successfully received redis server is more, takes compared to redis
Business device sends the second request of data, to obtain update data acquisition system, since background server is not successfully received redis server
The number of the propelling data pushed before is more, causes the quantity for updating the more new data for including in data acquisition system more, so that
The number that background server needs to be implemented incremental update operation is more, it is to be understood that carries out the mode of multiple incremental update
The probability of error is higher.However, acquisition is target partial data if sending the first request of data to redis server, it is only necessary to
1 data write operation is carried out, it, can be more accurately using this mode compared to the mode for carrying out multiple incremental update
Obtain target partial data.
Referring to Fig. 4, Fig. 4 is the flow diagram of another method of data synchronization provided in an embodiment of the present invention.Specifically
, as shown in figure 4, another method of data synchronization of the embodiment of the present invention can include but is not limited to following steps:
S401, redis server receive the update message that data server is sent by incremental update data-interface, this is more
New information includes mark, more new data and the more new version number of data server, and more new version number is the version number of more new data.
The determining mark with data server of S402, redis server has each background server of corresponding relationship
Mark.
Mark of S403, redis server based on aforementioned each background server, by aforementioned more new data and more new version
Number it is pushed to each background server.
Fig. 4 by with data server mark have corresponding relationship background server mark quantity be 1 for, therefore
Redis server is only shown in Fig. 4, more new data and more new version number are pushed to 1 background server.
It whether there is partial data in S404, background server detection built-in storage.
It should be noted that the implementation procedure of step S401~S404 can distinguish step S201~S203 in referring to fig. 2
With the specific descriptions in Fig. 3 in step S304, this will not be repeated here.
Specifically, whether there is partial data in background server detection built-in storage, partial data, then executed if it exists
Step S405;Partial data if it does not exist thens follow the steps S406.
If background server obtains the version number of the partial data there are partial data in S405, built-in storage;If more
New version number is different from the version number of the partial data, then background server carries out increment to the partial data according to more new data
It updates;Partial data after incremental update is stored in built-in storage with version number correlation is updated by background server.
It should be noted that the implementation procedure of step S405 may refer to specifically retouching in step S305~S307 in Fig. 3
It states, this will not be repeated here.
If partial data is not present in S406, built-in storage, background server sends the first data to redis server
Request, first request of data are used for request version number target partial data identical with more new version number.
Specifically, since incremental update needs on the basis of there are partial data, according to more new data to partial data
Carry out incremental update.Therefore, when partial data being not present in background server, show the number in the built-in storage of background server
According to loss, background server can not carry out incremental update.At this point, background server can send the first number to redis server
According to request, to obtain target partial data.It should be noted that version number and more new version number due to target partial data
It is identical, therefore, background server obtain target partial data it is identical as the currently stored partial data of data server, i.e., after
After platform server obtains target partial data, without carrying out incremental update, it is only necessary to by target partial data and more new version number
Associated storage is in built-in storage.
In one implementation, the reason of loss of data in the built-in storage of background server, can be because backstage takes
Business device power-off, and the data in built-in storage is caused all to be lost, background server is by being stored in interior storage for partial data
Device can make the speed of reading partial data faster.Since partial data and more new data are stored in outside by redis server
Memory, and the data stored in external memory will not lose because of power-off, therefore the partial data stored in redis server
More new data is not easy to lose.So background server is by sending the first request of data, available mesh to redis server
Mark partial data.In one implementation, external memory can be hard disk, floppy disk, CD or USB flash disk etc., and the present invention is implemented
Example is not construed as limiting this.
In one implementation, redis server, can by the corresponding relationship between storage version number and partial data
So that redis server can send backstage to background server and take when the partial data in background server is lost
The partial data (i.e. target partial data) that business device needs, it is advantageously ensured that the data between background server and data server
It is synchronous.
S407, redis server obtain target partial data, and target partial data is redis server according to update number
According to carrying out what incremental update obtained to the partial data that stores in the external memory of redis server.
In one implementation, redis server, can be with after the partial data for receiving data server transmission
The partial data is stored in the external memory of itself, when redis server is in the update for receiving data server transmission
After data, incremental update can be carried out to the partial data in external memory, obtained after the completion of updating according to the more new data
Target partial data.Wherein, more new version number is greater than the version number of the partial data in the external memory, when version number passs with 1
When increasing, the difference between more new version number and the version number of the partial data in the external memory is 1.Therefore, redis server
According to the more new data, 1 incremental update is carried out to the partial data in external memory, update can be made to obtain after the completion
The partial data stored in target partial data and data server is consistent.
In one implementation, it can be stored in advance in redis server corresponding between version number and partial data
Relationship can be based on version number and complete after redis server receives the first request of data of background server transmission
Corresponding relationship between data obtains version number and target partial data identical with more new version number, and then target is complete
Data are sent to background server.
Target partial data is sent to background server by S408, redis server.
Target partial data and update version number correlation are stored in built-in storage by S409, background server.
Specifically, after background server receives the target partial data that redis server is sent, it can be complete by target
It entire data and updates version number correlation and is stored in itself built-in storage, it, can be with when so as to subsequently received new more new data
The version number of more new version number and new more new data is compared, and carries out comparison result and judges whether to increment more
Newly.
By implementing the embodiment of the present invention, redis server is in the more new data for receiving data server transmission and more
After new version number, the mark for the background server that there is corresponding relationship with the mark of data server can be determined, and be based on
More new data and more new version number are pushed to background server by the mark of background server, background server can in storage
There are partial datas in device, and when more new version number and the inconsistent version number of the partial data of itself storage, according to update number
Incremental update is carried out according to the partial data stored to itself.It in this way, can be to avoid update version number and background service
When the version number of the partial data of device itself storage is consistent, partial data that background server stores itself according to more new data
It carries out unnecessary update and leads to the wasting of resources.In addition, partial data can be not present in background server in built-in storage
When, by sending the first request of data to redis server, to obtain target partial data.In this way, it can keep away
Exempt from that loss of data occurs in the built-in storage because of background server, and causes background server that can not carry out asking for incremental update
Topic is conducive to the reliability for improving synchronization system.
Fig. 5 is referred to, Fig. 5 is a kind of structural schematic diagram of data synchronization unit provided in an embodiment of the present invention, specifically,
As shown in figure 5, the data synchronization unit 50, may include:
Receiving unit 501, for receiving the update message that data server is sent by incremental update data-interface, this is more
New information includes mark, more new data and the more new version number of data server, and more new version number is the version number of more new data.
Processing unit 502 has each background server of corresponding relationship for the determining mark with data server
Mark.
Transmission unit 503 will more new data and more new version number is pushed to for the mark based on each background server
Each background server, so that each background server carries out incremental update according to aforementioned more new data and more new version number.
In one implementation, receiving unit 501, the first data that can be also used for receiving background server transmission are asked
It asks, the first request of data is used for request version number target partial data identical with more new version number, after the first request of data is
What platform server was sent when partial data is not present in the built-in storage of itself;The data synchronization unit 50 can also include obtaining
Unit 504 is taken, for obtaining target partial data, the target partial data is the sync server according to the update number
According to carrying out what incremental update obtained to the partial data that stores in the external memory of the sync server;Transmission unit 503,
It can be also used for target partial data being sent to background server.
In one implementation, receiving unit 501, the second data that can be also used for receiving background server transmission are asked
It asks, the second request of data is for request version number more new data identical with the version number in version number's set, version number's set
Including one or more version numbers, the second request of data is that there are partial datas in the built-in storage of itself for background server, and
Difference between the version number of partial data in more new version number and built-in storage, which is greater than, to be sent when preset value;Acquiring unit
504, it can be also used for obtaining update data acquisition system, update in the version number and version number's set of the more new data in data acquisition system
Version number correspond it is identical;Transmission unit 503, can be also used for, which will update data acquisition system, is sent to background server, with
The sequence for being incremented by background server according to version number, after the more new data that successively basis receives is to last incremental update
Partial data carries out incremental update.
Embodiment of the method shown in the embodiment of the present invention and Fig. 2-Fig. 4 is based on same design, bring technical effect also phase
Together, concrete principle referring to figure 2.-description of embodiment illustrated in fig. 4, this will not be repeated here.
Fig. 6 is referred to, Fig. 6 is the structural schematic diagram of another data synchronization unit provided in an embodiment of the present invention, specifically
, as shown in fig. 6, the data synchronization unit 60, may include:
Receiving unit 601, for receiving the propelling data of sync server transmission, propelling data is including more new data and more
New version number, more new version number are the version number of the more new data, the connection status between background server and sync server
For long connection;
Detection unit 602, for detecting in built-in storage with the presence or absence of partial data;
Acquiring unit 603, if obtaining the version number of the partial data for there are partial datas in built-in storage;
Processing unit 604, if different from the version number of partial data for more new version number, according to more new data to complete
Entire data carries out incremental update;
Processing unit 604 can be also used for for the partial data after incremental update being stored in update version number correlation interior
Memory.
In one implementation, which can also include transmission unit 605, if being used in built-in storage not
There are partial datas, then send the first request of data to sync server, and the first request of data includes updating version number, the first number
Request version number target partial data identical with more new version number is used for according to request;Receiving unit 601 can be also used for receiving
The target partial data that sync server is sent;Processing unit 604 can be also used for target partial data and more new version number
Associated storage is in built-in storage.
In one implementation, processing unit 604, if different from the version number of partial data for more new version number,
When then carrying out incremental update to partial data according to more new data, if specifically for the version number of more new version number and partial data
Between difference be preset value, then according to more new data to partial data carry out incremental update;If more new version number and complete number
According to version number between difference be greater than preset value, then to sync server send the second request of data, the second request of data use
In request version number more new data identical with the version number in version number's set, version number's set includes one or more versions
Number;The update data acquisition system that sync server is sent is received, the version number and version number of the more new data in data acquisition system are updated
Version number in set corresponds identical;According to the sequence that version number is incremented by, successively according to the more new data received, to upper
Partial data after incremental update carries out incremental update.
In one implementation, detection unit 602 can be also used for detecting background service using preset duration as interval
Connection status between device and sync server, connection status include that length is connected and disconnected from;Transmission unit 605, can be also used for
If connection status is to disconnect, long connection request is sent to sync server, long connection request is for request and sync server
Establish long connection;Receiving unit 601 can be also used for receiving the successful connection message that sync server is sent, the successful connection
Message, which is used to indicate between background server and sync server, is successfully established long connection.
Embodiment of the method shown in the embodiment of the present invention and Fig. 3-Fig. 4 is based on same design, bring technical effect also phase
Together, concrete principle referring to figure 3.-description of embodiment illustrated in fig. 4, this will not be repeated here.
Referring to Fig. 7, Fig. 7 is a kind of structural schematic diagram of sync server provided in an embodiment of the present invention.The server
70 may include receiver 701, transmitter 702, memory 703 and processor 704, receiver 701, transmitter 702, memory
703 are connected with processor 704 by one or more communication bus.
Memory 703 may include read-only memory and random access memory, and provide instruction sum number to processor 704
According to.The a part of of memory 703 can also include nonvolatile RAM.
Processor 704 can be central processing unit (Central Processing Unit, CPU), the processor 704
It can also be other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated integrated
Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor, and optionally, which is also possible to any conventional
Processor etc..Wherein:
Memory 703, for storing program instruction.
Processor 704, for calling the program instruction stored in memory 703, to be used for:
The update message that data server is sent is received by incremental update data-interface, which includes data clothes
Mark, more new data and the more new version number of business device, more new version number is the version number of more new data.
The determining mark with data server has the mark of each background server of corresponding relationship.
Based on the mark of each background server, more new data and more new version number are pushed to each background server,
So that each background server carries out incremental update according to aforementioned more new data and more new version number.
It should be noted that the specific implementation of unmentioned content and each step in the corresponding embodiment of Fig. 7
It can be found in Fig. 1-embodiment illustrated in fig. 4 and foregoing teachings, which is not described herein again.
Referring to Fig. 8, Fig. 8 is a kind of structural schematic diagram of background server provided in an embodiment of the present invention.The server
80 may include receiver 801, memory 802 and processor 803, and receiver 801, memory 802 and processor 803 pass through one
Item or the connection of a plurality of communication bus.
Memory 802 may include read-only memory and random access memory, and provide instruction sum number to processor 803
According to.The a part of of memory 802 can also include nonvolatile RAM.
Processor 803 can be central processing unit (Central Processing Unit, CPU), the processor 803
It can also be other general processors, digital signal processor (Digital Signal Processor, DSP), dedicated integrated
Circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor, and optionally, which is also possible to any conventional
Processor etc..Wherein:
Memory 802, for storing program instruction.
Processor 803, for calling the program instruction stored in memory 802, to be used for:
The propelling data that sync server is sent is received, propelling data includes more new data and more new version number, more new edition
This number be the more new data version number, connection status between background server and sync server is long connection;
It detects and whether there is partial data in built-in storage;
If there are partial datas in built-in storage, the version number of the partial data is obtained;
If more new version number is different from the version number of partial data, increment is carried out more to partial data according to more new data
Newly;
Partial data after incremental update is stored in built-in storage with version number correlation is updated.
It should be noted that the specific implementation of unmentioned content and each step in the corresponding embodiment of Fig. 8
It can be found in Fig. 3-embodiment illustrated in fig. 4 and foregoing teachings, which is not described herein again.
The embodiment of the present invention also provides a kind of computer readable storage medium, and computer-readable recording medium storage has calculating
Machine program, computer program includes program instruction, when program instruction is executed by processor, executes processor such as Fig. 1-Fig. 4 institute
Show step performed by redis server in embodiment of the method.
The embodiment of the present invention also provides a kind of computer readable storage medium, and computer-readable recording medium storage has calculating
Machine program, computer program includes program instruction, when program instruction is executed by processor, executes processor such as Fig. 3-Fig. 4 institute
Show step performed by background server in embodiment of the method.
Above disclosed is only section Example of the invention, cannot limit the right of the present invention with this certainly
Range, those skilled in the art can understand all or part of the processes for realizing the above embodiment, and according to right of the present invention
Equivalent variations made by it is required that, still belongs to the scope covered by the invention.
Claims (10)
1. a kind of method of data synchronization is applied to sync server characterized by comprising
The update message that data server is sent is received by incremental update data-interface, the update message includes the data
The mark of server, more new data and more new version number, the more new version number are the version numbers of the more new data;
The determining mark with the data server has the mark of each background server of corresponding relationship;
Based on the mark of each background server, the more new data and the more new version number are pushed to described each
Background server, so that each background server carries out increment more according to the more new data and the more new version number
Newly.
2. the method according to claim 1, wherein the method also includes:
The first request of data that background server is sent is received, first request of data is for request version number and the update
The identical target partial data of version number, first request of data be the background server in the built-in storage of itself not
There are what is sent when partial data;
The target partial data is obtained, the target partial data is the sync server according to the more new data, right
The partial data stored in the external memory of the sync server carries out what incremental update obtained;
The target partial data is sent to the background server.
3. the method according to claim 1, wherein the method also includes:
The second request of data that background server is sent is received, second request of data collects for request version number and version number
The identical more new data of version number in conjunction, version number's set includes one or more version numbers, second request of data
Be the background server in the built-in storage of itself there are partial data, and the more new version number and the built-in storage
In partial data version number between difference send when being greater than preset value;
It obtains and updates data acquisition system, in the version number for updating the more new data in data acquisition system and version number set
Version number corresponds identical;
The update data acquisition system is sent to the background server, so that the background server was incremented by according to version number
Sequentially, incremental update is successively carried out to the partial data after last incremental update according to the more new data received.
4. a kind of method of data synchronization is applied to background server characterized by comprising
Receive sync server send propelling data, the propelling data include more new data and more new version number, it is described more
New version number is the version number of the more new data, and the connection status between the background server and the sync server is
Long connection;
It detects and whether there is partial data in built-in storage;
If there are the partial datas in the built-in storage, the version number of the partial data is obtained;
If the more new version number is different from the version number of the partial data, according to the more new data to the complete number
According to progress incremental update;
By after incremental update partial data and the update version number correlation be stored in the built-in storage.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
If the partial data is not present in the built-in storage, the first request of data, institute are sent to the sync server
The first request of data is stated for request version number target partial data identical with the more new version number;
Receive the target partial data that the sync server is sent;
The target partial data and the update version number correlation are stored in the built-in storage.
6. if according to the method described in claim 4, it is characterized in that, the more new version number and the partial data
Version number is different, then carries out incremental update to the partial data according to the more new data, comprising:
If the difference between the more new version number and the version number of the partial data is preset value, according to the update number
Incremental update is carried out according to the partial data;
If difference between the more new version number and the version number of the partial data is greater than the preset value, to described same
It walks server and sends the second request of data, second request of data is for request version number and the version number in version number's set
Identical more new data, version number's set includes one or more version numbers;
Receive the update data acquisition system that the sync server is sent, the version number for updating the more new data in data acquisition system
It is identical as version number's one-to-one correspondence in version number set;
According to the sequence that version number is incremented by, successively according to the more new data received, to the complete number after last incremental update
According to progress incremental update.
7. method according to any one of claim 4 to 6, which is characterized in that the method also includes:
Using preset duration as interval, the connection status between the background server and the sync server, the company are detected
Connecing state includes that length is connected and disconnected from;
If the connection status is to disconnect, long connection request is sent to the sync server, the long connection request is used for
Request establishes long connection with the sync server;
The successful connection message that the sync server is sent is received, the successful connection message is used to indicate the background service
Long connection is successfully established between device and the sync server.
8. a kind of data synchronization unit, which is characterized in that described device includes for executing such as any one of claim 1~7 institute
The unit for the method stated.
9. a kind of server, which is characterized in that including memory and processor, the memory is used to store computer program,
The computer program includes program instruction, and the processor is configured for calling described program instruction, is executed as right is wanted
Seek 1~7 described in any item methods.
10. a kind of computer storage medium, which is characterized in that the computer storage medium is stored with computer program, described
Computer program includes program instruction, and described program instruction makes the processor execute such as claim when being executed by a processor
1~7 described in any item methods.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811525666.3A CN109788027B (en) | 2018-12-13 | 2018-12-13 | Data synchronization method, device, server and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811525666.3A CN109788027B (en) | 2018-12-13 | 2018-12-13 | Data synchronization method, device, server and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109788027A true CN109788027A (en) | 2019-05-21 |
CN109788027B CN109788027B (en) | 2022-04-15 |
Family
ID=66496851
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811525666.3A Active CN109788027B (en) | 2018-12-13 | 2018-12-13 | Data synchronization method, device, server and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109788027B (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110602168A (en) * | 2019-08-13 | 2019-12-20 | 平安科技(深圳)有限公司 | Data synchronization method and device, computer equipment and storage medium |
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 |
CN110851290A (en) * | 2019-11-01 | 2020-02-28 | 香港乐蜜有限公司 | Data synchronization method and device, electronic equipment and storage medium |
CN111966719A (en) * | 2020-10-21 | 2020-11-20 | 四川新网银行股份有限公司 | Method for refreshing local data cache of distributed consumer credit system in real time |
CN112199381A (en) * | 2020-09-30 | 2021-01-08 | 北京奇艺世纪科技有限公司 | Data synchronization system, method and device, electronic equipment and storage medium |
CN112463786A (en) * | 2020-12-10 | 2021-03-09 | 上海携宁计算机科技股份有限公司 | Data synchronization method, system, server and storage medium |
CN112860797A (en) * | 2021-02-10 | 2021-05-28 | 上海商汤智能科技有限公司 | Database synchronization method and device, storage medium and equipment |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1520562A (en) * | 2001-06-30 | 2004-08-11 | 国际商业机器公司 | System and method for caching mechanism for central synchronization |
EP1924046A1 (en) * | 2006-01-21 | 2008-05-21 | Huawei Technologies Co., Ltd. | A system, method and device for negotiating the equipment information |
CN103002011A (en) * | 2012-10-29 | 2013-03-27 | 北京奇虎科技有限公司 | Server-based data updating method and server |
CN103430178A (en) * | 2013-01-30 | 2013-12-04 | 华为技术有限公司 | Method, apparatus and product of data updating |
CN104066077A (en) * | 2014-06-24 | 2014-09-24 | 青岛海信移动通信技术股份有限公司 | OTA downloading and upgrading method and device thereof |
CN105453127A (en) * | 2014-07-31 | 2016-03-30 | 飞索科技有限公司 | Method and system for document synchronization in a distributed server-client environment |
CN106534300A (en) * | 2016-11-09 | 2017-03-22 | 东软集团股份有限公司 | Data updating method and system, user equipment and server |
CN106843984A (en) * | 2017-02-13 | 2017-06-13 | 东软集团股份有限公司 | The update method and device of application database |
CN107071005A (en) * | 2017-03-24 | 2017-08-18 | 厦门中控生物识别信息技术有限公司 | A kind of method of data synchronization and system |
CN107133234A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | The method of data cached renewal, apparatus and system |
CN107797817A (en) * | 2017-03-13 | 2018-03-13 | 平安科技(深圳)有限公司 | Using update method and device |
CN107819870A (en) * | 2017-11-21 | 2018-03-20 | 广州视睿电子科技有限公司 | Increment pulling data method, apparatus, storage medium, terminal device and server |
CN108683718A (en) * | 2018-04-27 | 2018-10-19 | 五八同城信息技术有限公司 | Method, apparatus, electronic equipment and the storage medium that data increment synchronizes |
-
2018
- 2018-12-13 CN CN201811525666.3A patent/CN109788027B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1520562A (en) * | 2001-06-30 | 2004-08-11 | 国际商业机器公司 | System and method for caching mechanism for central synchronization |
EP1924046A1 (en) * | 2006-01-21 | 2008-05-21 | Huawei Technologies Co., Ltd. | A system, method and device for negotiating the equipment information |
CN103002011A (en) * | 2012-10-29 | 2013-03-27 | 北京奇虎科技有限公司 | Server-based data updating method and server |
CN103430178A (en) * | 2013-01-30 | 2013-12-04 | 华为技术有限公司 | Method, apparatus and product of data updating |
CN104066077A (en) * | 2014-06-24 | 2014-09-24 | 青岛海信移动通信技术股份有限公司 | OTA downloading and upgrading method and device thereof |
CN105453127A (en) * | 2014-07-31 | 2016-03-30 | 飞索科技有限公司 | Method and system for document synchronization in a distributed server-client environment |
CN107133234A (en) * | 2016-02-29 | 2017-09-05 | 阿里巴巴集团控股有限公司 | The method of data cached renewal, apparatus and system |
CN106534300A (en) * | 2016-11-09 | 2017-03-22 | 东软集团股份有限公司 | Data updating method and system, user equipment and server |
CN106843984A (en) * | 2017-02-13 | 2017-06-13 | 东软集团股份有限公司 | The update method and device of application database |
CN107797817A (en) * | 2017-03-13 | 2018-03-13 | 平安科技(深圳)有限公司 | Using update method and device |
CN107071005A (en) * | 2017-03-24 | 2017-08-18 | 厦门中控生物识别信息技术有限公司 | A kind of method of data synchronization and system |
CN107819870A (en) * | 2017-11-21 | 2018-03-20 | 广州视睿电子科技有限公司 | Increment pulling data method, apparatus, storage medium, terminal device and server |
CN108683718A (en) * | 2018-04-27 | 2018-10-19 | 五八同城信息技术有限公司 | Method, apparatus, electronic equipment and the storage medium that data increment synchronizes |
Non-Patent Citations (1)
Title |
---|
郝平: "一种移动网络下基于双时间戳的数据增量同步研究", 《计算机应用与软件》 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110602168A (en) * | 2019-08-13 | 2019-12-20 | 平安科技(深圳)有限公司 | Data synchronization method and device, computer equipment and storage medium |
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 |
CN110851290A (en) * | 2019-11-01 | 2020-02-28 | 香港乐蜜有限公司 | Data synchronization method and device, electronic equipment and storage medium |
CN112199381A (en) * | 2020-09-30 | 2021-01-08 | 北京奇艺世纪科技有限公司 | Data synchronization system, method and device, electronic equipment and storage medium |
CN111966719A (en) * | 2020-10-21 | 2020-11-20 | 四川新网银行股份有限公司 | Method for refreshing local data cache of distributed consumer credit system in real time |
CN111966719B (en) * | 2020-10-21 | 2021-07-13 | 四川新网银行股份有限公司 | Method for refreshing local data cache of distributed consumer credit system in real time |
CN112463786A (en) * | 2020-12-10 | 2021-03-09 | 上海携宁计算机科技股份有限公司 | Data synchronization method, system, server and storage medium |
CN112463786B (en) * | 2020-12-10 | 2021-08-13 | 上海携宁计算机科技股份有限公司 | Data synchronization method, system, server and storage medium |
CN112860797A (en) * | 2021-02-10 | 2021-05-28 | 上海商汤智能科技有限公司 | Database synchronization method and device, storage medium and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109788027B (en) | 2022-04-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109788027A (en) | Method of data synchronization, device, server and computer storage medium | |
CN108632309B (en) | Method and device for upgrading narrow-band Internet of things terminal | |
CN101577646B (en) | Alarm synchronizing method based on SNMP | |
CN109714757B (en) | Method and device for preparing eSIM card in shared mode | |
CN106302421B (en) | A kind of information intercepting processing method and device | |
US10715628B2 (en) | Attribute operating method and device | |
CN103595566A (en) | Method and device for detecting idle IP addresses | |
CN103457748A (en) | Data transmission method, system and device | |
CN104601376A (en) | Heartbeat message sending method and device | |
CN109600254A (en) | The generation method and related system of full link log | |
CN106792844B (en) | Data transmission method and device | |
CN104639399A (en) | Method and device for detecting plurality of primary time servers | |
CN114827967B (en) | Software updating method, bluetooth device and storage medium | |
CN114760121B (en) | Access frequency control method and access frequency control system | |
CN110650135B (en) | Node processing method, related equipment and computer readable storage medium | |
CN112769889B (en) | Service data pushing method and device, storage medium and electronic device | |
CN111885613B (en) | SIG MESH-based networking method, node equipment and computer equipment | |
CN110572473B (en) | Block header synchronization method, equipment and computer readable storage medium | |
CN116483678B (en) | Information processing method and related device | |
CN112968792B (en) | Method and device for controlling upgrading of equipment of Internet of things | |
CN116028234B (en) | Distributed database load balancing method, device, equipment and storage medium | |
CN113011507B (en) | Method for establishing synchronous time prediction model, data synchronization method and corresponding device | |
CN114979153B (en) | Load balancing method, computer equipment and storage device | |
CN108093002B (en) | Synchronization method and device of information to be synchronized based on data state determination | |
CN117955974A (en) | File downloading method, device, electronic equipment and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |