Game matching processing method, device and equipment for virtual scene, computer program product and computer readable storage medium
By sampling and calculating weight distribution from historical game data, guiding candidate team selection is solved, the problem of greedy algorithm not taking into account the global state, and better team matching and throughput improvement is achieved.
Patent Information
- Application Number
- CN202410235111.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-29
- Publication Date
- 2025-08-29
AI Technical Summary
The existing greedy algorithms fail to consider whether there is a better composition game plan in the global state in the game processing of virtual scenes, resulting in some candidate teams being unable to form games in a timely manner, affecting the matching throughput performance of the server.
By sampling from historical game data to obtain sample game data, the weight distribution of teams selected for different members in the matching state of each team is calculated, and the candidate team is added to the game to be started according to the weight distribution, and the candidate team is selected with better candidate teams in the global scope.
Reduces the average matching time of candidate teams, improves matching success rate and server throughput.
Smart Images

Figure CN120550418A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device, computer program product, and computer-readable storage medium for processing a game in a virtual scene. Background Art
[0002] A game is a typical way of virtual scenes. When there are multiple candidate teams that need to join the game, the server needs to match the candidate teams in a relatively short time to form a game.
[0003] The game processing solutions in related technologies generally adopt a greedy algorithm. When a group of teams that can start a game are found in a certain order (generally the order in which the candidate teams apply to join the match), a new game is established with these teams. However, the game processing solution based on the greedy algorithm only considers whether the currently established game can be started, but does not consider whether there may be a better game formation solution under the global state. As a result, some candidate teams cannot form a game in time. The resulting long waiting time affects the matching throughput performance of the server. Summary of the Invention
[0004] The embodiments of the present application provide a method, apparatus, device, computer program product, and computer-readable storage medium for processing a virtual scene game, which can reduce the overall average game matching time of a team and improve the matching success rate.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] The present invention provides a method for processing a game in a virtual scene, the method comprising:
[0007] Acquiring historical game data of a virtual scene, wherein the historical game data includes the number of historical teams with different numbers of members that formed a game within a historical time period;
[0008] Sampling the historical game data to obtain sample game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed games during the historical time period, and the ratio of the number of teams between the historical teams with different numbers of members is the same as the ratio of the number of teams between the sample teams with different numbers of members;
[0009] Determining, based on the sample game data, a weight distribution for selecting the sample teams with different numbers of members to form a game in different team matching states, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form a game;
[0010] Obtaining a queue to be matched, wherein the queue to be matched includes a plurality of candidate teams to be formed into a game;
[0011] Adding the candidate teams in the to-be-matched queue to the game to be started according to the weight distribution;
[0012] Perform an opening operation on the game to be opened.
[0013] An embodiment of the present application provides a game processing device for a virtual scene, including:
[0014] A data acquisition module, configured to acquire historical game data of a virtual scene, wherein the historical game data includes the number of historical teams with different numbers of members that formed a game within a historical time period;
[0015] The data acquisition module is further configured to sample the historical game data to obtain sample game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed games during the historical time period, and the ratio of the number of teams between the historical teams with different numbers of members is the same as the ratio of the number of teams between the sample teams with different numbers of members;
[0016] a weight determination module, configured to determine, based on the sample game data, a weight distribution for selecting sample teams with different numbers of members to form a game in different team matching states, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form a game;
[0017] A matching processing module is used to obtain a queue to be matched, wherein the queue to be matched includes a plurality of candidate teams to be formed into a game;
[0018] The matching processing module is further configured to add the candidate teams in the to-be-matched queue to the to-be-started game according to the weight distribution;
[0019] The opening module is used to perform opening operations on the game to be opened.
[0020] An embodiment of the present application provides an electronic device, comprising:
[0021] a memory for storing computer-executable instructions;
[0022] The processor is used to implement the virtual scene game processing method provided in the embodiment of the present application when executing the computer-executable instructions stored in the memory.
[0023] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing a game processing method for a virtual scene provided in an embodiment of the present application when executed by a processor.
[0024] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions. When the computer program or computer-executable instructions are executed by a processor, the virtual scene game processing method provided by the embodiment of the present application is implemented.
[0025] The embodiments of the present application have the following beneficial effects:
[0026] By sampling small-scale sample game data from large-scale historical game data, the weight distribution of selecting different types of teams (corresponding to different numbers of members) in each team matching state is calculated based on the sample game data. The weight distribution is used as a guide for subsequent game formation. That is, the candidate teams in the to-be-matched queue are added to the to-be-started games according to the weight distribution, so as to select better candidate teams globally, thereby achieving the beneficial effect of saving the average matching time of candidate teams and improving the throughput of matching candidate teams to form games. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Schematic diagram of the structure of the game processing system architecture of the virtual scene provided by the embodiment of the present application;
[0028] Figure 2 1 is a schematic diagram of the structure of the matching server 100 provided in an embodiment of the present application;
[0029] Figure 3A This is a first flow chart of a method for processing a game in a virtual scene provided by an embodiment of the present application;
[0030] Figure 3B This is a second flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0031] Figure 3C 3 is a schematic diagram of a third flow chart of a method for processing a game in a virtual scene provided in an embodiment of the present application;
[0032] Figure 3D This is a fourth flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0033] Figure 3E This is a fifth flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0034] Figure 3F This is a sixth flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0035] Figure 3G This is a seventh flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0036] Figure 3HThis is an eighth flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0037] Figure 3I This is a ninth flow chart of the method for processing a game in a virtual scene provided by an embodiment of the present application;
[0038] Figure 4 Schematic diagram of the framework of the game processing method for a virtual scene provided by an embodiment of the present application;
[0039] Figure 5 This is a schematic diagram of the game matching process of the virtual scene provided in an embodiment of the present application.
[0040] It should be pointed out that the above-mentioned "first" and "second" are only used to distinguish different solutions, and do not represent the degree of distinction between the advantages and disadvantages of the solutions or the priority in the implementation process. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0042] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0043] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0044] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0045] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0046] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0047] 1) Historical game data refers to the number of historical teams with different numbers of members that formed a game within a historical time period. For example, it can be expressed as the game data in the virtual scene of the previous day. The game data may include, for example, the total number of one-person teams, the total number of two-person teams, and the total number of three-person teams.
[0048] 2) Sample game data refers to game data in a small-scale sample obtained by analyzing the ratio of the number of historical teams with different numbers of members in the historical game data. For example, if the ratio of the number of historical teams with different numbers of members in the historical game data is 3:2, the total number of historical teams is 10,000. Assuming the preset small-scale sample size is 500, the obtained sample game data includes 300 one-player teams and 200 two-player teams.
[0049] 3) Team matching status refers to the total number of teams and members used to form a game. For example, the team matching status of a certain team may be that there are currently 2 teams used to form a game, with a total of 7 members.
[0050] 4) Start conditions: These are the conditions under which a match can begin. These conditions may include the maximum number of teams and the maximum total number of players. They may also be a range of values for the number of teams and the total number of players. For example, a virtual scenario start condition might require that each match must have at least two teams, one of which must be a two-player team, and each team can have one or two players.
[0051] 5) Target opening plan refers to a plan that allows every team in the sample game data to enter the game. Multiple games can be constructed through the target opening plan.
[0052] 6) Weight distribution refers to the weight of selecting sample teams with different numbers of members to form a game under different team matching conditions. For example, when the team matching status is that there are 2 teams with a total of 7 people, the weight of selecting a team with 1 person is 20. At this time, the weight can be expressed as: probb[2][7][1]=20, where probb[i][j][k] represents the weight of the next selected team being a team with k people when i teams with a total of j people have been selected.
[0053] The game processing solutions in related technologies generally use a greedy algorithm. When a group of teams that can start a game are found in a certain order (generally the order of joining the match time), a new room is established with these teams and the game is started. However, the game processing solutions based on the greedy algorithm in related technologies only consider whether the currently established game can be started, but do not consider whether there may be a better game composition solution under the global state.
[0054] For example, consider the following starting conditions and participating teams: Each game requires two teams, each consisting of one or two players, and at least one two-player team must exist to start a game. Assuming an approximately equal ratio of one-player to two-player teams, consider the following sequence of participating teams: [1, 2, 2, 1, 2, 2, 1, 1]. The queue is sorted by the time they joined the match. We can see that there are eight teams waiting to be matched. Under the greedy rule of the related technique, Team 1 and Team 2 [1, 2] will form a game, Team 3 and Team 4 [2, 1] will form a game, and Team 5 and Team 6 [2, 2] will form a game. However, Teams 7 and 8, both single-player teams, cannot form a game and remain in the matchmaking queue, waiting for new teams to join. In fact, if the order of the game formation is reversed, Team 5 and Team 7 can form a game, and Team 6 and Team 8 can form a game. This way, no teams will be left behind in the matchmaking queue. The above example shows that the existing greedy algorithm's matching scheme only considers whether the current match can be started, but does not consider whether a better match formation scheme may be possible in the global state. This causes some teams to have to wait a long time before forming a match, affecting the server's throughput performance.
[0055] In order to solve the above problems, the embodiments of the present application provide a virtual scene game processing method, device, equipment, computer program product and computer-readable storage medium, which can sample sample game data from historical game data without increasing the load of the matching server, and calculate the weight distribution of selecting different types of teams (corresponding to different numbers of members) in each team matching state based on the sample game data. During matching, the candidate teams in the to-be-matched queue are added to the to-be-started game according to the weight distribution, thereby selecting a better candidate team globally, thereby achieving the beneficial effect of reducing the average matching time of the candidate teams and improving the throughput of the matching server.
[0056] The following describes an exemplary application of the device provided in the embodiment of the present application. The device provided in the embodiment of the present application can be implemented as a server. The following describes an exemplary application when the device is implemented as a server.
[0057] See also Figure 1 , Figure 1This is a structural diagram of the game processing system architecture of a virtual scene provided by an embodiment of the present application. Figure 1 The process involves a matching server 100, a terminal device 200, a game server 400, and a network 300. The terminal device 200 and the game server 400 are connected to the matching server 100 via the network 300, wherein the network 300 can be a wide area network or a local area network, or a combination of the two.
[0058] In some embodiments, the virtual scene game processing system provided in the embodiments of the present application can be collaboratively implemented by a matching server 100, a terminal device 200 (a terminal device running a virtual scene client, such as a terminal device running a game application) and a game server 400. For example, the virtual scene client in the terminal device 200 responds to the matching request and sends the matching queue data to the matching server 100 to join the match. Here, only the case of one terminal device 200 sending matching team data to the matching server 100 is shown. The matching server 100 can receive matching team data from different terminal devices 200 at the same time to form a queue to be matched (the matching teams are sorted in the order of joining the match). The queue to be matched includes multiple matching teams. The matching server 100 uses the game processing method of the virtual scene provided in the embodiment of the present application to perform game matching processing on the queue to be matched, obtain multiple games corresponding to the queue to be matched as game matching results, and send the game matching results to the terminal device 200. After receiving the game matching results, the terminal device 200 sends the matching team data to the game server 400. The game server 400 starts the current game in response to receiving the game start instruction sent by the matching server 100 and the received matching team information.
[0059] In some embodiments, the server can implement the virtual scene game processing method provided in the embodiments of the present application by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. The computer program can be a native program or software module in the operating system. In short, the aforementioned computer-executable instructions can be instructions in any form, and the aforementioned computer program can be an application, module, or plug-in in any form.
[0060] In some embodiments, multiple servers may be organized into a blockchain network, with the matching server 100 being a node on the blockchain network. Information connections may exist between each node in the blockchain network, and information may be transmitted between nodes via such connections. Data related to the virtual scenario game processing method provided in the embodiments of the present application may be stored on the blockchain. For example, historical game data for the virtual scenario may be stored on the blockchain network, thereby ensuring the security and integrity of the historical data and preventing it from being tampered with or deleted.
[0061] In some embodiments, the above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0062] See also Figure 2 , Figure 2 is a structural diagram of the matching server 100 provided in an embodiment of the present application, Figure 2 The matching server 100 shown includes: at least one processor 110, a memory 130 and at least one network interface 120. The various components in the matching server 100 are coupled together via a bus system 140. It is understood that the bus system 140 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 140 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 140 is not described in detail. Figure 2 Various buses are labeled as bus system 140 .
[0063] The processor 110 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0064] The memory 130 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, a hard drive, an optical drive, etc. The memory 130 may optionally include one or more storage devices that are physically remote from the processor 110.
[0065] The memory 130 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 130 described in the embodiments of the present application is intended to include any suitable type of memory.
[0066] In some embodiments, the memory 130 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.
[0067] Operating system 131, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0068] A network communication module 132 for reaching other electronic devices via one or more (wired or wireless) network interfaces 120 , exemplary network interfaces 120 including Bluetooth, Wi-Fi, and Universal Serial Bus (USB);
[0069] In some embodiments, the apparatus provided in the embodiments of the present application may be implemented in software. Figure 2 A game processing device 133 is shown, representing a virtual scene stored in memory 130. This device can be software in the form of a program or plug-in, and includes the following software modules: a data acquisition module 1331, a weight determination module 1332, a matching processing module 1333, and a game opening module 1334. These modules are logically organized and can be arbitrarily combined or further separated depending on the functions they implement. The functions of each module are described below.
[0070] In other embodiments, the apparatus provided in the embodiments of the present application may be implemented in hardware. As an example, the apparatus provided in the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the game processing method for the virtual scene provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0071] Below, the virtual scene game processing method provided by the embodiment of the present application will be described in conjunction with the exemplary application and implementation of the matching server provided by the embodiment of the present application. Figure 3A , Figure 3A This is a first flow chart of the virtual scene game processing method provided by the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.
[0072] In step 101, historical game data of a virtual scene is obtained, wherein the historical game data includes the number of historical teams with different numbers of members constituting a game within a historical time period.
[0073] In some embodiments, in response to the operation of multiple clients (such as game applications) from different terminal devices, data of multiple matching teams corresponding to different clients are received, and the data of the multiple matching teams are uploaded to a database, thereby saving historical game data. When it is necessary to obtain historical game data of a virtual scene, the corresponding historical data can be obtained according to a preset time period. The historical game data includes the number of historical teams with different numbers of members that formed the game within the historical time period.
[0074] In other embodiments, historical game data may correspond to different matching pools. For example, corresponding matching pools may be maintained for different modes, maps, or game difficulties in the game. Historical game data in the corresponding matching pool may be obtained based on the mode, map, or game difficulty of the current team data to be matched. By fine-tuning the historical game data, the weight distribution of subsequent calculations may be more consistent with the actual operation of the game, thereby improving the accuracy of subsequent matching.
[0075] In step 102, sample game data is sampled from the historical game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed games within the historical time period, and the ratio of the number of teams between historical teams with different numbers of members is the same as the ratio of the number of teams between sample teams with different numbers of members.
[0076] In some embodiments, for example, the ratio of one-player teams to two-player teams in historical game data is 3:2, and the preset number of samples is 500. Then the obtained sample game data includes 300 one-player teams and 200 two-player teams.
[0077] In step 103, based on the sample game data, a weight distribution for selecting sample teams with different numbers of members in different team matching states to form a game is determined, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form the game.
[0078] In some embodiments, see Figure 3B , Figure 3A The step 103 shown can be implemented by following the steps 1031 to 1034, which are described in detail below.
[0079] In step 1031, a start condition preset for the virtual scene is obtained.
[0080] In some embodiments, the starting conditions are also called matching rules. The starting conditions of different virtual scenes may be different. For example, the starting conditions of a game map in the game may be 4-7 teams and 10-16 members in total. The game can start when both conditions are met.
[0081] In step 1032, under the premise that the opening conditions are met, multiple opening plans that can be formed based on sample teams with different numbers of members are determined, where the opening plan is a plan for forming a game by combining sample teams with different numbers of members.
[0082] In some embodiments, see Figure 3C , Figure 3B Step 1032 shown can be implemented by following steps 10321 to 10324, which are described in detail below.
[0083] In step 10321, a scenario variable is generated, wherein the scenario variable is used to characterize the number of sample teams with different numbers of members constituting the game.
[0084] Taking the example of sample teams including 1-person team, 2-person team, 3-person team and 4-person team, the solution variable includes multiple sub-variables (corresponding to the dimensions of the solution variable), and the multiple sub-variables correspond to different numbers of members. Each sub-variable is used to characterize the number of sample teams with a specific number of members that make up the game. For example, the solution variable can be represented as a multidimensional array [a][b][c][d], where a represents the number of 1-person teams, b represents the number of 2-person teams, c represents the number of 3-person teams, and d represents the number of 4-person teams. Here, the description of the solution variable is only for example. In actual application, it can be adjusted according to the type of sample teams with different numbers of members in the virtual scene. The embodiment of the present application does not limit the specific dimensions or representation methods of the solution variables.
[0085] In step 10322, the plan variables are initialized to obtain an initial opening plan.
[0086] Continuing with the above example, initialization can be to assign an initial value of 0 to each dimension in the plan variable. For example, for the plan variables [a][b][c][d] above, the initial opening plan can be expressed as [0][0][0][0].
[0087] In step 10323, sample teams are added to the initial opening plan in sequence to obtain multiple updated candidate opening plans.
[0088] Continuing with the above example, we add sample teams to the initial opening plan in sequence to obtain multiple updated candidate opening plans, which can be expressed as [0][0][0][1], [0][0][0][2], etc., where [0][0][0][1] means there is a 4-person team in the current opening plan, and [0][0][0][2] means there are 2 4-person teams in the current opening plan.
[0089] In some embodiments, the start conditions are designed to adapt to the performance of the game server. For example, they may include at least the maximum number of sample teams and the maximum total number of members to avoid instability caused by the unlimited size of the game, such as memory overflow of the game server.
[0090] See also Figure 3D , Figure 3C Step 10323 shown can be implemented by following steps 103231 to 103232, which are described in detail below.
[0091] In step 103231, the maximum value of each subvariable in the scenario variable is determined based on the maximum number of sample teams and the maximum total number of members.
[0092] Continuing with the above example, when the starting conditions are 4-7 teams and 10-16 members in total. In the above example, the maximum number of sample teams is 7, and the maximum number of members is 16. Based on the above starting conditions, it can be determined that the solution variables [a][b][c][d] need to meet the following constraints: the maximum value of a is 7, the maximum value of b is 7, the maximum value of c is 5, and the maximum value of d is 4 (because the maximum number of sample teams is 7 and the maximum number of members is 16, so a≤7 and 1a≤16, so the maximum value of a is 7, similarly b≤7 and 4d≤16, so the maximum value of d is 4, where 1a represents the product of the number of 1-person teams a and the corresponding number of team members, that is, the total number of members in a 1-person team, and similarly 4b represents the total number of members in a 4-person team).
[0093] In step 103232, sample teams are sequentially added to the initial opening plan to obtain multiple candidate opening plans based on the initial opening plan, wherein each subvariable in each candidate opening plan is less than or equal to the maximum value corresponding to the subvariable.
[0094] In some embodiments, first, a sample team is added to the initial opening plan, that is, the value of the sub-variable corresponding to the number of members of the added sample team in the plan variable of the initial opening plan is increased by 1, so as to obtain a candidate opening plan based on the initial opening plan;
[0095] Then, continue to add another sample team to the obtained candidate opening plan, that is, add 1 to the value of the sub-variable corresponding to the other sample team in the plan variable of the candidate opening plan to obtain the plan variable of another candidate opening plan; and so on, until each sub-variable in the plan variable of the obtained candidate opening plan is less than or equal to the maximum value corresponding to the sub-variable. The maximum value here is determined by the opening conditions, that is, the maximum value of the sample team with the corresponding number of members required in the opening conditions.
[0096] Continuing with the above example, sample teams are sequentially added to the initial opening plan to obtain multiple updated candidate opening plans. For example, a sample team of 4 is added to the initial opening plan [0][0][0][0] to obtain [0][0][0][1]. On this basis, another sample team of 4 is added to obtain [0][0][0][2]. By analogy, multiple candidate opening plans can be expressed as [0][0][0][1], [0][0][0][2], ..., [7][7][5][4]. Here, multiple candidate opening plans are only used as examples. In the process of sequentially adding sample teams to the opening plan, constraints can also be imposed based on the opening conditions. For example, based on the maximum number of sample teams being 7, the sum of a, b, c, and d can be obtained to be less than or equal to 7, thereby reducing the number of multiple candidate opening plans generated. The embodiment of the present application does not limit the constraints obtained based on the opening conditions during the generation process.
[0097] Continue to see Figure 3C In step 10324, multiple opening plans that meet the opening conditions are searched from multiple candidate opening plans.
[0098] In some embodiments, each candidate opening plan is traversed, and plans that meet the opening conditions are retained to obtain multiple opening plans.
[0099] In some embodiments, the start conditions include at least a minimum number of sample teams and a minimum total number of members, and multiple candidate start plans are searched from multiple candidate start plans, wherein the number of sample teams included is greater than or equal to the minimum number of sample teams, and the total number of members of the sample teams included is greater than or equal to the minimum total number of members, as multiple start plans.
[0100] Continuing with the above example, when the opening conditions are 4-7 teams and 10-16 members, the following constraints can be obtained: 4≤a+b+c+d≤7, 10≤a+2b+3c+4d≤16. The candidate opening plans that meet these two constraints are taken as the opening plans, for example, the opening plans can be [2][3][1][0], [4][1][1][1], etc.
[0101] In other embodiments, multiple opening plans that meet the opening conditions can be obtained through a depth-first search algorithm. The embodiments of the present application do not limit the method of obtaining multiple opening plans. The purpose is to obtain a team composition plan that meets the opening conditions, that is, a starting plan.
[0102] Continue to see Figure 3B In step 1033, a target opening plan is determined among multiple opening plans so that multiple sample teams can form a game without omission.
[0103] In some embodiments, the target opening plan can be obtained by a feasibility knapsack algorithm, see Figure 3E , obtaining the target opening plan through the feasibility knapsack algorithm can be achieved through the following steps 10331 to 10334, which are described in detail below.
[0104] In step 10331, the opening state variable is initialized to obtain an initialized opening state, wherein the opening state is used to represent the state of at least one game formed by multiple sample teams.
[0105] In some embodiments, the opening state is used to represent the state in which multiple sample teams form at least one game, that is, among the multiple sample teams, each team can form a game (combination of teams).
[0106] In step 10332, each opening plan is added in sequence based on the initialized opening state to obtain multiple new opening states.
[0107] In some embodiments, to simplify the description, the opening state is exemplarily represented as dp[i][j], indicating that i one-person teams and j two-person teams can all start the game (that is, each team can form a game), and the initialized opening state is represented as dp[0][0]. When there are two opening plans, namely, one one-person team and one two-person team, and two two-person teams, each opening plan is added in turn based on the initialized opening state to obtain multiple new opening states. For example, it can be represented as adding the opening plan based on dp[0][0] to obtain dp[0][2] (corresponding to the opening plan of two two-person teams) and dp[1][1] (corresponding to the opening plan of one one-person team and one two-person team), that is, dp[i][j+2] and dp[i+1][j+1] can all start the game.
[0108] Continuing with the above example, based on the initialized opening state, the opening state variables represented by each opening plan are added in sequence to obtain multiple new opening states. For example, based on the initialized opening state dp[0][0], the opening plans of two two-person teams are added to obtain dp[0][2], where the opening state variables represented by the opening plans of the two two-person teams are [0][2].
[0109] In step 10333, each opening plan is iteratively added based on each new opening state until the new opening state represents that each sample team in the sample game data has entered the game, thereby obtaining the final opening state.
[0110] Continuing with the above example, we iteratively add each opening plan based on each new opening state, traverse all new opening states, and obtain the target opening plan that allows multiple sample teams to form a game without omission. For example, when there are 2 teams of 1 person and 10 teams of 2 people, we get multiple new opening states based on dp[0][0], namely dp[0][2] and dp[1][1]. Next, we continue to superimpose opening plans on the basis of dp[0][2] and dp[1][1]. For example, we superimpose the plan of forming two teams of 2 people based on dp[0][2] to obtain dp[0][4]. And so on, we continue to superimpose opening plans and traverse all situations until we get dp[2]
[10] . For example, the iterative process can be expressed as dp[0][0]→dp[0][2]→dp[0][4]→dp[0][6]→dp[0][8]→dp[1][9]→dp[2]
[10] .
[0111] In step 10334, an update path in the iterative process is obtained, and a target opening plan is obtained through the update path, wherein the update path includes multiple opening states formed in the iterative process from the initial opening state to the opening state.
[0112] Continuing with the above example, when there are 2 teams of 1 player and 10 teams of 2 players, it is known that dp[i][j+2] and dp[i+1][j+1] can all be opened, and dp[2]
[10] can be transferred through the following update path: p[2]
[10] →dp[1][9]→dp[0][8]→dp[0][6]→dp[0][4]→dp[0][2]→dp[0][0].
[0113] In some embodiments, see Figure 3F , Figure 3E The step 10334 shown can be implemented by following the steps 103341 to 103342, which are described in detail below.
[0114] In step 103341, the difference between the starting state variables of every two adjacent starting states in the update path is obtained, wherein the difference includes values of multiple dimensions, and the values of the multiple dimensions represent the number of sample teams with different numbers of members.
[0115] Continuing with the above example, when the update path is dp[2]
[10] →dp[1][9]→dp[0][8]→dp[0][6]→dp[0][4]→dp[0][2]→dp[0][0], the difference between the starting state variables of each two adjacent starting states in the update path is obtained. For example, the difference between dp[2]
[10] →dp[1][9] is [1][1]. And so on, multiple differences are obtained.
[0116] In step 103342, multiple differences are combined to obtain a target opening plan.
[0117] Continuing with the above example, the multiple differences obtained can be 2 [1][1] and 4 [0][2], that is, the target opening plan is 2 groups of [1][1] (1 team of 1 and 1 team of 2) and 4 groups of [0][2] (2 teams of 2).
[0118] Continue to see Figure 3B In step 1034, the target opening plan is used to obtain the weights of sample teams with different numbers of members selected under different team matching states to form a game, and the weight distribution is combined.
[0119] In some embodiments, see Figure 3G , Figure 3B Step 1034 shown can be implemented by executing the following steps 10341 to 10342 for each team matching status, which is described in detail below.
[0120] In step 10341, with the team matching status as a constraint condition, the contribution degrees corresponding to sample teams with different numbers of members when selecting sample teams with different numbers of members to form a game in the target opening plan are determined, where the contribution degree is used to represent the number of times a sample team with a specified number of members can be selected in the target opening plan.
[0121] Continuing with the above example, the target opening plan obtained in step 103342 is 2 [1][1] and 4 [0][2]. When the team matching status is 1 team with 1 person, the contribution of selecting a 1-person team is 0 (2×0+4×0, that is, since the opening conditions are not met, there is no opening situation with 2 1-person teams). The weight at this time can be expressed as prob[1][1][1]=0; when the team matching status is 1 team with 1 person, the contribution of selecting a 2-person team is 2 ( 2×1+4×0), the weight at this time can be expressed as prob[1][1][2]=2; when the team matching status is 1 team with 2 people, the contribution of selecting a 1-person team is 2(2×1+4×0), and the weight at this time can be expressed as prob[1][2][1]=2; when the team matching status is 1 team with 2 people, the contribution of selecting a 2-person team is 4(2×0+4×1), and the weight at this time can be expressed as prob[1][2][2]=4.
[0122] In step 10342, the multiple contribution degrees corresponding to each team matching status are used as multiple weights to be combined into a weight distribution.
[0123] Continuing with the above example, the multiple contributions corresponding to each team's matching status are used as multiple weights to form a weight distribution. For example, the weight distribution can be expressed as: prob[1][1][1]=0, prob[1][1][2]=2, prob[1][2][1]=2, prob[1][2][2]=4.
[0124] Continue to see Figure 3A In step 104, a queue to be matched is obtained, wherein the queue to be matched includes a plurality of candidate teams to be formed into a game.
[0125] In some embodiments, the queue to be matched is obtained within the current time period. The current time period and the historical time period correspond to different dates and have the same start time and end time. Here, the candidate teams are sorted according to the order of joining the queue to be matched. For example, the queue to be matched is represented as [1, 2, 2, 1, 2, 2, 1, 1], which is recorded as candidate team 1 to candidate team 8, where 1 represents a team of 1 person and 2 represents a team of 2 people.
[0126] In some embodiments, taking into account the similarity between the characteristics of the teams participating in the matching, it can be approximately considered that the team characteristics at the same time in the historical time period (the ratio between teams with different numbers of members) are basically consistent with those in the current time period. Therefore, the game data of the historical time period can be used to guide the matching process of the current time period, such as adopting any of the following schemes: guiding the game matching of all queues to be matched today through the overall weight distribution of yesterday's sample game data; guiding the game matching of all queues to be matched this week through the overall weight distribution of last week's sample game data; guiding the game matching of queues to be matched from 1 to 2 o'clock today through the overall weight distribution of sample game data, etc.
[0127] In step 105, candidate teams in the to-be-matched queue are added to the to-be-started game according to weight distribution.
[0128] In some embodiments, see Figure 3H , Figure 3A Step 105 shown can be implemented by traversing the queue to be matched and executing the following steps 1051 to 1055 for the candidate team currently traversed, which is described in detail below.
[0129] In step 1051, in response to the candidate team being a team that has already started a game, the next candidate team in the queue to be matched is traversed.
[0130] Continuing with the above example, the queue to be matched is represented as [1,2,2,1,2,2,1,1], which is recorded as candidate team 1 to candidate team 8, where 1 represents a team with one player and 2 represents a team with two players. If we traverse candidate team 1 and it is the team that has already started the game, we continue to traverse candidate team 2.
[0131] In step 1052, in response to the candidate team being a team that has not yet started a game, a game to be started is generated based on the candidate team.
[0132] Continuing with the above example, if candidate team 2 is a team that has not yet started a game, a game to be started is generated based on candidate team 2, and so on.
[0133] In step 1053, the game to be started is detected and a detection result is obtained.
[0134] Continuing with the above example, after generating the game to be started based on candidate team 2, it is checked whether the current game meets the start conditions. If the start conditions are not met, the process proceeds to execute the following step 1054; if the start conditions are met, the process proceeds to execute the following step 106.
[0135] In step 1054, in response to the detection result indicating that the game to be started does not meet the start conditions, a preset number of candidate teams after the team that has not started are selected in the order of their time of joining the queue to be matched to be added to the candidate team list.
[0136] In some embodiments, in response to the existence of a candidate team after the unstarted team in the to-be-matched queue, one candidate team is selected each time to be added to the candidate team list in chronological order until the number of candidate teams in the candidate team list reaches a preset value.
[0137] Continuing with the above example, we generate a game to be started based on candidate team 2. For example, if the preset value is 3 (i.e., the candidate list can accommodate up to 3 candidate teams), then the three candidate teams after candidate queue 2 in [1, 2, 2, 1, 2, 2, 1, 1] are added to the candidate team list in sequence, and the candidate team list can be expressed as [2, 1, 2].
[0138] In some embodiments, see Figure 3I , Figure 3H The step 1054 shown can be implemented by following the steps 10541 to 10542, which are described in detail below.
[0139] In step 10541, in response to the fact that there is no candidate team after the team that has not started, the game to be started is cleared, and the next candidate team in the queue to be matched is traversed.
[0140] Continuing with the above example, let's say we generate a game to be started based on candidate team 8, but there are no other candidate teams after candidate team 8 in the queue to be matched. At this point, the candidate team list is empty, so the game to be started is cleared, and the traversal continues with the next candidate team in the queue to be matched. After the traversal is complete, the teams that have already started in the queue to be matched are deleted, and the traversal ends.
[0141] In step 10542, in response to the number of candidate teams in the candidate team list not reaching a preset value and the candidate team list is not empty, at least one candidate team in the candidate team list is selected according to the weight distribution to join the game to be started, the candidate team list is cleared, and the process proceeds to the step of executing the detection of the game to be started to obtain the detection result.
[0142] Continuing with the above example, for example, a game to be started is generated based on candidate team 6, and there are two candidate teams (such as candidate team 7 and candidate team 8) after candidate team 6 in the queue to be matched. At this time, the candidate team list does not meet the preset value 3, but the candidate team list is not empty, so at least one candidate team in the candidate team list is still selected according to the weight distribution to join the game to be started, the candidate team list is cleared, and the process proceeds to the step of detecting the game to be started and obtaining the detection result.
[0143] Continue to see Figure 3H In step 1055, at least one candidate team in the candidate team list is selected according to the weight distribution to join the game to be started, and the candidate team list is cleared.
[0144] In some embodiments, the weight distribution includes the weights corresponding to the sample teams with different numbers of members selected to form a game in each team matching state, obtaining the weight corresponding to each candidate team in the candidate team list according to the weight distribution, and adding the candidate team with the largest weight to the game to be started.
[0145] Continuing with the above example, the weight distribution can be expressed as: prob[1][1][1]=0, prob[1][1][2]=2, prob[1][2][1]=2, prob[1][2][2]=4. Based on candidate team 2, the game to be started is generated. The preset value is 3, and the candidate team list is expressed as [2,1,2]. According to the weight distribution, there is currently 1 2-person team, and the weight of selecting another 1-person team is 2 (prob[1][2][1]=2). There is currently 1 2-person team, and the weight of selecting another 1-person team is 2 (prob[1][2][1]=2). The weight of a 2-player team is 4 (prob[1][2][2]=4). Therefore, a 2-player team is selected from the candidate list (can be candidate team 3 or candidate team 5). Candidate team 3 is selected to join the pending match based on the time sequence of joining the pending match queue (e.g., candidate team 3 joins the queue first). After joining candidate team 3, the pending match includes 2 2-player teams. The process then proceeds to the step of detecting the pending match and obtaining the detection result. At this point, the pending match meets the opening condition (corresponding to the dp[0][2] opening plan above).
[0146] Continue to see Figure 3A In step 106, the opening operation is performed on the game to be opened.
[0147] In some embodiments, in response to the detection result indicating that the game to be started meets the start conditions, the candidate teams in the game to be started are marked as teams that have started, and start information is sent to the game server and the client corresponding to the candidate teams in the game to be started, wherein the start information is used to indicate the start of the game to be started.
[0148] Continuing with the above example, based on candidate team 2, a game to be started is generated. After adding candidate team 3, the game to be started includes two two-person teams. The process then proceeds to the step of detecting the game to be started and obtaining the detection result. At this point, the game to be started meets the start conditions (corresponding to the dp[0][2] start plan). The candidate teams in the game to be started (candidate team 2 and candidate team 3) are marked as teams that have started, and the start information is sent to the game server and the clients corresponding to the candidate teams in the game to be started.
[0149] In some embodiments, when performing Figure 3A After step 106 shown, the team that has started the game may be deleted from the queue to be matched.
[0150] Continuing with the previous example, after traversing the queue to be matched, delete the teams that have already started in the queue to be matched, and the traversal ends.
[0151] Through steps 105 to 106, it is achieved that sample game data is sampled from historical game data without increasing the load on the matching server. Based on the sample game data, the weight distribution of selecting different types of teams (corresponding to different numbers of members) in each team's matching state is calculated. During matching, the candidate teams in the to-be-matched queue are added to the to-be-started game according to the weight distribution, thereby selecting a better candidate team globally, achieving the beneficial effect of reducing the average matching time of the candidate teams and improving the throughput of the matching server.
[0152] Next, an exemplary application of the embodiment of the present application in a game processing scenario of a virtual scene of a game application will be described. Figure 4 , Figure 4 This is a schematic diagram of the framework of the game processing method for a virtual scene provided by an embodiment of the present application. In response to the operation of game applications on multiple clients of different terminal devices, multiple matching teams join the match. The matching server receives the matching team data of the multiple matching teams and generates a queue to be matched according to the order of joining the matching pool. The matching server uploads the matching team data to the server. When obtaining the weight distribution for matching guidance, the computing server obtains historical game data through the server, obtains the weight distribution through the game processing method for a virtual scene provided by an embodiment of the present application, and sends the weight distribution to the matching server. The matching server matches the teams through the weight distribution to obtain a matching result. After that, the matching server sends the matching result to the corresponding client and notifies the game server to start the game. The game server receives the game start notification and receives the corresponding matching team according to the matching result, thereby starting the game. Here, the computing server can be implemented by an independent computing server or as a weight determination module of the matching server.
[0153] In some embodiments, the matching server's processing flow differs from that of other servers. Other servers are typically request-driven: upon receiving a request, they perform relevant processing logic and ultimately return the result to the sender. After the request is processed, no relevant data remains on the server. However, the most common request handled by the matching server is the join request, which requires placing teams joining the match into the matching server's queue. The matching server not only processes requests sent by clients but also traverses the entire matching queue, searching for possible teams to start a match and pairing them into a group. This results in a certain load on the matching server even when there are no requests. It takes more than one minute for the matching server to traverse and process a matching queue of only two hundred teams. Here, the traversal time of more than one minute refers to obtaining the target opening plan described above based on all the queues to be matched, thereby obtaining the current weight distribution. At this time, the calculation complexity is too high. An independent calculation server can be used to obtain the target opening plan based on sample game data (the total number of teams in the sample game data is controllable), thereby reducing the calculation complexity. The calculation server derives the weight distribution based on the sample game data and sends the weight distribution to the matching server, which is used by the matching server to guide the matching process. Therefore, the game processing method for virtual scenes provided in the embodiment of the present application is highly efficient.
[0154] See also Figure 5 , Figure 5 This is a schematic diagram of the game matching process of the virtual scene provided in an embodiment of the present application. The following is a specific description using the matching server as the execution entity.
[0155] In step 201, the i-th team is traversed.
[0156] In some embodiments, starting from the first team (i=1), the queues to be matched are traversed.
[0157] In step 202, it is determined whether i exceeds the length of the queue to be matched.
[0158] In some embodiments, in response to i not exceeding the length of the queue to be matched, the process proceeds to execute the following step 203 ; in response to i exceeding the length of the queue to be matched, the process proceeds to execute the following step 214 .
[0159] In step 203, it is determined whether the i-th team has started the game.
[0160] In some embodiments, in response to the i-th team being a team that has started the game, the process proceeds to the following step 204 ; in response to the i-th team being a team that has not started the game, the process proceeds to the following step 205 .
[0161] In step 204, continue traversing the next team.
[0162] In some embodiments, the process continues to traverse the next team in the queue to be matched, ie, i=i+1.
[0163] In step 205, a game to be started is generated with the i-th team.
[0164] In step 206, it is determined whether the game to be started can be started.
[0165] In some embodiments, in response to the game to be started meeting the start conditions and being able to start, the process proceeds to the following step 213 ; in response to the game to be started not meeting the start conditions and being unable to start, the process proceeds to the following step 207 .
[0166] In some embodiments, the start conditions are also called matching rules. The start conditions of different virtual scenes may be different. For example, the start conditions may require two teams for each game, each team may have 1 or 2 people, and there must be at least one two-person team to start a game.
[0167] In step 207, it is determined whether a team can be found to join the current game to be started.
[0168] In some embodiments, in response to a team being found to join the current game to be started, the process proceeds to execution of the following step 210; in response to a team not being found to join the current game to be started (corresponding to step 10541 above, there are no candidate teams after the team has not started), the process proceeds to execution of the following step 208.
[0169] In step 208, it is determined whether the candidate list is empty.
[0170] In some embodiments, in response to the candidate list being empty, the process proceeds to execute the following step 209 ; in response to the candidate list being not empty, the process proceeds to execute the following step 210 .
[0171] In step 209, the games to be started are cleared.
[0172] In step 210, the found team is added to the candidate list.
[0173] In step 211 , it is determined whether the candidate list is full.
[0174] In some embodiments, in response to the candidate list being full (such as reaching a preset number of teams), the process proceeds to execute the above step 207; in response to the candidate list being not full, the process proceeds to execute the following step 211.
[0175] In step 212, a team is selected from the candidate list according to the weight distribution to join the game to be started, and the candidate list is cleared.
[0176] Here, the determination of the weight distribution refers to the description of step 103 above, which will not be repeated here.
[0177] In some embodiments, assuming that the ratio of the number of one-player teams to two-player teams is 9:11, the obtained weight distribution is pro bb[1][1][2]=9, probb[1][2][1]=9, probb[1][2][2]=2. For example, consider the matching queue [1,2,2,1,2,2,1,1], recorded as teams 1 to 8. Assuming that the number of candidate teams is 3, first team 1 generates a game to be started, then the candidate list corresponding to team 1 is [2,2,1]. According to the weight distribution, it can be known that the two-player team should be selected to join the game to be started. At this time, the game to be started includes team 1 and team 2, and the process proceeds to execute the above step 206 to determine whether the game to be started can be started. In response to the game to be started meeting the start condition at this time, the process proceeds to execute the following step 213. In response to the game to be started not meeting the start condition at this time, the process proceeds to execute the above step 207.
[0178] Continuing with the above example, assume that the pending match consisting of Team 1 and Team 2 meets the start conditions (each match requires two teams, each team can have 1 or 2 people, and there must be at least one two-person team to start a match). Continue traversing Team 3, and remove the teams that have already started. The queue now remains [2, 1, 2, 2, 1, 1]. Team 3 generates a pending match. According to the weight distribution, the weight ratio of selecting a 1-person team and a 2-person team is 9:2. Then consider the three possible teams 4, 5, or 6. They are all likely to join the match, with weight ratios of 9:2:2 respectively. Therefore, there is a 9 / 13 probability of selecting Team 4, and the remaining queue is [2, 2, 1, 1]; there is a 4 / 13 probability of selecting Team 5 or Team 6, and the remaining queue is [1, 2, 1, 1]. If Team 5 or Team 6 is chosen, Team 4 will definitely be matched against the remaining two-player team, leaving Teams 7 and 8 unable to play. If Team 4 is chosen, the remaining teams are [2, 2, 1, 1], with Team 5 generating a pending match and then choosing Team 6. The weighting ratio for Team 7 or Team 8 is 2:9:9, meaning there's a 2 / 20 chance of choosing a two-player team and an 18 / 20 chance of choosing a one-player team. If a one-player team is chosen, there's one one-player team and one two-player team left, each of which can play. If a two-player team is chosen, there are two one-player teams left, unable to play.
[0179] When matching based on the greedy algorithm of the relevant technology, Team 1 and Team 2 [1, 2] will form a game, Team 3 and Team 4 [2, 1] will form a game, Team 5 and Team 6 [2, 2] will form a game, and the remaining Team 7 and Team 8, as they are both one-person teams, cannot form a game and wait in the matching queue for new players to enter.
[0180] In summary, when matching and forming a game using the method of step 212, the probability of two single-player teams remaining unable to form a game is 4 / 13 + 9 / 13 × 2 / 20 = 49 / 130, which is approximately 38%, while the probability of all eight teams forming a game is approximately 62%. This means that in this example, compared to the related art methods, there is a 62% chance of forming an additional game, improving matching efficiency and thus reducing the average matching time of the teams. Here, in this example, the ratio of single-player teams to two-player teams is 1:1, which is somewhat different from the 9:11 weight distribution used. In actual applications, the ratio of teams with different numbers of players represented by historical matching data and current matching data will not deviate so significantly, so the actual effect will be better than that shown in this example.
[0181] In step 213, all teams in the game to be started are marked as started, and the game server and client are notified of the game start information.
[0182] In some embodiments, all teams in the game to be started are marked as teams that have started, and start information is sent to the game server and the client, wherein the start information is used to indicate the start of the game to be started.
[0183] In step 214, the team that has started the game is deleted from the queue to be matched.
[0184] Through steps 201 to 214, it is achieved that sample game data is sampled from historical game data without increasing the load on the matching server, and the weight distribution of selecting different types of teams (corresponding to different numbers of members) in each team matching state is calculated based on the sample game data. During matching, the candidate teams in the to-be-matched queue are added to the to-be-started game according to the weight distribution, so as to select a better candidate team globally, thereby achieving the beneficial effect of reducing the overall average matching time of the team and improving the matching success rate, so that players can have more time to participate in the game.
[0185] In actual applications, taking a matching map in a virtual scene as an example, in this map, players can enter the match with any team size between one and four people. The starting conditions are 4-7 teams and 10-16 players. Both conditions must be met. Table 1 shows the number of teams participating in the map match in a certain time period of the previous day (corresponding to the historical game data above).
[0186] Table 1
[0187]
[0188]
[0189] Table 2
[0190]
[0191] Table 2 shows the changes in average matching time on that day using the original solution (greedy algorithm) and the virtual scene game processing method provided by the embodiment of the present application. It can be seen that through the virtual scene game processing method provided by the embodiment of the present application, the average matching time is reduced by about 10%, whether calculated by team average or player average. For the team with the longest original matching time, the one-person team without matching teammates, the time is reduced by about 14%. This type of team is also the largest type of team participating in the matching.
[0192] The following continues to describe the exemplary structure of the game processing device 133 of the virtual scene provided by the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2 As shown, the processing device 133 of the virtual resources stored in the memory 130 may include:
[0193] A data acquisition module 1331 is configured to acquire historical game data of a virtual scene, wherein the historical game data includes the number of historical teams with different numbers of members that formed a game within a historical time period;
[0194] In some embodiments, the data acquisition module 1331 is further used to sample the historical game data to obtain sample game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed the game within the historical time period, and the ratio of the number of teams between the historical teams with different numbers of members is the same as the ratio of the number of teams between the sample teams with different numbers of members.
[0195] A weight determination module 1332 is configured to determine, based on the sample game data, a weight distribution for selecting sample teams with different numbers of members to form a game in different team matching states, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form a game.
[0196] The matching processing module 1333 is used to obtain a queue to be matched, wherein the queue to be matched includes multiple candidate teams to be formed into a game.
[0197] In some embodiments, the matching processing module 1333 is further configured to add the candidate teams in the to-be-matched queue to the game to be started according to the weight distribution.
[0198] The opening module 1334 is configured to perform opening operations on the game to be opened.
[0199] In some embodiments, the weight determination module 1332 is further used to obtain opening conditions preset for the virtual scene; on the premise that the opening conditions are met, determine multiple opening plans that can be formed based on the sample teams with different numbers of members, wherein the opening plan is a plan for forming the sample teams with different numbers of members into a game; among the multiple opening plans, determine a target opening plan that allows the multiple sample teams to form a game without omission; through the target opening plan, obtain the weights of selecting the sample teams with different numbers of members to form a game under the different team matching states, and combine them into a weight distribution.
[0200] In some embodiments, the weight determination module 1332 is further used to generate a plan variable, wherein the plan variable is used to represent the number of sample teams with different numbers of members constituting the game; initialize the plan variable to obtain an initial opening plan; sequentially add the sample teams to the initial opening plan to obtain multiple updated candidate opening plans; and query multiple opening plans that meet the opening conditions from the multiple candidate opening plans.
[0201] In some embodiments, the opening conditions include at least a maximum number of sample teams and a maximum total number of members; the plan variable includes multiple sub-variables, each of the multiple sub-variables corresponds to a different number of members, and each sub-variable is used to characterize the number of sample teams with a specific number of members constituting the game; the weight determination module 1332 is further used to determine the maximum value of each sub-variable in the plan variable based on the maximum number of sample teams and the maximum total number of members; the sample teams are sequentially added to the initial opening plan to obtain multiple candidate opening plans based on the initial opening plan, wherein each sub-variable in each of the candidate opening plans is less than or equal to the maximum value corresponding to the sub-variable.
[0202] In some embodiments, the opening conditions include at least a minimum number of sample teams and a minimum total number of members; the weight determination module 1332 is further used to query from the multiple candidate opening plans a plurality of candidate opening plans in which the number of sample teams included is greater than or equal to the minimum number of sample teams, and the total number of members of the sample teams included is greater than or equal to the minimum total number of members, as the multiple opening plans.
[0203] In some embodiments, the weight determination module 1332 is further used to initialize the opening state variable to obtain an initialized opening state, wherein the opening state is used to represent the state in which multiple sample teams form at least one game; based on the initialized opening state, each of the opening plans is added in sequence to obtain multiple new opening states; each of the opening plans is iteratively added on the basis of each new opening state until the new opening state represents that each sample team in the sample game data enters the game, thereby obtaining a final opening state; obtaining an update path in the iterative process, and obtaining the target opening plan through the update path, wherein the update path includes multiple opening states formed in the iterative process from the initial opening state to the opening state.
[0204] In some embodiments, the weight determination module 1332 is further used to obtain the difference in the starting state variables between every two adjacent starting states in the update path, wherein the difference includes numerical values of multiple dimensions, and the numerical values of the multiple dimensions represent the number of sample teams with different numbers of members; and the target starting plan is obtained by combining multiple of the differences.
[0205] In some embodiments, the weight determination module 1332 is further used to perform the following processing on each team matching status: using the team matching status as a constraint condition, determining the contribution degrees corresponding to the sample teams with different numbers of members when the sample teams with different numbers of members are selected to form a game in the target opening plan, wherein the contribution degrees are used to characterize the number of times a sample team with a specified number of members can be selected in the target opening plan; and using the multiple contribution degrees corresponding to each team matching status as multiple weights to combine them into the weight distribution.
[0206] In some embodiments, the matching processing module 1333 is further used to traverse the queue to be matched and perform the following processing on the candidate team currently traversed: in response to the candidate team being a team that has started a game, continue to traverse the next candidate team in the queue to be matched; in response to the candidate team being a team that has not started a game, generate a game to be started based on the candidate team; detect the game to be started and obtain a detection result; in response to the detection result indicating that the game to be started does not meet the start condition, select a preset number of candidate teams after the team that has not started a game in the order of their time of joining the queue to be matched to add to the candidate team list; according to the weight distribution, select at least one candidate team in the candidate team list to add to the game to be started, and clear the candidate team list.
[0207] In some embodiments, the matching processing module 1333 is also used to respond to the existence of a candidate team after the unstarted team in the to-be-matched queue, and select one candidate team each time to be added to the candidate team list in the chronological order until the number of candidate teams in the candidate team list reaches a preset value.
[0208] In some embodiments, the matching processing module 1333 is further used to, in response to the absence of a candidate team after the unstarted team, clear the to-be-started game and continue to traverse the next candidate team in the to-be-matched queue; in response to the number of candidate teams in the candidate team list not reaching a preset value and the candidate team list is not empty, select at least one candidate team in the candidate team list according to the weight distribution to join the to-be-started game, clear the candidate team list, and proceed to the step of executing the detection of the to-be-started game to obtain the detection result.
[0209] In some embodiments, the weight distribution includes the weights corresponding to the sample teams with different numbers of members selected to form a game in each of the team matching states; the matching processing module 1333 is also used to obtain the weight corresponding to each candidate team in the candidate team list according to the weight distribution, and add the candidate team with the largest weight to the game to be started.
[0210] In some embodiments, the game opening module 1334 is further configured to, in response to the detection result indicating that the game to be opened meets the opening condition, mark the candidate team in the game to be opened as the team that has started, and send opening information to the game server and the client corresponding to the candidate team in the game to be opened, wherein the opening information is used to indicate the start of the game to be opened.
[0211] In some embodiments, the start module 1334 is further configured to delete the started team from the to-be-matched queue.
[0212] An embodiment of the present application provides a computer program product, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene game processing method described in the embodiment of the present application.
[0213] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the game processing method of the virtual scene provided by the embodiment of the present application, for example, Figure 3A A method for handling a game in a virtual scene is shown.
[0214] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0215] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0216] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0217] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.
[0218] To sum up, through the embodiments of the present application, without increasing the load on the matching server, sample game data is sampled from historical game data, and the weight distribution of selecting different types of teams (corresponding to different numbers of members) in each team matching state is calculated based on the sample game data. During matching, the candidate teams in the to-be-matched queue are added to the to-be-started game according to the weight distribution, thereby selecting a better candidate team globally, thereby achieving the beneficial effect of reducing the average matching time of the candidate teams and improving the throughput of the matching server.
[0219] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.
Claims
1. A method for processing a game in a virtual scene, characterized in that: The method comprises: Acquiring historical game data of a virtual scene, wherein the historical game data includes the number of historical teams with different numbers of members that formed a game within a historical time period; Sampling the historical game data to obtain sample game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed games during the historical time period, and the ratio of the number of teams between the historical teams with different numbers of members is the same as the ratio of the number of teams between the sample teams with different numbers of members; Determining, based on the sample game data, a weight distribution for selecting the sample teams with different numbers of members to form a game in different team matching states, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form a game; Obtaining a queue to be matched, wherein the queue to be matched includes a plurality of candidate teams to be formed into a game; Adding the candidate teams in the to-be-matched queue to the game to be started according to the weight distribution; Perform an opening operation on the game to be opened.
2. The method according to claim 1, characterized in that Determining, based on the sample game data, the weight distribution of selecting the sample teams with different numbers of members to form games in different team matching states includes: Obtaining a start condition preset for the virtual scene; Under the premise that the opening conditions are met, determining a plurality of opening plans that can be formed based on the sample teams with different numbers of members, wherein the opening plans are plans for forming the sample teams with different numbers of members into a game; Determining a target opening plan from the plurality of opening plans so that the plurality of sample teams can form a game without omission; The target opening plan is used to obtain weights of selecting sample teams with different numbers of members to form a game under the different team matching states, and the weights are combined into a weight distribution.
3. The method according to claim 2, characterized in that The determining of a plurality of opening schemes that can be formed based on the sample teams with different numbers of members includes: generating a scenario variable, wherein the scenario variable is used to represent the number of sample teams with different numbers of members constituting a game; Initializing the plan variables to obtain an initial opening plan; Adding the sample teams to the initial opening plan in sequence to obtain multiple updated candidate opening plans; A plurality of opening plans that meet the opening condition are searched from the plurality of candidate opening plans.
4. The method according to claim 3, characterized in that The opening conditions include at least a maximum number of sample teams and a maximum total number of members; the scenario variables include a plurality of sub-variables, each of the plurality of sub-variables corresponding to a different number of members, each sub-variable being used to represent the number of sample teams with a specific number of members constituting a game; The sample teams are sequentially added to the initial opening plan to obtain multiple updated candidate opening plans, including: Determining the maximum value of each of the sub-variables in the scenario variable according to the maximum number of sample teams and the maximum total number of members; The sample teams are sequentially added to the initial opening plan to obtain a plurality of candidate opening plans based on the initial opening plan, wherein each of the sub-variables in each of the candidate opening plans is less than or equal to the maximum value corresponding to the sub-variable.
5. The method according to claim 3, characterized in that The opening conditions include at least the minimum number of sample teams and the minimum total number of members; The step of searching for a plurality of opening plans that meet the opening condition from the plurality of candidate opening plans includes: A plurality of candidate opening plans are searched from the plurality of candidate opening plans, wherein the number of sample teams included is greater than or equal to the minimum number of sample teams, and the total number of members of the sample teams included is greater than or equal to the minimum total number of members, to serve as the plurality of opening plans.
6. The method according to claim 5, characterized in that Determining a target opening plan that enables the multiple sample teams to form a game without omission from the multiple opening plans includes: Initializing an opening state variable to obtain an initialized opening state, wherein the opening state is used to represent a state in which the plurality of sample teams form at least one game; Adding each of the opening schemes in sequence based on the initialized opening state to obtain multiple new opening states; Iteratively adding each of the opening plans based on each of the new opening states until the new opening state represents that each sample team in the sample game data has entered the game, thereby obtaining a final opening state; An update path in the iterative process is obtained, and the target opening plan is obtained through the update path, wherein the update path includes a plurality of opening states formed in the iterative process from the initial opening state to the opening state.
7. The method according to claim 6, characterized in that The obtaining the target opening plan through the update path includes: Obtaining a difference in the starting state variables between every two adjacent starting states in the update path, wherein the difference includes values in multiple dimensions, and the values in the multiple dimensions represent the number of the sample teams with different numbers of members; A plurality of the difference values are combined to obtain a target opening plan.
8. The method according to claim 6, characterized in that The step of obtaining weights of selecting sample teams with different numbers of members to form a game under the different team matching states through the target opening plan, and combining them into a weight distribution, includes: Perform the following processing for each team matching status: Determining, using the team matching status as a constraint, the contribution degrees corresponding to the sample teams with different numbers of members when the sample teams with different numbers of members are selected to form a game in the target opening scenario, wherein the contribution degrees represent the number of times a sample team with a specified number of members can be selected in the target opening scenario; The multiple contribution degrees corresponding to each team matching status are used as multiple weights to combine into the weight distribution.
9. The method according to claim 1, characterized in that Adding the candidate teams in the to-be-matched queue to a game to be started according to the weight distribution includes: Traverse the queue to be matched, and perform the following processing on the candidate team currently traversed: In response to the candidate team being a team that has already started a game, continue traversing the next candidate team in the to-be-matched queue; In response to the candidate team being a team that has not yet started a game, generating a game to be started based on the candidate team; Detecting the game to be started and obtaining a detection result; In response to the detection result indicating that the to-be-started game does not meet the start condition, selecting a preset number of candidate teams after the unstarted team in chronological order of their joining the to-be-matched queue to add to the candidate team list; According to the weight distribution, at least one candidate team in the candidate team list is selected to join the game to be started, and the candidate team list is cleared.
10. The method according to claim 9, characterized in that The step of selecting a preset number of candidate teams after the unstarted team in the order of their joining the queue to be matched to add them to the candidate team list includes: In response to the presence of a candidate team after the unstarted team in the to-be-matched queue, one candidate team is selected each time to be added to the candidate team list in the chronological order until the number of candidate teams in the candidate team list reaches a preset value.
11. The method according to claim 10, characterized in that When selecting a candidate team to be added to the candidate team list each time according to the chronological order, the method further includes: In response to there being no candidate team after the team that has not started, clearing the game to be started, and continuing to traverse the next candidate team in the queue to be matched; In response to the number of candidate teams in the candidate team list not reaching a preset value and the candidate team list is not empty, at least one candidate team in the candidate team list is selected according to the weight distribution to join the game to be started, the candidate team list is cleared, and the process proceeds to the step of executing the detection of the game to be started to obtain a detection result.
12. The method according to claim 9, characterized in that The weight distribution includes the weights corresponding to selecting sample teams with different numbers of members to form a game in each of the team matching states; The selecting, according to the weight distribution, at least one candidate team in the candidate team list to join the game to be started, and clearing the candidate team list includes: The weight corresponding to each candidate team in the candidate team list is obtained according to the weight distribution, and the candidate team with the largest weight is added to the game to be started.
13. The method according to claim 9, characterized in that The performing the opening operation on the game to be opened includes: In response to the detection result indicating that the game to be started meets the start condition, the candidate team in the game to be started is marked as the started team, and start information is sent to the game server and the client corresponding to the candidate team in the game to be started, wherein the start information is used to indicate the start of the game to be started.
14. The method according to claim 9, characterized in that After traversing the queue to be matched, the method further includes: Delete the started team from the queue to be matched.
15. The method according to any one of claims 1 to 14, characterized in that The queue to be matched is obtained within a current time period, and the current time period and the historical time period correspond to different dates and have the same start time and end time.
16. A virtual scene game processing device, characterized in that: The device comprises: A data acquisition module, configured to acquire historical game data of a virtual scene, wherein the historical game data includes the number of historical teams with different numbers of members that formed a game within a historical time period; The data acquisition module is further configured to sample the historical game data to obtain sample game data, wherein the sample game data includes the number of sample teams with different numbers of members that formed games during the historical time period, and the ratio of the number of teams between the historical teams with different numbers of members is the same as the ratio of the number of teams between the sample teams with different numbers of members; a weight determination module, configured to determine, based on the sample game data, a weight distribution for selecting sample teams with different numbers of members to form a game in different team matching states, wherein the team matching state represents the total number of teams and the total number of members of the sample teams used to form a game; A matching processing module is used to obtain a queue to be matched, wherein the queue to be matched includes a plurality of candidate teams to be formed into a game; The matching processing module is further configured to add the candidate teams in the to-be-matched queue to the to-be-started game according to the weight distribution; The opening module is used to perform opening operations on the game to be opened.
17. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions; The processor is configured to implement the game processing method for a virtual scene according to any one of claims 1 to 15 when executing the computer-executable instructions stored in the memory.
18. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer-executable instructions or computer program are executed by a processor, the game processing method for a virtual scene as described in any one of claims 1 to 15 is implemented.
19. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the game processing method for a virtual scene as described in any one of claims 1 to 15 is implemented.