WO2017114111A1 - Asynchronous data synchronization method for distributed system - Google Patents

Asynchronous data synchronization method for distributed system Download PDF

Info

Publication number
WO2017114111A1
WO2017114111A1 PCT/CN2016/108776 CN2016108776W WO2017114111A1 WO 2017114111 A1 WO2017114111 A1 WO 2017114111A1 CN 2016108776 W CN2016108776 W CN 2016108776W WO 2017114111 A1 WO2017114111 A1 WO 2017114111A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
client
synchronization
service center
information
Prior art date
Application number
PCT/CN2016/108776
Other languages
French (fr)
Chinese (zh)
Inventor
杜南山
Original Assignee
语联网(武汉)信息技术有限公司
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 语联网(武汉)信息技术有限公司 filed Critical 语联网(武汉)信息技术有限公司
Publication of WO2017114111A1 publication Critical patent/WO2017114111A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • 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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Definitions

  • the present invention relates to a computer distributed software system, and more particularly to a method of information synchronization in a distributed system.
  • the technical problem to be solved by the present invention is to provide a method for asynchronous data synchronization of a distributed system, which reduces waste of system resources in the synchronization process and reduces system requirements on the server.
  • the present invention provides a method for asynchronous data synchronization in a distributed system, comprising an information service center and a plurality of distributed clients communicatively connected to the information service center:
  • the information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
  • the information service center transmits the data update message to the target in the synchronization information table according to the synchronization information table;
  • the data update message may have two situations: one includes all data changes, and the other is only notification data changes;
  • the information service center sends a data update message, if it succeeds, it ends. If the transmission fails, it is discarded after multiple attempts;
  • the client After receiving the one or more data update messages, the client updates the data update according to the latest version of the data version, and then notifies the information service center of the latest data version;
  • the information service center After receiving the notification of the latest data version, the information service center updates the synchronization information table.
  • the client When the data update message received by the client includes a change of all the data, the client directly updates its own synchronization data according to the data difference information.
  • the client When the data update message received by the client is only a notification that the data has changed, the client requests all the changed data from the server according to the version number of the self data to update its own synchronization data.
  • the content of the synchronization information table includes an identifier of each client, synchronization data information, a communication type, and a communication identifier;
  • the information service center searches the synchronization information table for the client identifier corresponding to the change data, the communication type corresponding to the client identifier, and the communication identifier;
  • the information service center transmits the data update message to the target that needs data synchronization according to the communication type and the communication identifier.
  • the present invention provides a method for asynchronous data synchronization of a distributed system in which a client's data first changes, including an information service center and a plurality of distributed communication links with the information service center.
  • Client
  • the information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
  • the synchronization initiation client When the data of a certain client first changes, the synchronization initiation client sends data change information to the information service center according to the information service center contact information table, and if the transmission is successful, the process ends; if it fails, multiple attempts are made. Give up
  • the information service center After receiving the data change information of the synchronization initiation client, the information service center updates the synchronization data and updates the synchronization information table;
  • the information service center transmits the data update message to other target clients that need data synchronization according to the synchronization information table, and the steps are the same as the data of the information service center.
  • the client directly updates its own synchronization data according to the data difference information.
  • the client When the data update message received by the client is only one notification that the notification data has a change, the client requests all the changed data from the server according to the version number of the self data to update its own synchronization data.
  • the client When a client joins the distributed system, the client registers with the information service center, and the information service center adds the registered client information to the synchronization information table.
  • the client logs out to the information service center, and the information service center deletes the cancelled client information from the synchronization information table.
  • the client When a client information of the distributed system is changed, the client performs a change registration with the information service center, and the information service center updates the client information in the synchronization information table.
  • the present invention adopts a method of data synchronization initiated by one end and asynchronously responding by synchronous end, thereby avoiding the drawback of waste of network resources existing in the existing polling synchronization mode and reducing the data synchronization.
  • the amount of system resources required; and the asynchronous data synchronization network communication method is more flexible, more adaptable, less occupied by the communication network, and ensures the data integrity and uniformity of the distributed system.
  • Figure 1 is a schematic diagram of the connection between the server and the client through the network.
  • Figure 2 is a schematic diagram of all the basic information and environment preparation framework.
  • FIG. 3 is a schematic flow chart of the information service center notifying the client that saves the data of the data change.
  • FIG. 4 is a schematic flow chart of the client 1 updating data.
  • FIG. 5 is a schematic diagram of a process of updating data by the client 3.
  • an information service center an information service center and three information clients.
  • the general form of the information service center, that is, the server, and the client-based network connection is shown in Figure 1.
  • the specific network connection method is not considered here, as long as the server and the client can communicate in some way.
  • the basic information is the data that needs to be used during data synchronization execution.
  • Environment refers to the operation above the data, the environment in which interactions between systems can be performed.
  • the synchronous data stored in the information service center is divided as a whole. It can be a full or partial division of the synchronization data, which is set according to the specific information synchronization requirements.
  • An example of the division of data stored in an information service center is shown in Table 1.
  • the data set identifier in Table 1 is unique, indicating the corresponding data range; the version number is the version of the data corresponding to the data set identifier; the data refers to all the data contained in the corresponding data set identifier, which can be specified by the data index range or other methods. .
  • a data set can be a full, partial, or other more complex form of data.
  • the mapping of data to data sets can be used to determine which mapping set or which data the data belongs to.
  • the update method may adopt an incremental method.
  • a synchronization information table corresponding to each client is stored in the information service center, and the client also stores information for communicating with the information service center.
  • the information service center and the client are required to provide corresponding synchronization functions according to the supported communication methods.
  • the synchronization information table of the information service center is shown in Table 2 below.
  • the client identifier corresponds to the client; the data set and version correspond to the data set to be synchronized between the client and the information service center, and the identifier of the data set on the client; the communication type and the communication identifier are given to the information service center.
  • the client also saves similar information from the Information Service Center. This information allows any one of the information service center or the client to actively communicate.
  • the synchronization contact information may be preset in the information service center and the client, or may be registered, modified, and cancelled by each client to the information service center by means of dynamic request.
  • the registration corresponds to adding a synchronization information table row;
  • the logout is the reverse process of registration;
  • the modification mainly includes changing the data set, the communication type, the communication identifier, and the like synchronized by the client and the information service center.
  • the type of communication is not limited, as long as the server and client can transmit information, for example, the communication types supported by the client are TCP/IP, RPC, RMI, HTTP, HTTPS, Socket, Emal, QQ, WeChat, 263, Ali Wangwang, etc. Etc., for each type of communication, a corresponding communication identifier is required to be able to send information directly or indirectly to the client.
  • Table 3 An example of the information service center contact information table saved by the client is shown in Table 3. Because it is only necessary to ensure that the data of the information service center exists and is up-to-date, the corresponding data set and version are not stored in the contact information table of the information service center of the client.
  • the client also saves the dataset information it contains that is synchronized with the information service center.
  • Table 4, Table 5, and Table 6 correspond to the synchronization data sets contained in Client 1, Client 2, and Client 3, respectively.
  • FIG. 1 A schematic diagram that combines all the basic information and environmental preparation is shown in Figure 2.
  • the entire synchronization process is carried out through the interaction between the server and the client.
  • the notification phase mainly refers to the client that needs to notify the change when the data of the information service center changes.
  • the synchronization phase mainly refers to the client performing a specific data synchronization operation according to the received information after receiving the notification, so that the data is consistent with the information service center.
  • Step I the information service center performs:
  • the data set that needs to be updated may be determined
  • the client identifier is found in the synchronous contact information table, and the communication type and communication identifier corresponding to the client identifier can also be found;
  • Step II client execution:
  • the communication steps of the first stage are shown in Figure 3; the communication steps of the second stage of the client 1 are shown in Figure 4, and the communication steps of the client 3 are as shown in Figure 5. ,.
  • the first phase synchronization means that the client synchronizes the change data to the information service center, in which the client includes the latest data version number confirmed to the information service center;
  • the information service center updates the data and sets the version number of the corresponding data of the client. ⁇

Landscapes

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

Abstract

The present invention relates to an asynchronous data synchronization method for a distributed system, and the distributed system comprises an information service center and a plurality of clients. Synchronization data is stored on the information service center, and a synchronization information table is arranged on the information service center. When data in the information service center changes, a data update message is transmitted to a target in the synchronization information table. The clients update the synchronization data thereof when receiving the data update message. After the data updating, the clients notify the information service center of a latest data version. The information service center updates the synchronization information table after receiving the latest data version. In the present invention, a data synchronization method in which one end initiates synchronization and a synchronous end makes a response asynchronously is used, the disadvantages of waste of network resources caused by the existing polling synchronization method are avoided, and the amount of system resources needed for data synchronization is reduced. In addition, the network communication mode of asynchronous data synchronization is more flexible and adaptive, occupation of the communication network is less, and the data integrity and unity of the distributed system are ensured.

Description

分布式系统异步式数据同步的方法Distributed system asynchronous data synchronization method 技术领域Technical field
本发明涉及计算机分布式软件系统,尤其涉及到分布式系统中信息同步的方法。The present invention relates to a computer distributed software system, and more particularly to a method of information synchronization in a distributed system.
背景技术Background technique
计算机软件系统中,特别是分布式系统,都存在需要在多个系统之间同步信息的情况。常用的信息同步方法有轮询和通知两类。通过轮询方法同步,比较浪费资源。因为需要以一定的间隔重复查询,轮询的代价由轮询间隔确定。通知是异步方法,发生信息改变的系统通知需要同步的所有系统,信息发生了变化。由收到通知的系统决定如何同步信息。In computer software systems, especially distributed systems, there is a need to synchronize information between multiple systems. Commonly used information synchronization methods are polling and notification. Synchronized by polling method, it is a waste of resources. Because the query needs to be repeated at regular intervals, the cost of polling is determined by the polling interval. Notification is an asynchronous method. The system that changes information notifies all systems that need to be synchronized, and the information changes. The system that receives the notification determines how to synchronize the information.
发明内容Summary of the invention
本发明所要解决的技术问题是提供一种分布式系统异步式数据同步的方法,减少同步过程中的系统资源的浪费,同时降低对服务器的系统要求。The technical problem to be solved by the present invention is to provide a method for asynchronous data synchronization of a distributed system, which reduces waste of system resources in the synchronization process and reduces system requirements on the server.
为解决上述技术问题,本发明提供一种分布式系统异步式数据同步的方法,包括一个信息服务中心、与所述信息服务中心通讯连接的若干个分布式客户端:To solve the above technical problem, the present invention provides a method for asynchronous data synchronization in a distributed system, comprising an information service center and a plurality of distributed clients communicatively connected to the information service center:
所述信息服务中心上保存一张与各客户端对应的同步信息表,所述客户端也保存与所述信息服务中心进行通讯的信息;The information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
所述信息服务中心的数据发生变化时,所述信息服务中心根据所述同步信息表,将数据更新消息传递到同步信息表中的目标;When the data of the information service center changes, the information service center transmits the data update message to the target in the synchronization information table according to the synchronization information table;
所述数据更新消息可以有两种情况:一种包含所有数据的变化,一种仅仅是通知数据有变化;The data update message may have two situations: one includes all data changes, and the other is only notification data changes;
所述信息服务中心发送数据更新消息如果成功,则结束,如果发送失败,经多次尝试后放弃;If the information service center sends a data update message, if it succeeds, it ends. If the transmission fails, it is discarded after multiple attempts;
一个所述客户端收到一条或多条数据更新消息后,根据数据版本最新的消息更新数据更新后向所述信息服务中心告知最新数据版本;After receiving the one or more data update messages, the client updates the data update according to the latest version of the data version, and then notifies the information service center of the latest data version;
所述信息服务中心收到所述告知最新数据版本后,更新所述同步信息表。After receiving the notification of the latest data version, the information service center updates the synchronization information table.
当所述客户端接收到的数据更新消息包含所有数据的变化时,则所述客户端直接根据数据差别信息更新自身的同步数据。When the data update message received by the client includes a change of all the data, the client directly updates its own synchronization data according to the data difference information.
当所述客户端接收到的数据更新消息仅仅是数据有变化的通知时,则所述客户端根据自身数据的版本号向服务器请求所有变化的数据,以更新自身的同步数据。 When the data update message received by the client is only a notification that the data has changed, the client requests all the changed data from the server according to the version number of the self data to update its own synchronization data.
优选的,所述同步信息表内容包括各个客户端的标识、同步数据信息、通讯类型和通讯标识;Preferably, the content of the synchronization information table includes an identifier of each client, synchronization data information, a communication type, and a communication identifier;
所述信息服务中心的数据发生变化时,信息服务中心在所述同步信息表中查找变化数据对应的客户端标识、该客户端标识对应的通讯类型和通讯标识;When the data of the information service center changes, the information service center searches the synchronization information table for the client identifier corresponding to the change data, the communication type corresponding to the client identifier, and the communication identifier;
信息服务中心根据所述通讯类型和通讯标识,将数据更新消息传递到需要数据同步的目标。The information service center transmits the data update message to the target that needs data synchronization according to the communication type and the communication identifier.
基于同样的技术构思,本发明提供客户端的数据最先发生变化情况下的一种分布式系统异步式数据同步的方法,包括一个信息服务中心、与所述信息服务中心通讯连接的若干个分布式客户端:Based on the same technical concept, the present invention provides a method for asynchronous data synchronization of a distributed system in which a client's data first changes, including an information service center and a plurality of distributed communication links with the information service center. Client:
所述信息服务中心上保存一张与各客户端对应的同步信息表,所述客户端也保存与所述信息服务中心进行通讯的信息;The information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
当某一个客户端的数据最先发生变化时,该同步发起客户端根据所述信息服务中心联系信息表,向信息服务中心发送数据变化信息,如果发送成功,则结束;如果失败,经多次尝试后放弃;When the data of a certain client first changes, the synchronization initiation client sends data change information to the information service center according to the information service center contact information table, and if the transmission is successful, the process ends; if it fails, multiple attempts are made. Give up
所述信息服务中心收到该同步发起客户端的数据变化信息后,更新同步数据,并更新所述同步信息表;After receiving the data change information of the synchronization initiation client, the information service center updates the synchronization data and updates the synchronization information table;
所述信息服务中心根据所述同步信息表,将数据更新消息传递到需要数据同步的其它目标客户端,步骤与信息服务中心的数据发生变化相同。The information service center transmits the data update message to other target clients that need data synchronization according to the synchronization information table, and the steps are the same as the data of the information service center.
同样的,当所述客户端接收到的数据更新消息包含所有数据的变化时,则所述客户端直接根据数据差别信息更新自身的同步数据。Similarly, when the data update message received by the client includes all the changes of the data, the client directly updates its own synchronization data according to the data difference information.
当所述客户端接收到的数据更新消息仅仅一种通知数据有变化的通知时,则所述客户端根据自身数据的版本号向服务器请求所有变化的数据,以更新自身的同步数据。When the data update message received by the client is only one notification that the notification data has a change, the client requests all the changed data from the server according to the version number of the self data to update its own synchronization data.
当一个客户端加入所述分布式系统时,该客户端向所述信息服务中心进行注册登记,所述信息服务中心将注册的客户端信息添加入所述同步信息表中。When a client joins the distributed system, the client registers with the information service center, and the information service center adds the registered client information to the synchronization information table.
当一个客户端脱离所述分布式系统时,该客户端向所述信息服务中心进行注销登记,所述信息服务中心将注销的客户端信息从所述同步信息表中删除。When a client leaves the distributed system, the client logs out to the information service center, and the information service center deletes the cancelled client information from the synchronization information table.
当所述分布式系统的一个客户端信息变更时,该客户端向所述信息服务中心进行变更登记,所述信息服务中心更新所述同步信息表内该客户端信息。When a client information of the distributed system is changed, the client performs a change registration with the information service center, and the information service center updates the client information in the synchronization information table.
有益效果:本发明采用一端发起、同步端异步响应的数据同步的方法,避免了现有轮询同步方式存在的网络资源浪费的弊端,降低了数据同步所 需要的系统资源量;而且异步式数据同步的网络通讯方式更加灵活,适应性更广,对通讯网络的占用更小,同时保证了分布式系统的数据完整性、统一性。Advantageous Effects: The present invention adopts a method of data synchronization initiated by one end and asynchronously responding by synchronous end, thereby avoiding the drawback of waste of network resources existing in the existing polling synchronization mode and reducing the data synchronization. The amount of system resources required; and the asynchronous data synchronization network communication method is more flexible, more adaptable, less occupied by the communication network, and ensures the data integrity and uniformity of the distributed system.
附图说明DRAWINGS
下面结合附图和具体实施方式对本发明的技术方案作进一步具体说明。The technical solutions of the present invention are further described in detail below with reference to the accompanying drawings and specific embodiments.
图1为服务器和客户端通过网络连接示意图。Figure 1 is a schematic diagram of the connection between the server and the client through the network.
图2为所有基础信息和环境准备框架示意图。Figure 2 is a schematic diagram of all the basic information and environment preparation framework.
图3为信息服务中心向保存数据的客户端通知数据变化的流程示意图。FIG. 3 is a schematic flow chart of the information service center notifying the client that saves the data of the data change.
图4为客户端1更新数据的流程示意图。FIG. 4 is a schematic flow chart of the client 1 updating data.
图5为客户端3更新数据的流程示意图。FIG. 5 is a schematic diagram of a process of updating data by the client 3.
具体实施方式detailed description
不失一般性,将参与信息同步的系统各方简化为以下形式:一个信息服务中心,3个信息客户端。信息服务中心,也就是服务器,和客户端基于网络连接的一般形式如图1所示。这里不考虑具体的网络连接方式,因为只要服务器和客户端之间能够通过某种方式进行通信即可。Without loss of generality, the parties involved in synchronizing information are simplified into the following forms: an information service center and three information clients. The general form of the information service center, that is, the server, and the client-based network connection is shown in Figure 1. The specific network connection method is not considered here, as long as the server and the client can communicate in some way.
基础信息是数据同步执行过程中需要使用到的数据。环境是指数据之上的操作,各系统之间的交互能够执行的环境。The basic information is the data that needs to be used during data synchronization execution. Environment refers to the operation above the data, the environment in which interactions between systems can be performed.
以信息服务中心存储的同步数据作为整体,对其进行划分。可以是同步数据的一个全划分或部分划分,根据具体的信息同步需求进行设置。一个信息服务中心存储数据的划分示例如表1所示。The synchronous data stored in the information service center is divided as a whole. It can be a full or partial division of the synchronization data, which is set according to the specific information synchronization requirements. An example of the division of data stored in an information service center is shown in Table 1.
表1同步数据划分Table 1 Synchronous data partitioning
表1中数据集标识具有唯一性,指示对应的数据范围;版本号是数据集标识对应数据的版本;数据是指包含在对应数据集标识下的所有数据,可以通过数据索引范围或者其他方法指定。The data set identifier in Table 1 is unique, indicating the corresponding data range; the version number is the version of the data corresponding to the data set identifier; the data refers to all the data contained in the corresponding data set identifier, which can be specified by the data index range or other methods. .
数据集可以是数据的全划分、部分划分或者其它更加复杂的形式。数据到数据集的映射关系可以用来判定数据属于哪个或哪些映射集。当每次数据集中的数据被修改时,更新其对应的版本号,一般来说更新方式可以采用逐一递增的方法。A data set can be a full, partial, or other more complex form of data. The mapping of data to data sets can be used to determine which mapping set or which data the data belongs to. When the data in each data set is modified, the corresponding version number is updated. Generally, the update method may adopt an incremental method.
在信息服务中心保存一张与各客户端对应的同步信息表,客户端也保存与信息服务中心进行通讯的信息。一般来说,需要信息服务中心和客户端根据支持的通信方式提供相应的同步功能。信息服务中心的同步信息表如下表2所示。A synchronization information table corresponding to each client is stored in the information service center, and the client also stores information for communicating with the information service center. In general, the information service center and the client are required to provide corresponding synchronization functions according to the supported communication methods. The synchronization information table of the information service center is shown in Table 2 below.
表2同步信息表Table 2 synchronization information table
表2中,客户端标识对应到客户端;数据集和版本对应客户端和信息服务中心之间需同步的数据集,以及该数据集在客户端的标识;通讯类型和通讯标识给出信息服务中心与客户端通信的联系方式和联系信息。客户端也保存信息服务中心的类似信息。这些信息使信息服务中心或客户端两方中任何一方都可以主动进行通信。In Table 2, the client identifier corresponds to the client; the data set and version correspond to the data set to be synchronized between the client and the information service center, and the identifier of the data set on the client; the communication type and the communication identifier are given to the information service center. Contact and contact information for communicating with the client. The client also saves similar information from the Information Service Center. This information allows any one of the information service center or the client to actively communicate.
同步联系信息可以预先设置在信息服务中心和客户端,也可以通过动态请求的方式由各客户端向信息服务中心进行注册,修改和注销。一般来说,注册对应增加一个同步信息表行;注销是注册的逆过程;修改主要包括改变客户端和信息服务中心同步的数据集、通讯类型、通讯标识等。The synchronization contact information may be preset in the information service center and the client, or may be registered, modified, and cancelled by each client to the information service center by means of dynamic request. Generally, the registration corresponds to adding a synchronization information table row; the logout is the reverse process of registration; the modification mainly includes changing the data set, the communication type, the communication identifier, and the like synchronized by the client and the information service center.
通讯类型不限,只要服务端、客户端能够传递信息即可,例如:客户端支持的通讯类型TCP/IP,RPC,RMI,HTTP,HTTPS,Socket,Emal,QQ、微信,263、阿里旺旺等等,对于每种通讯类型都需要提供对应的通讯标识以便能够将信息直接或间接发送到客户端。The type of communication is not limited, as long as the server and client can transmit information, for example, the communication types supported by the client are TCP/IP, RPC, RMI, HTTP, HTTPS, Socket, Emal, QQ, WeChat, 263, Ali Wangwang, etc. Etc., for each type of communication, a corresponding communication identifier is required to be able to send information directly or indirectly to the client.
客户端保存的信息服务中心联系信息表的一个示例如表3所示。因为只需要保证的是信息服务中心的数据存在并是最新的,所以在客户端的信息服务中心联系信息表中不用存储对应的数据集和版本。An example of the information service center contact information table saved by the client is shown in Table 3. Because it is only necessary to ensure that the data of the information service center exists and is up-to-date, the corresponding data set and version are not stored in the contact information table of the information service center of the client.
表3客户端保存的信息服务中心联系信息表Table 3 Information Service Center Contact Information Table Saved by Client
客户端也保存其包含的与信息服务中心同步的数据集信息。关于客户端同步数据集的示例,如表4、表5和表6分别对应客户端1,客户端2和客户端3中包含的同步数据集。The client also saves the dataset information it contains that is synchronized with the information service center. For examples of client synchronization data sets, Table 4, Table 5, and Table 6 correspond to the synchronization data sets contained in Client 1, Client 2, and Client 3, respectively.
表4客户端1的同步数据集Table 4 Synchronous data set of client 1
表5客户端2的同步数据集Table 5 Synchronous data set of client 2
表6客户端3的同步数据集Table 6 Synchronous data set of client 3
将所有的基础信息和环境准备结合起来的一个示意图如图2所示。A schematic diagram that combines all the basic information and environmental preparation is shown in Figure 2.
下面详细描述分布式系统之间的信息同步流程如下:The following describes in detail the information synchronization process between distributed systems as follows:
按信息同步的流程,主要有两种情况:According to the process of information synchronization, there are two main situations:
(一)信息服务中心的数据最先发生变化;(1) The data of the information service center changes first;
(二)某一个客户端的数据最先发生变化。(2) The data of a certain client first changes.
整个同步流程的进行都是通过服务端和客户端双方之间的交互完成。The entire synchronization process is carried out through the interaction between the server and the client.
两种情况下同步的整个过程都是分阶段进行的。下面就这两种信息同步的流程分别进行说明。In both cases, the entire process of synchronization is done in stages. The following describes the process of synchronizing these two kinds of information separately.
(一)信息服务中心的数据最先发生变化时的数据同步 (1) Data synchronization when the data of the information service center changes first
当信息服务中心数据最先变化时,主要有通知和同步两个阶段。通知阶段主要指信息服务中心的数据发生变化时,将这种变化通知需要的客户端。同步阶段则主要指客户端接收到通知后,根据接收的信息执行具体的数据同步操作,使数据与信息服务中心保持一致。When the information service center data changes first, there are two stages of notification and synchronization. The notification phase mainly refers to the client that needs to notify the change when the data of the information service center changes. The synchronization phase mainly refers to the client performing a specific data synchronization operation according to the received information after receiving the notification, so that the data is consistent with the information service center.
步骤I、信息服务中心执行:Step I, the information service center performs:
1.当信息服务中心数据发生变化时,根据数据到数据集的映射关系可以确定需要更新版本的数据集;1. When the data of the information service center changes, according to the mapping relationship of the data to the data set, the data set that needs to be updated may be determined;
2.根据需要更新的数据集,在同步联系信息表中查找到客户端标识,同时也可以找到与该客户端标识对应的通讯类型和通讯标识;2. According to the data set that needs to be updated, the client identifier is found in the synchronous contact information table, and the communication type and communication identifier corresponding to the client identifier can also be found;
3.将数据更新消息根据通讯类型和通讯标识传递到对应的目标。3. Pass the data update message to the corresponding target based on the communication type and communication identifier.
4.数据更新消息发送成功则结束。如果发送失败,经多次尝试后放弃。4. The data update message ends successfully. If the transmission fails, give up after multiple attempts.
步骤II、客户端执行:Step II, client execution:
1.收到一条或多条数据更新消息,根据数据更新消息中的数据版本信息选择最近的一条数据更新消息;1. Receive one or more data update messages, and select a latest data update message according to the data version information in the data update message;
2.判断如果数据更新消息是当前数据与最新数据之间的差别,直接更新数据;否则,向信息服务中心请求当前数据与最新数据的差别;2. Judging if the data update message is the difference between the current data and the latest data, directly updating the data; otherwise, requesting the information service center to distinguish the current data from the latest data;
【信息服务中心相应服务:计算数据的差别。】[Information Service Center corresponding service: Calculate the difference in data. 】
3.更新数据及版本;3. Update data and version;
4.向信息服务中心确认更新后的数据版本。如果失败,经多次尝试后放弃。4. Confirm the updated data version to the Information Service Center. If it fails, give up after many attempts.
【信息服务中心相应服务:更新同步信息表中该客户端对应的数据版本信息。】[Information Service Center corresponding service: Update the data version information corresponding to the client in the synchronization information table. 】
其中需要说明的是,【】括号中的内容表示通信时,通信的对方需要完成的工作。It should be noted that the content in the brackets of [] indicates the work that the other party of the communication needs to complete when communicating.
示例:Example:
以信息服务中心dataPart1发生变化为例,第一个阶段的通信步骤如图3所示;第二个阶段客户端1的通信步骤如图4所示,客户端3的通信步骤如图5所示,。Taking the information service center dataPart1 as an example, the communication steps of the first stage are shown in Figure 3; the communication steps of the second stage of the client 1 are shown in Figure 4, and the communication steps of the client 3 are as shown in Figure 5. ,.
(二)某一个客户端的数据最先发生变化时的数据同步。(2) Data synchronization when the data of a certain client first changes.
当某个客户端数据最先变化时,主要有同步,通知和再同步三个阶段。第一个阶段同步是指客户端将变化数据同步至信息服务中心,在该阶段中包含客户端向信息服务中心确认最新数据版本号;When a client's data changes first, there are three phases: synchronization, notification, and resynchronization. The first phase synchronization means that the client synchronizes the change data to the information service center, in which the client includes the latest data version number confirmed to the information service center;
步骤I’、在客户端1:Step I', at client 1:
1.更新数据并记录数据变化信息;1. Update data and record data change information;
2.更新数据对应的版本号;2. Update the version number corresponding to the data;
3.向信息服务中心发送数据变化信息和新的数据版本号; 3. Send data change information and new data version number to the information service center;
【信息服务中心更新数据,并设置该客户端对应数据的版本号。】[The information service center updates the data and sets the version number of the corresponding data of the client. 】
4.如果成功,则结束;如果失败,经多次尝试后放弃。4. If successful, end; if it fails, give up after multiple attempts.
后续步骤同(一)中所有步骤。本领域技术人员能够理解,故不赘述。The next steps are the same as in (a). Those skilled in the art can understand and therefore will not be described.
最后所应说明的是,以上具体实施方式仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。 It should be understood that the above specific embodiments are only illustrative of the technical solutions of the present invention, and are not to be construed as limiting. The technical solutions are modified or equivalent, without departing from the spirit and scope of the invention, and are intended to be included within the scope of the appended claims.

Claims (9)

  1. 一种分布式系统异步式数据同步的方法,其特征在于,包括一个信息服务中心、与所述信息服务中心通讯连接的若干个分布式客户端:A method for asynchronous data synchronization in a distributed system, comprising: an information service center; and a plurality of distributed clients connected to the information service center:
    所述信息服务中心上保存一张与各客户端对应的同步信息表,所述客户端也保存与所述信息服务中心进行通讯的信息;The information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
    所述信息服务中心的数据发生变化时,所述信息服务中心根据所述同步信息表,将数据更新消息传递到同步信息表中的目标;When the data of the information service center changes, the information service center transmits the data update message to the target in the synchronization information table according to the synchronization information table;
    所述信息服务中心发送数据更新消息如果成功,则结束,如果发送失败,经多次尝试后放弃;If the information service center sends a data update message, if it succeeds, it ends. If the transmission fails, it is discarded after multiple attempts;
    一个所述客户端收到一条或多条数据更新消息后,根据数据版本最新的消息更新数据,更新后向所述信息服务中心告知最新数据版本;After receiving the one or more data update messages, the client updates the data according to the latest news of the data version, and updates the information service center to the latest data version after updating;
    所述信息服务中心收到所述告知最新数据版本后,更新所述同步信息表。After receiving the notification of the latest data version, the information service center updates the synchronization information table.
  2. 根据权利要求1所述的分布式系统异步式数据同步的方法,其特征在于,The method for asynchronous data synchronization of a distributed system according to claim 1, wherein
    所述客户端接收到的数据更新消息包含所有数据的变化,则所述客户端直接根据数据差别信息更新自身的同步数据。The data update message received by the client includes all the changes of the data, and the client directly updates its own synchronization data according to the data difference information.
  3. 根据权利要求1所述的分布式系统异步式数据同步的方法,其特征在于,The method for asynchronous data synchronization of a distributed system according to claim 1, wherein
    所述客户端接收到的数据更新消息仅仅是数据有变化的通知,则所述客户端根据自身数据的版本号向服务器请求所有变化的数据,以更新自身的同步数据。The data update message received by the client is only a notification that the data has changed, and the client requests all the changed data to the server according to the version number of the data to update its own synchronization data.
  4. 根据权利要求1至3之一所述的分布式系统异步式数据同步的方法,其特征在于,所述同步信息表内容包括各个客户端的标识、同步数据信息、通讯类型和通讯标识;The method for asynchronous data synchronization of a distributed system according to any one of claims 1 to 3, wherein the content of the synchronization information table includes an identifier of each client, synchronization data information, a communication type, and a communication identifier;
    所述信息服务中心的数据发生变化时,信息服务中心在所述同步信息表中查找变化数据对应的客户端标识、该客户端标识对应的通讯类型和通讯标识;When the data of the information service center changes, the information service center searches the synchronization information table for the client identifier corresponding to the change data, the communication type corresponding to the client identifier, and the communication identifier;
    信息服务中心根据所述通讯类型和通讯标识,将数据更新消息传递到通讯类型和通讯标识对应的目标。The information service center transmits the data update message to the target corresponding to the communication type and the communication identifier according to the communication type and the communication identifier.
  5. 根据权利要求1所述的分布式系统异步式数据同步的方法,其特征在于,The method for asynchronous data synchronization of a distributed system according to claim 1, wherein
    一个客户端加入所述分布式系统,该客户端向所述信息服务中心进行注册登记,所述信息服务中心将注册的客户端信息添加入所述同步信息表中;a client joins the distributed system, the client registers with the information service center, and the information service center adds the registered client information to the synchronization information table;
    一个客户端脱离所述分布式系统,该客户端向所述信息服务中心进行注销登记,所述信息服务中心将注销的客户端信息从所述同步信息表中删除;A client detaches from the distributed system, and the client performs logout registration with the information service center, and the information service center deletes the logged-out client information from the synchronization information table;
    所述分布式系统的一个客户端信息变更,该客户端向所述信息服务中心进行变更登记,所述信息服务中心更新所述同步信息表内该客户端信息。A client information of the distributed system is changed, the client performs change registration with the information service center, and the information service center updates the client information in the synchronization information table.
  6. 一种分布式系统异步式数据同步的方法,其特征在于,包括一个信息服务中心、与所述信息服务中心通讯连接的若干个分布式客户端:A method for asynchronous data synchronization in a distributed system, comprising: an information service center; and a plurality of distributed clients connected to the information service center:
    所述信息服务中心上保存一张与各客户端对应的同步信息表,所述客户端也保存与所述信息服务中心进行通讯的信息; The information service center stores a synchronization information table corresponding to each client, and the client also stores information for communicating with the information service center;
    当某一个客户端的数据最先发生变化时,该同步发起客户端根据所述信息服务中心联系信息表,向信息服务中心发送数据变化信息,如果发送成功,则结束;如果失败,经多次尝试后放弃;When the data of a certain client first changes, the synchronization initiation client sends data change information to the information service center according to the information service center contact information table, and if the transmission is successful, the process ends; if it fails, multiple attempts are made. Give up
    所述信息服务中心收到该同步发起客户端的数据变化信息后,更新同步数据,并更新所述同步信息表;After receiving the data change information of the synchronization initiation client, the information service center updates the synchronization data and updates the synchronization information table;
    所述信息服务中心根据所述同步信息表,将数据更新消息传递到需要数据同步的其它目标客户端,The information service center delivers the data update message to other target clients that need data synchronization according to the synchronization information table.
    所述客户端收到一条或多条数据更新消息后,根据数据版本最新的消息更新数据,更新后向所述信息服务中心告知最新数据版本;After receiving the one or more data update messages, the client updates the data according to the latest news of the data version, and updates the information service center to the latest data version after updating;
    所述信息服务中心收到所述告知最新数据版本后,更新所述同步信息表。After receiving the notification of the latest data version, the information service center updates the synchronization information table.
  7. 根据权利要求6所述的分布式系统异步式数据同步的方法,其特征在于,A method for asynchronous data synchronization of a distributed system according to claim 6, wherein
    所述客户端接收到的数据更新消息包含所有数据的变化,则所述客户端直接根据数据差别信息更新自身的同步数据。The data update message received by the client includes all the changes of the data, and the client directly updates its own synchronization data according to the data difference information.
  8. 根据权利要求6所述的分布式系统异步式数据同步的方法,其特征在于,A method for asynchronous data synchronization of a distributed system according to claim 6, wherein
    所述客户端接收到的数据更新消息仅仅一种通知数据有变化的通知,则所述客户端根据自身数据的版本号向服务器请求所有变化的数据,以更新自身的同步数据。The data update message received by the client is only a notification that the notification data has changed, and the client requests all the changed data to the server according to the version number of the self data to update its own synchronization data.
  9. 根据权利要求6至8之一所述的分布式系统异步式数据同步的方法,其特征在于,A method for asynchronous data synchronization of a distributed system according to any one of claims 6 to 8, characterized in that
    一个客户端加入所述分布式系统,该客户端向所述信息服务中心进行注册登记,所述信息服务中心将注册的客户端信息添加入所述同步信息表中;a client joins the distributed system, the client registers with the information service center, and the information service center adds the registered client information to the synchronization information table;
    一个客户端脱离所述分布式系统,该客户端向所述信息服务中心进行注销登记,所述信息服务中心将注销的客户端信息从所述同步信息表中删除;A client detaches from the distributed system, and the client performs logout registration with the information service center, and the information service center deletes the logged-out client information from the synchronization information table;
    所述分布式系统的一个客户端信息变更,该客户端向所述信息服务中心进行变更登记,所述信息服务中心更新所述同步信息表内该客户端信息。 A client information of the distributed system is changed, the client performs change registration with the information service center, and the information service center updates the client information in the synchronization information table.
PCT/CN2016/108776 2015-12-31 2016-12-07 Asynchronous data synchronization method for distributed system WO2017114111A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201511025961.9 2015-12-31
CN201511025961.9A CN105743970A (en) 2015-12-31 2015-12-31 Asynchronous data synchronization method for distributed systems

Publications (1)

Publication Number Publication Date
WO2017114111A1 true WO2017114111A1 (en) 2017-07-06

Family

ID=56296128

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108776 WO2017114111A1 (en) 2015-12-31 2016-12-07 Asynchronous data synchronization method for distributed system

Country Status (2)

Country Link
CN (1) CN105743970A (en)
WO (1) WO2017114111A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111835855A (en) * 2020-07-17 2020-10-27 浪潮软件股份有限公司 Data synchronization method and system

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105743970A (en) * 2015-12-31 2016-07-06 武汉传神信息技术有限公司 Asynchronous data synchronization method for distributed systems
CN107071005A (en) * 2017-03-24 2017-08-18 厦门中控生物识别信息技术有限公司 A kind of method of data synchronization and system
CN109213769B (en) * 2017-06-30 2022-04-29 华为技术有限公司 Data conflict identification method for data object
CN109857747B (en) * 2018-12-18 2021-07-13 百度在线网络技术(北京)有限公司 Data synchronous updating method, system and computer equipment
CN109684342A (en) * 2018-12-21 2019-04-26 成都四方伟业软件股份有限公司 Data managing method and device
CN111741038B (en) * 2019-03-25 2022-02-25 华为技术有限公司 Data transmission method and data transmission device
CN110942393B (en) * 2019-11-11 2023-08-15 支付宝(杭州)信息技术有限公司 Transaction processing method and device based on main account and sub account, and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064630A (en) * 2006-04-24 2007-10-31 华为技术有限公司 Data synchronization method and system
CN102063494A (en) * 2010-12-31 2011-05-18 青岛海信网络科技股份有限公司 Database synchronizing method and device
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
CN105635286A (en) * 2015-12-31 2016-06-01 武汉传神信息技术有限公司 Method for synchronous data synchronization of distributed system
CN105743970A (en) * 2015-12-31 2016-07-06 武汉传神信息技术有限公司 Asynchronous data synchronization method for distributed systems

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8077736B2 (en) * 2008-02-25 2011-12-13 Newport Media, Inc. Fast audio/visual reception in DVB-H systems
CN101426026B (en) * 2008-09-17 2013-07-03 北京六维世纪网络技术有限公司 Method and system for data synchronization between multiple servers
CN101778134A (en) * 2010-01-11 2010-07-14 青岛海信移动通信技术股份有限公司 Data synchronization method and mobile communication terminal
CN104052768A (en) * 2013-03-13 2014-09-17 彭涛 Distributed multi-point synchronization system and synchronization method thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101064630A (en) * 2006-04-24 2007-10-31 华为技术有限公司 Data synchronization method and system
CN102202073A (en) * 2010-03-24 2011-09-28 杭州华三通信技术有限公司 Distributed system and data synchronization method thereof
CN102063494A (en) * 2010-12-31 2011-05-18 青岛海信网络科技股份有限公司 Database synchronizing method and device
CN105635286A (en) * 2015-12-31 2016-06-01 武汉传神信息技术有限公司 Method for synchronous data synchronization of distributed system
CN105743970A (en) * 2015-12-31 2016-07-06 武汉传神信息技术有限公司 Asynchronous data synchronization method for distributed systems

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111835855A (en) * 2020-07-17 2020-10-27 浪潮软件股份有限公司 Data synchronization method and system

Also Published As

Publication number Publication date
CN105743970A (en) 2016-07-06

Similar Documents

Publication Publication Date Title
WO2017114111A1 (en) Asynchronous data synchronization method for distributed system
CN107295080B (en) Data storage method applied to distributed server cluster and server
CN102088489B (en) Distributed data synchronizing system and method
US9983957B2 (en) Failover mechanism in a distributed computing system
EP3490224A1 (en) Data synchronization method and system
JP4381655B2 (en) Storage system, storage device, and information sharing method using the storage device
US8423507B2 (en) Method and system for managing replication of data
US10812578B2 (en) Migration of durable clients in a clustered publish/subscribe system
EP3396568B1 (en) Systems and methods for adaptive data replication
CN105915369B (en) A kind of configuration information management method and device
CN103491055A (en) Method for synchronizing information among clients, clients and server
US10069942B2 (en) Method and apparatus for changing configurations
CN106713497A (en) Server-side message push device and method and message push system
US20190173596A1 (en) Method for fast reconfiguration of gm clocks in the tsn network by means of an explicit teardown message
CN103544303A (en) Data synchronization method, system and device
CN101795295A (en) Local area network virus library upgrading system and method based on P2P technology
CN107734017B (en) Data service method and system
WO2016138931A1 (en) Future certificate revocation using crl
CN105824865A (en) Distributed type database data synchronization system
CN114328618A (en) Cache data synchronization method, device, equipment and storage medium
CN110213359B (en) Internet of vehicles networking data pushing system and method based on D2D
CN105635286A (en) Method for synchronous data synchronization of distributed system
CN112838935B (en) Electronic data exchange method and system
CN103248656A (en) Method for achieving data reading and writing as well as DSF (distributed file system) and client side
CN110912979B (en) Method for solving multi-server resource synchronization conflict

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16880901

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16880901

Country of ref document: EP

Kind code of ref document: A1