CN108076081B - Method, device and system for synchronizing service data - Google Patents

Method, device and system for synchronizing service data Download PDF

Info

Publication number
CN108076081B
CN108076081B CN201610987199.0A CN201610987199A CN108076081B CN 108076081 B CN108076081 B CN 108076081B CN 201610987199 A CN201610987199 A CN 201610987199A CN 108076081 B CN108076081 B CN 108076081B
Authority
CN
China
Prior art keywords
data
data object
information
synchronous
target
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
Application number
CN201610987199.0A
Other languages
Chinese (zh)
Other versions
CN108076081A (en
Inventor
侯鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cainiao Smart Logistics Holding Ltd
Original Assignee
Cainiao Smart Logistics Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Cainiao Smart Logistics Holding Ltd filed Critical Cainiao Smart Logistics Holding Ltd
Priority to CN201610987199.0A priority Critical patent/CN108076081B/en
Publication of CN108076081A publication Critical patent/CN108076081A/en
Application granted granted Critical
Publication of CN108076081B publication Critical patent/CN108076081B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/562Brokering proxy services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a method, a device and a system for synchronizing service data, wherein the method comprises the following steps: providing data object category information and version information and data object identification information related to the version information; receiving data object category information and first version information of target synchronous data sent by a client; determining data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server; and receiving the target synchronous data returned by the service server according to the query request information and sending the target synchronous data to the client, wherein the synchronous protocol server does not need to store the incremental data of the service party, and directly obtains the incremental data from the service server when needed, so that the waste of storage resources is avoided.

Description

Method, device and system for synchronizing service data
Technical Field
The present invention relates to the field of data synchronization, and in particular, to a method, an apparatus, and a system for synchronizing service data.
Background
In various applications of electronic devices, data between a client and a server needs to be updated and synchronized to realize various functions of the applications. The data of the client needs to be synchronized with the server, and the effect generated by the operations is further displayed at the client.
In the synchronization scheme of the related technology, the service server is relied on to synchronize the changed data to the synchronization protocol server, the synchronization protocol server maintains a set of changed data and the version number thereof in the database, and the service server also stores a copy of data on the server thereof, so that a data storage resource waste is caused by at least 2 copies (copy) of the data in the related technology. Moreover, as more service servers are accessed, multiple modifications to the same data are synchronized between the service servers and the servers, wasting network resources, and particularly, after data modification, the entire data is transmitted as synchronously updated data, wherein the unmodified portion is also transmitted during data synchronization, resulting in an increase in network traffic, when the magnitude of incremental data is large, such as 1 billion data updates per day, the more data that needs to be stored at the sync protocol server, which causes a great pressure on the storage space of the sync protocol database, and, if the traffic server incremental data has a large number of fields, such as 100 fields in a record, the space required for storage is 1 hundred million by 100 hundred million fields, resulting in a typical sync protocol server that can only hold several days of incremental data storage.
Disclosure of Invention
The invention provides a method, a device and a system for synchronizing service data, which do not need to store incremental data of a service server and save storage resources.
In order to achieve the purpose of the invention, the technical scheme adopted by the invention is as follows:
a method for synchronizing service data is applied to a synchronous protocol server and comprises the following steps:
providing data object category information and version information and data object identification information related to the version information;
receiving data object category information and first version information of target synchronous data sent by a client;
determining data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
and receiving the target synchronous data returned by the service server according to the query request information and sending the target synchronous data to the client.
Preferably, the query request information includes: and the data object category information of the target synchronous data and the data object identification information corresponding to the target synchronous data.
Preferably, the method further comprises, before:
and receiving data object category information which is applied and registered by the service server for the data object, and receiving a query interface which is applied and registered by the service server for the data object.
Preferably, determining, according to the data object category information of the target synchronization data and the first version information, the data object identification information corresponding to the target synchronization data includes:
matching the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
when the current version information is the same as the first version information, returning a response instruction to the client, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
and when the current version information is different from the first version information, inquiring a data object identification information list associated with a version which is changed when the current version information is compared with the first version information according to the first version information.
Preferably, generating query request information according to the data object identification information corresponding to the determined target synchronous data and sending the query request information to the service server includes:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
The embodiment of the invention also provides a method for synchronizing the service data, which is applied to the service server and comprises the following steps:
storing data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
and when receiving query request information generated by the synchronous protocol server according to data object category information sent by the client and data object identification information corresponding to the first version information query target synchronous data, sending the target synchronous data obtained by querying according to the query request information to the client through the synchronous protocol server.
Preferably, the method further comprises, before:
registering data object category information for a data object in the synchronization protocol server, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronization protocol server for the data object.
Preferably, sending the target synchronization data obtained by querying according to the query request information to the client through the synchronization protocol server comprises:
obtaining a data object identification information list of the target synchronous data according to the received query request information,
the target synchronous data object identification information list is obtained by the synchronous protocol server through the data object category information and the first version information sent by the client to inquire the data object identification information corresponding to the target synchronous data;
and retrieving data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronous data through the synchronous protocol server.
The embodiment of the invention also provides a method for synchronizing the service data, which is applied to the client and comprises the following steps:
sending data object category information and the first version information of the target synchronous data to a synchronous protocol server;
receiving the target synchronous data returned by the service server according to the query request information of the synchronous protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
Preferably, the method further comprises, after:
and updating the first version information corresponding to the service registration category information stored by the client into the current version information corresponding to the target synchronous data.
The embodiment of the invention also provides a method for synchronizing the service data, which comprises the following steps:
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends the data object category information and the first version information of the target synchronous data to a synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
The embodiment of the present invention further provides a device for synchronizing service data, which is arranged in a synchronization protocol server, and includes:
the storage module is arranged for providing data object category information and version information and data object identification information related to the version information;
the first communication module is used for receiving the data object category information and the first version information of the target synchronous data sent by the client;
the retrieval module is configured to determine data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
the generating module is set to generate query request information and send the query request information to the service server according to the data object identification information corresponding to the determined target synchronous data;
the first communication module is further configured to receive the target synchronization data returned by the service server according to the query request information and send the target synchronization data to the client.
Preferably, the first communication module is further configured to receive data object category information for which the service server applies for registration for a data object, and receive a query interface for which the service server applies for registration for a data object.
Preferably, the retrieval module comprises:
the matching unit is set to match the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
the response unit is configured to return a response instruction to the client when the current version information is the same as the first version information, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
the association unit is configured to query a data object identification information list associated with a changed version when the current version information is different from the first version information according to the first version information;
preferably, the generating module generates query request information according to the data object identification information corresponding to the determined target synchronization data, and sends the query request information to the service server, where the generating module is configured to:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
The embodiment of the present invention further provides a device for synchronizing service data, which is arranged in a service server, and includes:
the second communication module is set to store the data object category information corresponding to the data with data change and the version information and the data object identification information related to the version information to the synchronous protocol server;
and the feedback module is set to send the target synchronous data obtained by inquiring according to the inquiry request information to the client through the synchronous protocol server when receiving the inquiry request information generated by the synchronous protocol server according to the data object category information sent by the client and the data object identification information corresponding to the first version information inquiry target synchronous data.
Preferably, the apparatus further comprises:
the registration module is used for registering data object category information in the synchronous protocol server for the data object, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronous protocol server for the data object.
Preferably, the feedback module comprises:
a confirmation unit, configured to obtain a data object identification information list of the target synchronous data according to the received query request information, where the data object identification information list of the target synchronous data is obtained by the synchronous protocol server querying data object identification information corresponding to the target synchronous data through the data object category information and the first version information sent by the client;
and the synchronization unit is used for retrieving the data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronization data through the synchronization protocol server.
The embodiment of the present invention further provides a device for synchronizing service data, which is arranged at a client and includes:
the third communication module is used for sending the data object category information and the first version information of the target synchronous data to the synchronous protocol server;
the third communication module is also configured to receive the target synchronization data returned by the service server according to the query request information of the synchronization protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
Preferably, the apparatus further comprises:
and the updating module is set to update the first version information corresponding to the service registration category information stored in the client to the current version information corresponding to the target synchronous data.
The embodiment of the present invention further provides a system for synchronizing service data, including: the system comprises a service server, a synchronous protocol server and a client;
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends the data object category information and the first version information of the target synchronous data to a synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
Compared with the prior art, the invention has the following beneficial effects:
the incremental data of the business party does not need to be stored in the synchronous protocol server, and the incremental data can be directly obtained from the business server when needed, so that the waste of storage resources is avoided, the number of the business servers is increased, the data needing to be stored cannot be greatly increased, the resources are stored in the same machine, and the storage time of the incremental data can be greatly increased.
Drawings
Fig. 1 is a schematic diagram of a service data synchronization system according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for synchronizing service data according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for synchronizing service data according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for synchronizing service data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service data synchronization apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a search module according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a service data synchronization apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a feedback module according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a service data synchronization apparatus according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a service data synchronization system implementing a service data synchronization method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following description of the embodiments of the present invention with reference to the accompanying drawings is provided, and it should be noted that, in the case of conflict, features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
As shown in fig. 1, an embodiment of the present invention provides a system for synchronizing service data, including: the system comprises a service server, a synchronous protocol server and a client;
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends the data object category information and the first version information of the target synchronous data to a synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
In the synchronization scheme of the embodiment of the invention, the service server stores the original data and the changed data, the changed data does not need to be synchronized to the synchronization protocol server, and only the synchronization protocol server needs to maintain the data object category information and the version information and the data object identification information related to the version information. When the client needs to inquire, update or synchronize data, the synchronization protocol server applies for inquiry to the service server according to the maintained data object category information and the version information and the data object identification information associated with the version information to obtain corresponding target synchronization data.
The data object is a type of data service, for example, in a logistics service, the data object represents logistics services with different starting points or ending points such as hang state to beijing, beijing to shanghai, and the like, the data object category information is a data object represented by an identifier, for example, 001 identifies hang state to beijing, 002 identifies beijing to shanghai, the data object identification information is an item included in the data object category information, still taking the logistics service as an example, the data object identification information is an invoice number corresponding to the starting point and the ending point, for example, 001 identifies N invoices below hang state to beijing, each invoice is distinguished by using a unique identification code, and the version information is a corresponding version identifier for data change under the data object category information, wherein the version information is a version identifier which needs to guarantee self-increment, can be an integer value, and can be a timestamp.
In the embodiment of the invention, the service server, the synchronous protocol server and the client can be internally or externally provided with corresponding databases for storing data. The data base corresponding to the service server is a service data base, the data base corresponding to the synchronous protocol server is a synchronous protocol data base, the data base corresponding to the client is a client data base, the service server stores the data with changed data into the corresponding service data base, the synchronous protocol server stores the data object category information and the data object identification information related to the version information into the corresponding synchronous protocol data base, and the client stores the data object category information and the first version information of the target synchronous data into the corresponding client data base.
As shown in fig. 2, an embodiment of the present invention further provides a method for synchronizing service data, which is applied to a synchronization protocol server, and includes:
providing data object category information and version information and data object identification information related to the version information;
s101, receiving data object category information and first version information of target synchronous data sent by a client;
s102, determining data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
s103, generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
and S104, receiving the target synchronous data returned by the service server according to the query request information and sending the target synchronous data to the client.
The data object category information provided in the embodiment of the present invention and the version information and the data object identification information associated with the version information may be configured in advance by an administrator or downloaded from a server or acquired from a service server. The synchronous protocol server of the embodiment of the invention needs to count or maintain the data object category information in a timing or real-time manner and the incidence relation between the version information and the data object identification information associated with the version information.
The data object category information provided by the synchronization protocol server, and the version information and the data object identification information associated with the version information may be as shown in table 1:
Figure BDA0001148902750000101
the method for acquiring the data object category information and the version information and the data object identification information related to the version information from the service server comprises the following steps:
receiving and storing data object category information corresponding to data with data change sent by a service server, and version information and data object identification information associated with the version information.
Wherein the query request information includes: and the data object category information of the target synchronous data and the data object identification information corresponding to the target synchronous data.
Based on the above embodiment, the method further comprises:
and receiving data object category information which is applied and registered by the service server for the data object, and receiving a query interface which is applied and registered by the service server for the data object.
In step S102, determining, according to the data object category information of the target synchronization data and the first version information, that the data object identification information corresponding to the target synchronization data includes:
matching the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
when the current version information is the same as the first version information, returning a response instruction to the client, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
and when the current version information is different from the first version information, inquiring a data object identification information list associated with a version which is changed when the current version information is compared with the first version information according to the first version information.
In step S104, generating query request information according to the data object identification information corresponding to the determined target synchronization data, and sending the query request information to a service server includes:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
As shown in fig. 3, an embodiment of the present invention further provides a method for synchronizing service data, which is applied to a service server, and includes:
s201, storing data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
s202, when receiving query request information generated by the synchronous protocol server according to data object category information sent by the client and data object identification information corresponding to first version information query target synchronous data, sending the target synchronous data obtained by query according to the query request information to the client through the synchronous protocol server.
In the embodiment of the invention, data object category information and data object identification information of data with data change are created, if the data object identification information has no version number, a record is created to store the data object category information, the data object identification information and the version information (self-increment type); if the version information of the data object category information exists, updating the version information of the data object category information (self-increment needs to be kept); and updating the corresponding version information.
Based on the above embodiment, the method further comprises:
registering data object category information for a data object in the synchronization protocol server, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronization protocol server for the data object.
Based on the above embodiment, sending the target synchronization data obtained by querying according to the query request information to the client through the synchronization protocol server includes:
obtaining a data object identification information list of the target synchronous data according to the received query request information,
the target synchronous data object identification information list is obtained by the synchronous protocol server through the data object category information and the first version information sent by the client to inquire the data object identification information corresponding to the target synchronous data;
and retrieving data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronous data through the synchronous protocol server.
As shown in fig. 4, an embodiment of the present invention further provides a method for synchronizing service data, which is applied to a client, and includes:
s301, sending data object category information and the first version information of the target synchronous data to a synchronous protocol server;
s302, receiving the target synchronous data returned by the service server according to the query request information of the synchronous protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
The method further comprises the following steps:
and updating the first version information corresponding to the service registration category information stored by the client into the current version information corresponding to the target synchronous data.
The process of synchronizing the service data by the service server, the synchronous protocol server and the client in the embodiment of the invention is as follows:
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends the data object category information and the first version information of the target synchronous data to a synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
As shown in fig. 5, an embodiment of the present invention further provides a device for synchronizing service data, which is disposed in a synchronization protocol server, and includes:
the storage module is arranged for providing data object category information and version information and data object identification information related to the version information;
the first communication module is used for receiving the data object category information and the first version information of the target synchronous data sent by the client;
the retrieval module is configured to determine data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
the generating module is set to generate query request information and send the query request information to the service server according to the data object identification information corresponding to the determined target synchronous data;
the first communication module is further configured to receive the target synchronization data returned by the service server according to the query request information and send the target synchronization data to the client.
The first communication module is further configured to receive data object category information for which the service server applies for registration of the data object, and receive a query interface for which the service server applies for registration of the data object.
As shown in fig. 6, the retrieval module includes:
the matching unit is set to match the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
the response unit is configured to return a response instruction to the client when the current version information is the same as the first version information, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
the association unit is configured to query a data object identification information list associated with a changed version when the current version information is different from the first version information according to the first version information;
the step of generating, by the generation module, query request information according to the data object identification information corresponding to the determined target synchronization data, and sending the query request information to the service server, includes:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
As shown in fig. 7, an embodiment of the present invention further provides a device for synchronizing service data, which is disposed in a service server, and includes:
the second communication module is set to store the data object category information corresponding to the data with data change and the version information and the data object identification information related to the version information to the synchronous protocol server;
and the feedback module is set to send the target synchronous data obtained by inquiring according to the inquiry request information to the client through the synchronous protocol server when receiving the inquiry request information generated by the synchronous protocol server according to the data object category information sent by the client and the data object identification information corresponding to the first version information inquiry target synchronous data.
The device further comprises:
the registration module is used for registering data object category information in the synchronous protocol server for the data object, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronous protocol server for the data object.
As shown in fig. 8, the feedback module includes:
a confirmation unit, configured to obtain a data object identification information list of the target synchronous data according to the received query request information, where the data object identification information list of the target synchronous data is obtained by the synchronous protocol server querying data object identification information corresponding to the target synchronous data through the data object category information and the first version information sent by the client;
and the synchronization unit is used for retrieving the data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronization data through the synchronization protocol server.
As shown in fig. 9, an embodiment of the present invention further provides a device for synchronizing service data, which is disposed at a client, and includes:
the third communication module is used for sending the data object category information and the first version information of the target synchronous data to the synchronous protocol server;
the third communication module is also configured to receive the target synchronization data returned by the service server according to the query request information of the synchronization protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
The device further comprises:
and the updating module is set to update the first version information corresponding to the service registration category information stored in the client to the current version information corresponding to the target synchronous data.
Example 1
As shown in fig. 10, this embodiment illustrates a process of synchronizing data by using the above-described synchronization method for service data:
1. the service server registers data object category information, such as SyncKey, for each type of service needing synchronous data in the synchronous protocol server, and registers an adding, deleting, modifying and inquiring interface corresponding to the SyncKey and a data object identification information UUID list interface initializing the data object;
2. the service server performs service operation;
3. when the service data is changed, the UUID of the changed service data under the SyncKey is sent to a synchronous protocol server;
4. after the synchronous protocol server receives the SyncKey and the UUID with data change, if the UUID has no version number, a record is newly created to store the SyncKey, the UUID and the version number (self-increment type) of the UUID; if the UUID has a version number, updating the version number of the UUID (self-increment needs to be guaranteed, and the version number can be an integer value or a timestamp); updating the version number of the SyncKey to be the version information of the UUID;
5. the client uploads the local version number of the SyncKey to the synchronous protocol server;
6-6.1, a synchronization protocol server checks how many pieces of service data are changed between the SyncKey client version information and the server version information (UUID list).
6.1.1-6.1.1.1.1.1, a synchronous protocol server, an inquiry interface for calling service server registration, and a batch inquiry for sending service data corresponding to the changed UUID list (if the UUID list is many, for example, there are 100, only 10 UUIDs can be inquired during inquiry, and the inquiry does not need to be finished at one time).
7. The synchronous protocol server is used for assembling data needing to be synchronized to the client, and comprises the latest version of a SyncKey, a business data list and the version number thereof, wherein the data structure is similar to { "sync": xxx, "version": xxx, "data" [ { "uuid": xxx, "key1": xxx, "key2": xxx, "key3": xxx, "version": xxx }, { "uuid": xxx, "key1": xxx, "key2": xxx, "key3": xxx, "version": xxx }), and transmitting a data packet to the client;
8. and the client updates the version number of the local SyncKey after receiving the service data transmitted by the server, returns to the step 5 if the version number of the local SyncKey is lower than the version number of the server, and continues synchronization until the version number of the local SyncKey is consistent with the version number of the server.
Example 2
The embodiment takes a logistics service synchronization waybill number as an example to explain the process of synchronizing data by using the synchronization method of the service data:
1. a service server, which registers a data object category information for each class of service requiring synchronized data in a synchronization protocol server, such as SyncKey in this embodiment, where the SyncKey identifies a starting point and an ending point of a waybill of a certain day, for example, the service server registers SyncKey1 in the synchronization protocol server to identify that hangzhou arrives at beijing, and registers SyncKey2 to identify that hangzhou arrives at shanghai, and registers an add, delete, modify, query interface and an initialized data object identification information UUID list interface corresponding to the SyncKey, where the data object identification information is multiple waybill keys whose starting points and ending points are the same as corresponding synckeys, for example, in this embodiment, the SyncKey1 corresponds to 100 waybill numbers, and the SyncKey2 corresponds to 300 waybill numbers;
2. the business server updates the logistics information;
3. when the logistics information changes, the UUID of the changed business data under the SyncKey is sent to a synchronization protocol server, such as the No. 1-50 waybill numbers in the SyncKey1 and the No. 1-10 waybill numbers in the SyncKey 1;
4. after the synchronous protocol server receives the SyncKey and the UUID with data change, if the UUID has no version number, a record is newly created to store the SyncKey, the UUID and the version number (self-increment type) of the UUID; if the UUID has a version number, updating the version number of the UUID (self-increment needs to be guaranteed, and the version number can be an integer value or a timestamp); updating the version number of the SyncKey to be the version number of the UUID;
5. the client uploads the SyncKey and the corresponding local version number to the synchronization protocol server; for example, SyncKey1 and the corresponding local version number 1.0.1;
6. the synchronous protocol server checks how many pieces of service data are changed (UUID list) between the local version number of the client and the version number of the server, for example, the version number of the synchronous protocol server is 1.0.4, 3 versions are changed in the middle, wherein the version number is 1.0.2, the waybill number A is changed, the version number is 1.0.3, the waybill numbers A and B are changed, the version number is 1.0.4, the waybill numbers B and C are changed, the content of the UUID list is the waybill number A, B, C, or the waybill numbers changed between the version 1.0.1 and the version 1.0.4 are directly summarized.
7. And the synchronous protocol server calls a query interface registered by the service server, and queries and sends the service data corresponding to the changed UUID list in batch (if the UUID list is many, for example, 100 UUIDs are available, only 10 UUIDs can be queried during querying, and the query does not need to be completed at one time).
8. The synchronization protocol server is used for assembling data needing to be synchronized to the client, and the data comprises the latest version of a SyncKey, a business data list and the version number thereof, and the data structure is similar to { "sync": xxx, "version": xxx, "data" [ { "uuid": xxx, "key1": xxx, "key2": xxx, "key3": xxx, "version": xxx }, { "uuid": xxx, "key1": xxx, "key2": xxx, "key3": xxx, "version": xxx }), and transmitting a data packet to the client;
9. and the client updates the version number of the local SyncKey after receiving the service data transmitted by the server, returns to the step 5 if the version number of the local SyncKey is lower than the version number of the server, and continues synchronization until the version number of the local SyncKey is consistent with the version number of the server.
Although the embodiments of the present invention have been described above, the contents thereof are merely embodiments adopted to facilitate understanding of the technical aspects of the present invention, and are not intended to limit the present invention. It will be apparent to persons skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (21)

1. A method for synchronizing service data is applied to a synchronization protocol server, and comprises the following steps:
providing data object category information and version information and data object identification information related to the version information;
receiving data object category information and first version information of target synchronous data sent by a client;
determining data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
and receiving the target synchronous data returned by the service server according to the query request information and sending the target synchronous data to the client.
2. The method of claim 1, wherein: the query request information includes: and the data object category information of the target synchronous data and the data object identification information corresponding to the target synchronous data.
3. The method of claim 1, wherein: the method is also preceded by:
and receiving data object category information which is applied and registered by the service server for the data object, and receiving a query interface which is applied and registered by the service server for the data object.
4. The method of claim 1, wherein: determining, according to the data object category information of the target synchronization data and the first version information, data object identification information corresponding to the target synchronization data includes:
matching the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
when the current version information is the same as the first version information, returning a response instruction to the client, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
and when the current version information is different from the first version information, inquiring a data object identification information list associated with a version which is changed when the current version information is compared with the first version information according to the first version information.
5. The method of claim 4, wherein: generating query request information according to the data object identification information corresponding to the determined target synchronous data and sending the query request information to a service server comprises the following steps:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
6. A method for synchronizing service data is applied to a service server, and comprises the following steps:
storing data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
and when receiving query request information generated by the synchronous protocol server according to data object category information sent by the client and data object identification information corresponding to the first version information query target synchronous data, sending the target synchronous data obtained by querying according to the query request information to the client through the synchronous protocol server.
7. The method of claim 6, wherein: the method is also preceded by:
registering data object category information for a data object in the synchronization protocol server, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronization protocol server for the data object.
8. The method of claim 6, wherein: sending the target synchronous data obtained by inquiring according to the inquiry request information to the client through the synchronous protocol server comprises the following steps:
obtaining a data object identification information list of the target synchronous data according to the received query request information,
the target synchronous data object identification information list is obtained by the synchronous protocol server through the data object category information and the first version information sent by the client to inquire the data object identification information corresponding to the target synchronous data;
and retrieving data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronous data through the synchronous protocol server.
9. A method for synchronizing service data is applied to a client, and comprises the following steps:
sending data object category information and first version information of target synchronous data to a synchronous protocol server;
receiving the target synchronous data returned by the service server according to the query request information of the synchronous protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
10. The method of claim 9, wherein: the method further comprises the following steps:
and updating the first version information corresponding to the service registration category information stored in the client to the current version information corresponding to the target synchronous data.
11. A method for synchronizing service data is characterized in that: the method comprises the following steps:
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends the data object category information and the first version information of the target synchronous data to the synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
12. A device for synchronizing service data, which is disposed in a synchronization protocol server, comprising:
the storage module is arranged for providing data object category information and version information and data object identification information related to the version information;
the first communication module is used for receiving the data object category information and the first version information of the target synchronous data sent by the client;
the retrieval module is configured to determine data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data;
the generating module is set to generate query request information and send the query request information to the service server according to the data object identification information corresponding to the determined target synchronous data;
the first communication module is further configured to receive the target synchronization data returned by the service server according to the query request information and send the target synchronization data to the client.
13. The apparatus of claim 12, wherein:
the first communication module is further configured to receive data object category information for which the service server applies for registration of the data object, and receive a query interface for which the service server applies for registration of the data object.
14. The apparatus of claim 12, wherein: the retrieval module comprises:
the matching unit is set to match the current version information stored in the synchronous protocol server according to the data object category information sent by the client;
the response unit is configured to return a response instruction to the client when the current version information is the same as the first version information, wherein the response instruction is used for indicating that the first version information of the client is the current version information;
and the association unit is used for inquiring a data object identification information list associated with a changed version compared with the current version information and the first version information according to the first version information when the current version information is different from the first version information.
15. The apparatus of claim 14, wherein: the step of generating, by the generation module, query request information according to the data object identification information corresponding to the determined target synchronization data, and sending the query request information to the service server, includes:
generating query request information according to the data object category information of the target synchronous data and the data object identification information list associated with the changed version, and calling the data object identification information list query interface registered by the service server to send the query request information to the service server.
16. A device for synchronizing service data, comprising: set up in the business server, include:
the second communication module is set to store the data object category information corresponding to the data with data change and the version information and the data object identification information related to the version information to the synchronous protocol server;
and the feedback module is set to send the target synchronous data obtained by inquiring according to the inquiry request information to the client through the synchronous protocol server when receiving the inquiry request information generated by the synchronous protocol server according to the data object category information sent by the client and the data object identification information corresponding to the first version information inquiry target synchronous data.
17. The apparatus of claim 16, wherein: further comprising:
the registration module is used for registering data object category information in the synchronous protocol server for the data object, and registering a corresponding query interface and a data object identification information list interface for initializing the data object in the synchronous protocol server for the data object.
18. The apparatus of claim 16, wherein: the feedback module includes:
a confirmation unit, configured to obtain a data object identification information list of the target synchronous data according to the received query request information, where the data object identification information list of the target synchronous data is obtained by the synchronous protocol server querying data object identification information corresponding to the target synchronous data through the data object category information and the first version information sent by the client;
and the synchronization unit is used for retrieving the data which is subjected to data change and corresponds to the data object identification information list according to the data object identification information list, and sending the data which is subjected to data change to the client as target synchronization data through the synchronization protocol server.
19. A device for synchronizing service data, which is arranged at a client, comprises:
the third communication module is arranged to send the data object category information and the first version information of the target synchronous data to the synchronous protocol server;
the third communication module is also configured to receive the target synchronization data returned by the service server according to the query request information of the synchronization protocol server; the query request information is generated by the synchronization protocol server according to the data object category information of the target synchronization data sent by the client and the data object identification information corresponding to the first version information query target synchronization data.
20. The apparatus of claim 19, wherein: further comprising:
and the updating module is set to update the first version information corresponding to the service registration category information stored in the client to the current version information corresponding to the target synchronous data.
21. A system for synchronizing service data, comprising: the method comprises the following steps: the system comprises a service server, a synchronous protocol server and a client;
the service server stores data object category information corresponding to data with data change and version information and data object identification information related to the version information to a synchronous protocol server;
the synchronous protocol server provides data object category information and version information and data object identification information related to the version information;
the client sends data object category information and first version information of target synchronous data to a synchronous protocol server;
the synchronous protocol server determines data object identification information corresponding to the target synchronous data according to the data object category information and the first version information of the target synchronous data; generating query request information according to the data object identification information corresponding to the determined target synchronous data, and sending the query request information to a service server;
the service server sends the target synchronous data obtained by inquiring according to the inquiry request information to the synchronous protocol server;
and the synchronization protocol server sends the target synchronization data to the client.
CN201610987199.0A 2016-11-09 2016-11-09 Method, device and system for synchronizing service data Active CN108076081B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610987199.0A CN108076081B (en) 2016-11-09 2016-11-09 Method, device and system for synchronizing service data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610987199.0A CN108076081B (en) 2016-11-09 2016-11-09 Method, device and system for synchronizing service data

Publications (2)

Publication Number Publication Date
CN108076081A CN108076081A (en) 2018-05-25
CN108076081B true CN108076081B (en) 2021-02-26

Family

ID=62154079

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610987199.0A Active CN108076081B (en) 2016-11-09 2016-11-09 Method, device and system for synchronizing service data

Country Status (1)

Country Link
CN (1) CN108076081B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545301B (en) * 2018-05-29 2022-06-17 视联动力信息技术股份有限公司 Monitoring resource synchronization method and device
CN112015804A (en) * 2019-05-28 2020-12-01 阿里巴巴集团控股有限公司 Data synchronization method, device, equipment and storage medium
CN112839067B (en) * 2019-11-22 2022-07-22 腾讯科技(深圳)有限公司 Data synchronization method and device
CN114024982B (en) * 2021-11-03 2024-02-23 南京炫佳网络科技有限公司 Information transmission method, service server, terminal device, system and storage medium
CN113987089B (en) * 2021-12-28 2022-08-26 北京力控元通科技有限公司 System cascading method, data processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1828599A (en) * 2005-02-22 2006-09-06 微软公司 Ghosted synchronization
EP1490770A4 (en) * 2002-02-25 2007-02-28 Siebel Systems Inc Method and system for server-based operations in server synchronization with a computing device
CN102480520A (en) * 2010-11-26 2012-05-30 中国科学院声学研究所 Media data synchronism method based on differential metadata description structure
CN103299602A (en) * 2011-01-14 2013-09-11 苹果公司 Data synchronization
CN103929450A (en) * 2013-01-14 2014-07-16 联想(北京)有限公司 Data synchronization method and data synchronization device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1490770A4 (en) * 2002-02-25 2007-02-28 Siebel Systems Inc Method and system for server-based operations in server synchronization with a computing device
CN1828599A (en) * 2005-02-22 2006-09-06 微软公司 Ghosted synchronization
CN102480520A (en) * 2010-11-26 2012-05-30 中国科学院声学研究所 Media data synchronism method based on differential metadata description structure
CN103299602A (en) * 2011-01-14 2013-09-11 苹果公司 Data synchronization
CN103929450A (en) * 2013-01-14 2014-07-16 联想(北京)有限公司 Data synchronization method and data synchronization device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向移动计算环境的混合式数据同步机制;徐小龙等;《通信学报》;20160831;第37卷(第8期);全文 *

Also Published As

Publication number Publication date
CN108076081A (en) 2018-05-25

Similar Documents

Publication Publication Date Title
CN108076081B (en) Method, device and system for synchronizing service data
CN104980486B (en) Method and apparatus for providing set synchronization using equivalent matching network names
KR101011216B1 (en) Data synchronization
KR101389101B1 (en) Method and apparatus for tracking device management data changes
AU2009296436B2 (en) Trickle sync protocol
KR101159341B1 (en) System and method for managing xdm service information
KR20080068110A (en) A method for processing data synchronization and client terminal, server and data synchronization system thereof
CN109542865A (en) Distributed cluster system configuration file synchronous method, device, system and medium
CN109739867A (en) A kind of industry metadata management method and system
EP2157758A1 (en) Data soft deletion, recovery and synchronization method, terminal and system thereof
CN1954317A (en) Method, system, computer programs and devices for management of media items
EP4236422A2 (en) Devices and methods for discovering collectable data and analytics data in a network
US8204898B2 (en) Multi-site common directory and method for using the multi-site common directory
US20240015135A1 (en) Domain management and synchronization system
CN112749172A (en) Data synchronization method and system between cache and database
CN114090692A (en) Full-media-asset data synchronization method, system, device and computer-readable storage medium
CN108491448B (en) Data pushing method and device
CN110650033B (en) Distributed application configuration management method and distributed computing system
CN111090648A (en) Relational database data synchronization conflict resolution method
CN112468524A (en) Cross-network transmission method and device of data and related equipment
CN114706925B (en) Cache synchronization method, device and system for multi-service and multi-key values
EP2183688B1 (en) A method and apparatus in a database system
CN108737587B (en) Method, equipment and system for setting double identification for domain name registrant
CN114301930A (en) Distributed data synchronization method, system and storage medium
CN114827083A (en) Domain name resolution method, system and ECS recursive server

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