CN114515429A - Game process distribution control method and device and electronic equipment - Google Patents

Game process distribution control method and device and electronic equipment Download PDF

Info

Publication number
CN114515429A
CN114515429A CN202111551395.0A CN202111551395A CN114515429A CN 114515429 A CN114515429 A CN 114515429A CN 202111551395 A CN202111551395 A CN 202111551395A CN 114515429 A CN114515429 A CN 114515429A
Authority
CN
China
Prior art keywords
game
target
weight
load
processes
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
Application number
CN202111551395.0A
Other languages
Chinese (zh)
Inventor
周晓
王曦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111551395.0A priority Critical patent/CN114515429A/en
Publication of CN114515429A publication Critical patent/CN114515429A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • A63F13/358Adapting the game course according to the network or server load, e.g. for reducing latency due to different connection speeds between clients
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/847Cooperative playing, e.g. requiring coordinated actions from several players to achieve a common goal

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for controlling the distribution of game processes and electronic equipment, which receive a process distribution request aiming at a target game field; acquiring the weight and the single-game load of each game process in a game server; wherein the game server runs a plurality of game processes; determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution 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 the method, the target process is determined by the weight of the game process, and after the target game field is distributed to the target process, the weight of the target process is reduced according to the load of a single game, so that the problem that the load of the target process suddenly rises due to the fact that a plurality of game fields are distributed to the same target process under the condition that the number of selectable game processes is small is solved, the load balance of the game process is realized, and the stability of the game server is improved.

Description

Game process distribution control method and device and electronic equipment
Technical Field
The present invention relates to the field of game technologies, and in particular, to a method and an apparatus for controlling allocation of a game process, and an electronic device.
Background
Multiplayer online tactical competitive games typically have a large base of users and are typically served using a distributed multi-server architecture. In order to balance the pressure borne by each server in the distributed multi-server architecture and ensure stable operation of the servers, in the related art, the matchmaker server generally allocates an appropriate game process to a newly received game based on a Central Processing Unit (CPU) load sent by the game server. However, the server of the multiplayer online tactical competitive game has the characteristics of large concurrency, centralized user connection, complex system state, fast load change and the like, when the distribution process receives a plurality of games and needs to distribute the game processes to the plurality of games, the problem of distributing the plurality of games to the same game process may occur, so that the load of the game process suddenly rises, the load balance of the server cannot be realized, and the stability of the server is influenced.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, and an electronic device for controlling allocation of a game process, so as to avoid a problem of sudden load increase of the game process, implement process load balancing, and improve stability of a server.
In a first aspect, an embodiment of the present invention provides a method for controlling allocation of a game process, where the method is applied to a matching server; the method comprises the following steps: receiving a progress allocation request for a target game session; acquiring the weight and the single-game load of each game process in a game server; wherein, a plurality of game processes run in the game server; determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution 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.
Further, the step of determining a target course from the plurality of game courses according to the weight of each game course and allocating the target game session in the course allocation request to the target course includes: determining a process to be distributed with the weight larger than a preset threshold value from a plurality of game processes according to the weight of each game process; determining a target process from the processes to be distributed in a random mode according to the weight of the processes to be distributed, and distributing the target game field in the process distribution request to the target process; the greater the weight of the process to be allocated, the greater the probability that the process to be allocated is determined to be the target process.
Furthermore, a plurality of matching processes are operated 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 comprises the following steps: 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; and subtracting the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.
Further, the step of calculating the attenuation coefficient of the target process by the matching process includes: acquiring a first process number of all processes in a plurality of game processes and a second process number of processes to be distributed; the process to be distributed is a process with the weight larger than a preset threshold value in a plurality of game processes; acquiring a third process number in a process distribution state in the plurality of matched processes; and calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number.
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:
Figure BDA0003417700680000021
wherein TB represents a first number of passes; CB represents a second process number; m represents a third process number; f represents the attenuation coefficient of the target process.
Further, 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 following steps: and calculating the product value of the single-field game load and the attenuation coefficient of the target process, and determining the product value as the attenuation weight of the target process.
Further, the weight of the game progress is determined by: acquiring sampling load of a game process through the game process in a game server, namely a first load occupied by a game field to be added into the game process and a second load occupied by a game field in a preparation state and a pause state in the game process; and calculating the weight of the game progress according to the sampling load, the first load and the second load.
Further, the single game load of the game progress is determined by: and calculating the single-field game load of the game process according to the sampling load of the game process and the number of the game fields in the game state in the game process through the game process in the game server.
In a second aspect, an embodiment of the present invention provides a device for controlling allocation of a game process, where the device is disposed in a matching server; the device comprises: the receiving module is used for receiving a progress distribution request aiming at the target game field; the acquisition module is used for acquiring the weight of each game process and the load of a single game in the game server; wherein, a plurality of game processes run in the game server; the distribution module is used for determining a target process from a plurality of game processes according to the weight of each game process and distributing the target game field in the process distribution request to the target process; and the control module is used for controlling the weight reduction of the target process based on the single game load of the target process.
In a third aspect, an embodiment of the present invention provides an electronic device, which is characterized by including a processor and a memory, where the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to implement the allocation control method for a game process according to any one of the first aspect.
In a fourth aspect, embodiments of the invention provide a machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the allocation control method of a game process of any one of the first aspects.
The embodiment of the invention has the following beneficial effects:
the invention provides a method and a device for controlling the distribution of game processes and electronic equipment, which receive a process distribution request aiming at a target game field; acquiring the weight and the single-game load of each game process in a game server; wherein the game server runs a plurality of game processes; determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution 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 the method, the target process is determined by the weight of the game process, and after the target game field is distributed to the target process, the weight of the target process is reduced, so that the problem that the load of the target process suddenly rises due to the fact that a plurality of game fields are distributed to the same target process is solved, meanwhile, the load balance of the game process is realized, and the stability of the game server is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a method for controlling distribution of a game process according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a state change in a game process according to an embodiment of the present invention;
FIG. 3 is a diagram of a specific game server according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a distribution control device for game process according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
At present, with the development of network games, network games such as MOBA (Multiplayer Online Battle Arena) gradually have a larger user base, and the MOBA games generally adopt a distributed multi-server architecture to provide services. In order to balance the pressure borne by each server in the distributed multi-server architecture and ensure stable operation of the servers, in the related art, the matchmaker server generally allocates an appropriate game process to a newly received game based on a Central Processing Unit (CPU) load sent by the game server. For example, a load balancing scheme based on nginn (a high-performance HTTP and reverse proxy web server), a load balancing scheme based on micro service, and the like, wherein the load balancing algorithm includes a polling method, a random method, a raw address hashing method, a minimum connection number method, and the like. Taking a load balancing scheme based on Nginx as an example, a unified reverse proxy center is adopted to provide services for clients, and the load balancing scheme is mainly used in a Web application cluster, and the adopted load balancing algorithm comprises the following steps: weighted round robin, minimum number of connections, ip address mapping, etc.
However, unlike the conventional internet, a user of a game server has high interactivity and state variability, and is particularly sensitive to delay, and obtains a server or process load only by a sampling method, and when a matching process receives a plurality of games and needs to allocate game processes to the plurality of games, and the loads of most game processes reach saturation, a problem of allocating the plurality of games to the same game process may occur, so that the load of the game process suddenly rises, load balance of the server cannot be realized, and the stability of the server is affected. Based on this, the technology can be applied to the matching server, and particularly can be applied to a device having a function of allocating the game process to the game field.
To facilitate understanding of the present embodiment, a detailed description will be given of a game process allocation control method disclosed in the present embodiment, which is applied to a matching server. The game can be a battle-related game, and the game process comprises at least one battle field; as shown in fig. 1, the method comprises the steps of:
step S102, receiving a progress allocation request aiming at a target game field;
the process allocation request for the target game field may be sent by the client, where the process allocation request includes the target game field, and the matching server needs to allocate the target game field to a suitable game process after receiving the process allocation request. The matching server is a server for bearing player logic required by matching single game, and a plurality of matching processes are operated in the server and used for distributing proper game processes for target game fields in the received process matching requests. Specifically, the central process in the game server receives a process allocation request for the target game session, and then sends the request to one of the matching processes, or directly one of the matching processes receives the process allocation request for the target game session.
Step S104, acquiring the weight and the single game load of each game process in the game server; wherein, a plurality of game processes run in the game server;
the game server is in communication connection with the matching server; the game may be a battle-related game, and the game progress may be a battle-related battle progress, and the game progress generally includes a multi-game or battle. Specifically, the game server sends the weight of each game process and the single-game load to the matching server every other time of the sampling period, and the matching process in the matching server stores the received weight of each game process and the received single-game load in the local space in the sampling period. Alternatively, the matching process in the matching server may pull the weight and single game load for each game process from the game server over a sample period and then save in local space.
The matching server receives the weight and the single game load of each game process; wherein a greater weight indicates a lesser load on the game process, a greater likelihood of being assigned a game session.
Step S106, determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution request to the target process;
specifically, the game processes can be sorted according to the descending order of the weights, then a preset number of the game processes to be distributed arranged in the front can be extracted, and the game processes to be distributed which are larger than a preset weight value can also be extracted, wherein the number of the game processes to be distributed can be one or more, and then a target process is selected from the game processes to be distributed in a random selection mode; the game process with the maximum weight can be selected from the game processes to be distributed as the target process; or sequentially selecting target progresses from game progresses to be distributed according to the arrangement sequence. In addition, the target process can be randomly determined from a plurality of game processes directly through the weight, and the probability of being selected is generally higher when the weight is higher. The target game session in the process allocation request can be allocated to the target process after the target process is determined.
And step S108, controlling the weight reduction of the target process based on the single game load of the target process.
In order to avoid the problem that a plurality of game fields are allocated to the same game process according to the weight stored in the local space, the weight of the target process can be reduced while the target game field in the process allocation request is allocated to the target process, so that the target game field can be allocated according to the latest weight information when the matching process allocates the target game field subsequently.
Specifically, the single game load may be subtracted from the weight of the target process stored in the local space to obtain a reduced weight of the target process; the weight value to be reduced can be calculated according to the current game process and the process number of the matching process, and then the weight value is subtracted from the weight value of the target process stored in the local space to obtain the reduced weight value of the target process.
The embodiment of the invention provides a game process distribution control method, which comprises the steps of receiving a process distribution request aiming at a target game field; acquiring the weight and the single-game load of each game process in a game server; wherein the game server runs a plurality of game processes; determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution 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 the method, the target process is determined by the weight of the game process, and after the target game field is distributed to the target process, the weight of the target process is reduced according to the load of a single game, so that the problem that the load of the target process suddenly rises due to the fact that a plurality of game fields are distributed to the same target process under the condition that the number of selectable game processes is small is solved, the load balance of the game process is realized, and the stability of the game server is improved.
The following describes a specific implementation process of the steps of determining a target process from a plurality of game processes according to the weight of each game process, and allocating a target game session in a process allocation request to the target process, which is one possible implementation manner: determining a process to be distributed with the weight larger than a preset threshold value from a plurality of game processes according to the weight of each game process; determining a target process from the processes to be distributed in a random mode according to the weight of the processes to be distributed, and distributing the target game field in the process distribution request 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
The preset threshold is usually preset according to actual requirements, such as 10%, 5%, 1%, and the like, and usually the preset threshold is smaller and may even be 0; or the preset threshold may be set according to the number of game processes with weights greater than a certain value, if the number of game processes with weights greater than 10% is greater, the preset threshold may be set to be larger, for example, 15%, and if the number of game processes with weights greater than 10% is smaller, the preset threshold may be set to be smaller, for example, 5%, 1%, and the like. 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 plural.
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, and in actual implementation, the weight of each process to be allocated may be determined as the randomly selected probability, for example, if the weight of the process to be allocated is 90%, the probability that the process to be allocated is determined as the target process is 0.9. It can be understood that all processes to be allocated are in a disk, the area occupied by each process to be allocated in the disk is determined according to the weight, the larger the weight is, the larger the area occupied by each process to be allocated is, and then the process to be allocated, which is pointed at by the pointer when the pointer stops, is determined as the target process by rotating the pointer. And finally, distributing the target game field in the process distribution request to the target process. Of course, after the weight is reduced, the above steps are continuously repeated when the game progress is matched for the target game field again, and the target progress is determined again according to the reduced weight.
In the above manner, by setting a preset threshold, the processes to be allocated with a large weight and a small load are determined, then the probability that each process to be allocated is determined as a target process is determined according to the weight of the process to be allocated, and finally the target process is determined in the process to be allocated, and the target game session in the process allocation request is allocated to the target process.
A plurality of matching processes run in the matching server; the weight of each game process and the load of the single game are saved in each matching process, and the weight saved in each matching process is controlled to be reduced. The following describes a specific implementation process of the step of controlling the weight reduction of the target process based on the load of the single game of the target process, and a possible implementation manner is as follows:
(1) calculating the attenuation coefficient of the target process through the matching process;
in order to make the reduced weight value more consistent with the actual running state, the weight value to be reduced can be determined according to the matching process currently working, the process to be distributed and the single game load. The attenuation coefficient of the target process may be calculated first.
One possible implementation: acquiring a first process number of all processes in a plurality of game processes and a second process number of the processes to be distributed; the process to be distributed is a process with the weight larger than a preset threshold value in a plurality of game processes; acquiring a third process number in a process distribution state in the plurality of matched processes; and calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number.
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 distributed, and the third process number is the number of processes in a working state (or in a distribution state) in a plurality of matching processes running in a matching process at the current moment. After the three process numbers are obtained, the attenuation coefficient of the target process can be calculated according to a preset formula.
Specifically, the attenuation coefficient of the target process can be calculated by the following formula:
Figure BDA0003417700680000101
wherein TB represents a first number of passes; CB represents a second process number; m represents a third process number; f denotes the attenuation coefficient of the target process.
(2) Calculating the attenuation weight of the target process according to the single game load and the attenuation coefficient of the target process;
one possible implementation: and calculating the product value of the single-field game load and the attenuation coefficient of the target process, and determining the product value as the attenuation weight of the target process. Specifically, the attenuation weight of the target process can be calculated by the following formula:
Δw=f*PB(cpu);
wherein f represents the attenuation coefficient of the target process, PB (cpu) represents the single-field game load of the target process, and Δ w represents the attenuation weight of the target process.
(3) And subtracting the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.
Specifically, the weight of the reduced target process is calculated by the following formula:
W′=W-Δw;
wherein, W represents the weight of the received target process, and W' is the weight of the target process after being reduced.
It can be understood that, when the third process number M is larger, that is, the number of processes in the working state (or in the distribution state) at the present time is larger, the first process number TB is larger, that is, the number of all game processes running in the game server is larger, the second process number CB is smaller, that is, the number of processes to be distributed is smaller, the attenuation coefficient f is larger, the attenuation weight calculated according to the attenuation coefficient is larger, the weight of the target process after reduction is smaller, the probability that the target process is distributed with a plurality of game fields is reduced, and the problem that the load of the target process is suddenly increased is also reduced. Of course, if the weight of the target process is not reduced at this time, the game field which can be allocated to a certain target process at the same time is increased, and the load of the target process is increased suddenly.
For example, the weight of the target process is 1, the load of a single game is 0.2, the target process is issued to the matching process and stored in the local space, a process matching request is received in the sampling period, when the game field number in the process matching request is distributed to the target process, the weight of the target process is reduced, and if the weight of the target process is directly reduced to 1-0.2-0.8, at most 4 games can be distributed to the target process in the sampling period; if the attenuation coefficient f becomes large and becomes 2, the attenuation weight becomes 0.4, the weight of the target course after one game is redistributed becomes 0.8-0.4, and then only one game can be distributed.
In the method, the weight saved in the matching process is set to be a dynamic value in a weight reduction mode, and the weight of the target process is reduced after attenuation, so that the problem of continuously distributing game sessions to the same target process is avoided, load balance is further realized, and the stability of the server is improved.
The problem of the CPU load threshold can be understood as that the larger the third process number M, the larger the first process number TB, and the smaller the second process number CB. When the CPU load of most game processes reaches saturation and cannot be directly selected, a new incoming game session will flood a few game processes that can be directly selected, resulting in a CPU load surge. In the embodiment, the matching server locally caches the target process weight in the sampling interval, so that the load change condition of each game process in the sampling period interval can be predicted, and the frequency of selecting the same game process by the same matching process in a short time can be controlled, thereby avoiding the problem of critical values.
The following describes the way in which the weights of the game progress are calculated: acquiring sampling load of a game process through the game process in a game server, namely a first load occupied by a game field to be added into the game process and a second load occupied by a game field in a preparation state and a pause state in the game process; and calculating the weight of the game progress according to the sampling load, the first load and the second load.
In general, a network game has a plurality of game states, such as a ready state, a PAUSE state, and a game state, wherein different states consume different CPU loads, and the states have a certain transition relationship, as shown in fig. 2, which is a schematic diagram of a state change in a game process, wherein a game session in the game state (corresponding to BATTLE in the figure) requires a constant synchronization of player positions and operations, so that the game session in the game state occupies a higher CPU load, and game sessions in the ready state (corresponding to WAIT in the figure) and the PAUSE state (corresponding to PAUSE in the figure) consume a relatively lower CPU load because the player does not need to move and operate. However, since the game fields in the ready state and the paused state are likely to be randomly switched to the game state, in order to ensure that each game field in the game process can stably run, the game process needs to reserve enough load space for the games of the game fields in the ready state and the paused state to bear the load change caused by the game switching state of the game fields in the ready state and the paused state at any time. That is, the game play in the ready state and the paused state can be counted as the game play in the game play state.
In addition, since the sampling process for determining the sampling load is generally periodic, for a game process with low load, more game fields are generally allocated to the game process in a sampling interval, so that the CPU load of the game process fluctuates greatly, in order to avoid this problem, an upcoming game field in each game process may be predicted, for example, a game field that may be allocated to a current game process within 5 seconds, and then the CPU load consumed by the game field is predetermined to the load occupied by the game process.
Specifically, the sampling load y (t) of each game process, the game field c (t) to be added to the game process, the game field n (t) in the preparation state and the pause state in the game process, and the game field b (t) in the game state in the game process may be obtained. Then according to the formula
Figure BDA0003417700680000121
Calculating to obtain a first load occupied by a game field to be added into the game process; according to the formula
Figure BDA0003417700680000122
And calculating to obtain a second load occupied by the game fields in the preparation state and the pause state in the game process. The predicted load of each game process is calculated specifically according to the following prediction model:
Figure BDA0003417700680000131
wherein, T (cpu) represents the predicted load of the game process at the current moment; a. b and c are model parameters of the prediction model; as described above
Figure BDA0003417700680000132
Representing the CPU load each game session takes in the game state. The weight for each game play is then calculated according to the formula W-1-t (cpu). In the method, the current state of each game field in the game process and the game field to be added into the game process are considered, and the load occupied by the game field to be added into the game process and the game field in the preparation and pause state is reserved for the game process, so that the finally determined process load is more consistent with the operation of the actual game, the accuracy of the process load is improved, and the stability of the server is further improved.
In addition, the game session to be added to the game process can be calculated by the following method:
c (t) ═ α s (t) +(1 — α) C (t-1);
wherein, C (t) represents the game field to be added into the game process at the moment t; s (t) represents the current game field of the game progress at the time t; c (t-1) represents the historical game field added in the game process at the previous moment; alpha is a preset weight coefficient; alpha is more than 0 and less than 1. It can be understood that c (t) is a game field to be added to the game process in the next sampling period in the game process; the above s (t) is the current game field newly added in the game process at the current time, that is, the current game field newly added in the game process in the current sampling period; c (t-1) is the historical game number added in the game process in the previous sampling period.
It can be understood that the longer the time is, the smaller the coefficient of the earliest acquired historical game session is, the smaller the influence on the first game session is, and further, the load of the newly added game process can be controlled to gradually decrease from a larger value to a real value.
Generally, at the initial time of a game process, that is, when a game server starts to run or the process expands, if a newly expanded game process obtains a CPU load in a current sampling manner, the obtained load is low, and a large number of game sessions may be distributed to the game process, which may cause a sudden increase in the CPU load of the process. Through the primary exponential smoothing model, the game field newly added in the game process can be controlled by setting an initial value, the value is gradually reduced to a true value from a higher value, and meanwhile, the weight of the game process can be controlled by controlling the game field to be added in the game process to be gradually reduced to a true weight value from a smaller value along with the time.
The following describes the way in which the single game load of the game process is calculated: and calculating the single-field game load of the game process according to the sampling load of the game process and the number of the game fields in the game state in the game process through the game process in the game server.
During actual implementation, the single-game load of the game process at each moment in the historical time period can be calculated according to the sampling load of the game process at each moment in the preset historical time period and the game field number in the game state; and calculating the average value of the single game load of the game process at each moment in the historical time period to obtain the single game load of the game process at the current moment.
The single-game load prediction can be carried out in a sliding window average mode in particular as follows:
Figure BDA0003417700680000141
the single game load calculated in the mode considers the single game load in the historical time period, and the predicted result is more real and more accords with the actual running state of the game.
Specifically, referring to the schematic diagram of the specific game server shown in fig. 3, a general multiplayer online tactical competitive game is a distributed multi-server architecture, which includes a plurality of servers (corresponding to the game servers) carrying game combat logic, such as combat uniform 1 and combat uniform 2 in the figure. And a plurality of matching clothes (corresponding to the matching servers) bearing the servers matching the player logic required by the single-play battle. Each combat uniform runs with a plurality of combat processes (corresponding to the game processes) and a central process, each matching uniform runs with a plurality of matching processes and a central process, each combat uniform and the matching uniform are communicated through the central process, each combat process in the combat uniform is communicated with the central process, and each matching process in the matching uniform is communicated with the central process.
The embodiment is based on a multi-combat uniform and multi-match uniform distributed system, wherein each combat progress is connected with a central progress on the combat uniform, and the central progress is connected with a matching progress. In the matching process, the present embodiment selects a random-based-weighting-based clothes selection algorithm, and the clothes selection step substantially includes:
step1, regularly sampling CPU load use conditions Y (t) on each fighting process, observing newly-arrived fighting field times S (t) from t-1 to t, preparing and suspending fighting field times N (t) at t, and currently fighting field times B (t).
Step2. each battle progress is based on formula
Figure BDA0003417700680000151
Calculate PB (t) and are based on formula
Figure BDA0003417700680000152
Figure BDA0003417700680000153
Sliding window averaging PB (t) to predict average PB (cpu) over a period of time based on the formula
Figure BDA0003417700680000154
Calculating C (t) and synchronizing Y (t), C (t), N (t) and PB (cpu) to the current combat uniform center process.
Step3, the central process of the combat uniform calculates the total CPU load T (CPU) of each combat process according to the collected information; the weight of each battle progress is then calculated according to the formula W ═ 1-t (cpu).
And step4, the central process of the combat uniform issues the weight information of all the current combat progresses and PB (cpu) to the matching uniform.
And step5, pulling and caching all the weight information of the fighting process and PB (cpu) by the matching process, randomly selecting clothes by weighting when a new fighting arrives, subtracting delta w from the local weight of the fighting process after each selection, and returning to pure random clothes selection if the weights of all the selectable fighting processes are all reduced to 0.
Corresponding to the above method embodiment, an embodiment of the present invention further provides an allocation control device for a game process, where the device is disposed in a matching server, and as shown in fig. 4, the device includes:
a receiving module 41, configured to receive a progress allocation request for a target game session;
an obtaining module 42, configured to obtain a weight and a single game load of each game process in the game server; wherein, a plurality of game processes run in the game server;
an allocating module 43, configured to determine a target process from the multiple game processes according to the weight of each game process, and allocate a target game session in the process allocation request to the target process;
the control module 44 controls the weight reduction of the target process based on the single game load of the target process.
The embodiment of the invention provides a game process distribution control device, which receives a process distribution request aiming at a target game field; acquiring the weight and the single-game load of each game process in a game server; wherein the game server runs a plurality of game processes; determining a target process from a plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution 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 the method, the target process is determined by the weight of the game process, and after the target game field is distributed to the target process, the weight of the target process is reduced according to the load of a single game, so that the problem that the load of the target process suddenly rises due to the fact that a plurality of game fields are distributed to the same target process under the condition that the number of selectable game processes is small is solved, the load balance of the game process is realized, and the stability of the game server is improved.
Further, the allocation module is further configured to: determining a process to be distributed with the weight larger than a preset threshold value from a plurality of game processes according to the weight of each game process; determining a target process from the processes to be distributed in a random mode according to the weight of the processes to be distributed, and distributing the target game field in the process distribution request to the target process; the greater the weight of the process to be allocated, the greater the probability that the process to be allocated is determined to be the target process.
Furthermore, a plurality of matching processes are operated in the matching server; the control module is further configured to: 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; and subtracting the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.
Further, the control module is further configured to: acquiring a first process number of all processes in a plurality of game processes and a second process number of processes to be distributed; the process to be distributed is a process with the weight larger than a preset threshold value in a plurality of game processes; acquiring a third process number in a process distribution state in the plurality of matched processes; and calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number.
Further, the control module is further configured to: calculating the attenuation coefficient of the target process by the following formula:
Figure BDA0003417700680000171
wherein TB represents a first number of passes; CB represents a second process number; m represents a third process number; f represents the attenuation coefficient of the target process.
Further, the control module is further configured to: and calculating the product value of the single-field game load and the attenuation coefficient of the target process, and determining the product value as the attenuation weight of the target process.
Further, the weight of the game progress is determined by: acquiring sampling load of a game process through the game process in a game server, namely a first load occupied by a game field to be added into the game process and a second load occupied by a game field in a preparation state and a pause state in the game process; and calculating the weight of the game progress according to the sampling load, the first load and the second load.
Further, the single game load of the game progress is determined by: and calculating the single-field game load of the game process according to the sampling load of the game process and the number of the game fields in the game state in the game process through the game process in the game server.
The game process allocation control device provided by the embodiment of the invention has the same technical characteristics as the game process allocation control method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
The embodiment also provides an electronic device, which comprises a processor and a memory, wherein the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to realize the distribution control method of the game process. The electronic device may be a server or a terminal device.
Referring to fig. 5, the electronic device includes a processor 100 and a memory 101, the memory 101 stores machine executable instructions capable of being executed by the processor 100, and the processor 100 executes the machine executable instructions to implement the distribution control method of the game process.
Further, the electronic device shown in fig. 5 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.
The Memory 101 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system 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, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 102 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
Processor 100 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 100. The Processor 100 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. 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 foregoing embodiment in combination with the hardware thereof.
The present embodiments also provide a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the allocation control method of a game process described above.
The method, apparatus, electronic device and computer program product for controlling distribution of game processes provided in the embodiments of the present invention include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the methods described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present invention can be understood in specific cases for those skilled in the art.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method 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 various media capable of storing program codes.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (11)

1. A distribution control method of game process is characterized in that the method is applied to a matching server; the method comprises the following steps:
receiving a progress allocation request for a target game session;
acquiring the weight and the single-game load of each game process in a game server; wherein, a plurality of game processes run in the game server;
determining a target process from the plurality of game processes according to the weight of each game process, and distributing the target game field in the process distribution request to the target process;
and controlling the weight reduction of the target process based on the single game load of the target process.
2. The method according to claim 1, wherein the step of determining a target course from the plurality of game courses based on the weight of each of the game courses, and allocating the target game session in the course allocation request to the target course comprises:
determining a process to be distributed with the weight larger than a preset threshold value from the plurality of game processes according to the weight of each game process;
determining the target process from the processes to be distributed in a random mode according to the weight of the processes to be distributed, and distributing the target game field in the process distribution request to the target process; wherein the larger the weight of the process to be allocated is, the larger the probability that the process to be allocated is determined to be the target process is.
3. The method of claim 1, wherein 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 comprises:
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;
and subtracting the attenuation weight from the weight of the target process to obtain the reduced weight of the target process.
4. The method of claim 3, wherein the step of calculating the attenuation coefficient of the target process by the matching process comprises:
acquiring a first process number of all processes in the plurality of game processes and a second process number of processes to be distributed; the process to be distributed is a process with the weight larger than a preset threshold value in the game processes;
acquiring a third process number in a process distribution state in the plurality of matching processes;
and calculating the attenuation coefficient of the target process according to the first process number, the second process number and the third process number.
5. The method of claim 4, wherein the step of calculating the attenuation coefficient of the target process based on the first process number, the second process number, and the third process number comprises:
calculating an attenuation coefficient of the target process by the following formula:
Figure FDA0003417700670000021
wherein TB represents the first number of passes; CB represents the second process number; m represents the third process number; f represents the attenuation coefficient of the target process.
6. The method of claim 3, wherein the step of calculating the attenuation weight of the target process based on the single game load and the attenuation coefficient of the target process comprises:
and calculating a 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.
7. The method of claim 1, wherein the weight of the game progress is determined by:
acquiring a sampling load of the game process through the game process in the game server, namely a first load occupied by a game field to be added into the game process and a second load occupied by a game field in a preparation state and a pause state in the game process;
and calculating the weight of the game progress according to the sampling load, the first load and the second load.
8. The method of claim 1, wherein the single game load of the game progress is determined by:
and calculating the single-field game load of the game process according to the sampling load of the game process and the number of the game fields in the game state in the game process through the game process in the game server.
9. A game progress distribution control device is characterized in that the device is arranged on a matching server; the device comprises:
a receiving module, configured to receive a progress allocation request for a target game session;
the acquisition module is used for acquiring the weight of each game process and the load of a single game in the game server; wherein, a plurality of game processes run in the game server;
the distribution module is used for determining a target process from the plurality of game processes according to the weight of each game process and distributing the target game field in the process distribution request to the target process;
and the control module is used for controlling the weight reduction of the target process based on the single-field game load of the target process.
10. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the allocation control method of a game process of any one of claims 1 to 8.
11. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the allocation control method of a game process of any of claims 1 to 8.
CN202111551395.0A 2021-12-17 2021-12-17 Game process distribution control method and device and electronic equipment Pending CN114515429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111551395.0A CN114515429A (en) 2021-12-17 2021-12-17 Game process distribution control method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111551395.0A CN114515429A (en) 2021-12-17 2021-12-17 Game process distribution control method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN114515429A true CN114515429A (en) 2022-05-20

Family

ID=81595892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111551395.0A Pending CN114515429A (en) 2021-12-17 2021-12-17 Game process distribution control method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN114515429A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116173495A (en) * 2023-02-09 2023-05-30 广州延利网络科技有限公司 Game progress distribution control method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116173495A (en) * 2023-02-09 2023-05-30 广州延利网络科技有限公司 Game progress distribution control method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111084983B (en) Cloud game service method, device, equipment and storage medium
KR101540631B1 (en) System, method and recording medium recording the program thereof for dynamic expansion of the virtual cluster
CN103701916B (en) The dynamic load balancing method of distributed memory system
US10957149B2 (en) Computer and method for game control
CN105871640B (en) Outpost configuration data configuration method, game server and system
US20030105797A1 (en) Dynamic load balancing among a set of servers
Lai et al. Quality of experience-aware user allocation in edge computing systems: A potential game
CN110474966B (en) Method for processing cloud platform resource fragments and related equipment
US20150196841A1 (en) Load balancing system and method for rendering service in cloud gaming environment
CN114515429A (en) Game process distribution control method and device and electronic equipment
CN106162214B (en) Method for video coding and net cast client
CN108499100A (en) A kind of cloud game error recovery method and system based on edge calculations
CN106464733A (en) Method and device for adjusting virtual resources in cloud computing
CN111045808A (en) Distributed network task scheduling method and device
CN107733805B (en) Service load scheduling method and device
CN108737544A (en) CDN node dispatching method and device
CN111949408A (en) Dynamic allocation method for edge computing resources
CN113992945A (en) Multi-server multi-user video analysis task unloading method based on game theory
KR101448413B1 (en) Method and apparatus for scheduling communication traffic in atca-based equipment
US10953328B1 (en) Dynamic batching interval adjustment for game session creation
CN113486042B (en) Data processing method, device, computer readable medium and electronic equipment
CN110147277A (en) A kind of resource dynamic deployment method, device, server and storage medium
Burger et al. Load dynamics of a multiplayer online battle arena and simulative assessment of edge server placements
CN112398957B (en) Server scheduling method and device, storage medium and electronic equipment
CN114392548A (en) Method and device for determining process load 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