Data synchronization method and device

By receiving data synchronization instructions and determining synchronization policies based on preset policy configuration tables, efficient data synchronization in online games is achieved, and resource waste and calculation overhead problems of data synchronization strategy management in the prior art are solved, and work efficiency is improved.

CN111744198BActive Publication Date: 2025-01-17ZHUHAI SEASUN MOBILE GAME TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010631813.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-03
Publication Date
2025-01-17
Estimated Expiration
2040-07-03

AI Technical Summary

Technical Problem

The management of data synchronization strategies in existing online games has huge human resources waste and computational overhead, and when the data synchronization strategy changes, it requires rewriting code, which is time-consuming and labor-intensive.

Method used

By receiving data synchronization instructions, determine the data to be synchronized and obtain its information, determine the synchronization policy based on the preset synchronization policy configuration table, package and synchronize the data to be synchronized to the server, and use time synchronization policy, space synchronization policy or time and space synchronization Policy, configure synchronization interface for efficient data synchronization.

Benefits of technology

There is no need to write synchronization code for each data to be synchronized, which saves a lot of manual work and calculation overhead, improves work efficiency, and only configures tags or modifys policies to set and change data when the synchronization policy changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111744198B_ABST
    Figure CN111744198B_ABST
Patent Text Reader

Abstract

The present application provides a data synchronization method and device, wherein the data synchronization method comprises: receiving a data synchronization instruction; determining at least one data to be synchronized in response to the data synchronization instruction, and obtaining the data information to be synchronized corresponding to each data to be synchronized; determining the synchronization strategy of each data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized; synchronizing each data information to be synchronized to a server according to the corresponding synchronization strategy. The data synchronization method provided by the present application does not need to write synchronization code for each data to be synchronized, which saves a lot of manual workload and computing overhead, and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a data synchronization method and apparatus, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology, online games have also made great progress. Many of the existing online games are played by multiple players through a client connecting to a server. When each player enters the game, a game scene screen will be opened. When multiple players play games through terminals separately, it seems that they are playing in the same game world and sharing a virtual world, but in fact, each player's terminal is only an approximate simulation of the game world.

[0003] In order to make the game world of each player in the game achieve as close to the same effect as possible, it is necessary to confirm which data on the player's terminal needs to be synchronized. Only by synchronizing these data can the virtual world be shared. For example, the various attributes of the virtual character controlled by the player, the coordinates in the map, the attributes of the enemy teammates, the prop information, and other data that affect the performance of the game need to be synchronized. However, whether some data is synchronized does not have much impact on the shared virtual world, such as the bubble particle effect on the seabed, the effect of props when used, background music, etc. For the data that needs to be synchronized, it is necessary to set the relevant synchronization strategy code for each data to be synchronized in advance, and then execute the synchronization code in sequence. What follows is a huge waste of human resources and computing overhead. When the synchronization strategy of a certain data changes, the code needs to be rewritten, which is time-consuming, labor-intensive, and a waste of resources.

[0004] Therefore, how to solve the above problems has become a problem that needs to be solved urgently by technical personnel. Summary of the invention

[0005] In view of this, embodiments of the present application provide a data synchronization method and apparatus, a computing device, and a computer-readable storage medium to address the technical deficiencies in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a data synchronization method is provided, including:

[0007] Receive data synchronization instructions;

[0008] In response to the data synchronization instruction, determining at least one data to be synchronized, and acquiring data information to be synchronized corresponding to each data to be synchronized;

[0009] Determine the synchronization strategy of each of the data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each of the data to be synchronized;

[0010] Each of the data information to be synchronized is synchronized to the server according to the corresponding synchronization strategy.

[0011] Optionally, synchronizing each of the data information to be synchronized to the server according to a corresponding synchronization strategy includes:

[0012] Packing the data information to be synchronized according to the synchronization strategy to generate a set of data information to be synchronized, wherein the set of data information to be synchronized corresponds to the synchronization strategy one by one;

[0013] The data information set to be synchronized is synchronized to the server according to the corresponding synchronization strategy.

[0014] Optionally, before receiving the data synchronization instruction, the method further includes:

[0015] A synchronization tag is pre-configured for each of the data to be synchronized.

[0016] Optionally, determining at least one data to be synchronized in response to the data synchronization instruction includes:

[0017] In response to the data synchronization instruction, at least one data to be synchronized is determined according to a preconfigured synchronization tag.

[0018] Optionally, before determining the synchronization strategy of each of the to-be-synchronized data according to the preset synchronization strategy configuration table, the method further includes:

[0019] A corresponding synchronization strategy is configured for each of the data to be synchronized, and the synchronization strategy corresponding to each of the data to be synchronized is saved in a synchronization strategy configuration table.

[0020] Optionally, the synchronization strategy includes a time synchronization strategy, a space synchronization strategy and a time-space synchronization strategy;

[0021] Determining the synchronization strategy of each of the to-be-synchronized data according to a preset synchronization strategy configuration table includes:

[0022] The synchronization strategy of each of the to-be-synchronized data is determined according to a preset synchronization strategy configuration table to be one of a time synchronization strategy, a space synchronization strategy or a time-space synchronization strategy.

[0023] Optionally, packaging the data information to be synchronized to generate a set of data information to be synchronized according to the synchronization strategy includes:

[0024] Packing the data information to be synchronized whose synchronization strategy is the time synchronization strategy to generate a first data information set to be synchronized;

[0025] Packing the data information to be synchronized whose synchronization strategy is the space synchronization strategy to generate a second data information set to be synchronized;

[0026] The data information to be synchronized whose synchronization strategy is the time-space synchronization strategy is packaged to generate a third set of data information to be synchronized.

[0027] Optionally, the method further includes:

[0028] Configure a first synchronization interface for the time synchronization policy;

[0029] Configure a second synchronization interface for the spatial synchronization strategy;

[0030] Configure the third synchronization interface for the time-space synchronization policy.

[0031] Optionally, synchronizing the to-be-synchronized data information set to the server according to a corresponding synchronization strategy includes:

[0032] Calling the first synchronization interface to synchronize the first set of data information to be synchronized to the server;

[0033] Calling the second synchronization interface to synchronize the second set of data information to be synchronized to the server;

[0034] The third synchronization interface is called to synchronize the third set of data information to be synchronized to the server.

[0035] According to a second aspect of an embodiment of the present application, a data synchronization device is provided, including:

[0036] A receiving module, configured to receive a data synchronization instruction;

[0037] a response module, configured to determine at least one data to be synchronized in response to the data synchronization instruction, and obtain data information to be synchronized corresponding to each data to be synchronized;

[0038] A determination module is configured to determine a synchronization strategy for each of the data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each of the data to be synchronized;

[0039] The synchronization module is configured to synchronize each of the data information to be synchronized to the server according to the corresponding synchronization strategy.

[0040] According to a third aspect of an embodiment of the present application, a computing device is provided, comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the data synchronization method when executing the instructions.

[0041] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the data synchronization method are implemented.

[0042] The data synchronization method provided in the embodiment of the present application receives a data synchronization instruction; determines at least one data to be synchronized in response to the data synchronization instruction, and obtains the data information to be synchronized corresponding to each data to be synchronized; determines the synchronization strategy of each data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized; and synchronizes each data information to be synchronized to the server according to the corresponding synchronization strategy. The present application realizes synchronization of data information according to demand by identifying the corresponding synchronization strategy for the data to be synchronized, and synchronizing the data information to be synchronized according to the synchronization strategy, without having to write synchronization code for each data to be synchronized, saving a lot of manual workload and computing overhead, and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a structural block diagram of a computing device provided in an embodiment of the present application;

[0044] Figure 2 is a flow chart of a data synchronization method provided in an embodiment of the present application;

[0045] Figure 3 is a flow chart of a data synchronization method provided by another embodiment of the present application;

[0046] Figure 4 It is a structural diagram of a data synchronization device provided in an embodiment of the present application. DETAILED DESCRIPTION

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

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

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

[0050] First, the terms involved in one or more embodiments of the present invention are explained.

[0051] Time synchronization strategy: A strategy for synchronizing data based on the time dimension, such as synchronizing data every 15 milliseconds.

[0052] Spatial synchronization strategy: a strategy for synchronizing data according to spatial dimensions, such as synchronizing data according to a circle, a nine-square grid, or other spatial dimensions.

[0053] Time and space synchronization strategy: A strategy that synchronizes data in both the time dimension and the space dimension. For example, data within a 15-meter radius centered on the game character will be synchronized every 15 milliseconds.

[0054] In the present application, a data synchronization method and apparatus, a computing device, and a computer-readable storage medium are provided, which are described in detail one by one in the following embodiments.

[0055] Figure 1 The structure block diagram of a computing device 100 according to an embodiment of the present application is shown. The components of the computing device 100 include but are not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.

[0056] The computing device 100 also includes an access device 140 that enables the computing device 100 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 140 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

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

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

[0059] The processor 120 may execute Figure 2 Steps in the data synchronization method shown. Figure 2 A flow chart of a data synchronization method according to an embodiment of the present application is shown, including steps 202 to 208.

[0060] Step 202: Receive a data synchronization instruction.

[0061] The data synchronization instruction is an instruction for triggering data synchronization. The instruction can be set to be automatically triggered at a predetermined time interval, such as automatically triggering a data synchronization instruction every 20 milliseconds during the game. When the data synchronization instruction is received, the data synchronization operation is performed. The data synchronization instruction can also be automatically triggered according to the login status of the player logging into the game, such as when the player logs into the game, the data synchronization instruction is received.

[0062] Step 204: Determine at least one data to be synchronized in response to the data synchronization instruction, and obtain the data information to be synchronized corresponding to each data to be synchronized.

[0063] After receiving the data synchronization instruction, on the player's game terminal, the data to be synchronized is the data to be synchronized. In response to the data synchronization instruction, the data to be synchronized is determined, and the data information to be synchronized corresponding to each data to be synchronized is obtained. The data information to be synchronized is the information corresponding to the data to be synchronized. For example, the data to be synchronized is the game character level, the game character health, the game character coordinates and other information. The data information to be synchronized corresponding to the game character level is "game character level: level 60", the data information to be synchronized corresponding to the game character health is "game character health: 9854", and the data information to be synchronized corresponding to the game character coordinates is "game character coordinates: (X: 185, Y: 163)", and so on.

[0064] Optionally, a synchronization tag is pre-configured for each of the data to be synchronized.

[0065] In actual applications, the data in the game is divided into two categories, one does not need to be synchronized, and the other needs to be synchronized. The data that needs to be synchronized is called data to be synchronized. A synchronization tag is pre-configured for each data to be synchronized to identify that the data information corresponding to the data needs to be synchronized.

[0066] Optionally, determining at least one data to be synchronized in response to the data synchronization instruction includes: determining at least one data to be synchronized according to a preconfigured synchronization tag in response to the data synchronization instruction.

[0067] After receiving the data synchronization instruction, the to-be-synchronized data configured with the synchronization tag is determined, and the to-be-synchronized data information corresponding to each to-be-synchronized data is acquired.

[0068] In a specific implementation provided in the present application, the data to be synchronized are the game character level and the game character health, and the data information to be synchronized is "game character level: level 60" and "game character health: 9854".

[0069] Step 206: Determine the synchronization strategy for each of the data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each of the data to be synchronized.

[0070] In actual application, a corresponding synchronization strategy is configured in advance for each data to be synchronized, and the synchronization strategy corresponding to each data to be synchronized is saved in a synchronization strategy configuration table. When the data to be synchronized is determined, the synchronization strategy corresponding to each data to be synchronized can be determined according to the synchronization strategy configuration table.

[0071] Optionally, the synchronization strategy includes a time synchronization strategy, a space synchronization strategy, and a time-space synchronization strategy; determining the synchronization strategy of each of the data to be synchronized according to a preset synchronization strategy configuration table, including: determining the synchronization strategy of each of the data to be synchronized as one of the time synchronization strategy, the space synchronization strategy, or the time-space synchronization strategy according to the preset synchronization strategy configuration table.

[0072] The synchronization strategies include time synchronization strategy, space synchronization strategy and time-space synchronization strategy. The time synchronization strategy is based on time synchronization, and data synchronization is performed at fixed time intervals each time, such as synchronization every 15 milliseconds or every 1 second.

[0073] The spatial synchronization strategy is to synchronize based on spatial position, such as synchronizing the prop information within a radius of 15 meters with the game character as the center.

[0074] The time-space synchronization strategy is to synchronize based on time and space position. For example, with the game character as the center of the circle, the attribute information of the enemies and teammates within a radius of 20 meters are synchronized at a frequency of once every 15 milliseconds.

[0075] Each data to be synchronized corresponds to a synchronization strategy, that is, the synchronization strategy corresponding to each data to be synchronized is one of a time synchronization strategy, a space synchronization strategy or a time-space synchronization strategy.

[0076] Step 208: Synchronize each of the data information to be synchronized to the server according to the corresponding synchronization strategy.

[0077] Optionally, each of the data information to be synchronized is synchronized to the server according to the corresponding synchronization strategy, including: packaging the data information to be synchronized according to the synchronization strategy to generate a set of data information to be synchronized, wherein the set of data information to be synchronized corresponds one-to-one to the synchronization strategy; and synchronizing the set of data information to be synchronized to the server according to the corresponding synchronization strategy.

[0078] In actual applications, in order to improve synchronization efficiency, the data information to be synchronized with the same synchronization strategy can be packaged to generate a set of information to be synchronized. The set of information to be synchronized corresponds to the synchronization strategy one by one. When performing data synchronization, the set of data information to be synchronized with the same synchronization strategy will be synchronized, which reduces the number of data synchronization times, improves data synchronization efficiency, and reduces game delays.

[0079] Optionally, the data information to be synchronized is packaged according to the synchronization strategy to generate a set of data information to be synchronized, including: packaging the data information to be synchronized whose synchronization strategy is a time synchronization strategy to generate a first set of data information to be synchronized; packaging the data information to be synchronized whose synchronization strategy is a space synchronization strategy to generate a second set of data information to be synchronized; packaging the data information to be synchronized whose synchronization strategy is a time and space synchronization strategy to generate a third set of data information to be synchronized.

[0080] The data information to be synchronized with the same time synchronization strategy is packaged to generate a first set of data information to be synchronized, such as the health of the game character controlled by the player, the game character experience value, the game character level information, the game character position information, etc., to generate the first set of data information to be synchronized.

[0081] The data information to be synchronized that is the same as the spatial synchronization strategy is packaged to generate a second set of data information to be synchronized, such as: prop information, character orientation information, character defense information, character attack information, etc. within a radius of 15 meters centered on the player are packaged to generate a second set of data information to be synchronized.

[0082] The data information to be synchronized with the same time-space synchronization strategy is packaged to generate a third set of data information to be synchronized, such as: the health of enemies within a radius of 20 meters centered on the player, the enemy's position information, the health of teammates, the teammate's position information, etc. are packaged to generate a third set of data information to be synchronized.

[0083] Optionally, a corresponding synchronization interface is pre-configured for each synchronization strategy, specifically, a first synchronization interface is configured for the time synchronization strategy, a second synchronization interface is configured for the space synchronization strategy, and a third synchronization interface is configured for the time and space strategy.

[0084] Configuring a corresponding synchronization interface for each synchronization strategy is conducive to directly calling the corresponding synchronization interface to synchronize the data information to be synchronized after the synchronization strategy is determined, without having to write corresponding synchronization code for each data information to be synchronized.

[0085] Optionally, the data information set to be synchronized is synchronized to the server according to the corresponding synchronization strategy, including: calling the first synchronization interface to synchronize the first data information set to be synchronized to the server; calling the second synchronization interface to synchronize the second data information set to be synchronized to the server; calling the third synchronization interface to synchronize the third data information set to be synchronized to the server.

[0086] Calling each synchronization interface to synchronize the corresponding set of data information to be synchronized to the server, and synchronizing multiple data information to be synchronized to the server at one time can efficiently realize the synchronization operation of the data information to be synchronized, improve the synchronization efficiency of the data information to be synchronized, and effectively reduce game delays.

[0087] The data synchronization method provided in the embodiment of the present application receives a data synchronization instruction; determines at least one data to be synchronized in response to the data synchronization instruction, and obtains the data information to be synchronized corresponding to each data to be synchronized; determines the synchronization strategy of each data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized; and synchronizes each data information to be synchronized to the server according to the corresponding synchronization strategy. There is no need to write synchronization code for each data to be synchronized. When there is new data to be synchronized that needs to be synchronized, or the existing synchronization strategy needs to be changed, it is only necessary to configure the synchronization tag for the data to be synchronized or modify the synchronization strategy corresponding to the data to be synchronized, so as to realize the setting and change of the data to be synchronized, while saving a lot of manual workload and computing overhead, and improving work efficiency.

[0088] Figure 3 A data synchronization method according to an embodiment of the present application is shown. The data synchronization method is described by taking a game character A, an enemy B, and a teammate C controlled by a certain player as an example, and includes steps 302 to 310.

[0089] Step 302: Receive a data synchronization instruction.

[0090] In the embodiment provided in the present application, when a player logs into a game and starts the game, it is deemed to receive a data synchronization instruction.

[0091] Step 304: Determine at least one data to be synchronized in response to the data synchronization instruction, and obtain the data information to be synchronized corresponding to each data to be synchronized.

[0092] In the embodiment provided in the present application, in response to the data synchronization instruction, the data to be synchronized are determined as: A's blood volume, A's level, A's defense value, A's force value, A's direction information, A's coordinates, B's blood volume, B's level, B's defense value, B's force value, C's blood volume, C's level, C's defense value, and C's force value.

[0093] Determine the data information to be synchronized corresponding to each data to be synchronized: A's health -1600, A's level -60, A's defense value -1600, A's force value -8000, A's direction information -East, A's coordinates -(X:185, Y:141), B's health -3500, B's level -60, B's defense value -6000, B's force value -1800, C's health -1800, C's level -56, C's defense value -1400, C's force value -6000.

[0094] Step 306: Determine the synchronization strategy for each of the data to be synchronized according to the preset synchronization strategy configuration table.

[0095] See Table 1, which shows part of the content of the preset synchronization strategy configuration table.

[0096] Table 1

[0097] Data to be synchronized Synchronization strategy Character health Time synchronization strategy Character Level Time synchronization strategy Character Defense Value Space synchronization strategy Character Strength Space synchronization strategy Character orientation information Space synchronization strategy Character coordinates Space synchronization strategy Enemy health Time and space synchronization strategy Enemy Level Time synchronization strategy Enemy Defense Value Time and space synchronization strategy Enemy Strength Time and space synchronization strategy Teammate health Time and space synchronization strategy Teammate Level Time synchronization strategy Teammate Defense Value Time and space synchronization strategy Teammate Strength Time and space synchronization strategy

[0098] As shown in the above table, determine the synchronization strategy corresponding to each data to be synchronized.

[0099] The time synchronization strategy is: synchronize once every 15 milliseconds.

[0100] The spatial synchronization strategy is to synchronize data within a 20-meter radius centered on the game character.

[0101] The time and space strategy is to synchronize data within a 20-meter radius centered on the game character at intervals of 15 milliseconds.

[0102] Step 308: Pack the data information to be synchronized according to the synchronization strategy to generate a data information set to be synchronized.

[0103] In the embodiment provided in the present application, the data information to be synchronized when the synchronization strategy is the time synchronization strategy is: A's health -1600, A's level -60, B's level -60, C's level -56. The above data information to be synchronized is packaged to generate a first set of data information to be synchronized.

[0104] The data information to be synchronized when the synchronization strategy is the space synchronization strategy is: A's defense value -1600, A's force value -8000, A's direction information -east, A's coordinates -(X:185, Y:141). The above data information to be synchronized is packaged to generate a second set of data information to be synchronized.

[0105] The data information to be synchronized when the synchronization strategy is the time-space synchronization strategy is: B's health -3500, B's defense value -6000, B's force value -1800, C's health -1800, C's defense value -1400, C's force value -6000. The above data information to be synchronized is packaged to generate the third set of data information to be synchronized.

[0106] Step 310: calling the synchronization interface corresponding to each synchronization strategy to synchronize the to-be-synchronized data information set corresponding to each synchronization strategy to the server.

[0107] In the embodiment provided in the present application, a first synchronization interface is pre-configured for the time synchronization strategy, a second synchronization interface is pre-configured for the space synchronization strategy, and a third synchronization interface is pre-configured for the time-space synchronization strategy.

[0108] The first synchronization interface corresponding to the time synchronization strategy is called to synchronize the first set of data information to be synchronized [A's health - 1600, A's level - 60, B's level - 60, C's level - 56] to the server.

[0109] Call the second synchronization interface corresponding to the space synchronization strategy to synchronize the second data information set to be synchronized [A's defense value -1600, A's force value -8000, A's direction information -east, A's coordinates -(X:185, Y:141)] to the server.

[0110] Call the third synchronization interface corresponding to the time and space synchronization strategy to synchronize the third data information set to be synchronized [B's health -3500, B's defense value -6000, B's force value -1800, C's health -1800, C's defense value -1400, C's force value -6000] to the server.

[0111] The data synchronization method provided in the embodiment of the present application receives a data synchronization instruction; determines at least one data to be synchronized in response to the data synchronization instruction, and obtains the data information to be synchronized corresponding to each data to be synchronized; determines the synchronization strategy of each data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized; and synchronizes each data information to be synchronized to the server according to the corresponding synchronization strategy. There is no need to write synchronization code for each data to be synchronized. When there is new data to be synchronized that needs to be synchronized, or the existing synchronization strategy needs to be changed, it is only necessary to configure the synchronization tag for the data to be synchronized or modify the synchronization strategy corresponding to the data to be synchronized, so as to realize the setting and change of the data to be synchronized, while saving a lot of manual workload and computing overhead, and improving work efficiency.

[0112] Corresponding to the above method embodiment, the present application also provides a data synchronization device embodiment, Figure 4 FIG. 1 is a schematic diagram showing the structure of a data synchronization device according to an embodiment of the present application. Figure 4 As shown, the device comprises:

[0113] The receiving module 402 is configured to receive a data synchronization instruction;

[0114] The response module 404 is configured to determine at least one data to be synchronized in response to the data synchronization instruction, and obtain the data information to be synchronized corresponding to each data to be synchronized;

[0115] The determination module 406 is configured to determine the synchronization strategy of each of the data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each of the data to be synchronized;

[0116] The synchronization module 408 is configured to synchronize each of the data information to be synchronized to the server according to the corresponding synchronization strategy.

[0117] Optionally, the synchronization module 408 is further configured to package the data information to be synchronized to generate a data information set to be synchronized according to the synchronization strategy, wherein the data information set to be synchronized corresponds to the synchronization strategy one by one; and synchronize the data information set to be synchronized to the server according to the corresponding synchronization strategy.

[0118] Optionally, the device further comprises:

[0119] The tag module is configured to pre-configure a synchronization tag for each of the data to be synchronized.

[0120] Optionally, the response module 404 is further configured to determine at least one data to be synchronized according to a pre-configured synchronization tag in response to the data synchronization instruction.

[0121] Optionally, the device further comprises:

[0122] The configuration module is configured to configure a corresponding synchronization strategy for each of the data to be synchronized, and save the synchronization strategy corresponding to each of the data to be synchronized into a synchronization strategy configuration table.

[0123] Optionally, the synchronization strategy includes a time synchronization strategy, a space synchronization strategy and a time-space synchronization strategy;

[0124] The determination module 406 is further configured to determine, according to a preset synchronization strategy configuration table, that the synchronization strategy of each of the to-be-synchronized data is one of a time synchronization strategy, a space synchronization strategy or a time-space synchronization strategy.

[0125] Optionally, the synchronization module 408 is further configured to package the data information to be synchronized whose synchronization strategy is a time synchronization strategy to generate a first set of data information to be synchronized; package the data information to be synchronized whose synchronization strategy is a space synchronization strategy to generate a second set of data information to be synchronized; and package the data information to be synchronized whose synchronization strategy is a time and space synchronization strategy to generate a third set of data information to be synchronized.

[0126] Optionally, the device further comprises:

[0127] The interface module is configured to configure a first synchronization interface for a time synchronization strategy; configure a second synchronization interface for a space synchronization strategy; and configure a third synchronization interface for a time and space synchronization strategy.

[0128] Optionally, the synchronization module 408 is further configured to call the first synchronization interface to synchronize the first set of data information to be synchronized to the server; call the second synchronization interface to synchronize the second set of data information to be synchronized to the server; and call the third synchronization interface to synchronize the third set of data information to be synchronized to the server.

[0129] The data synchronization device provided in the embodiment of the present application receives a data synchronization instruction; determines at least one data to be synchronized in response to the data synchronization instruction, and obtains the data information to be synchronized corresponding to each data to be synchronized; determines the synchronization strategy of each data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized; and synchronizes each data information to be synchronized to the server according to the corresponding synchronization strategy. There is no need to write synchronization code for each data to be synchronized. When there is new data to be synchronized that needs to be synchronized, or the existing synchronization strategy needs to be changed, it is only necessary to configure the synchronization tag for the data to be synchronized or modify the synchronization strategy corresponding to the data to be synchronized, so as to realize the setting and change of the data to be synchronized, while saving a lot of manual workload and computing overhead, and improving work efficiency.

[0130] In one embodiment of the present application, a computing device is also provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the data synchronization method when executing the instructions.

[0131] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the data synchronization method as described above.

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

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

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

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

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

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

Claims

1. A data synchronization method, characterized in that: include: Receiving a data synchronization instruction, wherein the data synchronization instruction is an instruction for triggering data synchronization; In response to the data synchronization instruction, at least one data to be synchronized is determined, and the data information to be synchronized corresponding to each data to be synchronized is obtained; the synchronization strategy of each data to be synchronized is determined according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each data to be synchronized, and the synchronization strategy is any one of a time synchronization strategy, a space synchronization strategy, or a time-space synchronization strategy; Configure a corresponding synchronization interface for each synchronization strategy, and call each synchronization interface to synchronize the corresponding data information to be synchronized to the server.

2. The data synchronization method according to claim 1, characterized in that: Call each synchronization interface to synchronize the corresponding data information to be synchronized to the server, including: Packing the data information to be synchronized according to the synchronization strategy to generate a set of data information to be synchronized, wherein the set of data information to be synchronized corresponds to the synchronization strategy one by one; Each synchronization interface is called to synchronize the corresponding data information set to be synchronized to the server.

3. The data synchronization method according to claim 1, characterized in that: Before receiving the data synchronization instruction, it also includes: A synchronization tag is pre-configured for each of the data to be synchronized.

4. The data synchronization method according to claim 3, characterized in that: Determining at least one data to be synchronized in response to the data synchronization instruction includes: In response to the data synchronization instruction, at least one data to be synchronized is determined according to a preconfigured synchronization tag.

5. The data synchronization method according to claim 1, characterized in that: Before determining the synchronization strategy of each of the to-be-synchronized data according to the preset synchronization strategy configuration table, the method further includes: A corresponding synchronization strategy is configured for each of the data to be synchronized, and the synchronization strategy corresponding to each of the data to be synchronized is saved in a synchronization strategy configuration table.

6. The data synchronization method according to claim 1, characterized in that: Packing the data information to be synchronized according to the synchronization strategy to generate a set of data information to be synchronized includes: Packing the data information to be synchronized whose synchronization strategy is the time synchronization strategy to generate a first data information set to be synchronized; Packing the data information to be synchronized whose synchronization strategy is the space synchronization strategy to generate a second data information set to be synchronized; The data information to be synchronized whose synchronization strategy is the time-space synchronization strategy is packaged to generate a third set of data information to be synchronized.

7. The data synchronization method according to claim 6, characterized in that: Configure the corresponding synchronization interface for each synchronization policy, including: Configure a first synchronization interface for the time synchronization policy; Configure a second synchronization interface for the spatial synchronization strategy; Configure the third synchronization interface for the time-space synchronization policy.

8. The data synchronization method according to claim 7, characterized in that: Call each synchronization interface to synchronize the corresponding set of data information to be synchronized to the server, including: Calling the first synchronization interface to synchronize the first set of data information to be synchronized to the server; Calling the second synchronization interface to synchronize the second set of data information to be synchronized to the server; The third synchronization interface is called to synchronize the third set of data information to be synchronized to the server.

9. A data synchronization device, characterized in that: include: A receiving module, configured to receive a data synchronization instruction, wherein the data synchronization instruction is an instruction for triggering data synchronization; a response module, configured to determine at least one data to be synchronized in response to the data synchronization instruction, and obtain data information to be synchronized corresponding to each data to be synchronized; A determination module is configured to determine a synchronization strategy for each of the data to be synchronized according to a preset synchronization strategy configuration table, wherein the synchronization strategy configuration table records the synchronization strategy corresponding to each of the data to be synchronized, and the synchronization strategy is any one of a time synchronization strategy, a space synchronization strategy, or a time-space synchronization strategy; The synchronization module is configured to configure a corresponding synchronization interface for each synchronization strategy, and call each synchronization interface to synchronize the corresponding data information to be synchronized to the server.

10. A computing device comprising a memory, a processor, and computer instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the instructions, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Attribute information synchronization method and device, storage medium and processor

    CN110515605A