Lockstep-based synchronization system and method for key data between server clusters

Through the lockstep-based inter-server cluster data synchronization system and the fixed frame rate polling mechanism of the lockstep server and client threads, the network pressure and data consistency problems in the existing technology are solved, and cross-region and time zone product rush activities are realized. Efficient processing and data consistency.

CN114168346BActive Publication Date: 2024-09-03四川启睿克科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111545232.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-16
Publication Date
2024-09-03
Estimated Expiration
2041-12-16

AI Technical Summary

Technical Problem

When the existing technology handles a large number of user requests, it causes excessive network pressure, which may cause operation requests to be ignored or rejected. It is also unable to support cross-region and time zone product rush activities, and data consistency cannot be guaranteed, and operation delays and conflicts are prone to occur. .

Method used

A key data synchronization system between server clusters based on lockstep is adopted. The lockstep server is connected to multiple server clusters. Each server cluster contains a lockstep client thread for polling at a fixed frame rate. The lockstep server receives and timestamps the data and then forwards it. Ensure data consistency.

Benefits of technology

It achieves complete data consistency under high concurrency, avoids operational delays and conflicts, and ensures normal processing of cross-region and time zone activities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168346B
    Figure CN114168346B
Patent Text Reader

Abstract

The present invention discloses a system for synchronizing key data between server clusters based on LockStep, comprising a LockStep server and a plurality of server clusters connected to the LockStep server, each of the server clusters being respectively connected to a plurality of clients, and each server cluster comprising a LockStep client thread, the LockStep client thread being used for performing polling at a fixed frame rate; the present invention also provides a method for synchronizing key data between server clusters based on LockStep; the present invention ensures that data between server clusters are completely consistent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a lockstep-based synchronization system and method for key data between server clusters. Background Art

[0002] With the development of the Internet, more and more e-commerce companies have emerged in the market, and providing users with real-time and accurate product information when they enter the e-commerce system has become a basic function.

[0003] In current technology, product rush purchase activities are generally carried out in the same region and time zone, and the same server processes user operation requests for products. However, when the number of users is too large and all operation requests are concentrated on the same server, due to the instantaneous network pressure and too frequent data operations, some users' operation requests are easily ignored or directly rejected. At the same time, this method cannot support activities carried out simultaneously in different time zones and regions.

[0004] Currently, there is a method in the market that operates data through servers in different regions and then sends it to the central server for processing. However, it cannot guarantee complete consistency of data. There is also a method that different servers operate the only service storage center at the same time, but when the instantaneous operation pressure is too high, the operation delay is too large and is affected by the operation of other servers. In extreme cases, different servers may have operation conflicts, which are difficult to handle. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a system and method for synchronizing key data between server clusters based on lockstep, and the present invention ensures that the data between server clusters are completely consistent.

[0006] To achieve the above-mentioned purpose, the technical solution adopted by the present invention is: a lockstep-based synchronization system for key data between server clusters, including a lockstep server and multiple server clusters connected to the lockstep server, each of the server clusters is connected to multiple clients, and each server cluster includes a lockstep client thread, and the lockstep client thread is used for polling at a fixed frame rate.

[0007] The present invention also provides a method for synchronizing key data between server clusters based on LockStep, using the above-mentioned LockStep system for synchronizing key data between server clusters, the method comprising the following steps:

[0008] Step 1: When starting the whole process, the lockstep server and lockstep client threads first synchronize complete data;

[0009] Step 2: The lockstep server receives the data from the lockstep client thread, adds a timestamp to it, and then forwards it to all lockstep client threads;

[0010] Step 3: The lockstep client thread performs fixed frequency polling;

[0011] Step 4: In the polling process of the lockstep client thread, the current frame number, current operation, operation parameters, and current server time are assembled into a frame data and sent to the lockstep server;

[0012] Step 5: After receiving the frame data, the lockstep client thread performs data operations locally.

[0013] As a preferred implementation, in step 1, the lockstep server is started first, and then the lockstep client threads are started in sequence. The lockstep client threads first request all basic data from the lockstep server, and after all lockstep client threads complete data synchronization, the following process is entered.

[0014] As another preferred implementation, in step 3, the lockstep client thread performs polling at a fixed frequency of 20 frames.

[0015] As another preferred implementation, in step 4, the lockstep client thread sends data via UDP during polling.

[0016] The beneficial effects of the present invention are:

[0017] The present invention distributes data operation information to all server clusters through a globally unique lockstep server. Under the condition that the initial data is consistent, each cluster performs consistent operations on the data to ensure that the final results are still completely consistent. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 A topological structure diagram of a synchronization system in an embodiment of the present invention;

[0019] Figure 2 It is a flowchart of the lockstep server in the synchronization method of an embodiment of the present invention;

[0020] Figure 3 The flowchart of the lockstep client thread in the synchronization method of the embodiment of the present invention. DETAILED DESCRIPTION

[0021] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0022] Example

[0023] like Figure 1 As shown, a lockstep-based synchronization system for key data between server clusters includes a lockstep server and multiple server clusters connected to the lockstep server, each server cluster is connected to multiple clients, and each server cluster includes a lockstep client thread, which is used for fixed frame rate polling.

[0024] This embodiment further provides a method for synchronizing key data between server clusters based on LockStep, using the above-mentioned system for synchronizing key data between server clusters based on LockStep, including:

[0025] The lockstep server sends the data to all lockstep clients;

[0026] All server clusters provide a separate lockstep client thread for fixed frame rate polling;

[0027] In the lockstep client thread polling, the current frame number, current operation, and operation parameters are assembled into a frame data and sent to the lockstep server through UDP;

[0028] The lockstep server receives frame data;

[0029] If there is an operation instruction in the frame data, the time of the current lockstep server is written into the frame data and then forwarded to the lockstep client threads of all server clusters;

[0030] If there is no operation instruction in the frame data, this frame can be skipped;

[0031] The lockstep client thread performs data operations locally after receiving the frame data.

[0032] Specifically, Figure 2 As shown, the lockstep server process includes the following steps:

[0033] After the lockstep server is started, it first waits for the connection request from the lockstep client thread;

[0034] After all configured lockstep clients are connected successfully, start the data synchronization process;

[0035] After data synchronization is completed, the loop processing flow of frame data begins;

[0036] After receiving the frame data from the lockstep client, if it is a valid operation command, the current timestamp is added to the frame data and then distributed to all lockstep client threads;

[0037] Repeat the above process.

[0038] like Figure 3 As shown, the lockstep client thread process includes the following steps:

[0039] Each server cluster will establish an independent lockstep client thread, which is dedicated to handling the synchronization of key data between clusters. When the lockstep client thread is started, it will first synchronize data with the lockstep server to ensure the initial data is consistent.

[0040] After receiving the client request, the server cluster will perform preliminary processing. If there is a request to operate key data, it will notify the lockstep client thread, organize the operation instructions, operation parameters, operation time, and current frame number into frame data, and send it to the lockstep server.

[0041] After the lockstep client thread receives the frame data from the lockstep server, if there is an operation instruction, it performs the operation on the data locally.

[0042] Repeat the above process.

[0043] The above-mentioned embodiments only express the specific implementation of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A lockstep-based method for synchronizing key data between server clusters, characterized in that: The synchronization system of key data between server clusters using lockstep is implemented. The synchronization system includes a lockstep server and multiple server clusters connected to the lockstep server. Each of the server clusters is connected to multiple clients respectively, and each server cluster includes a lockstep client thread. The lockstep client thread is used for polling at a fixed frame rate. The synchronization method includes the following steps: Step 1: When starting the whole process, the lockstep server and lockstep client threads first synchronize complete data; Step 2: The lockstep server receives the data from the lockstep client thread, adds a timestamp to it, and then forwards it to all lockstep client threads; Step 3: The lockstep client thread performs fixed frequency polling; Step 4: In the polling process of the lockstep client thread, the current frame number, current operation, operation parameters, and current server time are assembled into a frame data and sent to the lockstep server; The lockstep server receives frame data; If there is an operation instruction in the frame data, the time of the current lockstep server is written into the frame data and then forwarded to the lockstep client threads of all server clusters; If there is no operation instruction in the frame data, this frame can be skipped; Step 5: After receiving the frame data, the lockstep client thread performs data operations locally.

2. The lockstep-based synchronization method for key data between server clusters according to claim 1 is characterized in that: In step 1, the lockstep server is started first, and then the lockstep client threads are started in sequence. The lockstep client threads first request all basic data from the lockstep server. After all lockstep client threads complete data synchronization, the following process is entered.

3. The lockstep-based synchronization method for key data between server clusters according to claim 1 is characterized in that: In step 3, the lockstep client thread performs polling at a fixed frequency of 20 frames.

4. The lockstep-based synchronization method for key data between server clusters according to claim 1, characterized in that: In step 4, the lockstep client thread sends data via UDP in polling.