CN115334089A - Data synchronization method, computing device and medium - Google Patents

Data synchronization method, computing device and medium Download PDF

Info

Publication number
CN115334089A
CN115334089A CN202210976620.3A CN202210976620A CN115334089A CN 115334089 A CN115334089 A CN 115334089A CN 202210976620 A CN202210976620 A CN 202210976620A CN 115334089 A CN115334089 A CN 115334089A
Authority
CN
China
Prior art keywords
data
synchronization
identification information
field
entity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210976620.3A
Other languages
Chinese (zh)
Inventor
曹必焕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Palm Fun Technology Co ltd
Original Assignee
Beijing Palm Fun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Palm Fun Technology Co ltd filed Critical Beijing Palm Fun Technology Co ltd
Priority to CN202210976620.3A priority Critical patent/CN115334089A/en
Publication of CN115334089A publication Critical patent/CN115334089A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The embodiment of the application discloses a data synchronization method, computing equipment and a medium, which are used for reducing the workload required by realizing data synchronization between a game server and a client. The method of the embodiment of the application comprises the following steps: the method comprises the steps that first equipment obtains change data of a first data entity and first identification information used for indicating a field to which the change data belong; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software; the first device sends a synchronization packet containing the change data and the first identification information to the second device, so that the second device synchronizes the second data entity according to the synchronization packet.

Description

Data synchronization method, computing device and medium
Technical Field
The present application relates to the field of game data processing technologies, and in particular, to a data synchronization method, a computing device, and a medium.
Background
The network game generally refers to an electronic game in which multiple users perform interactive entertainment through the internet, which is also called an online game, and includes a multiplayer online game, such as a massively multiplayer online role-playing game (MMORPG) and a multiplayer online tactical sports game (MOBA). When a user is playing a network game, data interaction among users of the network game needs to be guaranteed, and therefore, it is very important to achieve game data synchronization among user terminals of the users.
Currently, the mainstream data synchronization method in the industry is that when a service code of a game application changes data, one end of a server or a client converts the changed data into a difference message and sends the difference message to the other end of the server or the client, and the other end writes the changed data into local data after receiving the difference message.
However, since different modules of the client require different data, a programmer needs to write corresponding data structures for different modules and servers and difference messages required for data synchronization between the data structures, so that the changed data can be converted into difference messages that can be understood by the opposite end during data synchronization. Under the method, when the business logic changes, the difference message needs to be modified, rewritten or newly added, and the workload required for realizing data synchronization is large.
Disclosure of Invention
In view of this, the present application provides a data synchronization method, a computing device and a medium, which can reduce the workload required for implementing data synchronization.
A first aspect of the present application provides a data synchronization method, including:
the method comprises the steps that first equipment acquires change data of a first data entity and first identification information used for indicating a field to which the change data belong; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software;
the first device sends a synchronization data packet containing the change data and the first identification information to a second device, so that the second device synchronizes a second data entity in the second device according to the synchronization data packet; and the first data entity and the second data entity are generated by the same data definition file.
Optionally, the first device is a server device, and the second device is a client device; before the first device sends a synchronization packet containing the change data and the first identification information to the second device, the method further includes: and the first equipment determines the second equipment from the plurality of client equipment according to the version number corresponding to the field.
Optionally, the first device is a server device, and the second device is a client device; the first device stores the subscription relationship between the second device and the field; the first device sends a synchronization packet containing the change data and the first identification information to a second device, and the synchronization packet includes: and the first equipment sends the synchronous data packet to the second equipment according to the subscription relation.
Optionally, before the first device sends the synchronization packet containing the change data and the first identification information to the second device, the method further includes: the first device receives a subscription request of the second device, wherein the subscription request carries version number information and second identification information, and the second identification information is used for indicating the field to be subscribed by the second device; and the first equipment stores the subscription relationship according to the version number information and the second identification information.
Optionally, the change data is a value of a change field of the first data entity, and the first identification information is path information.
Optionally, before the first device sends the synchronization packet containing the change data and the first identification information to the second device, the method further includes: adding the synchronous data packet into a synchronous queue; and triggering the first equipment to send the synchronous data packet to the second equipment when the timing synchronization event occurs.
Optionally, the sending, by the first device, a synchronization packet including the change data and the first identification information to the second device includes: and when the synchronous queue comprises a plurality of synchronous data packets of the same field, the first equipment sends the latest synchronous data packet added into the synchronous queue to the second equipment.
A second aspect of the present application provides a computing device comprising:
an acquisition unit configured to acquire change data of a first data entity and first identification information indicating a field to which the change data belongs; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software;
a synchronization unit, configured to send a synchronization packet including the change data and the first identification information to a second device, so that the second device synchronizes a second data entity in the second device according to the synchronization packet; and the first data entity and the second data entity are generated by the same data definition file.
Optionally, the first device is a server device, and the second device is a client device; the computing device further comprises: a determining unit, configured to determine the second device from the multiple pieces of client devices according to the version number corresponding to the field.
Optionally, the first device is a server device, and the second device is a client device; the first device stores the subscription relationship between the second device and the field; the synchronization unit is specifically configured to send the synchronization packet to the second device according to a subscription relationship.
Optionally, the computing device further includes: a receiving unit, configured to receive a subscription request of the second device, where the subscription request carries version number information and second identification information, and the second identification information is used to indicate the field to be subscribed by the second device; and the subscription management unit is used for storing the subscription relationship according to the version number information and the second identification information.
Optionally, the change data is a value of a change field of the first data entity, and the first identification information is path information.
Optionally, the synchronization unit is further configured to add the synchronization packet to a synchronization queue; the computing device further comprises a triggering unit for triggering the synchronization unit to send the synchronization data packet to the second device when a timing synchronization event occurs.
Optionally, the synchronization unit is specifically configured to: and when the synchronous queue contains a plurality of synchronous data packets of the same field, the first equipment sends the latest synchronous data packet added into the synchronous queue to the second equipment.
A third aspect of the present application provides a computing device comprising:
a processor, a memory;
the memory has stored therein instruction operations or code;
the processor is configured to communicate with the memory and execute the instruction operations or code in the memory to perform the data synchronization method provided by any one of the first aspects.
A fourth aspect of the present application provides a computer-readable storage medium, which is characterized by comprising instructions that, when executed on a computer, cause the computer to perform the data synchronization method provided in any one of the first aspects.
In the application, a first device acquires change data of a first data entity and first identification information used for indicating a field to which the change data belongs; and finally, sending a synchronous data packet containing the change data and the first identification information to the second equipment so that the second equipment synchronizes the second data entity according to the synchronous data packet. According to the method and the device, the data entity in the first device and the data entity in the second device are unified, data synchronization is carried out through direct incremental data instead of converted difference messages, the data structure and the difference messages required by synchronization among different data structures do not need to be written, and the workload required by data synchronization is greatly reduced.
Drawings
FIG. 1 is a diagram illustrating a data synchronization network architecture according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a data synchronization method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating an implementation of a data synchronization method according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a computing device in an embodiment of the present application;
fig. 5 is a schematic structural diagram of another computing device in the embodiment of the present application.
Detailed Description
Embodiments of the present application will be described with reference to the accompanying drawings, and it is to be understood that the described embodiments are only some embodiments of the present application, and not all embodiments of the present application. As can be known to those skilled in the art, with the development of technology and the emergence of new scenes, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
The terms "first," "second," and the like in the description and claims of this application and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The application provides a data synchronization method, a computing device and a medium, which can reduce the workload required by realizing data synchronization.
Referring to fig. 1, a data synchronization network architecture in an embodiment of the present application includes: a server device 101 and client devices 102a-102c.
The embodiment of the application is mainly applied to a data synchronization scenario in a game process, for example, when game characters corresponding to clients of the client devices 102a to 102c are in the same scenario, after data change is caused by operation of the game character of the client device 102a, the client device 102a synchronizes the changed data to the server 101, and the server 101 synchronizes the changed data to the client devices 102b and 102c.
The server device 101 may be a terminal, a server, or other computing devices with data processing capability.
The client devices 102a-102c may be mobile phones, tablet computers, notebook computers, personal computers (personal computers), or other computing devices with data processing capabilities. It is understood that the client devices 102a-102c may be collectively referred to as client devices 102, and in practical applications of embodiments of the present application, the number of client devices 102 may be more or less than that shown in fig. 1, and is not limited thereto.
Referring to fig. 2, based on the data synchronization network architecture shown in fig. 1, an embodiment of a data synchronization method in the embodiment of the present application includes:
201. the first device acquires change data of a first data entity and first identification information indicating a field to which the change data belongs.
The first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software. That is, the first data entity is the data entity corresponding to the data module in the game software process.
The first device and the second device in this embodiment correspond to a server device and a client device in a data synchronization network architecture shown in fig. 1; the first device may be a server device or a client device, and the second device may be another device of the server device and the client device other than the first device. For brevity and smoothness of description, the first device is taken as a server device, and the second device is taken as a client device.
The change data refers to data of which a first data entity changes due to user operation or system setting in the game software process, and the first data entity is composed of data of a plurality of different fields.
The data definition file is written for game developers and used for defining data modules in game software, such as task system modules and workshop system modules in games. Specifically, the data definition file may include a data structure, a version number, a sync group, a sync time, and a sync manner of the corresponding data module.
Reference may be made to the following codes:
Figure BDA0003798700030000041
and the data structure in the data definition file is used for defining and generating a data entity corresponding to the data module, and the data in the data entity is changed and updated based on the business logic of the data module.
The version number may be used to record the version of the current data entity, and may be a string of characters of the version update time, such as 20210804 in the above-mentioned code; the version number has a corresponding relationship with a field in the data entity under the corresponding version, specifically, the field in the data entity has a version number attribute, and the version number attribute distinguishes the valid version of the field. For example, a field of spring festival activity data in a spring festival version is valid only in the spring and later versions, so that a client whose version number corresponds to the version before the spring festival does not need to synchronize the field at the time of data synchronization.
The sync group is configured to group the fields in the data entity according to a preset correspondence between different modules of the client and different fields in the data entity, and specifically, one field may be defined to include a sync group attribute. For example, the life value field of the player character needs to be synchronized to the client to which the player character belongs and the clients of other players whose fields of view contain the player character, and the legal value field of the player character only needs to be synchronized to the client to which the player character belongs; correspondingly, the life value field belongs to a visual field group and a player character group at the same time, the legal value field belongs to the player character group, and when the data module of the client subscribes to the groups, the server device synchronizes the data of the corresponding field to the client device. It should be noted that the synchronization group may be identified by the second identification information.
In one possible implementation, the first device is a server device, and the second device is a client device; before the first device synchronizes the change data and the first identification information to the second device, the first device may receive a subscription request of the second device, where the subscription request carries the second identification information and the version number information; and the first device stores the subscription relationship between the second device and the field of the change data according to the second identification information and the version number information.
The second identification information is used for indicating a field to which the second device is subscribed.
Specifically, the first device may determine a synchronization group according to the second identification information, and then determine a field of interest of the second device; and determining a target field from the interested field according to the version number information, namely the field to which the change data belongs.
After the first device determines a target field subscribed by the second device, the first device stores the subscription relationship between the second device and the target field in a subscription relationship management module of the first device.
Specifically, the subscription relationship management module in the first device may publish a view, and manage the subscription relationship through the view.
It is to be understood that the subscription request further includes the IP address of the second device, so that after the data change, the first device synchronizes the changed data to the second device.
It will be appreciated that the second device is a client device that subscribes to the field to which the change data belongs.
In one possible implementation, the first device is a server device, and the second device is a client device; the first device may receive a request for unsubscribing sent by the second device, where the request for unsubscribing carries second identification information; and the first equipment deletes the corresponding subscription relationship from the subscription relationship management module according to the second identification information.
The synchronization time is used to indicate an opportunity for the first device to synchronize the change data to the second device, and specifically may include immediate synchronization or delayed synchronization. The delay time of the delay synchronization can be determined according to the synchronization speed requirement of the field data, for example, the change of life value and legal value of a player character in the MMORPG requires instant synchronization in the fighting process; the experience value after the battle is finished can be changed to tolerate a certain delay.
For the case that the value of a field is modified multiple times in one operation, it can be determined that the field belongs to one change or multiple changes in a synchronous manner, for example, "last" in the code example indicates that the field changes once in one operation, and "continue" indicates that the field changes multiple times in one operation. When a field belongs to multiple changes, the first device may synchronize the field data of the latest change to the second device after the synchronization time is reached. Specifically, the fields synchronized multiple times are counted according to the number of times of synchronization during synchronization, and when the count value reaches the preset value of the field, the first device may directly send the change data of the latest synchronization to the second device.
The synchronization group, the synchronization time and the synchronization mode may be used as a set of attributes of the field, and the synchronization time and the synchronization mode of the same field may be different for different synchronization groups.
In one possible implementation, the first device may receive a data definition file and generate a first data entity from the data definition file. The first data entity corresponds to a data module to be defined by the data definition file, and the first data entity is changed and updated based on the service logic of the data module.
Specifically, the first device may parse the data definition file using a lexical analysis engine to generate an abstract syntax tree; loading a template file of a specified programming language by using a template engine, converting the abstract syntax tree into template data for rendering, and generating a data entity code file; and when the first equipment runs the data entity file, obtaining a first data entity.
In another possible implementation, the first device may receive a data entity code file corresponding to the first data entity, which is generated by the other device according to the data definition file; and after the data entity code file is operated, the first equipment obtains the first data entity.
Through the data entity code file, the first device can realize incremental updating, serialization, version matching and field matching functions of the first data entity.
Wherein the first identification information is used for indicating the field to which the change data belongs. Specifically, the first identification information may be a number of a field, or may be path information of the field in the first data entity.
It will be appreciated that if the first identifying information is the number of a field, that number is the number of the field throughout the game software to distinguish it from other like-type fields.
Specifically, the first device may identify the corresponding field using the path information according to the data entity and a hierarchy of the field in the data entity corresponding structure. For example, when the data entity is a nested structure, a data entity named N includes a field HP, which may be specifically shown as the following code fragment:
Figure BDA0003798700030000061
at this time, the first device may acquire the path information corresponding to the field HP as n.xhuman.info.hp. It can be understood that, when the second device receives the path information and the change value of the corresponding field HP, the second device may find the corresponding field HP according to the path information, and update the value of the field HP to the change value; specifically, the specific change value of the change data field in the synchronization packet, and the path information may be in the format of { "999", "n.xhuman.info.hp".
It should be noted that the changed data in the synchronization data packet may only be the changed value of the corresponding field, and the first identification information of the field is added, so that the second device can accurately replace the value of the field in the path in the second data entity according to the value in the synchronization data packet, so as to complete synchronization. The synchronous data packet is simplified, does not contain redundant information, can save communication resources and improve the data synchronization efficiency.
202. The first device sends a synchronization packet containing the change data and the first identification information to the second device.
And after receiving the synchronous data packet, the second device synchronizes a second data entity in the second device according to the synchronous data packet.
The second data entity and the first data entity are generated through the same data definition file, and the fields contained in the second data entity are the same as the fields contained in the first data entity.
It will be appreciated that the first data entity and the second data entity are the same data entity generated from the data definition file. Based on the same structure and field of the first data entity and the second data entity, the change data of the first data entity can be simply and conveniently synchronized to the second data entity, so that the workload of compiling difference messages among different data structures is reduced, and the system resource of converting the change data into the difference messages with different structures can be saved.
In a possible implementation, when the first device is a server device and the second device is a client device, the first device determines the second device from the multiple client devices according to a version number corresponding to a field to which the change data belongs, and then sends a synchronization packet including the change data and the first identification information to the second device.
That is to say, when the first device is used as a server device and needs to send a synchronization data packet to one or more second devices, the version number attribute of the corresponding field of the synchronization data packet and the version numbers of all clients subscribing the first data entity are grouped to obtain a field valid version group and a field invalid version group, so as to avoid sending the synchronization data packet to the client of the field invalid version, which causes data collision and software failure. The client equipment corresponding to the client with the valid field is determined to be used as second equipment through the version number, synchronous data can be compatible on client data layers with different versions, upper-layer logic of business is not affected, and the changed data can be directly synchronized to a second data entity of the second equipment; meanwhile, the difference message does not need to be written for compatible consideration of different versions, and the workload required for realizing data synchronization is reduced.
In a possible implementation, when the first device is a server device and the second device is a client device, the first device may send the synchronization packet to the second device subscribing to the corresponding field of the change data according to the subscription relationship stored in the subscription relationship management module.
That is to say, when a first device is used as a server device and needs to send a synchronization data packet to one or more second devices, all client devices subscribing to a first data entity are grouped according to a subscription relationship of corresponding fields of the synchronization data packet to obtain a subscription group and an unsubscribed group, and then the synchronization data packet is sent to the second devices in the subscription group.
In a possible implementation, the first device may determine a target client device from the client devices subscribed to the first data entity according to the version number of the field corresponding to the changed data, determine a second device from the target client device according to the subscription relationship of the field in the subscription relationship management module, and finally send the synchronization packet to the second device.
Different parts of one part of data can be accurately synchronized to different data modules of a client by making a synchronous data packet by taking the field as a unit and synchronizing the data according to the subscription relation of the field, and corresponding synchronous messages do not need to be compiled according to different data structures of different services.
After the first device determines the second device and before sending the synchronization packet, the first device may add the synchronization packet to the synchronization queue; and when the timing synchronization event corresponding to the field is triggered, the first equipment sends the synchronization data packet to second equipment serving as a synchronization target.
The timing synchronization event is an event set according to a synchronization time preset in a field, and specifically, the timing synchronization event may be triggered after the synchronization time passes after data change.
The synchronization queue may be a preset queue or a temporarily generated queue. Specifically, there may be a plurality of queues, and each queue is used to buffer the isochronous packet corresponding to one field.
When a timing synchronization event occurs and the synchronization queue comprises a plurality of synchronization data packets of the field, the first device sends the latest synchronization data packet added into the synchronization queue to the second device.
It will be appreciated that the synchronization time of the corresponding field of the change data indicates the synchronization speed tolerance of the data of that field and the first device need only synchronize the latest data within the range of the synchronization speed tolerance. For example, the data of the friend role in the friend system may not need to be synchronized within 1 second, but may be synchronized within 5 seconds. By reducing the transmission of data of the same field with high frequency variation within the tolerance range of the synchronous speed, communication resources and system resources can be saved.
In this embodiment of the application, the first device may obtain change data of the first data entity, and first identification information used for indicating a field to which the change data belongs; and finally, sending a synchronous data packet containing the change data and the first identification information to the second equipment so that the second equipment synchronizes the second data entity according to the synchronous data packet. According to the method and the device, the data entity in the first device and the data entity in the second device are unified, data synchronization is carried out through direct incremental data instead of converted difference messages, the data structure and the difference messages required by synchronization among different data structures do not need to be written, and the workload required by data synchronization is greatly reduced.
For a more comprehensive understanding of the data synchronization method provided in the present embodiment, please refer to fig. 3, and fig. 3 is a flowchart illustrating an implementation of the data synchronization method provided in the present embodiment.
As shown in fig. 3, after a game developer writes a data definition file, the data definition file is input into a code generation tool in a server device or other devices; generating an abstract syntax tree by a lexical analysis engine in a rule analysis module according to a lexical rule and a data structure in a data definition file, loading a template file of a specified programming language by a template engine in a code generation module, and generating a data entity code file according to the abstract syntax tree; and finally, the server equipment and the client equipment respectively generate a first data entity and a second data entity through the data entity code file.
After the server device generates the first data entities, the view can be published to manage the subscription relationship of the fields of each first data entity; the method specifically includes receiving a subscription request sent by a client device, and storing a subscription relation between the client device and a field established according to the subscription request in the view.
When the first data entity in the server device has data change, the server device may determine the client device as the synchronization target through the subscription relationship in the view. Specifically, the server device may obtain the client device subscribed to the first data entity, filter the client device that does not match the version number of the field corresponding to the changed data, and filter the client device that does not subscribe to the field according to the subscription relationship of the field, to obtain the client device serving as the synchronization target.
Then, a grouping module in the server device can group the second device according to the version number of the client in the client device, make a corresponding synchronous data packet according to the effective change data in the corresponding version, and add the synchronous data packet into a synchronous queue corresponding to the version group; and when the timing synchronization event corresponding to the field occurs, sending the synchronization data packet to a plurality of client devices in the version packet.
For example, the server device determines that the version number of the client device targeted for synchronization includes valid change fields of versions 1.06 and 1.07,1.06 as versions a, B, and C, and valid change fields of version 1.07 as versions C and D. At this time, the server device divides the client device into 1.06 group and 1.07 group, adds the synchronous data packets corresponding to the fields a, B and C into the synchronous queue of the 1.06 group, and adds the synchronous data packets corresponding to the fields C and D into the synchronous queue of the 1.07 group; and finally, when the timing synchronization event occurs, the synchronization data packets in the synchronization queue are respectively sent to the corresponding client equipment, so that the client equipment synchronizes the second data entity according to the synchronization data packets.
After receiving the synchronous data packet, the client device finds the field to be synchronized in the second data entity according to the path information in the synchronous data packet, and then replaces the value of the field to be synchronized with the value of the change data in the synchronous data packet, thereby completing data synchronization.
In combination with the data synchronization method provided in the embodiment of the present application, the present application further provides a computing device 400, specifically referring to fig. 4, where fig. 4 is a schematic structural diagram of the computing device 400, and the computing device 400 may specifically include:
an obtaining unit 401, configured to obtain change data of a first data entity and first identification information indicating a field to which the change data belongs; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software;
a synchronization unit 402, configured to send a synchronization packet including the change data and the first identification information to the second device, so that the second device synchronizes a second data entity in the second device according to the synchronization packet; the first data entity and the second data entity are generated through the same data definition file.
Optionally, the computing device 400 is a server device, and the second device is a client device; computing device 400 also includes: a determining unit 403, configured to determine the second device from the client device according to the version number corresponding to the field.
Optionally, the computing device 400 is a server device, and the second device is a client device; the subscription management 405 unit stores the subscription relationship between the second device and the field; the synchronization unit 402 is specifically configured to send the synchronization packet to the second device according to the subscription relationship.
Optionally, the computing device 400 further comprises: a receiving unit 404, configured to receive a subscription request of the second device, where the subscription request carries version number information and second identifier information; a subscription management unit 405, configured to store the subscription relationship according to the version number information and the second identification information.
Optionally, the change data is a value of a change field of the first data entity, and the first identification information is path information.
Optionally, the synchronization unit 402 is further configured to add the synchronization packet to the synchronization queue; the computing device 400 further comprises a triggering unit 406 for triggering the step of the synchronization unit 402 sending the synchronization data packet to the second device when a timing synchronization event occurs.
Optionally, the synchronization unit 402 is specifically configured to: and when the synchronous queue contains a plurality of synchronous data packets of the same field, sending the latest synchronous data packet added into the synchronous queue to the second equipment.
The working principle of the computing device 400 provided in the embodiment of the present application may be understood by referring to the corresponding content in the foregoing data synchronization method, and details are not repeated here.
The embodiment of the present application further provides a computing device 500, as shown in fig. 5, the computing device 500 includes a processor 501 and a memory 503;
wherein, the memory 503 stores instruction operations or codes;
the processor 501 is configured to communicate with the memory 503 and execute instruction operations or code in the memory 503 to perform a data synchronization method as provided in fig. 2.
Optionally, the processor 501 and the memory 503 are connected by a bus 502.
Embodiments of the present application also provide a computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform a data synchronization method as provided in fig. 2.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application, which essentially or partly contribute to the prior art, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.

Claims (10)

1. A method for synchronizing data, the method comprising:
the method comprises the steps that first equipment acquires change data of a first data entity and first identification information used for indicating a field to which the change data belong; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software;
the first device sends a synchronization data packet containing the change data and the first identification information to a second device, so that the second device synchronizes a second data entity in the second device according to the synchronization data packet; and the first data entity and the second data entity are generated by the same data definition file.
2. The method of claim 1, wherein the first device is a server device and the second device is a client device; before the first device sends the synchronization packet containing the change data and the first identification information to the second device, the method further includes:
and the first equipment determines the second equipment from the plurality of client equipment according to the version number corresponding to the field.
3. The method of claim 1 or 2, wherein the first device is a server device and the second device is a client device; the first device stores the subscription relationship between the second device and the field; the first device sends a synchronization packet containing the change data and the first identification information to a second device, and the synchronization packet includes:
and the first equipment sends the synchronous data packet to the second equipment according to the subscription relation.
4. The method of claim 3, wherein before the first device sends the synchronization packet containing the change data and the first identification information to the second device, the method further comprises:
the first device receives a subscription request of the second device, wherein the subscription request carries version number information and second identification information, and the second identification information is used for indicating the field to be subscribed by the second device;
and the first equipment stores the subscription relationship according to the version number information and the second identification information.
5. The method according to any of claims 1 to 4, wherein the change data is a value of a change field of the first data entity, and the first identification information is path information.
6. The method according to any one of claims 1 to 5, wherein before the first device sends a synchronization packet containing the change data and the first identification information to the second device, the method further comprises:
adding the synchronous data packet into a synchronous queue;
and triggering the first equipment to send the synchronous data packet to the second equipment when the timing synchronization event corresponding to the field occurs.
7. The method of claim 6, wherein sending, by the first device, a synchronization packet containing the change data and the first identification information to the second device comprises:
and when the synchronous queue contains a plurality of synchronous data packets of the same field, the first equipment sends the latest synchronous data packet added into the synchronous queue to the second equipment.
8. A computing device, wherein the computing device comprises:
an acquisition unit configured to acquire change data of a first data entity and first identification information indicating a field to which the change data belongs; the first data entity is generated through a data definition file, and the data definition file is used for defining a data module of game software;
a synchronization unit, configured to send a synchronization packet including the change data and the first identification information to a second device, so that the second device synchronizes a second data entity in the second device according to the synchronization packet; and the first data entity and the second data entity are generated by the same data definition file.
9. A computing device, wherein the computing device comprises:
a processor, a memory;
the memory has stored therein instruction operations or code;
the processor is configured to communicate with the memory and execute the instruction operations or code in the memory to perform the method of any of claims 1 to 7.
10. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 7.
CN202210976620.3A 2022-08-15 2022-08-15 Data synchronization method, computing device and medium Pending CN115334089A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210976620.3A CN115334089A (en) 2022-08-15 2022-08-15 Data synchronization method, computing device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210976620.3A CN115334089A (en) 2022-08-15 2022-08-15 Data synchronization method, computing device and medium

Publications (1)

Publication Number Publication Date
CN115334089A true CN115334089A (en) 2022-11-11

Family

ID=83923609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210976620.3A Pending CN115334089A (en) 2022-08-15 2022-08-15 Data synchronization method, computing device and medium

Country Status (1)

Country Link
CN (1) CN115334089A (en)

Similar Documents

Publication Publication Date Title
US9536261B2 (en) Resolving conflicts within saved state data
US9740761B2 (en) Management of application state data
KR101412765B1 (en) Multi-phased and partitioned content preparation and delivery
US10127294B2 (en) Idempotency of application state data
US8825743B2 (en) Semantic transactions in online applications
JP7397094B2 (en) Resource configuration method, resource configuration device, computer equipment, and computer program
CN108512814B (en) Media data processing method, device and system
CN106713469B (en) Dynamic loading method, device and system for distributed container
CN112636992B (en) Dynamic routing method, device, equipment and storage medium
CN112084258A (en) Data synchronization method and device
CN109032796B (en) Data processing method and device
CN111897564A (en) Application updating method and system
CN110888858A (en) Database operation method and device, storage medium and electronic device
CN113076304A (en) Distributed version management method, device and system
CN115185705A (en) Message notification method, device, medium and equipment
CN112988377B (en) Resource allocation method, system and medium for cloud service
CN116208623B (en) Information synchronization method, device, engine server and storage medium
CN115334089A (en) Data synchronization method, computing device and medium
CN112138372B (en) Data synchronization method in distributed system and related equipment
CN108829824B (en) Resource processing method and device in internet operation activity
Younes Dynamic end-to-end reliable causal delivery middleware for geo-replicated services
CN110866036B (en) Data processing method, system, device, terminal and readable storage medium
US20220337641A1 (en) Extended relationship signaling between events in event message tracks
Abad Copoví Container Orchestration in Limited Availability Domains
CN113996066A (en) Game application updating method and device, storage medium and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination