Data synchronization method and system

By separating proxy services, request processing queues and business logic modules in the data synchronization system of off-site multi-active systems, and generating and passing processing queue synchronization instructions, the problem of multi-region data conflicts is solved, efficient data synchronization and consistent updates are achieved, and maintenance difficulty is reduced.

CN119814806APending Publication Date: 2025-04-11GUANGZHOU SEASUN ENTERTAINMENT NETWORK TECHCO
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510029198.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In a remote multi-living system, when multiple regions operate the same data at the same time, data conflicts are prone to occur. The existing technology handles conflicts when the data layer is synchronized, and the logic is complex and logical errors are prone to occur, and the maintenance difficulty increases as business growth.

Method used

By introducing proxy services, request processing queues and business logic modules in the data synchronization system, the processing queue synchronization instructions are generated and passed, and the request processing queues of each server are kept consistent, thereby completing the data synchronization process independently and avoiding version number and timestamp conflicts.

Benefits of technology

It realizes efficient broadcast synchronization of requested data between different regions, reduces the direct operational requirements for business data, avoids complex data conflict processing, optimizes the data consistency update process, reduces maintenance difficulty, and improves the stability and maintainability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814806A_ABST
    Figure CN119814806A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data synchronization method and system.The data synchronization method is applied to a first server in the data synchronization system, the data synchronization system comprises at least two servers, and the first server is any one of the servers and comprises the steps that a data processing request is sent by receiving end side equipment; generating a first processing queue synchronization instruction based on the data processing request, and sending the first processing queue synchronization instruction to at least one second server, so that request processing queues in the servers are kept consistent; and obtaining a request processing queue according to the first processing queue synchronization instruction, and updating service data based on the request processing queue. By broadcasting the first processing queue synchronization instruction, the multi-region data consistency operation is simplified, the system resource utilization rate is improved, and the synchronization logic complexity and maintenance difficulty are effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a data synchronization method. Background Art

[0002] With the development of multi-site active-active system architecture, the system has produced remarkable results in improving service availability and enhancing user experience, but it has also brought new technical challenges. In particular, when the same data is operated in multiple regions at the same time, data conflicts may arise. How to effectively solve this problem has become a focus of attention in the industry.

[0003] Currently, the commonly used solution is to handle conflicts during data layer synchronization. This solution is outstanding in improving regional resource utilization, but the synchronization logic is complex and requires version numbers and timestamps to determine data validity, which is prone to logical errors. In addition, business growth will lead to increasing maintenance difficulties. Therefore, in order to overcome these shortcomings, a data synchronization method is urgently needed. Summary of the invention

[0004] In view of this, the embodiments of this specification provide a data synchronization method and a data synchronization system. One or more embodiments of this specification also relate to a data synchronization device, a computing device, a computer-readable storage medium and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a data synchronization method is provided, which is applied to a first server in a data synchronization system, wherein the data synchronization system includes at least two servers, and the first server is any one of the servers, including: A data processing request sent by a receiving device; Generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server to keep the request processing queues in each server consistent; A request processing queue is obtained according to the first processing queue synchronization instruction, and business data is updated based on the request processing queue.

[0006] According to a second aspect of an embodiment of this specification, there is provided a data synchronization system, including a first server and at least one second server; A first server is configured to receive a first data processing request; generate a first processing queue synchronization instruction based on the first data processing request, and send the first processing queue synchronization instruction to at least one second server; The second server is configured to receive a first processing queue synchronization instruction sent by the first server; obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue; The first server is further configured to obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue.

[0007] According to a third aspect of an embodiment of this specification, a data synchronization device is provided, including: a first server applied to a data synchronization system, the data synchronization system including at least two servers, the first server being any one of the servers, including: A first receiving module, configured to receive a data processing request sent by a terminal-side device; a sending module, configured to generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server, so that the request processing queues in each server are consistent; The synchronization module is configured to obtain the request processing queue according to the first processing queue synchronization instruction, and update the business data based on the request processing queue.

[0008] According to a fourth aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned data synchronization method are implemented.

[0009] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned data synchronization method are implemented.

[0010] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which implements the steps of the above-mentioned data synchronization method when executed by a processor.

[0011] An embodiment of the present specification is applied to any server in a data synchronization system to implement the following steps: receiving a data processing request sent by a device on the receiving end side; generating a first processing queue synchronization instruction based on the data processing request, and sending the first processing queue synchronization instruction to at least one second server to keep the request processing queues in each server consistent; obtaining a request processing queue according to the first processing queue synchronization instruction, and updating business data based on the request processing queue.

[0012] The solution of the embodiment of this specification is applied. By separating the proxy service part for receiving data processing requests, the request processing queue part for determining the request processing order, and the business logic part for executing requests to update business data, the data synchronization operation is independent of the business data, and efficient broadcast synchronization of request data between different regions is achieved, which reduces the need for direct operations on business data and avoids complex data conflict processing. In addition, the data consistency update process is optimized, and the risk of logical errors caused by version numbers and timestamps is eliminated. In addition, by maintaining the consistency of the request processing queues between servers, the maintenance difficulty brought about by business growth is effectively reduced, efficient resource utilization is achieved, and a more stable synchronization solution is provided for multi-active architectures in different locations. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a flow chart of a data synchronization method provided by an embodiment of this specification; Figure 2 is an architecture diagram of a data synchronization system provided by an embodiment of this specification; Figure 3 It is a process flow chart of a method for synchronizing video data on a video platform provided by an embodiment of this specification; Figure 4 It is a structural diagram of a data synchronization device provided by an embodiment of this specification; Figure 5 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0014] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0015] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0016] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0017] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0018] In this specification, a data synchronization method and a data synchronization system are provided. One or more embodiments of this specification also relate to a data synchronization device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0019] The current problem faced by multi-region active systems is to resolve data conflicts between different regions. When region A and region B modify the same data at the same time, conflicts will occur. At this time, a complex mechanism needs to be developed to resolve the conflicts. To solve this problem, the industry generally adopts two solutions: the first is to shard the data to avoid data conflicts, and the second is to develop programs to resolve conflicts when synchronizing the data layer.

[0020] The first solution is to shard the business or data. Each shard is only in one region, and each region has its own independent data (including cache and database). This avoids data synchronization between different regions and avoids data conflicts. Its architecture is very simple, but its disadvantages are also obvious, that is, each shard is only in one region, and the server performance of all regions cannot be fully utilized, and resource utilization is not high. At the same time, in order to avoid data loss caused by the unavailability of a certain region, a set of backup data mechanisms needs to be added, which makes the architecture more complicated.

[0021] The second solution is to solve the problem during data layer synchronization. Under the architecture of this solution, each region can handle all businesses, and the regional resource utilization rate is high. However, the data synchronization logic is relatively complex. In order to resolve data conflicts, it is necessary to add version numbers and timestamps to the data. When merging data from different regions, it is easy to make logical errors when judging which data to use or discard based on the version number and timestamp. Different businesses have different conflict resolution logics. As the business grows, the logic code will become larger and more difficult to maintain. Therefore, in order to overcome these shortcomings, a data synchronization method is urgently needed.

[0022] See also Figure 1 , Figure 1 A flow chart of a data synchronization method provided according to an embodiment of the present specification is shown. The data synchronization method is applied to any server in a data synchronization system including at least two servers, and specifically includes the following steps.

[0023] Step 102: A data processing request sent by a receiving end-side device.

[0024] In actual applications, the data synchronization system is a system that manages and coordinates data consistency among multiple servers; the server is a device that provides data processing and computing functions; the end-side device is a user device that initiates data processing requests and communicates with the server; the data processing request is the request information sent by the end-side device to the server, which is used to trigger specific data operations.

[0025] Exemplarily, the data synchronization system can be understood as a solution to ensure data consistency between multiple regions or multiple devices. The system is usually used in scenarios where multiple servers collaborate to process the same data. For example, in a multi-active system in different locations, through the synchronization of message queues, servers in different regions can share a consistent data state and avoid data conflict problems. The server can be understood as a key node in the data synchronization system, responsible for receiving and processing requests sent by its corresponding end-side device (such as end-side devices within the coverage range of its corresponding area, and end-side devices expected to establish a communication connection), and synchronizing the requested data to other servers. The server usually includes modules such as proxy services, request processing queues, and business logic programs.

[0026] It should be noted that the end-side device can be understood as a user device that initiates a data request. It sends a data processing request to the server through the network, thereby triggering the server to perform corresponding operations. Typical examples of end-side devices include the user's mobile phone, computer or tablet device. The data processing request can be understood as a specific operation instruction initiated by the end-side device to the server, which is used to request the server to perform a specific data operation.

[0027] In one embodiment provided in this specification, taking the data synchronization system corresponding to the video platform as an example, users in different regions like the same video. Through the data synchronization system, servers in different regions can synchronize the likes data to ensure that the number of likes in each server is the same, and inconsistent data will not be generated due to different operation regions. When the user performs a like operation on the end-side device, the end-side device will send a data processing request to instruct the server to increase the number of likes for the video. The data processing request contains the specific content of the request (such as adding likes or comments on the video) and sends it to the server. The server will receive the request through the proxy service, store the request in the request processing queue, and the business logic program will process and update the number of likes in the database. The servers will maintain the consistency of the processing queue through synchronization instructions to ensure that the business data of all servers are updated synchronously.

[0028] Any server in the data synchronization system can immediately add the request to the request processing queue and generate synchronization instructions to other servers by receiving the data processing request, ensuring that the request processing queues of all servers are updated synchronously. This improves the stability and maintainability of the system and provides strong support for efficient data processing under large-scale distributed architecture.

[0029] Step 104: Generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server to keep the request processing queues in each server consistent.

[0030] In actual applications, the first processing queue synchronization instruction is an instruction generated and sent by the first server, which is used to maintain the consistency of the request processing queues between multiple servers; the second server is a server node that receives and processes the synchronization instruction, and the request processing queue is a structure inside the server for storing and sorting requests to be processed.

[0031] Exemplarily, the first processing queue synchronization instruction can be understood as a synchronization instruction generated by the first server after receiving a data processing request, which is used to ensure that the request processing queues of other servers are consistent with the queue of the first server. Through this instruction, each server can receive requests from different regions and process them in the same order, avoiding data inconsistency problems caused by remote operations. For example, in a video platform, when the first server receives a like request, it will generate a first processing queue synchronization instruction and broadcast it to other servers to ensure that the processing order of each server is the same to achieve data synchronization.

[0032] The request processing queue can be understood as a queue structure in the server that is used to temporarily store and sort client requests. It ensures that requests are processed in the order in which they are received to maintain the logical consistency of the system. The queue is responsible for storing requests for data processing in sequence and passing them to the business logic program for processing in the set order. For example, after a like request enters the request processing queue, the business logic program will generate the first processing queue synchronization instruction in the order of the queue, and synchronize the queue status to other servers through the synchronization instruction to ensure the consistency of business data in each server.

[0033] The second server can be understood as a participating server in the data synchronization system, responsible for receiving and executing synchronization instructions from the first server, thereby ensuring data consistency among servers in a distributed environment. As an important node in the data synchronization process, the second server not only receives synchronization instructions from the first processing queue, but also receives synchronization instructions from other second servers. Taking the video like function as an example, when the first server generates and sends the first processing queue synchronization instruction, the second server will receive the instruction and update its own request processing queue to ensure that the like data is synchronized and consistent on each server.

[0034] It should be noted that generating the first processing queue synchronization instruction based on the data processing request can be understood as passing the request information to other servers through different methods to maintain the consistency of the request processing queue. The specific method can be to obtain the current request status information and generate the synchronization instruction based on the status information and the data processing request; or to generate the updated request status information based on the current request status information and the data processing request, and then generate the first processing queue synchronization instruction based on the updated information; or to directly generate the synchronization instruction according to the priority and processing order of the request to ensure that the key request is synchronized to other servers first, etc. This manual does not impose any restrictions on this.

[0035] By sending the first processing queue synchronization instruction generated based on the data processing request to each second server, it can ensure that the request processing queue of each server remains consistent, thereby effectively reducing the risk of data conflicts between different regions or different servers. This synchronization method enables all servers to process requests in the same order and logic, ensuring the consistency and synchronization of business data in a multi-server environment, while reducing logical errors caused by inconsistent data. In addition, the unified synchronization instruction mechanism also simplifies system maintenance, improves scalability, enables the system to more flexibly respond to the growth of business volume, and provides stable and reliable data synchronization support for multi-regional or multi-server distributed architectures.

[0036] Further, generating a first processing queue synchronization instruction based on the data processing request includes: Get the current request status information; A first processing queue synchronization instruction is generated based on the current request status information and the data processing request.

[0037] In actual applications, the current request status information is the status of the request processing queue recorded by the server at a specific time, which is used to generate synchronization instructions to ensure processing consistency among multiple servers.

[0038] For example, the current request status information can be understood as a data structure that reflects the current status of the server request processing queue, which usually includes information such as the number of requests, priority, and processing order. When generating a synchronization instruction, the server will check the current request status information to determine whether the synchronization processing queue needs to be updated. This status information is crucial in a distributed system and can effectively avoid data inconsistencies caused by different request orders.

[0039] It should be noted that obtaining the current request status information and generating the first processing queue synchronization instruction based on the current request status information and the data processing request can be understood as generating a synchronization instruction by analyzing the status of the current request queue to ensure the consistency of request processing among multiple servers. The specific method can be to directly obtain the current request status information, integrate it with the new data processing request and generate a synchronization instruction; it can also generate updated request status information based on the current request status information and the data processing request, and then generate a synchronization instruction based on the updated status information; it can also compare the priorities in the current request status information to determine which key requests to synchronize to ensure priority processing, etc. This manual does not impose any restrictions on this.

[0040] In one embodiment provided in this specification, following the above example, when multiple users in different regions like a video at the same time, each server will record the current request status information, and adjust the processing queues of other servers to a consistent state through synchronization instructions to ensure that the update order of the number of likes is the same. In addition, the current request status information can also be used to manage the priority of requests, so that key requests can be processed first, improving the flexibility and stability of system response.

[0041] Further, generating a first processing queue synchronization instruction based on the current request state information and the data processing request includes: generating update request status information based on the current request status information and the data processing request; A first processing queue synchronization instruction is generated based on the update request status information.

[0042] In actual applications, the update request status information is a new state after adjusting the current state of the request processing queue, which is used to generate synchronization instructions to ensure the coordination and consistency of the processing flow between multiple servers. The update request status information can be understood as the new queue state formed after the data processing request is added to the request processing queue, which reflects important information such as the order, quantity and priority of the request. The update request status information is usually generated when the request status changes, so as to provide the latest queue status to other servers.

[0043] Continuing with the above example, when a server in the video platform receives a like request and updates the queue, the generated update request status information can synchronize the inclusion of the like request to other servers, ensuring that the order of like operations in each server remains consistent.

[0044] Since the updated request status information not only records the detailed information of the newly added requests, but also includes the overall changes in the queue, this is particularly important for the synchronous processing of multi-regional servers because it can reduce conflicts and data inconsistencies, improve system stability and data processing accuracy.

[0045] Step 106: Obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue.

[0046] In actual applications, the request processing queue is a structure within the server used to temporarily store and sort client requests, and the business data is the core data content updated after the server processes the request.

[0047] The request processing queue can be understood as an ordered structure inside the server, which is used to store requests from end-side devices and arrange them in the order in which they are received to ensure that the requests can be processed in sequence. The queue usually works in conjunction with the proxy service and business logic program in the server: the proxy service adds the received requests to the request processing queue, and the business logic program reads the requests from the queue and executes them in sequence. The existence of the request processing queue ensures the orderliness of operations and the consistency of data processing. Business data can be understood as the core information updated by the server after processing the client request, and is an important part of the data synchronization system. Business data is usually stored in the database or cache of the server, and contains data information related to specific business operations, such as the number of user likes and comments. When updating business data, it is necessary to maintain consistency between servers to ensure that the data status seen by users in any region is consistent.

[0048] In one embodiment provided in this specification, in the likes scenario of the video platform, when a user initiates a like request, the request will enter the request processing queue and wait for processing, and the business logic program will process the like requests in the queue in order to ensure that the increase in the number of likes complies with the actual operation order. Then, after the like request is processed, the number of likes in the business data will be updated, and by generating and transmitting synchronization instructions before processing the like request in the queue, it is ensured that the request processing queue can be consistent between multiple servers, thereby ensuring that this update will be synchronized between the servers, so that users in different regions can see the same number of video likes, thereby achieving data consistency.

[0049] Since the reliability and accuracy of business data are directly related to the user experience, in the data synchronization system, business data is strictly managed through request processing queues and synchronization instructions to ensure the update process and ensure its consistency in the distributed server environment, thereby improving the user experience.

[0050] Further, obtaining a request processing queue according to the first processing queue synchronization instruction includes: determining queue update information based on the first processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

[0051] In actual applications, queue update information is the latest status of the request queue generated by the queue synchronization instruction, which is used to reflect the latest order and status of the requests in the queue in order to maintain consistency among multiple servers. Queue update information can be understood as the update status formed after the server adjusts the request processing queue according to the received synchronization instruction. It contains the details of the requests added, deleted or adjusted in the queue. This information is particularly critical in a multi-server collaborative environment to ensure that the request processing queue of each server is consistent in order, quantity and content.

[0052] Continuing with the above example, when multiple users in different regions like the same video at the same time, each server will generate queue update information based on the received synchronization instructions to ensure that the like requests are executed in the same order in all locations.

[0053] This synchronization method can effectively prevent data conflicts and processing delays, and improve the overall stability and response speed of the system. In addition, queue update information plays a feedback role in the queue management of distributed systems, and can provide a reference for subsequent request processing to ensure the consistency and accuracy of the processing flow.

[0054] Further, updating the service data based on the request processing queue includes: Determining a target data processing task based on the request processing queue, wherein the target data processing task is any task in the request processing queue; The business data is updated based on the target data processing task.

[0055] In practical applications, the target data processing task is a data operation task that needs to be executed first in the request processing queue, which is used to ensure that the system gradually updates the business data in a predetermined order to maintain consistency and coherence. The target data processing task can be understood as the key task that is identified as the next task to be processed in the request processing queue, and is the object that the server executes first when maintaining data consistency.

[0056] It should be noted that the target data processing task is usually determined based on the sorting rules in the queue, and the rules for each server to determine the target data processing task are the same. For example, the first request in the queue can be set as the target data processing task so that each server can synchronously execute the same data update operation; or, based on the priority of the request, tasks with higher priorities can be placed at the front of the queue for priority execution; or, based on the type of task requested, tasks in the system that require immediate response, such as user interaction requests, can be prioritized as target data processing tasks, and so on. This manual does not impose any restrictions on this.

[0057] Continuing with the above example, the target data processing task may be a like operation, which is placed at the front of the request processing queue, indicating that each server should prioritize processing of this task, thereby maintaining synchronous updates of the number of likes among multiple servers.

[0058] The setting and execution of target data processing tasks helps ensure that each request is processed step by step in the established order, reducing data inconsistencies caused by sequence differences, while improving the system's response speed and data synchronization efficiency.

[0059] Further, updating the business data based on the target data processing task includes: Execute the target data processing task and generate a business processing result; The business data is updated according to the business processing result.

[0060] In actual applications, business processing results are the result data or status generated after executing a specific data processing task, which is used to guide the update of business data and ensure the completion of operations and the consistency of system data. Business processing results can be understood as feedback information or status changes obtained after executing the target data processing task, which will be used to further update and synchronize business data. Business processing results may be output in various forms, such as database update status, specific calculation values, or information returned by interface calls.

[0061] Continuing with the above example, in the likes system of the video platform, the business processing result may be the incremental value of the number of likes. This incremental result will be used to update the business data in each server to ensure that the total number of likes is consistent in different regions.

[0062] In another embodiment provided in this specification, the business processing result may also include feedback on the business logic, which is used to monitor whether the task execution is successful or whether further adjustment is required. Taking the order system as an example, the corresponding business processing result may be an update of the order status, such as "completed" or "pending shipment".

[0063] By obtaining and generating business processing results based on the target data processing tasks confirmed in the same request queue, and using the above business processing results to update business data, it can be ensured that all servers update business data consistently under the same task execution order, effectively avoiding data inconsistency problems caused by multi-region or multi-server operations. This method ensures the continuity of the business processing flow, enables each request to be processed correctly and synchronously, improves the overall stability of the system and the accuracy of data synchronization, and reduces logical errors caused by differences in processing order, providing strong support for the efficient operation of the system and the stability of user experience.

[0064] Considering that after another server receives a data processing request sent by its corresponding end-side device, the remaining servers will also generate their own processing queue synchronization instructions. Therefore, before obtaining the request processing queue according to the first processing queue synchronization instruction, the method also includes: Further, receiving a second processing queue synchronization instruction sent by each second server, wherein the second server is a server other than the first server in the data synchronization system; Correspondingly, obtaining a request processing queue according to the first processing queue synchronization instruction includes: A request processing queue is obtained based on the first processing queue synchronization instruction and each second processing queue synchronization instruction.

[0065] In actual applications, the second processing queue synchronization instruction is a synchronization instruction generated and sent by other servers except the first server, which is used to coordinate the synchronization of request processing queues in a multi-server environment to ensure that the request queues of all servers are consistent. The second processing queue synchronization instruction can be understood as a synchronization instruction generated by the second server after receiving a data processing request to ensure that all servers can coordinate and process requests in a multi-region or multi-node environment. When the second server receives a request from a client, it generates the synchronization instruction and sends it to other servers to ensure that these servers can update their request processing queues.

[0066] Continuing with the above example, when the server in region B receives a request from a user to like a video, the server will generate a second processing queue synchronization instruction and broadcast this instruction to region A and other servers so that the like request is also added to their request processing queues.

[0067] By sending a first processing queue synchronization instruction to the remaining servers, receiving a second processing queue synchronization instruction sent by the remaining servers, and simultaneously obtaining the request processing queue according to the above-mentioned first processing queue synchronization instruction and the second processing queue synchronization instruction, all servers can operate in the same request queue state, thereby improving the efficiency and overall stability of data synchronization in the distributed system.

[0068] Further, obtaining a request processing queue based on the first processing queue synchronization instruction and each second processing queue synchronization instruction includes: Determining queue update information based on the first processing queue synchronization instruction and each second processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

[0069] In actual applications, obtaining the request processing queue based on the first processing queue synchronization instruction and each second processing queue synchronization instruction ensures data consistency and operation synchronization among multiple servers. As different servers receive and generate synchronization instructions, the system needs a mechanism to integrate these instructions to ensure that the final request processing queue remains consistent among all servers. By integrating the synchronization instructions from the first server and other servers, the system can generate queue update information to guide the specific update operations of the request processing queue. In this way, when the server processes user requests (such as video likes), it can ensure that the order of like operations in different regions is consistent, avoiding data conflicts and display differences caused by inconsistent processing orders of different servers.

[0070] Through the queue update information generated by the first processing queue synchronization instruction and each second processing queue synchronization instruction, the system can clearly reflect the latest request sorting and status, so that the request processing queues of all servers can update data in a unified order. This consistency processing mechanism is particularly critical for multi-region, multi-node systems, which helps to improve the accuracy and consistency of data synchronization and ensure that users can see the same number of likes or other data regardless of the region. This synchronization method not only improves the stability of the system, but also reduces the complexity of maintaining and resolving data conflicts, providing users with a consistent experience.

[0071] By applying the solution of the embodiments of this specification, a clearer multi-server collaborative architecture is constructed by splitting the data synchronization system into a proxy service that receives data processing requests, a processing queue responsible for generating and transmitting synchronization instructions, and a business logic module for updating business data. This method reduces the need to directly operate business data, and the efficient transmission of synchronization instructions between multiple servers maintains the consistency of the request processing queue and avoids complex conflict resolution processes. Since the synchronization process is completed independently at the proxy layer and the queue layer, logical problems caused by version number and timestamp conflicts are effectively avoided. In addition, this structured separation reduces the difficulty of business logic maintenance while supporting multi-regional resource sharing, allowing the system to expand more flexibly and cope with the complexity brought about by business growth.

[0072] See also Figure 2 , Figure 2 An architecture diagram of a data synchronization system provided by an embodiment of the present specification is shown. The data synchronization system may include a first server 100 and a second server 200; The first server 100 is configured to receive a first data processing request; generate a first processing queue synchronization instruction based on the first data processing request, and send the first processing queue synchronization instruction to at least one second server 200; The second server 200 is configured to receive a first processing queue synchronization instruction sent by the first server 100; obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue; The first server 100 is further configured to obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue.

[0073] Considering that before updating the service data, each second server will receive the second data request sent by its corresponding end-side device, the second server 200 is also used to receive a second data processing request; generate a second processing queue synchronization instruction based on the second data processing request, and send the second processing queue synchronization instruction to the first server 100 and other second servers 200; The first server 100 is further configured to receive a second queue synchronization instruction sent by each second server 200; obtain a request processing queue according to the first processing queue synchronization instruction and each second processing queue synchronization instruction, and update business data based on the request processing queue; The second server 200 is further configured to obtain a request processing queue according to the first processing queue synchronization instruction and each second processing queue synchronization instruction, and update business data based on the request processing queue.

[0074] Further, the first server 100 includes a proxy service part, a request processing queue part and a business logic program part. The proxy service part is used to receive the first data processing request sent by the client, and pass the request to the request processing queue part. It should be noted that in order to further improve the efficiency of data synchronization of the synchronization system, the proxy service adds an identifier 1 representing the first server to the data corresponding to the received first data processing request when passing the request to the request queue processing part. The request processing queue part is used to arrange the requests in the order received, so that the business logic program part can process the data requests in the request queue in sequence, and then update the business data. At the same time, the synchronization program part generates a first processing queue synchronization instruction based on the data identified as identifier 1 in the request processing queue part (that is, the data corresponding to the first data processing request), and sends the instruction to the second server 200. The second server 200 includes a similar proxy service part, a request processing queue part, a synchronization program part and a business logic program part, which are used to receive the second data processing request from the client, and generate a second processing queue synchronization instruction based on the data identified as identifier 2 in the request processing queue part (that is, the data corresponding to the second data processing request).

[0075] After receiving the first processing queue synchronization instruction sent by the second server 200, the first server 100 obtains and synchronously updates its request processing queue according to the instruction, and the business logic program part processes requests and updates business data in sequence according to the updated request processing queue. Similarly, after receiving the second processing queue synchronization instruction sent by the second server 200, the first server 100 obtains and synchronously updates its request processing queue according to the instruction, and the business logic program part processes requests and updates business data in sequence according to the updated request processing queue. To ensure data consistency among multiple servers, the first server 100 and the second server 200 synchronize the request processing queues by transmitting synchronization instructions to each other, so that the requests in the queues are processed consistently in the business logic program part, ensuring that the final business data remains consistent among the servers.

[0076] By applying the solution of the embodiments of this specification, a multi-server collaborative architecture is formed by dividing the data synchronization system into a proxy service, a processing queue and a business logic module, making the functions of each part clearer. The proxy service is used to receive and forward requests, the processing queue is responsible for the generation and distribution of synchronization instructions, and the business logic module focuses on updating business data. This separation reduces the frequency of direct operations on business data. Synchronization instructions are efficiently transmitted between servers, effectively maintaining the consistency of the request processing queue and avoiding complex conflict resolution processes. Synchronization is completed independently at the proxy layer and the queue layer, eliminating logical errors caused by version number and timestamp conflicts, while enhancing the ability to share resources in multiple regions, reducing the difficulty of maintaining business logic, and making the system more scalable and flexible when dealing with business growth.

[0077] The data system may include multiple first servers 100 and second servers 200, wherein the server may be referred to as a cloud-side device or a server, and each server corresponds to one or more end-side devices (clients). Communication connections are established between multiple servers, and communication connections can be established between clients through the servers. In the data synchronization scenario, data synchronization services are provided between the servers.

[0078] The servers are connected via a network. The network provides a medium for communication links between the servers. The network may include various connection types, such as wired or wireless communication links or optical fiber cables. The data transmitted by the first server may need to be encoded, transcoded, compressed, etc. before being published to other second servers.

[0079] The first server 100 and each second server 200 may include servers that provide various services, such as servers that provide communication services for multiple clients, servers for background training that provide support for models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0080] It is worth noting that the data synchronization method provided in the embodiments of this specification can be executed by any server in the data synchronization system. However, in other embodiments of this specification, the client can also have similar functions to the server to execute the data synchronization method provided in the embodiments of this specification.

[0081] The following combination Figure 3 , taking the application of the data synchronization method provided in this specification in the video platform video data synchronization as an example, the data synchronization method is further described. Figure 3 A processing flow chart of a video platform video data synchronization method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0082] Step 302: The server corresponding to area A receives a data processing request from a client in area A through a proxy service part.

[0083] In actual applications, the data processing request of the client in area A here may be a request corresponding to adding 1 like to video A.

[0084] Step 304: The proxy service part parses the data processing request to generate an identifier A for the data corresponding to the data processing request, generates a first processing queue synchronization instruction according to the data corresponding to the identifier A, and then sends the first processing queue synchronization instruction to a server corresponding to another area.

[0085] Step 306: The server corresponding to area A receives the second processing queue synchronization request generated by the server corresponding to area B according to the data processing request sent by the client in area B to add 1 to the like of video A.

[0086] In actual applications, the data processing request of the client in area B here can also add 1 to the like for video A. The second processing queue synchronization request is that the proxy service part corresponding to area B parses the data processing request sent by the client in area B, and then generates an identifier B for the data corresponding to the above data processing request, and generates a second processing queue synchronization instruction based on the data corresponding to the identifier B, and then sends the second processing queue synchronization instruction to the server corresponding to another area.

[0087] Step 308: The servers corresponding to region A and region B update the request processing queue according to the first processing queue synchronization instruction and each second processing queue synchronization request.

[0088] It should be noted that the servers corresponding to region A and region B have received the first processing queue synchronization instruction and the second processing queue synchronization instruction through the above steps, so their respective request processing queues can be synchronized to the same state (the number of likes for video A is increased by 1 and then increased by 1, that is, the request processing queue stores the data processing requests sent by different clients in the two regions in sequence).

[0089] Step 310: The business logic parts of the servers corresponding to region A and region B process the logical operations corresponding to the above two data processing requests in sequence according to the request processing queue, and update the data corresponding to the video in its cache and database according to the results of the logical operations.

[0090] In actual applications, the logical operation corresponding to the above two processing data processing requests can be to add 1 to the number of likes for video A twice, so the number of likes can be increased and updated in sequence for the videos in the cache of each server and the database.

[0091] By applying the solution of the embodiments of this specification, the likes data synchronization process across regions of the video platform is simplified and made more efficient through the separation of the proxy service part, the request processing queue part and the business logic part. The proxy service part is responsible for receiving and parsing likes requests from clients in different regions, and generating synchronization instructions. The messages are sequentially sorted in the request processing queue and transmitted to servers in each region, effectively avoiding conflicts caused by direct data operations. On the basis of keeping the request processing queue synchronized, the business logic part of servers in each region executes the likes data update in a unified request order, so that the likes data remains consistent in the cache and database in different regions. In addition, by reducing the direct synchronization operations of the cache and database, the logical errors caused by version numbers and timestamps are reduced, and the maintainability and resource utilization efficiency of the system are improved under business growth.

[0092] Corresponding to the above method embodiment, this specification also provides a data synchronization device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a data synchronization device provided by an embodiment of the present specification. Figure 4 As shown, the device is applied to a first server in a data synchronization system, the data synchronization system includes at least two servers, the first server is any one of the servers, and includes: A first receiving module 402 is configured to receive a data processing request sent by a terminal device; A sending module 404 is configured to generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server to keep the request processing queues in each server consistent; The synchronization module 406 is configured to obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue.

[0093] Optionally, the sending module 404 is further configured to: Get the current request status information; A first processing queue synchronization instruction is generated based on the current request status information and the data processing request.

[0094] Optionally, the sending module 404 is further configured to: generating update request status information based on the current request status information and the data processing request; A first processing queue synchronization instruction is generated based on the update request status information.

[0095] Optionally, the synchronization module 406 is further configured to: determining queue update information based on the first processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

[0096] Optionally, the synchronization module 406 is further configured to: Determining a target data processing task based on the request processing queue, wherein the target data processing task is any task in the request processing queue; The business data is updated based on the target data processing task.

[0097] Optionally, the synchronization module 406 is further configured to: Execute the target data processing task and generate a business processing result; The business data is updated according to the business processing result.

[0098] Optionally, the data synchronization device further includes a second receiving module configured to: receiving a second processing queue synchronization instruction sent by each second server, wherein the second server is a server other than the first server in the data synchronization system; Accordingly, the synchronization module 406 is further configured to: A request processing queue is obtained based on the first processing queue synchronization instruction and each second processing queue synchronization instruction.

[0099] Accordingly, the synchronization module 406 is further configured to: Determining queue update information based on the first processing queue synchronization instruction and each second processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

[0100] By applying the solution of the embodiments of this specification, a clearer multi-server collaborative architecture is constructed by splitting the data synchronization system into a proxy service that receives data processing requests, a processing queue responsible for generating and transmitting synchronization instructions, and a business logic module for updating business data. This method reduces the need to directly operate business data, and the efficient transmission of synchronization instructions between multiple servers maintains the consistency of the request processing queue and avoids complex conflict resolution processes. Since the synchronization process is completed independently at the proxy layer and the queue layer, logical problems caused by version number and timestamp conflicts are effectively avoided. In addition, this structured separation reduces the difficulty of business logic maintenance while supporting multi-regional resource sharing, allowing the system to expand more flexibly and cope with the complexity brought about by business growth.

[0101] The above is a schematic scheme of a data synchronization device of this embodiment. It should be noted that the technical scheme of the data synchronization device and the technical scheme of the above data synchronization method belong to the same concept, and the details not described in detail in the technical scheme of the data synchronization device can be referred to the description of the technical scheme of the above data synchronization method.

[0102] Figure 5 The structure block diagram of a computing device 500 provided according to an embodiment of the present specification is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.

[0103] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0104] In one embodiment of the present specification, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0105] The computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 500 may also be a mobile or stationary server.

[0106] The processor 520 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned data synchronization method when executed by the processor.

[0107] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above data synchronization method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above data synchronization method.

[0108] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned data synchronization method.

[0109] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above data synchronization method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above data synchronization method.

[0110] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned data synchronization method when executed by a processor.

[0111] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above data synchronization method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above data synchronization method.

[0112] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0113] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0114] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0115] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0116] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. A data synchronization method, characterized in that: A first server applied to a data synchronization system, the data synchronization system comprising at least two servers, the first server being any one of the servers, comprising: A data processing request sent by a receiving device; Generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server to keep the request processing queues in each server consistent; A request processing queue is obtained according to the first processing queue synchronization instruction, and business data is updated based on the request processing queue.

2. The method according to claim 1, characterized in that Generating a first processing queue synchronization instruction based on the data processing request includes: Get the current request status information; A first processing queue synchronization instruction is generated based on the current request status information and the data processing request.

3. The method according to claim 2, characterized in that Generating a first processing queue synchronization instruction based on the current request state information and the data processing request includes: generating update request status information based on the current request status information and the data processing request; A first processing queue synchronization instruction is generated based on the update request status information.

4. The method according to claim 1, characterized in that Acquiring a request processing queue according to the first processing queue synchronization instruction includes: determining queue update information based on the first processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

5. The method according to claim 1, characterized in that Before acquiring the request processing queue according to the first processing queue synchronization instruction, the method further includes: receiving a second processing queue synchronization instruction sent by each second server, wherein the second server is a server other than the first server in the data synchronization system; Correspondingly, obtaining a request processing queue according to the first processing queue synchronization instruction includes: A request processing queue is obtained based on the first processing queue synchronization instruction and each second processing queue synchronization instruction.

6. The method according to claim 5, characterized in that Acquiring a request processing queue based on the first processing queue synchronization instruction and each second processing queue synchronization instruction includes: Determining queue update information based on the first processing queue synchronization instruction and each second processing queue synchronization instruction; A request processing queue is obtained according to the queue update information.

7. The method according to claim 1, characterized in that Updating business data based on the request processing queue includes: Determine a target data processing task based on the request processing queue, wherein the target data processing task is any task in the request processing queue; The target data processing task is executed to generate a business processing result, and the business data is updated according to the business processing result.

8. A data synchronization system, characterized in that: comprising a first server and at least one second server; A first server is configured to receive a first data processing request; generate a first processing queue synchronization instruction based on the first data processing request, and send the first processing queue synchronization instruction to at least one second server; The second server is configured to receive a first processing queue synchronization instruction sent by the first server; obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue; The first server is further configured to obtain a request processing queue according to the first processing queue synchronization instruction, and update business data based on the request processing queue.

9. A data synchronization device, characterized in that: A first server applied to a data synchronization system, the data synchronization system comprising at least two servers, the first server being any one of the servers, comprising: A first receiving module, configured to receive a data processing request sent by a terminal-side device; a sending module, configured to generate a first processing queue synchronization instruction based on the data processing request, and send the first processing queue synchronization instruction to at least one second server, so that the request processing queues in each server are consistent; The synchronization module is configured to obtain the request processing queue according to the first processing queue synchronization instruction, and update the business data based on the request processing queue.

10. A computing device, characterized in that include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium, characterized in that: A computer program / instruction is stored, and when the computer program / instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

12. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.