Data processing method, apparatus and electronic device

By creating room objects on the server and using temporary connections to synchronize home data, the problem of excessive data processing pressure on cross-server nodes was solved, and the stability and performance of the server were improved.

CN115920409BActive Publication Date: 2026-05-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

In the homestead system of massively multiplayer online games, cross-server nodes may crash due to excessive data processing pressure caused by the large amount of data synchronization and transmission requirements.

Method used

Create room objects on the server, synchronize home data through temporary connections, and periodically send modified data to the server cache to reduce the data processing pressure on the server.

Benefits of technology

By establishing temporary connections on the server and periodically caching modified data, the data processing pressure on the server side is reduced, ensuring the stability and performance of the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115920409B_ABST
    Figure CN115920409B_ABST
Patent Text Reader

Abstract

The application provides a data processing method and device and electronic equipment, a room object of a target virtual home is created in a server, if the server receives an access request of a player account for the target virtual home, a temporary connection with a client of the player account is established in the room object of the target virtual home, if modification data of the client for the target virtual home is received through the temporary connection, the modification data is synchronized to the room object of the target virtual home, the modification data is forwarded to other player accounts in the target virtual home by the room object, and the modification data in the room object is sent to the server for caching at regular time. In this way, the players in the virtual home synchronize data through the temporary connection of the room object in the server, the pressure of data processing of the server is reduced, the room object sends the modification of the home data to the server at regular time, the server avoids processing a large amount of data at the same time, and the stability of the server is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The Homestead system is an indispensable part of massively multiplayer online games (MMORPGs), serving as a social system where players can customize their own spaces. Within the Homestead system, the Homestead is essentially the player character's home in the game. Players can decorate their homes to their liking, collect antiques, and acquire special functions through their Homesteads. Therefore, the Homestead system satisfies both players' daily social needs and their desire for creative customization.

[0003] The Homestead System is a cross-server gameplay feature where players within the same Homestead synchronize and transmit data through cross-server nodes. In the Homestead System, after a player applies for a Homestead at a cross-server node, the node generates Homestead data, caches it, and persists it to a database. The cached and database data must remain consistent throughout the process. When a Homestead owner or visitor applies to enter, they request Homestead data from the cross-server node, which retrieves the data from the cache or database and returns it to the player. When a player modifies their Homestead or interacts with it, they send the changes to the cross-server node, which then broadcasts the changes to all players in the Homestead and simultaneously updates its own cache and stores it in the database. Therefore, if the number of players in the Homestead System is large, the amount of data synchronization and transmission will be enormous, increasing the data processing load on the cross-server nodes and potentially causing them to crash. Summary of the Invention

[0004] The purpose of this invention is to provide a data processing method, apparatus, and electronic device to reduce the data processing pressure on cross-server nodes and prevent cross-server node crashes.

[0005] In a first aspect, the present invention provides a data processing method applied to a server, the server being connected to a server-side client and at least one client-side client; the server-side client creates a room object for a target virtual home, and caches home data for the target virtual home; the method includes: receiving an access request for the target virtual home sent by the server-side client, and extracting first player information carried in the access request; wherein the first player information is used to indicate the first client of the first player account requesting access to the target virtual home; based on the first player information, establishing a first temporary connection with the first client in the room object of the target virtual home, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data; if modified data for the target virtual home is received from the first client through the first temporary connection, the modified data is synchronized to the room object of the target virtual home, and the room object forwards the modified data to other player accounts in the target virtual home other than the first player account; wherein the modified data in the room object is periodically sent to the server-side client for caching.

[0006] Secondly, the present invention provides a data processing method applied to a server, which is connected to a server and at least one client. The server is used to create room objects for virtual homes. The server is used to manage object information of the room objects created on the server. The method includes: receiving an access request for a target virtual home from a target client; determining whether the room object for the target virtual home exists based on the saved object information; if it does not exist, sending an object creation instruction for the target virtual home to the server to create the room object for the target virtual home and establishing a temporary connection with the target client in the room object; wherein the server receives modified data for the target virtual home from the target client through the temporary connection, synchronizes the modified data to the room object of the target virtual home, and the room object forwards the modified data to other clients other than the target client corresponding to the target virtual home; if it exists, sending an access request to the server to establish a temporary connection with the target client in the room object of the target virtual home; if modified data is received from the room object, caching the modified data in a preset queue and saving the modified data in the preset queue to a preset database; wherein the room object sends modified data periodically.

[0007] Thirdly, the present invention provides a data processing apparatus, which is disposed on a server, the server being connected to a server-side device and at least one client-side device; the server-side device creates room objects for a target virtual home, and caches home data of the target virtual home in the server-side device; the apparatus includes: a request receiving module, used to receive access requests for the target virtual home sent by the server-side device, and extract first player information carried in the access request; wherein the first player information is used to indicate the first client of the first player account requesting access to the target virtual home; a connection establishment module, used to establish a first temporary connection with the first client in the room object of the target virtual home based on the first player information, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data; a data synchronization module, used to synchronize the modified data to the room object of the target virtual home if modified data for the target virtual home is received from the first client through the first temporary connection, and the room object forwards the modified data to other player accounts in the target virtual home other than the first player account; wherein the modified data in the room object is periodically sent to the server-side device for caching.

[0008] Fourthly, the present invention provides a data processing apparatus, which is disposed on a server and connected to a server and at least one client respectively; the server is used to create room objects for virtual homes; the server is used to manage object information of the room objects created on the server; the apparatus includes: a judgment module, used to receive an access request for a target virtual home sent by a target client, and to determine whether the room object of the target virtual home exists based on the stored object information of the room object; a creation instruction sending module, used to send an object creation instruction for the target virtual home to the server if the room object does not exist, so that the server creates the room object of the target virtual home and establishes an association with the target virtual home in the room object. The system includes: a temporary connection for the client; where the server receives modified data from the target client for the target virtual home through the temporary connection, synchronizes the modified data to the room object of the target virtual home, and the room object forwards the modified data to other clients of the target virtual home besides the target client; an access request sending module, which sends an access request to the server if it exists, so that the server establishes a temporary connection with the target client in the room object of the target virtual home; and a data caching module, which caches the modified data in a preset queue if it receives modified data from the room object, and saves the modified data in the preset queue to a preset database; wherein, the room object sends modified data periodically.

[0009] Fifthly, the present invention provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the above-described data processing method.

[0010] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the above-described data processing method.

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

[0012] This invention provides a data processing method, apparatus, and electronic device. First, when the first player account accesses the target virtual home, a room object for the target virtual home is created on the server. Then, when the server receives an access request for the target virtual home from the server, it extracts the first player information carried in the access request. This first player information indicates the first client containing the first player account requesting access to the target virtual home. Next, based on the first player information, a first temporary connection is established between the first client and the room object of the target virtual home. This allows the first client to obtain home data from the room object through the first temporary connection and render the target virtual home in the first client's graphical user interface based on the home data. If modified data for the target virtual home is received from the first client through the first temporary connection, the modified data is synchronized to the room object of the target virtual home, and the room object forwards the modified data to other player accounts in the target virtual home besides the first player account. The modified data in the room object is periodically sent to the server for caching. In this method, when a player requests to enter the virtual home, a new temporary connection is established in the room object of that virtual home on the server. The player synchronizes the data in the virtual home through this temporary connection, thereby reducing the data processing pressure on the server. Meanwhile, the room object periodically sends the modified home data to the server, avoiding the server from processing a large amount of data at the same time and ensuring the stability of the server.

[0013] Other features and advantages of the invention will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

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

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

[0016] Figure 1 A flowchart of a data processing method provided in an embodiment of the present invention;

[0017] Figure 2 A flowchart of another data processing method provided in an embodiment of the present invention;

[0018] Figure 3 A flowchart of another data processing method provided in an embodiment of the present invention;

[0019] Figure 4 A data processing flowchart of the home system provided in this embodiment of the invention;

[0020] Figure 5 A schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;

[0021] Figure 6 This is a schematic diagram of another data processing device provided in an embodiment of the present invention;

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

[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0024] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0025] With the widespread adoption of mobile smart devices, mobile games have become an increasingly popular form of entertainment. Among these games, the Homestead system is an indispensable part of massively multiplayer online games (MMORPGs), serving as a social system where players can customize their own spaces. The Homestead is essentially a player's in-game home, which they can decorate to their liking, collect antiques, and acquire special functions. Therefore, the Homestead system satisfies both players' daily social needs and their desire for creative customization. Key aspects of the Homestead system include the loading, storage, modification, and synchronization of Homestead data, as well as the synchronization of visitor data.

[0026] Cross-server gameplay requires cross-server nodes for data transmission. Players from different servers interact and transmit data through the same cross-server node. The Homestead system is a cross-server feature where players within the same Homestead synchronize and transmit data via cross-server nodes. This includes synchronizing player location data and modifying furniture placement. Simultaneously, the cross-server node needs to manage the lifecycle of Homestead data and ensure data persistence through a database. The key processes are as follows:

[0027] 1) After a player applies for a homestead at a cross-server node, the node generates homestead data, caches it, and persists it to the database. The cached data and the database must remain consistent throughout the process. Therefore, modifications to the cached data in the cross-server node need to be synchronized to the database. If a large amount of homestead data is modified simultaneously, writing the changes to the cached data to the database may cause server lag. Furthermore, because the cross-server node caches homestead data, when there are many homesteads in the game, the cached data becomes enormous, consuming a significant amount of server memory.

[0028] 2) When a homeowner or visitor applies to enter a home, they need to request home data from the cross-server node. The cross-server node retrieves the home data from the cache or database and returns it to the player so that the player's client can render the virtual home in the game interface through the home data.

[0029] 3) When a player modifies or interacts with their homestead, the changes are sent to the cross-server node. The cross-server node then broadcasts the changes to all players in the homestead, while simultaneously updating its own cache and storing the changes in the database. For example, if four players (A, B, C, and D) are in the same homestead, player A's modifications will be synchronized to the cross-server node via server A, and then broadcast by the cross-server node to players B, C, and D on servers B, C, and D. Players B, C, and D will perform similar actions. If the number of players in the homestead system is large, the amount of data synchronization and transmission will be enormous, significantly increasing the data processing load on the cross-server node and potentially causing it to crash.

[0030] Based on the above problems, this invention provides a data processing method, apparatus, and electronic device. This technology can be applied to scenarios where cross-server nodes need to synchronize and transmit data, particularly in the scenario of data synchronization and transmission within a home system.

[0031] To facilitate understanding of the embodiments of the present invention, a data processing method provided by the embodiments of the present invention will first be described in detail. This method is applied to a server, which is connected to both a server-side application and at least one client-side application. The client-side application can be a mobile phone, tablet computer, or computer, etc. The server-side application creates room objects for the target virtual home, and the server-side application caches home data for the target virtual home. Figure 1 As shown, the method includes the following specific steps:

[0032] Step S102: Receive the access request for the target virtual home sent by the server, and extract the first player information carried in the access request; wherein, the first player information is used to indicate the first client where the first player account applying to access the target virtual home is located.

[0033] In practical applications, the server acts as the cross-server node mentioned above. This node can cache data from multiple virtual homes and retrieve data from a pre-set database, which persistently stores data from multiple virtual homes. The server primarily creates room objects for virtual homes and establishes temporary connections within these room objects for each player client joining the virtual home. This allows player clients to synchronize home data within the room objects via these temporary connections. The home data in the room object corresponding to a specific virtual home is shared data among all players within that virtual home.

[0034] In practical implementation, when a room object for the target virtual home has already been created on the server, when a new player (equivalent to the player corresponding to the first player account mentioned above) applies to join the target virtual home, they will send an access request to the server through the client. At this time, the server will forward the access request to the server, which will receive the access request and extract the first player information carried in the access request. This first player information may include the name and ID of the first player account, as well as the IP address of the first client where the first player account is located. The first player account can be any game account corresponding to any player in the home system.

[0035] Step S104: Based on the first player information, establish a first temporary connection with the first client in the room object of the target virtual home, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data.

[0036] After receiving the access request from the client, the server will establish a first temporary connection with the first client in the room object of the target virtual home, and then wait for the first client to connect. At the same time, it will broadcast the message that a new player (that is, the player corresponding to the first player's account) has entered the target virtual home to all players in the target virtual home.

[0037] After the first client connects to the room object, it can obtain the home data of the target virtual home stored in the room object through the first temporary connection, and render the game screen of the target virtual home in the graphical user interface of the first client based on the obtained home data, so that players can modify or view the home data of the target virtual home in the graphical user interface, and interact with other players in the target virtual home.

[0038] Step S106: If the modified data for the target virtual home is received from the first client through the first temporary connection, the modified data is synchronized to the room object of the target virtual home, and the room object forwards the modified data to other player accounts in the target virtual home except for the first player account; wherein, the modified data in the room object is periodically sent to the server for caching.

[0039] Modifications made by players to the target virtual home in the first client can be synchronized to the room object of the target virtual home via the first temporary connection. The room object can save the modified data and transfer it to other player accounts in the target virtual home except for the first player's account, so that the home data of all players in the target virtual home is consistent.

[0040] In practice, modified data in the room object is sent to the server triggered by a synchronization timer. This means that modified data in the room object needs to be sent to the server periodically, and only the updated parts of the data are synchronized to the server. Upon receiving the updated data, the server writes it to a pre-defined database. Modifications that do not require persistence, such as player actions and locations in the player's home, are sent to the room object via a temporary connection and then broadcast to other players. This eliminates the need to send them to the server, thus reducing the server's data processing load.

[0041] This invention provides a data processing method whereby, when a player applies to enter a virtual home, a new temporary connection is established in the room object of that virtual home on the server. The player synchronizes data in the virtual home through this temporary connection, thereby reducing the data processing pressure on the server. Simultaneously, the room object periodically sends modifications to the home data to the server, avoiding the server processing large amounts of data simultaneously and ensuring server stability.

[0042] This invention also provides another data processing method, which is implemented based on the above method embodiments. This method focuses on describing the specific process of creating a room object for a target virtual home on the server (implemented through steps S202-S204 below), synchronizing modified data to the room object of the target virtual home, and having the room object forward the modified data to other player accounts in the target virtual home except for the first player account; wherein, the specific process of periodically sending modified data in the room object to the server for caching (implemented through steps S214-S216 below) is as follows... Figure 2 As shown, the method includes the following specific steps:

[0043] Step S202: Receive the object creation instruction for the target virtual home sent by the server, and extract the home data and second player information of the target virtual home carried in the object creation instruction; wherein, the second player information is used to indicate the second client where the second player account applying to access the target virtual home is located, and the second player account is the first player account applying to join the target virtual home.

[0044] In the specific implementation, there is a management class for virtual homes on the server side. This management class is used to record and manage the object information of room objects already created on the server. This object information includes, but is not limited to, the address of the room object, the room identifier, and player-related information. The player-related information includes the number of players in the virtual home corresponding to the current room object, the player's account name, etc. Specifically, when a player requests to enter a target virtual home, the management class first checks whether the room object for that target virtual home already exists. For example, if a player sends an access request for a target virtual home to the server through the client, the server receives the access request and searches the management class for object information for a room object of the target virtual home. If it exists, it means that the room object for the target virtual home already exists on the server; if not, it needs to send an object creation command for the target virtual home to the server to create the room object for the target virtual home on the server.

[0045] In practical applications, the above object creation instruction carries the home data of the target virtual home and the second player information of the player who applied to join the target virtual home; wherein, the second player information is used to indicate the second client where the second player account applying to access the target virtual home is located, and the second player account is the first player account that applied to join the target virtual home.

[0046] Step S204: Based on the home data of the target virtual home, create a room object of the target virtual home, and establish a second temporary connection with the second client in the room object according to the second player information, so that the second client can communicate with the room object through the second temporary connection.

[0047] The aforementioned server contains multiple running processes, and each process can create one or more room objects. Based on this, a target process can be determined according to load balancing rules and the load status of multiple running processes. Then, the room object of the target virtual home is created in the target process, and the home data of the target virtual home is used as the shared data of the room objects. Specifically, the server can select the running process with the lowest load as the target process according to load balancing, and create room objects on the selected target process.

[0048] Once the room object of the target virtual home is created, a second temporary connection will be established between the room object and the second client. The corresponding player on the second client will be notified and wait for the second client to connect. After the second client connects, it can obtain the home data of the target virtual home stored in the room object through the second temporary connection. Based on the obtained home data, the game screen of the target virtual home will be rendered in the graphical user interface of the second client, so that players can modify or view the home data of the target virtual home in the graphical user interface, as well as interact with other players in the target virtual home.

[0049] It's important to note that temporary connections between players within the same virtual home reside on the same server and within the same process, managed by the room object. This temporary connection can be understood as a server-side player object on the server. When a player requests to enter a home, the server notifies this room object to create a new temporary connection, wait for the client to connect, and simultaneously store and manage this temporary connection. Subsequent modifications to home data are then forwarded to all temporary connections on the room object.

[0050] Step S206: Establish a synchronization data timer for the room object and return the room information of the room object to the server so that the server can record and manage the room object; wherein, the synchronization data timer is used to control the data in the room object to be sent to the server periodically.

[0051] Once the room object of the target virtual home is created, the room information of the room object will be sent back to the management class on the server side, and a heartbeat and synchronization data timer will be established. The heartbeat here can determine the liveness status of the room object. Usually, the failure of the running process of the room object, the failure of the room object itself, or the connection failure will cause the heartbeat to disappear, causing the room object to become inactive.

[0052] Step S208: If an access request for the target virtual home is received from the server, extract the first player information carried in the access request; the first player information is used to indicate the first client where the first player account applying to access the target virtual home is located.

[0053] The first player account mentioned above can be different from the second player account.

[0054] Step S210: Based on the first player information, establish a first temporary connection with the first client in the room object of the target virtual home, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data.

[0055] Step S212: Through the aforementioned room object, send a message that the first player account has accessed the target virtual home to the temporary connection of other player accounts in the target virtual home, excluding the first player account, so that the client of the other player account can receive the message.

[0056] The target virtual home's room object establishes multiple temporary connections, each corresponding to a player account's client within the target virtual home. In practice, when a new player joins the target virtual home, a temporary connection for that player's client is established within the target virtual home's room object to await client connection, while simultaneously broadcasting a message about the new player's arrival to all players within the room object.

[0057] Step S214: If the modification data for the target virtual home is received from the first client through the first temporary connection, the modification data is synchronized to the room object of the target virtual home, and the modification data is sent to the temporary connections of other player accounts in the target virtual home other than the first player account through the room object, so that the clients of the other player accounts can receive the modification data.

[0058] Step S216: Based on the duration indicated by the synchronization data timer, the home data that needs to be cached in the modified data stored in the room object is sent to the server in real time, so that the server caches the received data in a preset queue and writes the data in the preset queue into a preset database.

[0059] In practical applications, the aforementioned modified data includes player operation data and homestead adjustment data. Homestead adjustment data refers to the modified homestead data that needs to be cached, while player operation data is modified data that does not require caching. Therefore, based on the duration indicated by the synchronization data timer, the homestead adjustment data stored in the room object can be sent to the server in real time. This allows the server to cache the homestead adjustment data in a preset queue and write the data in the preset queue into a preset database. Specifically, when the synchronization data timer in the room object is triggered, only the updated data (i.e., the modified homestead data that needs to be cached) is synchronized back to the server. Upon receiving the updated data, the server caches it in the preset queue and writes it into the database. Data that does not require persistence (i.e., the aforementioned player operation data) is synchronized to the room object via a temporary connection and then broadcast to other players by the room object, without needing to be forwarded to the server, thus reducing the server's data processing load.

[0060] Homestead data is typically very large, so it can be pre-divided into multiple sub-data sets based on functionality, each with a modification flag indicating whether it has been modified. These sub-data sets can include furniture data, parking space data, and display wheel hub data, etc., and can be specifically configured according to development needs. Based on this, the modified sub-data set indicated by the modification flag in the room object can be sent to the server based on the duration of the synchronization timer, and the modification flag of the modified sub-data set can be adjusted back to "unmodified". In this method, the room object only sends the data that needs to be cached; data that does not need to be cached can be synchronized directly by the room object, thus reducing the pressure on server-side data synchronization. Simultaneously, structuring the cached data (i.e., dividing the homestead data into multiple sub-data sets) reduces the amount of data updated and synchronized each time, decreasing the amount of data transmitted to the server and the amount of data read and written to the database.

[0061] Since a room object is created only when a player enters the virtual home, the creation time of the room object can be considered discrete. The synchronization timer in the room object synchronizes the data back to the server at a uniformly distributed time. The timing of the server modifying the data and writing it to the preset database is also discrete. Therefore, the data writing operations to the preset database are distributed over a uniform time, which reduces the amount of data read and written to the database by the server in a single operation and reduces the possibility of database read and write lag.

[0062] In some embodiments, if a message is received from the first client indicating that the first player account has left the target virtual home, the first temporary connection corresponding to the first client is deleted from the target virtual home. This method can reduce the load on the room object.

[0063] In the above data processing method, the temporary connections of players within the same virtual home reside in the same process. Players in the virtual home can synchronize data through these temporary connections without requiring remote server calls, thus significantly reducing the amount of data synchronized by the server. Simultaneously, the room object periodically synchronizes modified data from the virtual home back to the server. Interactions and modifications from other homes, as well as player location and operation data, are synchronized to other players via temporary connections, eliminating the need for server-side forwarding and reducing server load.

[0064] This invention also provides another data processing method, which is applied to a server connected to both a physical server and at least one client; the server is used to create virtual home room objects; the server is used to manage object information of the room objects created on the server; such as... Figure 3 As shown, the method includes the following specific steps:

[0065] Step S304: Receive the access request for the target virtual home sent by the target client. Based on the saved room object information, determine whether the room object of the target virtual home exists. If it does not exist, proceed to step S306. If it exists, proceed to step S308.

[0066] The server contains a management class for virtual home rooms. This class records and manages the object information of room objects already created on the server. Specifically, if the management class does not contain object information for the target virtual home room object, it means that the target virtual home room object does not exist.

[0067] Step S306: Send an object creation instruction for the target virtual home to the server, so that the server creates a room object for the target virtual home and establishes a temporary connection with the target client in the room object; wherein, the server receives the modification data of the target virtual home from the target client through the temporary connection, synchronizes the modification data to the room object of the target virtual home, and the room object forwards the modification data to other clients of the target virtual home besides the target client; execute step S310.

[0068] In the specific implementation, if the room object of the target virtual home does not exist, the server needs to retrieve the home data of the target virtual home from the preset database; then, based on the home data and the player information carried in the access request, it generates an object creation instruction for the target virtual home; the object creation instruction is sent to the server so that the server creates the room object of the target virtual home, and uses the home data as the shared data of the room. At the same time, the object information of the room object is called back to the management class, and a heartbeat and synchronization data timer is established. Then, a temporary connection with the target client is established in the room object, the player is notified and the server waits for the target client to connect. After the target client connects, it retrieves the home data in the room object and loads and renders it.

[0069] Step S308: Send an access request to the server so that the server establishes a temporary connection with the target client in the room object of the target virtual home; proceed to step S310.

[0070] If a room object already exists for the target, the player information is sent directly to the room object via an access request. The room object then creates a temporary connection locally to wait for the target client to connect, while simultaneously broadcasting a message that a new player has entered to all players in the room object.

[0071] Step S310: If modified data is received from the room object, the modified data is cached in a preset queue, and the modified data in the preset queue is saved to a preset database; wherein, the room object sends modified data periodically.

[0072] In a practical implementation, step S310 above can be achieved through the following steps 10-12:

[0073] Step 10: Determine if the data in the preset queue is full; if yes, proceed to step 11; otherwise, proceed to step 12.

[0074] Step 11: Delete the data that was stored first or used least in the preset queue, and cache the modified data in the preset queue.

[0075] Step 12: Cache the modified data in a preset queue.

[0076] This application's server-side uses lazy loading and least recently used caching mechanisms to ensure the maximum number of cached items in the preset queue, thus preventing excessive server memory usage. Initially, the server has no cached data. Whenever a player requests to enter a virtual home, the server reads the corresponding home data from the preset database and adds it to the preset queue before processing the player's request. If the cache is full, the oldest cached data is unloaded and new data is loaded according to the least recently used caching mechanism, achieving on-demand loading and unloading of home data.

[0077] To facilitate understanding of the embodiments of the present invention, Figure 4 A data processing flowchart for the home system is provided. Figure 4 The system includes two player clients, client1 and client2. Client1 is located on login server A, and client2 is located on login server B. The player corresponding to client1 is the first player to apply to enter the virtual home JY001. First, client1 sends a request to the home function node (equivalent to the server mentioned above) in the function server to enter home JY001. After receiving the request, the home function node reads the home data of home JY001 from the database and caches it in the home cache data. Then, it sends the player information and the home data of JY001 to the synchronization data server (equivalent to the server mentioned above). This allows the synchronization data server to create a temporary home room (equivalent to the room object mentioned above) on an appropriate process based on load balancing, and uses the home data as shared data for the room. Then, the temporary room creates a temporary connection locally, notifies client1, and waits for client1 to connect. After connecting, client1 obtains the home data in the room and loads and renders it. Client1 can also modify, interact with, and synchronize location data of the home through the temporary connection. Then, the temporary room in the homestead will periodically synchronize the modified data to the cross-server function node (equivalent to the homestead function node). After caching the modified data, the cross-server function node will synchronize and save the modified data to the database.

[0078] In this invention, players in the virtual home system synchronize data via temporary connections, significantly reducing the amount of data on the server. Because the temporary connections of players within the same home system reside in the same process, remote server-side calls are unnecessary. Only the following two types of data require server-side synchronization:

[0079] 1. When a player applies to enter a homestead for the first time, the homestead server will send the homestead data to the temporarily created room object across servers;

[0080] 2. The room object then periodically synchronizes the modified data of the homestead back to the server. Other homestead interaction and modification data, as well as player location and operation data, are synchronized through a temporary connection, without going through the server, greatly reducing the server load.

[0081] The above data processing method establishes a new temporary connection in the virtual home's room object on the server when a player applies to enter. The player then synchronizes data within the virtual home through this temporary connection, reducing the server's data processing load. Simultaneously, the room object periodically sends changes to the home's data to the server, preventing the server from processing large amounts of data simultaneously and ensuring server stability.

[0082] In accordance with the above-described method embodiments, this invention also provides a data processing apparatus, which is disposed on a server, and the server is connected to a client and at least one client respectively; the server creates room objects for the target virtual home, and the client caches home data for the target virtual home; such as Figure 5 As shown, the device includes:

[0083] The request receiving module 50 is used to receive the access request for the target virtual home sent by the server and extract the first player information carried in the access request; wherein, the first player information is used to indicate the first client where the first player account applying to access the target virtual home is located.

[0084] The connection establishment module 51 is used to establish a first temporary connection with the first client in the room object of the target virtual home based on the first player information, so that the first client can obtain home data in the room object through the first temporary connection and render the target virtual home in the graphical user interface of the first client based on the home data.

[0085] The data synchronization module 52 is used to synchronize the modified data to the room object of the target virtual home if it receives the modified data for the target virtual home from the first client through the first temporary connection, and the room object forwards the modified data to other player accounts in the target virtual home except for the first player account; wherein, the modified data in the room object is periodically sent to the server for caching.

[0086] The aforementioned data processing device establishes a new temporary connection to the room object of that virtual home on the server when a player applies to enter. The player synchronizes data within the virtual home through this temporary connection, thus reducing the data processing load on the server. Simultaneously, the room object periodically sends changes to the home data to the server, preventing the server from processing large amounts of data simultaneously and ensuring server stability.

[0087] In a specific implementation, the above-mentioned device further includes an object creation module, used to: receive an object creation instruction for a target virtual home sent by the server, extract the home data and second player information of the target virtual home carried in the object creation instruction; wherein, the second player information is used to indicate the second client where the second player account applying to access the target virtual home is located; based on the home data of the target virtual home, create a room object of the target virtual home, and establish a second temporary connection with the second client in the room object according to the second player information, so that the second client can communicate with the room object through the second temporary connection.

[0088] In practical applications, the server mentioned above contains multiple running processes; the object creation module is also used to: determine the target process based on load balancing rules and the load status of multiple running processes; create a room object of the target virtual home in the target process, and use the home data of the target virtual home as the shared data of the room object.

[0089] Furthermore, the aforementioned device also includes an information processing module, used to: after creating a room object of the target virtual home based on the home data of the target virtual home, establish a synchronization data timer for the room object, and return the room information of the room object to the server so that the server can record and manage the room object; wherein, the synchronization data timer is used to control the data in the room object to be sent to the server periodically; the room information includes the address of the room object, the room identifier, and player-related information.

[0090] In a specific implementation, multiple temporary connections are established in the room object of the target virtual home, and each temporary connection corresponds to a client of a player account in the target virtual home; the device also includes a message sending module, used to: after establishing a first temporary connection with the first client in the room object of the target virtual home based on the first player information, send a message that the first player account has accessed the target virtual home to the temporary connections of other player accounts in the target virtual home other than the first player account through the room object, so that the clients of other player accounts can receive the message.

[0091] Furthermore, the aforementioned data synchronization module 52 is also used to: send modified data to temporary connections of player accounts other than the first player account in the target virtual home through the room object, so that the client where the other player account is located receives the modified data.

[0092] In specific implementation, the aforementioned modified data includes player operation data and home adjustment data; among which, home adjustment data is modified home data that needs to be cached; player operation data is modified data that does not need to be cached; the aforementioned data synchronization module 52 is also used to: based on the duration indicated by the preset synchronization data timer, send the home adjustment data stored in the room object to the server in real time, so that the server caches the home adjustment data in a preset queue and writes the home adjustment data in the preset queue into a preset database.

[0093] Furthermore, the aforementioned home data is divided into multiple sub-data according to function, and each sub-data is set with a modification flag bit; the modification flag bit is used to indicate whether the sub-data has been modified; the aforementioned data synchronization module 52 is also used to: based on the duration indicated by the synchronization data timer, send the modified sub-data indicated by the modification flag bit in the room object to the server, and adjust the modification flag bit of the modified sub-data to be unmodified.

[0094] In a specific implementation, the above device also includes a connection deletion module, used to: if a message is received from the first client that the first player account has left the target virtual home, delete the first temporary connection corresponding to the first client in the target virtual home.

[0095] The data processing apparatus provided in this embodiment of the invention has the same implementation principle and technical effects as the method embodiment described above. For the sake of brevity, any parts not mentioned in the apparatus embodiment can be referred to the corresponding content in the foregoing method embodiment.

[0096] In accordance with the above-described method embodiments, this invention also provides another data processing apparatus, which is located on a server and connected to both a server and at least one client. The server is used to create room objects for virtual homes; the server is used to manage the object information of the room objects created on the server. Figure 6 As shown, the device includes:

[0097] The judgment module 60 is used to receive the access request for the target virtual home sent by the target client, and determine whether the room object of the target virtual home exists based on the saved room object information.

[0098] The creation instruction sending module 61 is used to send an object creation instruction for the target virtual home to the server if the target virtual home does not exist, so that the server creates a room object for the target virtual home and establishes a temporary connection with the target client in the room object; wherein, the server receives the modification data of the target virtual home from the target client through the temporary connection, synchronizes the modification data to the room object of the target virtual home, and the room object forwards the modification data to other clients of the target virtual home other than the target client.

[0099] Access request sending module 62 is used to send an access request to the server if it exists, so that the server can establish a temporary connection with the target client in the room object of the target virtual home.

[0100] The data caching module 63 is used to cache the modified data in a preset queue and save the modified data in the preset queue to a preset database if modified data is received from the room object; wherein, the room object sends modified data periodically.

[0101] In the aforementioned data processing device, when a player applies to enter a virtual home, a new temporary connection is established in the room object of that virtual home on the server. The player synchronizes the data in the virtual home through this temporary connection, thereby reducing the data processing pressure on the server. At the same time, the room object periodically sends the modified home data to the server, avoiding the server from processing a large amount of data at the same time and ensuring server stability.

[0102] Furthermore, the aforementioned access request sending module 62 is used to: if the target virtual home does not exist, retrieve the home data of the target virtual home from a preset database; generate an object creation instruction for the target virtual home based on the home data and the player information carried in the access request; and send the object creation instruction to the server so that the server creates a room object for the target virtual home and establishes a temporary connection with the target client in the room object.

[0103] In a specific implementation, the aforementioned data caching module 63 is used to: determine whether the data in the preset queue is full; if it is full, delete the data that was stored first or used least in the preset queue and cache the modified data in the preset queue; if it is not full, cache the modified data in the preset queue.

[0104] The data processing apparatus provided in this embodiment of the invention has the same implementation principle and technical effects as the method embodiment described above. For the sake of brevity, any parts not mentioned in the apparatus embodiment can be referred to the corresponding content in the foregoing method embodiment.

[0105] This invention also provides an electronic device, such as... Figure 7 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the data processing method described above.

[0106] Furthermore, Figure 7 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.

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

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

[0109] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned data processing method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

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

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

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

Claims

1. A data processing method, characterized in that, The method is applied to a synchronization server, which is connected to both a server-side application and at least one client; the server has created room objects for the target virtual home, and the server-side application caches the home data of the target virtual home; the method includes: The server receives an access request for the target virtual home and extracts the first player information carried in the access request; wherein the first player information is used to indicate the first client where the first player account requesting access to the target virtual home is located. Based on the first player information, a first temporary connection is established between the first client and the room object of the target virtual home, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data; If the modified data for the target virtual home is received from the first client through the first temporary connection, the modified data is synchronized to the room object of the target virtual home, and the room object forwards the modified data to other player accounts in the target virtual home besides the first player account; wherein, the modified data in the room object is periodically sent to the server for caching; The modified data includes player operation data and homestead adjustment data; wherein, the homestead adjustment data is modified homestead data that needs to be cached; the player operation data is modified data that does not need to be cached; the step of periodically sending the modified data in the room object to the server for caching includes: based on the duration indicated by a preset synchronization data timer, sending the homestead adjustment data stored in the room object to the server in real time, so that the server caches the homestead adjustment data in a preset queue and writes the homestead adjustment data in the preset queue into a preset database.

2. The method according to claim 1, characterized in that, The room object of the target virtual home is created in the following way: The system receives an object creation instruction for the target virtual home sent by the server, and extracts the home data and second player information of the target virtual home carried in the object creation instruction; wherein, the second player information is used to indicate the second client where the second player account applying to access the target virtual home is located; Based on the home data of the target virtual home, a room object of the target virtual home is created, and a second temporary connection with the second client is established in the room object according to the second player information, so that the second client can communicate with the room object through the second temporary connection.

3. The method according to claim 2, characterized in that, The server contains multiple running processes; the step of creating a room object for the target virtual home based on the home data of the target virtual home includes: Based on the load balancing rules and the load status of the multiple running processes, the target process is determined; In the target process, a room object of the target virtual home is created, and the home data of the target virtual home is used as the shared data of the room object.

4. The method according to claim 2, characterized in that, After the step of creating a room object of the target virtual home based on the home data of the target virtual home, the method further includes: A synchronization data timer is established for the room object, and the room information of the room object is returned to the server so that the server can record and manage the room object; wherein, the synchronization data timer is used to control the data in the room object to be sent to the server periodically; the room information includes the address of the room object, the room identifier, and player-related information.

5. The method according to claim 1, characterized in that, The room object of the target virtual home has multiple temporary connections established, and each temporary connection corresponds to a client of a player account in the target virtual home. After the step of establishing a first temporary connection with the first client in the room object of the target virtual home based on the first player information, the method further includes: Through the room object, a message is sent to the temporary connection of other player accounts in the target virtual home besides the first player account, indicating that the first player account has accessed the target virtual home, so that the client of the other player account receives the message.

6. The method according to claim 5, characterized in that, The step of forwarding the modified data from the room object to other player accounts in the target virtual home besides the first player account includes: The modified data is sent via the room object to temporary connections of other player accounts in the target virtual home, excluding the first player account, so that the client of the other player account receives the modified data.

7. The method according to claim 1, characterized in that, The home data is divided into multiple sub-data according to function, and each sub-data is set with a modification flag bit; the modification flag bit is used to indicate whether the sub-data has been modified. The step of sending the home adjustment data stored in the room object to the server in real time based on the duration indicated by a preset synchronization data timer includes: Based on the duration indicated by the synchronization data timer, the modified sub-data indicated by the modification flag in the room object is sent to the server, and the modification flag of the modified sub-data is adjusted to be unmodified.

8. The method according to claim 1, characterized in that, The method further includes: If a message is received from the first client indicating that the first player's account has left the target virtual home, the first temporary connection corresponding to the first client is deleted from the target virtual home.

9. A data processing method, characterized in that, The method is applied to a server, which is connected to a server and at least one client. The server is used to create room objects for the virtual home. The server is used to manage object information of room objects created in the server; the method includes: Receive an access request for the target virtual home sent by the target client, and determine whether the room object of the target virtual home exists based on the saved object information of the room object; If the target virtual home does not exist, an object creation instruction is sent to the server to create a room object for the target virtual home and establish a temporary connection with the target client in the room object. The server receives modification data of the target virtual home from the target client through the temporary connection, synchronizes the modification data to the room object of the target virtual home, and the room object forwards the modification data to other clients of the target virtual home besides the target client. If it exists, the access request is sent to the server so that the server establishes a temporary connection with the target client in the room object of the target virtual home. If modified data is received from the room object, the modified data is cached in a preset queue, and the modified data in the preset queue is saved to a preset database; wherein, the room object sends the modified data periodically.

10. The method according to claim 9, characterized in that, If the target virtual home does not exist, the step of sending an object creation instruction to the server to create a room object for the target virtual home and establishing a temporary connection with the target client in the room object includes: If it does not exist, retrieve the home data of the target virtual home from the preset database; Based on the home data and the player information carried in the access request, an object creation instruction is generated for the target virtual home. The object creation instruction is sent to the server so that the server creates a room object for the target virtual home and establishes a temporary connection with the target client in the room object.

11. The method according to claim 9, characterized in that, The step of receiving modified data from the room object and caching the modified data to a preset queue includes: Determine whether the preset queue is full; If the queue is full, delete the earliest stored or least used data in the preset queue, and cache the modified data in the preset queue. If the queue is not full, the modified data is cached in the preset queue.

12. A data processing apparatus, characterized in that, The device is installed on a server, which is connected to both a server-side application and at least one client. The server contains room objects representing the target virtual home, and the server-side application caches the home data of the target virtual home. The device includes: The request receiving module is used to receive the access request for the target virtual home sent by the server, and extract the first player information carried in the access request; wherein, the first player information is used to indicate the first client where the first player account applying to access the target virtual home is located; The connection establishment module is used to establish a first temporary connection with the first client in the room object of the target virtual home based on the first player information, so that the first client can obtain home data in the room object through the first temporary connection, and render the target virtual home in the graphical user interface of the first client based on the home data; The data synchronization module is used to synchronize the modified data to the room object of the target virtual home if it receives the modified data for the target virtual home from the first client through the first temporary connection, and the room object forwards the modified data to other player accounts in the target virtual home other than the first player account; wherein the modified data in the room object is periodically sent to the server for caching; The modified data includes player operation data and homestead adjustment data; wherein, the homestead adjustment data is modified homestead data that needs to be cached; the player operation data is modified data that does not need to be cached; the data synchronization module is used to: based on the duration indicated by a preset synchronization data timer, send the homestead adjustment data stored in the room object to the server in real time, so that the server caches the homestead adjustment data in a preset queue and writes the homestead adjustment data in the preset queue into a preset database.

13. A data processing apparatus, characterized in that, The device is located on the server side, and the server side is connected to a server and at least one client respectively; The server is used to create room objects for the virtual home. The server is used to manage object information of room objects created in the server; the device includes: The judgment module is used to receive the access request for the target virtual home sent by the target client, and determine whether the room object of the target virtual home exists based on the saved object information of the room object; A creation instruction sending module is configured to send an object creation instruction for the target virtual home to the server if the target virtual home does not exist, so that the server creates a room object for the target virtual home and establishes a temporary connection with the target client in the room object; wherein, the server receives modification data of the target virtual home from the target client through the temporary connection, synchronizes the modification data to the room object of the target virtual home, and the room object forwards the modification data to other clients of the target virtual home besides the target client; An access request sending module is used to send the access request to the server if it exists, so that the server establishes a temporary connection with the target client in the room object of the target virtual home. The data caching module is used to cache the modified data in a preset queue and save the modified data in the preset queue to a preset database if modified data is received from the room object; wherein the room object sends the modified data periodically.

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

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