A data synchronization method, device, server and program product

By constructing the current latency matrix in the distributed system and using the QUIC protocol to dynamically select the optimal transmission path, the lag problem caused by network instability in traditional data synchronization methods is solved, achieving efficient and low-latency data synchronization.

CN119946073BActive Publication Date: 2026-01-09HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411968804.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2026-01-09
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

Traditional data synchronization methods in distributed systems suffer from data synchronization delays or failures due to network instability, making it difficult to meet the requirements of real-time performance and efficiency, especially in global deployment scenarios.

Method used

By dynamically obtaining the current communication latency between any two servers in the distributed system, constructing a current latency matrix, and using the QUIC protocol for data synchronization, the system dynamically selects the optimal transmission path and uses the shortest path algorithm to select the target server for data synchronization.

Benefits of technology

It improves the efficiency and reliability of data synchronization, reduces network latency, optimizes network bandwidth utilization, adapts to dynamic network changes, and ensures that data is synchronized across the entire network under low latency conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946073B_ABST
    Figure CN119946073B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of communication technology, and provides a data synchronization method and device, a server and a program product. The method determines a current time delay matrix of a distributed system and initial server information corresponding to to-be-synchronized data in response to first data synchronization information; determines whether to perform a synchronization operation for the to-be-synchronized data according to the initial server information; if it is determined to perform the synchronization operation, selects a target server with a communication time delay satisfying a first time delay condition based on the current time delay matrix; and sends second data synchronization information to the target server, so that the target server is used to continue to acquire the current time delay matrix of the distributed system and the initial server information of the to-be-synchronized data, until the to-be-synchronized data is synchronized to all servers of the distributed system according to the current time delay matrix and the initial server information. The method selectively synchronizes data to a node with a lower communication time delay according to the actual situation of a server network, thereby ensuring the efficiency of data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of communication technology, and in particular relates to a data synchronization method, device, server and program product. Background Technology

[0002] With the rapid development of the global internet, deploying large-scale distributed systems worldwide has become commonplace. In distributed systems, clients can access the nearest server in their region to obtain a low-latency and high-performance experience. To achieve this, servers need to ensure consistency of client access by rapidly synchronizing data.

[0003] Traditional data synchronization methods typically rely on the database to synchronize data to all other server nodes. However, due to the instability of the networks of various servers, data synchronization can be delayed, or even fail to synchronize in severe cases. Summary of the Invention

[0004] This application provides a data synchronization method, apparatus, server, and program product that can dynamically adapt to changes in the server network and ensure high efficiency in data synchronization.

[0005] In a first aspect, embodiments of this application provide a data synchronization method, applied to any current server in a distributed system, the method comprising:

[0006] In response to receiving the first data synchronization information, the current delay matrix of the distributed system and the initial server information corresponding to the data to be synchronized in the first data synchronization information are determined. The current delay matrix stores the current communication delay between any two servers in the distributed system, and a Fast User Datagram Protocol Internet connection (QUIC) is established between any two servers.

[0007] Based on the initial server information corresponding to the data to be synchronized, determine whether to perform a synchronization operation on the data to be synchronized.

[0008] If it is determined that a synchronization operation will be performed on the data to be synchronized, then a target server whose communication latency meets the first latency condition is selected from the distributed system based on the current latency matrix, and second data synchronization information is generated based on the initial server information. The first latency condition is used to select the server with the shortest communication latency with the current server using the shortest path algorithm.

[0009] sending second data synchronization information to a target server, wherein the target server is configured to continue to acquire a current latency matrix of the distributed system and initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers of the distributed system according to the current latency matrix and the initial server information of the to-be-synchronized data.

[0010] In some embodiments, determining whether to perform the synchronization operation for the to-be-synchronized data according to the initial server information of the to-be-synchronized data comprises:

[0011] If the initial server information is used to represent the current server, it is determined that the synchronization operation for the to-be-synchronized data is performed.

[0012] In some embodiments, selecting the target server from the distributed system based on the current latency matrix comprises:

[0013] calculating optimal transmission paths between the current server and other servers in the distributed system according to the current latency matrix and a shortest path algorithm;

[0014] selecting a server at a first position in each optimal transmission path as the target server.

[0015] In some embodiments, determining whether to perform the synchronization operation for the to-be-synchronized data according to the initial server information of the to-be-synchronized data comprises:

[0016] If the initial server information is used to represent a server other than the current server, calculating optimal transmission paths between the other server and any server other than the other server in the distributed system according to the current latency matrix and a shortest path algorithm;

[0017] detecting whether there is a next server adjacent to the current server in at least one optimal transmission path;

[0018] If it is detected that there is a next server adjacent to the current server in at least one optimal transmission path, it is determined that the synchronization operation for the to-be-synchronized data is performed.

[0019] If it is detected that there is no next server adjacent to the current server in all optimal transmission paths, it is determined that the synchronization operation for the to-be-synchronized data is not performed, and the to-be-synchronized data is stored to the current server.

[0020] In some embodiments, selecting the target server from the distributed system based on the current latency matrix comprises:

[0021] The next server adjacent to the current server in the at least one optimal transmission path is taken as a target server.

[0022] In some embodiments, after the second data synchronization information is sent to the target server, the method further includes:

[0023] If no response information from the target server is received within a preset time period, a server with a communication delay satisfying a second delay condition is selected from the distributed system as a backup server based on the current delay matrix;

[0024] Based on the current server information of the current server and the target server information of the target server, third data synchronization information is generated;

[0025] The third data synchronization information is sent to the backup server, so that the backup server synchronizes the data to be synchronized to the target server based on the third data synchronization information.

[0026] In some embodiments, after the third data synchronization information is sent to the backup server, the method further includes:

[0027] If no response information from the target server is received by all servers in the distributed system, the current delay matrix of the distributed system is updated according to a preset update period;

[0028] According to the updated current delay matrix, fourth data synchronization information is sent to the target server, and the fourth data request at least includes the current server information and the target server information.

[0029] In some embodiments, the current delay matrix of the distributed system is determined, including:

[0030] The current communication delay between any two servers in the distributed system is dynamically obtained;

[0031] According to the current communication delay between any two servers, the current delay matrix of the distributed system is constructed.

[0032] In some embodiments, the current communication delay includes a first communication delay and a second communication delay, and the current communication delay between any two servers in the distributed system is dynamically obtained, including:

[0033] The first communication delay between the current server and each other server in the distributed system is calculated according to a preset update period;

[0034] Each second communication delay broadcast by each other server is received, and the second communication delay is used to represent the communication delay between each other server and the servers in the distributed system except the other servers.

[0035] In a second aspect, the embodiments of the present application provide a data synchronization device, configured in any one current server in a distributed system, and the device comprises:

[0036] a first determining module, configured to determine a current latency matrix of the distributed system and initial server information corresponding to the to-be-synchronized data in the first data synchronization information in response to receiving the first data synchronization information, wherein the current latency matrix stores current communication latency between any two servers in the distributed system, and a QUIC (Quick User Datagram Protocol Internet Connections) is established between any two servers;

[0037] a second determining module, configured to determine whether to perform a synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data;

[0038] a first selecting module, configured to select a target server with communication latency satisfying a first latency condition from the distributed system based on the current latency matrix and generate second data synchronization information based on the initial server information, if it is determined to perform the synchronization operation on the to-be-synchronized data, wherein the first latency condition is used to select a server with the shortest communication latency from the current server by using a shortest path algorithm;

[0039] a first sending module, configured to send the second data synchronization information to the target server, wherein the target server is configured to continue to acquire the current latency matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current latency matrix and the initial server information corresponding to the to-be-synchronized data.

[0040] In a third aspect, the embodiments of the present application provide a server, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the method of any one of the first aspect when executing the computer program.

[0041] In a fourth aspect, the embodiments of the present application provide a computer program product, which, when running on a server, causes the server to execute the method of any one of the first aspect.

[0042] The embodiment of the application provides a data synchronization method, device, server and program product, the method is applied to any one current server in a distributed system, and the method comprises the following steps: in response to receiving first data synchronization information, determining a current time delay matrix of the distributed system and initial server information corresponding to to-be-synchronized data in the first data synchronization information, wherein the current time delay matrix stores current communication time delays between any two servers in the distributed system, and a quick user datagram protocol Internet connection (QUIC) is established between any two servers; determining whether to perform a synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data; if it is determined to perform the synchronization operation on the to-be-synchronized data, selecting a target server with a communication time delay satisfying a first time delay condition from the distributed system based on the current time delay matrix, and generating second data synchronization information based on the initial server information, wherein the first time delay condition is used to select a server with the shortest communication time delay from the current server by using a shortest path algorithm; and sending the second data synchronization information to the target server, wherein the target server is used to continue to acquire the current time delay matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current time delay matrix and the initial server information corresponding to the to-be-synchronized data. By using the above technical solution, whether to perform the synchronization operation on the to-be-synchronized data is determined according to the initial server information corresponding to the to-be-synchronized data, and in the case of determining to perform the synchronization operation on the to-be-synchronized data, the target server is selected from the distributed system based on the current time delay matrix for data synchronization, so that the to-be-synchronized data can be selectively synchronized to a node with a lower communication time delay according to the actual situation of the server network, the efficiency of data synchronization is ensured, and the efficiency of data synchronization is improved. BRIEF DESCRIPTION OF DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort.

[0044] Figure 1 is a flowchart of a data synchronization method provided by the prior art;

[0045] Figure 2 is a flowchart of a data synchronization method provided by an embodiment of the present application;

[0046] Figure 3 is a structural diagram of a network weighted graph provided by an embodiment of the present application;

[0047] Figure 4 is a structural schematic diagram of another network weighted graph provided by an embodiment of the present application;

[0048] Figure 5 is a flow schematic diagram of a data synchronization method provided by another embodiment of the present application;

[0049] Figure 6 is a network structure block diagram of data synchronization provided by an embodiment of the present application;

[0050] Figure 7 is a structural block diagram of a data synchronization device provided by an embodiment of the present application;

[0051] Figure 8 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION

[0052] In the following description, for the purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

[0053] It should be understood that the term "includes" when used in the specification and the appended claims herein, specifies the presence of stated features, integers, steps, operations, elements, and / or components but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0054] It should also be understood that the term "and / or" when used in the specification and the appended claims herein, means any one or more of the associated listed items can be present, and includes multiples of any one or more of the associated listed items.

[0055] As used in the description of the application and the appended claims herein, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted as meaning "upon determining" or "in response to determining" or "upon detecting [a described condition or event]" or "in response to detecting [a described condition or event]", depending on the context.

[0056] In addition, in the description of the application and the appended claims herein, the terms "first", "second", "third", etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0057] Reference within the specification of this application to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in additional embodiments," and so on, in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily referring to one or more particular embodiments that differ from other embodiments. The terms "including," "comprising," "having," and variations thereof are meant to encompass the items listed thereafter, but do not exclude other items from also being present. Unless otherwise indicated, the terms "including," "comprising," "having," and variations thereof are meant to encompass the items listed thereafter, but do not exclude other items from also being present.

[0058] It should be noted that the information collection process (such as face image collection process, fingerprint information collection process, etc.) / feature extraction process involved in the present application is executed with the user's knowledge and permission, that is, the information collection process / feature extraction process meets the legal and regulatory requirements and does not belong to the act of interfering with the public interest.

[0059] Figure 1 is a flowchart of a data synchronization method provided by the prior art, as shown in Figure 1 The client 1 can upload the to-be-synchronized data to the server 1 through interaction, the server 1 can send the to-be-synchronized data to the database of region 1, and then the database synchronization service can use the Transmission Control Protocol (TCP) protocol to realize data synchronization between servers.

[0060] However, the above-mentioned data synchronization method often adopts a simple group sending mode, that is, the data of any server will be synchronized to all other database nodes at the same time through the database, which can easily increase the communication pressure of the sending server and occupy a large amount of network bandwidth. In addition, the path of data synchronization is usually pre-configured, and lacks dynamic adjustment capability. At the same time, direct point-to-point synchronization in some scenarios can easily cause network delay, especially in abnormal situations, point-to-point cannot communicate normally, which reduces the efficiency of data synchronization.

[0061] In addition, in the scenario of global deployment, data needs to be synchronized across oceans and continents, and the database often uses the traditional TCP protocol. Due to the poor performance of the TCP protocol in high-latency and high-packet-loss network environments, the existing data synchronization method is difficult to meet the real-time and high-efficiency requirements.

[0062] Based on this, the embodiments of the present application propose a data synchronization method, which can dynamically select the optimal synchronization path by statistically analyzing the communication delay between servers, thereby significantly improving the efficiency of data synchronization.

[0063] Figure 2 is a flowchart of a data synchronization method provided by an embodiment of the present application, which is an example and is not limited. The method can be applied to any current server in a distributed system.

[0064] S101, in response to receiving the first data synchronization information, determining the current latency matrix of the distributed system and the initial server information corresponding to the to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores the current communication latency between any two servers in the distributed system, and a QUIC (Quick User Datagram Protocol Internet Connections) is established between any two servers.

[0065] The first data synchronization information can be considered as the data synchronization information received by the current server. The first data synchronization information can include to-be-synchronized data, or other data related to the to-be-synchronized data. The to-be-synchronized data can refer to the data that needs to be synchronized between the servers in the distributed system. The specific type of the to-be-synchronized data is not limited and can be determined according to the business scenario of the client. For example, the to-be-synchronized data can be video data or other data that needs to be synchronized in the entire network. The initial server information can be used to represent the server that initially sends the to-be-synchronized data in the distributed system, that is, the sending source of the to-be-synchronized data in the distributed system.

[0066] The current latency matrix can store the current communication latency between any two servers in the distributed system. The current communication latency is the communication latency between the current any two servers. Since the network state of each server in the distributed system changes in real time, the current latency matrix of the distributed system in this embodiment can be dynamically updated in real time or according to a preset update period, so as to efficiently and low-latency realize data synchronization.

[0067] Further, a quick user datagram protocol internet connection (QUIC) can be established between any two servers in the distributed system, that is, any two servers can communicate with each other through the QUIC protocol. The quick user datagram protocol internet connection (QUIC) protocol is a new connection-oriented and reliable transport layer protocol that combines the speed and performance of the user datagram protocol (UDP) and the security and reliability of the transmission control protocol (TCP). It is a secure general-purpose transport protocol that supports multi-stream multiplexing. That is, the QUIC supports multiple parallel streams. Packet loss in a certain stream will not affect the normal transmission of other streams, avoiding the problem of head-of-line blocking, making data transmission more efficient.

[0068] Specifically, after receiving the first data synchronization information, the current server can determine the current latency matrix of the distributed system and the initial server information corresponding to the to-be-synchronized data in response to the first data synchronization information. The specific determination process can be determined according to actual conditions. For example, the initial server information can be determined based on the source of the first data synchronization information, or the initial server information can be further determined according to the specific content of the first data synchronization information.

[0069] Alternatively, the current latency matrix of the distributed system can be directly determined by being derived from other devices. The current server can also construct the current latency matrix of the distributed system through certain calculations. The present embodiment does not limit this.

[0070] In some embodiments, determining the current latency matrix of the distributed system includes:

[0071] dynamically obtaining the current communication latency between any two servers in the distributed system;

[0072] constructing the current latency matrix of the distributed system according to the current communication latency between any two servers.

[0073] In the specific embodiment, the current server can dynamically obtain the current communication latency between any two servers in the distributed system, and then construct the current latency matrix of the distributed system according to the obtained current communication latency between any two servers. The means of dynamically obtaining the current communication latency between any two servers is not limited and can be determined according to the actual communication connection of the current server or can be different according to the server.

[0074] For example, the current communication latency can include a first communication latency and a second communication latency, the first communication latency can be a communication latency between the current server and each other server in the distributed system, and the second communication latency can be used to represent a communication latency between each other server and a server other than the other server in the distributed system. The current server can calculate the first communication latency between the current server and each other server in the distributed system according to a preset update period. For example, the current server can perform Ping-Pong communication with each other server in the distributed system respectively, measure a one-way latency from the current server to each other server and a one-way latency from each other server to the current server, and then calculate the first communication latency by calculating an average latency. Correspondingly, each other server can also calculate the second communication latency by Ping-Pong communication, and then broadcast the calculated second communication latency, so that all servers can receive the second communication latency broadcast by other servers, thereby obtaining the current communication latency between any two servers in the distributed system.

[0075] Ping-Pong communication can be a method for testing network latency, which usually sends a probe data packet (Ping) from one node to another node and waits for a return response data packet (Pong), and can be used to measure the round-trip time (RTT) between nodes. The preset update period can be configured according to actual conditions, for example, it can be 10 seconds.

[0076] In S102, whether to perform the synchronization operation on the to-be-synchronized data is determined according to the initial server information corresponding to the to-be-synchronized data.

[0077] After the current server receives the first data synchronization information, the current server can determine whether to perform the synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data in the first data synchronization information, that is, whether to synchronize the to-be-synchronized data to other servers. For example, whether to perform the synchronization operation on the to-be-synchronized data can be determined by simply judging whether the initial server information represents the current server. In addition, whether to perform the synchronization operation on the to-be-synchronized data can also be determined by combining a pre-configured calculation strategy. The present embodiment does not further expand this, as long as whether to perform the synchronization operation on the to-be-synchronized data can be determined.

[0078] In some embodiments, whether to perform the synchronization operation on the to-be-synchronized data is determined according to the initial server information corresponding to the to-be-synchronized data, including:

[0079] If the initial server information is used to represent the current server, it is determined that the synchronization operation for the to-be-synchronized data is performed.

[0080] In the specific embodiment, if the source of the first data synchronization information is the client, it indicates that the current server receives the first data synchronization information from the client, and the current server can be considered as the server closest to the client in the distributed system. Therefore, the initial server information can be used to represent the current server, that is, the current server is considered as the sending source of the to-be-synchronized data. At this time, the current server needs to store the to-be-synchronized data and perform the synchronization operation for the to-be-synchronized data, so as to synchronize the to-be-synchronized data to other servers.

[0081] S103, if it is determined that the synchronization operation for the to-be-synchronized data is performed, a target server satisfying a first time delay condition in communication time delay is selected from the distributed system based on the current time delay matrix, and second data synchronization information is generated based on the initial server information, the first time delay condition is used to select a server with the shortest communication time delay between the current server by using a shortest path algorithm.

[0082] The first time delay condition can be used to select a server with the shortest communication time delay between the current server by using a shortest path algorithm. The target server can be understood as a server to which the to-be-synchronized data needs to be synchronized at present. The communication time delay between the target server and the current server selected by using the shortest path algorithm is the shortest. The number of target servers can be one or more, which can be determined according to the first time delay condition. The second data synchronization information can be information to be sent to the target server, such as the second data synchronization information can at least include the initial server information and the to-be-synchronized data, or other data related to the to-be-synchronized data.

[0083] After it is determined that the synchronization operation for the to-be-synchronized data needs to be performed through the above steps, a target server satisfying a first time delay condition in communication time delay can be selected from the distributed system based on the current time delay matrix, and corresponding second data synchronization information can be generated based on the initial server information. The process of selecting the target server can be directly outputting the target server to be synchronized by inputting the current time delay matrix and the current server identifier into a preset model. The preset model can be a preconfigured neural network module, which can select and output the target server satisfying the first time delay condition in communication time delay from the distributed system.

[0084] In some embodiments, selecting a target server satisfying a first time delay condition in communication time delay from the distributed system based on the current time delay matrix comprises:

[0085] According to the current time delay matrix and the shortest path algorithm, the optimal transmission path between the current server and other servers in the distributed system is calculated.

[0086] The server in the first position in each optimal transmission path is selected as the target server.

[0087] The shortest path algorithm can be used to calculate the optimal transmission path between any two servers, and the communication delay of data transmission between any two servers through the optimal transmission path is the shortest. The shortest path algorithm can include Dijkstra algorithm or Floyd-Warshall algorithm, etc.

[0088] In the specific embodiment, it is assumed that there is a client whose address position is closest to server 1. Server 1 can start the strategy of full network synchronization after receiving the data packet sent by the client. From the perspective of server 1, the data packet needs to be synchronized to servers 2, 3, 4, 5 and 6.

[0089] Among them, according to the preset update period, each server in the distributed system can perform Ping-Pong communication with each other, for example, the one-way delay from server 1 to server 2 and the one-way delay from server 2 to server 1 can be measured, and the average delay of any two servers can be calculated, such as the average delay from server 1 to server 2 can be (the delay from server 1 to server 2 + the delay from server 2 to server 1) / 2; each server can broadcast its delay measurement result to all other servers in the network, and all servers can store the average delay between each other as a complete current delay matrix (such as Table 1).

[0090] Table 1: Current delay matrix

[0091] Server / latency Server 1 Server 2 Server 3 Server 4 Server 5 Server 6 Server 1 — 10 ms 50 ms 10 ms 100 ms 200 ms Server 2 11 ms — 12 ms 20 ms 70 ms 150 ms Server 3 55 ms 11 ms — 80 ms 20 ms 70 ms Server 4 8 ms 20 ms 80 ms — 5 ms 15 ms Server 5 110 ms 80 ms 39 ms 6 ms — 20 ms Server 6 200 ms 180 ms 80 ms Network not available 30 ms —

[0092] For server 1, the server network can be modeled as a weighted graph, where the nodes represent servers, and the weight of the edge is the average delay between the two servers, Figure 3 is a structural diagram of a network weighted graph provided by an embodiment of the application, as Figure 3 shown, the average delay between the two servers can be labeled in the weighted graph (only part of the communication delay is released in the figure), it can be simply seen that for server 1, directly sending data to server 3 requires 50 ms, but through server 2 forwarding, only 10 + 12 = 22 ms is required; Similarly, directly sending data to server 5 requires 100 ms, and through server 4 forwarding only requires 15 ms.

[0093] In a specific application, the server 1 can use the shortest path algorithm to calculate the optimal transmission strategy (e.g., Table 2) between itself and other servers, which can include the destination, the optimal transmission path and the shortest time delay. For example, the server 1 can send the data packet to the server 6 through the server 4, which only needs 25 ms, instead of 200 ms of direct forwarding.

[0094] Table 2 Optimal transmission strategy

[0095] Destination Optimal transmission path Shortest latency delay 2 1——2 10 ms 3 1——2——3 10 + 12 = 22 ms 4 1——4 10 ms 5 1——4——5 10 + 5 = 15 ms 6 1——4——6 10 + 15 = 25 ms

[0096] Subsequently, the server 1 can select the servers in the first position from the optimal transmission paths as the target servers, such as servers 2 and 4, and only synchronize the data packet to the servers 2 and 4.

[0097] S104, sending the second data synchronization information to the target server, wherein the target server is configured to continue to obtain the current time delay matrix of the distributed system and the initial server information of the data to be synchronized in the second data synchronization information in response to receiving the second data synchronization information, until the data to be synchronized is synchronized to all servers of the distributed system according to the current time delay matrix and the initial server information corresponding to the data to be synchronized.

[0098] The current server can send the second data synchronization information generated in the above steps to the target server, so that after the target server receives the second data synchronization information, it can continue to obtain the current time delay matrix of the distributed system and the initial server information of the data to be synchronized in the second data synchronization information in response to the received second data synchronization information, and return to execute the step of determining whether to perform the synchronization operation for the data to be synchronized according to the initial server information corresponding to the data to be synchronized. For example, in the case of determining that the data to be synchronized does not need to be forwarded to other servers, the data to be synchronized can be stored only, or in the case of determining that the data to be synchronized needs to be forwarded to other servers, the next target data can be selected based on the current time delay matrix for synchronization of the data to be synchronized, until the data to be synchronized is synchronized to all servers of the distributed system.

[0099] The data synchronization method provided in the embodiment comprises the following steps: in response to receiving first data synchronization information, determining a current latency matrix of a distributed system and initial server information corresponding to to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores current communication latency between any two servers in the distributed system, and a quick user datagram protocol Internet connection (QUIC) is established between any two servers; determining whether to perform a synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data; if it is determined to perform the synchronization operation on the to-be-synchronized data, selecting a target server that satisfies a first latency condition in terms of communication latency from the distributed system based on the current latency matrix, and generating second data synchronization information based on the initial server information, wherein the first latency condition is used to select a server with the shortest communication latency with the current server by using a shortest path algorithm; and sending the second data synchronization information to the target server, wherein the target server is configured to continue to acquire the current latency matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current latency matrix and the initial server information corresponding to the to-be-synchronized data. By using the method, the to-be-synchronized data can be selectively synchronized to a node with lower communication latency according to the actual situation of the server network by determining whether to perform the synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data and selecting the target server from the distributed system based on the current latency matrix for data synchronization in the case of determining to perform the synchronization operation on the to-be-synchronized data, thereby ensuring the efficiency of data synchronization and improving the efficiency of data synchronization.

[0100] In some embodiments, after the second data synchronization information is sent to the target server, the method further comprises:

[0101] If no response information of the target server to the second data synchronization information is received within a preset time length, a server that satisfies a second latency condition in terms of communication latency is selected as a backup server from the distributed system based on the current latency matrix;

[0102] Based on the current server information of the current server and the target server information of the target server, third data synchronization information is generated;

[0103] The third data synchronization information is sent to the backup server, so that the backup server synchronizes the to-be-synchronized data to the target server based on the third data synchronization information.

[0104] The second time delay condition can be used to select a server with shorter communication time delay between the current server and the selected server by using a shortest path algorithm; the standby server can be a server selected from the distributed system, so that the standby transmission path for transmitting the to-be-synchronized data from the current server to the target server through the standby server can have the shortest communication time delay compared with the communication time delays of all transmission paths except the optimal transmission path.

[0105] The current server information and the target server information can be used to represent the current server and the target server, respectively. For example, the current server information can include identification information of the current server, and the target server information can include identification information of the target server. The third data synchronization information can be information to be sent to the standby server, such as the third data synchronization information including at least the current server information, the target server information, and the to-be-synchronized data.

[0106] In the specific embodiment, transmission failure can occur between any two servers. Therefore, in the data synchronization process of all servers in the embodiment, a reference time of 2 times can be set as the preset time length (i.e., the timeout time) based on the time delay between the servers in the current time delay matrix.

[0107] For example, when the communication time delay between the server 1 and the server 2 is (10 ms+11 ms) / 2=10.5 ms, the timeout time can be 2 times the communication time delay, that is, 10.5 ms*2=21 ms. If the second data synchronization information is not sent successfully within 21 ms, that is, the server 1 does not receive the response information of the server 2 to the second data synchronization information within 21 ms, the path adjustment strategy is adopted, a server with a communication time delay satisfying the second time delay condition is selected from the distributed system based on the current time delay matrix as a standby server, and the third data synchronization information is generated and sent to the standby server. For example, the server 3 is selected as the standby server, and the third data synchronization information is sent to the server 3 according to the secondary path planning forwarding protocol, so that the server 3 synchronizes the to-be-synchronized data to the server 2.

[0108] The secondary path planning forwarding protocol can include at least from, data, to, and path fields. The from field is the sending source, indicating the initial sending server of the data packet. The data field is the data packet to be synchronized. The to field can indicate the failed destination. The path field can include the server information on the route, that is, the current transmission route. In the secondary path planning forwarding process, all servers on the route can understand why the data packet is forwarded through the from, to, and path fields in the secondary path planning forwarding protocol, and plan a reasonable secondary path forwarding route according to the current situation.

[0109] Further, the server 3 can still adopt the above path adjustment strategy to continue to select other backup servers to finally synchronize the to-be-synchronized data to the server 2 if the forwarding process is not successful, i.e., a transmission failure occurs.

[0110] In some embodiments, after the third data synchronization information is sent to the backup server, the method further comprises:

[0111] If all servers in the distributed system do not receive the response information of the target server, the current latency matrix of the distributed system is updated according to a preset update period.

[0112] According to the updated current latency matrix, fourth data synchronization information is sent to the target server, and the fourth data request at least includes the current server information and the target server information.

[0113] In the specific embodiment, if the data transmission results of all other servers to a certain server are all failed, i.e., all servers in the distributed system do not receive the response information of the target server, the embodiment can trigger a degradation strategy, at least one server can synchronize the to-be-synchronized data to a local retry queue, update the current latency matrix of the distributed system according to a time window (i.e., a preset update period), and reinitiate a synchronization attempt according to the latest current latency matrix in the next time window, such as sending fourth data synchronization information to the target server, and the fourth data request at least includes the current server information and the target server information. The server that initiates the synchronization attempt is not limited as long as it can realize fast forwarding of the to-be-synchronized data.

[0114] Figure 4 is another network weighted graph structure diagram provided by an embodiment of the present application, as shown in Figure 4 In an ideal case, after the server 1 sends the data packet to the server 4, the server 4 sends the data packet to the servers 5 and 6, respectively. However, if the server 1 fails to send the data packet to the server 4, the servers 5 and 6 will not receive the data packet. In this case, the embodiment can adopt a secondary path planning to solve the problem, such as the server 1 can query the optimal path table of the whole network to find a backup path. If another node (such as the server 2) in the backup path can forward the data to the server 4, the server 1 can select the server 2 as a backup server and inform the server 2 to help forward to the server 4.

[0115] Figure 5is a flowchart of a data synchronization method provided by another embodiment of the present application. In this embodiment, whether to perform the synchronization operation on the to-be-synchronized data is further optimized according to the initial server information corresponding to the to-be-synchronized data, that is, if the initial server information is used to represent other servers except the current server, the optimal transmission paths between the other servers and any server in the distributed system except the other servers are calculated according to the current latency matrix and the shortest path algorithm; it is detected whether there is a next server adjacent to the current server in at least one optimal transmission path; if it is detected that there is a next server adjacent to the current server in at least one optimal transmission path, it is determined that the synchronization operation on the to-be-synchronized data is performed; if it is detected that there is no next server adjacent to the current server in all optimal transmission paths, it is determined that the synchronization operation on the to-be-synchronized data is not performed, and the to-be-synchronized data is stored to the current server. As shown in Figure 5 The method comprises:

[0116] S201, in response to receiving the first data synchronization information, determining the current latency matrix of the distributed system and the initial server information corresponding to the to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores the current communication latency between any two servers in the distributed system, and a quick user datagram protocol Internet connection (QUIC) is established between any two servers.

[0117] S202, if the initial server information is used to represent other servers except the current server, the optimal transmission paths between the other servers and any server in the distributed system except the other servers are calculated according to the current latency matrix and the shortest path algorithm.

[0118] S203, it is detected whether there is a next server adjacent to the current server in at least one optimal transmission path.

[0119] In the specific embodiment, if the source of the first data synchronization information is a certain server, it means that the current server receives the first data synchronization information from the server, then the initial server information can be stored in the first data synchronization information, and the initial server information is used to represent other servers except the current server. At this time, the current server can judge whether to perform the synchronization operation on the to-be-synchronized data while storing the to-be-synchronized data, for example, the optimal transmission paths between the other servers and any server in the distributed system except the other servers can be calculated according to the current latency matrix and the shortest path algorithm from the perspective of the other servers, it is detected whether there is a next server adjacent to the current server in at least one optimal transmission path calculated, and whether to perform the synchronization operation on the to-be-synchronized data is determined according to different detection results. The next server can be understood as a node that needs to be synchronized by the current server.

[0120] For example, if it is detected that there is a next server adjacent to the current server in at least one optimal transmission path, indicating that there is a node requiring synchronization service of the current server, steps S204-S206 can be performed to send the second data synchronization information; if it is detected that there is no next server adjacent to the current server in all optimal transmission paths, indicating that there is no node requiring synchronization service of the current server in all determined optimal transmission paths, step S207 can be performed, i.e., it can be determined that the synchronization operation for the to-be-synchronized data is not required to be performed, and the to-be-synchronized data can be stored to the current server.

[0121] S204, determining to perform the synchronization operation for the to-be-synchronized data.

[0122] S205, selecting a target server satisfying a first time delay condition in terms of communication time delay from the distributed system based on the current time delay matrix, and generating second data synchronization information based on the initial server information.

[0123] S206, sending the second data synchronization information to the target server, wherein the target server is configured to continue to acquire the current time delay matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers of the distributed system according to the current time delay matrix and the initial server information corresponding to the to-be-synchronized data.

[0124] S207, determining not to perform the synchronization operation for the to-be-synchronized data, and storing the to-be-synchronized data to the current server.

[0125] In the specific embodiment, the servers can use a data packet synchronization protocol for data transmission, at least including two fields of data, a from field indicating a sending source, indicating an initial sending server of the data packet, and a data field, i.e., a data packet requiring synchronization.

[0126] Suppose that the current server is server 2, the first data synchronization information received by the server 2 carries the from field (i.e., the initial server information) and the data field, indicating which server initiates the data packet in the data field first, if the initial server information indicates the server 1, the server 2 can start from the perspective of the server 1, infer the optimal transmission strategy as shown in Table 2 above, determine whether it is a relay node on an optimal transmission path, and detect whether there is a next server adjacent to the current server in at least one optimal transmission path, if it is detected that there is a next server 3 adjacent to the current server in the "1-2-3" optimal transmission path, the to-be-synchronized data can be continued to be synchronized to the server 3 according to the path planning.

[0127] Or, if the current server is server 3, after server 2 sends the data packet to server 3, server 3 can also infer the optimal transmission strategy as in Table 2 above, and server 3 does not need to send the data packet to other servers, but only needs to store the data to be synchronized.

[0128] The data synchronization method provided in the embodiment can determine whether to perform the synchronization operation for the data to be synchronized by detecting whether there is a next server adjacent to the current server in at least one optimal transmission path according to the current delay matrix and the shortest path algorithm when the initial server information is used to represent other servers except the current server, thereby providing an operation basis for the current server and further realizing efficient and low-delay synchronization of data.

[0129] Figure 6 is a network structure block diagram of data synchronization provided by an embodiment of the application, as shown in Figure 6 The data synchronization between the servers discards the one-to-many group sending mode, and no longer needs to be sent to all servers, but is selectively sent to a server with lower delay, and relies on mutual sharing between nodes to synchronize data in the whole network. Among them, all servers can perform Ping-Pong detection every time window to count the communication delay, and dynamically update the current delay matrix, so that the server can select the optimal transmission path according to the network condition, avoid occupying a large amount of network bandwidth by the same server, and further can efficiently and low-delay synchronize data according to the dynamic change of the network.

[0130] From the above description, it can be found that the embodiment designs a more efficient protocol to dynamically optimize the synchronization path according to the network condition, and at the same time no longer relies on the three-party database module, but the server actively performs data synchronization by using the QUIC protocol, so that the network architecture model is more lightweight, and lower delay and higher throughput are provided. In addition, in the whole data synchronization process, there is no redundant sending of data under normal circumstances, that is, any node will not receive the same data packet from multiple servers at the same time, which saves the network bandwidth and improves the network availability.

[0131] Corresponding to the data synchronization method of the above embodiment, Figure 7 is a structure block diagram of a data synchronization device provided by an embodiment of the application, and only parts related to the embodiments of the application are shown for ease of description.

[0132] Referring to Figure 7 , the device comprises:

[0133] The first determination module 301 is configured to, in response to receiving the first data synchronization information, determine a current latency matrix of the distributed system and initial server information corresponding to the to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores current communication latencies between any two servers in the distributed system, and a QUIC (Quick User Datagram Protocol Internet Connections) is established between any two servers.

[0134] The second determination module 302 is configured to determine whether to perform a synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data.

[0135] The first selection module 303 is configured to, if it is determined to perform the synchronization operation on the to-be-synchronized data, select a target server that satisfies a first latency condition in terms of communication latency from the distributed system based on the current latency matrix, and generate second data synchronization information based on the initial server information, wherein the first latency condition is used to select a server with the shortest communication latency from the current server by using a shortest path algorithm.

[0136] The first sending module 304 is configured to send the second data synchronization information to the target server, wherein the target server is configured to, in response to receiving the second data synchronization information, continue to acquire the current latency matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current latency matrix and the initial server information corresponding to the to-be-synchronized data.

[0137] The embodiment provides a data synchronization device. The device comprises a first determination module, a second determination module, a first selection module and a first sending module. The first determination module is configured to determine a current time delay matrix of a distributed system and initial server information corresponding to to-be-synchronized data in the first data synchronization information in response to receiving the first data synchronization information, wherein the current time delay matrix stores current communication time delays between any two servers in the distributed system, and a quick user datagram protocol Internet connection (QUIC) is established between any two servers. The second determination module is configured to determine whether to perform a synchronization operation on the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data. The first selection module is configured to select a target server with a communication time delay satisfying a first time delay condition from the distributed system based on the current time delay matrix and generate second data synchronization information based on the initial server information if it is determined to perform the synchronization operation on the to-be-synchronized data, wherein the first time delay condition is used to select a server with the shortest communication time delay from the current server by using a shortest path algorithm. The first sending module is configured to send the second data synchronization information to the target server, wherein the target server is configured to continue to acquire the current time delay matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current time delay matrix and the initial server information corresponding to the to-be-synchronized data. By using the device, whether to perform the synchronization operation on the to-be-synchronized data is determined according to the initial server information corresponding to the to-be-synchronized data, and the target server is selected from the distributed system based on the current time delay matrix for data synchronization if it is determined to perform the synchronization operation on the to-be-synchronized data, so that the to-be-synchronized data can be selectively synchronized to a node with a lower communication time delay according to an actual situation of a server network, the efficiency of data synchronization is ensured, and the efficiency of data synchronization is improved.

[0138] Optionally, the second determination module is specifically configured to:

[0139] If the initial server information is used to represent the current server, it is determined to perform the synchronization operation on the to-be-synchronized data.

[0140] Optionally, the first selection module is specifically configured to:

[0141] The first selection module is configured to calculate optimal transmission paths between the current server and other servers in the distributed system according to the current time delay matrix and the shortest path algorithm.

[0142] The first selection module is configured to select a server in a first position in each optimal transmission path as the target server.

[0143] Optionally, the second determination module comprises:

[0144] The computing unit is configured to, if the initial server information is used to represent a server other than the current server, calculate optimal transmission paths between the other server and any server other than the other server in the distributed system according to the current time delay matrix and a shortest path algorithm.

[0145] The detecting unit is configured to detect whether there is a next server adjacent to the current server in the at least one optimal transmission path.

[0146] The first determining unit is configured to, if it is detected that there is a next server adjacent to the current server in the at least one optimal transmission path, determine to perform a synchronization operation on the to-be-synchronized data.

[0147] The second determining unit is configured to, if it is detected that there is no next server adjacent to the current server in all the optimal transmission paths, determine not to perform the synchronization operation on the to-be-synchronized data, and store the to-be-synchronized data to the current server.

[0148] Optionally, the first selecting module is specifically configured to:

[0149] select, as the target server, the next server adjacent to the current server in the at least one optimal transmission path.

[0150] Optionally, the data synchronization apparatus provided by the embodiment further includes:

[0151] The second selecting module is configured to, after the second data synchronization information is sent to the target server, if no response information of the target server to the second data synchronization information is received within a preset time length, select, as a backup server, a server satisfying a second time delay condition in terms of communication time delay from the distributed system based on the current time delay matrix.

[0152] The generating module is configured to generate third data synchronization information based on the current server information of the current server and the target server information of the target server.

[0153] The second sending module is configured to send the third data synchronization information to the backup server, so that the backup server synchronizes the to-be-synchronized data to the target server based on the third data synchronization information.

[0154] Optionally, the data synchronization apparatus provided by the embodiment further includes:

[0155] The updating module is configured to, after the third data synchronization information is sent to the backup server, if no response information of the target server is received by all the servers in the distributed system, update the current time delay matrix of the distributed system according to a preset update period.

[0156] The third sending module is configured to send fourth data synchronization information to the target server according to the updated current time delay matrix, wherein the fourth data request comprises at least the current server information and the target server information.

[0157] Optionally, the first determining module comprises:

[0158] The dynamic acquisition unit is configured to dynamically acquire a current communication time delay between any two servers in the distributed system.

[0159] The constructing unit is configured to construct a current time delay matrix of the distributed system according to the current communication time delay between any two servers.

[0160] Optionally, the current communication time delay comprises a first communication time delay and a second communication time delay, and the dynamic acquisition unit is specifically configured to:

[0161] calculate the first communication time delay between the current server and each other server in the distributed system according to a preset update period;

[0162] receive the second communication time delay broadcast by each other server, wherein the second communication time delay is used to represent the communication time delay between each other server and the server other than the other server in the distributed system.

[0163] It should be noted that the information interaction, execution process and the like between the above apparatuses / units are based on the same concept as the method embodiments of the present application, and the specific functions and the technical effects brought by the same can be referred to the method embodiments part, and will not be repeated here.

[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example for illustration, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of software functional unit. In addition, the specific names of the functional units and modules are only for the purpose of mutual distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0165] The present application also provides a server, Figure 8 is a structural schematic diagram of a server provided by an embodiment of the present application, as Figure 8As shown, the server comprises at least one processor 401, a memory 402, an input device 403, an output device 404, and a computer program stored in the memory 402 and capable of running on the at least one processor 401, and the processor 401 implements the steps in any of the above method embodiments when executing the computer program.

[0166] The input device 403 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the server. The output device 404 can include a display device such as a display screen.

[0167] The embodiments of the present application provide a computer program product, when the computer program product runs on the server, so that the server executes to implement the steps in each of the above method embodiments.

[0168] The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program, when executed by the processor 401, can implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the device / server, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium cannot be an electrical carrier signal and a telecommunication signal.

[0169] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in detail in a certain embodiment can be referred to the related description of other embodiments.

[0170] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0171] In the embodiments provided by the present application, it should be understood that the disclosed apparatuses / servers and methods can be implemented in other manners. For example, the embodiments of the apparatuses / servers described above are merely illustrative. For example, the division of the modules or units is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0172] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.

[0173] The above embodiments are merely used to describe the technical solutions of the present application, but not to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: the technical solutions recorded in the foregoing embodiments can still be modified, or some technical features can be replaced by equivalent; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A data synchronization method, characterized by, The method is applied to any current server in a distributed system, and the method comprises: In response to receiving first data synchronization information, determining a current latency matrix of the distributed system and initial server information corresponding to to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores current communication latency between any two servers in the distributed system, and a quick user datagram protocol Internet connection (QUIC) is established between any two servers; According to the initial server information corresponding to the to-be-synchronized data, determining whether to perform a synchronization operation on the to-be-synchronized data; If it is determined to perform the synchronization operation on the to-be-synchronized data, selecting a target server with communication latency satisfying a first latency condition from the distributed system based on the current latency matrix, and generating second data synchronization information based on the initial server information, wherein the first latency condition is used to select a server with the shortest communication latency from the current server by using a shortest path algorithm; Sending the second data synchronization information to the target server, wherein the target server is configured to continue to acquire the current latency matrix of the distributed system and the initial server information of to-be-synchronized data in the second data synchronization information in response to receiving the second data synchronization information, until the to-be-synchronized data is synchronized to all servers in the distributed system according to the current latency matrix and the initial server information corresponding to the to-be-synchronized data.

2. The data synchronization method of claim 1, wherein, The method further comprises: If the initial server information represents the current server, it is determined to perform the synchronization operation on the to-be-synchronized data.

3. The data synchronization method of claim 2, wherein, The method further comprises: According to the current latency matrix and the shortest path algorithm, calculating optimal transmission paths between the current server and other servers in the distributed system; Selecting a server at a first position in each optimal transmission path as a target server.

4. The data synchronization method of claim 1, wherein, The method further comprises: If the initial server information represents a server other than the current server, according to the current latency matrix and the shortest path algorithm, calculating optimal transmission paths between the other server and any server other than the other server in the distributed system; Detecting whether there is a next server adjacent to the current server in at least one optimal transmission path; If it is detected that there is a next server adjacent to the current server in at least one optimal transmission path, it is determined to perform the synchronization operation on the to-be-synchronized data; If it is detected that there is no next server adjacent to the current server in all optimal transmission paths, it is determined not to perform the synchronization operation on the to-be-synchronized data, and the to-be-synchronized data is stored to the current server.

5. The data synchronization method of claim 4, wherein, The selecting a target server from the distributed system based on the current latency matrix, wherein the target server has a communication latency satisfying a first latency condition, comprises: selecting a next server adjacent to the current server in the at least one optimal transmission path as the target server.

6. The data synchronization method of claim 1, wherein, After the sending the second data synchronization information to the target server, the method further comprises: if no response information from the target server is received within a preset time length, selecting a server having a communication latency satisfying a second latency condition as a backup server based on the current latency matrix; generating third data synchronization information based on current server information of the current server and target server information of the target server; sending the third data synchronization information to the backup server, so that the backup server synchronizes the to-be-synchronized data to the target server based on the third data synchronization information.

7. The data synchronization method of claim 6, wherein, After the sending the third data synchronization information to the backup server, the method further comprises: if no response information from the target server is received by all servers in the distributed system, updating the current latency matrix of the distributed system according to a preset update period; sending fourth data synchronization information to the target server according to the updated current latency matrix, wherein the fourth data request at least includes the current server information and the target server information.

8. The data synchronization method of claim 1, wherein, The determining the current latency matrix of the distributed system comprises: dynamically obtaining a current communication latency between any two servers in the distributed system; constructing the current latency matrix of the distributed system according to the current communication latency between the any two servers.

9. The data synchronization method of claim 8, wherein, The current communication latency comprises a first communication latency and a second communication latency, and the dynamically obtaining the current communication latency between any two servers in the distributed system comprises: calculating the first communication latency between the current server and each other server in the distributed system according to a preset update period; receiving each second communication latency broadcast by each other server, wherein the second communication latency is used to represent a communication latency between each other server and a server in the distributed system other than the other server.

10. A data synchronization apparatus, characterized by comprising: The apparatus is configured in any current server in a distributed system, and the apparatus comprises: a first determining module configured to, in response to receiving first data synchronization information, determine a current latency matrix of the distributed system and initial server information corresponding to to-be-synchronized data in the first data synchronization information, wherein the current latency matrix stores a current communication latency between any two servers in the distributed system, and a quick user datagram protocol internet connection (QUIC) is established between any two servers; a second determining module configured to determine whether to perform a synchronization operation for the to-be-synchronized data according to the initial server information corresponding to the to-be-synchronized data. The first selecting module is configured to, if it is determined to perform the synchronization operation on the to-be-synchronized data, select a target server that satisfies a first time delay condition in communication time delay from the distributed system based on the current time delay matrix, and generate second data synchronization information based on the initial server information, wherein the first time delay condition is used to select a server with the shortest communication time delay with the current server by using a shortest path algorithm. The first sending module is configured to send the second data synchronization information to the target server, wherein the target server is configured to, in response to receiving the second data synchronization information, continue to acquire the current time delay matrix of the distributed system and the initial server information of the to-be-synchronized data in the second data synchronization information until the to-be-synchronized data is synchronized to all servers of the distributed system according to the current time delay matrix and the initial server information corresponding to the to-be-synchronized data.

11. A server comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program, so that the server implements the method in any one of claims 1-9.

12. A computer program product, characterised in that, The computer program is executed by the processor, so that the method in any one of claims 1-9 is executed.

Citation Information

Patent Citations

  • User data plane migration method and device, equipment and storage medium

    CN117177323A

  • Equipment communication method and system based on Internet of Things

    CN118945168A