Data Synchronization Method, Device, Electronic Device, and Storage Medium
By adopting a synchronous process cluster design in large-scale multiplayer online role-playing games, sharing field of vision calculation and data synchronization, the performance bottleneck problem of scene service processes is solved, and the game performance limit and load capacity are improved.
Patent Information
- Application Number
- CN202310313670.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2043-03-22
AI Technical Summary
In existing large-scale multiplayer online role-playing games, the scene service process consumes a lot of object synchronization and migration, resulting in performance bottlenecks, especially when a large number of players and objects are concentrated in the server boundary area, the performance upper limit is too low.
The synchronous process cluster design is adopted. By creating a clone of the game object in the synchronization process for field of view calculation and data synchronization, and the synchronization of the game object between the regional processes through the clone of the game object in the regional process, sharing the computing resources of the regional process.
It improves the upper limit of game performance, reduces the computing burden of regional processes, and improves the load-bearing capacity and performance of the game.
Smart Images

Figure CN116521789B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of synchronization technology, and in particular, to a data synchronization method, apparatus, electronic device, and storage medium. Background Art
[0002] In a Massively Multiplayer Online Role-Playing Game (MMORPG), the scene service process (Game Server, GAS) is often the performance bottleneck for the number of players the game can carry, and optimizing GAS is the key to breaking through the game performance.
[0003] The prior art usually divides the game scene into different regions, each GAS is responsible for one of the regions, and then near the border range of the regions, the GASs achieve cross-region calculations through mutual synchronization of objects and object migration. Since the object synchronization and object migration between the servers in the border range consume a large amount, if a large number of players and objects are concentrated in the server boundary region, it will still lead to a performance bottleneck. It can be seen that the existing object data synchronization technology still has the technical problem of too low performance upper limit. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a data synchronization method, apparatus, electronic device, and storage medium to improve the performance upper limit of virtual games.
[0005] In a first aspect, an embodiment of the present invention provides a data synchronization method. The method includes: in response to the creation of a target game object in any target area process, determining a target synchronization process corresponding to the target game object, where each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, the any target area process is used to indicate the area process corresponding to any scene area, and the target synchronization process is a synchronization process in a preset synchronization process cluster; creating a target synchronization object corresponding to the target game object in the target synchronization process, and respectively creating a target view query object corresponding to the target game object in the remaining synchronization processes, and the synchronization objects and view query objects corresponding to the remaining game objects of the target game are respectively distributed in each synchronization process; receiving synchronization messages and calculating the view range of the target game object in each synchronization process through the target synchronization object and the target view query object, so as to obtain synchronization data corresponding to the target synchronization object and each target view query object respectively; based on the synchronization data corresponding to the target synchronization object and each target view query object respectively, synchronizing the game objects in the target area process and the visible area process through the virtual object in the target area process and the visible area process, the virtual object is used to indicate a visible game object across scene areas, and the visible area process is used to indicate the area process where the visible game object is located.
[0006] In a second aspect, an embodiment of the present invention provides a data synchronization device, the device comprising: a response module, configured to determine a target synchronization process corresponding to the target game object in response to the creation of the target game object in any target area process, wherein each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, the any target area process is used to indicate the area process corresponding to any scene area, the target synchronization process is a synchronization process in a preset synchronization process cluster, and the preset synchronization process cluster includes at least two synchronization processes; a creation module, configured to create a target synchronization object corresponding to the target game object in the target synchronization process, and respectively create a target view query object corresponding to the target game object in the remaining synchronization processes, and the synchronization objects and view query objects respectively corresponding to the remaining game objects of the target game are distributed in each synchronization process; a calculation module, configured to receive synchronization messages and calculate the view range of the target game object in each synchronization process through the target synchronization object and the target view query object, so as to obtain synchronization data respectively corresponding to the target synchronization object and each target view query object, so that the client corresponding to the target game object synchronizes the synchronization data of all game objects within the view range of the target game object through the synchronization data; a synchronization module, configured to synchronize the game objects in the target area process and the visible area process through the virtual objects in the target area process and the visible area process based on the synchronization data respectively corresponding to the target synchronization object and each target view query object, the virtual object is used to indicate the visible game object across the scene area, and the visible area process is used to indicate the area process where the visible game object is located.
[0007] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above data synchronization method.
[0008] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by the processor, the computer-executable instructions cause the processor to implement the above data synchronization method.
[0009] The embodiments of the present invention bring the following beneficial effects:
[0010] The above data synchronization method, device, electronic device, and storage medium. The method includes: in response to the creation of a target game object in any target area process, determining a target synchronization process corresponding to the target game object, where each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, the any target area process is used to indicate the area process corresponding to any scene area, and the target synchronization process is a synchronization process in a preset synchronization process cluster; creating a target synchronization object corresponding to the target game object in the target synchronization process, and respectively creating target view query objects corresponding to the target game object in the remaining synchronization processes, and the synchronization objects and view query objects respectively corresponding to the remaining game objects of the target game are distributed in each synchronization process; receiving synchronization messages and calculating the view range of the target game object in each synchronization process through the target synchronization object and the target view query objects, to obtain synchronization data respectively corresponding to the target synchronization object and each target view query object; based on the synchronization data respectively corresponding to the target synchronization object and each target view query object, synchronizing the game objects in the target area process and the visible area process through virtual objects in the target area process and the visible area process, the virtual object is used to indicate visible game objects across scene areas, and the visible area process is used to indicate the area process where the visible game objects are located. In this way, through the design of the synchronization process cluster, the view range calculation and data synchronization originally responsible for by the area process are shared. A clone of the game object (i.e., the synchronization object) is created in the synchronization process for view range calculation and data synchronization, which can be used for game object synchronization on the client side, while in the area process, a clone of the game object (i.e., the virtual object) is used for synchronization of game objects between area processes, so that the computing resources of the area process in these aspects are released, and the upper limit of game performance is thereby increased.
[0011] Other features and advantages of the present invention will be described in the following specification, and in part will be obvious from the specification, or can be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification, claims, and drawings.
[0012] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings
[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0014] Figure 1 It is a flowchart of an embodiment of the data synchronization method in an embodiment of the present invention;
[0015] Figure 2 It is the first schematic diagram of the data synchronization method in an embodiment of the present invention;
[0016] Figure 3 It is the second schematic diagram of the data synchronization method in an embodiment of the present invention;
[0017] Figure 4 It is another flowchart of an embodiment of the data synchronization method in an embodiment of the present invention;
[0018] Figure 5 It is the third schematic diagram of the data synchronization method in an embodiment of the present invention;
[0019] Figure 6 It is the fourth schematic diagram of the data synchronization method in an embodiment of the present invention;
[0020] Figure 7 It is a schematic diagram of a data synchronization device provided in an embodiment of the present invention;
[0021] Figure 8 It is a schematic diagram of an electronic device provided in an embodiment of the present invention. Specific Embodiments
[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions of the present invention with reference to the drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present invention.
[0023] In the description and claims of the present invention and the above-mentioned drawings, the terms "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the term "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that comprises a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0024] The data synchronization method in one embodiment of the present invention can run on a server. When the data synchronization method runs on the server, the method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and client devices.
[0025] In an alternative embodiment, various cloud applications can run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the running entity of the game program and the presenting entity of the game screen are separated. The storage and operation of the data synchronization method are completed on the cloud game server, and the role of the client device is to receive, send, and present the game screen. For example, the client device can be a display device with data transmission function near the user side, such as a mobile terminal, a television, a computer, a palm computer, etc.; however, the information processing is performed by the cloud game server in the cloud. When playing a game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses data such as the game screen, returns it to the client device through the network, and finally, the game screen is decoded and output through the client device.
[0026] In an alternative embodiment, taking a game as an example, the local terminal device stores a game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally, the game program is downloaded and installed on an electronic device and run. The way the local terminal device provides the graphical user interface to the player can include various methods. For example, it can be rendered and displayed on the display screen of the terminal, or provided to the player through holographic projection. For example, the local terminal device can include a display screen and a processor. The display screen is used to present the graphical user interface, which includes the game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.
[0027] In a possible implementation, an embodiment of the present invention provides a data synchronization method. A graphical user interface is displayed through a terminal device. The terminal device may be the aforementioned local terminal device or a client device in the aforementioned cloud interaction system.
[0028] It should be noted that in the embodiment of the present invention, a graphical user interface is displayed through a terminal device. The graphical user interface includes at least one game scene of a target game. Each game scene includes at least one scene area, and each scene area corresponds to an area process. It can be understood that the complete game scene of the target game is composed of at least one game scene. Each game scene is divided into at least one scene area, and one scene area is responsible for by one process (Process), that is, each scene area corresponds to an area process. In one implementation, in order to improve the computing performance of the process, different area processes correspond to different game servers (Game Server, GAS), that is, each scene area corresponds to a GAS. The total number of GASs of the target game is the same as the total number of divided scene areas. In this case, the area process refers to the GAS. For ease of understanding, the embodiment of the present invention is described based on this case. In one implementation, the target game is a virtual game of the MMORPG type, including the MMORPG type of real-time and turn-based, and specific limitations are not made here.
[0029] It can be understood that in the embodiment of the present invention, a GAS is responsible for the business operation of one scene area. When it is necessary to improve the upper limit of the game performance, that is, to increase the upper limit of the number of game players, it can be achieved by further subdividing the scene area and increasing the GAS. Since there is no migration of game objects between GASs, even if the scene area is further subdivided, the object migration calculation amount of the GAS will not increase, which greatly releases the GAS and reduces the possibility of game performance bottlenecks.
[0030] For ease of understanding, the specific process of the embodiment of the present invention is described below. Please refer to Figure 1 , an embodiment of the data synchronization method in the embodiment of the present invention includes:
[0031] Step S10: In response to the creation of a target game object in any target area process, determine a target synchronization process corresponding to the target game object. Each game scene of the target game includes at least one scene area, one scene area corresponds to an area process, and any target area process is used to indicate the area process corresponding to any scene area. The target synchronization process is a synchronization process in a preset synchronization process cluster;
[0032] In this embodiment, when a game object (including the target game object) enters the game scene of the target game, the game object is created in the area process (i.e., GAS) corresponding to the scene area entered by the game object. During the entire life cycle of the game object, there is no migration and synchronization of GAS. Instead, the data synchronization function (without migration) is shared by the synchronization processes (Synchronize Server Process, SYN) in the preset synchronization process cluster, thereby releasing the performance consumption of GAS in object migration and synchronization, and enabling the computing resources to be allocated to other business functions, improving the performance ceiling of the virtual game.
[0033] In this embodiment, after a target game object is created in the GAS (i.e., the target area process) corresponding to the target scene area, a target SYN is determined in the preset SYN cluster for performing the synchronization calculation of the target game object. It should be noted that the preset SYN cluster includes at least two SYNs. The total number of SYNs in the preset SYN cluster can be constant or dynamic. In order to improve the stability of data synchronization, in one embodiment, the total number of SYNs in the preset SYN cluster is constant and equal to the preset total number of processes, such as 10 or 20, and specific values are not limited here. It should be noted that different SYNs can also correspond to different servers, and the same server can include at least one SYN, and specific details are not limited here.
[0034] In one embodiment, the determination method of the target SYN can be an allocation method based on any load balancing algorithm. For example, according to the current load of each SYN in the preset SYN cluster, the SYN with the smallest current load is determined as the target SYN corresponding to the target game object; or according to the total number of objects (including synchronization objects and view query objects) of each SYN in the preset SYN cluster, the SYN with the smallest total number of objects is determined as the target SYN corresponding to the target game object. The determination method of the target SYN can also be an allocation method based on the preset average allocation algorithm. For example, the target game objects are numbered according to the creation order, and the SYNs in the preset SYN cluster are numbered in sequence. Then, according to the serial number of the target game object when it is created, the target SYN is determined according to the serial number of the SYN. For example, the first created game object corresponds to the first SYN, the second created game object corresponds to the second SYN, and so on. After allocating to the last SYN, the allocation starts from the beginning, so as to achieve the average allocation of processes. It can be seen that all game objects of the target game are allocated a corresponding SYN, and the corresponding SYN is used to share the data synchronization operation of the game object in GAS, enabling GAS to allocate computing resources to other business functions and improving the performance ceiling of the virtual game.
[0035] Step S20: Create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target vision query object corresponding to the target game object in each of the remaining synchronization processes. The synchronization objects and vision query objects corresponding to the remaining game objects of the target game are distributed in each synchronization process;
[0036] It can be understood that for each game object (including the target game object, collectively referred to as GasObj), a synchronization object corresponding to it (collectively referred to as SynObj) is created in the target SYN corresponding to the game object, and a vision query object corresponding to it (collectively referred to as SynView) is created in each of the remaining SYNs. In this way, the SynObjs corresponding to all game objects of the target game are distributed in each SYN, and the SynViews corresponding to all game objects are distributed in each SYN except the target SYN. As a clone of the game object, SynObj receives the synchronization data sent by the game object in the GAS in real time and maintains synchronization with the game object in the GAS. Among them, the synchronization data can include any game data that needs to be synchronized, such as position data, blood volume data, mana data, equipment data, economic data, experience data, etc., which are not specifically limited here. And SynView is a kind of Ghost object that will not be included in the vision range calculation by other game objects, that is, it will not be seen by other game objects. SynView also contains the real-time synchronization data of the corresponding game object. The purpose of creating SynView corresponding to the game object in each of the remaining SYNs is: since the SynObjs of the remaining game objects are distributed in the remaining SYNs, therefore, through the vision range calculation of SynView, the visible SynObjs in each of the remaining SYNs are obtained, and the visible SynObjs in each SYN are summarized to construct the complete visible game objects within the vision range of the game object, so as to realize the vision range calculation and data synchronization in the SYN and release the computing resources of the GAS in these aspects. Improve the upper limit of game performance.
[0037] As an example rather than a limitation, such as Figure 2As shown in the figure, assume that GasObj1 is the target game object and SYN1 is the target synchronization process. Then, SynObj1 is the target synchronization object corresponding to GasObj1, and SynView1 in SYN2 - SYNn is the target view query object corresponding to GasObj1. From SynView1 and SynObj3 in SYN2, it can be seen that through SynView1 in SYN2, the synchronization object SynObj3 corresponding to GasObj3 within the view range can be queried in SYN2. And from SynView1 and SynObj2 in SYNn, it can be seen that SynView1 in SYNn can query the synchronization object SynObj2 corresponding to GasObj2 within the view range in SYNn. By aggregating the view range query results of SynObj1 and all SynView1, a complete visible GasObj within the view range of GasObj1 can be constructed, that is, GasObj2 and GasObj3.
[0038] Step S30: Receive synchronization messages of the target game object and calculate the view range in each synchronization process through the target synchronization object and the target view query object, to obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively.
[0039] In this embodiment, the target SynObj in the target SYN updates the synchronization data by receiving synchronization messages from the corresponding GasObj, and notifies the target SynView in the remaining SYNs to update the synchronization data. In this way, the target SynObj corresponding to the target GasObj and all target SynView can be synchronized with the target GasObj. Based on the updated synchronization data, the view range is calculated through the target SynObj in the target SYN to obtain the first visible object list of the target SynObj in the target SYN. Then, the view range is calculated through the target SynView in the remaining SYNs to obtain the second visible object list of each target SynView in the corresponding SYN. By combining the synchronization data of each visible object in the first visible object list, the synchronization data corresponding to the target SynObj can be obtained. By combining the synchronization data of each visible object in the second visible object list, the synchronization data corresponding to each target view query object can be obtained respectively.
[0040] It can be understood that the client of the target game object can construct a complete game object through the synchronization data of the target SynObj in the target SYN and the synchronization data corresponding to each SynView respectively in the client. It can achieve game data synchronization of the client without calculating the view range and synchronizing data through GAS, thereby releasing the computing resources of GAS in these aspects and improving the upper limit of game performance.
[0041] It should be noted that the field of view (Area Of Interest, AOI) calculation can be achieved through a preset AOI algorithm, which includes but is not limited to a full-scene synchronization method, a grid method, a cross-linked list method, etc., and is not specifically limited here.
[0042] Step S40, based on the synchronization data corresponding to the target synchronization object and each target field of view query object, synchronize the game objects in the target area process and the visible area process through the virtual objects in the target area process and the visible area process, the virtual objects are used to indicate the visible game objects across the scene area, and the visible area process is used to indicate the area process where the visible game objects are located.
[0043] It should be noted that the above-mentioned steps S10-step S30 are used to realize the data synchronization of the client, and this step S40 is used to realize the data synchronization of GAS. Since GAS, in addition to containing the original game object, also carries the game business functions of each game object, such as attack, life cycle management, skill management, props management, etc., therefore, it is also necessary to ensure the synchronization of game data in GAS. In this step, virtual objects (collectively referred to as: NeighbourVirObj) are used to indicate the visual game objects across scene areas, that is to say, virtual objects are the avatars of the visual game objects of the target game objects in other scene areas in the process of this area, through the target synchronization object and each target vision query object respectively corresponding synchronization data, it is possible to determine the visual game objects of the target game objects across scene areas, and then the virtual objects corresponding to the visual game objects in the target GAS are synchronized and updated with synchronization data, thereby synchronizing the visual game objects in the target GAS. Due to the mutual visibility, the target game object can see the visible game objects across the scene area, and the visible game objects across the scene area can also see the target game object. Therefore, the virtual object corresponding to the target game object in the visible area process also needs to be updated synchronously to synchronize the target game object in the visible GAS.
[0044] By way of example and not limitation, Figure 3As shown in the figure, assume that GasObj1 is the target game object, and GasObj2 and GasObj3 are visible game objects in the cross-scene area in GAS2. According to the synchronization data of SynObj2 in SYN for GasObj2, the visibility of GasObj2 relative to GasObj1 can be determined. By sending a synchronization message from SynObj2 to GAS1, a virtual object corresponding to GasObj2 (i.e., NeighbourVirObj1) can be created in GAS1. NeighbourVirObj1 updates the synchronization data through the synchronization message, thus ensuring that the synchronization data of GasObj2 is synchronized in GAS1. Similarly, the synchronization of NeighbourVirObj2 corresponding to GasObj3 in the figure is also carried out in the same way, which will not be elaborated here. It can be understood that if the GAS synchronization of this step is not performed, there may be a phenomenon that the client can see a certain game object, but because the game object is not synchronized in GAS, an attack cannot be launched on it. This embodiment can avoid the occurrence of such problems through virtual objects.
[0045] The data synchronization method provided by the above embodiment shares the field of view calculation and data synchronization originally responsible for by the area process through the design of the synchronization process cluster. A clone of the game object (i.e., the synchronization object) is created in the synchronization process for field of view calculation and data synchronization, which can be used for the synchronization of game objects on the client side. In the area process, a clone of the game object (i.e., the virtual object) is used for the synchronization of game objects between area processes, so that the computing resources of the area process in these aspects can be released, and the upper limit of game performance can also be improved accordingly.
[0046] Please refer to Figure 4 , another embodiment of the data synchronization method in the embodiment of the present invention includes:
[0047] Step S401: In response to the creation of a target game object in any target area process, determine the target synchronization process corresponding to the target game object, where each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, any target area process is used to indicate the area process corresponding to any scene area, and the target synchronization process is a synchronization process in a preset synchronization process cluster;
[0048] In one embodiment, the above step S401 includes: in response to the creation of a target game object in any target area process, obtaining the identification information of the target game object, where the target game object is used to indicate a player object or a non-player object; determining the target synchronization process corresponding to the target game object through a preset hash distribution algorithm according to the total number of synchronization processes in the preset synchronization process cluster and the identification information. In this embodiment, the hash distribution algorithm is used to determine the target synchronization process assigned to the target game object. Specifically, after the target GasObj is created in the target GAS, according to the identification information (such as ID) of the target GasObj and the number of SYNs in the preset SYN cluster, the node (i.e., SYN) assigned to this identification information is calculated through the preset hash distribution algorithm, so as to determine the target SYN. The preset hash distribution algorithm may be a remainder hash algorithm, a consistent hash algorithm, a virtual slot hash algorithm, etc. To improve the calculation efficiency, in one embodiment, the preset hash distribution algorithm is the remainder hash algorithm, and the target synchronization process corresponding to the target game object is determined through the remainder hash algorithm. For example, assuming that the total number of SYNs in the preset SYN cluster is 10 and the identification information is ID, then, through ID % 10 of the remainder hash algorithm, the serial number of the SYN can be obtained, so as to assign the target game object to the SYN with this serial number.
[0049] Step S402, create a target synchronization object corresponding to the target game object in the target synchronization process, and respectively create a target view query object corresponding to the target game object in the remaining synchronization processes. The synchronization objects and view query objects corresponding to the remaining game objects of the target game are respectively distributed in each synchronization process;
[0050] In one embodiment, the above step S402 includes: if the target game object is a player object, create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field of view query object corresponding to the target game object in each of the remaining synchronization processes; if the target game object is a non-player object, create a target synchronization object corresponding to the target game object in the target synchronization process. It should be noted that the target game object can be a player (i.e., player) object (collectively referred to as: GasPlayer, one type of GasObj) and a non-player (non-person character, NPC) object (collectively referred to as: GasNPC, one type of GasObj). Since the NPC object does not need to display the objects it sees within its field of view on the terminal, that is, it does not need to perform AOI calculations. It only needs to receive the synchronization data from the corresponding GAS and broadcast the received synchronization data to the SynObj that sees itself. The objects it sees can be determined through mutual visibility. Therefore, for a target game object that is a GasNPC, after determining the corresponding target SYN, only a target SynNPC (one type of SynObj) for receiving the synchronization data from the target GAS needs to be created in the target SYN, and there is no need to create a SynView for field of view range query in the remaining SYNs, thereby reducing the waste of SYN computing resources and improving the data synchronization efficiency. For the player object, since the play object is controlled by the player's terminal and needs to display the objects it sees within its field of view, that is, it needs to perform AOI calculations, it also needs to receive the synchronization data from the corresponding GAS and broadcast the received synchronization data to the player objects that see itself. Therefore, for a target game object that is a GasPlayer, both a corresponding target SynPlayer (one type of SynObj) needs to be created in the target SYN, and a target SynView for field of view range query needs to be created in the remaining SYNs, thereby distributively implementing AOI calculations and data synchronization, releasing the computing resources of GAS in these aspects, and improving the upper limit of game performance.
[0051] Step S403: Receive synchronization messages of the target game object and calculate the field of view range in each synchronization process through the target synchronization object and the target field of view query object, to obtain synchronization data corresponding to the target synchronization object and each target field of view query object respectively;
[0052] In one implementation, the target game object is used to indicate a player object or a non-player object. The above step S403 includes: if the target game object is a non-player object, receiving, by the target synchronization object in the target synchronization process, a synchronization message sent by the target area process to obtain synchronization data corresponding to the target synchronization object; if the target game object is a player object, receiving, by the target synchronization object and the target field of view query object in each synchronization process, the synchronization message of the target game object and calculating the field of view range to obtain synchronization data corresponding to the target synchronization object and each target field of view query object respectively.
[0053] Similar to step S402, if the target GasObj is a GasNPC, then, when performing data synchronization, only receive the synchronization data from the target GAS in the target SYN and broadcast the received synchronization data to the SynObjs that can see itself. The SynObjs that can see itself can be determined by the calculation results of the field of view range of each SynObj. For example, if a certain SynNPC is included in the calculation result of the field of view range of SynObj1, then this SynNPC will broadcast the synchronization data it receives from the GAS to this SynObj1, so as to obtain the complete synchronization data within the field of view of this SynObj1. That is, in this implementation, after receiving, by the target synchronization object in the target synchronization process, a synchronization message sent by the target area process to obtain synchronization data corresponding to the target synchronization object when the target game object is a non-player object, it further includes: based on the calculation results of the field of view ranges of all synchronization objects and field of view query objects (i.e., the visible object list), broadcasting the synchronization data corresponding to the target synchronization object to all visible objects in the target visible object set, where the target visible object set includes synchronization objects and / or field of view query objects whose field of view range calculation results include the target synchronization object. For example, as Figure 2 shown, assume that GasObj3 is a GasNPC, and SynView1 determines through the field of view range calculation that SynObj3 is within its field of view, that is, in the corresponding visible object list. Then, SynObj3 will broadcast the synchronization data received from GasObj3 to SynView1, so as to obtain the synchronization data corresponding to SynObj3 in SynView1.
[0054] If the target GasObj is GasPlayer, then when performing data synchronization, it is necessary to receive synchronization messages (including synchronization data) from the target GAS in the target SYN, and also perform AOI calculations through the corresponding target SynPlayer in the target SYN, as well as perform AOI calculations through the corresponding target SynView in the remaining SYNs, so as to obtain the synchronization data corresponding to the target SynPlayer and the synchronization data corresponding to each target SynView respectively. These synchronization data contain all visible objects of GasPlayer and the synchronization data of each visible object, which are used for data synchronization between the client and GAS.
[0055] It should be noted that after obtaining the synchronization data corresponding to the target SynPlayer and the synchronization data corresponding to each target SynView respectively, all the synchronization data is sent to the client corresponding to the target GasObj, or the client corresponding to the target GasObj obtains the synchronization data corresponding to the target SynPlayer from each SYN, so that a complete and synchronized field of view content can be constructed in the client, enabling the AOI calculation and data synchronization originally performed by GAS to be shared and completed by the SYN cluster, thereby releasing the computing resources of GAS in these aspects and improving the upper limit of game performance.
[0056] In one implementation, each synchronization object is used to receive synchronization messages of corresponding game objects sent by the corresponding regional process in real time. The synchronization messages include synchronization data, and the target game object is used to indicate a player object or a non-player object; the above step S403 further includes: if the target game object is a player object, then receive the synchronization message sent by the target regional process in real time through the target synchronization object in the target synchronization process to obtain the synchronization data corresponding to the target synchronization object; based on the synchronization data corresponding to the target synchronization object and the synchronization data corresponding to the remaining synchronization objects, perform a field of view range calculation through the target synchronization object in the target synchronization process to obtain at least one visible object corresponding to the target synchronization object, and perform a field of view range calculation through the target field of view query object in each of the remaining synchronization processes to obtain at least one visible object corresponding to each target field of view query object respectively. The visible object is used to indicate the synchronization object corresponding to the remaining game objects in the synchronization process; combine the synchronization data corresponding to the target synchronization object, at least one visible object corresponding to the target synchronization object, and at least one visible object corresponding to each target field of view query object respectively to obtain the synchronization data corresponding to the target synchronization object and each target field of view query object respectively.
[0057] As Figure 5As shown, assume that GasPlayer1 is the target GasPlayer, GAC1 (Game Client, GAC) is the client corresponding to GasPlayer1, SynPlayer1 is the target SynPlayer corresponding to GasPlayer1, and SynView1 is the target SynView corresponding to GasPlayer1. Then, in SYN1, SynPlayer1 is used to receive synchronization messages and calculate the field of view range, and the synchronization data corresponding to SynPlayer1 is obtained. The synchronization data includes SynNPC1 within the field of view of SynPlayer1 and the synchronization data received by SynNPC1 from GasNPC1 (located in GAS2). In SYN2, SynView1 is used to receive synchronization messages and calculate the field of view range, and the synchronization data corresponding to SynView1 is obtained. The synchronization data includes SynPlayer2 and SynNPC2 within the field of view of SynPlayer1, as well as the synchronization data received by SynPlayer2 from GasPlayer2 (located in GAS1) and the synchronization data received by SynNPC2 from GasNPC2 (located in GAS2). GAC1 obtains the corresponding synchronization data from all SYNs, that is, the synchronization data corresponding to SynPlayer1 and the synchronization data corresponding to SynView1, and then can construct FolNPC1 (corresponding to GasNPC1), FolPlayer2 (corresponding to GasPlayer2), and FolNPC2 (corresponding to GasNPC2) within the field of view. MainPayler1 in the figure corresponds to GasPlayer1.
[0058] Step S404: According to the synchronization data corresponding to the target synchronization object and each target field of view query object, respectively determine whether each game object within the field of view of the target game object is in a regional process outside the target regional process;
[0059] Step S405: If any game object within the field of view of the target game object is in a regional process outside the target regional process, then determine the regional process where each first game object located outside the target regional process is located as the visible regional process, and obtain at least one visible regional process;
[0060] In the above steps S404 - S405, in order to synchronize the AOI calculation results and synchronization data obtained in SYN back to GAS, after obtaining the synchronization data corresponding to the target SynPlayer and the synchronization data corresponding to each target SynView, first, through all SynObjs in all the synchronization data, that is, all GasObjs within the field of view of the target GasPlayer, it is determined whether there are GasObjs in other GASs. If there are GasObjs in other GASs, then each GasObj in other GASs is determined as the first GasObj, and the GAS where each first GasObj is located is determined as the visible GAS. The method of determining the visible GAS based on the visible GasObjs can more accurately determine the visible relationship compared to directly binding the GASs as visible relationships, and can adapt to different angle transformations in the game. For example, at a certain angle, only a part of a certain scene area is visible. If directly bound as a visible relationship, GasObjs in the invisible part of that scene area may also be classified as visible GasObjs, resulting in misjudgment. Also, for GasObjs that are visible at a relatively long distance, they will not be ignored due to the lack of a bound visible relationship, and the discrimination of the visibility of game objects is more accurate.
[0061] By way of example and not limitation, as Figure 3 shown, assume that GasObj1 is the target GasObj and this GasObj is a GasPlayer, SynObj1 is the target SynObj corresponding to GasObj1, and SynView1 is the target SynView corresponding to GasObj1. According to the synchronization data corresponding to SynObj1 and the synchronization data corresponding to SynView1, it can be determined that the GasObjs within the field of view of GasObj1 include GasObj2 and GasObj3, and both GasObj2 and GasObj3 are in a GAS other than GAS1, that is, GAS2. Therefore, GasObj2 and GasObj3 are both the first game objects outside the target GAS, and GAS2 is the GAS where these two first game objects are located, that is, the visible GAS. The specific details are not limited here.
[0062] Step S406: Update the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object to obtain the first game object with the latest synchronization in the target area process, and update the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object to obtain the target game object with the latest synchronization in the visible area process. The first virtual object is used to indicate the first game object outside the target area process, and the target virtual object includes the target game object in the visible area process.
[0063] In this step, to avoid the performance ceiling reduction of GAS caused by the migration of GasObj between GASs due to the cross-scene area movement of GasObj, after determining each first GasObj and the GAS (i.e., visible GAS) where each first GasObj is located, create a first NeighbourVirObj corresponding to each first GasObj in the target GAC (if already created, directly obtain it), and synchronize the data of the first NeighbourVirObj corresponding to each first GasObj in the target GAS through the SynObj corresponding to each first GasObj, so that the first NeighbourVirObj corresponding to each first GasObj in the target GAS is synchronized with the data of the first GasObj in the GAS where each first GasObj actually is. Since visibility is mutual, after the virtual objects in the target GAS are synchronized to the latest, the target NeighbourVirObj corresponding to the target GasObj in the visible GAS also needs to be synchronized with the data. Similarly, in each visible GAS, synchronize the data of the target NeighbourVirObj corresponding to each visible GAS through the target SynObj corresponding to the target GasObj, so that the target NeighbourVirObj in each visible GAS is synchronized with the target GasObj in the target GAS, thereby realizing data synchronization between GASs. Thus, it can be seen that the virtual object is actually the avatar of the visible game object across the scene area in the process of this scene area. When the game object in the process of this scene area needs to interact with the visible game object across the scene area, directly interact with the avatar of the visible game object in the process of this scene area, thereby avoiding the frequent migration of game objects between GASs and improving the game virtual ceiling.
[0064] As an example and not a limitation, as Figure 6 shown, assume that GasPlayer1 is the target game object and GasPlayer2 is the visible game object of GasPlayer1. Then, NeighbourVirObj2 is the virtual object, i.e., the avatar, of GasPlayer2 in GAS1, and NeighbourVirObj1 is the virtual object, i.e., the avatar, of GasPlayer1 in GAS2. The specific details are not limited here.
[0065] In one implementation, the above step S406 includes: Step S4061, through the synchronization process in which the synchronization object corresponding to each first game object is located, send a first synchronization message to the target area process, and send a second synchronization message to each visible area process through the target synchronization process. The first synchronization message is used to indicate the creation, deletion, or synchronization data update of the first virtual object in the target area process, and the second synchronization message is used to indicate the creation, deletion, or synchronization data update of the target virtual object in each visible area process; Step S4062, based on the first synchronization message, create, delete, or synchronize data update for the first virtual object in the target area process to obtain the first game object with the latest synchronization in the target area process. Based on the second synchronization message, create, delete, or synchronize data update for the target virtual object in each visible area process to obtain the target game object with the latest synchronization in the visible area process. In this implementation, the life cycle of each virtual object (including the target virtual object and the first virtual object) is controlled by its corresponding SynObj. The entire life cycle of a virtual object in GAS includes creation, update, and deletion. When the SynObj changes, a synchronization message is sent to its corresponding virtual object, so that after GAS receives the synchronization message, it creates, deletes, or synchronizes data update for the virtual object to obtain the latest virtual object in GAS, that is, the clone of the game object.
[0066] In one implementation, the above step S4062 includes: determining whether the first virtual object corresponding to each first game object has been created, and determining whether the target virtual object corresponding to the target game object has been created; if the first virtual object corresponding to each first game object has not been created, and it is determined that the target virtual object corresponding to the target game object has not been created, then determine whether the total number of all virtual objects in all area processes is greater than a preset total threshold; if the total number of all virtual objects in all area processes is greater than the preset total threshold, then add each first virtual object and the target virtual object to a preset synchronization queue, and based on the preset synchronization queue, create, delete, or synchronize data update for the first virtual object in the target area process through the first synchronization message to obtain the first game object with the latest synchronization in the target area process, and create, delete, or synchronize data update for the target virtual object in each visible area process through the second synchronization message to obtain the target game object with the latest synchronization in the visible area process.
[0067] In this embodiment, to prevent a large number of virtual objects from being created, deleted, or updated due to a large number of players gathering at the boundary of the scene area, the method of queuing the creation of virtual objects is adopted in this embodiment to prevent game performance problems when such extreme situations occur. Specifically, if a virtual object has not been created in the GAS, before creating the virtual object, first determine whether the total number of virtual objects in all GASs is greater than the preset total threshold. If so, add the first virtual object and the target virtual object to be created to the preset synchronization queue first, and then create the virtual objects in an orderly manner according to the enqueue order of the virtual objects in the preset synchronization queue, so as to avoid game virtual problems.
[0068] In one embodiment, the above method further includes: in response to the high-frequency synchronization data change of the target game object, the target synchronization process updates the high-frequency synchronization data of the target synchronization object, and sends a change notification to the remaining synchronization processes, the client corresponding to the target game object, and the target area process; the remaining synchronization processes perform real-time synchronization update of the high-frequency synchronization data through the change notification, and enable the client corresponding to the target game object to perform real-time synchronization update of the high-frequency synchronization data through the change notification; the target area process performs real-time synchronization update of the high-frequency synchronization data through the change notification according to the preset update frequency, and obtains the latest high-frequency synchronization data corresponding to the target game object in the target area process. It can be understood that for high-frequency synchronization data of the game, such as position data, life state data, etc., only high-frequency update synchronization needs to be maintained between the client and the SYN, and the GAS can release more computing resources by reducing the update frequency, thereby increasing the upper limit of game performance. It should be noted that the preset update frequency is less than the frequency of real-time synchronization update. For example, assuming that the position data is updated 30 times per second for real-time synchronization update, then the preset update frequency can be 1 time per second, and the specific value is not limited here.
[0069] The data synchronization method provided by the above embodiment shares the field of view calculation and data synchronization originally responsible for by the area process through the design of the synchronization process cluster. A clone of the game object (i.e., the synchronization object) is created in the synchronization process for field of view calculation and data synchronization, which can be used for game object synchronization of the client, while in the area process, a clone of the game object (i.e., the virtual object) is used for game object synchronization between area processes, so that the computing resources of the area process in these aspects are released, and the upper limit of game performance is also increased accordingly.
[0070] Corresponding to the above method embodiment, refer to Figure 7Schematic diagram of a data synchronization device, the device includes: a response module 70, configured to determine a target synchronization process corresponding to a target game object in response to the creation of the target game object in any target area process, wherein each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, any target area process is used to indicate the area process corresponding to any scene area, the target synchronization process is a synchronization process in a preset synchronization process cluster, and the preset synchronization process cluster includes at least two synchronization processes; a creation module 72, configured to create a target synchronization object corresponding to the target game object in the target synchronization process, and respectively create a target view query object corresponding to the target game object in the remaining synchronization processes, and the synchronization objects and view query objects respectively corresponding to the remaining game objects of the target game are distributed in each synchronization process; a calculation module 74, configured to receive synchronization messages of the target game object and calculate the view range through the target synchronization object and the target view query object in each synchronization process, so as to obtain the synchronization data respectively corresponding to the target synchronization object and each target view query object, so that the client corresponding to the target game object synchronizes the synchronization data of all game objects within the view range of the target game object; a synchronization module 76, configured to synchronize the game objects in the target area process and the visible area process through the virtual objects in the target area process and the visible area process based on the synchronization data respectively corresponding to the target synchronization object and each target view query object, the virtual object is used to indicate the visible game objects across the scene areas, and the visible area process is used to indicate the area process where the visible game objects are located.
[0071] For the above data synchronization device, through the design of the synchronization process cluster, the view range calculation and data synchronization originally responsible for by the area process are shared. In the synchronization process, the clones of the game objects (i.e., synchronization objects) are created for view range calculation and data synchronization, which can be used for game object synchronization of the client, while in the area process, the clones of the game objects (i.e., virtual objects) are used for the synchronization of game objects between area processes, so that the computing resources of the area process in these aspects are released, and the upper limit of game performance is thus improved.
[0072] Optionally, the above synchronization module 76 includes: a judgment sub-module, configured to respectively judge whether each game object within the field of view of the target game object is in a regional process outside the target regional process according to the target synchronization object and the synchronization data respectively corresponding to each target field-of-view query object; a determination sub-module, configured to determine that if any game object within the field of view of the target game object is in a regional process outside the target regional process, the regional process where each first game object outside the target regional process is located is determined as a visible regional process, obtaining at least one visible regional process; a synchronization sub-module, configured to update the synchronization data of the first virtual object in the target regional process through the synchronization object corresponding to each first game object, obtaining the first game object with the latest synchronization in the target regional process, and update the synchronization data of the target virtual object in each visible regional process through the target synchronization object corresponding to the target game object, obtaining the target game object with the latest synchronization in the visible regional process, where the first virtual object is used to indicate the first game object outside the target regional process, and the target virtual object includes the target game object in the visible regional process.
[0073] Optionally, the above synchronization sub-module includes: a sending unit, configured to send a first synchronization message to the target regional process through the synchronization process where the synchronization object corresponding to each first game object is located, and send a second synchronization message to each visible regional process through the target synchronization process, where the first synchronization message is used to indicate the creation, deletion, or synchronization data update of the first virtual object in the target regional process, and the second synchronization message is used to indicate the creation, deletion, or synchronization data update of the target virtual object in each visible regional process; a synchronization unit, configured to create, delete, or update the synchronization data of the first virtual object in the target regional process based on the first synchronization message, obtaining the first game object with the latest synchronization in the target regional process, and create, delete, or update the synchronization data of the target virtual object in each visible regional process based on the second synchronization message, obtaining the target game object with the latest synchronization in the visible regional process.
[0074] Optionally, the above synchronization unit is specifically configured to: determine whether the first virtual object corresponding to each first game object has been created, and determine whether the target virtual object corresponding to the target game object has been created; if the first virtual object corresponding to each first game object has not been created, and the target virtual object corresponding to the target game object has not been created, then determine whether the total number of all virtual objects in all area processes is greater than a preset total threshold; if the total number of all virtual objects in all area processes is greater than the preset total threshold, then add each first virtual object and the target virtual object to a preset synchronization queue, and based on the preset synchronization queue, create, delete, or synchronize data updates for the first virtual objects in the target area process through a first synchronization message, to obtain the latest synchronized first game objects in the target area process, and create, delete, or synchronize data updates for the target virtual objects in each visible area process through a second synchronization message, to obtain the latest synchronized target game objects in the visible area process.
[0075] Optionally, the above response module 70 is specifically configured to: in response to the creation of a target game object in any target area process, obtain the identification information of the target game object, where the target game object is used to indicate a player object or a non-player object; determine the target synchronization process corresponding to the target game object through a preset hash distribution algorithm according to the total number of synchronization processes in the preset synchronization process cluster and the identification information.
[0076] Optionally, the above creation module 72 is specifically configured to: if the target game object is a player object, create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target view query object corresponding to the target game object in each of the remaining synchronization processes; if the target game object is a non-player object, create a target synchronization object corresponding to the target game object in the target synchronization process.
[0077] Optionally, the above calculation module 74 is configured to: if the target game object is a non-player object, receive a synchronization message sent by the target area process in the target synchronization process through the target synchronization object, to obtain the synchronization data corresponding to the target synchronization object; if the target game object is a player object, receive the synchronization message of the target game object and calculate the field of view range in each synchronization process through the target synchronization object and the target view query object, to obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively.
[0078] Optionally, each synchronization object is used to receive the synchronization message of the corresponding game object sent by the process in the corresponding area in real time. The synchronization message includes synchronization data, and the target game object is used to indicate a player object or a non-player object. The above calculation module 74 is further configured to: if the target game object is a player object, receive the synchronization message sent by the target area process in real time through the target synchronization object in the target synchronization process, and obtain the synchronization data corresponding to the target synchronization object; based on the synchronization data corresponding to the target synchronization object and the synchronization data corresponding to the remaining synchronization objects, perform a field of view calculation through the target synchronization object in the target synchronization process to obtain at least one visible object corresponding to the target synchronization object, and perform a field of view calculation through the target field of view query object in each of the remaining synchronization processes to obtain at least one visible object corresponding to each target field of view query object. The visible object is used to indicate the synchronization object corresponding to the remaining game objects in the synchronization process; combine the synchronization data corresponding to the target synchronization object, the at least one visible object corresponding to the target synchronization object, and the at least one visible object corresponding to each target field of view query object to obtain the synchronization data corresponding to the target synchronization object and each target field of view query object respectively.
[0079] Optionally, the above device further includes: a sending notification module, configured to, in response to a change in the high-frequency synchronization data of the target game object, update the high-frequency synchronization data of the target synchronization object, and send a change notification to the remaining synchronization processes, the client corresponding to the target game object, and the target area process; a high-frequency update module, configured to enable the remaining synchronization processes to perform real-time synchronization and update of the high-frequency synchronization data through the change notification, and enable the client corresponding to the target game object to perform real-time synchronization and update of the high-frequency synchronization data through the change notification; a low-frequency update module, configured to enable the target area process to perform real-time synchronization and update of the high-frequency synchronization data according to a preset update frequency through the change notification, and obtain the latest high-frequency synchronization data of the target game object in the target area process.
[0080] This embodiment further provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above data synchronization method. The electronic device can be a server or a terminal device.
[0081] See Figure 8 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above data synchronization method.
[0082] Furthermore, Figure 8The electronic device shown also includes a bus 102 and a communication interface 103. The processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
[0083] Among them, the memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 103 (which can be wired or wireless), a communication connection is realized between this system network element and at least one other network element. The Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The said bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, Figure 8 only a single bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0084] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 100 or by instructions in software form. The above-mentioned processor 100 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 101. The processor 100 reads the information in the memory 101 and combines its hardware to complete the steps of the method in the foregoing embodiments, for example:
[0085] In response to the creation of a target game object in any target area process, determine the target synchronization process corresponding to the target game object. Each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, and any target area process is used to indicate the area process corresponding to any scene area. The target synchronization process is a synchronization process in a preset synchronization process cluster; create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target view query object corresponding to the target game object in each of the remaining synchronization processes. The synchronization objects and view query objects corresponding to the remaining game objects of the target game are distributed in each synchronization process; receive synchronization messages of the target game object and calculate the view range in each synchronization process through the target synchronization object and the target view query object, and obtain the synchronization data corresponding to the target synchronization object and each target view query object; based on the synchronization data corresponding to the target synchronization object and each target view query object, synchronize the game objects in the target area process and the visible area process through the virtual objects in the target area process and the visible area process. The virtual object is used to indicate the visible game objects across scene areas, and the visible area process is used to indicate the area process where the visible game objects are located.
[0086] In this method, the design of the synchronization process cluster shares the view range calculation and data synchronization originally responsible for by the area process. Create a clone of the game object (i.e., the synchronization object) in the synchronization process for view range calculation and data synchronization, which can be used for game object synchronization on the client side. While in the area process, the clone of the game object (i.e., the virtual object) is used for the synchronization of game objects between area processes, so that the computing resources of the area process in these aspects can be released, and the upper limit of game performance can also be improved accordingly.
[0087] In this method, based on the synchronization data corresponding to the target synchronization object and each target view query object, the game objects in the target area process and the visible area process are synchronized through the virtual objects in the target area process and the visible area process, including: respectively determining whether each game object within the field of view of the target game object is in an area process outside the target area process according to the synchronization data corresponding to the target synchronization object and each target view query object; if any game object within the field of view of the target game object is in an area process outside the target area process, determining the area process where each first game object outside the target area process is located as the visible area process, and obtaining at least one visible area process; updating the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object, obtaining the first game object with the latest synchronization in the target area process, and updating the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object, obtaining the target game object with the latest synchronization in the visible area process, where the first virtual object is used to indicate the first game object outside the target area process, and the target virtual object includes the target game object in the visible area process.
[0088] In this method, updating the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object, obtaining the first game object with the latest synchronization in the target area process, and updating the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object, obtaining the target game object with the latest synchronization in the visible area process, including: sending a first synchronization message to the target area process through the synchronization process where the synchronization object corresponding to each first game object is located, and sending a second synchronization message to each visible area process through the target synchronization process, where the first synchronization message is used to indicate the creation, deletion, or synchronization data update of the first virtual object in the target area process, and the second synchronization message is used to indicate the creation, deletion, or synchronization data update of the target virtual object in each visible area process; based on the first synchronization message, creating, deleting, or updating the synchronization data of the first virtual object in the target area process, obtaining the first game object with the latest synchronization in the target area process, and based on the second synchronization message, creating, deleting, or updating the synchronization data of the target virtual object in each visible area process, obtaining the target game object with the latest synchronization in the visible area process.
[0089] In this method, based on the first synchronization message, create, delete, or synchronize data updates for the first virtual object in the target area process to obtain the latest synchronized first game object in the target area process. Based on the second synchronization message, create, delete, or synchronize data updates for the target virtual object in each visible area process to obtain the latest synchronized target game object in the visible area process, including: determining whether the first virtual object corresponding to each first game object has been created, and determining whether the target virtual object corresponding to the target game object has been created; if the first virtual object corresponding to each first game object has not been created, and the target virtual object corresponding to the target game object has not been created, then determine whether the total number of all virtual objects in all area processes is greater than a preset total threshold; if the total number of all virtual objects in all area processes is greater than the preset total threshold, then add each first virtual object and the target virtual object to a preset synchronization queue, and based on the preset synchronization queue, use the first synchronization message to create, delete, or synchronize data updates for the first virtual object in the target area process to obtain the latest synchronized first game object in the target area process, and use the second synchronization message to create, delete, or synchronize data updates for the target virtual object in each visible area process to obtain the latest synchronized target game object in the visible area process.
[0090] In this method, in response to the creation of a target game object in any target area process, determine the target synchronization process corresponding to the target game object, including: in response to the creation of a target game object in any target area process, obtain the identification information of the target game object, where the target game object is used to indicate a player object or a non-player object; according to the total number of synchronization processes in the preset synchronization process cluster and the identification information, determine the target synchronization process corresponding to the target game object through a preset hash distribution algorithm.
[0091] In this method, create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field-of-view query object corresponding to the target game object in each of the remaining synchronization processes, including: if the target game object is a player object, then create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field-of-view query object corresponding to the target game object in each of the remaining synchronization processes; if the target game object is a non-player object, then create a target synchronization object corresponding to the target game object in the target synchronization process.
[0092] In this method, the target game object is used to indicate a player object or a non-player object. In each synchronization process, the target synchronization object and the target field-of-view query object are used to receive synchronization messages of the target game object and calculate the field-of-view range, so as to obtain the synchronization data corresponding to the target synchronization object and each target field-of-view query object, including: if the target game object is a non-player object, the target synchronization object receives the synchronization message sent by the target area process in the target synchronization process to obtain the synchronization data corresponding to the target synchronization object; if the target game object is a player object, the target synchronization object and the target field-of-view query object are used to receive synchronization messages of the target game object and calculate the field-of-view range in each synchronization process, so as to obtain the synchronization data corresponding to the target synchronization object and each target field-of-view query object respectively.
[0093] In this method, each synchronization object is used to receive the synchronization message of the corresponding game object sent by the corresponding area process in real time. The synchronization message includes synchronization data, and the target game object is used to indicate a player object or a non-player object; the target synchronization object and the target field-of-view query object are used to receive synchronization messages of the target game object and calculate the field-of-view range in each synchronization process, so as to obtain the synchronization data corresponding to the target synchronization object and each target field-of-view query object respectively, including: if the target game object is a player object, the target synchronization object receives the synchronization message sent by the target area process in real time in the target synchronization process to obtain the synchronization data corresponding to the target synchronization object; based on the synchronization data corresponding to the target synchronization object and the synchronization data corresponding to the other synchronization objects, the target synchronization object calculates the field-of-view range in the target synchronization process to obtain at least one visible object corresponding to the target synchronization object, and in each of the other synchronization processes, the target field-of-view query object calculates the field-of-view range to obtain at least one visible object corresponding to each target field-of-view query object respectively. The visible object is used to indicate the synchronization object corresponding to the other game objects in the synchronization process; combining the synchronization data corresponding to the target synchronization object, at least one visible object corresponding to the target synchronization object, and at least one visible object corresponding to each target field-of-view query object respectively, the synchronization data corresponding to the target synchronization object and each target field-of-view query object are obtained.
[0094] In this method, the method further includes: in response to the change of the high-frequency synchronization data of the target game object, the target synchronization process updates the high-frequency synchronization data of the target synchronization object, and sends a change notification to the other synchronization processes, the client corresponding to the target game object, and the target area process; the other synchronization processes perform real-time synchronization update of the high-frequency synchronization data through the change notification, and enable the client corresponding to the target game object to perform real-time synchronization update of the high-frequency synchronization data through the change notification; the target area process performs real-time synchronization update of the high-frequency synchronization data through the change notification according to the preset update frequency to obtain the latest high-frequency synchronization data of the target game object in the target area process.
[0095] This embodiment also provides a computer-readable storage medium storing computer-executable instructions, which, when called and executed by a processor, cause the processor to implement the above data synchronization method. For example:
[0096] In response to the creation of a target game object in any target area process, determine a target synchronization process corresponding to the target game object. Each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, and any target area process is used to indicate the area process corresponding to any scene area. The target synchronization process is a synchronization process in a preset synchronization process cluster; create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target view query object corresponding to the target game object in each of the remaining synchronization processes. The synchronization objects and view query objects corresponding to the remaining game objects of the target game are distributed in each synchronization process; receive synchronization messages and calculate the view range of the target game object in each synchronization process through the target synchronization object and the target view query object, and obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively; based on the synchronization data corresponding to the target synchronization object and each target view query object respectively, synchronize the game objects in the target area process and the visible area process through the virtual objects in the target area process and the visible area process. The virtual object is used to indicate the visible game objects across scene areas, and the visible area process is used to indicate the area process where the visible game objects are located.
[0097] In this way, the design of the synchronization process cluster shares the view range calculation and data synchronization originally responsible for by the area process. Create a clone of the game object (i.e., the synchronization object) in the synchronization process for view range calculation and data synchronization, which can be used for game object synchronization on the client side. While in the area process, use the clone of the game object (i.e., the virtual object) for game object synchronization between area processes, so that the computing resources of the area process in these aspects can be released, and the upper limit of game performance can also be improved accordingly.
[0098] In this method, based on the synchronization data corresponding to the target synchronization object and each target view query object, game objects in the target area process and the visible area process are synchronized through virtual objects in the target area process and the visible area process, including: respectively determining whether each game object within the field of view of the target game object is in an area process outside the target area process according to the synchronization data corresponding to the target synchronization object and each target view query object; if any game object within the field of view of the target game object is in an area process outside the target area process, determining the area process where each first game object outside the target area process is located as the visible area process, and obtaining at least one visible area process; updating the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object to obtain the first game object with the latest synchronization in the target area process, and updating the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object to obtain the target game object with the latest synchronization in the visible area process, where the first virtual object is used to indicate the first game object outside the target area process, and the target virtual object includes the target game object in the visible area process.
[0099] In this method, updating the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object to obtain the first game object with the latest synchronization in the target area process, and updating the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object to obtain the target game object with the latest synchronization in the visible area process, including: sending a first synchronization message to the target area process through the synchronization process where the synchronization object corresponding to each first game object is located, and sending a second synchronization message to each visible area process through the target synchronization process, where the first synchronization message is used to indicate the creation, deletion, or synchronization data update of the first virtual object in the target area process, and the second synchronization message is used to indicate the creation, deletion, or synchronization data update of the target virtual object in each visible area process; based on the first synchronization message, creating, deleting, or updating the synchronization data of the first virtual object in the target area process to obtain the first game object with the latest synchronization in the target area process, and based on the second synchronization message, creating, deleting, or updating the synchronization data of the target virtual object in each visible area process to obtain the target game object with the latest synchronization in the visible area process.
[0100] In this method, based on the first synchronization message, create, delete, or synchronize data updates for the first virtual object in the target area process to obtain the latest synchronized first game object in the target area process. Based on the second synchronization message, create, delete, or synchronize data updates for the target virtual object in each visible area process to obtain the latest synchronized target game object in the visible area process, including: determining whether the first virtual object corresponding to each first game object has been created, and determining whether the target virtual object corresponding to the target game object has been created; if the first virtual object corresponding to each first game object has not been created, and the target virtual object corresponding to the target game object has not been created, then determine whether the total number of all virtual objects in all area processes is greater than a preset total threshold; if the total number of all virtual objects in all area processes is greater than the preset total threshold, then add each first virtual object and the target virtual object to a preset synchronization queue, and based on the preset synchronization queue, create, delete, or synchronize data updates for the first virtual object in the target area process through the first synchronization message to obtain the latest synchronized first game object in the target area process, and create, delete, or synchronize data updates for the target virtual object in each visible area process through the second synchronization message to obtain the latest synchronized target game object in the visible area process.
[0101] In this method, in response to the creation of a target game object in any target area process, determine the target synchronization process corresponding to the target game object, including: in response to the creation of a target game object in any target area process, obtain the identification information of the target game object, where the target game object is used to indicate a player object or a non-player object; determine the target synchronization process corresponding to the target game object through a preset hash distribution algorithm according to the total number of synchronization processes in the preset synchronization process cluster and the identification information.
[0102] In this method, create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field-of-view query object corresponding to the target game object in the remaining synchronization processes respectively, including: if the target game object is a player object, create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field-of-view query object corresponding to the target game object in the remaining synchronization processes respectively; if the target game object is a non-player object, create a target synchronization object corresponding to the target game object in the target synchronization process.
[0103] In this method, the target game object is used to indicate a player object or a non-player object. In each synchronization process, the target synchronization object and the target view query object are used to receive synchronization messages of the target game object and calculate the field of view range, so as to obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively, including: if the target game object is a non-player object, the target synchronization object receives the synchronization message sent by the target area process in the target synchronization process to obtain the synchronization data corresponding to the target synchronization object; if the target game object is a player object, the target synchronization object and the target view query object are used to receive synchronization messages of the target game object and calculate the field of view range in each synchronization process, so as to obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively.
[0104] In this method, each synchronization object is used to receive the synchronization message of the corresponding game object sent by the corresponding area process in real time. The synchronization message includes synchronization data, and the target game object is used to indicate a player object or a non-player object; the target synchronization object and the target view query object are used to receive synchronization messages of the target game object and calculate the field of view range in each synchronization process, so as to obtain the synchronization data corresponding to the target synchronization object and each target view query object respectively, including: if the target game object is a player object, the target synchronization object receives the synchronization message sent by the target area process in real time in the target synchronization process to obtain the synchronization data corresponding to the target synchronization object; based on the synchronization data corresponding to the target synchronization object and the synchronization data corresponding to the other synchronization objects, the target synchronization object calculates the field of view range in the target synchronization process to obtain at least one visible object corresponding to the target synchronization object, and in each other synchronization process, the target view query object calculates the field of view range to obtain at least one visible object corresponding to each target view query object respectively. The visible object is used to indicate the synchronization object corresponding to the other game objects in the synchronization process; combining the synchronization data corresponding to the target synchronization object, at least one visible object corresponding to the target synchronization object, and at least one visible object corresponding to each target view query object respectively, the synchronization data corresponding to the target synchronization object and each target view query object is obtained.
[0105] In this method, the method further includes: the target synchronization process responds to the change of the high-frequency synchronization data of the target game object, updates the high-frequency synchronization data of the target synchronization object, and sends a change notice to the other synchronization processes, the client corresponding to the target game object, and the target area process; the other synchronization processes perform real-time synchronization update of the high-frequency synchronization data through the change notice, and enable the client corresponding to the target game object to perform real-time synchronization update of the high-frequency synchronization data through the change notice; the target area process performs real-time synchronization update of the high-frequency synchronization data through the change notice according to the preset update frequency, so as to obtain the latest high-frequency synchronization data of the target game object in the target area process.
[0106] The computer program product of the data synchronization method, device, electronic device and storage medium provided by the embodiments of the present invention includes a computer-readable storage medium storing program codes, and the instructions included in the program codes can be used to execute the methods described in the foregoing method embodiments. For specific implementation, reference can be made to the method embodiments, which will not be elaborated here.
[0107] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.
[0108] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0109] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0110] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0111] Finally, it should be noted that the above embodiments are only specific implementation manners of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A data synchronization method, characterized in that, The method includes: In response to the creation of a target game object in any target area process, determining a target synchronization process corresponding to the target game object, where each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, the any target area process is used to indicate the area process corresponding to any scene area, and the target synchronization process is a synchronization process in a preset synchronization process cluster; Creating a target synchronization object corresponding to the target game object in the target synchronization process, and respectively creating a target view query object corresponding to the target game object in the remaining synchronization processes, and the synchronization objects and view query objects corresponding to the remaining game objects of the target game are distributed in each synchronization process; Receiving synchronization messages and calculating the view range of the target game object in each synchronization process through the target synchronization object and the target view query object, to obtain synchronization data corresponding to the target synchronization object and each target view query object respectively; Based on the synchronization data corresponding to the target synchronization object and each target view query object respectively, synchronizing the game objects in the target area process and the visible area process through virtual objects in the target area process and the visible area process, where the virtual object is used to indicate a visible game object across scene areas, and the visible area process is used to indicate the area process where the visible game object is located.
2. The method according to claim 1, wherein The synchronizing the game objects in the target area process and the visible area process through virtual objects in the target area process and the visible area process based on the synchronization data corresponding to the target synchronization object and each target view query object respectively includes: Respectively judging whether each game object within the view range of the target game object is in an area process outside the target area process according to the synchronization data corresponding to the target synchronization object and each target view query object respectively; If any game object within the view range of the target game object is in an area process outside the target area process, determining the area process where each first game object outside the target area process is located as the visible area process, to obtain at least one visible area process; Updating the synchronization data of the first virtual object in the target area process through the synchronization object corresponding to each first game object, to obtain the first game object with the latest synchronization in the target area process, and updating the synchronization data of the target virtual object in each visible area process through the target synchronization object corresponding to the target game object, to obtain the target game object with the latest synchronization in the visible area process, where the first virtual object is used to indicate the first game object outside the target area process, and the target virtual object includes the target game object in the visible area process.
3. The method according to claim 2, wherein Synchronously updating data of the first virtual object in the target area process through the synchronization object corresponding to each of the first game objects to obtain the first game object with the latest synchronization in the target area process, and synchronously updating data of the target virtual object in each of the visual area processes through the target synchronization object corresponding to the target game object to obtain the target game object with the latest synchronization in the visual area process, including: Sending a first synchronization message to the target area process through the synchronization process where the synchronization object corresponding to each of the first game objects is located, and sending a second synchronization message to each of the visual area processes through the target synchronization process, where the first synchronization message is used to indicate the creation, deletion, or synchronous data update of the first virtual object in the target area process, and the second synchronization message is used to indicate the creation, deletion, or synchronous data update of the target virtual object in each of the visual area processes; Based on the first synchronization message, creating, deleting, or synchronously updating data of the first virtual object in the target area process to obtain the first game object with the latest synchronization in the target area process, and based on the second synchronization message, creating, deleting, or synchronously updating data of the target virtual object in each of the visual area processes to obtain the target game object with the latest synchronization in the visual area process.
4. The method according to claim 3, wherein The creating, deleting, or synchronously updating data of the first virtual object in the target area process based on the first synchronization message to obtain the first game object with the latest synchronization in the target area process, and creating, deleting, or synchronously updating data of the target virtual object in each of the visual area processes based on the second synchronization message to obtain the target game object with the latest synchronization in the visual area process, including: Judging whether the first virtual object corresponding to each of the first game objects has been created, and judging whether the target virtual object corresponding to the target game object has been created; If the first virtual object corresponding to each of the first game objects has not been created and the target virtual object corresponding to the target game object has not been created, then judging whether the total number of all virtual objects in all area processes is greater than a preset total threshold; If the total number of all virtual objects in all area processes is greater than the preset total threshold, then adding each of the first virtual object and the target virtual object to a preset synchronization queue, and based on the preset synchronization queue, creating, deleting, or synchronously updating data of the first virtual object in the target area process through the first synchronization message to obtain the first game object with the latest synchronization in the target area process, and creating, deleting, or synchronously updating data of the target virtual object in each of the visual area processes through the second synchronization message to obtain the target game object with the latest synchronization in the visual area process.
5. The method according to claim 1, wherein Responding to the creation of a target game object in any target area process, determining the target synchronization process corresponding to the target game object, including: In response to the creation of a target game object in any target area process, obtain the identification information of the target game object, where the target game object is used to indicate a player object or a non-player object; According to the total number of synchronization processes in the preset synchronization process cluster and the identification information, determine the target synchronization process corresponding to the target game object through a preset hash distribution algorithm.
6. The method according to claim 1, wherein The creating a target synchronization object corresponding to the target game object in the target synchronization process and respectively creating a target field-of-view query object corresponding to the target game object in the remaining synchronization processes includes: If the target game object is a player object, create a target synchronization object corresponding to the target game object in the target synchronization process and respectively create a target field-of-view query object corresponding to the target game object in the remaining synchronization processes; If the target game object is a non-player object, create a target synchronization object corresponding to the target game object in the target synchronization process.
7. The method according to claim 1, characterized in that, The target game object is used to indicate a player object or a non-player object. The receiving of synchronization messages of the target game object and the calculation of the field-of-view range are performed in each synchronization process through the target synchronization object and the target field-of-view query object to obtain synchronization data respectively corresponding to the target synchronization object and each target field-of-view query object, including: If the target game object is a non-player object, receive the synchronization message sent by the target area process in the target synchronization process through the target synchronization object to obtain the synchronization data corresponding to the target synchronization object; If the target game object is a player object, receive the synchronization message of the target game object and calculate the field-of-view range in each synchronization process through the target synchronization object and the target field-of-view query object to obtain the synchronization data respectively corresponding to the target synchronization object and each target field-of-view query object.
8. The method according to claim 1, characterized in that, Each synchronization object is used to receive the synchronization message of the corresponding game object sent by the corresponding area process in real time, where the synchronization message includes synchronization data, and the target game object is used to indicate a player object or a non-player object; The receiving of synchronization messages of the target game object and the calculation of the field-of-view range are performed in each synchronization process through the target synchronization object and the target field-of-view query object to obtain the synchronization data respectively corresponding to the target synchronization object and each target field-of-view query object, including: If the target game object is a player object, receive the synchronization message sent by the target area process in real time in the target synchronization process through the target synchronization object to obtain the synchronization data corresponding to the target synchronization object; Based on the synchronization data corresponding to the target synchronization object and the synchronization data corresponding to the remaining synchronization objects, perform a field of view calculation in the target synchronization process through the target synchronization object to obtain at least one visible object corresponding to the target synchronization object, and perform a field of view calculation through the target field of view query object in each remaining synchronization process to obtain at least one visible object corresponding to each target field of view query object respectively, where the visible object is used to indicate the synchronization object corresponding to the remaining game objects in the synchronization process; Combine the synchronization data corresponding to the target synchronization object, at least one visible object corresponding to the target synchronization object, and at least one visible object corresponding to each target field of view query object respectively to obtain the synchronization data corresponding to the target synchronization object and each target field of view query object respectively.
9. The method according to claim 1, characterized in that, The method further includes: In response to the change of the high-frequency synchronization data of the target game object, the target synchronization process updates the high-frequency synchronization data of the target synchronization object, and sends a change notification to the remaining synchronization processes, the client corresponding to the target game object, and the target area process; The remaining synchronization processes perform real-time synchronization update of the high-frequency synchronization data through the change notification, and enable the client corresponding to the target game object to perform real-time synchronization update of the high-frequency synchronization data through the change notification; The target area process performs real-time synchronization update of the high-frequency synchronization data through the change notification according to a preset update frequency, and obtains the latest high-frequency synchronization data corresponding to the target game object in the target area process.
10. A data synchronization device, characterized in that, The device includes: A response module, configured to determine the target synchronization process corresponding to the target game object in response to the creation of the target game object in any target area process, where each game scene of the target game includes at least one scene area, one scene area corresponds to one area process, the any target area process is used to indicate the area process corresponding to any scene area, and the target synchronization process is a synchronization process in a preset synchronization process cluster; A creation module, configured to create a target synchronization object corresponding to the target game object in the target synchronization process, and create a target field of view query object corresponding to the target game object in each of the remaining synchronization processes, where the synchronization objects and field of view query objects corresponding to the remaining game objects of the target game are distributed in each synchronization process; A calculation module, configured to perform synchronization message reception and field of view calculation of the target game object in each of the synchronization processes through the target synchronization object and the target field of view query object, to obtain the synchronization data corresponding to the target synchronization object and each target field of view query object respectively, so that the client corresponding to the target game object synchronizes the synchronization data of all game objects within the field of view of the target game object through the synchronization data; A synchronization module, configured to synchronize game objects in the target area process and the visible area process through virtual objects in the target area process and the visible area process based on the target synchronization object and the synchronization data respectively corresponding to each target view query object, where the virtual object is used to indicate a visible game object across a scene area, and the visible area process is used to indicate the area process where the visible game object is located.
11. An electronic device, characterized in that, It includes a processor and a memory, where the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the data synchronization method according to any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the data synchronization method according to any one of claims 1-9.
Citation Information
Patent Citations
Virtual desktop-meta-organization & control system
CN101040249A
Virtual object action control method and device, computer equipment and storage medium
CN109091869A