Distributed game server system, use method, storage medium and equipment

Through the hierarchical architecture design of the distributed game server system, the problem of inefficient resource utilization in traditional game server architecture is solved, dynamic resource allocation and elastic expansion are realized, operation and maintenance processes are simplified, and the performance and availability of game servers are improved.

CN120459622APending Publication Date: 2025-08-12SUZHOU HUANTA NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510725437.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

When the traditional game server architecture faces a surge in users, the resource utilization efficiency is inefficient and cannot be expanded elasticly on demand, resulting in high hardware costs, high operation and maintenance complexity, and complex server/transfer operation, affecting the flexibility and efficiency of game operations.

Method used

The distributed game server system is adopted, and dynamic resource allocation and elastic expansion are realized through the hierarchical architecture design of the gateway layer, service discovery layer, logic layer and data layer. Dynamic resource allocation and elastic expansion are achieved using load balancers and distributed key-value storage to manage dynamic metadata, support intelligent distribution and efficient routing, the logic layer decouples business logic in the form of functional clusters, and the data layer provides unified storage and sharding support.

Benefits of technology

It improves resource utilization, supports flexible capacity expansion on demand, simplifies server/server transfer operations, reduces operation and maintenance complexity, and provides a high-performance, highly available and easy-to-maintenance server solution, suitable for super-large-scale concurrent game scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120459622A_ABST
    Figure CN120459622A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed game server system, a use method, a storage medium and equipment, and the system comprises a gateway layer which is used for selecting a target gateway node in a gateway cluster through a load balancer under the condition of receiving a client request, and transmitting the client request to a service discovery layer through the target gateway node; a distributed key value storage unit of the service discovery layer is used for managing dynamic metadata of each function cluster in the logic layer; the dispatcher cluster is used for dynamically synchronizing the dynamic metadata in the distributed key value storage unit, selecting a target dispatcher node from a plurality of dispatcher nodes, and distributing the client request to a function cluster matched with the client request from a plurality of function clusters through the target dispatcher node based on the dynamic metadata; the logic layer comprises a plurality of function clusters used for processing respective corresponding service functions based on a received client request; and the data layer is used for storing game data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game server technology, and in particular to a distributed game server system and usage method, storage medium, and device. Background Art

[0002] With the rapid development of the online gaming industry, traditional game server architectures are facing unprecedented challenges. While the early adoption of physical server partitioning solutions was able to meet the needs of initial user growth, its static resource allocation mechanism gradually revealed many drawbacks.

[0003] The design of each game server dedicated to a dedicated physical server meant that when faced with a surge in users, the only way to alleviate the pressure was to add new servers. This not only increased hardware costs but also led to inefficient resource utilization. In particular, when popular servers faced an overload of players, they had to implement flow control measures such as login queues to ensure service quality. Meanwhile, unpopular servers saw a decrease in active players, making social gameplay like multiplayer dungeons less appealing. This created a vicious cycle and further exacerbated player churn.

[0004] Furthermore, another major issue with the traditional server-based architecture is the inability to elastically scale capacity based on the actual number of active users. This causes unpopular servers to remain underloaded for extended periods while still maintaining full server resource allocation, resulting in a significant waste of hardware resources. To address these issues, data migration techniques such as server transfers or mergers are often employed, but this introduces new complexities. For example, server mergers require the cross-database migration of millions of player data. Traditional solutions rely on a maintenance shutdown to perform a full data copy, with a single downtime window potentially lasting over eight hours and posing the risk of highly complex operations. Server transfers can also lead to data version compatibility issues, such as abnormal server-wide email sequence numbers and duplicate player names. Manual intervention is required to repair these abnormal data, significantly increasing the difficulty and cost of operations.

[0005] The above-mentioned technical bottlenecks have directly led to a geometric increase in the complexity of operation and maintenance, seriously affecting the flexibility and efficiency of game operations. Summary of the Invention

[0006] In view of this, the embodiments of the present application provide a distributed game server system and usage method, storage medium, and device, which improve resource utilization, support on-demand elastic expansion, and avoid resource waste in traditional distributed server architecture.

[0007] According to one aspect of the present application, a distributed game server system is provided, comprising:

[0008] Gateway layer, service discovery layer, logic layer, data layer;

[0009] The gateway layer is deployed with a gateway cluster and a load balancer, and is used to select a target gateway node in the gateway cluster through the load balancer when receiving a client request, and send the client request to the service discovery layer through the target gateway node;

[0010] The service discovery layer is deployed with a distributor cluster and a distributed key-value storage unit, and the distributor cluster includes multiple distributor nodes;

[0011] The distributed key-value storage unit is used to manage the dynamic metadata of each functional cluster in the logic layer, wherein the dynamic metadata uses the service name of the functional cluster as the key and the metadata of the functional cluster as the value;

[0012] The distributor cluster is configured to dynamically synchronize dynamic metadata in the distributed key-value storage unit, select a target distributor node from a plurality of distributor nodes, and distribute the client request to a functional cluster matching the client request among the plurality of functional clusters through the target distributor node based on the dynamic metadata;

[0013] The logic layer includes multiple functional clusters, each functional cluster is used to process its corresponding business function based on the received client request;

[0014] The data layer is used to store game data and provide data support for business function processing for each functional cluster based on the stored game data.

[0015] According to another aspect of the present application, a method for using a game server system is provided, which is applied to the above-mentioned distributed game server system, comprising:

[0016] When the gateway layer receives a client request, it forwards the client request to the service discovery layer based on the gateway cluster of the gateway layer;

[0017] The service discovery layer distributes the client request to a function cluster in the logic layer that matches the client request based on the distributor cluster of the service discovery layer;

[0018] The functional cluster in the logic layer performs business function processing based on the received client request and with the help of the game data stored in the data layer.

[0019] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method for using the above-mentioned game server system is implemented.

[0020] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the method for using the above-mentioned game server system when executing the program.

[0021] By means of the above technical solution, a distributed game server system and usage method, storage medium, and device provided by the embodiment of the present application realize dynamic resource allocation, elastic expansion, and efficient operation and maintenance through the layered architecture design of the gateway layer, service discovery layer, logic layer, and data layer. The gateway layer uses a load balancer to distribute traffic to the gateway cluster, the service discovery layer ensures efficient routing of requests through dynamic metadata management and intelligent distribution, the logic layer decouples business logic in the form of functional clusters, and the data layer provides unified storage and sharding support. The distributed game server architecture provided by the embodiment of the present application improves resource utilization, supports on-demand elastic expansion, avoids the waste of resources in the traditional server-based architecture, simplifies server merging / transferring operations through dynamic metadata and a unified data layer, and reduces the complexity of operation and maintenance, thereby providing a high-performance, highly available, and easy-to-maintain server solution for ultra-large-scale concurrent game scenarios with modular design and intelligent routing strategies.

[0022] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0024] Figure 1 A schematic diagram of the structure of a distributed game server system provided in an embodiment of the present application is shown;

[0025] Figure 2 A schematic diagram of a process for logging into a game using a distributed game server system provided in an embodiment of the present application is shown;

[0026] Figure 3 A flowchart illustrating a method for using a game server system provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0028] In this embodiment, a distributed game server system is provided. Figure 1 As shown, including:

[0029] Gateway layer 10, service discovery layer 20, logic layer 30, data layer 40;

[0030] The gateway layer 10 is deployed with a gateway cluster 101 and a load balancer 102, and is used to select a target gateway node in the gateway cluster 101 through the load balancer 102 when receiving a client request, and send the client request to the service discovery layer 20 through the target gateway node;

[0031] The service discovery layer 20 is deployed with a distributor cluster 201 and a distributed key-value storage unit 202. The distributor cluster 201 includes multiple distributor nodes 2011.

[0032] The distributed key-value storage unit 202 is used to manage the dynamic metadata of each functional cluster 301 in the logic layer 30, wherein the dynamic metadata uses the service name of the functional cluster as the key and the metadata of the functional cluster as the value;

[0033] The distributor cluster 201 is configured to dynamically synchronize dynamic metadata in the distributed key-value storage unit 202, select a target distributor node from among the plurality of distributor nodes 2011, and distribute the client request to a functional cluster 301 matching the client request among the plurality of functional clusters 301 through the target distributor node based on the dynamic metadata;

[0034] The logic layer 30 includes multiple function clusters 301, each function cluster 301 is used to process its corresponding business function based on the received client request;

[0035] The data layer 40 is used to store game data and provide data support for business function processing for each functional cluster 301 based on the stored game data.

[0036] The distributed game server system provided in the embodiment of the present application realizes dynamic resource allocation, elastic expansion and efficient operation and maintenance through a layered architecture design. The architecture includes: a gateway layer 10, a service discovery layer 20, a logic layer 30, and a data layer 40.

[0037] The gateway layer (Gateway Layer) 10 includes a gateway cluster 101 and a load balancer 102. After receiving a client request, the load balancer 102 dynamically selects the optimal target gateway node from the multiple gateway nodes 1011 contained in the gateway cluster 101 to avoid single point overload. The gateway layer 10 serves as a traffic entrance, isolating external requests from internal services to improve system security. In addition, the gateway cluster 101 can also support horizontal expansion and can dynamically increase or decrease gateway nodes 1011 according to traffic. The service discovery layer (Service Discovery Layer) 20 includes a distributor cluster 201 (for example, a dispatcher cluster, which dynamically synchronizes the service node metadata in ETCD through the Watch mechanism, and performs intelligent load balancing based on the consistent hashing algorithm, accurately delivering requests to the most appropriate backend service node to ensure efficient operation of the system) and a distributed key-value storage unit 202 (for example, an ETCD unit. ETCD serves as the core storage hub for service discovery, adopts a multi-level service registration architecture (Zone / Host / DistrictId) and integrates a dual health check mechanism (TCP active probe + passive status reporting), and fully maintains the dynamic metadata of each service node, covering the node's IP address, port number, service status, etc.). The service discovery layer 20 can realize dynamic metadata management and intelligent distribution. Specifically, it uses the service name as the key and the cluster metadata (such as IP, port, load status) as the value, which is stored in the distributed key-value storage unit 202 (such as etcd / ZooKeeper) to ensure high availability and consistency. After the distributor cluster 201 synchronizes the dynamic metadata, it selects the target distributor node and routes the client request to the matching functional cluster 301. The Logic Layer 30 includes multiple functional clusters 301, each handling specific services (such as combat, social interaction, and transactions). This allows high-load services (such as combat) to be independently scaled out, while low-load services (such as email) can be scaled down, optimizing resource utilization. Failure of a single functional cluster 301 does not affect other services, improving system fault tolerance. The Data Layer 40 centrally stores game data (such as player information and items), supports sharding and read-write separation, provides low-latency data access for the Logic Layer 30, and supports distributed transactions and caching (such as Redis) to improve performance.

[0038] By applying the technical solution of this embodiment, dynamic resource allocation, elastic expansion and efficient operation and maintenance are achieved through the layered architecture design of the gateway layer 10, service discovery layer 20, logic layer 30 and data layer 40. The gateway layer 10 uses the load balancer 102 to distribute traffic to the gateway cluster 101, the service discovery layer 20 ensures efficient request routing through dynamic metadata management and intelligent distribution, the logic layer 30 decouples business logic in the form of functional clusters 301, and the data layer 40 provides unified storage and sharding support. The distributed game server architecture provided by the embodiment of the present application improves resource utilization, supports on-demand elastic expansion, avoids the waste of resources in the traditional server architecture, simplifies the server merging / transferring operations through dynamic metadata and a unified data layer, and reduces the complexity of operation and maintenance, thereby providing a high-performance, highly available and easy-to-maintain server solution for ultra-large-scale concurrent game scenarios with modular design and intelligent routing strategies.

[0039] In an embodiment of the present application, optionally, the load balancer 102 is configured to, upon receiving a client request, select a target gateway node from among the multiple gateway nodes 1011 of the gateway cluster 101 based on a load balancing principle; the gateway cluster 101 is configured to parse the client request through the target gateway node and forward the parsed client request to the service discovery layer 20. The distributor cluster 201 is specifically configured to distribute the parsed client request to a functional cluster 301 that matches the parsed client request among the multiple functional clusters 301 through the target distributor node.

[0040] In this embodiment, gateway layer 10 uses load balancer 102 to dynamically distribute client requests to target gateway nodes in gateway cluster 101 based on load balancing principles. Combined with request parsing capabilities, this ensures even traffic distribution and precise routing to subsequent layers via target distributor nodes in distributor cluster 201 of service discovery layer 20. Distributor cluster 201 uses a consistent hashing algorithm to implement intelligent load balancing, selecting a target distributor node from among the distributor nodes 2011 in distributor cluster 201. This improves resource utilization through load balancing and dynamic routing mechanisms.

[0041] In an embodiment of the present application, optionally, the functional cluster 301 is used to perform business function processing based on the parsed client request, and return the business function processing result to the target distributor node; the target distributor node is also used to determine the next request based on the received business function processing result, and distribute the next request to the functional cluster 301 in the multiple functional clusters 301 of the logical layer that matches the next request.

[0042] In this embodiment, the target distributor node dynamically determines the target functional cluster for subsequent requests based on the processing results returned by the functional cluster 301, forming a cross-cluster business process orchestration. For example, after the battle settlement, the economic system deduction needs to be triggered. The target distributor node can directly route to the transaction cluster without the client re-initiating the request. In this way, the number of network interactions is reduced by replacing client polling with internal routing on the server. The distributor node maintains the request-level context state (such as player ID, session token, intermediate result cache) to ensure the consistency of the state of cross-cluster calls, reduce the overhead of duplicate data verification between functional clusters, and thus help improve the agility of game operations.

[0043] In the embodiment of the present application, optionally, the functional cluster 301 includes a battle cluster, a core service cluster, and a microservice cluster; the core service cluster includes at least one of a player status management cluster, an authentication service cluster, a database proxy service cluster, and a load balancing cluster; the microservice cluster includes at least one of a game log recording cluster, a team management cluster, a social relationship management cluster, a player data cache cluster, and an email push cluster;

[0044] The combat cluster is used to load the game scene, perform physical rule calculations within the game scene, synchronize player entity states, and calculate NPC behavior trees;

[0045] The player state management cluster is used to manage the player state machine;

[0046] The authentication service cluster is used to provide multiple verification services, including identity verification and payment verification;

[0047] The database proxy service cluster is used to interact with the data layer through a data access interface;

[0048] The load balancing cluster is used to monitor the load of the game scenes in real time and allocate server resources through dynamic scheduling and load balancing algorithms to ensure stable performance of each game scene;

[0049] The logging cluster is used to record game log information, including player operation records, game events, and exception information;

[0050] The team management cluster is used to cache and manage team information;

[0051] The social relationship management cluster is used to manage the players' social relationship graphs and interaction behavior data, and provide social interaction functions for players;

[0052] The player data cache cluster is used to store player data of preset common types in the cache of the data layer to realize data retrieval and presentation in the offline state of the character;

[0053] The email push cluster is used to provide server-wide email broadcasting and push.

[0054] In this embodiment, the functional clusters 301 within the logic layer 30 are subdivided into a combat cluster (focused on physics calculations and state synchronization), a core service cluster (player state management, authentication, database proxy), and a microservice cluster (logging, team management, social relationships, caching, and email push). Each cluster's stateless design supports independent scaling. The combat cluster deploys the GameScene cluster and the GameRoom cluster, utilizing the Unreal Engine Dedicated Server architecture to load corresponding game scenes in real time while simultaneously performing physics rule calculations, player entity state synchronization, and NPC behavior tree calculations, providing robust support for the game's combat scenes. The GameScene cluster utilizes the Unreal Engine Dedicated Server architecture, responsible for dynamic loading of open worlds, physics rule calculations, player entity state synchronization, and NPC behavior tree calculations; the GameRoom cluster utilizes the Unreal Engine Dedicated Server architecture, responsible for dynamic loading of scenes within instances, physics rule calculations, player entity state synchronization, and NPC behavior tree calculations. The player state management cluster, PlayerManager, manages the player state machine, which is divided into states such as initialization, login, character creation, casting, queuing, online, local, offline, and disconnected. The authentication service cluster, Charge, is a high-performance token authentication service built on the Gin framework, integrating multiple authentication methods such as account and password, third-party login, and GM login. The database proxy service cluster, GameStore, serves as a database proxy service node, interacting with the data layer 40, providing a unified data access interface and optimizing data read and write operations. The load balancing cluster, Balance, monitors the load of game scenes in real time. Through dynamic scheduling and load balancing algorithms, it rationally allocates server resources to ensure stable performance across all game scenes. The game logging cluster, GameLog, records various in-game log information, including player operation records, game events, and exception information, providing critical data support for game operations and optimization. The team management cluster, Team, caches and manages team data, ensuring the real-time and consistency of team information and facilitating player team formation. The social relationship management cluster, Friend, manages social relationship graphs and interaction behavior data, providing players with social interaction features such as adding friends and chatting. The player data cache cluster, UserCache, hosts core player basic data caching services, storing frequently used player data in the cache, enabling data retrieval and presentation even when users are offline, improving system responsiveness. Mails supports server-wide email broadcasting and precision push. Built on the Go language, it uses a high-concurrency microservices architecture, modularized to form a loosely coupled service system. With a stateless design, each independent service unit is capable of horizontal scalability.In addition, the functional cluster 301 can also include a unique service cluster, which deploys the operation activity management service Activity, the copy matching service MatchMaking, the login queue service LoginQueue, the game management backend service GameBackend, and the global data storage service GlobalData. The Activity service is responsible for managing game operation activities. The MatchMaking service efficiently manages the game copy scene matching, and quickly matches the appropriate copy scene and teammates according to the player's level, equipment, game time and other conditions to improve the player's gaming experience. The LoginQueue service effectively controls the game login traffic. When the server load is too high, the login requests are queued to prevent server overload and ensure that players can log in to the game stably.

[0055] The GameBackend service, serving as the game management backend, provides an intuitive management interface and convenient interfaces, enabling administrators to comprehensively manage the game, such as player information management, game data statistics, and event configuration. The GlobalData service securely stores global data, such as game system switches and server launch times.

[0056] In the embodiment of the present application, optionally, the distributor cluster 201 is specifically configured to distribute the parsed login request to the authentication service cluster in the function cluster 301 through the target distributor node when the parsed client request is a login request;

[0057] The authentication service cluster is specifically configured to verify the account information in the parsed login request, return the account verification result to the target distributor node, and distribute the account verification result to the gateway layer 10 through the target distributor node. Upon receiving a player status management notification sent by the gateway layer 10, the authentication service cluster distributes the player status management notification to the player status management cluster in the function cluster 301.

[0058] The player state management cluster is specifically configured to send a loading character information notification to the target distributor node after receiving the player state management notification, so as to distribute the loading character information notification to the database proxy cluster in the function cluster 301 through the target distributor node;

[0059] The database proxy cluster is specifically configured to load character information from the data layer 40 based on the character information loading notification, and forward the character information to the target distributor node, so as to distribute the character information to the player state management cluster through the target distributor node;

[0060] The player state management cluster is further configured to send a game scene request to the target distributor node based on the character information, so as to distribute the game scene request to the load balancing cluster in the function cluster 301 through the target distributor node;

[0061] The load balancing cluster is specifically configured to return a scene identifier to the target distributor node based on the game scene request, so as to distribute the scene identifier to the player state management cluster through the target distributor node;

[0062] The player state management cluster is further configured to return a player scene entry notification to the target distributor node, so as to distribute the player scene entry notification to the combat cluster in the functional cluster 301 through the target distributor node;

[0063] The battle cluster is specifically used to return the login success information to the target distributor node, so as to send the login success information to the gateway layer 10 through the target distributor node, so that the gateway layer 10 notifies the client of the login success information.

[0064] In this embodiment, a login process implementation method for a distributed game server architecture is provided, such as Figure 2 The specific process is as follows:

[0065] The client sends a login request to the gateway layer 10 , and the load balancer 102 selects a target gateway node, completes protocol parsing, and forwards the request to the service discovery layer 20 .

[0066] The distributor cluster 201 in the service discovery layer 20 identifies the login request type, queries the authentication service cluster address through dynamic metadata, and routes the request to the authentication service cluster. Key-value routing based on the service name can be used to support horizontal expansion of the authentication service cluster and avoid single-point bottlenecks.

[0067] The authentication service cluster in the function cluster 301 verifies the account information in the login request, such as verifying the legitimacy of the account password / Token, and returns the verification result to the target dispatcher node in the service discovery layer 20 .

[0068] The target dispatcher node in service discovery layer 20 distributes the account verification result to gateway layer 10. After confirming that the account verification result is successful, gateway layer 10 sends a player state management notification to the target dispatcher node in service discovery layer 20. The target dispatcher node then distributes the player state management notification to the player state management cluster in function cluster 301, triggering the character information loading process. The state management cluster is decoupled from the authentication cluster, supporting independent scaling and preventing service avalanches caused by login peaks.

[0069] After receiving the player status management notification, the player status management cluster in the functional cluster 301 sends a loading character information notification to the target distributor node in the service discovery layer 20 , thereby distributing the loading character information notification to the database proxy cluster in the functional cluster 301 through the target distributor node.

[0070] The database proxy cluster in the functional cluster 301 asynchronously loads character information (such as level, equipment) from the data layer 40, and sends the character information to the target distributor node in the service discovery layer 20, thereby distributing the character information to the player status management cluster in the functional cluster 301 through the target distributor node.

[0071] After receiving the character information, the player state management cluster in the function cluster 301 may generate a game scene request based on the player's historical behavior data, and distribute the game scene request to the target distributor node of the service discovery layer 20 .

[0072] The target distributor node of the service discovery layer 20 forwards the game scene request to the load balancing cluster in the functional cluster 301, thereby requesting the load balancing cluster to return the optimal scene identifier (such as the low-latency zone server, the server where the friend is located), and then the target distributor node distributes the scene identifier to the player status management cluster in the functional cluster 301.

[0073] The player state management cluster in the functional cluster 301 returns a player entry scene notification to the target distributor node in the service discovery layer 20 according to the scene identifier, and the target distributor node forwards the player entry scene notification to the combat cluster in the functional cluster 301.

[0074] The combat cluster in the functional cluster 301 receives the notification that the player has entered the scene, initializes the game instance (such as matching teammates, loading the map), confirms that the player character has entered the corresponding scene, and returns a login success message to the target distributor node of the service discovery layer 20.

[0075] The target distributor node in the service discovery layer 20 sends a login success message to the gateway layer 10, and the gateway layer 10 notifies the client of the login success message.

[0076] Throughout the game login process, each functional cluster does not retain cross-request state; all context is maintained by the target dispatcher node, enabling rapid failover in the event of any node failure, helping to improve single-node recovery efficiency. The load balancing cluster dynamically adjusts the distribution of scenario instances based on real-time monitoring data (such as CPU usage and network bandwidth), automatically expanding resource pools for popular scenarios and releasing resources for unpopular scenarios, improving hardware utilization and reducing hardware costs.

[0077] In an embodiment of the present application, optionally, the data layer 40 includes a structured data cluster 401 and a cache cluster 402; the structured data cluster 401 adopts a sharded database and table storage architecture, shards the data by player ID hash, and stores the structured data in multiple structured database nodes in a dispersed manner; the cache cluster 402 is deployed in Redis Cluster mode to cache high-frequency data of preset commonly used types.

[0078] In this embodiment, the data layer 40 realizes efficient and reliable data storage and access through the collaborative design of the structured data cluster 401 and the cache cluster 402. The structured data cluster 401 adopts a sharded database and table storage architecture, performs hash sharding calculations based on the player ID, and evenly distributes the data to multiple database shards (structured database nodes). Each shard can be independently deployed as a MySQL master-slave cluster. The cache cluster 402 is deployed in Redis Cluster mode to cache high-frequency data (such as player backpacks and task progress). In addition, an expiration time (such as 1 minute) can be set to form a cache gradient with the database. When the data layer requests data, the player status management cluster will first query the local cache (Caffeine) and return directly if it hits. If the local cache does not hit, the Redis cluster will be queried. If Redis does not hit, the structured data cluster will be queried through the SQL proxy layer, and it can also be asynchronously preheated to Redis. This data layer design builds a high-performance, highly reliable data base through tiered storage, intelligent routing, and consistency assurance mechanisms, improving the efficiency of upper-layer business data access. At the same time, through hot and cold separation and cache gradient design, it achieves cost optimization while ensuring scalability.

[0079] Furthermore, the embodiment of the present application also provides another method for using the game server system, which is applied to the above-mentioned distributed game server system, such as Figure 3 As shown, the method includes:

[0080] S1. When the gateway layer receives a client request, the gateway cluster based on the gateway layer forwards the client request to the service discovery layer;

[0081] S2. The service discovery layer distributes the client request to a function cluster in the logic layer that matches the client request based on the distributor cluster of the service discovery layer;

[0082] S3. The function cluster in the logic layer performs business function processing based on the received client request and with the help of the game data stored in the data layer.

[0083] It should be noted that the method of using a distributed game server system provided in an embodiment of the present application can refer to the corresponding description of the distributed game server system above, and will not be repeated here.

[0084] The embodiment of the present application also provides a computer device, which can be specifically a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.

[0085] Those skilled in the art will understand that the structure of the above-mentioned computer device is only a partial structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components, or combine certain components, or have a different component arrangement.

[0086] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0087] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0088] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0089] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, and the like.

[0090] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0091] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A distributed game server system, characterized in that: include: Gateway layer, service discovery layer, logic layer, data layer; The gateway layer is deployed with a gateway cluster and a load balancer, and is used to select a target gateway node in the gateway cluster through the load balancer when receiving a client request, and send the client request to the service discovery layer through the target gateway node; The service discovery layer is deployed with a distributor cluster and a distributed key-value storage unit, and the distributor cluster includes multiple distributor nodes; The distributed key-value storage unit is used to manage the dynamic metadata of each functional cluster in the logic layer, wherein the dynamic metadata uses the service name of the functional cluster as the key and the metadata of the functional cluster as the value; The distributor cluster is configured to dynamically synchronize dynamic metadata in the distributed key-value storage unit, select a target distributor node from a plurality of distributor nodes, and distribute the client request to a functional cluster matching the client request among the plurality of functional clusters through the target distributor node based on the dynamic metadata; The logic layer includes multiple functional clusters, each functional cluster is used to process its corresponding business function based on the received client request; The data layer is used to store game data and provide data support for business function processing for each functional cluster based on the stored game data.

2. The system according to claim 1, wherein: The load balancer is configured to select a target gateway node from the plurality of gateway nodes in the gateway cluster based on a load balancing principle when receiving a client request; The gateway cluster is configured to parse the client request through the target gateway node and forward the parsed client request to the service discovery layer.

3. The system according to claim 2, characterized in that The distributor cluster is specifically configured to distribute the parsed client request to a functional cluster matching the parsed client request among multiple functional clusters through the target distributor node.

4. The system according to claim 3, characterized in that The function cluster is used to perform business function processing based on the parsed client request and return the business function processing result to the target dispatcher node; The target distributor node is further configured to determine a next request based on the received business function processing result, and distribute the next request to a function cluster matching the next request among the multiple function clusters of the logic layer.

5. The system according to claim 4, characterized in that The functional clusters include a combat cluster, a core service cluster, and a microservice cluster; the core service cluster includes at least one of a player status management cluster, an authentication service cluster, a database proxy service cluster, and a load balancing cluster; the microservice cluster includes at least one of a game log recording cluster, a team management cluster, a social relationship management cluster, a player data cache cluster, and an email push cluster; The combat cluster is used to load the game scene, perform physical rule calculations within the game scene, synchronize player entity states, and calculate NPC behavior trees; The player state management cluster is used to manage the player state machine; The authentication service cluster is used to provide multiple verification services, including identity verification and payment verification; The database proxy service cluster is used to interact with the data layer through a data access interface; The load balancing cluster is used to monitor the load of the game scenes in real time and allocate server resources through dynamic scheduling and load balancing algorithms to ensure stable performance of each game scene; The logging cluster is used to record game log information, including player operation records, game events, and exception information; The team management cluster is used to cache and manage team information; The social relationship management cluster is used to manage the players' social relationship graphs and interaction behavior data, and provide social interaction functions for players; The player data cache cluster is used to store player data of preset common types in the cache of the data layer to realize data retrieval and presentation in the offline state of the character; The email push cluster is used to provide server-wide email broadcasting and push.

6. The system according to claim 4, characterized in that The distributor cluster is specifically configured to distribute the parsed login request to the authentication service cluster in the functional cluster through the target distributor node when the parsed client request is a login request; The authentication service cluster is specifically configured to verify the account information in the parsed login request, return the account verification result to the target distributor node, distribute the account verification result to the gateway layer through the target distributor node, and then, upon receiving a player status management notification sent by the gateway layer, distribute the player status management notification to the player status management cluster in the functional cluster; The player state management cluster is specifically configured to send a loading character information notification to the target distributor node after receiving the player state management notification, so as to distribute the loading character information notification to the database proxy cluster in the functional cluster through the target distributor node; The database proxy cluster is specifically configured to load character information from the data layer based on the character information loading notification, and forward the character information to the target distributor node, so as to distribute the character information to the player state management cluster through the target distributor node; The player state management cluster is further configured to send a game scene request to the target distributor node based on the character information, so as to distribute the game scene request to the load balancing cluster in the functional cluster through the target distributor node; The load balancing cluster is specifically configured to return a scene identifier to the target distributor node based on the game scene request, so as to distribute the scene identifier to the player state management cluster through the target distributor node; The player state management cluster is further configured to return a player scene entry notification to the target distributor node, so as to distribute the player scene entry notification to the combat cluster in the functional cluster via the target distributor node; The battle cluster is specifically used to return the login success information to the target distributor node, so as to send the login success information to the gateway layer through the target distributor node, so that the gateway layer notifies the client of the login success information.

7. The system according to any one of claims 1 to 6, characterized in that The data layer includes a structured data cluster and a cache cluster; the structured data cluster adopts a sharded database and table storage architecture, shards by player ID hash, and stores structured data in multiple structured database nodes in a dispersed manner; the cache cluster is deployed in Redis Cluster mode to cache high-frequency data of preset commonly used types.

8. A method for using a game server system, characterized in that: Applicable to a distributed game server system according to any one of claims 1 to 7, comprising: When the gateway layer receives a client request, it forwards the client request to the service discovery layer based on the gateway cluster of the gateway layer; The service discovery layer distributes the client request to a function cluster in the logic layer that matches the client request based on the distributor cluster of the service discovery layer; The functional cluster in the logic layer performs business function processing based on the received client request and with the help of the game data stored in the data layer.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to claim 8 is implemented.

10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, wherein: When the processor executes the computer program, the method according to claim 8 is implemented.