CN113398570A - Server grouping method, equipment, storage medium and server cluster - Google Patents

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

Info

Publication number
CN113398570A
CN113398570A CN202110737914.6A CN202110737914A CN113398570A CN 113398570 A CN113398570 A CN 113398570A CN 202110737914 A CN202110737914 A CN 202110737914A CN 113398570 A CN113398570 A CN 113398570A
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.)
Granted
Application number
CN202110737914.6A
Other languages
Chinese (zh)
Other versions
CN113398570B (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

Images

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. And the target central server receives a connection request sent by the target partition server according to the first packet relation. And if the target central server determines to respond to the connection request according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the target partition servers. In the process, the grouping algorithm is executed to determine and adjust the grouping relation of the servers under the non-stop state of the servers.

Description

Server grouping method, equipment, 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, device, storage medium, and server cluster.
Background
At present, games of a large-scale 3D multi-player online network game and the like can provide cross-service activities for users, so that the users registered on different servers in the same group can interact with each other. Because the grouping relationship between the servers is often fixed, the user combination capable of realizing interaction is also fixed.
In order to improve the diversity of user combinations, the grouping relationship between the servers can be continuously adjusted. However, in the prior art, the adjustment of the grouping relationship between the servers is realized by modifying the configuration file during the period that the servers stop service, so that the adjustment of the grouping relationship can influence the normal provision of the game service.
Therefore, how to adjust the grouping relationship of the servers without stopping the servers becomes a problem to be solved urgently.
Disclosure of Invention
In view of this, embodiments of the present invention provide a server cluster, so as to ensure that a grouping relationship between servers in the server cluster is adjusted in a state where the servers do not shut 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 between servers obtained by the target partition server according to a grouping algorithm;
acquiring a second grouping relation between the servers determined according to the grouping algorithm;
and if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partition servers.
In a second aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory is used to store one or more computer instructions, and when the one or more computer instructions are executed by the processor, the server grouping method in the first aspect is implemented. The electronic device may also include a communication interface for communicating with other devices or a communication network.
In a third aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored, and when the executable code is executed by a processor of an electronic device, the processor is enabled to implement at least the server grouping method according to the first aspect.
A fourth aspect of the present invention provides a server cluster, including: the system comprises a plurality of partition servers and a plurality of central servers, wherein a target partition server is any one of the plurality of partition servers, and a target central server is any one of the plurality of central servers;
the target partition server is used for determining a first grouping relation between the servers according to a grouping algorithm; sending a connection request to the target central server according to the first grouping relation;
the target central server is used for determining a second grouping relation between the servers according to the grouping algorithm; and if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partition servers.
The server cluster may include a plurality of central servers and partitioned servers, wherein any of the plurality of central servers may be a target central server and any of the plurality of partitioned servers may be a target partitioned server. Based on the server cluster, the server grouping method provided in this embodiment may specifically include:
the target partition server can obtain a first grouping relation among the servers in the cluster by using a self-configured grouping algorithm, and meanwhile, the target central server can also obtain a second grouping relation among the servers by using a grouping algorithm. The target zone server may then send a connection request to the target central server according to the first packet relationship. And the target central server receives the connection request, and if the response connection request is determined according to the second grouping relation and indicates that the target partitioned server and the target central server are in the same group, the target central server provides cross-service activities for users corresponding to the partitioned servers.
In the process, each server in the cluster can automatically execute a self-configured grouping algorithm so as to group the servers in the cluster under the state that the servers do not shut down, and simultaneously, the grouping relation among the servers can be adjusted under the state that the servers do not shut down, so that the connection relation among the servers is established. In addition, compared with a mode of adjusting the grouping relation of the servers by modifying and reading the configuration file describing the grouping relation, the grouping algorithm can be used for enabling the generation and adjustment processes of the grouping relation among the servers to be more convenient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a flowchart of a server grouping method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a server cluster corresponding to the server grouping method provided in the embodiment shown in fig. 1;
FIG. 3 is a flow chart of a grouping algorithm provided in the present embodiment;
fig. 4 is a flowchart of another server grouping method provided in the embodiment of the present invention;
fig. 5 is a schematic structural diagram of another server cluster corresponding to the server grouping method provided in the embodiment shown in fig. 4;
fig. 6a is a schematic structural diagram of another server cluster according to an embodiment of the present invention;
fig. 6b is a schematic structural diagram of another server cluster according to an embodiment of the present invention;
fig. 7 is a flowchart of another 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
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present 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 the examples of the present invention and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, and "a" and "an" generally include at least two, but do not exclude at least one, unless the context clearly dictates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if," "if," as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a recognition," depending on the context. Similarly, the phrases "if determined" or "if identified (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when identified (a stated condition or event)" or "in response to an identification (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a good 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 good or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a commodity or system that includes the element.
Some embodiments of the invention are described in detail below with reference to the accompanying drawings. The features of the embodiments and examples described below may be combined with each other without conflict between the embodiments. In addition, the sequence of steps in each method embodiment 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 partitioned servers in a server cluster so as to provide cross-service activities for users through grouping.
Specifically, a physical connection is established between each central server and each partitioned server in the server cluster, that is, a one-to-many relationship between each central server and each partitioned server in the server cluster is established through grouping, that is, each grouping includes one central server and at least one partitioned server. And logical connection is established between the central server and each partitioned server in the same group, and the central server can provide cross-service activities for users corresponding to each partitioned server in the same group by means of the logical connection. Therefore, the connection relationship between the servers to be established or disconnected mentioned in this embodiment and each embodiment described below is actually a logical connection between the servers.
The user can register an account 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 is also stored in the partition server corresponding to the user.
Just like the server cluster shown in fig. 2, when the central server 1 and the zone servers 1 to 3 are in the same group 1, the central server 1 can provide cross-service activities to the users corresponding to the zone servers 1 to 3 through the connection relationship between the central server 1 and the zone servers 1 to 3. The participation in the cross-service activity can realize different forms of interaction among the users corresponding to the partition servers 1 to 3. Optionally, the interaction between users may include team games, voice calls, inter-friends, and so on. Similarly, the central server 2 and the zone servers 4 to 6 are located 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 performed by any central server in a plurality of central servers included in a server cluster, that is, a 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 the grouping relation between servers obtained by the target partition server according to a grouping algorithm.
S102, obtaining a second grouping relation between the servers determined according to the grouping algorithm.
And S103, if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partitioned servers.
The target partition server may group the servers in the server cluster according to a grouping algorithm configured in advance to obtain a first grouping relationship. Similarly, the target central server may also pre-configure the grouping algorithm according to itself, and group the servers using the algorithm to obtain the second grouping relationship.
It is assumed that at a certain time, a user can send a participation application of a cross-service activity to a target partition server corresponding to the user by means of a terminal device. And the target partition server receives the application, determines a target central server in the same group with the target partition server according to the first group relation, and sends a connection request to the target central server. Since the target central server can provide cross-service activities to the user through the logical connection between itself and the partitioned servers, the connection request sent by the target partitioned server is actually a logical connection request.
After receiving and responding to the connection request sent by the target partition server, the target central server establishes a logical 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 grouping relationship, that is, whether to continue to respond to the connection request is determined according to the second grouping 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 to the target partition server.
In the process of providing the cross-server activity, in order to enable the partition servers to be in the same group with different central servers at different times and enable users to interact with more users, the grouping relationship among the servers in the server cluster can also be adjusted. In a common manner, the grouping relationship between the servers is usually written into a configuration file of the central server, and at this time, the central server may be restarted to adjust the grouping relationship after the configuration file is modified by stopping the central server. 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 cross-server activities is ensured.
In the method provided by this embodiment, since the grouping algorithm is deployed in advance in each server in the server cluster, the central server and the partition servers can both implement the adjustment of the grouping relationship in a non-stop state by executing the grouping algorithm. And the central server does not need to synchronize the adjusted grouping relation with the partitioned servers, 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 the servers in the cluster by using a grouping algorithm, and meanwhile, the target central server may also obtain a second grouping relationship between the servers by using a grouping algorithm. Thereafter, the target zone server may send a connection request to the target central server according to the first packet relationship. And after the target central server receives the connection request, if the connection request is determined to be responded according to the second grouping relation, and the target partitioned server and the target central server are in the same group, the target central server provides cross-service activities for users corresponding to the partitioned servers.
Therefore, by executing the self-configured grouping algorithm, the servers in the server cluster can be grouped under the non-stop state, and the grouping relation can be adjusted. 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 of each partition server in the cluster and the extreme load-bearing capacity value of each central server. The activity of the partition server can be preset to reflect the online number, the payment proportion, the user level and the like of the users bound with the partition server. The extreme value of the bearing capacity of the central server may also be a preset value, and the extreme value of the bearing capacity specifically includes an upper limit of the bearing capacity and a lower limit of the bearing capacity.
Taking the embodiment shown in fig. 1 as an example, as shown in fig. 3, taking the target central server as an example, the execution process of the grouping algorithm, that is, the process of the target central server obtaining the second grouping relationship, may include the following steps:
s201, according to the sequence of each partition server in the partition server queue, establishing a second grouping relationship between at least one partition server in the partition server queue and a target central server, wherein the sum of the activity degrees of at least one partition server is greater than or equal to the lower limit of the bearing capacity of the target central server.
The target central server may obtain a sorting result of each partitioned server in the server cluster, i.e., a partitioned server queue, and a sorting result of each central server in the server cluster, i.e., a 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 central server may then select at least one partitioned server from the partitioned server queue and establish a second packet relationship between itself and the selected at least one partitioned server. Optionally, the 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 bearing capacity of the target central server.
Through the above process, the first round of grouping for the target central server is realized. After that, the other central servers may be sequentially grouped in the first round according to the sequence of the other central servers in the central server queue.
S202, after the plurality of central servers respectively establish a second grouping relationship with at least one partition server in the partition server queue, if a first residual partition server which does not establish the second grouping relationship with any central server exists in the partition server queue, determining the sum of the respective liveness of at least one partition server which establishes the second grouping relationship with a target central server.
S203, determining the difference between the sum of the liveness degrees and the upper limit of the bearing capacity of the target central server.
And S204, establishing a second grouping relationship between the target center server and a second remaining partitioned server according to the difference, wherein the second remaining partitioned server is contained in the first remaining partitioned server, and the sum of the respective liveness of the second remaining partitioned server is less than or equal to the difference.
After each central server completes the first round of grouping, there may be unallocated partition servers, i.e., the first remaining partition server, in the partition servers. At this point, the target central server at the top of the central server queue may begin a second round of grouping:
the target central server calculates the sum of the respective liveness of at least one partition server selected in the first grouping round. And calculating the difference between the sum of the liveness degrees and the upper limit of the bearing capacity of the target central server. And selecting a second residual partitioned server from the first residual partitioned servers according to the difference value so as to establish a second grouping relationship between the target central server and the second residual partitioned server. And the sum of the respective liveness of the selected second remaining partition servers is less than or equal to the difference.
After this, the second round of grouping can also be done in the manner described above for the other central servers in the central server queue.
S205, if a third remaining partitioned server which does not establish a second grouping relationship with any central server exists in the first remaining partitioned servers and the sum of the activity degrees of the partitioned servers included in each group is greater than or equal to the upper limit of the bearing capacity of the central server included in the group, establishing a second grouping relationship between a preset central server in the server cluster and the third remaining partitioned server.
After each server is grouped in the above 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 central server. At this time, if after the two rounds of grouping are completed, the sum of the liveness of the partition servers included in each group is greater than or equal to the upper limit of the bearing capacity of the central server included in the group, that is, the bearing capacity of the central server included in each group is relatively saturated, at this time, a second grouping relationship between the third remaining partition server and the preset central server may be directly established, that is, the third remaining partition server is divided into the groups where the preset central server is located, that is, the third round of grouping is realized.
Optionally, the preset server may be a fixed central server in the server cluster, and the setting of the preset server may be written into the grouping algorithm in advance, so that each server in the server cluster may know, when executing the grouping algorithm, that a third remaining partition server exists, and then a second grouping relationship between the third remaining partition server and the preset central server is established.
Optionally, the preset server may also correspond to the grouping period, for example, when the grouping period is 1, the preset server may be a central server numbered 1, and so on. And the corresponding relationship 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 relationship 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 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 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 included in each group is relatively average, and the partition servers with higher activity are also evenly distributed into different groups.
It should be noted that, for the central server in the server cluster, it also has an activity index, and whenever the second grouping relationship between the central server and one 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 the partition servers with which the second grouping relationship is established.
In the embodiment shown in fig. 3, it is disclosed that the central server queue and the partitioned server queues participate in the execution of the grouping algorithm. The central servers may optionally be sorted by server number to obtain a central server queue. Alternatively, the partitioned servers may be sorted according to the server numbers, and then the sorted results are scattered by using the same sort-changing algorithm, such as a shuffle algorithm (random _ shuffle algorithm), according to the generated random number sequence, so as to obtain the partitioned server queue.
Each server in the server cluster can execute a grouping algorithm periodically according to a 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 sorted corresponds to the grouping period to which the execution time of the grouping algorithm belongs. Alternatively, the random number sequence may be generated from a start time included in the packet cycle as a time stamp. And the variable sequence algorithm uses the timestamp 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 the partition servers 1 to 7, and the partition servers may be sorted according to the server numbers to obtain a sorting result: zone server 1 to zone server 7. Meanwhile, assuming that the target central server executes the 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 less than the preset time length, the grouping algorithm may be executed when the time in the next grouping period is t2, the starting time t2 is converted into a timestamp corresponding to the grouping period to which the target central server belongs, the timestamp 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 sorting result of the partition servers is scattered according to the random number sequence, so that a scattered server queue is obtained.
It should be noted that, in one grouping cycle, for example, in the grouping cycle to which the time t2 belongs, the grouping algorithm may be executed at a plurality of times in the grouping cycle, and when the grouping algorithm is executed, the plurality of times are all converted into uniform timestamps corresponding to the belonging grouping cycle according to time zones, so that the grouping relationships obtained by executing the grouping algorithm at the plurality of times are consistent.
Optionally, a random number sequence may also be generated according to the start time by using a random number generation algorithm, and the partition servers may be sorted according to a numerical order in the random number sequence, for example: the random number sequence is 1325467, and in this case, the above sort result can be scrambled by the random number sequence to obtain the following partitioned server queue: the system comprises a partition server 1, a partition server 3, a partition server 2, a partition server 5, a partition server 4, a partition server 6 and a partition server 7.
According to the above description, in different grouping periods, different random number sequences can be used to break up the sequencing result, that is, different partitioned server queues can be obtained when a grouping algorithm is executed in different grouping periods, and finally different grouping relationships can be obtained, so that the flexibility of the grouping relationships is improved, and the interactive experience of the user in the cross-service activity is ensured.
It should be noted that, in practice, because the clocks of the central server and the partition servers often have a deviation, if the random number sequence is generated by directly using the execution time of the grouping algorithm, the queues of the partition servers obtained by the partition servers in the cluster are different, the grouping relationships obtained by the servers are also different, and finally, the servers cannot be connected with each other, and the cross-server activities cannot be provided normally.
However, because the clock skew between the servers is usually small, the algorithm execution time of the servers usually corresponds to the same packet cycle, and therefore, the manner mentioned in the above description in which the start time of the next packet cycle is determined according to the packet cycle to which the execution time belongs, and the start time is converted into the time stamp to determine the random number sequence can ensure that the two servers obtain the same random number sequence, thereby avoiding the situations that the connection establishment fails and the cross-server activity cannot be provided due to the clock skew between the servers.
The following may exemplify a specific implementation process of the grouping algorithm:
it is assumed that the server cluster includes a central server 1 to a central server 3, and a zone server 1 to a zone server 7. The upper limit of the bearing capacity of the central server 1 to the central server 3 is 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 the disordered partitioned server queue according to the random number sequence: the system comprises a partition server 1, a partition server 3, a partition server 2, a partition server 5, a partition server 4, a partition server 6 and a partition server 7. Meanwhile, the central server queue may be: the system comprises a center server 1, a center server 2 and a center server 3. The two server queues mentioned above are available to the central server 1, and each server that executes the grouping algorithm within a preset time period can obtain the two queues mentioned above.
Based on the above queues, a first round of grouping can be performed for the central server 1 located at the top of the central server queue:
according to the lower limit of the carrying capacity of the central server 1, the partitioned server 1 may be taken out from the partitioned server queue first, and at this time, the central server 1 may establish a second grouping relationship between itself and the partitioned server 1. Since the activity of the partition server 1 is 1.5 and the lower limit of the carrying capacity of the central server 1 is already exceeded by 0.8, the first round of grouping continues for the central server 2 in the central server queue: a second packet relationship between the zone servers 3 in the zone server queue and the central server 2 is established. Since the activity of the partition server 2 is 1 and the lower limit of the carrying capacity of the central server 2 is already exceeded, the first round of grouping continues to be performed on the central servers 3 in the central server queue: a second grouping relationship between the zone servers 2 and the central server 3 is established. Since the activity of the partition server 2 is 0.5, which is less than the lower limit of the bearing capacity of the central server 3 by 0.8, the partition server 5 is taken out again, and the 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 is already greater than the lower limit of the bearing capacity by 0.8, and the first round of grouping of all the central servers is completed.
After one round of grouping, the partition server 4, the partition server 6 and the partition server 7 (i.e. the first remaining partition server in the above embodiment) in the partition server queue have not established a grouping relationship. And the remaining bearing capacities of the central server 1 to the central server 3 are 0.5,1 and 0.7, respectively, a second grouping relationship between the central server 2 and the partition server 4 can be established, and a second grouping relationship between the central server 3 and the partition server 6 can be established. 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 the 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 server in the above embodiment) have not established a grouping relationship with the central server, and the bearing capacity of each central server is saturated. At this time, the partitioned servers 7 and the central server 1 in the server cluster may be directly divided into the same group, that is, a third group is implemented. It should be noted that the central server 1 may be regarded as a preset server in a server cluster, and each server in the server cluster can know that after multiple rounds of grouping, if the carrying capacity of each central server is relatively saturated, a second grouping relationship between the partition server 7 and the central server 1 may be directly established, so as to implement a third round of grouping.
After the grouping algorithm is executed, the following grouping relationship can be obtained: the central server 1, the partition servers 1 and the partition servers 7 are in the same group; the central server 2, the partition servers 3 and the partition servers 4 are in the same group; the central server 3 is in the same group as the zone servers 2, 5, 6.
Fig. 4 is a flowchart of another server grouping method according to an embodiment of the present invention. The execution subject of this embodiment is any central server in the server cluster, that is, the target central server. As shown in fig. 4, the method includes 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 the grouping relation between servers obtained by the target partition server according to a grouping algorithm.
S302, obtaining a second grouping relation between the servers determined according to the 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 cross-service activity for the user. Meanwhile, the target central server may further determine the validity of the logical connection according to the second grouping relationship, that is, determine whether to continue to respond to the connection request sent by the target partition server according to the second grouping relationship, so as to determine whether to continue to provide the service crossing activity for the user corresponding to the target partition server.
The execution process of the above steps 301 to 302 is similar to the corresponding steps of the foregoing embodiment, and reference may be made to the related description in the embodiment shown in fig. 1, which is not repeated herein.
S303, receiving a third grouping relation between the servers sent by the management server in the server cluster.
And S304, if the third grouping relationship is different from the second grouping relationship, replacing the second grouping relationship with the third grouping relationship.
Alternatively, a server cluster as shown in fig. 5, wherein a plurality of central servers may include a management server in addition to a plurality of partitioned servers. The management server may also be configured with a grouping algorithm, and by executing the grouping algorithm in different grouping periods, the management server can also obtain a third grouping relationship between the servers in different grouping periods.
In the above description, it has been mentioned that clock skew may exist between central servers in a cluster, and the influence of the clock skew on normal provision of a cross-service activity may be made up by setting a correspondence between a grouping period and a random number sequence, so that the central servers and the partition servers all obtain the same grouping relationship in the same grouping period. However, when 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 servers still obtain different grouping relationships, and the normal provision of cross-server activities is affected finally.
In order to avoid the influence of clock deviation on normal provision of the cross-service activities, the management server can synchronize the third grouping relation obtained by the management server to each central server and each partition server in time. And if the second grouping relationship in the target central 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 third grouping relationship is also used for replacement, so as to ensure that each central server and each partitioned server have the same grouping relationship in the same grouping period.
S305, if the response connection request is determined according to the third grouping relation, the target central server provides cross-service activities for the users corresponding to the partitioned servers.
In the process that the target central server provides the cross-service activities for the target partition servers, after the grouping relationship is replaced, the target central server can also determine the validity of the connection request sent by the target partition servers again according to the third grouping relationship obtained after the replacement, namely, whether to continue to respond to the connection request sent by the target partition servers is determined. If the target central server determines to continuously respond to the connection request, the connection relation between the target central server and the target partition server is continuously maintained, and the target central server continuously provides cross-service activities for the user.
Optionally, in practice, the second grouping relationship generated by the central server may further perform comparison with the third grouping relationship generated by the management server for multiple times, and 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 comparison failure) 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 time period, and during this time period, the central server may only passively receive the third grouping relationship sent by the management server. Similarly, for a partitioned server with an exception, it can only passively receive the third packet relationship.
And in a period of time when the comparison is carried out for a plurality of times and the comparison failure times do not exceed the preset times, the target center server can still continue to provide the cross-service activities for the user until the comparison is successful. At this time, the central server providing the cross-service activity for the user can be determined again according to the grouping relation which is compared successfully.
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 servers in the same grouping period, so that the central server can normally provide cross-service activities for users.
In addition, there are some special requirements for grouping servers in practical applications, such as that a plurality of special partitioned servers cannot be in the same group, or that a central server fails. At this time, based on the server cluster shown in fig. 5, a maintenance person of the server cluster may trigger an operation of modifying the algorithm parameter to the management server. The management server sends a modification notification to each of the zone servers and each of the central servers in the cluster in response to the modification operation. This modification notification is used to indicate the modified algorithm parameters. Each partition server responds to the modification notice and re-determines the first grouping relation according to the modified algorithm parameters; the central server also re-determines the second grouping relationship based on the modified algorithm parameters in response to the modification notification. Wherein, the modification to the algorithm parameter can comprise the modification of the activity of the partition server and/or the load capacity extremum of the central server.
For example, by adjusting the extreme load-bearing capacity value of the central server of the algorithm parameter, such as increasing the upper limit of the load-bearing capacity of the central server 1 and decreasing the upper limit of the load-bearing capacity of the central server 2, the change of the grouping relationship between the servers in the server cluster can be understood by referring to fig. 6 a. In fig. 6a, the number of partitioned servers in the same group as the center server 1 is increased and the number of partitioned servers in the same group as the center server 2 is decreased, compared to fig. 5.
For another example, by adjusting the activity of the partition servers in the algorithm parameters, the partition servers 1 and 2 originally in the same group can be in different groups. In contrast to fig. 5, in fig. 6b, the partitioned server 1 and the edge service 3 are divided into different groups.
Optionally, in practice, the number of servers in the cluster may also be changed, for example, a newly added central server and/or a newly added partition server exists, at this time, the management server may synchronize the algorithm parameter to the newly added server, so that the newly added server executes the grouping algorithm to obtain the grouping relationship.
In this embodiment, the management server can modify the grouping parameters of the grouping algorithm. By modifying the extreme value of the bearing capacity in the algorithm parameter, the number of the partitioned servers in the same group can be adjusted, namely, the group is cut or expanded. By increasing the activity of the plurality of partition servers and combining the bearing capacity extreme value of the central server, the partition servers with higher activity can be prevented from being divided into the same group, so that the special requirement on server grouping in practical application is met.
Fig. 7 is a flowchart of another server grouping method according to an embodiment of the present invention. The execution subject of this embodiment is any central server in the server cluster, that is, the 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 the grouping relation between servers obtained by the target partition server according to a grouping algorithm.
S402, obtaining a second grouping relation between the servers determined according to the grouping algorithm.
The execution process of the steps 401 to 402 is 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.
And S403, if the target partition server and the target central server are determined not to be in the same group according to the second grouping relationship, waiting for receiving a third grouping relationship between the servers sent by the management server within a preset time length.
S404, if the third grouping relation received in the preset time length indicates that the target partition server and the target central server are in the same group, responding to the connection request to provide the cross-service activity for the user by the target central server.
S405, if the third grouping relation sent by the management server is not received within the preset time length, the connection relation between the target center server and the target partitioning server is disconnected.
The target central server receives the connection request sent by the target partition server, and then can respond to the connection request, namely, the logical connection between the target central server and the target partition server is established, so that the target central server provides cross-service activities for the user. Meanwhile, the target central server may also determine the validity of the logical connection according to the second grouping relationship, that is, determine whether the target central server and the target partition server are in the same group.
And if the target central server determines that the target central server and the target partition server are in the same group, the target central server continuously responds to the connection request sent by the target partition server so as to provide the cross-service activity for the user.
And if the target central server determines that the target central server and the target partition server are not in the same group, waiting for receiving the third group relation sent by the management server within a preset time length. If the central server receives the third grouping relation within the preset time length and the third grouping relation indicates that the target partition server and the target central server are in the same group, the target central server can continuously respond to the connection request sent by the target partition server and provide the cross-service activity for the user by the target central server.
If the target central server does not receive the third grouping relationship within the preset time length or receives the third grouping relationship within the preset time length, but the received third grouping relationship indicates that the target zone server and the target central server are not in the same group, the target central server stops responding to the connection request sent by the target zone server, and at this time, the user cannot participate in the service crossing activity.
It should be noted that, in the same packet cycle, each server in the cluster executes the packet algorithm in different packet cycles at regular time. And after the management server obtains the third grouping relationship, the management server can synchronize the third grouping relationship to each partition server and the central server in the server cluster in time, so that the target central server can receive the third grouping relationship in a short time under normal conditions to quickly determine whether the user can participate in the cross-service activity. Therefore, even if the target central server has the process of waiting for the third grouping relation, the experience of the user participating in the cross-server activity is not obviously influenced.
In this embodiment, if the target central server determines that the cross-server activity cannot be provided for the target partition server according to the second grouping relationship of the target central server, at this time, the connection request is not directly disconnected, but the third grouping relationship sent by the management server is used as a basis to perform another judgment, and finally, whether the cross-server activity is provided for the user is determined, so that the possibility that the user participates in the cross-server activity is improved.
According to the descriptions in the above embodiments, the purpose of grouping the servers is to provide a cross-server activity for the user, and then the description may be further performed in combination with the experience of the user participating in the cross-server activity.
The users are provided with cross-service activities, typically by different central servers, during different packet cycles. Therefore, for a user participating in the cross-service activity for a time period exceeding one grouping period, at the time when the grouping period changes, if the partition server and the central server do not obtain the latest grouping result, the central server providing the cross-service activity for the user in the next grouping period can only be determined by using the grouping relation of the previous grouping period. At this time, the user is easily sent back to the corresponding partition server, so that the user cannot participate in the cross-service activity. And when 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 can cause discontinuities in the cross-clothing activity. Alternatively, the grouping relationship of the next grouping period received by the partition server and the central server may be transmitted by the management server.
However, with the above embodiments, it is assumed that the user corresponds to the target partition server, and the target central server provides the cross-server activity for the user, during the process that the user participates in the cross-server activity, each partition server in the server cluster may also periodically execute a self-configured grouping algorithm according to a 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 length of which exceeds one grouping period, at the moment when the grouping period changes, the partition servers 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 providing the cross-service activity can be switched for the users without perception, and the continuity of the cross-service activity is ensured.
Optionally, in practice, the cross-server activity itself also has a preset duration, and different users can participate in the cross-server activity for different durations, for example, one grouping period for the duration that the users can participate in the cross-server activity.
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 which can be participated by the user, namely the remaining effective duration of the second grouping relationship, 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.
And after the target central server continues to provide the cross-service activities for the user and reaches the minimum value, the cross-service activities 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 central server also stores the user data of the user participating in the cross-service activity and sends the user data to a target partition server corresponding to the user.
In this embodiment, after the cross-server activity is normally finished or the user cannot participate in the cross-server activity, the target central server may normally return the user to the target partition server corresponding to the user, and the user data is also synchronized to the target partition server corresponding to the user.
In the process of participating in the cross-service activity, the user can also actively quit the cross-service activity. Assume that the user corresponds to a target partitioned server and cross-service activities are provided for this user by a target central server. Optionally, the user may trigger the cross-service activity quitting operation by means of the terminal device, and the target partition server may notify the cross-service activity quitting operation to the target central server. And the target center server responds to the cross-service activity quit 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.
During the process of participating in the cross-server activity, the user can also temporarily quit the cross-server activity. Also assume that the user is bound to a target zone server and cross-service activities are provided for this user by a target central server. Optionally, the user may trigger the cross-server activity pause operation by means of the terminal device, and the target central server may respond to the cross-server activity pause operation and store the user data after the user participates in the cross-server activity.
After the user participates in the cross-service activity again, optionally, the user can also trigger the cross-service activity to continue operating by means of the terminal device. In one case, the triggering time interval of the cross-server activity pause operation and the cross-server activity resume operation may be less than one packet cycle, in which case the user may be dropped due to a network problem, and the cross-server activity is provided to the user both before the cross-server activity pause operation is triggered and after the cross-server activity resume operation is triggered.
In another case, the trigger time interval between the cross-server activity pause operation and the cross-server activity resume operation may be greater than one group period, and then the group relationship obtained by each server in the cluster may also change correspondingly before the cross-server activity pause operation is triggered and after the cross-server activity resume operation is triggered, so that different central servers are usually used before the cross-server activity pause operation is triggered and after the cross-server activity resume operation is triggered to provide the cross-server activity for the user.
Specifically, when the user triggers the cross-service activity suspension operation at time T1, it can be known from the first grouping relationship and the second grouping relationship corresponding to each server at time T1 that the target central server a and the target partition server corresponding to the user have the second grouping relationship before time T1, that is, the target central server a provides the cross-service activity for the user. And user data of the user before the cross-service activity suspension operation is triggered is also stored in the target central server a.
Then, the user may also trigger the cross-service activity continuing operation at time T2, and at this time, no matter whether the time interval between time T1 and time T2 is greater than one grouping period, the cross-service activity continuing operation is responded by the target center server a first, that is, the target center server a determines whether the target partition server corresponding to the user has the second grouping relationship with the target center server a at time T2 according to the second grouping relationship corresponding to each server at time T2.
If the target partition server and the target central server a do not have the second grouping relationship corresponding to the time T2, the target central server a may disconnect the connection relationship between itself and the target partition server, that is, stop providing the service crossing service for the user, and simultaneously send the user data to the target partition server.
The target partition server may also determine, in the cluster, another central server B having a second packet relationship with itself according to the first packet relationship corresponding to time T2, and send a connection request to this other central server B. The other central server B receives and responds to the connection request, i.e. establishes a connection relationship between itself and the target partition server. Meanwhile, the other center servers B can also determine that the center server B has the second grouping relationship with the target partition server according to the second grouping relationship corresponding to the time T2, and if the center server B has the second grouping relationship corresponding to the time T2, continue to respond to the connection request sent by the target partition server, and continue to maintain the connection relationship between the center server B and the target partition server, so that the other center servers B continue to provide the cross-server activity for the user. Meanwhile, other central servers B will also receive the 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 zone servers and a plurality of central servers.
And each partitioned server and each central server in the server cluster are provided with a grouping algorithm. The grouping relation of the servers in the server cluster is obtained by executing the algorithm, so that cross-service activities are provided for users.
The following description will be given by taking as an example a target partitioned server which is any one of a plurality of partitioned servers and a target central server which is any one of a plurality of central servers:
the target zone server and the target central server may each execute a grouping algorithm to obtain a first grouping relationship and a second grouping relationship. Based on this, the target zone server may send a connection request to the target central server according to the first packet relationship. Then, the target central server receives the connection request to establish a connection relationship between the target central server and the target partition server, namely, response to the connection request is realized, and then validity of the connection relationship is determined according to the second grouping relationship, namely, whether the connection request is continuously responded is judged according to the second grouping relationship. If the target central server can determine 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 can continuously respond to the connection request, namely, the logical connection relationship between the target central server and the target partition server is continuously maintained, and the target central server provides cross-service activities for users corresponding to the partition servers.
In addition, for the parts of the present embodiment not described in detail, reference may be made to the related description of the embodiments shown in fig. 1 to 3. For the specific implementation process and technical effects of this embodiment, reference is made to the descriptions in the embodiments shown in fig. 1 to fig. 3, which are not described herein again.
The embodiment of the invention also provides another structural schematic diagram of the server cluster. As shown in fig. 5, the server cluster includes: a plurality of zone 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 synchronizes each partition server and each central server in the third grouping algorithm, so that cross-service is provided for users.
The specific process of executing the grouping algorithm by each server in the cluster can be referred to the relevant description in the embodiment shown in fig. 3.
In addition, for the parts of the present embodiment not described in detail, reference may be made to the related descriptions of the embodiments shown in fig. 4 to 7. For the specific implementation process and technical effects of this embodiment, reference is made to the descriptions in the embodiments shown in fig. 4 to fig. 7, which are not described herein again.
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 used for storing a program for supporting the electronic device to execute the server grouping method provided in the embodiments shown in fig. 1 to 7, and the processor 21 is configured to execute 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 performing 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 between servers obtained by the target partition server according to a grouping algorithm;
acquiring a second grouping relation between the servers determined according to the grouping algorithm;
and if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partition servers.
Optionally, the processor 21 is further configured to establish a second grouping relationship between at least one partition server in the partition server queue and the target central server according to the sorting 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 carrying capacity of the target central server;
after each central server of the server cluster respectively establishes a second grouping relationship with at least one partition server in the partition server queue, if a first remaining partition server which does not establish the second grouping relationship 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 relationship with the target central server;
determining the difference between the sum of the liveness degrees and the upper limit of the bearing capacity of the target central server;
and establishing a second grouping relationship between the target center server and a second remaining partitioned server according to the difference, wherein the second remaining partitioned server is contained in the first remaining partitioned server, and the sum of the respective liveness of the second remaining partitioned server is less than or equal to the difference.
Optionally, the processor 21 is further configured to establish a second grouping relationship between a preset central server in the server cluster and a third remaining partitioned server if the third remaining partitioned server that does not establish the second grouping relationship with any central server exists in the first remaining partitioned server and the sum of the liveness of the partitioned servers included in each group is greater than or equal to the upper limit of the bearer capability of the central server included in the group.
Optionally, the processor 21 is further configured to determine 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.
Optionally, the processor 21 is further configured to receive a third packet relationship between servers sent by a management server in the server cluster;
and if the third grouping relationship is different from the second grouping relationship, replacing the second grouping relationship with the third grouping relationship.
Optionally, the processor 21 is further configured to determine the second grouping relationship between the servers according to the modified activity of the target partition server and the grouping algorithm in response to a modification notification sent by the management server, where the modification notification is used to indicate the modified activity of the target partition server; and/or the presence of a gas in the gas,
and in response to the modification notification sent by the management server, determining the second grouping relationship between the servers according to the modified bearing capacity extremum of the target central 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 notification is used for indicating the modified bearing capacity extremum of the target central server.
Optionally, the processor 21 is further configured to wait for receiving a third grouping relationship between the servers sent by the management server within a preset time length if it is determined that the target partition server and the target central server are not in the same group according to the second grouping relationship;
if the third grouping relation received in the preset time length indicates that the target subarea server and the target central server are in the same group, responding to the connection request to provide the cross-service activity for the user by the target central server;
and if the third grouping relation sent by the management server is not received within the preset time length, disconnecting the connection relation between the target partitioning server and the target central server.
Optionally, the processor 21 is further configured to obtain a remaining duration of the cross-service activity and a remaining effective duration of the second grouping relationship;
determining a minimum value of the remaining duration and the remaining effective duration;
after the cross-server activity continues to the minimum value, disconnecting the target central server and the target partition server;
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 quitting operation triggered by the user;
sending the user data to the target zone 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 a cross-service activity pause operation triggered by the user;
responding to the cross-service activity triggered by the user to continue operation, and if the target partition server does not have the second grouping relationship with the target central server, disconnecting the connection relationship 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 central servers in the server cluster to provide the user with cross-service activities by the other central servers.
Optionally, the electronic device may further include a communication interface 23 in the structure, so that the electronic device communicates with other devices or a communication network.
In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for the electronic device, which includes a program for executing the server grouping method in the method embodiments shown in fig. 1 to 7.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (15)

1. The server grouping method is applied to a target central server in a server cluster, wherein 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 between servers obtained by the target partition server according to a grouping algorithm;
acquiring a second grouping relation between the servers determined according to the grouping algorithm;
and if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partition servers.
2. The method of claim 1, wherein determining the second grouping relationship between servers according to the grouping algorithm comprises:
establishing a second grouping relationship between at least one partition server in the partition server queue and the target central server according to the sorting 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 central server;
after each central server of the server cluster respectively establishes a second grouping relationship with at least one partition server in the partition server queue, if a first remaining partition server which does not establish the second grouping relationship 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 relationship with the target central server;
determining the difference between the sum of the liveness degrees and the upper limit of the bearing capacity of the target central server;
and establishing a second grouping relationship between the target center server and a second remaining partitioned server according to the difference, wherein the second remaining partitioned server is contained in the first remaining partitioned server, and the sum of the respective liveness of the second remaining partitioned server is less than or equal to the difference.
3. The method of claim 2, wherein after establishing the second grouping relationship between the target central server and the second remaining partitioned server, the method further comprises:
and if a third remaining partitioned server which does not establish a second grouping relationship with any central server exists in the first remaining partitioned server and the sum of the activity degrees of the partitioned servers included in each server group is greater than or equal to the upper limit of the bearing capacity of the central server included in the group, establishing a second grouping relationship between a preset central server in the server cluster and the third remaining partitioned server.
4. The method of claim 2 or 3, wherein prior to establishing the second packet relationship between the at least one partitioned server in the partitioned server queue and the 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 of claim 1, further comprising:
receiving a third grouping relation between the servers sent by the management server in the server cluster;
and if the third grouping relationship is different from the second grouping relationship, replacing the second grouping relationship with the third grouping relationship.
6. The method of claim 5, further comprising:
determining the second grouping relationship between the 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 presence of a gas in the gas,
and in response to a modification notification sent by the management server, determining the second grouping relationship between the servers according to a modified bearing capacity extremum of the target central server and the grouping algorithm, wherein the bearing capacity extremum comprises a bearing capacity upper limit and a bearing capacity lower limit, and the modification notification is used for indicating the modified bearing capacity extremum of the target central server.
7. The method of claim 5, further comprising:
if the target partition server and the target central server are determined not to be in the same group according to the second grouping relationship, waiting for a third grouping relationship between servers sent by a management server in the server cluster within a preset time length;
if the third grouping relation received in the preset time length indicates that the target subarea server and the target central server are in the same group, responding to the connection request to provide the cross-service activity for the user by the target central server;
and if the third grouping relation sent by the management server is not received within the preset time length, disconnecting the connection relation between the target partitioning server and the target central server.
8. The method of claim 1, further comprising:
acquiring the remaining duration of the cross-service activity and the remaining effective duration of the second grouping relationship;
determining a minimum value of the remaining duration and the remaining effective duration;
after the cross-server activity continues to the minimum value, disconnecting the target central server and the target partition server;
and storing the user data after the user participates in the cross-service activity.
9. The method of claim 1, further comprising:
responding to the cross-service activity quitting operation triggered by the user, and storing user data after the user participates in the cross-service activity;
sending the user data to the target zone server corresponding to the user.
10. The method of claim 1, further comprising:
responding to a cross-service activity pause operation triggered by the user, and storing user data after the user participates in the cross-service activity;
responding to the cross-service activity triggered by the user to continue operation, and if the target partition server does not have the second grouping relationship with the target central server, disconnecting the connection relationship 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 central servers in the server cluster to provide the user with cross-service activities by the other central servers.
11. 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 as claimed in any one of claims 1 to 10.
12. 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 one of claims 1 to 10.
13. A server cluster, comprising: the system comprises a plurality of partition servers and a plurality of central servers, wherein a target partition server is any one of the plurality of partition servers, and a target central server is any one of the plurality of central servers;
the target partition server is used for determining a first grouping relation between the servers according to a grouping algorithm; sending a connection request to the target central server according to the first grouping relation;
the target central server is used for determining a second grouping relation between the servers according to the grouping algorithm; and if the connection request is determined to be responded according to the second grouping relation, the target central server provides cross-service activities for the users corresponding to the partition servers.
14. The server cluster according to claim 13, wherein the target central server is configured to establish a second grouping relationship between at least one of the partitioned servers in the partitioned server queue and the target central server according to the sorting of the partitioned servers in the partitioned server queue, wherein a sum of respective liveness of the at least one partitioned server is greater than or equal to a lower bearing capacity limit of the target central server;
after the plurality of central servers respectively establish a second grouping relationship with at least one partition server in the partition server queue, if a first remaining partition server which does not establish the second grouping relationship 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 relationship with the target central server;
determining the difference between the sum of the liveness degrees and the upper limit of the bearing capacity of the target central server;
and establishing a second grouping relationship between the target center server and a second remaining partitioned server according to the difference, wherein the second remaining partitioned server is contained in the first remaining partitioned server, and the sum of the respective liveness of the second remaining partitioned server is less than or equal to the difference.
15. The server cluster of claim 13, wherein the target central server is configured to store user data after the user participates in the cross-server activity in response to a cross-server activity suspension operation triggered by the user;
responding to the cross-service activity triggered by the user to continue operation, and if the target partition server does not have the second grouping relationship with the target central server, disconnecting the connection relationship between the target partition server and the target central server; sending the user data to the target partition server;
the target partition server is used for sending a connection request to other central servers in the plurality of central servers according to the first grouping relation;
and the other central servers are used for receiving the user data sent by the target partition server if the connection request is determined to be responded according to the second grouping relationship, so that the other central 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 true CN113398570A (en) 2021-09-17
CN113398570B 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 (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160346684A1 (en) * 2015-05-29 2016-12-01 Colossi LLC Systems and methods for mass user multi input control of a common display
US20180193742A1 (en) * 2017-01-12 2018-07-12 Machine Zone, Inc. System and method for managing event data in a multi-player online game
CN109510872A (en) * 2018-11-28 2019-03-22 珠海金山网络游戏科技有限公司 A kind of cross-server system, a kind of cross-server method and server
CN109936539A (en) * 2017-12-15 2019-06-25 腾讯科技(深圳)有限公司 The transmission method of account
CN110433487A (en) * 2019-08-08 2019-11-12 腾讯科技(深圳)有限公司 A kind of method and relevant apparatus of traffic resource assignment
CN111282262A (en) * 2020-01-13 2020-06-16 网易(杭州)网络有限公司 Game server communication method and device
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160346684A1 (en) * 2015-05-29 2016-12-01 Colossi LLC Systems and methods for mass user multi input control of a common display
US20180193742A1 (en) * 2017-01-12 2018-07-12 Machine Zone, Inc. System and method for managing event data in a multi-player online game
CN109936539A (en) * 2017-12-15 2019-06-25 腾讯科技(深圳)有限公司 The transmission method of account
CN109510872A (en) * 2018-11-28 2019-03-22 珠海金山网络游戏科技有限公司 A kind of cross-server system, a kind of cross-server method and server
CN110433487A (en) * 2019-08-08 2019-11-12 腾讯科技(深圳)有限公司 A kind of method and relevant apparatus of traffic resource assignment
CN111282262A (en) * 2020-01-13 2020-06-16 网易(杭州)网络有限公司 Game server communication method and device
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
CN113398570B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN107959705B (en) Distribution method of streaming computing task and control server
CN113014634B (en) Cluster election processing method, device, equipment and storage medium
CN107453929B (en) Cluster system self-construction method and device and cluster system
CN106936618B (en) Data acquisition method and system
CN110795203B (en) Resource scheduling method, device, system and computing equipment
CN111614708B (en) Transaction system based on block chain
CN110855708B (en) Game server architecture
CN111338774A (en) Distributed timing task scheduling system and computing device
CN109173270B (en) Game service system and implementation method
CN105939389A (en) Load balancing method and device
US10225854B2 (en) Enhancements to resource allocation for MBSFN transmission in an MBSFN area
CN109040184B (en) Host node election method and server
EP3061207A1 (en) Load balancing in a distributed network management architecture
CN109921942B (en) Cloud platform switching control method, device and system and electronic equipment
CN106790092A (en) Remote procedure call services end control system and method
CN106991070B (en) Real-time computing method and device
CN109871273A (en) A kind of adaptive task moving method and device
CN111752924A (en) Database migration method, system and storage medium
CN113946362B (en) Consumption data processing method and storage medium
CN113398570A (en) Server grouping method, equipment, storage medium and server cluster
CN111669427B (en) Software defined network publishing and subscribing system and method
CN109714328B (en) Capacity adjustment method and device for game cluster
CN111249747A (en) Information processing method and device in game
CN116455830A (en) Method for realizing high-availability distributed QOS of storage gateway
CN110855465B (en) Message processing method and device

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