Game matching method and device, storage medium and server
By acquiring the network latency between game players and the server and matching them accordingly, the problem of poor network performance caused by rank-based matching in existing technologies has been solved, thus improving the gaming experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NETEASE (HANGZHOU) NETWORK CO LTD
- Filing Date
- 2023-01-10
- Publication Date
- 2026-07-31
AI Technical Summary
In existing technologies, game matchmaking systems only consider rank factors, leading to poor network performance due to network latency and a poor gaming experience.
By acquiring the network latency between game players and each server, comparing the latency with a specified threshold, candidate servers are determined, and players with common candidate servers are matched as candidate game players.
The matching mechanism based on network latency avoids poor gaming experience caused by network latency and improves the network quality of game matches.
Smart Images

Figure CN116077926B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and specifically to a game matching method, apparatus, computer-readable storage medium, and server. Background Technology
[0002] In recent years, with the development and popularization of computer equipment technology, more and more online games have emerged, such as first-person shooter (FPS) games and role-playing games (RPGs).
[0003] In existing technology, when gamers play online games, they are matched with other gamers who can enter the same game. The matching mechanism generally determines the player's rank in the game and matches other gamers of that rank with the player in the same game.
[0004] In the process of researching and practicing the existing technology, the inventors of this application discovered that the existing matching system only considers the rank factor. The players matched according to the rank do not meet the user's expectations, resulting in a poor gaming experience. Summary of the Invention
[0005] This application provides a game matching method and apparatus that can solve the problem of poor network and bad gaming experience during game matches.
[0006] To address the aforementioned technical problems, this application provides the following technical solutions:
[0007] A game matchmaking method, comprising:
[0008] In response to a game matchmaking command sent by a target game player, a set of game players to be matched and an allocable server are determined, wherein the set of game players includes the target game player and game players that the target game player can match;
[0009] For each player in the set of game players, the network latency between the player and each server is obtained, and each network latency is compared with a specified latency threshold. The server with a network latency less than the latency threshold is determined as the candidate server for the player.
[0010] Based on each player's candidate server, players who share at least one candidate server with the target player are identified as candidate players who match the target player.
[0011] A game matching device, characterized in that it comprises:
[0012] The first determining module is used to determine the set of game players to be matched and the available servers in response to the game matchmaking instruction sent by the target game player, wherein the set of game players includes the target game player and the game players that the target game player can match;
[0013] The second determining module is used to obtain the network latency between each game player and each server for each game player in the game player set, compare each network latency with a specified latency threshold, and determine the server corresponding to the network latency less than the latency threshold as the candidate server for the game player;
[0014] The third determining module is used to determine, based on each game player's candidate server, game players who share at least one candidate server with the target game player as candidate game players who match the target game player.
[0015] A computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps in the game matching method described above.
[0016] A server includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement the steps in the game matching method described above.
[0017] This application embodiment determines a set of players to be matched and available servers in response to a game matchmaking command sent by a target player. The set of players includes the target player and players that can be matched with the target player. For each player in the set, the network latency between the player and each server is obtained. Each network latency is compared with a specified latency threshold, and servers with network latency less than the threshold are identified as candidate servers for that player. Based on each player's candidate servers, players who share at least one candidate server with the target player are identified as candidate players to match with the target player. Thus, by determining the network latency of each player, candidate players sharing servers with the target player can be assigned to the target player, avoiding poor network performance and a bad gaming experience due to network latency during gameplay. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1a A system schematic diagram of the game matching method provided in the embodiments of this application.
[0020] Figure 1b This is a flowchart illustrating the game matching method provided in an embodiment of this application.
[0021] Figure 1c This is a schematic diagram illustrating the network latency between a game player and a single server, provided as an embodiment of this application.
[0022] Figure 1d This is a schematic diagram illustrating the latency acquisition between game players and each server, provided as an embodiment of this application.
[0023] Figure 1e This is a schematic diagram illustrating the correspondence between the number of game players and the latency threshold provided in an embodiment of this application.
[0024] Figure 1f This is a server-based matching diagram provided for an embodiment of this application.
[0025] Figure 1g This is a schematic diagram illustrating the correspondence between game matching time and total latency distance provided in an embodiment of this application.
[0026] Figure 2 This is a schematic diagram of the structure of the game matching device provided in the embodiments of this application;
[0027] Figure 3 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation
[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0029] Please see Figure 1a , Figure 1aThis is a system diagram illustrating the game matching method provided in this application embodiment. The system may include at least one terminal device 1000, at least two servers 2000, at least one database 3000, and a network 4000. The terminal device 1000 may be a mobile phone, computer, or personal digital assistant, etc. The server 2000 and the terminal device 1000 can establish a connection through the network 4000. The server 2000 is used to synchronize other virtual players and virtual scene images in the game to the terminal device 1000 in real time. The network 4000 may be a wireless network or a wired network, such as a wireless local area network (WLAN), local area network (LAN), cellular network, 2G network, 3G network, 4G network, 5G network, etc. Additionally, the system may include the database 3000, which can be used to store game player account information and virtual character information under the account.
[0030] This application provides a game matching method, which can be executed by a server. For example... Figure 1a As shown, in response to a game matchmaking command sent by a target game player, server 2000 determines a set of game players to be matched and available servers. The set of game players includes the target game player and game players that the target game player can match. For each game player in the set of game players, server 2000 obtains the current network latency between the game player and each of the servers, compares each network latency with a specified latency threshold, and determines the server corresponding to the network latency less than the latency threshold as the candidate server for the game player. Based on the candidate servers of each game player, game players who share at least one candidate server with the target game player are determined as candidate game players to match with the target game player.
[0031] It should be noted that, Figure 1a The schematic diagram of the game matching system shown is merely an example. The game matching system and scenarios described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of game matching systems and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0032] In current technologies, network experience has gradually become an indispensable and crucial factor for gamers when playing online games. Players expect a smooth experience with low latency and minimal lag. Different matchmaking systems based on players' locations allow players from the same region to be matched together, thereby reducing network latency.
[0033] In the process of researching and practicing existing technologies, the inventors of this application discovered that the existing matching systems only consider regional factors, resulting in poor network performance and a poor gaming experience due to network latency during game matches.
[0034] To address the aforementioned technical problems, this application provides a game matching method. Please refer to [link / reference]. Figure 1b , Figure 1b This is a flowchart illustrating the game matching method provided in an embodiment of this application. The game matching method includes:
[0035] In step 101, in response to the game matchmaking instruction sent by the target game player, a set of game players to be matched is determined, wherein the set of game players includes the target game player and game players that the target game player can match.
[0036] The game matchmaking command can be generated by the player by clicking or touching the matchmaking or game control in the game interface of the online game. After the game matchmaking command is generated, it will be sent to the online game server through the player's terminal device. After receiving the game matchmaking command, the server will match the player with the game, which specifically includes determining the players who can be matched, i.e., the set of players to be matched.
[0037] Specifically, the set of players to be matched includes players who meet preset matching criteria and can be matched with the target player. These preset matching criteria can be that the player's rank is the same as the target player's rank or the rank difference is less than a preset rank difference, and the player is currently in a matchmaking state. Based on these preset matching criteria, matchable players can be selected from the pool of players who can be matched with the target player.
[0038] In step 102, for each player in the set of game players, the network latency between the player and each server is obtained, and each network latency is compared with a specified latency threshold. The server with a network latency less than the latency threshold is determined as the candidate server for the player.
[0039] In order to determine the target game player and the optimal server corresponding to the game player that can be matched with the target game player, the network latency between the game player and each of the servers can be obtained.
[0040] Specifically, during the matchmaking process, the network latency value for the player's current network environment can be obtained using the methods described above. This value measures the network quality between the player and the server. During the matchmaking process, the game players are assigned to servers with high network quality as much as possible (that is, the game players experience lower network latency on servers with high network quality).
[0041] To determine whether a player can be assigned to a particular server, latency data (i.e., network latency) needs to be divided into two categories. When the network latency is less than a certain threshold, we consider that the player can have a good network experience when connecting to that server. When the network latency is greater than the latency threshold, the player should not be assigned to that server.
[0042] In some implementations, obtaining the current network latency between the game player and each server includes:
[0043] (1) For each server, obtain multiple initial network latencies between the game player and the server;
[0044] (2) Based on the multiple initial network delays, obtain the current network delay between the game player and the server.
[0045] In order to obtain the actual network latency between the game player and each server, multiple initial network latencies between the game player and each server can be obtained; and based on the multiple initial network latencies, the current network latency between the game player and the server can be obtained.
[0046] In some implementations, obtaining the current network latency between the game player and the server based on a plurality of the initial network latencies includes:
[0047] The median of the initial network latency is taken to obtain the current network latency between the game player and the server.
[0048] In order to obtain the actual network latency between the game player and each server, the median of the multiple initial network latencies can be taken to obtain the current network latency between the game player and the server. That is, the initial network latency that is the median of the multiple initial network latencies is taken as the current network latency between the game player and the server.
[0049] Specifically, during gameplay, players' network speeds often fluctuate, especially on cellular networks where network jitter is more pronounced. To address this jitter issue, this application proposes a median-based solution based on multiple latency probes. For servers distributed across major global regions, latency probes are performed periodically, and the historical data of these probes is recorded on the terminal device. After multiple probes over a period, multiple arrays containing various latency values are obtained. The median of these arrays yields the average network latency. To avoid sudden spikes in latency due to brief network outages, the median method is used to determine the latency between the player and each server. This avoids the vulnerability of the average algorithm to being easily dragged into extremely high latency values by a single, persistently large latency spike, which is difficult to reverse.
[0050] In some implementations, obtaining multiple initial network latencies between the game player and the server includes:
[0051] The initial network latency between a first specified number of the game players and the server is obtained at a first time interval;
[0052] After obtaining the first specified number of initial network latencies, a second number of initial network latencies between the game players and the server are obtained at a second time interval;
[0053] The first specified number of initial network delays and the second specified number of initial network delays are used as multiple initial network delays between the game player and the server.
[0054] The method for obtaining the initial network latency can be to obtain a first specified number of initial network latencies at a first time interval, and to obtain a second number of initial network latencies at a second time interval, and to use the first specified number of initial network latencies and the second number of initial network latencies as multiple initial network latencies between the game player and the server.
[0055] In some implementations, obtaining multiple initial network latencies between the game player and the server includes:
[0056] Within a first duration, the initial network latency between the game player and the server is obtained at a first time interval;
[0057] The initial network latency between the game player and the server is obtained at a second time interval within a second duration.
[0058] The initial network latency obtained within the first time period and the initial network latency obtained within the second time period are used as multiple initial network latencies between the game player and the server.
[0059] Delay probing itself incurs time and bandwidth costs and cannot be performed indefinitely. Therefore, probing can be divided into two phases: a first phase with a first time interval and a second phase with a second time interval. The end of either phase can be determined by the amount of initial network latency obtained. When a first specified amount of initial network latency is obtained, the first phase ends, and the second phase begins. Conversely, when a second specified amount of initial network latency is obtained, the second phase ends.
[0060] The detection phase can also be divided based on duration. For example, after entering the detection phase, the first duration is the first phase of detection. After the first phase ends, the second phase begins, and the duration of the second phase can be the second duration.
[0061] Starting with a player logging into the game, an intensive network latency detection period is initially implemented. The intervals between these intensive detections can be very short or even nonexistent. The next detection begins immediately after the previous one ends, ensuring a sufficient number of detections before the player officially matches. This allows for cyclical acquisition of network latency, with each acquired latency serving as the initial latency, until a preset number of latency acquisitions (e.g., 10) is reached. When the preset number of acquisitions is reached, the intensive network latency detection period is considered complete. To minimize the impact on time and bandwidth costs, a sparse network latency detection method can be implemented after the intensive detection period, following a second time interval. The preset time interval can be 5 seconds, 20 minutes, etc., and is not limited here.
[0062] In some implementations, the first time interval is shorter than the second time interval.
[0063] Since dense detection needs to be performed first, followed by sparse detection, the first time interval needs to be shorter than the second time interval.
[0064] In some implementations, obtaining multiple initial network latencies between the game player and the server includes:
[0065] (1) Obtain the sending time of the network packet sent by the game player to the server, and the return time of the network packet returned by the server to the game player;
[0066] (2) The difference between the sending time and the return time is determined as the initial network latency between the game player and the server.
[0067] like Figure 1c As shown, Figure 1c This is a schematic diagram illustrating the network latency between a game player and a single server, provided in an embodiment of this application. The network latency between the game player and the single server is obtained by having the game player's terminal device (Actor) send a network packet to the server and record the sending time of the network packet (Time 1). After receiving the network packet, the server immediately returns it to the game player's terminal device (Actor) and records the return time of the terminal device receiving the network packet (Time 2). The initial network latency between the game player and the single server is then the difference between the return time and the sending time (Time 2 - Time 1).
[0068] Specifically, such as Figure 1d As shown, Figure 1d This diagram illustrates the latency acquisition between a game player and each server, as provided in an embodiment of this application. To avoid inaccurate latency acquisition due to network anomalies caused by operator network issues, multiple latency acquisitions can be performed, thereby preventing inaccurate latency acquisition due to occasional network anomalies. For example... Figure 1d The Actor performs multiple probes on servers 1, 2, 3, and 4 respectively, and by taking the median, the initial network delays from the Actor to servers 1, 2, 3, and 4 are 46, 18, 52, and 22 respectively.
[0069] In some implementations, obtaining multiple initial network latencies between the game player and the server includes:
[0070] The current initial network latency between the game player and the server is obtained to form the plurality of initial network latencies between the game player and the server.
[0071] The multiple initial network delays between the game player and the server are formed by each current initial network delay obtained between the game player and the server.
[0072] In some embodiments, the method further includes:
[0073] The current initial network latency is sent to the server for storage to obtain the historical initial network latency.
[0074] In order to quickly obtain the network latency of the game player when the game player matches again, the current initial network latency can be sent to the server for storage to obtain the historical initial network latency, so that the historical initial network latency can be directly obtained next time.
[0075] In some implementations, sending the current initial network latency to the server for storage to obtain the historical initial network latency includes:
[0076] Obtain the current network environment information of the game player;
[0077] The current initial network latency is sent to the location corresponding to the network environment information in the server for storage, thus obtaining the historical initial network latency.
[0078] In this case, considering that some players start matchmaking immediately upon entering the game, and sufficient latency data hasn't been collected yet, historical latency information needs to be incorporated for data fusion. Specifically, after the latency detection results are received on the terminal device, they are not stored directly on the player's device, but rather uploaded to the server for storage. The next time a player logs into the game, the server can load the historical latency information and combine it with the latest latency detection data to calculate network quality. This ensures that even with a smaller number of recent detections, a high accuracy in network quality measurement can still be achieved.
[0079] Specifically, when the server receives latency data uploaded from game players' terminal devices, it cannot directly store it because the player's network environment may have changed. For example, the player might be logging in at noon under a company network and logging in at night under a home network. The latency detected from these two different network environments cannot be combined for calculation. To solve this problem, this application defines the concept of network environment information. Network environment information is a network environment tagged with the triple <city, network operator, network type>. Different tags represent different network environments. Table 1 shows the design purpose of the different network environment tag keys.
[0080] Table 1
[0081] City Handling player login from different locations and switching between cities Network operators Handling handover between different carriers Network type Handling switching between cellular networks and Wi-Fi
[0082] In some implementations, obtaining multiple initial network latencies between the game player and the server includes:
[0083] The historical initial network latency between the game player and the server is obtained from the server to form the plurality of initial network latencies between the game player and the server.
[0084] Among them, based on network environment information, when a player starts an online game and is matched with another player, the system can directly filter out historical latency information that is the same as the current network environment information from the latency information uploaded within a historical time period (such as within a week) based on the current network environment information of the player's terminal device.
[0085] In some implementations, obtaining the historical initial network latency between the game player and the server from the server includes:
[0086] Obtain the current network environment information of the game player;
[0087] The historical initial network latency between the game player and the server is obtained from the location corresponding to the current network environment information in the server.
[0088] The method for obtaining the historical initial network latency from the server is to obtain the current network environment information of the game player; and to obtain the historical initial network latency between the game player and the server from the location corresponding to the current network environment information in the server.
[0089] In some embodiments, the method further includes:
[0090] The latency threshold is determined based on the number of matchable game players.
[0091] Since the number of game players varies at different times, the latency threshold also changes accordingly. Therefore, it is necessary to determine the latency threshold based on the number of game players, and then determine the candidate servers that game players can be assigned to based on the latency threshold. The candidate servers are the servers that provide game matches for the game players.
[0092] In some implementations, determining the latency threshold based on the number of matchable game players includes:
[0093] (1) If the number of matchable game players is less than or equal to the first number, then the delay threshold is set to the first delay threshold;
[0094] (2) If the number of matchable game players is greater than or equal to the second number, then the delay threshold is set to the second delay threshold;
[0095] (3) If the number of matchable game players is greater than the first number and less than the second number, then the delay threshold is set to the third delay threshold;
[0096] Wherein, the first quantity is less than the second quantity, the first delay threshold is greater than the second delay threshold, and the third delay threshold is greater than the second delay threshold and less than the first delay threshold.
[0097] Among them, such as Figure 1e As shown, Figure 1e This diagram illustrates the relationship between the number of game players and the latency threshold provided in this application embodiment. When the number of game players N is less than or equal to a first preset number N1, it indicates that the number of game players in the current matching period is small. To avoid long matching times for game players, the latency threshold can be set to a larger first latency threshold T1, so that the latency threshold for server allocation is lower. This allows servers with latency less than the first latency threshold to be identified as target servers, achieving the goal of quickly allocating target servers to game players.
[0098] Specifically, when the number of game players N is greater than or equal to the second preset number N2, it means that the number of game players in the current matching period is large, and there is no concern that game players will not be able to find a game match. Therefore, the latency threshold can be set to a smaller second latency threshold T2, so that the latency threshold of the allocation server is higher.
[0099] Specifically, when the number of game players N is greater than the first number N1 and less than the second number N2, the latency threshold is set to a third latency threshold T3, where T3 can be a fixed latency.
[0100] In some embodiments, the method further includes:
[0101] The third latency threshold is determined based on the number of matchable game players, the first number, the second number, the first latency threshold, and the second latency threshold.
[0102] Specifically, if the number of game players is greater than the first preset number and less than the second preset number, it indicates that the number of game players in the current matching period is at a medium level. Therefore, the difference between the number of game players N and the first preset number N1 can be calculated to obtain the first calculation result; the difference between the second preset number N2 and the first preset number N1 can be calculated to obtain the second calculation result; the difference between the first preset delay threshold T1 and the second preset delay threshold T2 can be calculated to obtain the third calculation result; based on the first calculation result, the second calculation result, and the third calculation result, the third delay threshold is determined.
[0103] The ratio of the first calculation result (N-N1) to the second calculation result (N2-N1) is used to determine the proportion value (fourth calculation result). The product of the fourth calculation result (N-N1) / (N2-N1) and the third calculation result (T1-T2) is used to determine the reduced portion of the latency threshold. The sum of the fifth calculation result (N-N1) / (N2-N1)*(T2-T1) and the first preset latency threshold T1 is used to determine the target latency threshold. The target latency threshold is determined as the third latency threshold so that servers whose latency to game players is less than the specified latency threshold are subsequently identified as candidate servers.
[0104] In step 103, based on each game player's candidate server, game players who share at least one candidate server with the target game player are identified as candidate game players who match the target game player.
[0105] Among them, such as Figure 1f As shown, Figure 1f This is a schematic diagram of server-based matching provided in an embodiment of this application. The current latency threshold (i.e., the threshold in the diagram) is 25. Player 1 (Actor1) and Player 2 (Actor2) both correspond to Server 2 as their candidate server, so Player 1 and Player 2 can be assigned to Server 2. Player 3 (Actor3) and Player 4 (Actor4) both correspond to Server 1 as their candidate server, so Player 3 and Player 4 can be assigned to Server 1. If a game requires K real players, then the active server lists of these K players must have at least one intersection. When these K players are successfully matched together, the matching system will randomly select one of the intersection servers to assign the next game.
[0106] Specifically, the method for screening candidate game players is to find game players whose server is the target server from other game players who are in the game matchmaking state, that is, game players who share the same target server with the game player.
[0107] In some embodiments, the method further includes:
[0108] (1) For each of the candidate game players, determine the common candidate server that the candidate game player and the target game player have;
[0109] (2) For each of the common candidate servers, determine the difference in network latency between the target game player and the candidate game player and the common candidate server respectively;
[0110] (3) Determine the sum of the differences corresponding to each of the common candidate servers;
[0111] (4) Compare the sum with the specified total delay threshold. If the sum is less than the total delay threshold, then determine the candidate game player as a game player that can be matched with the target game player.
[0112] Specifically, for each candidate game player, a common candidate server shared by the candidate game player and the target game player is determined.
[0113] Specifically, this application defines the total latency distance between two game players, which is calculated by determining the absolute value of the difference in network latency between the two game players and the same server, thus obtaining the latency distance between the target game player and each of the candidate game players to each server; the sum of the latency distances between the target game player and each of the candidate game players to each server is calculated to obtain the total latency distance between the target game player and each of the candidate game players. Based on the game matching time of the target game player and the total latency distance, a specific game player is determined from the candidate game players to play against the target game player.
[0114] Specifically, such as Figure 1fAs shown, the network latency between player 1 (Actor1) and servers 1, 2, 3, and 4 is 46, 18, 52, and 22, respectively; the latency between player 2 (Actor2) and servers 1, 2, 3, and 4 is 24, 31, 48, and 34, respectively; the latency between player 3 (Actor3) and servers 1, 2, 3, and 4 is 17, 34, 21, and 68, respectively; and the latency between player 4 (Actor4) and servers 1, 26, 38, and 74, respectively. For server 1, the difference in network latency between Actor1 and Actor2 is 46 - 24, which is 22; the difference in network latency between Actor1 and Actor3 is 46 - 17, which is 29; and the difference in network latency between Actor1 and Actor4 is 46 - 13, which is 33. For server 2, the difference in network latency between Actor1 and Actor2 is 18 - 12, which is 6; the difference in network latency between Actor1 and Actor3 is 34 - 18, which is 16; and the difference in network latency between Actor1 and Actor4 is 26 - 18, which is 8. For server 3, the difference in network latency between Actor1 and Actor2 is 52-48, which is 4; the difference in network latency between Actor1 and Actor3 is 52-21, which is 31; and the difference in network latency between Actor1 and Actor4 is 52-38, which is 14. For server 4, the difference in network latency between Actor1 and Actor2 is 27-22, which is 5; the difference in network latency between Actor1 and Actor3 is 68-22, which is 46; and the difference in network latency between Actor1 and Actor4 is 74-22, which is 52.
[0115] Furthermore, this total latency distance can be compared with a specified total latency threshold. Given that the number of players matched in the last hour was 20,000, and considering the matchmaking wait time T for the target game players, the current total latency threshold can be calculated to be 25. Therefore, the network latencies less than the total latency threshold are: the network latencies from Actor1 and Actor2 to Server 2 (18 and 12 respectively), the network latency from Actor1 to Server 4 (22), the network latency from Actor3 to Server 3 (21), and the network latencies from Actor3 and Actor4 to Server 2 and Server 1 (17 and 13 respectively). Thus, the candidate servers for Actor1 are Server 2 and Server 4, the candidate server for Actor2 is Server 2, the candidate servers for Actor3 are Server 1 and Server 3, and the candidate server for Actor4 is Server 1. Based on these candidate servers, it can be determined that Actor1 and Actor2 can be assigned to the common candidate server 2, and Actor3 and Actor4 can be assigned to the common candidate server 1.
[0116] Since Actor1 and Actor2 can be assigned to the same candidate server 2, and Actor3 and Actor4 can be assigned to the same candidate server 1, the total latency distance from Actor1 and Actor2 to server 2 can be calculated as 18 - 12, which is 6; the total latency distance from Actor3 and Actor4 to server 1 can be calculated as 17 - 13, which is 4. Combining this with the matchmaking waiting time of the target game players, if the total latency threshold is 5, then since 6 is greater than 5, Actor1 and Actor2 cannot be assigned to server 2 for game matches; since 4 is less than 5, Actor3 and Actor4 can be assigned to server 1 for game matches.
[0117] Specifically, since this application defines the total latency distance between two game players, during actual gameplay, the reaction time of certain actions of one game player in the game to the graphical user interface of the other game player can be determined based on the total latency distance between the two game players. This avoids the situation where the actions of one game player cannot be reflected in the graphical user interface of the other game player in time due to a large total latency distance between the two game players, thus preventing the occurrence of asynchrony.
[0118] In some embodiments, the method further includes:
[0119] (1) Obtain the matchmaking waiting time of the target game player;
[0120] (2) If the matching waiting time is less than or equal to the first time threshold, then the total delay threshold is set as the first total delay threshold;
[0121] (3) If the matching waiting time is greater than or equal to the second time threshold, then the total delay threshold is set as the second total delay threshold;
[0122] (4) If the matching waiting time is greater than the first time threshold and less than the second time threshold, then the total delay threshold is set as the third total delay threshold;
[0123] Wherein, the first time threshold is less than the second time threshold, the first total delay threshold is less than the second total delay threshold, and the third total delay threshold is greater than the first total delay threshold and less than the second total delay threshold.
[0124] Among them, such as Figure 1g As shown, Figure 1g This diagram illustrates the correspondence between matching waiting time and total latency threshold provided in this application embodiment. When the matching waiting time T of the target player is less than or equal to the first time threshold T1, the total latency threshold V is set to the first total latency threshold V1. This identifies candidate players whose total latency distance is less than the first total latency threshold V1 as specific players, who can then be matched with the target player. When the matching waiting time T of the target player is greater than the second time threshold T2, the total latency threshold can be set to the second total latency threshold. Since the second total latency threshold is greater than the first total latency threshold, to prevent players from being unable to match with other players for an extended period, the total latency distance restriction can be removed, allowing any candidate player to be assigned.
[0125] If the matchmaking waiting time T of the target game player is greater than the first time threshold T1 and less than the second time threshold T2, then the correspondence between the game matchmaking time T and the total delay distance V is set so as to make flexible adjustments.
[0126] Specifically, the difference between the matching waiting time T and the first time threshold T1 is calculated to obtain a sixth calculation result (T-T1); the difference between the second time threshold T2 and the first time threshold T1 is calculated to obtain a seventh calculation result (T2-T1); the difference between the second preset total delay distance V2 and the first preset total delay threshold V1 is calculated to obtain an eighth calculation result (V2-V1); based on the sixth calculation result, the seventh calculation result, and the eighth calculation result, a specific game player who will play against the game player is determined from the candidate game players.
[0127] In some implementations, the step of determining the target player to play against the game player from the candidate game players based on the sixth calculation result, the seventh calculation result, and the eighth calculation result includes:
[0128] The ratio of the sixth calculation result (T-T1) to the seventh calculation result (T2-T1) is used to determine the proportion (ninth calculation result); the product of the ninth calculation result (T-T1) / (T2-T1) and the eighth calculation result (V2-V1) is used to determine the increased portion of the total latency threshold (tenth calculation result); the sum of the tenth calculation result (T-T1) / (T2-T1)*(V2-V1) and the first preset total latency threshold V1 is used to determine the target total latency threshold; candidate game players whose total latency threshold is less than the target total latency threshold are identified as specific game players. The second preset total latency threshold V2 is the total latency threshold corresponding to the game matching duration T2.
[0129] As described above, this embodiment of the application determines a set of players to be matched and available servers in response to a game matchmaking command sent by a target player. The set of players includes the target player and players that can be matched with the target player. For each player in the set, the network latency between the player and each server is obtained. Each network latency is compared with a specified latency threshold, and servers with network latency less than the threshold are identified as candidate servers for that player. Based on each player's candidate servers, players who share at least one candidate server with the target player are identified as candidate players to match with the target player. Thus, by determining the network latency of players, candidate players sharing servers with the target player can be assigned to the target player, avoiding poor network performance and a bad gaming experience due to network latency during gameplay.
[0130] To facilitate better implementation of the game matching method provided in this application, this application also provides an apparatus based on the above-described game matching method. In this embodiment, the description will focus on the game matching apparatus, which can be integrated into a server equipped with a storage unit and a microprocessor, thus possessing computing power.
[0131] The meanings of the terms are the same as in the game matching method described above. For specific implementation details, please refer to the description in the method embodiment.
[0132] Please see Figure 2 , Figure 2This is a schematic diagram of the structure of a game matching device provided in an embodiment of this application. The game matching device may include a first determining module 301, a second determining module 302, and a third determining module 303, etc.
[0133] The first determining module 301 is used to determine the set of game players to be matched and the available servers in response to the game matching instruction sent by the target game player, wherein the set of game players includes the target game player and the game players that the target game player can match;
[0134] The second determining module 302 is used to obtain the network latency between each game player and each server for each game player in the game player set, compare each network latency with a specified latency threshold, and determine the server corresponding to the network latency less than the latency threshold as the candidate server of the game player.
[0135] The third determining module 303 is used to determine, based on each game player's candidate server, game players who share at least one candidate server with the target game player as candidate game players who match the target game player.
[0136] In some embodiments, the second determining module 302 includes:
[0137] The first acquisition submodule is used to acquire multiple initial network latencies between the game player and the server for each server;
[0138] The second acquisition submodule is used to obtain the current network latency between the game player and the server based on the multiple initial network latencies.
[0139] In some implementations, the second acquisition submodule includes:
[0140] The first acquisition unit is used to obtain the current network latency between the game player and the server by taking the median from a plurality of initial network latencies.
[0141] In some implementations, the first acquisition submodule includes:
[0142] The second acquisition unit is configured to acquire the initial network latency between a first specified number of the game players and the server at a first time interval;
[0143] The third acquisition unit is used to acquire a second number of initial network delays between the game players and the server at a second time interval after acquiring the first specified number of initial network delays;
[0144] The first determining unit is configured to use the first specified number of initial network delays and the second specified number of initial network delays as multiple initial network delays between the game player and the server.
[0145] In some implementations, the first acquisition submodule includes:
[0146] The fourth acquisition unit is used to acquire the initial network latency between the game player and the server at a first time interval within a first duration.
[0147] The fifth acquisition unit is used to acquire the initial network latency between the game player and the server at a second time interval within a second duration.
[0148] The second determining unit is used to take the initial network latency obtained within the first time period and the initial network latency obtained within the second time period as multiple initial network latencies between the game player and the server.
[0149] In some implementations, the first time interval is shorter than the second time interval.
[0150] In some implementations, the first acquisition submodule includes:
[0151] The sixth acquisition unit is used to acquire the time when the game player sends a network packet to the server, and the time when the game player receives the network packet returned by the server;
[0152] The third determining unit is used to determine the difference between the sending time and the return time as the initial network latency between the game player and the server.
[0153] In some implementations, the first acquisition submodule includes:
[0154] The seventh acquisition unit is used to acquire the current initial network latency between the game player and the server to form the plurality of initial network latency between the game player and the server.
[0155] In some implementations, the first acquisition submodule further includes:
[0156] The storage unit is used to send the current initial network latency to the server for storage, thereby obtaining the historical initial network latency.
[0157] In some implementations, sending the current initial network latency to the server for storage to obtain the historical initial network latency includes:
[0158] The eighth acquisition unit is used to acquire the current network environment information of the game player;
[0159] The sending unit is used to send the current initial network delay to the location corresponding to the network environment information in the server for storage, so as to obtain the historical initial network delay.
[0160] In some implementations, the first acquisition submodule includes:
[0161] The component is configured to obtain the historical initial network latency between the game player and the server from the server, in order to form the plurality of initial network latencies between the game player and the server.
[0162] The ninth acquisition unit is configured in some embodiments, wherein the first acquisition submodule includes:
[0163] The tenth acquisition unit is used to acquire the current network environment information of the game player;
[0164] The eleventh acquisition unit is used to acquire the historical initial network latency between the game player and the server from the location corresponding to the current network environment information in the server.
[0165] In some embodiments, the apparatus further includes:
[0166] A determining unit is configured to determine the latency threshold based on the number of matchable game players.
[0167] In some implementations, the determining unit includes:
[0168] The first setting subunit is configured to set the delay threshold to a first delay threshold if the number of matchable game players is less than or equal to a first number.
[0169] The second setting subunit is used to set the delay threshold to the second delay threshold if the number of matchable game players is greater than or equal to the second number.
[0170] The third setting subunit is used to set the delay threshold to a third delay threshold if the number of matchable game players is greater than the first number and less than the second number.
[0171] Wherein, the first quantity is less than the second quantity, the first delay threshold is greater than the second delay threshold, and the third delay threshold is greater than the second delay threshold and less than the first delay threshold.
[0172] In some implementations, the determining unit further includes:
[0173] A determining subunit is configured to determine the third latency threshold based on the number of matchable game players, the first number, the second number, the first latency threshold, and the second latency threshold.
[0174] In some embodiments, the apparatus further includes:
[0175] The fourth determining module is used to determine, for each candidate game player, a common candidate server shared by the candidate game player and the target game player;
[0176] The fifth determining module is used to determine, for each of the common candidate servers, the difference in network latency between the target game player and the candidate game player and the common candidate server respectively;
[0177] The sixth determining module is used to determine the sum of the differences corresponding to each of the common candidate servers;
[0178] The seventh determining module is used to compare the sum with a specified total latency threshold. If the sum is less than the total latency threshold, the candidate game player is determined as a game player that can be matched with the target game player.
[0179] In some embodiments, the apparatus further includes:
[0180] The acquisition module is used to acquire the matchmaking waiting time of the target game player;
[0181] The first setting module is used to set the total delay threshold to a first total delay threshold if the matching waiting time is less than or equal to a first time threshold.
[0182] The second setting module is used to set the total delay threshold as the second total delay threshold if the matching waiting time is greater than or equal to the second time threshold.
[0183] The third setting module is used to set the total delay threshold to a third total delay threshold if the matching waiting time is greater than the first time threshold and less than the second time threshold.
[0184] Wherein, the first time threshold is less than the second time threshold, the first total delay threshold is less than the second total delay threshold, and the third total delay threshold is greater than the first total delay threshold and less than the second total delay threshold.
[0185] As described above, in this embodiment, the first determining module 301 responds to a game matchmaking command sent by the target game player, determining a set of game players to be matched and an allocable server. The set of game players includes the target game player and game players that the target game player can match with. The second determining module 302, for each game player in the set, obtains the current network latency between the game player and each server, compares each network latency with a specified latency threshold, and determines the server corresponding to the network latency less than the latency threshold as the game player's candidate server. The third determining module 303, based on each game player's candidate server, determines game players who share at least one candidate server with the target game player as candidate game players to match with the target game player. Thus, by determining the game player's network latency, candidate game players sharing the same server as the target game player can be assigned to the target game player, avoiding poor network performance and a bad gaming experience due to network latency during gameplay.
[0186] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0187] Accordingly, embodiments of this application also provide a server, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the structure of a server provided in an embodiment of this application. The server 2000 includes a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 and the memory 402 are electrically connected. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0188] The processor 401 is the control center of the server 2000. It connects various parts of the server 2000 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, it performs various functions of the server 2000 and processes data, thereby monitoring the server 2000 as a whole.
[0189] In this embodiment, the processor 401 in the server 2000 loads the instructions corresponding to the processes of one or more applications into the memory 402 according to the following steps, and the processor 401 runs the applications stored in the memory 402 to achieve various functions:
[0190] In response to a game matchmaking command sent by a target player, a set of players to be matched and available servers are determined, wherein the set of players includes the target player and players that the target player can match with; for each player in the set of players, the network latency between the player and each server is obtained, and each network latency is compared with a specified latency threshold, and servers with network latency less than the latency threshold are determined as candidate servers for the player; based on each player's candidate servers, players who share at least one candidate server with the target player are determined as candidate players to match with the target player.
[0191] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0192] Optional, such as Figure 3 As shown, the server 2000 also includes an input unit 403 and a power supply 404. The processor 401 is electrically connected to both the input unit 403 and the power supply 404. Those skilled in the art will understand that... Figure 3 The server structure shown does not constitute a limitation on the server and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0193] The input unit 403 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0194] Power supply 404 is used to power the various components of server 2000. Optionally, power supply 404 can be logically connected to processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 404 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0195] although Figure 3 As not shown in the diagram, the server 2000 may also include a camera, sensors, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0196] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0197] As can be seen from the above, the server provided in this embodiment can determine the set of players to be matched and the available servers by responding to the game matchmaking command sent by the target game player. The set of players includes the target game player and the players that the target game player can match with. For each player in the set, the server obtains the current network latency between the player and each server, compares each network latency with a specified latency threshold, and determines the server with a network latency less than the threshold as the player's candidate server. Based on each player's candidate server, players who share at least one candidate server with the target game player are determined as candidate players to match with the target game player. Thus, by determining the network latency of the players, candidate players sharing servers with the target game player can be assigned to the target game player, avoiding poor network performance and a bad gaming experience due to network latency during gameplay.
[0198] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0199] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute steps in any of the data analysis methods provided in embodiments of this application. For example, the computer program can execute the following steps:
[0200] In response to a game matchmaking command sent by a target player, a set of players to be matched and available servers are determined, wherein the set of players includes the target player and players that the target player can match with; for each player in the set of players, the network latency between the player and each server is obtained, and each network latency is compared with a specified latency threshold, and servers with network latency less than the latency threshold are determined as candidate servers for the player; based on each player's candidate servers, players who share at least one candidate server with the target player are determined as candidate players to match with the target player.
[0201] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0202] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0203] Since the computer program stored in the storage medium can execute the steps in any of the game matching methods provided in the embodiments of this application, it can achieve the beneficial effects that any of the data analysis methods provided in the embodiments of this application can achieve, as detailed in the preceding embodiments, and will not be repeated here.
[0204] The above provides a detailed description of a game matching method, apparatus, storage medium, and server provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A game matching method characterized by comprising: The method includes: In response to a game matchmaking command sent by a target game player, a set of game players to be matched is determined, wherein the set of game players includes the target game player and game players that the target game player can match; For each player in the set of game players, the network latency between the player and each server is obtained, and each network latency is compared with a specified latency threshold. The server with a network latency less than the latency threshold is determined as the candidate server for the player. Based on each player's candidate server, players who share at least one candidate server with the target player are identified as candidate players who match the target player. The method further includes: For each candidate game player, determine the common candidate server that the candidate game player and the target game player share; For each of the common candidate servers, determine the difference in network latency between the target game player and the candidate game player and the common candidate server, respectively; The sum of the differences corresponding to each of the common candidate servers is determined as the total latency distance; The total latency distance is compared with a specified total latency threshold. If the total latency distance is less than the total latency threshold, the candidate game player is determined as a game player who can be matched with the target game player. The total latency threshold is determined based on the matchmaking wait time of the target game player.
2. The method of claim 1, wherein, The step of obtaining the current network latency between the game player and each server includes: For each server, obtain multiple initial network latencies between the game player and the server; The current network latency between the game player and the server is obtained based on multiple initial network latencies.
3. The method of claim 2, wherein, The step of obtaining the current network latency between the game player and the server based on multiple initial network latencies includes: The median of the initial network latency is taken to obtain the current network latency between the game player and the server.
4. The method of claim 2, wherein, The process of obtaining multiple initial network latencies between the game player and the server includes: The initial network latency between a first specified number of the game players and the server is obtained at a first time interval; After obtaining the first specified number of initial network latencies, a second number of initial network latencies between the game players and the server are obtained at a second time interval; The first specified number of initial network delays and the second specified number of initial network delays are used as multiple initial network delays between the game player and the server.
5. The method of claim 2, wherein, The process of obtaining multiple initial network latencies between the game player and the server includes: Within a first duration, the initial network latency between the game player and the server is obtained at a first time interval; The initial network latency between the game player and the server is obtained at a second time interval within a second duration. The initial network latency obtained within the first time period and the initial network latency obtained within the second time period are used as multiple initial network latencies between the game player and the server.
6. The method according to claim 4 or 5, characterized in that, The first time interval is shorter than the second time interval.
7. The method according to claim 2, characterized in that, The process of obtaining multiple initial network latencies between the game player and the server includes: The system obtains the time when the game player sends a network packet to the server, and the time when the game player receives the network packet returned by the server. The difference between the sending time and the return time is determined as the initial network latency between the game player and the server.
8. The method of claim 2, wherein, The process of obtaining multiple initial network latencies between the game player and the server includes: The current initial network latency between the game player and the server is obtained to form the plurality of initial network latencies between the game player and the server.
9. The method of claim 8, wherein, The method further includes: The current initial network latency is sent to the server for storage to obtain the historical initial network latency.
10. The method of claim 9, wherein, The step of sending the current initial network latency to the server for storage to obtain the historical initial network latency includes: Obtain the current network environment information of the game player; The current initial network latency is sent to the location corresponding to the network environment information in the server for storage, thus obtaining the historical initial network latency.
11. The method according to claim 10, characterized in that, The process of obtaining multiple initial network latencies between the game player and the server includes: The historical initial network latency between the game player and the server is obtained from the server to form the plurality of initial network latencies between the game player and the server.
12. The method of claim 11, wherein, The step of obtaining the historical initial network latency between the game player and the server from the server includes: Obtain the current network environment information of the game player; The historical initial network latency between the game player and the server is obtained from the location corresponding to the current network environment information in the server.
13. The method of claim 1, wherein, The method further includes: The latency threshold is determined based on the number of matchable game players.
14. The method of claim 13, wherein, Determining the latency threshold based on the number of matchable game players includes: If the number of matchable game players is less than or equal to the first number, then the latency threshold is set to the first latency threshold; If the number of matchable game players is greater than or equal to the second number, then the latency threshold is set to the second latency threshold; If the number of matchable game players is greater than the first number and less than the second number, then the latency threshold is set to a third latency threshold; Wherein, the first quantity is less than the second quantity, the first delay threshold is greater than the second delay threshold, and the third delay threshold is greater than the second delay threshold and less than the first delay threshold.
15. The method of claim 14, wherein, The method further includes: The third latency threshold is determined based on the number of matchable game players, the first number, the second number, the first latency threshold, and the second latency threshold.
16. The method of claim 1, wherein, The method further includes: Obtain the matchmaking wait time of the target game player; If the matching waiting time is less than or equal to the first time threshold, then the total delay threshold is set to the first total delay threshold. If the matching waiting time is greater than or equal to the second time threshold, then the total delay threshold is set as the second total delay threshold; If the matching waiting time is greater than the first time threshold and less than the second time threshold, then the total delay threshold is set to the third total delay threshold. Wherein, the first time threshold is less than the second time threshold, the first total delay threshold is less than the second total delay threshold, and the third total delay threshold is greater than the first total delay threshold and less than the second total delay threshold.
17. A game matching apparatus characterized by comprising: include: The first determining module is used to determine a set of game players to be matched in response to a game matchmaking instruction sent by the target game player, wherein the set of game players includes the target game player and game players that the target game player can match; The second determining module is used to obtain the network latency between each game player and each server for each game player in the game player set, compare each network latency with a specified latency threshold, and determine the server corresponding to the network latency less than the latency threshold as the candidate server for the game player; The third determining module is used to determine, based on each game player's candidate server, game players who share at least one candidate server with the target game player as candidate game players who match the target game player. The device is also used for: For each candidate game player, determine the common candidate server that the candidate game player and the target game player share; For each of the common candidate servers, determine the difference in network latency between the target game player and the candidate game player and the common candidate server, respectively; The sum of the differences corresponding to each of the common candidate servers is determined as the total latency distance; The total latency distance is compared with a specified total latency threshold. If the total latency distance is less than the total latency threshold, the candidate game player is determined as a game player who can be matched with the target game player. The total latency threshold is determined based on the matchmaking waiting time of the target game player.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the game matching method according to any one of claims 1 to 16.
19. A server, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the game matching method as described in any one of claims 1 to 16.