Data synchronization method and apparatus, electronic device, and storage medium

CN116617654BActive Publication Date: 2026-10-16NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310532894.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2026-10-16
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

其中,帧同步技术由于游戏逻辑均部署在终端,容易被作弊程序篡改,影响游戏的公平性;而状态同步技术虽然能够避免被篡改,却需要传输巨大的数据量,容易造成游戏出现卡顿现象

Benefits of technology

[0012]When the aforementioned data synchronization method, apparatus, electronic device, and storage medium are applied to a game server, the method includes: acquiring a state change operation corresponding to a target frame of at least one target game client, wherein the state change operation includes at least one first state change operation and at least one second state change operation; performing state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; packaging the first state change data of the target frame and the at least one second state change operation into a target synchronization message; and sending the target synchronization message to each of the target game clients. In this approach, based on the size of the synchronized data volume and the fault tolerance rate for the settlement of core game rule resources, state change operations are divided into first state change operations with small synchronized data volume and low fault tolerance rate, and second state change operations with large synchronized data volume and high fault tolerance rate. For first state change operations, a state synchronization method is used for data synchronization, while for second state change operations, a frame synchronization method is used for data synchronization. This avoids directly forwarding the second state change data with a large data volume. Instead, the second state change operation is forwarded to each game client to generate the second state change data itself, realizing data synchronization between the game server and each game client. This reduces the occurrence of game lag and also makes it less likely for core game rule resources to be erroneous or tampered with.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116617654B_ABST
    Figure CN116617654B_ABST
Patent Text Reader

Abstract

The application provides a data synchronization method and device, electronic equipment and a storage medium; wherein, according to the size of the synchronization data and the abnormal fault tolerance rate of the game rule core resource settlement, the state change operation is divided into the first state change operation with small synchronization data and low abnormal fault tolerance rate, and the second state change operation with large synchronization data and high abnormal fault tolerance rate; the state synchronization mode is adopted for the first state change operation to synchronize the data, and the frame synchronization mode is adopted for the second state change operation to synchronize the data, so that the second state change data with large data is not directly forwarded, but the second state change operation is forwarded to each game client to generate the second state change data, the data synchronization of the game server and each game client is realized, the game lag phenomenon is reduced, and the game rule core resource is not easy to be wrong or tampered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data synchronization technology, and in particular to a data synchronization method, apparatus, electronic device, and storage medium. Background Technology

[0002] In multiplayer online games, it is necessary to ensure that the game status and operation results displayed on different game terminals are consistent. Therefore, data synchronization between different game terminals is required.

[0003] Existing data synchronization technologies are divided into frame synchronization and state synchronization. In frame synchronization, the server acts as a data forwarder, collecting operation data from different terminals and forwarding it to each terminal to execute game logic. In state synchronization, the server acts as the executor of the game logic and distributes the execution results to each terminal, which then updates its display state independently. Frame synchronization, because the game logic is deployed on the terminal, is vulnerable to tampering by cheat programs, affecting the fairness of the game. While state synchronization can prevent tampering, it requires transmitting a huge amount of data, which can easily cause game lag. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a data synchronization method, apparatus, electronic device and storage medium to reduce the occurrence of game lag.

[0005] In a first aspect, embodiments of the present invention provide a data synchronization method applied to a game server. The method includes: acquiring state change operations corresponding to a target frame of at least one target game client, wherein the state change operations include at least one first state change operation and at least one second state change operation; performing state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; packaging the first state change data of the target frame and the at least one second state change operation into a target synchronization message; and sending the target synchronization message to each of the target game clients.

[0006] Secondly, embodiments of the present invention provide another data synchronization method applied to a game client. The method includes: when a target synchronization message is received from a game server, updating the display state of first state change data in the target synchronization message to obtain a first display state; performing state change logic processing on at least one second state change operation in the target synchronization message to obtain second state change data of the game client; and updating the display state of the second state change data of the game client to obtain a second display state.

[0007] Thirdly, embodiments of the present invention provide a data synchronization device applied to a game server. The device includes: an operation acquisition module, configured to acquire state change operations corresponding to at least one target frame of a target game client, wherein the state change operations include at least one first state change operation and at least one second state change operation; a first processing module, configured to perform state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; a message packaging module, configured to package the first state change data of the target frame and the at least one second state change operation into a target synchronization message; and a message distribution module, configured to send the target synchronization message to each target game client.

[0008] Fourthly, embodiments of the present invention provide another data synchronization device applied to a game client. The device includes: a first update module, configured to update the display state of first state change data in the target synchronization message when a target synchronization message is received from a game server, thereby obtaining a first display state; a third processing module, configured to perform state change logic processing on at least one second state change operation in the target synchronization message, thereby obtaining second state change data of the game client; and a second update module, configured to update the display state of the second state change data of the game client, thereby obtaining a second display state.

[0009] Fifthly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described data synchronization method.

[0010] In a sixth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the aforementioned data synchronization method.

[0011] The embodiments of the present invention bring the following beneficial effects:

[0012] When the aforementioned data synchronization method, apparatus, electronic device, and storage medium are applied to a game server, the method includes: acquiring a state change operation corresponding to a target frame of at least one target game client, wherein the state change operation includes at least one first state change operation and at least one second state change operation; performing state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; packaging the first state change data of the target frame and the at least one second state change operation into a target synchronization message; and sending the target synchronization message to each of the target game clients. In this approach, based on the size of the synchronized data volume and the fault tolerance rate for the settlement of core game rule resources, state change operations are divided into first state change operations with small synchronized data volume and low fault tolerance rate, and second state change operations with large synchronized data volume and high fault tolerance rate. For first state change operations, a state synchronization method is used for data synchronization, while for second state change operations, a frame synchronization method is used for data synchronization. This avoids directly forwarding the second state change data with a large data volume. Instead, the second state change operation is forwarded to each game client to generate the second state change data itself, realizing data synchronization between the game server and each game client. This reduces the occurrence of game lag and also makes it less likely for core game rule resources to be erroneous or tampered with.

[0013] When the aforementioned data synchronization method, apparatus, electronic device, and storage medium are applied to a game client, they include: upon receiving a target synchronization message from a game server, updating the display state of first state change data in the target synchronization message to obtain a first display state; performing state change logic processing on at least one second state change operation in the target synchronization message to obtain second state change data for the game client; and updating the display state of the second state change data for the game client to obtain a second display state. In this method, when the target synchronization message is received in the game client, since the first state change data has undergone state change logic processing by the game server, the display state can be updated directly. The second state change operation is first processed by state change logic on the game client to obtain the same second state change data as the game server before updating the display state. This allows the second state change data from the game server to remain synchronized without data forwarding to the game client, thereby reducing the amount of data that needs to be synchronized and preventing game lag.

[0014] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0015] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart of one embodiment of the data synchronization method in this invention;

[0018] Figure 2 This is a flowchart of another embodiment of the data synchronization method in this invention;

[0019] Figure 3 This is a flowchart of another embodiment of the data synchronization method in this invention;

[0020] Figure 4 A schematic diagram of a data synchronization device provided in an embodiment of the present invention;

[0021] Figure 5 Another schematic diagram of a data synchronization device provided in an embodiment of the present invention;

[0022] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] Understandably, to ensure that all game clients participating in the same game see the same game state, this invention uses a hybrid frame synchronization and state synchronization method to synchronize data between the server and each game client. This combines the advantages of small data volume in frame synchronization and the resistance to tampering with state synchronization data, reducing game lag. It should be noted that the game framework applicable to this invention is divided into a logic layer and a presentation layer. The logic layer processes data related to the game rules and logic. For example, in a battle game, the logic layer records battlefield-related data and the attribute states of each game character. When a character uses a skill, the logic layer performs resource settlement, effect determination, and ultimately applies attribute changes to the affected character. The presentation layer, on the other hand, visualizes the data processed by the logic layer on the game terminal. This involves processing game scenes, actions, and special effects. For example, in a battle game, when a character uses a skill, the presentation layer controls the character model to play actions, creates corresponding attack and bullet effects, and plays hit actions and effects at the character identified as being hit.

[0026] Based on the aforementioned game framework, the logic layer handles state change logic, while the presentation layer displays state updates. The logic layer can be deployed on the game server and / or game client, while the presentation layer is typically deployed on the game client. In the frame synchronization method, both the logic and presentation layers are deployed on each game client. The game server collects one-frame operations uploaded by all game clients and broadcasts them to all game clients. Game rule logic processing and visualization effect calculations are performed on the game client, thus achieving state synchronization across clients. In the state synchronization method, the logic layer is deployed on the game server, and each game client only deploys the presentation layer. After the game server collects one-frame operations from all game clients, it executes these operations through the logic layer. Based on the execution result, it broadcasts the state change event triggered by this frame to all game clients. Upon receiving the broadcast, all game clients use the presentation layer to display the visualization effect, thus achieving state synchronization across clients. This invention combines frame synchronization and state synchronization methods for data synchronization between the server and each game client. It leverages the advantages of small data volume in frame synchronization and the resistance to tampering with state synchronization data, reducing game stuttering.

[0027] It should be noted that the smallest unit of time for data processing in a virtual game is called a frame. Both the logic layer and the presentation layer process and present data based on the amount of data in one frame. For example, when the frame rate of both the logic layer and the presentation layer is 10 frames per second, the amount of data in one frame is the amount of data within 1000 / 10 = 100 milliseconds. The logic layer and the presentation layer advance (tick) once every 100 milliseconds. The specific frame rate is not limited here. The frame rates of the logic layer and the presentation layer can be the same or different.

[0028] It is understandable that a game server can be a single server, or a combination of servers such as a server cluster or a distributed system. When the data synchronization method runs on the server, the method can be implemented and executed based on a cloud interaction system, which includes the server (i.e., the game server) and the client device (i.e., the game client).

[0029] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separate. Data synchronization and storage are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses game screen data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.

[0030] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.

[0031] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the data synchronization method in this invention is applied to a game server, including:

[0032] Step S10: Obtain at least one state change operation corresponding to the target frame of the target game client. The state change operation includes at least one first state change operation and at least one second state change operation.

[0033] In this embodiment, the target frame is any frame within the tick frame rate of the logic layer in the game server. For example, if the tick frame rate of the logic layer in the game server is 10 frames / second, then there are 10 target frames per second. Each target frame has a duration of 100 milliseconds. The state change operation corresponding to at least one target game client's target frame is equivalent to all state change operations of all target game clients within 100 milliseconds. Specific details are not limited here. In this embodiment, state change operations refer to any operation / instruction that can change the game state, such as player character movement, the occurrence of game system events (e.g., weather changes, object movement), attacks by non-player characters, the passage of time, etc. Specific details are not limited here.

[0034] It is understood that the state change operation includes at least one first state change operation and at least one second state change operation. The first state change operation can be operation data with a smaller synchronization data volume, while the second state change operation can be operation data with a larger synchronization data volume. In different virtual games, the first state change operation and the second state change operation can refer to different operation data. For example, in racing games, if movement-related operation data is synchronized across multiple clients using a state synchronization method, the synchronization data volume is large. In contrast, the synchronization data volume of non-movement-related operation data is small. Therefore, in racing games, the first state change operation can be used to indicate non-movement-related operation data, and the second state change operation can be used to indicate movement-related operation data. Similarly, in building games, the synchronization data volume of movement operation data for buildings may be greater than that for non-building movement operation data. Therefore, the first state change operation data can be used to indicate non-building movement operation data, and the second state change operation can be used to indicate building movement operation data. The first and second state change operations can be flexibly set for different types of virtual games, making the application scenarios of this invention more extensive.

[0035] In one embodiment, step S10 includes: receiving state change operations uploaded by at least one target game client within one frame duration according to a first preset frame rate, and obtaining state change operations corresponding to the target frames of all target game clients.

[0036] Understandably, the game server can update its status (tick) according to its own frame rate without needing to match the game client's status update frame rate. Typically, the game server's tick frame rate is lower than the game client's tick frame rate. This ensures accurate game logic while reducing server load. The game client can also choose different tick frame rates based on its device configuration. Commonly available tick frame rates include 20 frames per second, 30 frames per second, and 60 frames per second, while the server's tick frame rate is usually 10 frames per second, without specifying a particular limit here.

[0037] In one embodiment, after step S10, the method further includes: performing state change logic processing on at least one second state change operation to obtain second state change data of the target frame. In this embodiment, for second state change operations with a large amount of synchronization data, both the game server and all target game clients deploy logic processing modules for second state change operations. These logic processing modules are part of the logic layer in the game server, and in each target game client, they can be logic processing modules independent of the presentation layer, or they can be part of the presentation layer; the specifics are not limited here. For the second state change operation, frame synchronization is used to achieve synchronization among game clients. That is, the second state change operation is directly forwarded to each game client. The logic processing module of the second state change operation in each game client performs state change logic processing on at least one second state change operation. Similarly, the game server also performs state change logic processing on at least one second state change operation through the logic processing module of the second state change operation to obtain the second state change data of the target frame. In this way, the second state change data with a large amount of synchronization data does not need to be forwarded to each game client through the game server. The second state change data in the game server and each game client can also maintain a synchronized state, which reduces the amount of synchronization data and reduces the occurrence of game lag.

[0038] Step S20: Perform state change logic processing on at least one first state change operation to obtain the first state change data of the target frame;

[0039] Understandably, in virtual games, different state change operations can be processed using game logic to obtain state change data. For example, for the first state change operation of skill release, at the logic level of the game rules, it is necessary to calculate the state change after skill release, such as the reduction of skill resources of the skill release target, the reduction of health / life value of the skill target, etc., to obtain new game state data, which is the first state change data of the target frame.

[0040] In one implementation, the game server deploys a logic layer for the target game, used to perform state change logic processing on at least one first state change operation to obtain first state change data for the target frame. This first state change data is synchronized with all target game clients via a state synchronization mechanism. Specifically, the logic layer deployed on the game server executes all first state change operations on the target frame to obtain the first state change data. The game server then broadcasts this first state change data to all game clients. Upon receiving the broadcast, each game client displays the first state change data using a presentation layer deployed on its own game client, thus achieving state synchronization across all game clients.

[0041] Step S30: Pack the first state change data of the target frame and at least one second state change operation into a target synchronization message;

[0042] In this embodiment, the first state change data of the target frame and at least one second state change operation are packaged together by means of a synchronization message and sent to each target game client for synchronization. For example, assuming that the first state change data is the deduction data of skill resources and the second state change operation is a movement-related command, then the deduction data of skill resources and the movement-related command are packaged into a target synchronization message and sent to all target game clients participating in the same game, thereby realizing the state synchronization of all target game clients.

[0043] In one implementation, the first state change data and the second state change operation for different frames can be packaged frame by frame and pushed into the target synchronization message queue. The target synchronization message queue contains the first state change data and at least one second state change operation for each frame. Each target game client synchronizes its game state by reading the synchronization messages in the target synchronization message queue frame by frame.

[0044] In one embodiment, step S40 includes: generating instructions for at least one second state change operation corresponding to the target frame to obtain at least one second state change instruction; storing the at least one second state change instruction sequentially into a preset instruction sequence to obtain a target instruction sequence; and packaging the first state change data and the target instruction sequence into a target synchronization message. In this embodiment, each second state change operation is converted into an instruction that can be directly executed in the logic layer and the presentation layer, and stored sequentially into a preset instruction sequence to obtain a time-sequential target instruction sequence. Finally, the target instruction sequence and the first state change data are packaged together into a synchronization message to obtain a target synchronization message, so that the game client can directly unpack the target synchronization message to obtain the executable and time-sequential second state change instruction and execute it directly.

[0045] In one implementation, a first state change operation is used to indicate a non-movement-related state change operation, and a second state change operation is used to indicate a movement-related state change operation. It is understood that movement-related state change operations typically involve a high amount of synchronized data and also generally have a high fault tolerance rate; even if errors occur or the game client tampers with the data, the impact on the core game rules is relatively small and easily corrected. Therefore, this implementation designates movement-related state change operations as the second state change operation and uses frame synchronization for data synchronization, which ensures the security of the core game rules data while reducing the amount of synchronized data.

[0046] Step S40: Send the target synchronization message to each target game client.

[0047] In this embodiment, the game server sends a target synchronization message of the target frame to each target game client. After receiving the target synchronization message, each target game client synchronizes the first state change data and the second state change data. In one embodiment, while sending the target synchronization message to each target game client, the game server also sends a synchronization command to each target game client, triggering each target game client to synchronize the first state change data and the second state change data.

[0048] The data synchronization method provided in the above implementation method divides state change operations into a first state change operation with a small amount of synchronized data and a low fault tolerance rate for the settlement of core game rules resources, and a second state change operation with a large amount of synchronized data and a high fault tolerance rate, based on the size of the synchronized data volume and the fault tolerance rate for the settlement of core game rules resources. The first state change operation is synchronized using a state synchronization method, while the second state change operation is synchronized using a frame synchronization method. This avoids directly forwarding the second state change data with a large amount of data. Instead, the second state change operation is forwarded to each game client to generate the second state change data itself, thereby realizing data synchronization between the game server and each game client. This reduces the occurrence of game lag and also makes it less likely for core game rules resources to be erroneous or tampered with.

[0049] Please see Figure 2 Another embodiment of the data synchronization method in this invention, applied to a game client, includes:

[0050] Step S201: When a target synchronization message is received from the game server, the display status is updated on the first state change data in the target synchronization message to obtain the first display status.

[0051] In this embodiment, when the game client receives a target synchronization message from the game server, it triggers game synchronization. First, the target synchronization message contains first state change data. Since this first state change data is directly displayable and required by the game client's presentation layer, in one implementation, when the game client receives the target synchronization message, the presentation layer updates the display state of the first state change data in the target synchronization message to obtain the first display state in the game client. For example, assuming the first state change data represents skill resource deduction data, the game client's first display state is the display state after the skill resource deduction. Players can see the quantity of skill resources after the deduction, the playback effect of skill release, etc. Specific details are not limited here.

[0052] In one implementation, a presentation layer is deployed in the game client to update the display status of the first state change data in the target synchronization message when the target synchronization message is received from the game server, thereby obtaining the first display status.

[0053] In one implementation, step S201 includes: upon receiving a target synchronization message from the game server, unpacking the target synchronization message to obtain first state change data sent by the game server; and updating the first display state of the game client using the first state change data sent by the game server to obtain the first display state. In this implementation, after receiving the target synchronization message from the game server, the game client can obtain the first state change data sent by the game server by unpacking the target synchronization message, which is used to update the first display state of the game client to obtain the first display state. Specifically, the game client can update its first display state using the first state change data sent by the game server through the presentation layer to obtain the first display state.

[0054] Step S202: Perform state change logic processing on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client;

[0055] In this implementation, since the second state change operation is data that has not undergone state change logic processing by the game server, and is operation data collected by the game server from all game clients participating in the same game, it cannot be directly used for display state updates. Instead, it must first undergo state change logic processing at the logic layer to obtain the second state change data for the game client before it can be used for subsequent display state updates. It is understood that the second state change data of the game client and the second state change data of the game server are identical, allowing the second state change data of the game client and the game server to remain synchronized without data forwarding, thereby reducing the amount of data that needs to be synchronized and thus avoiding game lag.

[0056] In one implementation, the game client deploys a logic processing module for second state change operations, which is part of the logic layer in the game server. By extracting it from the logic layer and deploying it separately in the game client, it can perform state change logic processing on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client. This allows the second state change data of the game server to remain synchronized without having to forward data to the game client, thereby reducing the amount of data that needs to be synchronized and thus avoiding game lag.

[0057] In one implementation, step S202 includes: sequentially reading each second state change instruction from the target instruction sequence in the target synchronization message, and sequentially performing state change logic operations on each read second state change instruction to obtain the second state change data of the game client. In this implementation, during the state change logic processing of the second state change operation, each second state change instruction with a time sequence is first read from the target instruction sequence in the target synchronization message. Then, each second state change instruction is executed through the logic processing module or logic layer in the game client that handles the second state change operation, thereby obtaining the same / synchronized second state change data in the game client as that of the game server. This allows the second state change data of the game server to remain synchronized without needing to be forwarded to the game client, thus reducing the amount of data that needs to be synchronized and preventing game lag.

[0058] Step S203: Update the display state of the second state change data of the game client to obtain the second display state.

[0059] In this embodiment, after obtaining the second state change data of the game client, the display state can be updated in the game client to obtain the second display state. In one embodiment, the game client deploys a presentation layer, and the second display state can be obtained by updating the display state of the second state change data of the game client through the presentation layer. For example, assuming that the second state change data is movement-related data, such as a command for a player object to move forward, then after the presentation layer updates the display state of the second state change data of the game client, the player object in the game client will display a forward-moving animation, and the display position will change. The specifics are not limited here.

[0060] In one embodiment, after step S203, the method further includes: updating the display status frame by frame according to a second preset frame rate to obtain the display status of each frame. It is understandable that the game client and game server can tick according to their respective tick frame rates. Therefore, the frequency at which the game server sends target synchronization messages may differ from the frequency at which the game client updates its display status. For example, assuming the game server's tick frame rate is 10 frames per second and the game client's tick frame rate is 30 frames per second, then the game server sends a target synchronization message to the game client every 100 milliseconds, while the game client needs to refresh its status every 33 milliseconds. If the game client does not receive a target synchronization message from the game server during this period, it can update its status by interpolating frames. Therefore, in this embodiment, for intermediate frames where the target synchronization message from the game server has not been received, the display status is updated frame by frame according to the game client's own second preset frame rate to obtain the display status of each intermediate frame. The display status of the intermediate frame is the interpolation between the target frames of the two game servers, which allows the game client to maintain a high refresh rate while reducing the server load and minimizing game stuttering.

[0061] In one implementation, a first display state indicates a non-movement-related display state, and a second display state indicates a movement-related display state. Corresponding to the game server, the first display state refers to the display state indicating a first state change operation. If the first state change operation indicates a non-movement-related state change operation, then the first display state also indicates a non-movement-related display state. Similarly, the second display state refers to the display state indicating a second state change operation. If the second state change operation indicates a movement-related state change operation, then the second display state also indicates a movement-related display state. This hybrid frame synchronization and state synchronization approach ensures the security of core game data while reducing game stuttering.

[0062] In one implementation, the update frame rate of the game client is greater than that of the game server. It is understood that the game server's tick frame rate (i.e., update frame rate) can be less than the game client's tick frame rate. The game server's update frame rate refers to the frame rate at which the game server executes steps S10-S50 of this embodiment of the invention, which is the frame rate of one tick at the logic layer. The game client's update frame rate refers to the frame rate at which the game client updates its display state, including the first display state, the second display state, and the display state of intermediate frames where no target synchronization message has been received from the game server, which is the frame rate of one tick at the presentation layer. The specific details are not limited here.

[0063] The data synchronization method provided in the above embodiments allows for direct display status updates when a target synchronization message is received in the game client, since the first state change data is processed by the game server's state change logic. The second state change operation, on the other hand, is first processed by the game client's state change logic to obtain the same second state change data as the game server before display status updates are performed. This ensures that the second state change data from the game server can remain synchronized without being forwarded to the game client, thereby reducing the amount of data that needs to be synchronized and preventing game lag.

[0064] Please see Figure 3 Another embodiment of the data synchronization method in this invention is applied to a game server and a game client, including:

[0065] Step 301: The game server obtains at least one state change operation corresponding to the target frame of the target game client. The state change operation includes at least one first state change operation and at least one second state change operation.

[0066] Step 302: The game server performs state change logic processing on at least one first state change operation to obtain the first state change data of the target frame;

[0067] Step 303: The game server packages the first state change data of the target frame and at least one second state change operation into a target synchronization message;

[0068] Step 304: The game server sends the target synchronization message to each target game client;

[0069] Step 305: When the game client receives the target synchronization message sent by the game server, it updates the display status of the first state change data in the target synchronization message to obtain the first display status.

[0070] Step 306: The game client performs state change logic processing on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client.

[0071] Step 307: The game client updates the display state of the second state change data of the game client to obtain the second display state.

[0072] In steps 301-308 of this embodiment of the invention, the game server is equipped with a first logic layer and a second logic layer. After the game server collects the state change operations corresponding to the target frame of all target game clients, it performs game logic processing on at least one of the first state change operations through the first logic layer to obtain the first state change data of the target frame. Then, it performs game logic processing on at least one of the second state change operations through the second logic layer to obtain the second state change data of the target frame. To avoid game lag issues caused by directly forwarding large amounts of second-state change data to various game clients, the game server packages smaller amounts of first-state change data and at least one original second-state change operation. This packaged target synchronization message is then distributed to each target game client. To maintain data synchronization with the game server, each game client deploys a second logic layer and a presentation layer. Upon receiving the target synchronization message from the game server, the first-state change data can be directly updated through the presentation layer. The second-state change operation undergoes state change logic processing through the same second logic layer as the game server, resulting in the same second-state change data for the game client, which is then updated for display. This eliminates the need for the large amounts of second-state change data to be forwarded through the game server to each game client, ensuring synchronization between the game server and each game client. This reduces the amount of data to be synchronized and minimizes game lag.

[0073] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 4The diagram illustrates a data synchronization device applied to a game server. The device includes: an operation acquisition module 40, configured to acquire state change operations corresponding to at least one target frame of a target game client, the state change operations including at least one first state change operation and at least one second state change operation; a first processing module 42, configured to perform state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; a message packaging module 44, configured to package the first state change data of the target frame and the at least one second state change operation into a target synchronization message; and a message distribution module 46, configured to send the target synchronization message to each target game client.

[0074] The aforementioned data synchronization device categorizes state change operations into two types based on the size of the synchronized data volume and the fault tolerance rate for settling core game rules resources: first state change operations with small synchronized data volume and low fault tolerance rate, and second state change operations with large synchronized data volume and high fault tolerance rate. For first state change operations, a state synchronization method is used for data synchronization, while for second state change operations, a frame synchronization method is used. This avoids directly forwarding large amounts of second state change data; instead, it forwards the second state change operation to each game client to generate its own second state change data. This achieves data synchronization between the game server and each game client, reducing game lag and making it less prone to errors or tampering with core game rules resources.

[0075] Optionally, the above apparatus further includes: a second processing module, used to perform state change logic processing on at least one second state change operation to obtain second state change data of the target frame.

[0076] Optionally, the above-mentioned operation acquisition module 40 is specifically used to: receive at least one state change operation uploaded by a target game client within one frame duration according to a first preset frame rate, and obtain the state change operations corresponding to the target frames of all target game clients.

[0077] Optionally, the message packaging module 44 is specifically used to: generate instructions for at least one second state change operation in the target frame to obtain at least one second state change instruction; store the at least one second state change instruction into a preset instruction sequence in sequence to obtain a target instruction sequence; and package the first state change data and the target instruction sequence into a target synchronization message.

[0078] Optionally, the first state change operation is used to indicate a non-movement-related state change operation, and the second state change operation is used to indicate a movement-related state change operation.

[0079] For the corresponding method embodiments described above, see [link to relevant documentation]. Figure 5 The diagram illustrates a data synchronization device applied to a game client. The device includes: a first update module 50, configured to update the display state of first state change data in the target synchronization message upon receiving a target synchronization message from a game server, thereby obtaining a first display state; a third processing module 52, configured to perform state change logic processing on at least one second state change operation in the target synchronization message, thereby obtaining second state change data for the game client; and a second update module 54, configured to update the display state of the second state change data for the game client, thereby obtaining a second display state.

[0080] In the aforementioned data synchronization device, when a target synchronization message is received in the game client, the first state change data can be directly updated to reflect the state change after the game server has processed the state change logic. The second state change operation, on the other hand, is first processed by the game client to obtain the same second state change data as the game server before updating the state. This allows the second state change data from the game server to remain synchronized without needing to be forwarded to the game client, thereby reducing the amount of data that needs to be synchronized and preventing game lag.

[0081] Optionally, the third processing module 52 is specifically used to: sequentially read each second state change instruction from the target instruction sequence in the target synchronization message, and sequentially perform state change logic operations on each read second state change instruction to obtain the second state change data of the game client.

[0082] Optionally, the device further includes a third update module, used to update the display status frame by frame according to a second preset frame rate to obtain the display status of each frame.

[0083] Optionally, the first update module 50 is specifically used to: when receiving a target synchronization message sent by the game server, unpack the target synchronization message to obtain the first state change data sent by the game server; update the first display state of the game client using the first state change data sent by the game server to obtain the first display state.

[0084] Optionally, the first display state is used to indicate a non-motion-related display state, and the second display state is used to indicate a motion-related display state.

[0085] Optionally, the game client's update frame rate is higher than the game server's update frame rate.

[0086] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described data synchronization method. This electronic device can be a server or a terminal device.

[0087] See Figure 6 As shown, the electronic device includes a processor 600 and a memory 601. The memory 601 stores machine-executable instructions that can be executed by the processor 600. The processor 600 executes the machine-executable instructions to implement the above-described data synchronization method.

[0088] Furthermore, Figure 6 The electronic device shown also includes a bus 602 and a communication interface 603. The processor 600, the communication interface 603, and the memory 601 are connected via the bus 602.

[0089] The memory 601 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 603 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 602 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0090] The processor 600 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 600 or by instructions in software form. The processor 600 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 601. The processor 600 reads information from memory 601 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments, for example:

[0091] The method, applied to a game server, includes: obtaining at least one state change operation corresponding to a target frame of a target game client, wherein the state change operation includes at least one first state change operation and at least one second state change operation; performing state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; packaging the first state change data of the target frame and at least one second state change operation into a target synchronization message; and sending the target synchronization message to each target game client.

[0092] In this approach, based on the size of the synchronized data volume and the fault tolerance rate for the settlement of core game rule resources, state change operations are divided into first state change operations with small synchronized data volume and low fault tolerance rate, and second state change operations with large synchronized data volume and high fault tolerance rate. For first state change operations, a state synchronization method is used for data synchronization, while for second state change operations, a frame synchronization method is used for data synchronization. This avoids directly forwarding the second state change data with a large data volume. Instead, the second state change operation is forwarded to each game client to generate the second state change data itself, realizing data synchronization between the game server and each game client. This reduces the occurrence of game lag and also makes it less likely for core game rule resources to be erroneous or tampered with.

[0093] Optionally, the above method further includes: performing state change logic processing on at least one second state change operation to obtain second state change data of the target frame.

[0094] Optionally, obtaining the state change operation corresponding to the target frame of at least one target game client includes: receiving the state change operation uploaded by at least one target game client within one frame duration according to a first preset frame rate, and obtaining the state change operation corresponding to the target frame of all target game clients.

[0095] Optionally, the first state change data of the target frame and at least one second state change operation are packaged into a target synchronization message, including: generating instructions for at least one second state change operation corresponding to the target frame to obtain at least one second state change instruction; storing the at least one second state change instruction into a preset instruction sequence in sequence to obtain a target instruction sequence; and packaging the first state change data and the target instruction sequence into a target synchronization message.

[0096] Optionally, the first state change operation is used to indicate a non-movement-related state change operation, and the second state change operation is used to indicate a movement-related state change operation.

[0097] Optionally, when applied to a game client, the method further includes: when a target synchronization message is received from the game server, updating the display state of the first state change data in the target synchronization message to obtain a first display state; performing state change logic processing on at least one second state change operation in the target synchronization message to obtain second state change data of the game client; and updating the display state of the second state change data of the game client to obtain a second display state.

[0098] In this approach, when the target synchronization message is received in the game client, the first state change data is processed by the game server's state change logic, so the display state can be updated directly. The second state change operation is first processed by the game client's state change logic to obtain the same second state change data as the game server before the display state is updated. This allows the second state change data from the game server to remain synchronized without forwarding data to the game client, thereby reducing the amount of data that needs to be synchronized and thus avoiding game lag.

[0099] Optionally, state change logic processing is performed on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client, including: sequentially reading each second state change instruction from the target instruction sequence in the target synchronization message, and sequentially performing state change logic operation on each read second state change instruction to obtain the second state change data of the game client.

[0100] Optionally, after updating the display state of the second state change data of the game client to obtain the second display state, the method further includes: updating the display state frame by frame according to the second preset frame rate to obtain the display state of each frame.

[0101] Optionally, when a target synchronization message is received from the game server, the display state is updated based on the first state change data in the target synchronization message to obtain the first display state. This includes: when a target synchronization message is received from the game server, unpacking the target synchronization message to obtain the first state change data sent by the game server; and updating the first display state of the game client using the first state change data sent by the game server to obtain the first display state.

[0102] Optionally, the first display state is used to indicate a non-motion-related display state, and the second display state is used to indicate a motion-related display state.

[0103] Optionally, the game client's update frame rate is higher than the game server's update frame rate.

[0104] This embodiment also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned data synchronization method, for example:

[0105] The method, applied to a game server, includes: obtaining at least one state change operation corresponding to a target frame of a target game client, wherein the state change operation includes at least one first state change operation and at least one second state change operation; performing state change logic processing on the at least one first state change operation to obtain first state change data of the target frame; packaging the first state change data of the target frame and at least one second state change operation into a target synchronization message; and sending the target synchronization message to each target game client.

[0106] In this approach, based on the size of the synchronized data volume and the fault tolerance rate for the settlement of core game rule resources, state change operations are divided into first state change operations with small synchronized data volume and low fault tolerance rate, and second state change operations with large synchronized data volume and high fault tolerance rate. For first state change operations, a state synchronization method is used for data synchronization, while for second state change operations, a frame synchronization method is used for data synchronization. This avoids directly forwarding the second state change data with a large data volume. Instead, the second state change operation is forwarded to each game client to generate the second state change data itself, realizing data synchronization between the game server and each game client. This reduces the occurrence of game lag and also makes it less likely for core game rule resources to be erroneous or tampered with.

[0107] Optionally, the above method further includes: performing state change logic processing on at least one second state change operation to obtain second state change data of the target frame.

[0108] Optionally, obtaining the state change operation corresponding to the target frame of at least one target game client includes: receiving the state change operation uploaded by at least one target game client within one frame duration according to a first preset frame rate, and obtaining the state change operation corresponding to the target frame of all target game clients.

[0109] Optionally, the first state change data of the target frame and at least one second state change operation are packaged into a target synchronization message, including: generating instructions for at least one second state change operation corresponding to the target frame to obtain at least one second state change instruction; storing the at least one second state change instruction into a preset instruction sequence in sequence to obtain a target instruction sequence; and packaging the first state change data and the target instruction sequence into a target synchronization message.

[0110] Optionally, the first state change operation is used to indicate a non-movement-related state change operation, and the second state change operation is used to indicate a movement-related state change operation.

[0111] Optionally, when applied to a game client, the method further includes: when a target synchronization message is received from the game server, updating the display state of the first state change data in the target synchronization message to obtain a first display state; performing state change logic processing on at least one second state change operation in the target synchronization message to obtain second state change data of the game client; and updating the display state of the second state change data of the game client to obtain a second display state.

[0112] In this approach, when the target synchronization message is received in the game client, the first state change data is processed by the game server's state change logic, so the display state can be updated directly. The second state change operation is first processed by the game client's state change logic to obtain the same second state change data as the game server before the display state is updated. This allows the second state change data from the game server to remain synchronized without forwarding data to the game client, thereby reducing the amount of data that needs to be synchronized and thus avoiding game lag.

[0113] Optionally, state change logic processing is performed on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client, including: sequentially reading each second state change instruction from the target instruction sequence in the target synchronization message, and sequentially performing state change logic operation on each read second state change instruction to obtain the second state change data of the game client.

[0114] Optionally, after updating the display state of the second state change data of the game client to obtain the second display state, the method further includes: updating the display state frame by frame according to the second preset frame rate to obtain the display state of each frame.

[0115] Optionally, when a target synchronization message is received from the game server, the display state is updated based on the first state change data in the target synchronization message to obtain the first display state. This includes: when a target synchronization message is received from the game server, unpacking the target synchronization message to obtain the first state change data sent by the game server; and updating the first display state of the game client using the first state change data sent by the game server to obtain the first display state.

[0116] Optionally, the first display state is used to indicate a non-motion-related display state, and the second display state is used to indicate a motion-related display state.

[0117] Optionally, the game client's update frame rate is higher than the game server's update frame rate.

[0118] The computer program products of the data synchronization method, apparatus, electronic device and storage medium provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0120] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0121] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0122] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0123] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A data synchronization method, characterized in that, Applied to a game server, the method includes: Obtain at least one state change operation corresponding to a target frame of a target game client, wherein the state change operation includes at least one first state change operation and at least one second state change operation; wherein the amount of synchronization data of the second state change operation is greater than that of the first state change operation. Perform state change logic processing on at least one first state change operation to obtain the first state change data of the target frame; Pack the first state change data of the target frame and the at least one second state change operation into a target synchronization message; Send the target synchronization message to each of the target game clients; The step of packaging the first state change data of the target frame and the at least one second state change operation into a target synchronization message includes: Instructions are generated for at least one second state change operation corresponding to the target frame to obtain at least one second state change instruction; wherein, the second state change instruction is an instruction that can be directly executed in the logic layer and the presentation layer, the logic layer is used for state change logic processing, and the presentation layer is used for displaying state updates; The at least one second state change instruction is sequentially stored into a preset instruction sequence to obtain the target instruction sequence; The first state change data and the target instruction sequence are packaged into a target synchronization message.

2. The method according to claim 1, characterized in that, After obtaining the state change operation corresponding to the target frame of at least one target game client, the method further includes: Perform state change logic processing on at least one second state change operation to obtain the second state change data of the target frame.

3. The method according to claim 1, characterized in that, The operation of obtaining the state change corresponding to the target frame of at least one target game client includes: According to the first preset frame rate, receive the state change operations uploaded by at least one target game client within one frame duration, and obtain the state change operations corresponding to the target frame of all target game clients.

4. The method according to claim 1, characterized in that, The first state change operation is used to indicate a non-movement-related state change operation, and the second state change operation is used to indicate a movement-related state change operation.

5. A data synchronization method, characterized in that, Applied to a game client, the method includes: When a target synchronization message is received from the game server, the first state change data in the target synchronization message is updated to obtain the first display state. At least one second state change operation in the target synchronization message is processed by state change logic to obtain the second state change data of the game client; wherein the amount of synchronization data of the second state change operation is greater than that of the first state change operation. The second state change data of the game client is updated to obtain the second display state; The step of performing state change logic processing on at least one second state change operation in the target synchronization message to obtain second state change data of the game client includes: Each second state change instruction is read sequentially from the target instruction sequence in the target synchronization message, and state change logic operations are performed on each read second state change instruction to obtain the second state change data of the game client; wherein, the second state change instruction is an instruction that can be directly executed in the logic layer and the presentation layer, the logic layer is used for state change logic processing, and the presentation layer is used for displaying state updates.

6. The method according to claim 5, characterized in that, After updating the display state of the second state change data of the game client to obtain the second display state, the method further includes: The display status is updated frame by frame according to the second preset frame rate to obtain the display status of each frame.

7. The method according to claim 5, characterized in that, When a target synchronization message is received from the game server, the first state change data in the target synchronization message is updated to obtain a first display state, including: When a target synchronization message is received from the game server, the target synchronization message is unpacked to obtain the first state change data sent by the game server. The first display state of the game client is updated by the first state change data sent by the game server to obtain the first display state.

8. The method according to claim 5, characterized in that, The first display state is used to indicate a non-motion-related display state, and the second display state is used to indicate a motion-related display state.

9. The method according to claim 5, characterized in that, The game client's frame rate update rate is higher than the game server's frame rate update rate.

10. A data synchronization device, characterized in that, The device, used in a game server, includes: An operation acquisition module is used to acquire at least one state change operation corresponding to a target frame of a target game client. The state change operation includes at least one first state change operation and at least one second state change operation. The synchronization data volume of the second state change operation is greater than that of the first state change operation. The first processing module is used to perform state change logic processing on at least one first state change operation to obtain the first state change data of the target frame. The message packaging module is used to package the first state change data of the target frame and the at least one second state change operation into a target synchronization message; The message distribution module is used to send the target synchronization message to each of the target game clients; The message packaging module is specifically used for: Instructions are generated for at least one second state change operation corresponding to the target frame to obtain at least one second state change instruction; wherein, the second state change instruction is an instruction that can be directly executed in the logic layer and the presentation layer, the logic layer is used for state change logic processing, and the presentation layer is used for displaying state updates; The at least one second state change instruction is sequentially stored into a preset instruction sequence to obtain the target instruction sequence; The first state change data and the target instruction sequence are packaged into a target synchronization message.

11. A data synchronization device, characterized in that, The device, used in a game client, includes: The first update module is used to update the display status of the first state change data in the target synchronization message when a target synchronization message is received from the game server, so as to obtain the first display status. The third processing module is used to perform state change logic processing on at least one second state change operation in the target synchronization message to obtain the second state change data of the game client; wherein, the amount of synchronization data of the second state change operation is greater than that of the first state change operation. The second update module is used to update the display state of the second state change data of the game client to obtain the second display state; The third processing module is specifically used for: Each second state change instruction is read sequentially from the target instruction sequence in the target synchronization message, and state change logic operations are performed on each read second state change instruction to obtain the second state change data of the game client; wherein, the second state change instruction is an instruction that can be directly executed in the logic layer and the presentation layer, the logic layer is used for state change logic processing, and the presentation layer is used for displaying state updates.

12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the data synchronization method according to any one of claims 1-9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the data synchronization method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Method and device for realizing drifting effect in game, equipment and storage medium

    CN109718540A

  • Game data synchronization method, system and device

    CN113181633A

  • Multi-person online task data synchronization method based on state prediction and verification

    CN113572814A