CN113398570B - Server grouping method, device, storage medium and server cluster - Google Patents

Server grouping method, device, storage medium and server cluster Download PDF

Info

Publication number
CN113398570B
CN113398570B CN202110737914.6A CN202110737914A CN113398570B CN 113398570 B CN113398570 B CN 113398570B CN 202110737914 A CN202110737914 A CN 202110737914A CN 113398570 B CN113398570 B CN 113398570B
Authority
CN
China
Prior art keywords
server
grouping
target
partition
servers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110737914.6A
Other languages
Chinese (zh)
Other versions
CN113398570A (en
Inventor
王怡
王上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Perfect Time And Space Software Co ltd
Original Assignee
Shanghai Perfect Time And Space Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Perfect Time And Space Software Co ltd filed Critical Shanghai Perfect Time And Space Software Co ltd
Priority to CN202110737914.6A priority Critical patent/CN113398570B/en
Publication of CN113398570A publication Critical patent/CN113398570A/en
Application granted granted Critical
Publication of CN113398570B publication Critical patent/CN113398570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/352Details of game servers involving special game server arrangements, e.g. regional servers connected to a national server or a plurality of servers managing partitions of the game world
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • A63F2300/531Server assignment

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a server grouping method, equipment, a storage medium and a server cluster, wherein a target partition server in the server cluster utilizes a grouping algorithm to obtain a first grouping relation among servers, and a target center server in the server cluster utilizes the grouping algorithm to obtain a second grouping relation among servers. The target center server receives a connection request sent by the target partition server according to the first grouping relation. And if the target center server determines to respond to the connection request according to the second grouping relation, the target center server provides a cross-service activity for the user corresponding to the target partition server. In the process, the determination and adjustment of the grouping relation of the server can be realized under the condition that the server is not stopped by executing the grouping algorithm.

Description

Server grouping method, device, storage medium and server cluster
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a server grouping method, a device, a storage medium, and a server cluster.
Background
At present, various types of games such as large-scale 3D multi-player online games can provide cross-service activities for users, so that interaction between users registered on different servers in the same group can be realized. Because the grouping relationship between servers is often relatively fixed, so is the combination of users that can achieve interaction.
In order to increase the diversity of user combinations, the grouping relationship between servers can be continuously adjusted. However, in the prior art, adjustment of the grouping relationship between servers is achieved by modifying the configuration file during the period when the servers are out of service, resulting in the adjustment of the grouping relationship affecting the normal provision of the game service.
Therefore, how to adjust the grouping relation of the servers without stopping the servers becomes a urgent problem to be solved.
Disclosure of Invention
In view of this, the embodiment of the present invention provides a server cluster, which is used to adjust the grouping relationship between servers in the server cluster in a state that the servers are not down.
In a first aspect, an embodiment of the present invention provides a server grouping method, which is applied to a target central server in a server cluster, where the target central server is any central server in the server cluster, and a target partition server is any partition server in the server cluster;
the method comprises the following steps:
receiving a connection request sent by the target partition server according to a first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to a grouping algorithm;
Acquiring a second grouping relation among servers determined according to the grouping algorithm;
and if the response to the connection request is determined according to the second grouping relation, providing a cross-service activity for the user corresponding to the partition server by the target center server.
In a second aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory is configured to store one or more computer instructions, and the one or more computer instructions, when executed by the processor, implement the server grouping method in the first aspect. The electronic device may also include a communication interface for communicating with other devices or communication networks.
In a third aspect, embodiments of the present invention provide a non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to at least implement a server grouping method as described in the first aspect.
Fourth aspect an embodiment of the present invention provides a server cluster, including: the system comprises a plurality of partition servers and a plurality of center servers, wherein a target partition server is any one of the plurality of partition servers, and a target center server is any one of the plurality of center servers;
The target partition server is used for determining a first grouping relation among servers according to a grouping algorithm; sending a connection request to the target center server according to the first grouping relation;
the target center server is used for determining a second grouping relation between servers according to the grouping algorithm; and if the response to the connection request is determined according to the second grouping relation, providing a cross-service activity for the user corresponding to the partition server by the target center server.
The server cluster may include a plurality of central servers and partition servers, wherein any one of the plurality of central servers may be a target central server and any one of the plurality of partition servers may be a target partition server. Based on the above server cluster, the server grouping method provided in this embodiment may specifically include:
the target partition server can obtain a first grouping relation among servers in the cluster by utilizing a self-configured grouping algorithm, and meanwhile, the target center server can also obtain a second grouping relation among the servers by utilizing the grouping algorithm. The target partition server may then send a connection request to the target hub server according to the first grouping relationship. The target center server receives the connection request, and if the response connection request is determined according to the second grouping relation, the target partition server and the target center server are indicated to be in the same grouping, and the target center server provides cross-service activities for users corresponding to the partition server.
In the above process, each server in the cluster can automatically execute a self-configured grouping algorithm to group each server in the cluster in a state that the servers are not stopped, and meanwhile, the grouping relationship between the servers can be adjusted in a state that the servers are not stopped, so that the connection relationship between the servers is established. In addition, compared with the mode of modifying and reading the configuration file describing the grouping relation to adjust the grouping relation of the servers, the grouping relation generation and adjustment process among the servers can be more convenient by means of the grouping algorithm.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a server grouping method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a server cluster corresponding to the server grouping method provided in the embodiment of FIG. 1;
Fig. 3 is a flowchart of a grouping algorithm provided in the present embodiment;
FIG. 4 is a flowchart of another server grouping method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another server cluster corresponding to the server grouping method provided in the embodiment of FIG. 4;
FIG. 6a is a schematic diagram illustrating a structure of a server cluster according to an embodiment of the present invention;
FIG. 6b is a schematic diagram illustrating a structure of a server cluster according to an embodiment of the present invention;
FIG. 7 is a flowchart of a server grouping method according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two, but does not exclude the case of at least one.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to an identification", depending on the context. Similarly, the phrase "if determined" or "if identified (stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when identified (stated condition or event)" or "in response to an identification (stated condition or event), depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or system comprising such elements.
Some embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and features in the embodiments may be combined with each other. In addition, the sequence of steps in the method embodiments described below is only an example and is not strictly limited.
Fig. 1 is a flowchart of a server grouping method according to an embodiment of the present invention. The grouping method is used for grouping a plurality of central servers and a plurality of partition servers in the server cluster so as to provide cross-service activities for users through grouping.
Specifically, physical connection is established between each central server and each partition server in the server cluster, and a one-to-many relationship between each central server and each partition server in the server cluster is established through grouping, that is, each grouping includes one central server and at least one partition server. And the central server and each partition server in the same group are respectively provided with logic connection, and the central server can provide cross-service activities for users corresponding to each partition server in the same group by virtue of the logic connection. Therefore, the connection relationship between the establishment or disconnection servers mentioned in this embodiment and the embodiments described below is actually a logical connection between servers.
The user can register an account number in a partition server in the server cluster by means of the terminal device to become a user corresponding to the partition server, and meanwhile, user data of the user can be stored in the partition server corresponding to the user.
As shown in fig. 2, if the central server 1 and the partition servers 1 to 3 are in the same group 1, the central server 1 can provide a cross-service activity for the users corresponding to the partition servers 1 to 3 through the connection relationship between the central server 1 and the partition servers 1 to 3. The interaction of the users corresponding to the partition servers 1 to 3 can be realized in different forms through the cross-service activities. Optionally, interactions between users may include team games, voice calls, mutual friends, and so forth. Similarly, the center server 2 and the partition servers 4 to 6 are in the group 2.
On the basis of the above description, the server grouping method provided by the embodiment of the present invention may be executed by any one of a plurality of central servers included in the server cluster, that is, the target central server. As shown in fig. 1, the method comprises the steps of:
S101, receiving a connection request sent by a target partition server according to a first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to a grouping algorithm.
S102, acquiring a second grouping relation among the servers determined according to a grouping algorithm.
And S103, if the response connection request is determined according to the second grouping relation, the target center server provides the cross-service activity for the user corresponding to the partition server.
The target partition server may group servers in the server cluster according to a pre-configured grouping algorithm to obtain a first grouping relationship. Similarly, the target hub server may also pre-configure the grouping algorithm on its own and use the algorithm to group servers to obtain a second grouping relationship.
It is assumed that at a certain moment, a user may send a participation application for the cross-service activity to its corresponding target partition server by means of the terminal device. The target partition server receives the application, determines a target center server which is in the same group with the target partition server according to the first grouping relation, and sends a connection request to the target center server. Since the target hub server may provide cross-service activity to the user through a logical connection between itself and the partition server, the connection request sent by the target partition server is actually a logical connection request.
After receiving and responding to the connection request sent by the target partition server, the target center server firstly establishes logic connection between itself and the target partition server. Then, the target central server determines whether the connection request is valid according to the obtained second packet relationship, that is, determines whether to continue responding to the connection request according to the second packet relationship. Optionally, if the target central server determines that the target central server and the target partition server are in the same group according to the second grouping relationship, the target central server continues to respond to the connection request, continues to maintain the logical connection relationship between the target central server and the target partition server, and provides a cross-service activity for the user bound with the target partition server by the target central server.
In the process of providing cross-service activities, in order to enable the partitioned servers to be in the same group with different central servers at different moments, users can interact with more users, and grouping relations among servers in the server cluster can be adjusted. In a common manner, the grouping relationships between servers are typically written to a configuration file of a central server, at which time the configuration file may be modified by first shutting down and then restarting the central server to effect adjustment of the grouping relationships. And after the central server is restarted, the adjusted grouping relation can be synchronized to each partition server in the server cluster, so that the normal provision of the cross-service activity is ensured.
In the method provided in this embodiment, since the grouping algorithm is deployed in each server in the server cluster in advance, both the central server and the partition server may implement adjustment of the grouping relationship by executing the grouping algorithm in a state of not stopping. And the central server does not need to synchronize the adjusted grouping relation with the partition server, so that the adjustment process of the grouping relation is more convenient.
In this embodiment, the target partition server may obtain a first grouping relationship between servers in the cluster by using a grouping algorithm, and at the same time, the target center server may also obtain a second grouping relationship between servers by using a grouping algorithm. Then, according to the first grouping relationship, the target partition server may send a connection request to the target hub server. After the target center server receives the connection request, if the response to the connection request is determined according to the second grouping relation, the target partition server and the target center server are indicated to be in the same grouping, and then the target center server provides cross-service activities for the users corresponding to the partition server.
It can be seen that by executing the self-configured grouping algorithm, each server in the server cluster can also group servers without shutdown, and adjust the grouping relationship. Meanwhile, the grouping relation can be adjusted more conveniently by means of a grouping algorithm.
For the grouping algorithm configured in each server, the algorithm parameters of the algorithm may specifically include the activity level of each partition server in the cluster and the bearing capacity extremum of each central server. The activity of the partition server may be preset to reflect the number of online users, the payment ratio, the user level, etc. bound to the partition server. The bearing capacity extremum of the central server can also be a preset value, and the bearing capacity extremum specifically comprises an upper bearing capacity limit and a lower bearing capacity limit.
Then, with respect to the embodiment shown in fig. 1, as shown in fig. 3, taking the target central server as an example, the execution process of the grouping algorithm, that is, the process that the target central server obtains the second grouping relationship, may include the following steps:
s201, establishing a second grouping relation between at least one partition server in the partition server queue and the target center server according to the ordering of the partition servers in the partition server queue, wherein the sum of the respective liveness of the at least one partition server is greater than or equal to the lower limit of the bearing capacity of the target center server.
The target central server may obtain the sequencing result of each partition server in the server cluster, i.e. the partition server queue, and the sequencing result of each central server in the server cluster, i.e. the central server queue. Alternatively, the target central server in the above embodiments may be located at the top of the central server queue.
The target hub server may then first select at least one partitioned server from the partitioned server queue and establish a second grouping relationship between itself and the selected at least one partitioned server. Alternatively, the above-mentioned at least one partition server may be selected from the top of the partition server queue, and the sum of the respective liveness of the selected at least one partition server is greater than or equal to the lower limit of the load capacity of the target central server.
The first round of grouping for the target central server is realized through the above process. After that, the other central servers may also be grouped in turn for the first round according to the ordering of the other central servers in the central server queue.
S202, after a plurality of central servers respectively establish a second grouping relation with at least one partition server in a partition server queue, if first remaining partition servers which do not establish the second grouping relation with any central server exist in the partition server queue, determining the sum of respective liveness of at least one partition server which establishes the second grouping relation with a target central server.
S203, determining a difference value between the sum of the liveness and the upper limit of the bearing capacity of the target central server.
S204, establishing a second grouping relation between the target center server and a second residual partition server according to the difference value, wherein the second residual partition server is contained in the first residual partition server, and the sum of the respective liveness of the second residual partition server is smaller than or equal to the difference value.
After each central server completes the first round of grouping, there may be partition servers that are not allocated among the partition servers, i.e., the first remaining partition servers. At this point, the target central server at the top of the central server queue may begin a second round of packets:
the target central server calculates the sum of the respective liveness of at least one partition server selected at the time of the first round of grouping itself. And calculating the difference between the sum of the liveness and the upper limit of the bearing capacity of the target central server. And selecting a second residual partition server from the first residual partition servers according to the difference value to establish a second grouping relation between the target center server and the second residual partition server. And the sum of the respective liveness of the selected second residual partition servers is smaller than or equal to the difference value.
After this, the second round of grouping may be accomplished in the same manner as described above for the other central servers in the central server queue.
S205, if a third residual partition server which does not establish a second grouping relation with any central server exists in the first residual partition server, and the sum of the liveness of the partition servers contained in each group is greater than or equal to the upper limit of the bearing capacity of the central server contained in the group, establishing the second grouping relation between the preset central server and the third residual partition server in the server cluster.
After each server has been grouped in the two rounds, there may be a third remaining partitioned server in the partitioned server queue that does not establish a second grouping relationship with any of the central servers. At this time, if after the two rounds of grouping are completed, the sum of the liveness of the partition servers included in each grouping is greater than or equal to the upper limit of the bearing capacity of the central server included in the grouping, that is, the bearing capacity of the central server included in each grouping is saturated, at this time, a second grouping relationship between the third remaining partition servers and the preset central server may be directly established, that is, the third remaining partition servers are divided into the groupings where the preset central server is located, that is, the third round of grouping is implemented.
Wherein, alternatively, the preset server may be a fixed central server in the server cluster, and the setting of the preset server may be written in the grouping algorithm in advance, so that each server in the server cluster may know when executing the grouping algorithm that if the third remaining partition server exists, a second grouping relationship between the third remaining partition server and the preset central server is established.
Alternatively, the preset server may also correspond to the packet period, such as when in packet period 1, the preset server may be the central server numbered 1, and so on. And the corresponding relation between the preset server and the grouping period can also be written into the grouping algorithm, so that each server in the server cluster can establish a second grouping relation between the third remaining server and the preset server corresponding to the grouping period in the grouping period.
It should be noted that, each central server in the server cluster may obtain the respective second grouping relationship in the manner of the embodiment shown in fig. 3, and similarly, each partition server in the server cluster may also obtain the respective first grouping relationship in the manner described above.
And by executing the grouping algorithm shown in fig. 3, it can be ensured that each partition server establishes a grouping relationship with one central server, and the number of partition servers contained in each grouping is relatively average, and partition servers with higher activity are also distributed to different groupings.
It should be noted that, for a central server in the server cluster, the central server also has an activity index, whenever a second packet relationship between the central server and a partition server is established, the activity of the partition server is added to the activity of the central server, that is, the activity of the central server is the sum of the activities of all partition servers with which the second packet relationship is established.
The embodiment shown in fig. 3 has disclosed that the central server queue and the partition server queues participate in the execution of the grouping algorithm. The central servers may optionally be ordered by server number to obtain a central server queue. Alternatively, the partition servers may be ordered according to the server numbers, and then the ordering result is scattered by using the same sort-changing algorithm, such as a shuffling algorithm, according to the generated random number sequence, so as to obtain a partition server queue.
The servers in the server cluster can execute the grouping algorithm periodically according to the grouping period, and the effective duration of the grouping relationship is the grouping period. And the random number sequence used each time the partition server is ordered corresponds to the packet period to which the execution time of the packet algorithm belongs. Alternatively, the random number sequence may be generated as a time stamp from a start time contained in the packet period. The variable sequence algorithm uses the time stamp as a random seed to generate a random number, and breaks up the sequencing result of the partition server according to the random number to obtain the partition server queue.
For example, the server cluster includes partition servers 1 to 7, and the partition servers may be ordered according to server numbers, so as to obtain an ordering result as follows: partition servers 1 to 7. Meanwhile, assuming that the target central server executes a grouping algorithm at time t1, the starting time of the next grouping period of the grouping period to which t1 belongs is t2, and the time interval between the starting time t2 and the time t1 is not smaller than the preset duration, the grouping algorithm can be executed when the time in the next grouping period is t2, the starting time t2 is converted into a time stamp corresponding to the grouping period, the time stamp is used as a random seed of a variable sequence algorithm, a random number sequence is generated through the variable sequence algorithm, and the initial sequencing result of the partition server is scattered according to the random number sequence, so that a scattered server queue is obtained.
In addition, in one packet period, for example, in a packet period to which time t2 belongs, the packet algorithm may be executed at a plurality of times in the packet period, and when the packet algorithm is executed, the plurality of times are converted into uniform time stamps corresponding to the belonging packet period according to time zones, so that the packet relationship obtained by executing the packet algorithm at the plurality of times is uniform.
Alternatively, a random number sequence may be generated using a random number generation algorithm based on the start time, and the partition servers may be ordered according to the ordering of numbers in the random number sequence, for example: the random number sequence is 1325467, and the above sorting result can be disordered by using the random number sequence to obtain the following partitioned server queues: partition server 1, partition server 3, partition server 2, partition server 5, partition server 4, partition server 6, partition server 7.
According to the description, in different grouping periods, different random number sequences can be used for scattering the sorting results, namely, different partition server queues can be obtained when grouping algorithms are executed in different grouping periods, and finally, different grouping relations can be obtained, so that flexibility of the grouping relations is improved, and interactive experience of users in cross-service activities is guaranteed.
In practice, because clocks of the central server and the partition servers often have a deviation, if the execution time of the grouping algorithm is directly used to generate the random number sequence, the partition server queues obtained by the partition servers in the cluster are different, the grouping relationships obtained by the servers are different, and finally, connection cannot be established between the servers, and the cross-service activity cannot be normally provided.
However, since the clock bias between the servers is usually smaller, the algorithm execution time of the servers usually corresponds to the same packet period, so that the method of determining the start time of the next packet period according to the packet period to which the execution time belongs and converting the start time into the timestamp to determine the random number sequence mentioned in the above description can ensure that the two servers obtain the same random number sequence, thereby avoiding the situations of connection establishment failure and failure of cross-service activity due to the clock bias between the servers.
The following may illustrate a specific implementation of the grouping algorithm:
the server cluster is assumed to include the center servers 1 to 3 and the partition servers 1 to 7. The upper limit of the bearing capacity of the central server 1 to the bearing capacity of the central server 3 are 2, and the lower limit of the bearing capacity is 0.8. The activity of the partition server 1 is 1.5, the activity of the partition server 2 is 0.5, the activity of the partition server 3 is 1, the activity of the partition server 4 is 0.7, the activity of the partition server 5 is 0.8, the activity of the partition server 6 is 0.7, and the activity of the partition server 7 is 0.3.
When a grouping algorithm is executed at the time T1, and the random number sequence corresponding to the grouping period to which the time belongs is 1325467, obtaining a scrambled partition server queue according to the random number sequence: partition server 1, partition server 3, partition server 2, partition server 5, partition server 4, partition server 6, partition server 7. While the central server queue may be: a central server 1, a central server 2 and a central server 3. The two server queues described above are available to the center server 1, and the two queues described above are available to each server that performs the grouping algorithm for a preset period of time.
Based on the above queues, the first round of grouping can be performed on the central server 1 located at the top of the central server queue:
depending on the lower limit of the carrying capacity of the central server 1, the partition server 1 may be first fetched from the partition server queue, at which time the central server 1 may establish a second packet relationship between itself and the partition server 1. Since the liveness of the partition server 1 is 1.5, the lower limit of the bearing capacity of the central server 1 is already exceeded by 0.8, so the first round of grouping of the central servers 2 in the central server queue is continued: a second grouping relationship between the partition servers 3 in the partition server queue and the central server 2 is established. Since the liveness of the partition server 2 is 1, the lower limit of the bearing capacity of the central server 2 has been exceeded, so the first round of grouping of the central servers 3 in the central server queue is continued: a second grouping relationship between the partition server 2 and the central server 3 is established. Since the activity of the partition server 2 is 0.5, which is smaller than the lower limit of the bearing capacity of the central server 3 by 0.8, the partition server 5 is fetched again, and a second grouping relationship between the partition server 5 and the central server 3 is established. At this time, the sum of the liveness of the two partitioned servers is 1.3, and the liveness is already greater than the lower limit of the bearing capacity by 0.8, and then the first round of grouping of all the central servers is completed.
After a round of grouping, the partition server 4, the partition server 6, and the partition server 7 (i.e., the first remaining partition servers in the above embodiment) in the partition server queue have not established a grouping relationship yet. And the residual bearing capacities of the central server 1 to the central server 3 are 0.5,1 and 0.7 respectively, a second grouping relation between the central server 2 and the partition server 4 can be established, and a second grouping relation between the central server 3 and the partition server 6 can be established. Wherein the partition server 4 and the partition server 6 are the second remaining partition servers in the above embodiment. The second round of grouping of three central servers is completed through the above process.
After two rounds of grouping, the partition servers 7 in the partition server queue (the third remaining partition servers in the above embodiment) have not yet established a grouping relationship with the center servers, and the carrying capacity of each center server is also saturated. At this time, the partition server 7 may be directly divided into the same group as the center server 1 in the server cluster, that is, the third round of grouping is realized. It should be noted that, the central server 1 may be considered as a preset server in the server cluster, and each server in the server cluster may be aware that after multiple rounds of grouping, if the bearing capacity of each central server is more saturated, a second grouping relationship between the partition server 7 and the central server 1 may be directly established, so as to implement third round of grouping.
After executing the grouping algorithm, the following grouping relation can be obtained: the central server 1 is in the same group with the partition servers 1 and 7; the central server 2 and the partition servers 3 and 4 are in the same group; the center server 3 is in the same group as the partition servers 2, 5, 6.
Fig. 4 is a flowchart of another server grouping method according to an embodiment of the present invention. The execution body of the embodiment is any central server in the server cluster, namely, a target central server. As shown in fig. 4, the method comprises the steps of:
s301, receiving a connection request sent by a target partition server according to a first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to a grouping algorithm.
S302, acquiring a second grouping relation among servers determined according to a grouping algorithm.
According to the embodiment shown in fig. 1, after receiving the connection request, the target central server responds to the connection request, that is, establishes a logical connection between itself and the target partition server, thereby providing a user with a cross-service activity. Meanwhile, the target central server can further determine the validity of the logical connection according to the second packet relationship, that is, determine whether to continue responding to the connection request sent by the target partition server according to the second packet relationship, so as to determine whether to continue providing the cross-service activity for the user corresponding to the target partition server.
The steps 301 to 302 are similar to the corresponding steps in the foregoing embodiment, and reference may be made to the related description in the embodiment shown in fig. 1, which is not repeated here.
S303, receiving a third grouping relation among servers sent by the management servers in the server cluster.
S304, if the third grouping relation is different from the second grouping relation, replacing the second grouping relation with the third grouping relation.
Alternatively, a server cluster as shown in fig. 5 may include a management server in addition to a plurality of partitioned servers and a plurality of central servers. The management server may be configured with a grouping algorithm, and by executing the grouping algorithm in different grouping periods, the management server is also able to obtain a third grouping relationship between servers in different grouping periods.
The above description has already mentioned that clock deviation may exist between the central servers in the cluster, and the influence of the clock deviation on the normal provision of the cross-service activity can be compensated by setting the corresponding relation between the grouping period and the random number sequence, so that the central servers and the partition servers all obtain the same grouping relation in the same grouping period. However, after the clock deviation between the central server and the partition server is too large, the servers are not in the same grouping period, so that different grouping relations can still be obtained for different servers, and the normal provision of the cross-service activity is finally influenced.
In order to avoid the influence of clock deviation on the normal provision of the cross-service activity, the management server can synchronize the third grouping relationship obtained by the management server to each central server and each partition server in time. If the second grouping relationship in the target center server is different from the third grouping relationship of the management server, replacing the second grouping relationship with the third grouping relationship. Similarly, when the first grouping relationship is different from the third grouping relationship, the replacement can be performed by using the third grouping relationship, so as to ensure that each central server and each partition server have the same grouping relationship in the same grouping period.
And S305, if the response connection request is determined according to the third grouping relation, the target center server provides the cross-service activity for the user corresponding to the partition server.
In the process that the target central server provides the cross-service activity for the target partition server, after the grouping relation is replaced, the target central server can also determine the validity of the connection request sent by the target partition server again according to the third grouping relation obtained after the replacement, namely, determine whether to respond to the connection request sent by the target partition server continuously. If the target center server determines to continue responding to the connection request, the connection relation between the target center server and the target partition server is continuously maintained, and the target center server continues to provide the cross-service activity for the user.
Optionally, in practice, the second grouping relationship generated by the central server may be compared with the third grouping relationship generated by the management server for multiple times, if the number of times that the second grouping relationship generated by the central server is different from the third grouping relationship generated by the management server (i.e. the number of times of failure in comparison) exceeds a preset number of times, which indicates that the central server is abnormal, the management server may control the central server to stop executing the self-configured grouping algorithm within a preset duration, and during this period, the central server may only passively receive the third grouping relationship sent by the management server. Similarly, for a partitioned server that is anomalous, it can only passively receive the third packet relationship.
And in a period of time when the comparison is performed for a plurality of times and the number of times of comparison failure does not exceed the preset number of times, the target center server can still continue to provide the user with the cross-service activity until the comparison is successful. At this time, the central server providing the cross-service activity for the user can be redetermined according to the grouping relation of successful comparison.
In this embodiment, the third grouping relationship generated by the management server is used to synchronize the grouping relationships obtained by other servers in the cluster, so as to ensure that each server can use the same grouping relationship to establish a connection relationship between the central server and the partition server in the same grouping period, so that the central server can normally provide a cross-service activity for the user.
In addition, in practical applications, there may be some special requirements for grouping servers, such as that multiple special partition servers cannot be in the same grouping, or that a central server fails. At this time, based on the server cluster shown in fig. 5, maintenance personnel of the server cluster may trigger a modification operation of algorithm parameters to the management server. The management server responds to the modification operation and sends a modification notification to each partition server and each center server in the cluster. This modification notification is used to indicate the modified algorithm parameters. Each partition server responds to the modification notification, and redetermines the first grouping relation according to the modified algorithm parameters; the central server also re-determines the second grouping relationship in response to the modification notification in accordance with the modified algorithm parameters. The modification to the algorithm parameters may include, among other things, modification of activity of the partitioned server and/or of the load capacity extremum of the central server.
For example, by adjusting the extreme value of the bearing capacity of the central server, such as adjusting the upper limit of the bearing capacity of the central server 1, and simultaneously adjusting the upper limit of the bearing capacity of the central server 2, the change of the grouping relationship between the servers in the server cluster can be understood in conjunction with fig. 6 a. In fig. 6a, the number of partition servers in the same group as the center server 1 increases, and the number of partition servers in the same group as the center server 2 decreases, as compared with fig. 5.
For another example, by adjusting the liveness of the partition servers in the algorithm parameters, the partition servers 1 and 2 that are originally in the same group may be located in different groups. In fig. 6b, the partition server 1 and the edge service 3 are divided into different groups compared to fig. 5.
Alternatively, in practice, the number of servers in the cluster may also be changed, for example, there is a newly added central server and/or a partitioned server, where the management server may synchronize the algorithm parameters to the newly added servers, so that the newly added servers execute the grouping algorithm to obtain the grouping relationship.
In this embodiment, the grouping parameters of the grouping algorithm can be modified by means of the management server. The number of the partition servers in the same group can be adjusted by modifying the bearing capacity extremum in the algorithm parameters, namely, the clipping or the expansion of the group is realized. By increasing the liveness of the plurality of partition servers and combining the extreme value of the bearing capacity of the central server, the partition servers with higher liveness can be prevented from being divided into the same group, so that the special requirements on grouping the servers in practical application are met.
Fig. 7 is a flowchart of another server grouping method according to an embodiment of the present invention. The execution body of the embodiment is any central server in the server cluster, namely, a target central server. As shown in fig. 7, the method includes the steps of:
s401, receiving a connection request sent by a target partition server according to a first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to a grouping algorithm.
S402, acquiring a second grouping relation among servers determined according to a grouping algorithm.
The steps 401 to 402 are similar to the corresponding steps in the foregoing embodiment, and reference may be made to the related description in the embodiment shown in fig. 1, which is not repeated herein.
S403, if the target partition server and the target center server are not in the same group according to the second group relation, waiting to receive a third group relation between the servers sent by the management server within a preset duration.
And S404, if the third grouping relation received in the preset time period indicates that the target partition server and the target center server are in the same grouping, responding to the connection request to provide the cross-service activity for the user by the target center server.
And S405, if the third grouping relation sent by the management server is not received within the preset time, disconnecting the connection relation between the target center server and the target partition server.
The target center server receives the connection request sent by the target partition server and can respond to the connection request, namely, the logic connection between the target center server and the target partition server is established, so that the target center server provides cross-service activities for users. Meanwhile, the target central server can also determine the validity of the logical connection according to the second grouping relation, namely, whether the target central server and the target partition server are in the same grouping.
If the target center server determines that the target center server and the target partition server are in the same group, the target center server continues to respond to the connection request sent by the target partition server so as to provide cross-service activities for the user.
If the target center server determines that the target center server and the target partition server are not in the same group, waiting to receive a third group relation sent by the management server within a preset duration. If the central server receives a third grouping relation within the preset time period and the third grouping relation indicates that the target partition server and the target central server are in the same grouping, the target central server can continue to respond to the connection request sent by the target partition server and provide cross-service activities for the user by the target central server.
If the target central server does not receive the third grouping relation within the preset duration, or receives the third grouping relation within the preset duration, but the received third grouping relation indicates that the target partition server and the target central server are not in the same grouping, the target central server stops responding to the connection request sent by the target partition server, and at the moment, the user cannot participate in the cross-service activity.
It should be noted that, since each server in the cluster performs the grouping algorithm in different grouping periods in a same grouping period. And the management server can synchronize the third grouping relation to each partition server and the central server in the server cluster in time after obtaining the third grouping relation, so that the target central server can receive the third grouping relation in a shorter time under normal conditions so as to quickly determine whether the user can participate in the cross-service activity. Thus, even if the target hub server has a process of waiting for the third grouping relationship, it does not have a significant impact on the user's experience of participating in the cross-service activity.
In this embodiment, if the target central server determines that the cross-service activity cannot be provided for the target partition server according to the second packet relationship, the connection request is not directly disconnected at this time, but the third packet relationship sent by the management server is used as a basis to perform a further judgment, and finally determine whether the cross-service activity is provided for the user, thereby improving the possibility of the user participating in the cross-service activity.
From the descriptions in the above embodiments, it is known that grouping servers for providing a user with a cross-service activity may also be described in connection with the user's experience of participating in the cross-service activity.
The user is typically provided with cross-service activity by different central servers during different grouping periods. Therefore, for the user who participates in the cross-service activity and has a duration exceeding one grouping period, if the partition server and the central server do not obtain the latest grouping result at the moment of changing the grouping period, the grouping relationship of the last grouping period can only be used for determining the central server providing the cross-service activity for the user in the next grouping period. At this time, the situation that the user is sent back to the partition server corresponding to the user is easy to occur, so that the user cannot participate in the cross-service activity. After the partition server and the central server receive the grouping relation of the next grouping period, the cross-service activity can be continuously provided for the user according to the latest grouping relation. The above process may cause discontinuities in the cross-garment activity. Alternatively, the packet relationship of the next packet cycle received by the partition server and the center server may be transmitted by the management server.
With the above embodiments, assuming that the user corresponds to the target partition server and the target central server provides the user with the cross-service activity, during the process of the user participating in the cross-service activity, each partition server in the server cluster may also periodically execute the self-configured grouping algorithm according to the grouping period to update the first grouping relationship, and similarly, the central server may also periodically update the second grouping relationship.
For users participating in the cross-service activity, the time of the change of the grouping period is longer than the grouping period, and the partition server and the central server in the server cluster can obtain the grouping relation corresponding to the next grouping period according to the self-configured grouping algorithm, so that the central server for providing the cross-service activity for the user switching can be realized without perception, and the continuity of the cross-service activity is ensured.
Optionally, in practice, the cross-over activity itself also has a preset duration, and the duration that different users can participate in the cross-over activity is also different, such as one grouping period that the users can participate in the cross-over activity duration.
Assuming that the user corresponds to the target partition server, and the target central server provides the cross-service activity for the user, in the process of providing the cross-service activity for the user, the central server also obtains the remaining duration of the cross-service activity, and the remaining duration of the cross-service activity, namely the remaining effective duration of the second packet relationship, which can be participated in by the user, and further determines the minimum value of the remaining duration and the remaining effective duration, wherein the minimum value indicates the minimum duration of the cross-service activity which can be participated by the user.
After the target central server continues to provide the user with the cross-service activity and reaches the minimum value, the cross-service activity for the user can be stopped, namely, the connection between the target central server and the target partition server is disconnected. And then, the target center server also stores the user data of the user after participating in the cross-service activity, and sends the user data to the target partition server corresponding to the user.
In this embodiment, after the cross-service activity is normally ended or the user cannot participate in the cross-service activity, the target central server will normally send the user back to the target partition server corresponding to the user, and the user data is synchronized to the target partition server corresponding to the user.
During participation in the cross-service activity, the user may also actively exit the cross-service activity. Suppose a user corresponds to a target partition server and cross-service activity is provided by the target hub server for that user. The user may optionally trigger a cross-service activity exit operation by means of the terminal device and the target partition server may inform the target central server of this cross-service activity exit operation. And the target center server responds to the cross-service activity exit operation, stores the user data after the user participates in the cross-service activity, and sends the user data to the target partition server corresponding to the user.
The user may also temporarily exit the cross-service activity during participation in the cross-service activity. Also assume that a user binds with a target partition server and that a target hub server provides cross-service activity for that user. The user may optionally trigger a cross-service activity suspension operation by means of the terminal device and the target central server may respond to this cross-service activity suspension operation and store the user data after the user has participated in the cross-service activity.
After that, after the user participates in the cross-service activity again, optionally, the user can trigger the cross-service activity to continue operation by means of the terminal device. In one case, the trigger time interval between the cross-service activity pause operation and the cross-service activity continue operation may be less than one packet period, at which time the user may be dropped due to a network problem, and the same central server provides the cross-service activity to the user both before the cross-service activity pause operation is triggered and after the cross-service activity continue operation is triggered.
In another case, the triggering time interval between the cross-service activity pause operation and the cross-service activity continue operation may be greater than one grouping period, so that the grouping relationship obtained by each server in the cluster will also change correspondingly before the cross-service activity pause operation is triggered and after the cross-service activity continue operation is triggered, and therefore, different central servers are usually used to provide the cross-service activity for the user before the cross-service activity pause operation is triggered and after the cross-service activity continue operation is triggered.
Specifically, when the user triggers the cross-service activity suspension operation at the time T1, it can be known that, according to the first grouping relationship and the second grouping relationship corresponding to each server at the time T1, before the time T1, the target central server a and the target partition server corresponding to the user have the second grouping relationship, that is, the target central server a provides the cross-service activity for the user. And user data of the user before triggering the cross-service activity suspension operation is also stored in the target center server a.
And then, the user can trigger the continuous operation of the cross-service activity at the moment T2, and whether the time interval between the moment T1 and the moment T2 is larger than one grouping period or not is judged, at this moment, the continuous operation of the cross-service activity is responded by the target central server A, namely, the target central server A determines whether the target partition server corresponding to the user at the moment T2 has a second grouping relation with the target central server A according to the second grouping relation corresponding to each server at the moment T2.
If the target partition server and the target central server A do not have the second grouping relation corresponding to the time T2, the target central server A can disconnect the connection relation between the target central server A and the target partition server, namely, the cross-service is stopped being provided for the user, and meanwhile, the user data is sent to the target partition server.
The target partition server may further determine, in the cluster, other central servers B having a second grouping relationship with itself according to the first grouping relationship corresponding to the time T2, and send a connection request to the other central servers B. The other central server B receives and responds to the connection request, namely, establishes the connection relationship between itself and the target partition server. Meanwhile, the other center servers B can also determine that the other center servers B have the second grouping relation with the target partition server according to the second grouping relation corresponding to the moment T2, if the other center servers B have the second grouping relation corresponding to the moment T2, the other center servers B continuously respond to the connection request sent by the target partition server and continuously maintain the connection relation between the other center servers B and the target partition server so as to continuously provide cross-service activities for users. At the same time, other central servers B also receive user data sent by the target partition server.
The embodiment of the invention also provides a structural schematic diagram of the server cluster. As shown in fig. 2, the server cluster includes: a plurality of partitioned servers and a plurality of central servers.
Grouping algorithms are configured in each partition server and each central server in the server cluster. The grouping relation of each server in the server cluster is obtained by executing the algorithm, so that cross-service activities are provided for users.
Taking any one of the plurality of partition servers, that is, the target partition server and any one of the plurality of center servers, that is, the target center server as an example, the following description will be given:
the target partition server and the target hub server may each execute a grouping algorithm to obtain a first grouping relationship and a second grouping relationship. Based on this, the target partition server may send a connection request to the target hub server according to the first grouping relationship. And then, the target center server receives the connection request to establish a connection relation between the target center server and the target partition server, namely, to realize response to the connection request, and then, the validity of the connection relation is determined according to the second grouping relation, namely, whether to continue to respond to the connection request is judged according to the second grouping relation. If the target center server can determine that the target center server and the target partition server are in the same group according to the second grouping relation, the target center server can continuously respond to the connection request, namely, continuously maintain the logic connection relation between the target center server and the target partition server, and the target center server provides cross-service activities for users corresponding to the partition server.
In addition, for a part of the present embodiment which is not described in detail, reference is made to the description of the embodiment shown in fig. 1 to 3. The specific implementation and technical effects of this embodiment are described with reference to the embodiments shown in fig. 1 to 3, and are not described herein.
The embodiment of the invention also provides a structural schematic diagram of another server cluster. As shown in fig. 5, the server cluster includes: a plurality of partition servers, a plurality of central servers, and a management server.
The management server is also provided with a grouping algorithm, a third grouping relation can be obtained by executing the grouping algorithm, and the management server provides cross-service for users by synchronizing each partition server and each center server in the third grouping algorithm.
The specific process of each server of the cluster to execute the grouping algorithm can be referred to as related description in the embodiment shown in fig. 3.
In addition, for a part of the present embodiment which is not described in detail, reference is made to the description of the embodiment shown in fig. 4 to 7. The specific implementation and technical effects of this embodiment are described with reference to the embodiments shown in fig. 4 to 7, and are not described herein.
An embodiment of the present invention provides an electronic device, as shown in fig. 8, where the electronic device may include: a processor 21 and a memory 22. Wherein the memory 22 is for storing a program for supporting the electronic device to perform the server grouping method provided in the embodiments shown in fig. 1 to 7 described above, and the processor 21 is configured for executing the program stored in the memory 22.
The program comprises one or more computer instructions which, when executed by the processor 21, are capable of carrying out the steps of:
the target central server is any central server in the server cluster, and the target partition server is any partition server in the server cluster;
receiving a connection request sent by the target partition server according to a first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to a grouping algorithm;
acquiring a second grouping relation among servers determined according to the grouping algorithm;
and if the response to the connection request is determined according to the second grouping relation, providing a cross-service activity for the user corresponding to the partition server by the target center server.
Optionally, the processor 21 is further configured to establish a second packet relationship between at least one partition server in the partition server queue and the target central server according to the ordering of the partition servers in the partition server queue, where a sum of respective liveness of the at least one partition server is greater than or equal to a lower limit of a bearing capacity of the target central server;
After each central server of the server cluster establishes a second grouping relation with at least one partition server in the partition server queue respectively, if a first residual partition server which does not establish the second grouping relation with any central server exists in the partition server queue, determining the sum of respective liveness of the at least one partition server which establishes the second grouping relation with the target central server;
determining a difference between the sum of the liveness and an upper limit of the bearing capacity of the target central server;
and establishing a second grouping relation between the target center server and a second residual partition server according to the difference value, wherein the second residual partition server is contained in the first residual partition server, and the sum of the respective liveness of the second residual partition servers is smaller than or equal to the difference value.
Optionally, the processor 21 is further configured to establish a second packet relationship between a preset central server and a third remaining partition server in the server cluster if there is a third remaining partition server in the first remaining partition servers that does not establish the second packet relationship with any central server, and the sum of liveness of partition servers included in each group is greater than or equal to an upper limit of the bearing capacity of the central server included in the group.
Optionally, the processor 21 is further configured to determine a random number sequence according to a packet period to which the execution time of the packet algorithm belongs;
and sequencing the partitioned servers in the server cluster according to the random number sequence to obtain the partitioned server queue.
Optionally, the processor 21 is further configured to receive a third packet relationship between servers sent by the management server in the server cluster;
and if the third grouping relation is different from the second grouping relation, replacing the second grouping relation with the third grouping relation.
Optionally, the processor 21 is further configured to determine, according to the modified liveness of the target partition server and the grouping algorithm, the second grouping relationship between servers in response to a modification notification sent by the management server, where the modification notification is used to indicate the modified liveness of the target partition server; and/or the number of the groups of groups,
and responding to a modification notice sent by the management server, and determining the second grouping relation between servers according to the modified bearing capacity extremum of the target center server and the grouping algorithm, wherein the bearing capacity extremum comprises an upper bearing capacity limit and a lower bearing capacity limit, and the modification notice is identical to the modified bearing capacity extremum of the target center server.
Optionally, the processor 21 is further configured to wait for receiving a third packet relationship between the servers sent by the management server within a preset duration if it is determined that the target partition server and the target central server are not in the same packet according to the second packet relationship;
if the third grouping relation received in the preset time period indicates that the target partition server and the target center server are in the same grouping, responding to the connection request to provide cross-service activity for the user by the target center server;
and if the third grouping relation sent by the management server is not received within the preset time, disconnecting the connection relation between the target partition server and the target center server.
Optionally, the processor 21 is further configured to obtain a remaining duration of the cross-service activity and a remaining valid duration of the second packet relationship;
determining a minimum value of the remaining duration and the remaining effective duration;
disconnecting the connection between the target central server and the target partition server after the cross-service activity continues to the minimum value;
And storing the user data after the user participates in the cross-service activity.
Optionally, the processor 21 is further configured to store user data after the user participates in the cross-service activity in response to the cross-service activity exit operation triggered by the user;
the user data is sent to the target partition server corresponding to the user.
Optionally, the processor 21 is further configured to store user data after the user participates in the cross-service activity in response to the cross-service activity suspension operation triggered by the user;
responding to the user-triggered cross-service activity to continue operation, and if the target partition server and the target central server do not have the second grouping relation, disconnecting the connection relation between the target partition server and the target central server;
and sending the user data to the target partition server, so that the target partition server sends the user data to other center servers in the server cluster, and the other center servers provide cross-service activities for the user.
Optionally, the structure of the electronic device may further include a communication interface 23, for the electronic device to communicate with other devices or a communication network.
In addition, an embodiment of the present invention provides a computer storage medium, configured to store computer software instructions for the electronic device, where the computer storage medium includes a program for executing the server grouping method in the method embodiments shown in fig. 1 to fig. 7.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (13)

1. The server grouping method is characterized by being applied to target center servers in a server cluster, wherein the target center servers are any center server in the server cluster, and the target partition servers are any partition server in the server cluster; the method comprises the following steps:
the target partition server determines a first grouping relation among servers in the server cluster according to a grouping algorithm, wherein the grouping algorithm is deployed in each server in the server cluster in advance;
The target center server determines a second grouping relation between servers according to the grouping algorithm;
receiving a connection request sent by the target partition server according to the first grouping relation, wherein the first grouping relation is a grouping relation among servers obtained by the target partition server according to the grouping algorithm, and in the first grouping relation, the target center server and the target partition server are in the same grouping;
acquiring the second grouping relation among the servers determined according to the grouping algorithm;
if the target central server and the target partition server are also in the same group in the second grouping relation, determining to respond to the connection request, and providing a cross-service activity for a user corresponding to the partition server by the target central server;
if the target partition server and the target center server are not in the same group according to the second grouping relation, waiting for a third grouping relation among servers sent by management servers in the server cluster within a preset duration;
if the third grouping relation received in the preset time period indicates that the target partition server and the target center server are in the same grouping, responding to the connection request to provide cross-service activity for the user by the target center server;
And if the third grouping relation sent by the management server is not received within the preset time, disconnecting the connection relation between the target partition server and the target center server.
2. The method of claim 1, wherein said determining a second grouping relationship between servers according to the grouping algorithm comprises:
establishing a second grouping relation between at least one partition server in the partition server queue and the target center server according to the ordering of each partition server in the partition server queue, wherein the sum of the respective liveness of the at least one partition server is greater than or equal to the lower limit of the bearing capacity of the target center server;
after each central server of the server cluster establishes a second grouping relation with at least one partition server in the partition server queue respectively, if a first residual partition server which does not establish the second grouping relation with any central server exists in the partition server queue, determining the sum of respective liveness of the at least one partition server which establishes the second grouping relation with the target central server;
Determining a difference between the sum of the liveness and an upper limit of the bearing capacity of the target central server;
and establishing a second grouping relation between the target center server and a second residual partition server according to the difference value, wherein the second residual partition server is contained in the first residual partition server, and the sum of the respective liveness of the second residual partition servers is smaller than or equal to the difference value.
3. The method of claim 2, wherein after the establishing the second packet relationship between the target central server and the second remaining partitioned server, the method further comprises:
and if a third residual partition server which does not establish a second grouping relation with any central server exists in the first residual partition server, and the sum of the liveness of the partition servers contained in each server group is greater than or equal to the upper limit of the bearing capacity of the central server contained in the group, establishing a second grouping relation between a preset central server and the third residual partition server in the server cluster.
4. A method according to claim 2 or 3, wherein prior to said establishing a second packet relationship between at least one partitioned server in said partitioned server queue and said target central server, the method further comprises:
Determining a random number sequence according to a grouping period to which the execution time of the grouping algorithm belongs;
and sequencing the partitioned servers in the server cluster according to the random number sequence to obtain the partitioned server queue.
5. The method according to claim 1, wherein the method further comprises:
determining the second grouping relation between servers according to the modified liveness of the target partition server and the grouping algorithm in response to a modification notification sent by the management server, wherein the modification notification is used for indicating the modified liveness of the target partition server; and/or the number of the groups of groups,
and responding to a modification notice sent by the management server, and determining the second grouping relation between servers according to the modified bearing capacity extremum of the target center server and the grouping algorithm, wherein the bearing capacity extremum comprises an upper bearing capacity limit and a lower bearing capacity limit, and the modification notice is used for indicating the modified bearing capacity extremum of the target center server.
6. The method according to claim 1, wherein the method further comprises:
acquiring the remaining duration of the cross-service activity and the remaining effective duration of the second grouping relation;
Determining a minimum value of the remaining duration and the remaining effective duration;
disconnecting the connection between the target central server and the target partition server after the cross-service activity continues to the minimum value;
and storing the user data after the user participates in the cross-service activity.
7. The method according to claim 1, wherein the method further comprises:
responding to the user-triggered cross-service activity exit operation, and storing user data after the user participates in the cross-service activity;
the user data is sent to the target partition server corresponding to the user.
8. The method according to claim 1, wherein the method further comprises:
responding to the user-triggered cross-service activity pause operation, and storing user data after the user participates in the cross-service activity;
responding to the user-triggered cross-service activity to continue operation, and if the target partition server and the target central server do not have the second grouping relation, disconnecting the connection relation between the target partition server and the target central server;
and sending the user data to the target partition server, so that the target partition server sends the user data to other center servers in the server cluster, and the other center servers provide cross-service activities for the user.
9. An electronic device, comprising: a memory, a processor; wherein the memory has stored thereon executable code which, when executed by the processor, causes the processor to perform the server grouping method of any of claims 1 to 8.
10. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the server grouping method of any of claims 1-8.
11. A server cluster, comprising: the system comprises a plurality of partition servers and a plurality of center servers, wherein a target partition server is any one of the plurality of partition servers, and a target center server is any one of the plurality of center servers;
the target partition server is used for determining a first grouping relation among servers in the server cluster according to a grouping algorithm, and the grouping algorithm is deployed in each server in the server cluster in advance; transmitting a connection request to the target center server according to the first grouping relation, wherein in the first grouping relation, the target center server and the target partition server are in the same grouping;
The target center server is used for determining a second grouping relation between servers according to the grouping algorithm; if the target central server and the target partition server are also in the same group in the second grouping relation, determining to respond to the connection request, and providing a cross-service activity for a user corresponding to the partition server by the target central server;
if the target partition server and the target center server are not in the same group according to the second grouping relation, waiting for a third grouping relation among servers sent by management servers in the server cluster within a preset duration;
if the third grouping relation received in the preset time period indicates that the target partition server and the target center server are in the same grouping, responding to the connection request to provide cross-service activity for the user by the target center server;
and if the third grouping relation sent by the management server is not received within the preset time, disconnecting the connection relation between the target partition server and the target center server.
12. The server cluster according to claim 11, wherein the target central server is configured to establish a second packet relationship between at least one partition server in the partition server queue and the target central server according to the ordering of the partition servers in the partition server queue, wherein a sum of respective liveness of the at least one partition server is greater than or equal to a lower limit of a bearing capacity of the target central server;
After the plurality of center servers respectively establish a second grouping relation with at least one partition server in the partition server queue, if a first residual partition server which does not establish the second grouping relation with any center server exists in the partition server queue, determining the sum of respective liveness of the at least one partition server which establishes the second grouping relation with the target center server;
determining a difference between the sum of the liveness and an upper limit of the bearing capacity of the target central server;
and establishing a second grouping relation between the target center server and a second residual partition server according to the difference value, wherein the second residual partition server is contained in the first residual partition server, and the sum of the respective liveness of the second residual partition server is smaller than or equal to the difference value.
13. The server cluster according to claim 11, wherein the target central server is configured to store user data after the user participates in a cross-service activity in response to a cross-service activity suspension operation triggered by the user;
responding to the user-triggered cross-service activity to continue operation, and if the target partition server and the target central server do not have the second grouping relation, disconnecting the connection relation between the target partition server and the target central server; transmitting the user data to the target partition server;
The target partition server is configured to send a connection request to other center servers in the plurality of center servers according to the first grouping relationship;
and the other center servers are used for receiving the user data sent by the target partition server if the response to the connection request is determined according to the second grouping relation, so that the other center servers provide cross-service activities for the user.
CN202110737914.6A 2021-06-30 2021-06-30 Server grouping method, device, storage medium and server cluster Active CN113398570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110737914.6A CN113398570B (en) 2021-06-30 2021-06-30 Server grouping method, device, storage medium and server cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110737914.6A CN113398570B (en) 2021-06-30 2021-06-30 Server grouping method, device, storage medium and server cluster

Publications (2)

Publication Number Publication Date
CN113398570A CN113398570A (en) 2021-09-17
CN113398570B true CN113398570B (en) 2023-07-21

Family

ID=77680713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110737914.6A Active CN113398570B (en) 2021-06-30 2021-06-30 Server grouping method, device, storage medium and server cluster

Country Status (1)

Country Link
CN (1) CN113398570B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510872A (en) * 2018-11-28 2019-03-22 珠海金山网络游戏科技有限公司 A kind of cross-server system, a kind of cross-server method and server
CN111870936A (en) * 2020-08-06 2020-11-03 网易(杭州)网络有限公司 Cross-server game implementation method, device, server and storage medium
CN112604270A (en) * 2020-12-29 2021-04-06 北京冰封互娱科技有限公司 Cross-server method, device and equipment for online game

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10086275B2 (en) * 2015-05-29 2018-10-02 Colossi LLC Systems and methods for mass user multi input control of a common display
US11058946B2 (en) * 2017-01-12 2021-07-13 Mz Ip Holdings, Llc System and method for managing event data in a multi-player online game
CN109936539B (en) * 2017-12-15 2021-06-08 腾讯科技(深圳)有限公司 Account information transmission method
CN110433487B (en) * 2019-08-08 2022-01-28 腾讯科技(深圳)有限公司 Method and related device for distributing service resources
CN111282262B (en) * 2020-01-13 2023-04-18 网易(杭州)网络有限公司 Game server communication method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510872A (en) * 2018-11-28 2019-03-22 珠海金山网络游戏科技有限公司 A kind of cross-server system, a kind of cross-server method and server
CN111870936A (en) * 2020-08-06 2020-11-03 网易(杭州)网络有限公司 Cross-server game implementation method, device, server and storage medium
CN112604270A (en) * 2020-12-29 2021-04-06 北京冰封互娱科技有限公司 Cross-server method, device and equipment for online game

Also Published As

Publication number Publication date
CN113398570A (en) 2021-09-17

Similar Documents

Publication Publication Date Title
EP3490224A1 (en) Data synchronization method and system
EP3547649A1 (en) Method and system for sending request for acquiring data resource
CN107959705B (en) Distribution method of streaming computing task and control server
CN111614708B (en) Transaction system based on block chain
CN110290180A (en) Distributed task dispatching method, apparatus, computer equipment and storage medium
CN107278365B (en) Apparatus for scalable peer matching
CN109040184B (en) Host node election method and server
CN105554142B (en) The method, apparatus and system of message push
CN103297446A (en) Game resource allocation method and server
CN111787367B (en) Method, device, system, storage medium and computer equipment for distributing resources
US10455041B2 (en) Stateful service with partial replication
CN102055644A (en) Method, device and system for load management in distributed directory service system
CN112437454A (en) Data transmission method and device, storage medium and electronic device
CN110213213B (en) Timing task processing method and system for application
CN113398570B (en) Server grouping method, device, storage medium and server cluster
CN113486042B (en) Data processing method, device, computer readable medium and electronic equipment
CN105472707B (en) A kind of flow sharing method and device
CN104079663B (en) The method of distributed real time synchronization network system and its notification data
CN109714328B (en) Capacity adjustment method and device for game cluster
CN105634932B (en) Message pushing method, device, system and computer readable storage medium
CN112169312A (en) Queuing scheduling method, device, equipment and storage medium for cloud game service
CN109831372B (en) Message synchronization method and instant messaging system
CN108781215B (en) Network service implementation method, service controller and communication system
US9967163B2 (en) Message system for avoiding processing-performance decline
CN110620673B (en) Data processing method and system for chat room process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant