Game process distribution control method, device and electronic device

By dynamically adjusting the weight and load of the game process in the matching server of multiplayer online tactical competitive games, the problem of server load imbalance is solved, and process load balancing and stability are improved.

CN114515429BActive Publication Date: 2024-11-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111551395.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2024-11-12
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In multiplayer online tactical competitive games, server load imbalance causes process load to rise sharply, affecting server stability.

Method used

By receiving process allocation requests in the matching server, obtaining the weight of each game process and the single game load, randomly selecting processes with weights greater than the preset threshold, and adjusting the weight of the target process according to the attenuation coefficient to avoid multiple games being allocated to The same process realizes load balancing.

Benefits of technology

It effectively avoids sudden process load increase, improves server stability and load balancing, and ensures the long-term operation ability of the game server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114515429B_ABST
    Figure CN114515429B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for controlling the allocation of a game process, which receives a process allocation request for a target game session; obtains the weight of each game process and the single-game load in a game server; wherein a plurality of game processes are running in the game server; determines a target process from the plurality of game processes according to the weight of each game process, and allocates the target game session in the process allocation request to the target process; and controls the weight of the target process to be reduced based on the single-game load of the target process. In this method, the target process is determined by the weight of the game process, and after the target game session is allocated to the target process, the weight of the target process is reduced according to the single-game load, thereby avoiding the problem that when there are fewer optional game processes, multiple game sessions are allocated to the same target process, resulting in a sudden increase in the target process load, thereby achieving load balancing of the game process and improving the stability of the game server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a method, device and electronic equipment for controlling the distribution of a game process. Background Art

[0002] Multiplayer online tactical competitive games usually have a large user base and generally use a distributed multi-server architecture to provide services. In order to balance the pressure on each server in the distributed multi-server architecture and ensure the stable operation of the server, in the relevant technology, the matching service server usually allocates appropriate game processes to the newly received games based on the CPU (Central Processing Unit) load sent by the game server. However, the server of a multiplayer online tactical competitive game has the characteristics of large concurrency, concentrated user connections, complex system status, and rapid load changes. When the allocation process receives multiple games and needs to allocate game processes to multiple games, there may be a problem of allocating multiple games to the same game process, resulting in a sudden increase in the load of the game process, and the server load balancing cannot be achieved, affecting the stability of the server. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a method, device and electronic device for controlling the distribution of a game process, so as to avoid the problem of a sudden increase in the load of the game process, achieve process load balancing, and improve the stability of the server.

[0004] In a first aspect, an embodiment of the present invention provides a method for controlling the allocation of a game process, which is applied to a matching server; the method comprises: receiving a process allocation request for a target game session; obtaining the weight of each game process and the single-game load in the game server; wherein a plurality of game processes are running in the game server; determining a target process from the plurality of game processes according to the weight of each game process, and allocating the target game session in the process allocation request to the target process; and controlling the weight of the target process to be reduced based on the single-game load of the target process.

[0005] Furthermore, according to the weight of each game process, a target process is determined from multiple game processes, and the step of allocating the target game sessions in the process allocation request to the target process includes: according to the weight of each game process, a process to be allocated having a weight greater than a preset threshold is determined from multiple game processes; according to the weight of the process to be allocated, a target process is determined from the processes to be allocated in a random manner, and the target game sessions in the process allocation request are allocated to the target process; wherein, the greater the weight of the process to be allocated, the greater the probability that the process to be allocated is determined as the target process.

[0006] Furthermore, multiple matching processes are run in the matching server; based on the single game load of the target process, the step of controlling the reduction of the weight of the target process includes: calculating the attenuation coefficient of the target process through the matching process; calculating the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process; subtracting the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.

[0007] Furthermore, the step of calculating the attenuation coefficient of the target process through matching processes includes: obtaining the first process number of all processes in multiple game processes, and the second process number of the process to be allocated; wherein the process to be allocated is a process in multiple game processes whose weight is greater than a preset threshold; obtaining the third process number in the multiple matching processes that is in a process allocation state; and calculating the attenuation coefficient of the target process based on the first process number, the second process number and the third process number.

[0008] Further, the step of calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number includes: calculating the attenuation coefficient of the target process by the following formula: Among them, TB represents the first process number; CB represents the second process number; M represents the third process number; and f represents the attenuation coefficient of the target process.

[0009] Furthermore, the step of calculating the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process includes: calculating the product value of the single game load and the attenuation coefficient of the target process, and determining the product value as the attenuation weight of the target process.

[0010] Furthermore, the weight of the game process is determined in the following manner: through the game process in the game server, the sampled load of the game process is obtained, that is, the first load occupied by the game sessions that will be added to the game process, and the second load occupied by the game sessions that are in the preparation state and the pause state in the game process; based on the sampled load, the first load and the second load, the weight of the game process is calculated.

[0011] Furthermore, the single-game load of the game process is determined in the following manner: through the game process in the game server, the single-game load of the game process is calculated according to the sampled load of the game process and the number of game fields in the game state in the game process.

[0012] In a second aspect, an embodiment of the present invention provides a game process allocation control device, which is arranged in a matching server; the device includes: a receiving module, used to receive a process allocation request for a target game session; an acquisition module, used to obtain the weight of each game process and the single-game load in the game server; wherein multiple game processes are running in the game server; an allocation module, used to determine the target process from the multiple game processes according to the weight of each game process, and allocate the target game session in the process allocation request to the target process; and a control module, based on the single-game load of the target process, controls the weight of the target process to be reduced.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, characterized in that it includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the game process allocation control method of any one of the first aspects.

[0014] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the game process allocation control method of any one of the first aspects.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The present invention provides a method, device and electronic device for controlling the allocation of a game process, which receives a process allocation request for a target game session; obtains the weight of each game process and the single-game load of a game session in a game server; wherein a plurality of game processes are running in the game server; determines a target process from the plurality of game processes according to the weight of each game process, and allocates the target game session in the process allocation request to the target process; and controls the weight of the target process to be reduced based on the single-game load of the target process. In this method, the target process is determined by the weight of the game process, and after the target game session is allocated to the target process, the weight of the target process is reduced, thereby avoiding the problem of multiple game sessions being allocated to the same target process, resulting in a sudden increase in the load of the target process, and at the same time achieving load balancing of the game process and improving the stability of the game server.

[0017] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0018] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flowchart of a method for controlling the distribution of a game process provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of state changes during a game process provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of a specific game server provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of the structure of a distribution control device for a game process provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0026] At present, with the development of online games, MOBA (Multiplayer Online Battle Arena) online games gradually have a large user base, and MOBA games usually use a distributed multi-server architecture to provide services. In order to balance the pressure on each server in the distributed multi-server architecture and ensure the stable operation of the server, in the relevant technology, the matching service server usually allocates appropriate game processes to the newly received games based on the CPU (Central Processing Unit) load sent by the game server. For example, load balancing solutions based on Nginx (a high-performance HTTP and reverse proxy web server) and load balancing solutions based on microservices, among which the load balancing algorithms include polling, random method, original address hash method, minimum number of connections, etc. Taking the load balancing solution based on Nginx as an example, it uses a unified reverse proxy center to provide services to the client, which is mostly used in Web application clusters. The load balancing algorithms used include: weighted polling, minimum number of connections, ip address mapping, etc.

[0027] However, unlike the traditional Internet, users of game servers are highly interactive and highly state-variable, and are particularly sensitive to delays. The server or process load is obtained only by sampling. When the matching process receives multiple games and needs to allocate game processes to multiple games, and the load of most game processes reaches saturation, there may be a problem of allocating multiple games to the same game process, resulting in a sudden increase in the load of the game process, and the server load cannot be balanced, affecting the stability of the server. Based on this, the embodiments of the present invention provide a method, device and electronic device for controlling the allocation of game processes. The technology can be applied to matching servers, and in particular, can be applied to devices with the function of allocating game processes to game sessions.

[0028] To facilitate understanding of this embodiment, a method for controlling the distribution of a game process disclosed in an embodiment of the present invention is first described in detail. The method is applied to a matching server. The game may be a battle-related game, and the game process includes at least one battle; Figure 1 As shown, the method comprises the following steps:

[0029] Step S102, receiving a process allocation request for a target game session;

[0030] The above-mentioned process allocation request for the target game session may be sent by the client, and the process allocation request includes the target game session. After receiving the process allocation request, the matching server needs to allocate the target game session to the appropriate game process. The above-mentioned matching server refers to a server that carries the player logic required for matching a single game. Multiple matching processes are running in the server, which is used to allocate the appropriate game process to the target game session in the received process matching request. Specifically, the central process in the game server receives the process allocation request for the target game session, and then sends the request to one of the matching processes, or one of the matching processes directly receives the process allocation request for the target game session.

[0031] Step S104, obtaining the weight of each game process and the load of a single game in the game server; wherein a plurality of game processes are running in the game server;

[0032] The game server is connected to the matching server in communication; the game may be a game related to combat, the game process may be a combat process related to combat, and the game process usually includes multiple games or combats. Specifically, the game server will send the weight of each game process and the load of a single game to the matching server at every sampling period, and the matching process in the matching server will save the received weight of each game process and the load of a single game to the local space during the sampling period. Alternatively, the matching process in the matching server can pull the weight and load of each game process from the game server during the sampling period and save them in the local space.

[0033] For each game process, the matching server will receive the weight of the process and the load of a single game. The larger the weight, the smaller the load of the game process, and the greater the possibility of being assigned a game session.

[0034] Step S106, determining a target process from multiple game processes according to the weight of each game process, and allocating the target game session in the process allocation request to the target process;

[0035] Specifically, the game processes can be sorted according to the order of weight from large to small, and then the preset number of game processes to be allocated in the front can be extracted, and the game processes to be allocated with a value greater than the preset weight can be extracted, wherein the game processes to be allocated can be one or more, and then a target process is selected from the game processes to be allocated by random selection; or the game process with the largest weight can be selected from the game processes to be allocated as the above target process; or the target process can be selected from the game processes to be allocated in order of arrangement. In addition, the target process can be directly determined randomly from multiple game processes according to the weight size. Generally, the greater the weight, the greater the probability of being selected. After the target process is determined, the target game session in the process allocation request can be allocated to the target process.

[0036] Step S108, based on the single game load of the target process, controlling the weight of the target process to be reduced.

[0037] In order to avoid the problem of allocating multiple game sessions to the same game process when allocating game sessions according to the weights saved in the local space, the weight of the target process can be reduced while allocating the target game session in the process allocation request to the target process, so that the matching process can allocate the target game session according to the latest weight information when subsequently allocating the target game session.

[0038] Specifically, the weight of the target process saved in the local space can be subtracted from the load of a single game to obtain the reduced weight of the target process. Alternatively, the weight value that needs to be reduced can be calculated based on the number of processes of the current game process and the matching process, and then the weight of the target process saved in the local space can be subtracted from the weight value to obtain the reduced weight of the target process.

[0039] The embodiment of the present invention provides a method for controlling the allocation of a game process, receiving a process allocation request for a target game session; obtaining the weight of each game process and the single-game load in a game server; wherein a plurality of game processes are running in the game server; determining a target process from the plurality of game processes according to the weight of each game process, and allocating the target game session in the process allocation request to the target process; and controlling the weight of the target process to be reduced based on the single-game load of the target process. In this method, the target process is determined by the weight of the game process, and after the target game session is allocated to the target process, the weight of the target process is reduced according to the single-game load, thereby avoiding the problem that when there are fewer optional game processes, multiple game sessions are allocated to the same target process, resulting in a sudden increase in the target process load, thereby achieving load balancing of the game process and improving the stability of the game server.

[0040] The following describes the specific implementation process of the steps of determining a target process from multiple game processes according to the weight of each game process, and allocating the target game sessions in the process allocation request to the target process. A possible implementation method is: according to the weight of each game process, determine the to-be-allocated process whose weight is greater than a preset threshold from multiple game processes; according to the weight of the to-be-allocated process, determine the target process from the to-be-allocated process in a random manner, and allocate the target game sessions in the process allocation request to the target process; wherein, the greater the weight of the to-be-allocated process, the greater the probability that the to-be-allocated process is determined as the target process

[0041] The above-mentioned preset threshold is usually set in advance according to actual needs, such as 10%, 5%, 1%, etc. Usually, the preset threshold is small, and can even be 0; or the above-mentioned preset threshold can be set according to the number of game processes with a weight greater than a certain value. If there are many game processes with a weight greater than 10%, the above-mentioned preset threshold can be set larger, such as 15%. If there are fewer game processes with a weight greater than 10%, the above-mentioned preset threshold can be set smaller, such as 5%, 1%, etc. The number of processes to be allocated can be controlled by controlling the size of the preset threshold. In addition, the number of processes to be allocated is usually multiple.

[0042] Specifically, after the processes to be allocated are determined, the target process is generally determined from the processes to be allocated in a random manner. In actual implementation, the weight of each process to be allocated can be determined as the probability of being randomly selected. For example, if the weight of the process to be allocated is 90%, the probability of the process to be allocated being determined as the target process is 0.9. It can be understood that all the processes to be allocated are in a disk, and the area of ​​the disk occupied by each process to be allocated is determined according to the weight. The larger the weight, the larger the area occupied. Then, by rotating the pointer, the process to be allocated that the pointer points to when it stops is determined as the target process. Finally, the target game session in the process allocation request is allocated to the target process. Of course, after reducing the weight, the above steps will be repeated when matching the game process for the target game session again, and the target process will be re-determined according to the reduced weight.

[0043] In the above method, by setting a preset threshold, the to-be-allocated processes with larger weights and smaller loads are first determined, and then the probability of each to-be-allocated process being determined as the target process is determined by the weight of the to-be-allocated processes. Finally, the target process is determined among the to-be-allocated processes, and the target game sessions in the process allocation request are allocated to the target process. This method can make it more likely that the target game sessions will go to processes with larger weights and lower pressure.

[0044] The above matching server runs multiple matching processes; each matching process stores the weight of each game process and the load of a single game, and also controls the weight reduction of each matching process. The following describes the specific implementation process of controlling the weight reduction of the target process based on the load of a single game of the target process, and a possible implementation method:

[0045] (1) Calculate the attenuation coefficient of the target process by matching the process;

[0046] In order to make the reduced weight value more consistent with the actual operating status, the weight value to be reduced can be determined based on the currently working matching process, the process to be allocated, and the load of a single game. First, the attenuation coefficient of the target process can be calculated.

[0047] A possible implementation method is as follows: obtaining the first process number of all processes in multiple game processes, and the second process number of the process to be allocated; wherein the process to be allocated is a process in the multiple game processes whose weight is greater than a preset threshold; obtaining the third process number in the process allocation state in the multiple matching processes; and calculating the attenuation coefficient of the target process based on the first process number, the second process number and the third process number.

[0048] The first process number is the number of all game processes running in the game server, the second process number is the number of processes to be allocated, and the third process number is the number of processes in the working state (or in the allocated state) among the multiple matching processes running in the matching process at the current moment. After obtaining the three process numbers, the attenuation coefficient of the target process can be calculated according to a preset formula.

[0049] Specifically, the attenuation coefficient of the target process can be calculated by the following formula:

[0050]

[0051] Among them, TB represents the first process number; CB represents the second process number; M represents the third process number; and f represents the attenuation coefficient of the target process.

[0052] (2) Calculate the attenuation weight of the target process based on the single game load and the attenuation coefficient of the target process;

[0053] A possible implementation method is to calculate the product of the single game load and the attenuation coefficient of the target process, and determine the product as the attenuation weight of the target process. Specifically, the attenuation weight of the target process can be calculated by the following formula:

[0054] Δw=f*PB(cpu);

[0055] Among them, f represents the attenuation coefficient of the target process, PB(cpu) represents the single game load of the target process, and Δw represents the attenuation weight of the target process.

[0056] (3) Subtract the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.

[0057] Specifically, the weight of the reduced target process is calculated using the following formula:

[0058] W′=W-Δw;

[0059] Wherein, W represents the received weight of the target process, and W′ represents the reduced weight of the target process.

[0060] It can be understood that when the third process number M is larger, that is, the number of processes in working state (or in allocation state) at the current moment is larger, the first process number TB is larger, that is, the number of all game processes running in the game server is larger, and the second process number CB is smaller, that is, the number of processes to be allocated is smaller, the above-mentioned attenuation coefficient f is larger, and the attenuation weight calculated according to the attenuation coefficient will be larger at this time, and the weight of the target process after reduction will be smaller. At this time, the probability of the target process being allocated multiple game sessions will be reduced, and the problem of sudden increase in the load of the target process will also be reduced. Of course, if the weight of the target process is not reduced at this time, it may result in more game sessions that may be allocated to a certain target process at the same time, resulting in a sudden increase in the load of the target process.

[0061] For example, the weight of the target process is 1, and the load of a single game is 0.2. It is sent to the matching process and saved in the local space. A process matching request is received within the sampling period. After the game matches in the process matching request are assigned to the target process, the weight of the target process is reduced. If the weight of the target process is directly reduced to 1-0.2=0.8, a maximum of 4 games can be assigned to the target process within this sampling period; if the attenuation coefficient f increases to 2, the attenuation weight becomes 0.4, and after assigning another game, the weight of the target process becomes 0.8-0.4=0.4, and only one game can be assigned thereafter.

[0062] In this method, the weight saved in the matching process is set to a dynamic value by reducing the weight. After attenuation, the weight of the target process will decrease, thereby avoiding the problem of constantly allocating game sessions to the same target process, thereby achieving load balancing and improving server stability.

[0063] The larger the third process number M is, the larger the first process number TB is, and the smaller the second process number CB is, which can be understood as a CPU load critical value problem. When the CPU load of most game processes reaches saturation and cannot be directly selected, a large number of newly arrived game sessions will flood into a small number of game processes that can be directly selected, causing a sudden increase in CPU load. In this embodiment, the matching server locally caches the target process weight within the sampling interval, which can not only predict the load changes of each game process within the sampling period interval, but also control the frequency of selecting the same game process by the same matching process in a short period of time, thereby avoiding the critical value problem.

[0064] The following describes a method for calculating the weight of a game process: through the game process in the game server, obtain a sample load of the game process, that is, a first load occupied by game sessions that will be added to the game process, and a second load occupied by game sessions that are in a ready state and a paused state in the game process; calculate the weight of the game process based on the sample load, the first load, and the second load.

[0065] Usually, there are multiple game states in online games, such as ready state, pause state, and game state. Different states consume different CPU loads, and there is a certain conversion relationship between the states, such as Figure 2 A schematic diagram of state changes in a game process is shown, in which the game sessions in the game state (corresponding to BATTLE in the figure) need to constantly synchronize the player's position and operation, so the game sessions in the game state occupy a higher CPU load, while the game sessions in the preparation state (corresponding to WAIT in the figure) and the pause state (corresponding to PAUSE in the figure) consume relatively less CPU load because the players do not need to move and operate. However, since the game sessions in the preparation state and the pause state are likely to be randomly switched to the game state, in order to ensure that each game session in the game process can run stably, the game process needs to reserve enough load space for the game sessions in the preparation state and the pause state, so as to bear the load changes caused by the game switching state of the game sessions in the preparation state and the pause state at any time. That is, the game sessions in the preparation state and the pause state can be calculated as the game sessions in the game state.

[0066] In addition, since the sampling process for determining the sampling load is usually periodic, for a low-load game process, more game sessions will usually be allocated to the game process during the sampling interval, resulting in large fluctuations in the CPU load of the game process. To avoid this problem, the upcoming game sessions in each game process can be predicted. For example, the game sessions that may be allocated to the current game process within 5 seconds, and then the CPU load consumed by these game sessions can be pre-determined into the load occupied by the game process.

[0067] Specifically, we can obtain the sample load Y(t) of each game process, the number of games that will be added to the game process C(t), the number of games in the preparation state and the pause state N(t) in the game process, and the number of games in the game state B(t) in the game process. Then, according to the formula Calculate the first load occupied by the game session that will be added to the game process; according to the formula The second load occupied by the game sessions in the ready state and the paused state in the game process is calculated. Specifically, the predicted load of each game process is calculated according to the following prediction model:

[0068]

[0069] Wherein, T(cpu) represents the predicted load of the game process at the current moment; a, b, c are the model parameters of the prediction model; Indicates the CPU load occupied by each game session in the game state. Then the weight of each game process is calculated according to the formula W=1-T(cpu). In this method, the current state of each game session in the game process and the game session that is about to join the game process are taken into account, and the load occupied by the game session that is about to join the game process and is in the preparation and pause state is reserved for the game process, so that the final determined process load is more in line with the actual game operation, improving the accuracy of the process load, and thus improving the stability of the server.

[0070] In addition, the game sessions that will be added to the game process can be calculated in the following way:

[0071] C(t)=αS(t)+(1-α)C(t-1);

[0072] Among them, C(t) represents the game session that will be added to the game process at time t; S(t) represents the current game session of the game process at time t; C(t-1) represents the historical game session added to the game process at the previous moment; α is the preset weight coefficient; 0<α<1. It can be understood that the above C(t) is the game session that will be added to the game process in the next sampling cycle in the game process; the above S(t) is the current game session newly added to the game process at the current moment, that is, the current game session newly added to the game process in the current sampling cycle; C(t-1) is the historical game session added to the game process in the previous sampling cycle.

[0073] It is understandable that the longer the time is, the smaller the coefficient of the earliest historical game session is, and the smaller the impact on the first game session is, thereby achieving the goal of controlling the load of the newly added game process from a larger value to gradually decrease to the real value.

[0074] Usually at the beginning of a game process, when the game server just starts running or when the process is expanded, if the newly expanded game process obtains the CPU load in the current sampling method and the obtained load is low, a large number of game sessions may be allocated to the game process, causing a sudden increase in the CPU load of the process. Through the above-mentioned exponential smoothing model, by setting the initial value, the number of newly added game sessions of the game process can be controlled to gradually decrease from a higher value to the true value. At the same time, by controlling the number of game sessions that are about to be added to the game process, the weight of the game process can be controlled to be gradually reduced from a smaller value to the true weight value over time.

[0075] The following describes the calculation method of the single game load of the game process: through the game process in the game server, according to the sampling load of the game process and the number of games in the game state in the game process, the single game load of the game process is calculated.

[0076] In actual implementation, the single game load of the game process at each moment in the preset historical time period can be calculated based on the sampled load of the game process at each moment in the historical time period and the number of games in the game state; the average single game load of the game process at each moment in the historical time period is calculated to obtain the single game load of the game process at the current moment.

[0077] Specifically, the following sliding window average method can be used to predict the load of a single game:

[0078]

[0079] The single-game load calculated in the above manner takes into account the single-game load in the historical time period, and the predicted result is more realistic and more in line with the actual running status of the game.

[0080] For details, see Figure 3 The schematic diagram of the specific game server shown is that a multiplayer online tactical competitive game is usually a distributed multi-server architecture, which includes multiple battle servers (corresponding to the aforementioned game servers) that carry the game battle logic, such as battle server 1 and battle server 2 in the figure. It also includes multiple matching servers (corresponding to the aforementioned matching servers) that carry the player logic required for matching a single battle. Each battle server runs multiple battle processes (corresponding to the aforementioned game processes) and a central process. Similarly, each matching server runs multiple matching processes and a central process. Each battle server communicates with the matching server through the central process. Each battle process in the battle server communicates with the central process, and each matching process in the matching server communicates with the central process.

[0081] This embodiment is based on a distributed system of multiple battle servers and multiple matching servers, in which each battle process establishes a connection with the central process on the battle server, and the central process establishes a connection with the matching process. In the matching process, this embodiment selects a server selection algorithm based on weighted randomness, and the server selection steps generally include:

[0082] Step 1. Each battle process periodically samples the CPU load usage Y(t) on the battle process, observes the newly arrived battles S(t) from time t-1 to time t, the battles N(t) being prepared and paused at time t, and the battles B(t) currently in progress.

[0083] Step 2. Each battle process is based on the formula Calculate PB(t) and based on the formula Perform sliding window averaging on PB(t) to predict the average value PB(cpu) over a period of time, based on the formula Calculate C(t) and synchronize Y(t), C(t), N(t) and PB(cpu) to the current battle service center process.

[0084] Step 3. The combat service center process calculates the total CPU load T(cpu) of each combat process based on the collected information; then calculates the weight of each combat process according to the formula W=1-T(cpu).

[0085] Step 4. The battle server center process sends all current battle process weight information and PB (cpu) to the matching server.

[0086] Step 5. The matching process pulls and caches all battle process weight information and PB (cpu), and selects the server through weighted randomness when a new battle arrives. After each selection, the local weight of the battle process is subtracted from Δw. If the weights of all optional battle processes are reduced to 0, it will fall back to pure random server selection.

[0087] Corresponding to the above method embodiment, the embodiment of the present invention further provides a distribution control device for a game process, which is arranged in a matching server, such as Figure 4 As shown, the device comprises:

[0088] A receiving module 41 is used to receive a process allocation request for a target game session;

[0089] The acquisition module 42 is used to obtain the weight of each game process and the load of a single game in the game server; wherein a plurality of game processes are running in the game server;

[0090] An allocation module 43, configured to determine a target process from a plurality of game processes according to a weight of each game process, and allocate the target game session in the process allocation request to the target process;

[0091] The control module 44 controls the weight of the target process to be reduced based on the single game load of the target process.

[0092] The embodiment of the present invention provides a distribution control device for a game process, which receives a process distribution request for a target game session; obtains the weight of each game process and the single-game load in the game server; wherein the game server runs multiple game processes; determines the target process from the multiple game processes according to the weight of each game process, and distributes the target game session in the process distribution request to the target process; and controls the weight of the target process to be reduced based on the single-game load of the target process. In this method, the target process is determined by the weight of the game process, and after the target game session is distributed to the target process, the weight of the target process is reduced according to the single-game load, thereby avoiding the problem that when there are fewer optional game processes, multiple game sessions are distributed to the same target process, resulting in a sudden increase in the target process load, thereby achieving load balancing of the game process and improving the stability of the game server.

[0093] Furthermore, the above-mentioned allocation module is also used to: determine the to-be-allocated process whose weight is greater than a preset threshold from multiple game processes according to the weight of each game process; determine the target process from the to-be-allocated process in a random manner according to the weight of the to-be-allocated process, and allocate the target game session in the process allocation request to the target process; wherein, the greater the weight of the to-be-allocated process, the greater the probability that the to-be-allocated process is determined as the target process.

[0094] Furthermore, multiple matching processes are running in the above-mentioned matching server; the above-mentioned control module is also used to: calculate the attenuation coefficient of the target process through the matching process; calculate the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process; subtract the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.

[0095] Furthermore, the above-mentioned control module is also used to: obtain the first process number of all processes in multiple game processes, and the second process number of the process to be allocated; wherein the process to be allocated is a process in multiple game processes whose weight is greater than a preset threshold; obtain the third process number in the process allocation state in multiple matching processes; calculate the attenuation coefficient of the target process based on the first process number, the second process number and the third process number.

[0096] Furthermore, the control module is also used to calculate the attenuation coefficient of the target process by the following formula: Among them, TB represents the first process number; CB represents the second process number; M represents the third process number; and f represents the attenuation coefficient of the target process.

[0097] Furthermore, the control module is also used to calculate the product value of the single game load and the attenuation coefficient of the target process, and determine the product value as the attenuation weight of the target process.

[0098] Furthermore, the weight of the above-mentioned game process is determined in the following manner: through the game process in the game server, the sampled load of the game process is obtained, that is, the first load occupied by the game sessions to be added to the game process, and the second load occupied by the game sessions in the ready state and the paused state in the game process; the weight of the game process is calculated based on the sampled load, the first load and the second load.

[0099] Furthermore, the single game load of the above-mentioned game process is determined in the following manner: through the game process in the game server, the single game load of the game process is calculated according to the sampling load of the game process and the number of game fields in the game state in the game process.

[0100] The game process allocation control device provided in the embodiment of the present invention has the same technical features as the game process allocation control method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.

[0101] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned game process allocation control method. The electronic device can be a server or a terminal device.

[0102] See also Figure 5 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores machine executable instructions that can be executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the above-mentioned distribution control method of the game process.

[0103] Further, Figure 5 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0104] The memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0105] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0106] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned game process allocation control method.

[0107] The computer program products of the game process distribution control method, device, electronic device and system provided in the embodiments of the present invention include a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0108] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0109] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0110] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0111] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0112] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for controlling the distribution of a game process, characterized in that: The method is applied to a matching server; the method comprises: Receiving a process allocation request for a target game session; Obtaining the weight of each game process and the load of a single game in a game server; wherein the game server runs multiple game processes; According to the weight of each of the game processes, a target process is determined from the multiple game processes, and the target game session in the process allocation request is allocated to the target process; the weight of the target process is greater than a preset threshold, or the target process is a game process that is at the first position in the game process sequence and is at a position between the first position and a specified position; the game process sequence is formed by arranging the multiple game processes from large to small according to the weight; Based on the single game load of the target process, the weight of the target process is controlled to be reduced.

2. The method according to claim 1, characterized in that The step of determining a target process from the plurality of game processes according to the weight of each of the game processes, and allocating the target game session in the process allocation request to the target process comprises: According to the weight of each of the game processes, determining a process to be allocated having a weight greater than a preset threshold from the multiple game processes; According to the weight of the process to be assigned, the target process is determined from the processes to be assigned in a random manner, and the target game session in the process assignment request is assigned to the target process; wherein, the greater the weight of the process to be assigned, the greater the probability that the process to be assigned is determined as the target process.

3. The method according to claim 1, characterized in that A plurality of matching processes are running in the matching server; The step of controlling the weight reduction of the target process based on the single game load of the target process includes: Calculating the attenuation coefficient of the target process through the matching process; Calculating the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process; The attenuated weight is subtracted from the weight of the target process to obtain a reduced weight of the target process.

4. The method according to claim 3, characterized in that The step of calculating the attenuation coefficient of the target process through the matching process includes: Obtaining a first process number of all processes in the multiple game processes and a second process number of a process to be allocated; wherein the process to be allocated is a process in the multiple game processes whose weight is greater than a preset threshold; Obtaining the number of third processes in the process allocation state among the multiple matching processes; The attenuation coefficient of the target process is calculated according to the first process number, the second process number and the third process number.

5. The method according to claim 4, characterized in that The step of calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number comprises: The attenuation coefficient of the target process is calculated by the following formula: Among them, TB represents the first process number; CB represents the second process number; M represents the third process number; f represents the attenuation coefficient of the target process.

6. The method according to claim 3, characterized in that The step of calculating the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process comprises: The product value of the single game load and the attenuation coefficient of the target process is calculated, and the product value is determined as the attenuation weight of the target process.

7. The method according to claim 1, characterized in that The weight of the game process is determined in the following way: Obtaining a sample load of the game process through the game process in the game server, that is, a first load occupied by game sessions added to the game process, and a second load occupied by game sessions in a ready state and a paused state in the game process; The weight of the game process is calculated according to the sampled load, the first load, and the second load.

8. The method according to claim 1, characterized in that The single game load of the game process is determined in the following way: The single-game load of the game process is calculated through the game process in the game server according to the sampling load of the game process and the number of game fields in the game state in the game process.

9. A distribution control device for a game process, characterized in that: The device is arranged on a matching server; the device comprises: A receiving module, used for receiving a process allocation request for a target game session; An acquisition module, used to acquire the weight of each game process and the load of a single game in the game server; wherein the game server runs multiple game processes; an allocation module, configured to determine a target process from the plurality of game processes according to the weight of each of the game processes, and allocate the target game session in the process allocation request to the target process; the weight of the target process is greater than a preset threshold, or the target process is a game process that is at the first position in the game process sequence and is at a position between the first position and a specified position; the game process sequence is formed by arranging the plurality of game processes in descending order according to the weight; The control module controls the weight of the target process to be reduced based on the single game load of the target process.

10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the distribution control method of the game process described in any one of claims 1-8.

11. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the game process distribution control method described in any one of claims 1-8.

Citation Information

Patent Citations

  • Network protecting method and device based on game platform

    CN105561580A

  • Server load balancing method and device

    CN110209500A

  • Load balancing method and device, computer readable storage medium and electronic equipment

    CN112181664A

  • Load balancing system and method for rendering service in cloud gaming environment

    US20150196841A1