CN115068934A - Server distribution method, system, device, server and storage medium - Google Patents
Server distribution method, system, device, server and storage medium Download PDFInfo
- Publication number
- CN115068934A CN115068934A CN202210692318.5A CN202210692318A CN115068934A CN 115068934 A CN115068934 A CN 115068934A CN 202210692318 A CN202210692318 A CN 202210692318A CN 115068934 A CN115068934 A CN 115068934A
- Authority
- CN
- China
- Prior art keywords
- game
- server
- idle
- servers
- game server
- 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.)
- Pending
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/30—Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
- A63F13/35—Details of game servers
- A63F13/352—Details 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
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides a server distribution method, a system, a device, a server and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a game allocation request of a first game client sent by a character server, determining a game server with the number of online players not reaching a preset player number threshold value from a plurality of game servers as a plurality of idle game servers, determining a game server with the maximum number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers, and sending an identification of the target game server to the character server, wherein the identification of the target game server is used for indicating the character server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes game logic corresponding to the first game client. The invention can improve the game experience of the player by improving the concentration of the player.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a server allocation method, system, device, server, and storage medium.
Background
With the rapid development of the internet and wireless communication technologies, massive multiplayer online games are becoming more and more popular.
Generally, a network game comprises a plurality of game modes, each game mode is arranged on a plurality of game servers so as to distribute players to different game servers for playing, and each time the player selects the game mode, the player is connected to a fixed game server.
In the initial stage of online of each game mode, the number of players is usually the largest, but the number of players on some game servers is gradually reduced along with the passage of time, and due to the fixed connection mode of the game servers, the exploration progress of the game modes on the game servers with the reduced number of players is slowed down, so that server resources are wasted, and the game experience of the players is reduced.
Disclosure of Invention
In view of the above-mentioned shortcomings in the prior art, an object of the present invention is to provide a server allocation method, system, device, server and storage medium, so as to improve the game experience of the players by improving the concentration of the players and improve the resource utilization rate of the server.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a server allocation method, which is applied to a central server, and the method includes:
receiving a game allocation request of a first game client sent by a role server;
determining the game servers of which the number of online players does not reach a preset player number threshold value from the plurality of game servers as a plurality of idle game servers;
determining a game server with the largest number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers;
and sending the identification of the target game server to the role server, wherein the identification of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes game logic corresponding to the first game client.
Optionally, the game allocation request includes: presetting an identifier of a game mode, wherein the game server with the largest number of online players in the idle game servers is determined as a target game server according to the number of online players in the idle game servers, and the method comprises the following steps:
determining at least one idle game server corresponding to the preset game mode from the plurality of idle game servers according to the identifier of the preset game mode;
and according to the online player number of the at least one idle game server, determining the game server with the largest online player number from the at least one idle game server as the target game server.
Optionally, each game server has at least one game mode, and each game mode is provided on at least one game server.
Optionally, the determining, according to the number of online players of the idle game servers, a game server with the largest number of online players from the idle game servers as a target game server includes:
ranking the plurality of idle game servers according to the number of online players of the plurality of idle game servers;
and determining the game server with the largest number of online players as the target game server according to the sorted idle game servers.
Optionally, the sorting the idle game servers according to the number of online players of the idle game servers includes:
according to the number of online players of the idle game servers, the idle game servers are sorted and numbered from large to small;
the determining, according to the sorted idle game servers, a game server with the largest number of online players as the target game server includes:
and determining the idle game server with the minimum number as the target game server.
Optionally, the sorting the idle game servers according to the number of online players of the idle game servers includes:
according to the number of online players of the idle game servers, the idle game servers are sorted from small to large and numbered;
the determining, according to the sorted idle game servers, the game server with the largest number of online players as the target game server includes:
and determining the idle game server with the largest number as the target game server.
Optionally, the determining, according to the number of online players of the idle game servers, a game server with the largest number of online players from the idle game servers as a target game server includes:
calculating the load balance of the idle game servers according to the number of the online players of the idle game servers and the preset number threshold of the players;
and determining the game server with the maximum load balance degree as the target game server according to the load balance degrees of the idle game servers.
Optionally, after sending the identifier of the target game server to the character server, the method further includes:
updating the number of online players for the target game server.
Optionally, the method further includes:
receiving a notification message sent by the target game server, wherein the notification message is used for indicating that a second game client logs out from the target game server;
and updating the number of online players of the target game server according to the notification message.
In a second aspect, an embodiment of the present invention further provides a game server system, where the game server system includes: at least one character server, a center server, and a plurality of game servers;
the at least one character server is communicatively connected to the central server, the central server is further communicatively connected to the plurality of game servers, and the central server is configured to perform the steps of the server allocation method according to any one of the first aspect.
In a third aspect, an embodiment of the present invention further provides a server allocation apparatus, which is applied to a central server, where the apparatus includes:
the request receiving module is used for receiving a game allocation request of the first game client sent by the role server;
the idle game server determining module is used for determining that the game servers with the online player number not reaching the preset player number threshold value are a plurality of idle game servers from the plurality of game servers;
a target game server determining module, configured to determine, according to the number of online players of the idle game servers, a game server with the largest number of online players from the idle game servers as a target game server;
and the identifier sending module is used for sending the identifier of the target game server to the role server, wherein the identifier of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identifier, so that the target game server executes game logic corresponding to the first game client.
Optionally, the game allocation request includes: presetting an identifier of a game mode, wherein the target game server determining module comprises:
the game mode selection unit is used for determining at least one idle game server corresponding to the preset game mode from the idle game servers according to the mark of the preset game mode;
and the target game server determining unit is used for determining the game server with the largest number of online players from the at least one idle game server as the target game server according to the number of online players of the at least one idle game server.
Optionally, each game server has at least one game mode, and each game mode is provided on at least one game server.
Optionally, the target game server determining module includes:
a sorting unit, configured to sort the idle game servers according to the number of online players of the idle game servers;
the target game server determining unit is further configured to determine, according to the sorted idle game servers, a game server with the largest number of online players as the target game server.
Optionally, the sorting unit is specifically configured to sort and number the plurality of idle game servers from large to small according to the number of online players of the plurality of idle game servers;
the target game server determining unit is specifically configured to determine that the idle game server with the smallest number is the target game server.
Optionally, the sorting unit is specifically configured to sort and number the plurality of idle game servers from small to large according to the number of online players of the plurality of idle game servers;
the target game server determining unit is specifically configured to determine that the idle game server with the largest number is the target game server.
Optionally, the target game server determining module includes:
the balance degree calculating unit is used for calculating the load balance degree of the idle game servers according to the number of the online players of the idle game servers and the preset number threshold of the players;
the target game server determining unit is further configured to determine, according to the load balance of the plurality of idle game servers, the game server with the largest load balance as the target game server.
Optionally, the apparatus further comprises:
and the number updating module is used for updating the number of the online players of the target game server.
Optionally, the apparatus further comprises:
a notification message receiving module, configured to receive a notification message sent by the target game server, where the notification message is used to instruct a second game client to exit from the target game server;
and the number updating module is also used for updating the number of the online players of the target game server according to the notification message.
In a fourth aspect, an embodiment of the present invention further provides a server, including: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when the server runs, the processor communicates with the storage medium through the bus, and the processor executes the program instructions to execute the steps of the server allocation method according to any one of the first aspect.
In a fifth aspect, the present invention further provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program is executed by a processor to perform the steps of the server allocation method according to any one of the first aspect.
The invention has the beneficial effects that:
the invention provides a server distribution method, a system, a device, a server and a storage medium, wherein the method comprises the following steps: receiving a game allocation request of a first game client sent by a character server, determining a game server with the number of online players not reaching a preset player number threshold value from a plurality of game servers as a plurality of idle game servers, determining a game server with the maximum number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers, and sending an identification of the target game server to the character server, wherein the identification of the target game server is used for indicating the character server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes game logic corresponding to the first game client. According to the invention, the first game client and the target game server with the largest number of online players are communicated by the target game server with the largest number of online players, so that the waste of server resources caused by scattered distribution of the players in different game servers is avoided, the resource utilization rate of the game servers is improved, the activity among the players in the game servers is higher by improving the aggregation of the players in the game servers, and the game experience of the players is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a schematic diagram of a game server system according to the present invention;
fig. 2 is a schematic flowchart of a server allocation method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a server allocation method according to a second embodiment of the present invention;
fig. 4 is a schematic flowchart of a server allocation method according to a third embodiment of the present invention;
fig. 5 is a schematic flowchart of a server allocation method according to a fourth embodiment of the present invention;
fig. 6 is a schematic flow chart of a fifth embodiment of a server allocation method provided in the present invention;
FIG. 7 is an interaction diagram of a server allocation method according to the present invention;
FIG. 8 is a schematic structural diagram of a server distribution device provided in the present invention;
fig. 9 is a schematic diagram of a server provided by 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.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the 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 terms "first," "second," and the like in the description and in the claims, and in the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the features of the embodiments of the present invention may be combined with each other without conflict.
Generally, a network game includes a plurality of game modes, a developer arranges each game mode on a plurality of game servers to run, distributes players to different game servers to play, and connects the players to a fixed game server after selecting the corresponding game mode each time.
At the beginning of online of each game mode, the number of players is usually the largest, but as time goes on, the number of players on some game servers is gradually reduced, due to the fixed game server connection mode, the aggregation of players on the game servers with the reduced number of players is reduced, the exploration progress of the game mode is slowed, even for the copy which can be opened only when the number of players reaches the preset number, the copy cannot be opened on the game server with the reduced number of players, the player connected to the game server cannot open the corresponding copy, or even if the copy is opened, the player on the game server with the reduced number of players can not complete copy activity within the copy activity time to obtain rewards, and as time goes on, the player on the game server with the reduced number of players can select to leave games, thus wasting server resources, the gaming experience of the player is also reduced.
In view of the above problems in the prior art, the present invention proposes the following technical concepts: the first game client and the plurality of game servers do not reach the preset threshold value of the number of players, and the target game server with the largest number of online players establishes communication connection, so that the waste of server resources caused by the scattered distribution of the players in different servers is avoided, the resource utilization rate of the servers is improved, the aggregation of the players in the game servers is improved, the activity among the players in the game servers is higher, and the game experience of the players is improved.
In order to facilitate understanding of the present invention, a game server system to which the server allocation method according to the present invention is directed will be described below.
Referring to fig. 1, a schematic structural diagram of a game server system provided by the present invention is shown in fig. 1, where the game server system includes: at least one Character server (Character server)10, a center server (Central server)20 and a plurality of game servers (Solar servers) 30, wherein the at least one Character server 10 is connected with the center server 20 in a communication mode, and the center server 20 is also connected with the plurality of game servers 30 in a communication mode.
Specifically, a game Client (Client) is run on a terminal device of each player, the game Client is communicatively connected to one character server 10 of at least one character server 10, and the character server 10 is used to perform login management on the game Client so that the game Client can establish connection with the game server 30. Each game client has a unique and correspondingly connected character server 10, after a player runs a game client on a terminal device, player identity information is input into the game client, and the game client addresses the address of the character server 10 corresponding to the game client by performing a formatting algorithm according to the player identity information, so that the game client establishes communication connection with the character server 10 through the address of the character server 10.
After establishing a communication connection with the game client, the character server 10 transmits a game allocation request for the game client to the center server 20, and requests the center server 20 to allocate the game server 30 to the game client.
After receiving the game allocation request sent by the character server 10, the center server 20 determines the game server 30 with the number of online players less than the preset threshold value of the number of players from the plurality of game servers 30 as a plurality of idle game servers, determines the game server with the largest number of online players from the plurality of idle game servers as the target game server according to the number of online players of the plurality of idle game servers, sends the identifier of the target game server to the character server 10, instructs the character server 10 to address the target game server according to the identifier of the target game server, and informs the game client to establish communication connection with the target game server according to the address of the target game server, so that the target game server executes the game logic corresponding to the game client.
In some embodiments, a game management server (server manager) may also be included in the game server system, the game management server being communicatively coupled to the game client to obtain game data for execution on the game client and store the game data in a database.
Based on the game server system, the invention provides a server allocation method applied to a central server in the game server system. Referring to fig. 2, a schematic flow chart of a server allocation method according to a first embodiment of the present invention is shown in fig. 2, where the method includes:
s10: and receiving a game allocation request of the first game client sent by the character server.
In this embodiment, a first player runs a first game client on a first terminal device, and inputs player identity information in the first game client, and the first game client performs a formatting algorithm according to the player identity information to address an address of a role server corresponding to the first game client, so that the first game client establishes a communication connection with the role server through the address of the role server. The central server receives a game allocation request sent by the role server after the first game client is determined to be successfully logged in, wherein the game allocation request is used for requesting the central server to allocate a game server for the first game client.
S20: and determining the game servers of which the number of online players does not reach the preset number-of-players threshold value from the plurality of game servers as a plurality of idle game servers.
The present embodiment is directed to enable players to enter game servers with a high player concentration, but each game server has a load limit, and if the number of connected players exceeds the load limit, the game server will be stuck and even crashed, so the center server determines, according to the number of online players of the managed plurality of game servers, a game server whose number of online players does not reach a preset player number threshold from the plurality of game servers to form an idle game server list, where the idle game server list includes a plurality of idle game servers.
A plurality of idle game servers in the idle game server list are used as alternative game servers to which the game client can be connected, so that the problem that the game server is jammed or crashed due to the fact that the game client is connected with the game server with the number of online players reaching a preset player number threshold value can be avoided. The preset threshold of the number of players may be set according to the carrying capacity of the game server.
S30: and determining the game server with the largest number of online players from the idle game servers as the target game server according to the number of online players of the idle game servers.
In this embodiment, after determining a plurality of idle game servers from among the plurality of game servers, the central server selects an idle game server with the largest number of online players from the idle game server list as a target game server, where the target game server is a game server with the highest aggregation level of players among the plurality of idle game servers.
S40: and sending the identification of the target game server to the role server, wherein the identification of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes the game logic corresponding to the first game client.
In this embodiment, a coding rule corresponding to the address of the game server and the identifier of the game server is pre-established in the central server, and the central server codes the plurality of game servers according to the addresses of the plurality of game servers by using the coding rule, so that each game server has a unique identifier. The idle game server list comprises a plurality of idle game servers and identifications corresponding to the idle game servers, and the central server determines the identification of the target game server from the idle game server list and then sends the identification (key) of the target game server to the role server.
The character server is pre-established with an addressing rule corresponding to the identification of the game server and the address of the game server, and the addressing rule and the coding rule are mutually corresponding and are decoding rules corresponding to the coding rules. The role server determines the address of the target game server by adopting the addressing rule according to the identification of the target game server, and sends the address of the target game server to the first game client, so that the first game client establishes communication connection with the target game server according to the address of the target game server, and the target game server executes the game logic corresponding to the first game client.
In some embodiments, after the first game client establishes the communication connection with the target game server, the target game server sends a notification message to the central server to notify the central server that the first game client establishes the communication connection with the target game server, and the central server updates the number of online players of the target game server according to the notification message.
In the server allocation method provided by the above embodiment, based on the game allocation request of the first game client sent by the character server, the target game server in which the number of online players does not reach the preset player number threshold and the number of online players is the largest is determined from the plurality of game servers, so that the first client establishes communication connection with the target game server, thereby avoiding waste of server resources caused by scattered distribution of players in different game servers, improving the resource utilization rate of the game servers, improving the aggregation of players in the game servers, improving the activity among players in the game servers, and improving the game experience of players.
One possible implementation of S30 is described below with reference to fig. 3. Referring to fig. 3, a flowchart of a server allocation method according to a second embodiment of the present invention is shown in fig. 3, where the step S30 includes:
s31: and determining at least one idle game server corresponding to the preset game mode from the plurality of idle game servers according to the identifier of the preset game mode.
In this embodiment, the plurality of game servers have the same or different game modes, and the different game modes correspond to different game playing methods. The method comprises the steps that when a player runs a first game client on a terminal device and successfully logs in a role server through the first game client, a plurality of game modes corresponding to the network game are displayed on a graphical user interface of the terminal device, after the player selects a preset game mode from the plurality of game modes, the role server sends a game distribution request containing an identifier of the preset game mode to a center server, the game modes corresponding to the plurality of game servers are stored in a storage medium of the center server in advance, and the center server determines at least one idle game server corresponding to the preset game mode from the plurality of idle game servers according to the identifier of the preset game mode.
In some embodiments, the distribution of the game modes may be: each game server has at least one game mode, and each game mode is arranged on at least one game server.
Specifically, in order to enrich the playing methods of the network games, developers can develop a plurality of different game modes in the network games, and each game mode is arranged on at least one game server according to the number of players which can be attracted by the different game modes.
In some embodiments, the manner for displaying the plurality of game modes corresponding to the network game on the graphical user interface of the terminal device may be: and displaying a world map or a play list of the network game on a graphical user interface of the terminal device, wherein each node in the world map or each option in the play list corresponds to one game mode, and the player can select one game mode from a plurality of nodes in the world map or a plurality of options in the play list.
In some embodiments, the manner of determining at least one idle game server corresponding to the preset game mode may further be: and determining at least one game server corresponding to the preset game mode from the plurality of game servers according to the identification of the preset game mode, and determining at least one idle game server from the at least one game server corresponding to the preset game mode according to the number of the online players.
S32: and determining the game server with the largest number of online players from the at least one idle game server as the target game server according to the number of online players of the at least one idle game server.
In this embodiment, after determining at least one idle game server corresponding to the preset game mode, the central server selects an idle game server with the largest number of online players from the at least one idle game server corresponding to the preset game mode as the target game server.
In the server allocation method provided in the foregoing embodiment, based on the identifier of the preset game mode, the target game server with the largest number of online players corresponding to the preset game mode is determined from the multiple idle game servers, so that the first client establishes a communication connection with the target game server, thereby avoiding waste of server resources caused by scattered distribution of players in the same game mode among different game servers, improving resource utilization of the game servers, and improving the aggregation of players in the same game mode among the game servers corresponding to the game mode, so that the activity among the players in the game servers in the game mode is higher, and improving game experience of the players.
On the basis of the above embodiments, the embodiments of the present application further provide a server allocation method. Referring to fig. 4, a flowchart of a server allocation method according to a third embodiment of the present invention is shown in fig. 4, where the step S30 includes:
s33: the plurality of idle game servers are ranked according to their online player numbers.
S34: and determining the game server with the largest number of online players as the target game server according to the sorted idle game servers.
According to the above description, when selecting a target game server from the idle game server list, it is necessary to sequentially traverse a plurality of idle game servers in the idle game server list, compare the number of online players of the current space game server with the previous idle game server, and determine the target game server with the largest number of online players until the last idle game server is traversed, and both the speed and the efficiency of the traversal process are low.
In this embodiment, in order to improve the speed and efficiency of determining the target game server, the central server may sort, in advance, the plurality of idle game servers in the idle game server list according to the number of online players of the plurality of idle game servers, so that when a game allocation request sent by the character server is received, the game server with the largest number of online players is determined to be the target game server directly according to a sorting result in the idle game server list.
In an alternative embodiment, the idle game servers may be sorted and numbered from large to small according to the number of online players of the idle game servers, and the idle game server with the smallest number may be determined as the target game server.
In this embodiment, the central server sorts and numbers the plurality of idle game servers in the idle game server list in descending order according to the number of online players of the plurality of idle game servers in advance. Wherein the number of idle game servers with a larger number of online players is smaller, and the number of idle game servers with a smaller number of online players is larger. When the central server receives the game allocation request sent by the character server, the idle game server with the minimum number can be directly determined as the target game server according to the sorting result recorded in advance in the idle game server list.
In another alternative embodiment, the idle game servers may be ranked and numbered from small to large according to the number of online players of the idle game servers, and the idle game server with the largest number may be determined as the target game server.
In this embodiment, the central server sorts and numbers the plurality of idle game servers in the idle game server list in descending order according to the number of online players of the plurality of idle game servers. Wherein, the number of the idle game server with the smaller number of the online players is smaller, and the number of the idle game server with the larger number of the online players is larger. When the central server receives the game allocation request sent by the character server, the idle game server with the largest number can be directly determined as the target game server according to the sorting result recorded in advance in the idle game server list.
It should be noted that, after the first game client establishes a connection with the target game server, the target game server will immediately send a notification message to the central server to indicate the central server that the first game client establishes a connection with the target game server, and the central server will update the number of online players of the target game server according to the notification message and update the ranking result in the idle game server list. When the number of online players of the target game server reaches a preset number of players threshold, the target game server is deleted from the free game server list.
The server allocation method provided by the above embodiment ranks the game servers according to the number of online players of the idle game servers, and determines the game server with the largest number of online players as the target game server according to the ranking result, so that the speed and efficiency of determining the target game server from the idle game servers are improved, and the game client can be connected to the target game server more quickly.
On the basis of the above embodiments, the embodiments of the present application further provide a server allocation method. Referring to fig. 5, a flowchart of a server allocation method according to a fourth embodiment of the present invention is shown in fig. 5, where the step S30 includes:
s35: and calculating the load balance degree of the idle game servers according to the number of the online players of the idle game servers and a preset player number threshold value.
S36: and determining the game server with the maximum load balance degree as a target game server according to the load balance degrees of the plurality of idle game servers.
In addition to determining the target game server directly according to the number of online players of the idle game servers, in this embodiment, the load balancing degrees of the idle game servers may be calculated according to the number of online players of the idle game servers and a preset player number threshold, and the idle game server with the largest load balancing degree may be determined as the target game server according to the load balancing degrees of the idle game servers. The load balance degree can represent the number of players and the player concentration degree of the idle game server, and the higher the load balance degree of the idle game server is, the more the number of players of the idle game server is, the higher the player concentration degree is; the lower the load balance of the idle game servers, the lower the number of players representing the idle game servers and the lower the player concentration. For example, the load balancing degree may be calculated by: the number of online players is a percentage of the preset number of players threshold.
In some embodiments, when the central server updates the number of online players of the target game server according to the notification message of the target game server, the load balance of the target game server is also updated in real time, and when the load balance of the target game server is 100%, the target game server is no longer an idle game server.
According to the server allocation method provided by the embodiment, the load balance degrees of the idle game servers are calculated according to the number of online players of the idle game servers and the preset number threshold of the players, so that the target game server with the maximum load balance degree is determined from the idle game servers, the first client side is in communication connection with the target game server, the waste of server resources caused by the scattered distribution of the players in different game servers is avoided, the resource utilization rate of the game servers is improved, the activity among the players in the game servers is higher by improving the aggregation of the players in the game servers, and the game experience of the players is improved.
On the basis of the above embodiments, the embodiments of the present application further provide a server allocation method. Referring to fig. 6, a schematic flowchart of a server allocation method according to a fifth embodiment of the present invention is shown, and as shown in fig. 6, the method further includes:
s41: and receiving a notification message sent by the target game server, wherein the notification message is used for indicating that the second game client logs out from the target game server.
S42: the number of online players of the target game server is updated according to the notification message.
In this embodiment, the second game client is a game client corresponding to one of the plurality of online players of the target game server, and when the second game client quits from the target game server, the target game server sends a notification message to the center server, and the center server decrements the number of online players of the target game server according to the notification message.
In some embodiments, the second game client logging out of the target game server may return to the primary interface of the network game for the player, or the second game client logs out directly from the character server. The main interface of the network game can be a world map or an interface corresponding to a play list.
It should be noted that, when all online players in the target game server quit, the target game server enters a dormant state, that is, the target game server only occupies the storage medium, but does not consume the resources of the processor, so that the resource waste of the server can be effectively avoided.
If the target game server determined from the plurality of game servers is in a dormant state, the target game server is pulled up only when the game client requests to establish communication connection with the target game server, so that resource waste of the server can be effectively avoided.
Referring to fig. 7, an interaction diagram of the server allocation method provided by the present invention is shown in fig. 7, where the method includes:
s101: the game client determines the address of the character server according to the player identity information.
S102: the game client sends a login request to the role server according to the address of the role server so as to log in the role server.
S103: and after determining that the login of the game client is successful, the role server sends a game allocation request to the central server.
S104: the central server determines a target game server from the plurality of game servers based on the game allocation request.
S105: the central server sends the identification of the target game server to the character server.
S106: the character server determines the address of the target game server according to the identification of the target game server.
S107: the character server sends the address of the target game server to the game client.
S108: and the game client establishes communication connection with the target game server according to the address of the target game server.
S109: the target game server sends a first notification message to the central server to instruct the central server to increase the number of online players of the target game server.
S110: the central server increases the number of online players of the target game server based on the first notification message.
Still further, the method further comprises:
s201: the game client logs out of the target game server.
S202: the target game server sends a second notification message to the central server to instruct the central server to reduce the number of online players of the target game server.
S203: the central server reduces the number of online players of the target game server based on the second notification message.
On the basis of the above embodiments, the embodiments of the present application further provide a server distribution device. Referring to fig. 8, a schematic structural diagram of a server distribution device provided in the present invention is shown in fig. 8, where the device includes:
a request receiving module 100, configured to receive a game allocation request of a first game client sent by a role server;
an idle game server determining module 200, configured to determine, from among the plurality of game servers, that a game server for which the number of online players does not reach a preset player number threshold is a plurality of idle game servers;
a target game server determining module 300, configured to determine, according to the number of online players of a plurality of idle game servers, a game server with the largest number of online players from the idle game servers as a target game server;
and an identifier sending module 400, configured to send an identifier of the target game server to the role server, where the identifier of the target game server is used to instruct the role server to notify the first game client to establish a communication connection with the target game server according to the identifier, so that the target game server executes a game logic corresponding to the first game client.
The server allocation apparatus provided in the above embodiment determines, based on a game allocation request of the first game client sent by the character server, that the number of online players does not reach the preset player number threshold from the plurality of game servers, and the target game server with the largest number of online players establishes a communication connection between the first client and the target game server, thereby avoiding waste of server resources caused by scattered distribution of players in different game servers, improving resource utilization rate of the game servers, and improving the aggregation of players in the game servers, so that the activity between players in the game servers is higher, and improving game experience of players.
Optionally, the game allocation request includes: presetting an identifier of a game mode, and determining a target game server 300, including:
the game mode selection unit is used for determining at least one idle game server corresponding to the preset game mode from the plurality of idle game servers according to the identifier of the preset game mode;
and the target game server determining unit is used for determining the game server with the largest number of online players from the at least one idle game server as the target game server according to the number of online players of the at least one idle game server.
Optionally, each game server has at least one game mode, and each game mode is provided on at least one game server.
Optionally, the target game server determining module 300 includes:
the sequencing unit is used for sequencing the idle game servers according to the number of the online players of the idle game servers;
and the target game server determining unit is further used for determining the game server with the largest number of online players as the target game server according to the sorted idle game servers.
Optionally, the sorting unit is specifically configured to sort and number the plurality of idle game servers from large to small according to the number of online players of the plurality of idle game servers;
and the target game server determining unit is specifically used for determining the idle game server with the smallest number as the target game server.
Optionally, the sorting unit is specifically configured to sort and number the idle game servers from small to large according to the number of online players of the idle game servers;
and the target game server determining unit is specifically used for determining the idle game server with the largest number as the target game server.
Optionally, the target game server determining module 300 includes:
the balance degree calculating unit is used for calculating the load balance degree of the idle game servers according to the number of the online players of the idle game servers and a preset player number threshold;
and the target game server determining unit is also used for determining the game server with the maximum load balance degree as the target game server according to the load balance degrees of the plurality of idle game servers.
Optionally, the apparatus further comprises:
and the number updating module is used for updating the number of the online players of the target game server.
Optionally, the apparatus further comprises:
the notification message receiving module is used for receiving a notification message sent by the target game server, wherein the notification message is used for indicating the second game client to quit from the target game server;
and the number updating module is also used for updating the number of the online players of the target game server according to the notification message.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Referring to fig. 9, which is a schematic diagram of a server provided in the present invention, as shown in fig. 9, a server 500 includes: a processor 501, a storage medium 502 and a bus, wherein the storage medium 502 stores program instructions executable by the processor 501, when the server 500 runs, the processor 501 communicates with the storage medium 502 through the bus, and the processor 501 executes the program instructions to execute the embodiment of the server allocation method. By way of example, the server 500 may be the central server 20 in a game server system as shown in fig. 1.
Specifically, the steps of the processor executing the server allocation method include:
receiving a game allocation request of a first game client sent by a role server;
determining the game servers of which the number of online players does not reach a preset player number threshold value from the plurality of game servers as a plurality of idle game servers;
determining a game server with the largest number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers;
and sending the identification of the target game server to the role server, wherein the identification of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes the game logic corresponding to the first game client.
In the server allocation method executed by the processor in the above embodiment, based on the game allocation request of the first game client sent by the character server, the target game server in which the number of online players does not reach the preset player number threshold and the number of online players is the largest is determined from the multiple game servers, so that the first client establishes communication connection with the target game server, thereby avoiding waste of server resources caused by scattered distribution of players in different game servers, improving the resource utilization rate of the game servers, and improving the activity among players in the game servers and the game experience of the players by improving the aggregation of the players in the game servers.
Optionally, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the embodiment of the server allocation method described above. Specifically, the steps of the computer program executing the server allocation method include:
receiving a game allocation request of a first game client sent by a role server;
determining the game servers of which the number of online players does not reach a preset player number threshold value from the plurality of game servers as a plurality of idle game servers;
determining a game server with the largest number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers;
and sending the identification of the target game server to the role server, wherein the identification of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes the game logic corresponding to the first game client.
In the server allocation method executed by the computer program in the above embodiment, based on the game allocation request of the first game client sent by the character server, the target game server in which the number of online players does not reach the preset player number threshold and the number of online players is the largest is determined from the multiple game servers, so that the first client establishes communication connection with the target game server, thereby avoiding waste of server resources caused by scattered distribution of players in different game servers, improving the resource utilization rate of the game servers, and improving the activity among players in the game servers and the game experience of the players by improving the aggregation of the players in the game servers.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (in english: processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and shall be covered by the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (13)
1. A server distribution method is applied to a central server, and the method comprises the following steps:
receiving a game allocation request of a first game client sent by a role server;
determining the game servers of which the number of online players does not reach a preset player number threshold value from the plurality of game servers as a plurality of idle game servers;
determining a game server with the largest number of online players from the idle game servers as a target game server according to the number of online players of the idle game servers;
and sending the identification of the target game server to the role server, wherein the identification of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identification, so that the target game server executes game logic corresponding to the first game client.
2. The method of claim 1, wherein the game allocation request comprises: presetting an identifier of a game mode, wherein the game server with the largest number of online players in the idle game servers is determined as a target game server according to the number of online players in the idle game servers, and the method comprises the following steps:
determining at least one idle game server corresponding to the preset game mode from the plurality of idle game servers according to the identifier of the preset game mode;
and determining the game server with the largest number of online players from the at least one idle game server as the target game server according to the number of online players of the at least one idle game server.
3. The method of claim 2, wherein each game server has at least one game mode, each game mode being provided on at least one game server.
4. The method of claim 1, wherein said determining a game server from the plurality of idle game servers that has the highest number of online players as a target game server based on the number of online players at the idle game servers comprises:
ranking the plurality of idle game servers according to the number of online players of the plurality of idle game servers;
and determining the game server with the largest number of online players as the target game server according to the sorted idle game servers.
5. The method of claim 4, wherein said ranking the plurality of idle game servers according to the number of online players of the plurality of idle game servers comprises:
according to the number of online players of the idle game servers, the idle game servers are sorted and numbered from big to small;
the determining, according to the sorted idle game servers, the game server with the largest number of online players as the target game server includes:
and determining the idle game server with the minimum number as the target game server.
6. The method of claim 4, wherein said ranking the plurality of idle game servers according to the number of online players of the plurality of idle game servers comprises:
according to the number of online players of the idle game servers, the idle game servers are sorted from small to large and numbered;
the determining, according to the sorted idle game servers, the game server with the largest number of online players as the target game server includes:
and determining the idle game server with the largest number as the target game server.
7. The method of claim 1, wherein said determining from among the idle game servers the game server with the highest number of online players as the target game server based on the number of online players for the plurality of idle game servers comprises:
calculating the load balance of the idle game servers according to the number of the online players of the idle game servers and the preset number threshold of the players;
and determining the game server with the maximum load balance degree as the target game server according to the load balance degrees of the idle game servers.
8. The method of claim 1, wherein after sending the identification of the target game server to the character server, the method further comprises:
updating the number of online players for the target game server.
9. The method of claim 1, wherein the method further comprises:
receiving a notification message sent by the target game server, wherein the notification message is used for indicating that a second game client logs out from the target game server;
and updating the number of online players of the target game server according to the notification message.
10. A game server system, characterized in that the game server system comprises: at least one character server, a center server, and a plurality of game servers;
said at least one character server is communicatively connected to said central server, said central server is further communicatively connected to said plurality of game servers, said central server is adapted to perform the steps of the server allocation method of any of the preceding claims 1-9.
11. A server distribution device, which is applied to a central server, the device comprising:
the request receiving module is used for receiving a game allocation request of the first game client sent by the role server;
the idle game server determining module is used for determining that the game servers with the online player number not reaching the preset player number threshold value are a plurality of idle game servers from the plurality of game servers;
a target game server determining module, configured to determine, according to the number of online players of the idle game servers, a game server with the largest number of online players from the idle game servers as a target game server;
and the identifier sending module is used for sending the identifier of the target game server to the role server, wherein the identifier of the target game server is used for indicating the role server to inform the first game client to establish communication connection with the target game server according to the identifier, so that the target game server executes game logic corresponding to the first game client.
12. A server, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the server is running, the processor executing the program instructions to perform the steps of the server allocation method according to any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the server allocation method according to any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210692318.5A CN115068934A (en) | 2022-06-17 | 2022-06-17 | Server distribution method, system, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210692318.5A CN115068934A (en) | 2022-06-17 | 2022-06-17 | Server distribution method, system, device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115068934A true CN115068934A (en) | 2022-09-20 |
Family
ID=83254321
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210692318.5A Pending CN115068934A (en) | 2022-06-17 | 2022-06-17 | Server distribution method, system, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115068934A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116764189A (en) * | 2023-04-27 | 2023-09-19 | 支付宝(杭州)信息技术有限公司 | Virtual space distribution method, device, medium, equipment and product |
-
2022
- 2022-06-17 CN CN202210692318.5A patent/CN115068934A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116764189A (en) * | 2023-04-27 | 2023-09-19 | 支付宝(杭州)信息技术有限公司 | Virtual space distribution method, device, medium, equipment and product |
CN116764189B (en) * | 2023-04-27 | 2024-05-14 | 支付宝(杭州)信息技术有限公司 | Virtual space distribution method, device, medium, equipment and product |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11896905B2 (en) | Methods and systems for continuing to execute a simulation after processing resources go offline | |
US10232252B2 (en) | Information processing system, information processing method, program, and information storage medium | |
US20140325070A1 (en) | Usage consumption for an invitee of a cloud system | |
CN110113414B (en) | Method, device, server and storage medium for managing copies | |
KR20180009352A (en) | Method and apparatus for data processing for mobile games | |
CN107480059B (en) | Method and device for acquiring operation sequence, storage medium, processor and server | |
CN112090074B (en) | Virtual article control method, device, equipment and medium in application | |
CN111760295A (en) | Information processing method and device, computer readable medium and electronic equipment | |
CN115068934A (en) | Server distribution method, system, device, server and storage medium | |
CN113343089A (en) | User recall method, device and equipment | |
CN111068305A (en) | Cloud game loading control method and device, electronic equipment and storage medium | |
CN113680050A (en) | Game request processing method and device, computer equipment and readable storage medium | |
CN113230665A (en) | Resource allocation method and device | |
CN112783790A (en) | Application program testing method and device | |
CN111359213A (en) | Method and apparatus for controlling virtual players in game play | |
CN111249747A (en) | Information processing method and device in game | |
CN113713388B (en) | Game data processing method, device, equipment and storage medium | |
US20140357374A1 (en) | Method and server for pvp team matching in computer games | |
CN108600341A (en) | A kind of service node distribution method, decision node and server cluster | |
CN109598551B (en) | Game lottery method and device with distributed server structure | |
CN110124306B (en) | Resource configuration information recommendation method, device, equipment and medium | |
CN107320963B (en) | Role attribute storage method and device, storage medium, processor and server | |
CN113158029A (en) | Content display method and device and computer readable storage medium | |
CN111346372A (en) | Game login loading method and device based on data backup and server | |
CN114849225B (en) | Server scheduling method and device, computer readable medium and electronic equipment |
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 |