A game server system
By introducing a decentralized cluster architecture into the MMO game server system and utilizing a communication cluster to implement message communication services, the connection between service processes is decoupled, solving the problems of complex device associations and high dependence on central nodes in existing technologies, and realizing flexible system expansion and efficient communication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-05-18
- Publication Date
- 2026-07-14
AI Technical Summary
In existing MMO game server systems, the relationships between devices are complex, making horizontal scaling difficult. The central node has a high degree of dependency, which can easily lead to status errors and data loss.
It adopts a decentralized architecture consisting of a communication cluster, a login service cluster, a game service cluster, a gateway cluster, and a database. It provides services in a clustered manner, uses the communication cluster to implement message communication services, decouples the connections between service processes, and simplifies them into three types: login process, game process, and gateway process.
It achieves decentralization of the game server system, supports horizontal scaling, simplifies system architecture and operating logic, improves flexibility and reliability, reduces the impact of single points of failure, and improves server communication efficiency.
Smart Images

Figure CN116747511B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a game server system. Background Technology
[0002] Open-world games, also known as free-roaming games, allow players to freely roam a virtual world and choose when and how to complete game tasks. Open-world games offer players a sense of novelty, satisfaction, and accomplishment from independently exploring the game world.
[0003] Open-world games are essentially room-based games, where each player has their own game scene and rarely interacts with other players. From the player's perspective, it's like a single-player game; however, from the game operator's perspective, the game logic runs on a server, just like a typical MMO (Massive Multiplayer Online) game.
[0004] Existing MMO game server systems are managed by a central node (Master), which is highly dependent on the central node. Furthermore, the process of transferring player characters between different game processes or servers with different functions is complex and prone to problems such as status errors. Summary of the Invention
[0005] This application provides a game server system to solve, or at least partially solve, the aforementioned problems. Details are as follows.
[0006] This application provides a game server system, which includes a communication cluster, a login service cluster, a game service cluster, a gateway cluster, and a database. The login service cluster, the game service cluster, and the gateway cluster are respectively connected to the communication cluster. The login service cluster and the game service cluster are respectively connected to the database. The game service cluster is connected to the gateway cluster. The login service cluster and the gateway cluster are respectively connected to a first game client.
[0007] The database is used to store game user data;
[0008] The login service cluster is used to provide game user login services to the first game client, and in the process of providing the game user login services, read or store game user data in the database;
[0009] The game service cluster is used to provide game services to the first game client, and in the process of providing the game services, read or store game user data in the database;
[0010] The gateway cluster is used to provide gateway services between the first game client and the game service cluster;
[0011] The communication cluster is used to provide message communication services between the login service cluster, the game service cluster, and the gateway cluster.
[0012] Compared with the prior art, this application has the following advantages:
[0013] The game server system provided in this embodiment deploys a communication cluster, a login service cluster, a game service cluster, a gateway cluster, and a database. This game server system provides login, game, and gateway services in a clustered manner, achieving decentralization and allowing for free horizontal scaling of each service cluster to meet dynamic operational needs. Furthermore, the game server system provides inter-cluster message communication services to the login, game, and gateway clusters through the communication cluster, thereby decoupling the relationships between service processes. It avoids establishing point-to-point connections between individual service processes; instead, all service processes communicate via message with the communication cluster, achieving simple and efficient server communication. This simplifies the process types in the game server system to three: login processes, game processes, and gateway processes. This simplifies the system architecture and operational logic of the game server system, providing convenience for subsequent development and maintenance. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the architecture of a game server system in the existing technology;
[0015] Figure 2 This is a schematic diagram of the architecture of a game server system provided in an embodiment of this application;
[0016] Figure 3 This is a schematic diagram of a communication cluster architecture provided in an embodiment of this application;
[0017] Figure 4 This is a schematic diagram of the architecture of a login service cluster provided in an embodiment of this application;
[0018] Figure 5 This is a schematic diagram of the architecture of a game service cluster provided in an embodiment of this application;
[0019] Figure 6 This is a schematic diagram of the architecture of a gateway cluster provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.
[0021] The terms “a,” “an,” “the,” and “the” are used in this specification to indicate the presence of one or more elements / components / etc.; the terms “including” and “having” are used to indicate an open-ended inclusion and to mean that there may be other elements / components / etc. in addition to the listed elements / components / etc.; the terms “first” and “second” are used only as markings and are not a limitation on the number of objects.
[0022] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. The character " / " generally indicates that the related objects before and after it are in an "or" relationship. "Contains A, B and / or C" means containing any one, two, or three of A, B, and C.
[0023] It should be understood that in the embodiments of this application, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A, and B can be determined based on A. Determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0024] Before detailing the implementation methods of this application, the relevant technologies will be further introduced first.
[0025] To facilitate understanding of the relevant technologies, the following explanations are provided for the terms involved.
[0026] Gas (Game Server): The game process managed by the game server, including the processes that run the game's combat judgment, character data, etc., and usually runs on the game server in the game room.
[0027] Gac (Game Client): The first game client, which is the process that displays the graphical user interface of the character controlled by the player, and usually runs on the player's terminal device.
[0028] Login: The login process managed by the login server. It is the service process that players connect to first before entering the game, where they can perform operations such as account verification and character creation.
[0029] Gateway: The intermediate process responsible for communication between Gac and Gas.
[0030] Database process (database management process): responsible for storing player data in the database, or reading data from the database and sending it to the Gas process.
[0031] Gms: The process used for sending and receiving GM (Game Master) commands. GM commands in a game are instructions that allow you to perform special actions within the game.
[0032] Master: The central node process that manages the central node.
[0033] URS (User Register Service): Player account management and verification system.
[0034] Figure 1 This is a schematic diagram of the architecture of a game server system in related technologies, such as... Figure 1 As shown, the existing MMO game server system is a system in which a central node (Master) manages the process group.
[0035] The aforementioned game server system has the following defects:
[0036] 1. The relationships between the devices are too complex and involve too many processes, making it difficult to horizontally expand to increase the number of devices. As the number of players increases, horizontal expansion of the game server system becomes necessary.
[0037] 2. It is highly dependent on the central node. Once the central node fails, the entire game server system will be unable to continue providing game services, and may even cause serious problems such as data loss.
[0038] 3. The process of transferring player characters between different game processes or servers with different functions is complex and prone to problems such as status errors.
[0039] To address the aforementioned problems, this application provides a game server system, as described above. Figure 2The diagram illustrates the architecture of a game server system according to an embodiment of this application. The game server system may include a communication cluster 10, a login service cluster 20, a game service cluster 30, a gateway cluster 40, and a database 50.
[0040] In this embodiment, the login service cluster 20, game service cluster 30, and gateway cluster 40 are connected to the communication cluster 10. The login service cluster 20 and game service cluster 30 are connected to the database 50, the game service cluster 30 is connected to the gateway cluster 40, and the login service cluster 20 and gateway cluster 40 are connected to the first game client 60. In this embodiment, the connections between clusters and between a cluster and the first game client include wired and wireless communication connections. Wired communication connections include cable connections, fiber optic connections, etc., while wireless communication connections include electromagnetic wave communication connections, microwave communication connections, satellite communication connections, etc. This embodiment is not intended to limit these connections.
[0041] In an alternative implementation, the game server system can be implemented based on cloud technology.
[0042] The first game client device refers to any game client device. The function of the first game client device is to receive and send data and to present the game screen. For example, the first game client device can be a display device that is close to the user side and has at least data transmission function, such as a desktop computer, laptop computer, game console, smartwatch, tablet computer, mobile phone, television, etc. It can also be other terminal devices. This application embodiment does not specifically limit it.
[0043] In an optional implementation, the first game client device stores a first game client program and is used to display game visuals. The first game client device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the first game client program via an electronic device. The first game client device can provide the GUI to the player in various ways, such as rendering it on the display screen of the first game client device, or providing it to the player via holographic projection. For example, the first game client device may include a display screen for displaying the GUI, which includes game visuals, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0044] In the game server system provided in this application embodiment:
[0045] Database 50 is used to store game user data. This game user data may specifically include many types of data related to the game user, such as the user's friend relationships, virtual items held by the user, and game operation records. This embodiment of the application does not limit this specific data.
[0046] The login service cluster 20 provides game user login services to the first game client 60, and reads or stores game user data in the database during the login process. Before entering the game, game users need to log in to their game accounts, create characters, and select characters; these pre-entry needs can be handled by the login server cluster 20. If new game user data is generated during the processing of login-related needs, it can be stored in the database; if existing game user data needs to be retrieved, it can be read from the database.
[0047] The game service cluster 30 is used to provide game services to the first game client 60, and in the process of providing game services, reads or stores game user data in the database. The game service cluster 30 can be responsible for implementing the main logic of the game, thereby enabling the normal operation of the game for each successfully logged-in first game client 60.
[0048] Gateway cluster 40 provides gateway services between the first game client 60 and the game service cluster. The core of the gateway service provided by gateway cluster 40 is to ensure the connection between the first game client 60 and the game service cluster, i.e., to ensure that game users are online and that the first game client 60 does not need to re-establish a connection when the game service cluster 40 switches game servers. In addition, gateway cluster 40 can also provide other network services, such as filtering illegal messages from the first game client 60.
[0049] Communication cluster 10 is used to provide inter-cluster message communication services to login service cluster 20, game service cluster 30, and gateway cluster 40. Communication cluster 10 can provide a message communication mechanism, enabling inter-process communication between clusters connected to communication cluster 10 through message consumption. In this embodiment, login service cluster 20, game service cluster 30, and gateway cluster 40 are all connected to communication cluster 10; therefore, based on the message communication mechanism provided by communication cluster 10, login service cluster 20, game service cluster 30, and gateway cluster 40 can exchange messages with each other through communication cluster 10.
[0050] In this embodiment, the login service, game service, and gateway service are all supported by a cluster architecture. Within the cluster, each node can independently execute tasks while also sharing tasks and data with other nodes. This distributed computing approach significantly improves computing power and reliability, enabling the cluster to handle large amounts of data and requests. Furthermore, the cluster provides load balancing, fault tolerance, and scalability, resulting in higher availability and scalability for the entire game server system.
[0051] In the game server system provided in this application embodiment, there is no specific central node or centralized control structure. Instead, control and decision-making power in this game server system are distributed among various node devices or members, achieving decentralization of the game server system. In a decentralized game server system, each node can independently execute tasks and make decisions, while also communicating and collaborating with other nodes. This distributed organizational structure can improve the flexibility, scalability, and reliability of the game server system, making it more adaptable to complex and dynamic environmental changes.
[0052] In this embodiment, since the communication cluster 10 provides a communication mechanism between service devices in the game server system without the need for a central node to control and make decisions, the process of the game service system is simplified to include three types: the login process managed by the login service cluster, the game process managed by the game service cluster, and the gateway process managed by the gateway cluster.
[0053] The game server system provided in this embodiment deploys a communication cluster, a login service cluster, a game service cluster, a gateway cluster, and a database. This game server system provides login, game, and gateway services in a clustered manner, achieving decentralization and allowing for free horizontal scaling of each service cluster to meet dynamic operational needs. Furthermore, the game server system provides inter-cluster message communication services to the login, game, and gateway clusters through the communication cluster, thereby decoupling the relationships between service processes. It avoids establishing point-to-point connections between individual service processes; instead, all service processes communicate via message with the communication cluster, achieving simple and efficient server communication. This simplifies the process types in the game server system to three: login processes, game processes, and gateway processes. This simplifies the system architecture and operational logic of the game server system, providing convenience for subsequent development and maintenance.
[0054] Figure 3 This application provides an embodiment of a communication cluster 10, which is illustrated in the following schematic diagram. Figure 3As shown, the communication cluster 10 may include M communication servers, which provide message communication services in a distributed computing manner.
[0055] In one implementation, the message communication mechanism provided by the communication cluster 10 can specifically be a publish-subscribe message communication mechanism. The publish-subscribe pattern involves two main roles: publishers and subscribers. Before introducing the publish-subscribe pattern, let's first introduce an important concept involved in this pattern: topic, also known as a topic of discussion. Different types of messages or messages published by different objects can belong to different topics.
[0056] The workflow of the publish-subscribe model is as follows:
[0057] 1. Publisher publishes message: The publisher sends the message to the topic, also known as a message channel or message queue.
[0058] 2. Subscribers subscribe to topics: Subscribers register to listen to specific topics so that they can receive notifications when publishers publish messages.
[0059] When a publisher posts a message to a topic, all registered subscribers will receive a notification.
[0060] Subscribers receive messages: Subscribers receive messages and process them. The method of processing depends on the specific implementation; for example, the messages may be stored in a database or displayed in a graphical user interface.
[0061] Subscriber unsubscription: If a subscriber no longer wishes to receive notifications from a particular topic, they can unsubscribe.
[0062] Publisher stops publishing: When a publisher stops publishing messages to a topic, all subscribers will no longer receive notifications from that topic.
[0063] In summary, the publish-subscribe messaging mechanism enables loosely coupled message delivery, allowing publishers and subscribers to develop and maintain independently.
[0064] When the communication cluster 10 adopts a publish-subscribe message communication mechanism, each communication server in the communication cluster 10 can manage a portion of the topics, thereby realizing a distributed management approach.
[0065] Based on the above, in one optional implementation, the communication cluster 10 is specifically used to provide message communication services between the clusters based on the publish-subscribe mechanism to the login service cluster 20, the game service cluster 30, and the gateway cluster 40.
[0066] Accordingly, the login service cluster 20 is also used to subscribe to a first topic used by the game service cluster 30 to publish messages in the communication cluster 10, so as to receive and process messages published by the game service cluster 30 in the first topic, and to subscribe to a second topic used by the gateway cluster 40 to publish messages in the communication cluster 10, so as to receive and process messages published by the gateway cluster 40 in the second topic.
[0067] The game service cluster 30 is also used to subscribe to a third topic in the communication cluster 10 where the login service cluster 20 publishes messages, in order to receive and process messages published by the login service cluster 20 in the third topic;
[0068] Gateway cluster 40 is also used to subscribe to a fourth topic in communication cluster 10 where login service cluster 20 publishes messages, in order to receive and process messages published by login service cluster 20 in the fourth topic.
[0069] In the above implementation, the third and fourth topics used by the login service cluster 20 to publish messages can be the same topic or different topics, and can be set according to actual needs. No specific limitation is made here.
[0070] In summary, in this game server system, login service cluster 20 can become a message subscriber of game service cluster 30 and gateway cluster 40, and game service cluster 30 and gateway cluster 40 can become message subscribers of login service cluster 20.
[0071] However, the game service cluster 30 and the gateway cluster 40 can communicate without using communication cluster 10. In an optional implementation, the game service cluster 30 and the gateway cluster 40 can be connected via a long-lived socket connection. This is because, in practical applications, performance considerations exist for communication between the game service cluster 30 and the gateway cluster 40. Exchanging data via communication cluster 10 would result in excessive performance loss. Therefore, establishing a long-lived socket connection between the game service cluster 30 and the gateway cluster 40 and communicating through this connection improves the performance of the gateway service and enhances the user experience.
[0072] Alternatively, in an optional implementation, the login service cluster 20 and the first game client 60 can also be connected via a long socket connection to ensure that game users are online for extended periods and avoid any loss of connection performance.
[0073] like Figure 2As shown, in the above implementation, the communication cluster 10 provides a message subscription and message publishing mechanism for topics, so that the login service cluster 20 and the game service cluster 30 can communicate between the login process and the game process through the message subscription and publishing mechanism, and the login service cluster 20 and the gateway cluster 40 can communicate between the login process and the gateway process through the message subscription and publishing mechanism, without relying on the management and scheduling of the central node, simplifying the operation logic of the entire game server system and realizing efficient communication within the game server system.
[0074] Figure 4 This application provides an embodiment of a login service cluster 20, which is illustrated in the following diagram. Figure 4 As shown, the login service cluster 20 may include P login servers. The P login servers provide game user login services in a distributed computing manner, wherein each login server can manage at least one login process.
[0075] Figure 5 This illustration shows an architectural diagram of a game service cluster 30 provided in an embodiment of this application, such as... Figure 5 As shown, the game service cluster 30 may include L game servers, which provide game services in a distributed computing manner. Each game server can manage at least one game process.
[0076] Figure 6 This illustration shows an architecture diagram of a gateway cluster 40 provided in an embodiment of this application, as follows: Figure 6 As shown, the gateway cluster 40 may include K gateway devices, which provide gateway services in a distributed computing manner. Each gateway device can manage at least one gateway process.
[0077] In this embodiment, due to the flexibility of horizontal scaling in the cluster form, the number of communication servers M in the communication cluster 10, the number of login servers P in the login service cluster 20, the number of game servers L in the game service cluster 30, and the number of gateway devices K in the gateway cluster 40 can be expanded or reduced according to actual needs (such as the number of players).
[0078] It should be noted that, in order to make the description concise and easy to understand in the embodiments of this application, the login server in the login service cluster 20, the game server in the game service cluster 30, and the gateway device in the gateway cluster 40 are sometimes collectively referred to as service devices. It is understood that this description method does not constitute a limitation on this application.
[0079] Accordingly, in this embodiment of the application, the login service cluster 20 can also be used to add at least one login server to the login service cluster 20 when the load of each login process managed by the login service cluster 20 is higher than a first preset value or when a first expansion instruction is received for the login service cluster 20.
[0080] The game service cluster 30 can also be used to add at least one game server to the game service cluster 30 when the load of each game process managed by the game service cluster 30 is higher than the second preset value or when a second expansion instruction is received for the game service cluster 30.
[0081] Gateway cluster 40 can also be used to add at least one gateway device to gateway cluster 40 when the load of each gateway process managed by gateway cluster 40 is higher than a third preset value or when a third expansion instruction is received for gateway cluster 40.
[0082] In one implementation, when the number of players is large and the service devices are under high load for a period of time, the login service cluster 20, game service cluster 30 and gateway cluster 40 can be expanded, that is, horizontally expanded, to add more service devices.
[0083] In another implementation, when the game publisher attracts users through advertising, causing the game server system to face a large number of player registrations, in order to avoid the server equipment being overloaded and making it difficult to guarantee the game experience, the login service cluster 20, game service cluster 30 and gateway cluster 40 can also be expanded by using expansion commands.
[0084] Similarly, the login service cluster 20 can also be used to delete at least one login server from the login service cluster 20 when the load of each login process managed by the login service cluster 20 is lower than the fourth preset value or when a first scaling-down instruction is received for the login service cluster 20.
[0085] The game service cluster 30 can also be used to remove at least one game server from the game service cluster 30 when the load of each game process managed by the game service cluster 30 is lower than the fifth preset value or when a second scaling-down instruction is received for the game service cluster 30.
[0086] Gateway cluster 40 can also be used to remove at least one gateway device from gateway cluster 40 when the load of each gateway process managed by gateway cluster 40 is lower than the sixth preset value or when a third scaling-down instruction is received for gateway cluster 40.
[0087] In one implementation, when the number of players is small and the service equipment is under low load for a period of time, the login service cluster 20, game service cluster 30 and gateway cluster 40 can be expanded, that is, horizontally scaled.
[0088] In another implementation, if certain circumstances arise that cause the game server system to stop providing game services to some players, in order to save hardware resources and reduce the operating costs of the game server system, the login service cluster 20, game service cluster 30, and gateway cluster 40 can be scaled down using a scaling-down command, thereby reducing some service devices.
[0089] The following describes the process of game user login implemented through the game server system provided in the embodiments of this application.
[0090] In this process, the game service cluster 30 is also used to publish the load information of each game process managed by the game service cluster 30 in the first topic;
[0091] The login service cluster 20 is specifically used to handle the login request of the first game client 60. Then, based on the load information of each game process received from the communication cluster 10, the target game process is determined, and a message including the process information of the target game process is published to the third topic in the communication cluster 10.
[0092] The game service cluster 30 is specifically used to receive messages including process information of the target game process from the subscribed third topic, and to provide game services to the first game client 60 through the target game process.
[0093] In this process, gateway cluster 40 is also used to publish load information of each gateway process managed by gateway cluster 40 in the second topic;
[0094] The login service cluster 20 is specifically used to handle the login request of the first game client 60. Then, based on the load information of each gateway process received from the communication cluster 10, the target gateway process is determined, and a message including the process information of the target gateway process is published to the fourth topic in the communication cluster 10.
[0095] Gateway cluster 40 is specifically used to receive messages including process information of the target gateway process from the subscribed fourth topic, and to provide gateway services to the first game client 60 through the target gateway process.
[0096] When a user needs to log in to the game, the login service cluster 20 processes the login request and selects a suitable game process based on the process load in the game service cluster 30. A dedicated message is then published in the third topic, and the corresponding target game process transfers the user's game service. The login service cluster 20 also selects a suitable gateway process based on the process load in the gateway cluster 40 and publishes a dedicated message in the fourth topic, allowing the corresponding target gateway process to transfer the user's gateway service.
[0097] The following describes the process of game user communication implemented through the game server system provided in this application embodiment. This game user communication includes chat and transactions between game users.
[0098] In this process, the gateway cluster 40 can also be used to receive communication requests between the first game client and the second game client, and publish messages including the communication requests to the second topic in the communication cluster 10;
[0099] The game service cluster 30 can also be used to receive messages including the communication request from the subscribed second topic, broadcast the messages including the communication request to each game process managed by the game service cluster 30, process the communication request through the game process corresponding to the second game client, and send the processing result of the game process corresponding to the second game client for the communication request to the gateway cluster 40.
[0100] Gateway cluster 40 can also be used to send processing results to the first game client and the second game client.
[0101] A communication request from one game user to communicate with another is first received by gateway cluster 40. Gateway cluster 40 then publishes the message to the second topic subscribed to by game service cluster 30, which can then process the message. Game service cluster 30 internally broadcasts the message, ensuring each game process receives it and handles the message accordingly. After processing, the corresponding gateway process forwards the result to the game client, which can then use the result for data storage, computation, interface display, and so on.
[0102] The following describes the process of implementing high-load game services through the game server system provided in this application embodiment. High-load game services refer to game services with high process load, including game instances, multiplayer battles, etc. Which game services are designated as high-load game services can be set according to load thresholds or manually set by game development and maintenance personnel. This application embodiment does not limit this.
[0103] In this process, the gateway cluster 40 can also be used to receive game requests from the first game client for a preset high-load game service, and publish a message including the game request to the second topic in the communication cluster 10;
[0104] The game service cluster 30 can also be used to receive messages containing the game request from the subscribed second topic, broadcast the messages containing the game request to each game process managed by the game service cluster 30, and process the game request through the game process with the lowest current load.
[0105] When a game user requires high-load game services, such as entering a game instance, the game request is first received by gateway cluster 40. Gateway cluster 40 then publishes a message to the second topic subscribed to by game service cluster 30. Game service cluster 30 can then process the message. Internally, game service cluster 30 broadcasts the message, which is received by every game process. The game process with the lowest current load then takes over the message, thus providing high-load game services to the user.
[0106] In another embodiment of this application, the communication cluster 10 can also be connected to a third-party device system, thereby enabling the game server system to interact with third-party applications.
[0107] Accordingly, the game service cluster 30 can also be used to subscribe to a fifth topic used by a third-party device system to publish messages in the communication cluster 10, to receive and process messages published by the third-party device system in the fifth topic, and to publish messages in a sixth topic in the communication cluster 10, so that the third-party device system subscribing to the sixth topic can receive and process messages published by the game service cluster 30 in the sixth topic.
[0108] This application does not specifically limit the system architecture and service functions of third-party device systems.
[0109] In this embodiment, since the communication cluster in the game server system provided in this application has inherent cross-platform characteristics, the game server can easily interact with third-party applications to realize various game extension services such as treasure pavilion consignment, multi-device chat, leaderboard, and data center.
[0110] This application provides a clear and concise game server system framework, facilitating subsequent development and maintenance. The decentralized server framework ensures that no single node is relied upon within the Login, Gas, and Gateway clusters, or between these three clusters; any process failure will not affect the overall game service. The game server system provided in this application can achieve load balancing, with each process aware of the complete information of the entire game server system, allowing for easy selection of the process with the lowest load to provide service. This game server system has dynamic scaling capabilities, providing service in real-time at the lowest cost. When the number of players increases, the system scales up the Login, Gas, and Gateway clusters with higher loads; when the number of players decreases, it scales down. The communication cluster providing a message communication mechanism in this game server system naturally possesses cross-platform characteristics, enabling the game server system to easily interact with third-party applications, thereby expanding the game service.
[0111] Corresponding to the devices (or nodes, node devices, service devices) in the game server system provided in the embodiments of this application, the embodiments of this application provide a computer-readable storage medium storing a program containing the execution logic corresponding to the devices in the game server system. This program is run by the corresponding device and can execute the execution logic involved in the above embodiments.
[0112] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0115] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage media, or any other non-transferable media that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include non-transitory computer-readable media, such as modulated data signals and carrier waves.
[0116] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.
Claims
1. A game server system, characterized in that, The game server system includes a communication cluster, a login service cluster, a game service cluster, a gateway cluster, and a database. The login service cluster, the game service cluster, and the gateway cluster are respectively connected to the communication cluster. The login service cluster and the game service cluster are respectively connected to the database. The game service cluster is connected to the gateway cluster. The login service cluster and the gateway cluster are respectively connected to the first game client. The database is used to store game user data; The login service cluster is used to provide game user login services to the first game client, and in the process of providing the game user login services, read or store game user data in the database; The game service cluster is used to provide game services to the first game client, and in the process of providing the game services, read or store game user data in the database; The gateway cluster is used to provide gateway services between the first game client and the game service cluster; The communication cluster is used to provide message communication services between the login service cluster, the game service cluster, and the gateway cluster. The communication cluster is specifically used to provide message communication services between the login service cluster, the game service cluster, and the gateway cluster based on a publish-subscribe mechanism. The login service cluster is also used to subscribe to a first topic used by the game service cluster to publish messages in the communication cluster, so as to receive and process the messages published by the game service cluster in the first topic, and to subscribe to a second topic used by the gateway cluster to publish messages in the communication cluster, so as to receive and process the messages published by the gateway cluster in the second topic. The game service cluster is also used to subscribe to a third topic used by the login service cluster to publish messages in the communication cluster, so as to receive and process the messages published by the login service cluster in the third topic; The gateway cluster is also configured to subscribe to a fourth topic used by the login service cluster to publish messages in the communication cluster, so as to receive and process messages published by the login service cluster in the fourth topic.
2. The game server system according to claim 1, characterized in that, The game service cluster is also used to publish load information of each game process managed by the game service cluster in the first topic; The login service cluster is specifically used to process the login request of the first game client, determine the target game process based on the load information of each game process received from the communication cluster, and publish a message including the process information of the target game process to the third topic in the communication cluster. The game service cluster is specifically used to receive messages including process information of the target game process from the subscribed third topic, and to provide game services to the first game client through the target game process.
3. The game server system according to claim 1, characterized in that, The gateway cluster is also used to publish load information of each gateway process managed by the gateway cluster in the second topic; The login service cluster is specifically used to process the login request of the first game client, determine the target gateway process based on the load information of each gateway process received from the communication cluster, and publish a message including the process information of the target gateway process to the fourth topic in the communication cluster. The gateway cluster is specifically used to receive messages including process information of the target gateway process from the subscribed fourth topic, and to provide gateway services to the first game client through the target gateway process.
4. The game server system according to claim 1, characterized in that, The gateway cluster is also configured to receive communication requests between the first game client and the second game client, and publish a message including the communication request to the second topic in the communication cluster; The game service cluster is further configured to receive a message including the communication request from the subscribed second topic, broadcast the message including the communication request to each game process managed by the game service cluster, process the communication request through the game process corresponding to the second game client, and send the processing result of the game process corresponding to the second game client for the communication request to the gateway cluster. The gateway cluster is also used to send the processing result to the first game client and the second game client.
5. The game server system according to claim 1, characterized in that, The gateway cluster is also configured to receive game requests from the first game client for a preset high-load game service, and publish a message including the game request to the second topic in the communication cluster; The game service cluster is also configured to receive a message including the game request from the subscribed second topic, broadcast the message including the game request to each game process managed by the game service cluster, and process the game request through the game process with the lowest current load.
6. The game server system according to claim 1, characterized in that, The processes of the game service system include: the login process managed by the login service cluster, the game process managed by the game service cluster, and the gateway process managed by the gateway cluster.
7. The game server system according to claim 1, characterized in that, The game service cluster and the gateway cluster are connected via long socket links.
8. The game server system according to claim 1, characterized in that, The login service cluster and the first game client are connected via a long socket connection.
9. The game server system according to claim 1, characterized in that, The communication cluster is also connected to third-party device systems; The game service cluster is also used to subscribe to a fifth topic used by the third-party device system to publish messages in the communication cluster, so as to receive and process messages published by the third-party device system in the fifth topic, and to publish messages in a sixth topic in the communication cluster, so that the third-party device system subscribed to the sixth topic can receive and process messages published by the game service cluster in the sixth topic.
10. The game server system according to claim 1, characterized in that, The login service cluster is also used to add at least one login server to the login service cluster when the load of each login process managed by the login service cluster is higher than a first preset value or when a first expansion instruction is received for the login service cluster. The game service cluster is also used to add at least one game server to the game service cluster when the load of each game process managed by the game service cluster is higher than a second preset value or when a second expansion instruction is received for the game service cluster. The gateway cluster is further configured to add at least one gateway device to the gateway cluster when the load of each gateway process managed by the gateway cluster is higher than a third preset value or when a third expansion instruction is received for the gateway cluster.
11. The game server system according to claim 1, characterized in that, The login service cluster is also used to delete at least one login server from the login service cluster when the load of each login process managed by the login service cluster is lower than a fourth preset value or when a first scaling-down instruction is received for the login service cluster. The game service cluster is also used to delete at least one game server from the game service cluster when the load of each game process managed by the game service cluster is lower than a fifth preset value or when a second scaling-down instruction is received for the game service cluster. The gateway cluster is further configured to remove at least one gateway device from the gateway cluster when the load of each gateway process managed by the gateway cluster is lower than a sixth preset value or when a third scaling-down instruction is received for the gateway cluster.