Group data processing method, device, system and server
By adopting a distributed group service cluster in the game server, the scalability and availability of traditional single -point group service centers are solved, high availability and high scalability are achieved, and the player's experience is improved.
Patent Information
- Application Number
- CN202210520715.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-05-12
AI Technical Summary
Traditional game servers use single-point group service centers, resulting in limited service carrying capacity and difficulty in scaling. Single-point failure will cause the entire group service to be unavailable, seriously affecting the player's experience.
A distributed group service cluster, including group center nodes, group sharding nodes, group segmentation nodes, and group nodes. The collaborative work of these nodes can be managed and handled in group data to ensure high availability and high scalability.
The high availability and high scalability services of group organizations are realized, which can effectively handle the user's operating request message, improve the player's experience, and avoid the impact of a single point failure.
Smart Images

Figure CN114949847B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the Internet, and in particular to a method, device, system and server for processing group data. Background Art
[0002] Online games are generally equipped with corresponding game servers to provide services for users or players. For some online games that allow group combat, the game server often provides a group function to allow like-minded users to gather in a group and collaborate together.
[0003] Usually, in order to uniformly manage the team data of different teams, traditional game servers generally manage the group data of the game on a single server process. Therefore, traditional game servers are also called group service centers. However, this group service center is usually a single-point service. The service carrying capacity has a single-point upper limit and is difficult to expand. Moreover, when a single-point service fails, the group service of the entire game server will be unavailable, seriously affecting the player experience. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, system and server for processing group data to alleviate the above technical problems.
[0005] In a first aspect, an embodiment of the present invention provides a method for processing group data, which is applied to a server, wherein the server is configured with a distributed group service cluster, wherein the distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein after the group shard node, the group line node and the group node are started, they are all connected to the group center node network; wherein the group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; The body branch node is used to be responsible for the loading operation of the group node; the group node runs on one of the group branch nodes; the method includes: receiving an operation request message, wherein the operation request message carries the identifier of the target group for which the operation is requested; locating the corresponding group shard node according to the identifier of the target group, and sending the operation request message to the group shard node; determining the communication address of the group branch node corresponding to the identifier of the target group through the group shard node, and sending the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
[0006] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation method of the first aspect, wherein the above-mentioned step of determining the communication address of the group branch node corresponding to the identifier of the target group through the group sharding node includes: searching whether the identifier of the target group is included in the group list pre-stored in the group sharding node; if not, loading the identifier of the target group into the pre-stored group list to update the group list; and searching the communication address of the group branch node where the group node corresponding to the identifier of the target group is located from the updated group list.
[0007] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the above-mentioned step of loading the identifier of the target group into the pre-stored group list to update the group list includes: randomly selecting any group branch node in the group branch node list managed by the group sharding node; initiating a request to load the target group on the selected group branch node, so that the group branch node reads the stored data corresponding to the identifier of the target group from a preset database, and loads the stored data into the memory to complete the loading process of the target group; loading the identifier of the target group and the communication address of the group branch node for loading the target group into the pre-stored group list to update the group list.
[0008] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the above method also includes: if the group list pre-stored by the group sharding node includes the identifier of the target group, then searching the group list for the communication address of the group branch node where the group node corresponding to the identifier of the target group is located; sending the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
[0009] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation method of the first aspect, wherein the step of locating the corresponding group shard node according to the identifier of the target group includes: obtaining the number of the group shard nodes in the distributed group service cluster; calculating the number of the group shard node corresponding to the identifier of the target group according to the number and a pre-set grouping mechanism, so as to determine the group shard node corresponding to the number as the group shard node corresponding to the identifier of the target group.
[0010] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the above method also includes: obtaining the topological structure of the distributed group service cluster; constructing the group list and the group branch node list on the group shard node based on the topological structure; wherein the group list is a hash table, the key of the hash table is the identifier of the group corresponding to the group node, and the value of the hash table is the communication address of the group branch node corresponding to the identifier of the group; the group branch node list stores all the group branch nodes connected to the group shard node, and the communication address of the group branch node.
[0011] In combination with the fifth possible implementation of the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the above method also includes: creating multiple child nodes on each of the group shard nodes, and establishing communication between the multiple child nodes according to a preset communication protocol to ensure data consistency between the multiple child nodes; wherein the multiple child nodes include a master node and multiple backup nodes, and the master node and the backup nodes back up each other.
[0012] In combination with the first aspect, an embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein a database is also configured in the above-mentioned distributed group service cluster; the method also includes: triggering multiple groups in the group nodes to store data in the database according to a preset timing mechanism.
[0013] In a second aspect, an embodiment of the present invention further provides a group data processing device, which is applied to a server, wherein the server is configured with a distributed group service cluster, wherein the distributed group service cluster includes a group center node, at least one group shard node, at least one group branch node and at least one group node, wherein after the group shard node, the group branch node and the group node are started, they are all connected to the group center node network; wherein the group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; the group branch node is used to be responsible for the The loading operation of the group node; the group node runs on one of the group branch nodes; the device includes: a receiving module, which is used to receive an operation request message, wherein the operation request message carries the identifier of the target group for requesting the operation; a positioning module, which is used to locate the corresponding group shard node according to the identifier of the target group, and send the operation request message to the group shard node; a processing module, which is used to determine the communication address of the group branch node corresponding to the identifier of the target group through the group shard node, and send the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
[0014] In a third aspect, an embodiment of the present invention further provides a group data processing system, the group data processing system is used to execute the method described in the first aspect; wherein the group data processing system is configured with a distributed group service cluster; the distributed group service cluster includes a group center node, at least one group shard node, at least one group branch node and at least one group node, wherein after the group shard node, the group branch node and the group node are started, they are all connected to the group center node network; the group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group node; the group branch node is used to be responsible for the loading operation of the group node; the group node runs on one of the group branch nodes;
[0015] In a fourth aspect, an embodiment of the present invention further provides a server, comprising a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method described in the first aspect.
[0016] In a fifth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method described in the first aspect.
[0017] The embodiments of the present invention bring the following beneficial effects:
[0018] The group data processing method, device, system and server provided by the embodiments of the present invention can configure a distributed group service cluster on the server, and the distributed group service cluster includes a group center node, at least one group shard node, at least one group branch node and at least one group node. In this way, when an operation request message is received, the corresponding group shard node can be located according to the identifier of the target group carried in the operation request message, and the operation request message can be sent to the group shard node; then the communication address of the group branch node corresponding to the identifier of the target group is determined through the group shard node, and the operation request message is sent to the group branch node corresponding to the communication address, so that the group branch node executes the operation corresponding to the operation request message. Since the entire group service cluster is distributed, it can provide high-availability and high-scalability services to the group organization during the operation of the server, and can effectively process the user's operation request message, thereby improving the player experience.
[0019] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A basic framework diagram of a distributed group service cluster provided by an embodiment of the present invention;
[0023] Figure 2 A flowchart of a method for processing group data provided by an embodiment of the present invention;
[0024] Figure 3 An operation process of group data provided by an embodiment of the present invention;
[0025] Figure 4 A schematic diagram of the structure of a group data processing device provided by an embodiment of the present invention;
[0026] Figure 5 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] At present, in order to uniformly manage the data of different game teams, traditional game servers mostly manage the group data of games on a single server process, which is called a group service center. The basic group operation steps are as follows:
[0029] Step 1: The server user object sends the group operation to the group service center through the network or internal program call;
[0030] Step 2: After receiving the data of the group operation, the group service center of the server creates or updates the corresponding group data, and after completion, notifies the server user object of the operation result;
[0031] Step 3: The server user object receives the operation result and completes a group operation.
[0032] However, the group service center of the above-mentioned server is a single-point service, and its service carrying capacity has a single-point upper limit, which is difficult to expand. In addition, when a single-point service fails, the group service of the entire server will be unavailable, seriously affecting the user experience of players.
[0033] Based on this, the embodiments of the present invention provide a method, device, system and server for processing group data, which can effectively alleviate the above technical problems.
[0034] To facilitate understanding of this embodiment, a group data processing method disclosed in an embodiment of the present invention is first introduced in detail.
[0035] In one possible implementation, an embodiment of the present invention provides a method for processing group data, which is applied to a server, specifically, to a background server of a game, such as a background server of an online game, etc., and in order to ensure high availability and high scalability of the online game group organization so as to provide players with a long-lasting and stable gaming experience, the server is usually configured with a distributed group service cluster.
[0036] In specific implementation, the distributed group service cluster in the embodiment of the present invention includes a group center node, at least one group shard node, at least one group branch node and at least one group node, wherein after the group shard node, the group branch node and the group node are started, they are all connected to the group center node network; and the distributed group service cluster in the embodiment of the present invention uses a distributed structure, which is implemented through a distributed topology structure of a group center node (ClanCenter)--group shard node (ClanShard)--group branch node (ClanStub)--group node (Clan).
[0037] For ease of understanding, Figure 1 A basic framework diagram of a distributed group service cluster is shown, and for the sake of convenience, Figure 1 In the description, a distributed group service cluster including one group center node, three group shard nodes, three group line nodes and three group nodes is taken as an example.
[0038] Specifically, Figure 1 As shown, the community center node, also called ClanCenter, is responsible for the network topology of the distributed community service cluster; for example, it is responsible for maintaining the network topology of all nodes in the network topology of the distributed community service cluster, and so on.
[0039] A group shard node, also called ClanShard, is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; for example, it is responsible for group scheduling on the corresponding group shard node according to the group list, and scheduling different group shard nodes to load different group data, etc.
[0040] The group branch node is also called ClanStub, which is responsible for the loading operation of the group node; for example, it is responsible for loading the group data scheduled by the group shard node, and provides general group data operation logic, such as creation, dissolution, modification, query, etc. The group node runs on one of the group branch nodes, and the group node also carries the group data of the specific group and provides data storage operations. The data will be stored in Figure 1 in the database to ensure persistent storage.
[0041] It should be understood that Figure 1 It is only a schematic diagram of the basic framework of a distributed group service cluster. In other implementations, the number of group shard nodes, group line nodes and group nodes can be set according to actual usage, and, Figure 1 The database in the example generally adopts a database based on distributed file storage, such as a MongoDB database, etc. The specific parameters of the database can also be set according to actual usage, and the embodiment of the present invention does not limit this.
[0042] based on Figure 1 The distributed group service cluster shown can ensure the user experience during the operation of online games through a distributed online game group organization solution, provide users with uninterrupted game group organization services, ensure the stability and high availability of game group organization services, and have a certain degree of high scalability.
[0043] Specifically, based on Figure 1 The distributed group service cluster shown, Figure 2 A flowchart of a method for processing group data is also provided. Figure 2 As shown, the method comprises the following steps:
[0044] Step S202, receiving an operation request message;
[0045] The operation request message carries the identifier of the target group of the requested operation;
[0046] In specific implementation, the above operation request message is usually sent by a user, wherein the user usually refers to a player of an online game, and can be a player who has joined a certain group, or an independent non-group player. Usually, users have their own accounts, so as to log in to the background server of the online game to play the game. Therefore, after the user logs in to his own account, he can perform corresponding operations, for example, a non-group user applies to join a certain group, or a group user who has joined a certain group updates his group data, or a group leader user of a certain group approves a new user to join the group, etc. Therefore, the above operation request message in the embodiment of the present invention usually includes messages such as creation, dissolution, modification, and query initiated by users or players. After the user initiates to the server, the server can execute the above step S202 to receive the operation request message.
[0047] Furthermore, for the server, each user will generate data when logging in. From the server's perspective, each user is equivalent to a group, and the data generated by each user can be used as the group data of the group. Therefore, the group is the logical unit of group data in the server memory when the server is running, that is, the group in the embodiment of the present invention. Figure 1A group node is shown. During the operation of the server, the group node can store the group data at runtime and run on the above-mentioned group branch node ClanStub. Moreover, each group has a unique identifier as the globally unique number of the group. Therefore, after the user logs in to the server, it is equivalent to the group corresponding to the user going online. At this time, the user can initiate an operation request message for a certain operation to the server as the target group. The operation request message will carry the identifier of the target group so that the server can recognize the identifier, and then further perform the following steps in the embodiments of the present invention.
[0048] Step S204, locating the corresponding group shard node according to the identifier of the target group, and sending the operation request message to the group shard node;
[0049] Step S206, determining the communication address of the group branch node corresponding to the target group identifier through the group branch node, and sending the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
[0050] In specific implementation, since in an embodiment of the present invention, the group sharding node in the distributed group service cluster configured by the server is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes, after the server receives the operation request message sent by the user, it can extract the identifier of the target group carried in the operation request message, and then execute the above-mentioned step S204 process to locate the group sharding node, so as to continue to execute the step S206 process and put the group sharding node corresponding to the target group into use.
[0051] The group branch node is responsible for loading the target group, and the target group runs on a group branch node in the distributed group service cluster. It also provides a set of network interfaces for receiving operation request messages forwarded in the group shard node. The operation request message also serves as an operation request for group data, including creation, dissolution, modification, query, etc.
[0052] In specific implementation, after startup, the group shard node can connect to the group center node of the distributed group service cluster, and discover the node network address of the group shard node through the network topology information, establish a connection with the group shard node through the address, and put it into use.
[0053] The group data processing method provided by the embodiment of the present invention can configure a distributed group service cluster on the server, and the distributed group service cluster includes a group center node, at least one group shard node, at least one group branch node and at least one group node. In this way, when an operation request message is received, the corresponding group shard node can be located according to the identifier of the target group carried in the operation request message, and the operation request message can be sent to the group shard node; then the communication address of the group branch node corresponding to the identifier of the target group is determined through the group shard node, and the operation request message is sent to the group branch node corresponding to the communication address, so that the group branch node executes the operation corresponding to the operation request message. Since the entire group service cluster is distributed, it can provide high-availability and high-scalability services to the group organization during the operation of the server, and can effectively process the user's operation request message, thereby improving the player experience.
[0054] In actual use, since the number of server users, such as online game players, is huge, the above-mentioned distributed group service cluster provided in the embodiment of the present invention is usually designed based on the following goals: high availability and scalability, while supporting millions of DAU (Daily Active User). In order to achieve this goal, a certain number of group shard nodes are usually deployed to manage a group list containing multiple group nodes, and one group node corresponds to one group, that is, a user.
[0055] In addition, the group sharding node in the embodiment of the present invention is also responsible for maintaining a group sharding node list, which stores the communication addresses of all group sharding nodes connected to the group sharding node, and is used to allocate group sharding nodes to execute specific operation request messages. In addition, since there are multiple group sharding nodes, in the above step S204, after the server extracts the identifier of the target group, when locating the group sharding node, it is usually necessary to obtain the number of all group sharding nodes deployed in the distributed group service cluster; then, based on the number and the pre-set grouping mechanism, the number of the group sharding node corresponding to the identifier of the target group is calculated, so as to determine the group sharding node corresponding to the number as the group sharding node corresponding to the identifier of the target group.
[0056] For ease of understanding, a distributed group service cluster deploys N group shard nodes as an example. In addition, one group shard node manages a group of group nodes. One possible grouping mechanism is:
[0057] (1) For the N group shard nodes deployed, each group shard node is assigned a number from 0 to N-1, which is recorded as the identifier shard_id of the group shard node;
[0058] (2) The identifier of the target group usually refers to the group's globally unique number, that is, the number of the group logging into the distributed group service cluster. Therefore, after obtaining the number assigned to each group shard node, the identifier of the group shard node can be divided by the identifier of the target group, and the value corresponding to the remainder can be determined as the number of the group shard node that manages the target group.
[0059] That is, a modulo grouping mechanism is adopted to determine the number of the group shard node corresponding to the identifier of the target group.
[0060] It should be understood that the above-mentioned remainder grouping mechanism is only one possible grouping mechanism. In other implementations, the grouping mechanism can also be in other forms, such as randomly selecting the group shard node number, etc., which can be specifically set according to actual usage, and the embodiments of the present invention do not limit this.
[0061] Furthermore, since the group sharding node is used to manage a group list containing multiple group nodes, after locating the corresponding group sharding node through the above step S204, in the above step S206, when determining the group sharding node corresponding to the identifier of the target group, it is necessary to first confirm whether the identifier of the target group is in the group list managed by the group sharding node. If not, the target group needs to be added to the group list, and then the communication address of the group sharding node can be further determined to forward the operation request message; if the target group is in the group list, the communication address of the group sharding node where the group node corresponding to the identifier of the target group is located can be directly found.
[0062] Therefore, in the above step S206, determining the communication address of the group branch node corresponding to the identifier of the target group specifically includes the following steps:
[0063] (1) Check whether the target group's identifier is included in the group list pre-stored in the group shard node;
[0064] (2) if not, loading the target group's identifier into a pre-stored group list to update the group list;
[0065] (3) searching the updated group list for the communication address of the group branch node where the group node corresponding to the target group's identifier is located;
[0066] (4) sending the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message;
[0067] (5) If the group list pre-stored in the group slicing node includes the identifier of the target group, then search the group list for the communication address of the group branch node where the group node corresponding to the identifier of the target group is located; send the operation request message to the group branch node corresponding to the communication address, so that the group branch node executes the operation corresponding to the operation request message.
[0068] Specifically, in the above (2), when the identifier of the target group is loaded into the pre-stored group list to update the group list, it is necessary to randomly select any group branch node from the group branch node list managed by the group sharding node; initiate a request to load the target group on the selected group branch node, so that the group branch node reads the stored data corresponding to the identifier of the target group from a preset database, and loads the stored data into the memory to complete the loading process of the target group; load the identifier of the target group and the communication address of the group branch node for loading the target group into the pre-stored group list to update the group list.
[0069] In actual use, the above-mentioned group list and group branch node list can be constructed according to the topological structure of the distributed group service cluster to facilitate subsequent use and updating. Specifically, since the group sharding nodes, group branching nodes and group nodes are all connected to the group center node network after startup; therefore, when constructing the group list and the group branch node list, the topological structure of the distributed group service cluster can be obtained; then based on the topological structure, the group list and the group branch node list are constructed on the group sharding nodes.
[0070] Furthermore, in an embodiment of the present invention, a group list usually adopts a hash table, the key of the hash table is the identifier of the group corresponding to the group node, and the value of the hash table is the communication address of the group branch node corresponding to the group identifier; in addition, the group branch node list maintained on the group shard node stores all the group branch nodes connected to the group shard node, as well as the communication address of the group branch node, so as to allocate the group branch node to execute the specific group's request operation, that is, to enable the group branch node to execute the operation corresponding to the operation request message.
[0071] In actual use, in order to ensure the high availability of the distributed group service cluster, when the distributed group service cluster is configured, the group data processing method provided in the embodiment of the present invention also includes a disaster recovery solution applicable to the distributed group service cluster for possible failures that may occur during the operation of the background server cluster of the game, so as to solve the problem that when any node related to the distributed group service cluster fails during the operation of the server, the group organization service of the entire distributed group service cluster is not affected. Figure 1 The basic framework of the distributed group service cluster is shown, and the specific implementation scheme is as follows:
[0072] (1) The group center node ClanCenter is only responsible for managing the network topology of the distributed group service cluster. It is stateless. After a line failure, other service nodes will initiate a reconnection request. After ClanCenter restarts, it will re-establish connections with other nodes.
[0073] (2) Creating multiple child nodes on each group shard node, and establishing communication between the multiple child nodes according to a preset communication protocol to ensure data consistency between the multiple child nodes;
[0074] Among them, multiple sub-nodes include a master node and multiple backup nodes, and the master node and the backup node back up each other. For details, please refer to Figure 1 The distributed group service cluster shown shows a schematic diagram of a master node and a backup node.
[0075] Specifically, the group shard node ClanShard mainly contains a group list of multiple group nodes and forwards the operation request messages of the group nodes. The communication protocol between the multiple child nodes deployed by each group shard node ClanShard can adopt the Raft protocol, so as to ensure the final consistency of the data through the Raft algorithm. When the master node (Leader node) of ClanShard fails, the standby node (Follower node) of ClanShard perceives it through the heartbeat packet, and elects a new master node (Leader node) through the Raft algorithm to take over the failed master node to continue service; when the standby node (Follower node) fails, since the standby node (Follower node) is only a backup node, it does not involve specific forwarding logic and does not affect the service of the entire group shard node, and the failure can be restarted.
[0076] (3) If the group branch node ClanStub goes offline, the group node on the group branch node will go offline. Figure 1 As shown, the distributed group service cluster in the embodiment of the present invention is also configured with a database; multiple groups in the group node can be triggered to store data in the database according to a preset timing mechanism. This group node storage mechanism can ensure that the group data will not be lost; at the same time, after the group shard node ClanShard monitors the group branch node ClanStub through the heartbeat protocol, it will clear the information of the corresponding group node in the group list. When a new operation request message is received, the loading of the group node can be re-initiated without affecting the business of the group node.
[0077] For ease of understanding, based on Figure 1 The distributed community service cluster shown, and Figure 2 The method of processing group data shown, Figure 3 A group data operation flow is also shown, wherein, for the sake of convenience, Figure 3 The MongoDB database, the group shard node ClanStub, the group shard node ClanShard, and the user are shown, wherein the group shard node ClanShard shows the master node Leader. Specifically, the following steps are included:
[0078] Step S301: The user requests to operate the group's data and sends the operation request message to the group's sharding node;
[0079] The operation request message carries the identifier Clan_id of the target group for the requested operation, that is, the globally unique number of the group. In this step, the number of the group shard node ClanShard corresponding to the identifier Clan_id of the target group needs to be calculated according to the preset grouping mechanism, and then the group shard node ClanShard managed by it is located, and the request is sent to the leader node of the group shard node ClanShard.
[0080] Step S302, the leader of the group shard node ClanShard determines whether the identifier Clan_id of the target group is in the pre-stored group list, if not, execute step S303, if yes, execute step S306;
[0081] Step S303, the leader of the group shard node ClanShard randomly selects a group shard node ClanStub from the group shard node list it manages, initiates a request to load the target group Clan, and executes step S304;
[0082] Step S304: After receiving the request, the group shard node ClanStub reads the corresponding target group's stored data from the database, loads the stored data into the memory, completes the loading of the target group Clan, and notifies the leader of the group shard node ClanShard that the loading of the target group Clan is complete. The entire process of step S304 is as follows: Figure 3 , as indicated by the dotted line of step S304, and then executing step S305;
[0083] Step S305: After receiving the target group Clan loading completion, the leader of the group shard node ClanShard registers the identifier clan_id of the target group Clan and the communication address of the corresponding loaded group shard node ClanStub into the group list to update the group list, and then executes step S306;
[0084] Step S306, the group shard node ClanShard finds the communication address of the group branch node ClanStub where the group Clan corresponding to the target group identifier clan_id is located from the group list, and sends an operation request message to the group branch node ClanStub through the communication address to perform group-related operations, and then executes step S307;
[0085] Step S307, after receiving the request, the community branch node ClanStub operates the corresponding community data;
[0086] Step S308: Return the operation completion message to the user side.
[0087] In summary, the group data processing method provided by the embodiment of the present invention can ensure the high availability of the game group organization by configuring a distributed group service cluster in the background server of the game, and ensure that the background server of the game will not cause the entire group organization service to be terminated due to a single point failure; at the same time, it can also ensure the high scalability of the game group organization, and ensure that the group organization service can be expanded online, thereby increasing the upper limit of the service load. Therefore, the distributed group service cluster solution provided by the embodiment of the present invention ensures the user experience during the game operation, provides users with uninterrupted game group organization services, and ensures the stable, high-availability operation of the game group organization service, as well as high scalability.
[0088] On the basis of the above embodiment, the embodiment of the present invention further provides a group data processing device, which is applied to a server, wherein the server is configured with a distributed group service cluster, wherein the distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein after the group shard node, the group line node and the group node are started, they are all connected to the group center node network;
[0089] Among them, the group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage the group list containing multiple group nodes and forward the operation request message of the group node; the group branch node is responsible for the loading operation of the group node; the group node runs on one of the group branch nodes.
[0090] For ease of understanding, Figure 4 A schematic diagram of the structure of a group data processing device is shown, the device comprising:
[0091] The receiving module 40 is used to receive an operation request message, wherein the operation request message carries an identifier of a target group requesting the operation;
[0092] A positioning module 42, configured to locate a corresponding group shard node according to the identifier of the target group, and send the operation request message to the group shard node;
[0093] The processing module 44 is used to determine the communication address of the group branch node corresponding to the identifier of the target group through the group slicing node, and send the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
[0094] Furthermore, an embodiment of the present invention also provides a group data processing system, and the group data processing system is used to execute the group data processing method described above;
[0095] Among them, the group data processing system is configured with a distributed group service cluster;
[0096] The distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein the group shard node, the group line node and the group node are all connected to the group center node network after being started; the group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; the group line node is responsible for the loading operation of the group node; the group node runs on one of the group line nodes.
[0097] The group data processing device and system provided in the embodiments of the present invention have the same technical features as the group data processing method provided in the above embodiments, and therefore can solve the same technical problems and achieve the same technical effects.
[0098] Furthermore, an embodiment of the present invention also provides a server, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above method.
[0099] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above method.
[0100] Furthermore, the embodiment of the present invention also provides a schematic diagram of the structure of a server, such as Figure 5As shown, it is a schematic diagram of the structure of the server, wherein the server includes a processor 51 and a memory 50, the memory 50 stores computer executable instructions that can be executed by the processor 51, and the processor 51 executes the computer executable instructions to implement the above-mentioned group data processing method.
[0101] exist Figure 5 In the illustrated embodiment, the server further includes a bus 52 and a communication interface 53 , wherein the processor 51 , the communication interface 53 and the memory 50 are connected via the bus 52 .
[0102] Among them, the memory 50 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 52 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0103] The processor 51 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 51 or the instruction in the form of software. The above processor 51 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 51 reads the information in the memory and completes the group data processing method of the above embodiment in combination with its hardware.
[0104] The computer program products of the group data processing method, device, system and server provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments and will not be repeated here.
[0105] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0106] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0108] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0109] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for processing group data, characterized in that: Applied to a server, the server is configured with a distributed group service cluster, the distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein the group shard node, the group line node and the group node are all connected to the group center node network after being started; The group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; the group branch node is responsible for the loading operation of the group node; the group node runs on one of the group branch nodes; The method comprises: receiving an operation request message, wherein the operation request message carries an identifier of a target group requesting the operation; Locate the corresponding group shard node according to the identifier of the target group, and send the operation request message to the group shard node; The communication address of the group branch node corresponding to the identifier of the target group is determined by the group branch node, and the operation request message is sent to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
2. The method according to claim 1, characterized in that The step of determining the communication address of the group segment node corresponding to the identifier of the target group through the group segment node includes: Searching whether the target group's identifier is included in the group list pre-stored in the group shard node; If not, loading the identifier of the target group into the pre-stored group list to update the group list; The communication address of the group branch node where the group node corresponding to the identifier of the target group is located is searched from the updated group list.
3. The method according to claim 2, characterized in that The step of loading the identifier of the target group into the pre-stored group list to update the group list includes: Randomly select any group branch node from the group branch node list managed by the group shard node; Initiating a request to load the target group on the selected group branch node, so that the group branch node reads the stored data corresponding to the identifier of the target group from a preset database, and loads the stored data into a memory, so as to complete the loading process of the target group; The identifier of the target group and the communication address of the group branch node that loads the target group are loaded into the pre-stored group list to update the group list.
4. The method according to claim 2, characterized in that: The method further comprises: If the group list pre-stored in the group slicing node includes the identifier of the target group, searching the group list for the communication address of the group slicing node where the group node corresponding to the identifier of the target group is located; The operation request message is sent to the community branch node corresponding to the communication address, so that the community branch node performs the operation corresponding to the operation request message.
5. The method according to claim 1, characterized in that The step of locating the corresponding group shard node according to the identifier of the target group includes: Obtaining the number of group shard nodes in the distributed group service cluster; The number of the group shard node corresponding to the identifier of the target group is calculated according to the number and a preset grouping mechanism, so as to determine the group shard node corresponding to the number as the group shard node corresponding to the identifier of the target group.
6. The method according to claim 2, characterized in that The method further comprises: Obtaining the topology of the distributed community service cluster; Building the group list and group line node list on the group shard node based on the topological structure; The group list is a hash table, the key of the hash table is the identifier of the group corresponding to the group node, and the value of the hash table is the communication address of the group branch node corresponding to the group identifier; The group branch node list stores all group branch nodes connected to the group shard node and the communication addresses of the group branch nodes.
7. The method according to claim 6, characterized in that The method further comprises: Creating a plurality of child nodes on each of the group shard nodes, and establishing communication between the plurality of child nodes according to a preset communication protocol, so as to ensure data consistency between the plurality of child nodes; Among them, the multiple sub-nodes include a master node and multiple backup nodes, and the master node and the backup nodes back up each other.
8. The method according to claim 1, characterized in that The distributed group service cluster is also configured with a database; the method further includes: A plurality of communities in the community node are triggered to store data into the database according to a preset timing mechanism.
9. A group data processing device, characterized in that: Applied to a server, the server is configured with a distributed group service cluster, the distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein the group shard node, the group line node and the group node are all connected to the group center node network after being started; The group center node is responsible for the network topology of the distributed group service cluster; the group shard node is used to manage a group list containing multiple group nodes and forward operation request messages of the group nodes; the group branch node is responsible for the loading operation of the group node; the group node runs on one of the group branch nodes; The device comprises: A receiving module, configured to receive an operation request message, wherein the operation request message carries an identifier of a target group requesting the operation; A positioning module, used for locating a corresponding group shard node according to an identifier of the target group, and sending the operation request message to the group shard node; The processing module is used to determine the communication address of the group branch node corresponding to the identifier of the target group through the group slicing node, and send the operation request message to the group branch node corresponding to the communication address, so that the group branch node performs the operation corresponding to the operation request message.
10. A group data processing system, characterized in that: The group data processing system is used to execute the method described in any one of claims 1 to 8; Wherein, the group data processing system is configured with a distributed group service cluster; The distributed group service cluster includes a group center node, at least one group shard node, at least one group line node and at least one group node, wherein the group shard node, the group line node and the group node are all connected to the group center node network after being started; The group center node is responsible for the network topology of the distributed group service cluster; The group sharding node is used to manage a group list including a plurality of group nodes and forward an operation request message of the group node; The group branch node is used to be responsible for the loading operation of the group node; The group node runs on one of the group branch nodes.
11. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Distributed cluster data service method and distributed cluster data service system
CN106878472A
Distributed sample-based game profiling with game metadata and metrics and gaming api platform supporting third-party content
CN110678239A