CN111318025B - Game object matching method and device, electronic equipment and computer readable medium - Google Patents

Game object matching method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN111318025B
CN111318025B CN202010082629.0A CN202010082629A CN111318025B CN 111318025 B CN111318025 B CN 111318025B CN 202010082629 A CN202010082629 A CN 202010082629A CN 111318025 B CN111318025 B CN 111318025B
Authority
CN
China
Prior art keywords
game object
ranking score
opponent
competition
loss function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010082629.0A
Other languages
Chinese (zh)
Other versions
CN111318025A (en
Inventor
吴友友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010082629.0A priority Critical patent/CN111318025B/en
Publication of CN111318025A publication Critical patent/CN111318025A/en
Application granted granted Critical
Publication of CN111318025B publication Critical patent/CN111318025B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/79Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories
    • A63F13/795Game security or game management aspects involving player-related data, e.g. identities, accounts, preferences or play histories for finding other players; for building a team; for providing a buddy list

Abstract

The disclosure relates to a game object matching method and device, electronic equipment and a computer readable medium, and belongs to the technical field of games. The method comprises the following steps: extracting characteristic data of the game object from the log data, wherein the characteristic data comprises ranking scores, a competition time parameter, opponent ranking scores and a competition win-lose parameter; obtaining a model parameter according to the ranking score, the competition time parameter and the opponent ranking score, and determining a loss function according to the model parameter; performing iterative training on the loss function by taking the real win rate as training data to update the ranking fraction of the game object; and when the loss function is less than or equal to the loss threshold or the iteration times are greater than or equal to the iteration threshold, determining the updated ranking score so as to match the game object according to the ranking score. According to the method and the device, the loss function is defined by using more comprehensive game object characteristic parameters, and iterative training is performed on the loss function by using a machine learning algorithm, so that the prediction accuracy of player win and loss can be effectively improved.

Description

Game object matching method and device, electronic equipment and computer readable medium
Technical Field
The present disclosure relates to the field of game technologies, and in particular, to a method and an apparatus for matching a game object, an electronic device, and a computer-readable medium.
Background
In a multi-player online tactical competitive game, the strength of players of two parties needs to be balanced through a matching system, so that the levels of the two parties are as close as possible, the occurrence of rolling games is avoided to a greater extent, and the experience of the players is optimized.
Most matching systems calculate the points of the players through an ELO (Ehrot point) algorithm at present, but the strategy for calculating the points of the players in the ELO algorithm is relatively simple, the points of the players are updated only according to wins and losses of the games, and the accuracy rate for predicting the wins and losses of the players through the size of the ELO points is relatively low.
Therefore, there is a need for a method that can calculate matching credits and match players based on the credits, and that can improve the accuracy of predicting player wins and losses, thereby better improving the combat quality of the matching system.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a method for matching game objects, a device for matching game objects, an electronic device, and a computer-readable medium, so as to improve the accuracy of the game object match prediction and improve the fighting quality of a matching system.
According to a first aspect of the present disclosure, there is provided a matching method of game objects, including:
obtaining log data from a game log, and extracting feature data of the game object from the log data; wherein the feature data includes a ranking score, a tournament time parameter, an opponent ranking score, and a tournament win or loss parameter of the gaming object;
obtaining model parameters according to the ranking scores of the game objects, the competition time parameters and the opponent ranking scores, and determining a loss function according to the model parameters;
obtaining the real win rate of the game object according to the competition win and lose parameters of the game object, and performing iterative training on the loss function by taking the real win rate of the game object as training data to update the ranking score of the game object;
and when the loss function is smaller than or equal to a loss threshold value or the iteration times are larger than or equal to an iteration threshold value, determining the ranking score of the updated game object so as to match the game object according to the ranking score.
In an exemplary embodiment of the present disclosure, the obtaining of the model parameters according to the ranking score of the game object, the competition time parameter, and the opponent ranking score includes:
obtaining the match weight according to the match time parameter and a preset adjusting parameter;
obtaining an average score of an opponent according to the match weight and the ranking score of the game object;
and obtaining a predicted winning rate according to the ranking score of the game object and the opponent ranking score.
In an exemplary embodiment of the disclosure, the competition time parameters include a maximum competition time, a minimum competition time and a competition time length of the game object and an opponent, and the obtaining of the competition weight according to the competition time parameters and preset adjustment parameters includes:
obtaining a weight parameter according to the maximum competition time, the minimum competition time and the competition duration of the game object and the opponent;
and obtaining the match weight according to the weight parameter and a preset adjusting parameter.
In an exemplary embodiment of the present disclosure, the obtaining an opponent's average according to the tournament weight and the ranking score of the game object includes:
obtaining the match weight of which the match duration is greater than or equal to a duration threshold value in all matches of the game object and the corresponding opponent ranking score;
summing the competition weights of which the competition duration is greater than or equal to the duration threshold value to obtain a competition weight sum;
obtaining the opponent weights according to the competition weights with the competition duration being greater than or equal to the duration threshold and the corresponding opponent ranking scores, and summing the opponent weights to obtain an opponent weight sum;
and obtaining the opponent average score of the game object according to the opponent weight sum and the match weight sum.
In an exemplary embodiment of the present disclosure, the deriving the predicted win rate according to the ranking score of the game object and the opponent ranking score includes:
obtaining a winning rate parameter according to the difference value of the counterparty ranking score and the ranking score of the game object;
and obtaining the predicted winning rate of the game object according to the winning rate parameters.
In an exemplary embodiment of the present disclosure, the determining a loss function from the model parameters includes:
obtaining a residual error of the loss function according to the difference value between the predicted winning rate and the real winning rate, and obtaining a function main body of the loss function according to the residual error and the competition weight;
obtaining a regular term parameter according to the ranking score of the game object and the adversary, and obtaining a regular term of the loss function according to the regular term parameter and a preset regular term weight;
and taking the sum of the function body of the loss function and the regular term as the loss function.
In an exemplary embodiment of the disclosure, the iteratively training the loss function using the true win rate of the game object as training data to update the ranking score of the game object includes:
inputting the actual win rate of the game object as training data into the loss function;
decreasing the value of the loss function in the direction of gradient decrease, and updating the ranking score of the game object;
and recalculating the value of the loss function according to the updated ranking score of the game object, and updating the ranking score of the game object again according to the recalculated loss function.
According to a second aspect of the present disclosure, there is provided a game object matching apparatus comprising:
the characteristic data extraction module is used for acquiring log data from a game log and extracting the characteristic data of the game object from the log data; wherein the characteristic data includes a ranking score, a tournament time parameter, an opponent ranking score, and a tournament win or lose parameter of the game object;
the loss function determining module is used for obtaining model parameters according to the ranking scores of the game objects, the competition time parameters and the opponent ranking scores and determining a loss function according to the model parameters;
the ranking score updating module is used for obtaining the real winning rate of the game object according to the match winning and losing parameters of the game object, and performing iterative training on the loss function by taking the real winning rate of the game object as training data so as to update the ranking score of the game object;
and the game object matching module is used for determining the ranking score of the updated game object when the loss function is less than or equal to a loss threshold or the iteration number is greater than or equal to an iteration threshold so as to match the game object according to the ranking score.
According to a third aspect of the present disclosure, there is provided an electronic apparatus comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of matching a game object of any of the above via execution of the executable instructions.
According to a fourth aspect of the present disclosure, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements the matching method of a game object of any one of the above.
The exemplary embodiments of the present disclosure may have the following advantageous effects:
according to the matching method of the game objects, the characteristic data of each game object is obtained from the game log, the characteristic data is used for obtaining a plurality of model parameters, the loss function is defined through the model parameters, iterative training is conducted on the loss function through a machine learning algorithm, the ranking score of the game object is updated, and therefore the game objects are matched according to the ranking score. Through the matching method of the game objects in the exemplary embodiment of the disclosure, the ability level of the player in fight can be evaluated by using various useful characteristics, and the accuracy rate of the matching system in predicting the win or loss of the player in the game matching process can be effectively improved, so that the fighting quality of the player in the matching system is better improved, and the fighting experience of the player is further optimized.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It should be apparent that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived by those of ordinary skill in the art without inventive effort.
FIG. 1 shows a flow diagram of a method of matching game objects of an example embodiment of the present disclosure;
FIG. 2 illustrates a flow diagram for determining model parameters in an exemplary embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram for determining a match weight in an example embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram for determining an adversary split in an example embodiment of the present disclosure;
FIG. 5 illustrates a flow chart diagram for determining a predicted win ratio in accordance with an exemplary embodiment of the present disclosure;
FIG. 6 illustrates a flow diagram for determining a loss function in accordance with an exemplary embodiment of the present disclosure;
FIG. 7 illustrates a flow diagram for updating ranking scores of game objects according to an example embodiment of the present disclosure;
FIG. 8 shows a block diagram of a matching device for game objects of an example embodiment of the present disclosure;
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device implementing an embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the embodiments of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In some embodiments, the player scores may be calculated by machine learning, for example, using some current relatively sophisticated training models, such as regression models, to extract and process data according to the input requirements of linear regression, and then adding the extracted data to the model for training, and using the trained classifier to predict the classification effect on the test set. In addition, a tree model can be used to randomly select small data sets, each small data set is trained into one decision tree, each division of each decision tree tries various possibilities of all features, a mode with the highest purity after division is found as a basis for division, and a final result is determined according to votes of all decision trees during prediction. In the training of the model, data such as ELO integral, highest and lowest scores of each team, average grade, number of discretized teams, and difference between the number of teams may be normalized and trained as features.
However, in the above embodiment, the tree model may be overfitted in the whole training process, that is, a very high degree of fitting occurs on the training set, but the generalization capability is weak on the experimental data set, that is, the accuracy is low, only about 0.527 when predicting a new test data set. On the basis, after optimization of some adjusting methods such as parameter adjustment, feature extraction combination and the like is carried out, the accuracy on the test data set is improved to about 0.54 through tests. But this accuracy still does not reach the expected value.
In order to solve the problem of low prediction accuracy in the above embodiments, the present exemplary embodiment first provides a method of matching game objects. Referring to fig. 1, the method for matching game objects may include the steps of:
s110, acquiring log data from a game log, and extracting characteristic data of a game object from the log data; wherein the characteristic data includes a ranking score of the game object, a play time parameter, an opponent ranking score, and a win or lose parameter.
The game log refers to some log data which needs to be recorded in the process of game operation so as to know the running condition of the game and find and process the emergency condition in the game according to the log. The characteristic data of the game object comprises the ranking score, the competition time parameter, the opponent ranking score and the competition win-win parameter of the game object, is used for calculating model parameters and obtaining some basic characteristic data of training data, and can be extracted and sorted from log data.
In the present exemplary embodiment, a game start log (about 500 pieces of data) and an end log (about 500 pieces of data) in a period of time are used, and in the log data of these game logs, information of each race includes: the starting time and the ending time of the game, the information ID of the match, the type of the game, the waiting time, the player IDs of both the players, the score of the game, the situation of the team and the grade of the player.
Extracting the characteristic data of the game object from the log data, firstly extracting the fighting information ID, analyzing the information of each index, combining the log data of the game starting log and the game ending log according to the fighting information ID, extracting useful data, integrating according to different requirements, filtering the invalid data in the data, such as irrelevant information, such as a nickname of a player, a list of heros and the like, counting the quantity and process information of the categories of each game, forming a new statistical table by combining the useful information with the player ID, and adjusting the statistical table into a proper training format to be used as a data set required in training.
And S120, obtaining model parameters according to the ranking scores of the game objects, the match time parameters and the opponent ranking scores, and determining a loss function according to the model parameters.
In this exemplary embodiment, the model parameters are calculated from the respective feature data, and are used to define a plurality of parameters of the loss function, and the loss function may be used in training iteration to calculate the ranking score of the game object, so as to achieve the purpose of matching the game object.
And S130, obtaining the real winning rate of the game object according to the match winning and losing parameters of the game object, and performing iterative training on the loss function by taking the real winning rate of the game object as training data to update the ranking score of the game object.
And calculating the real win rate of the game object according to the game win and lose parameters of the game object in the characteristic data, processing the player ID and the real win rate of the game object in each game into a proper training set and a proper testing set, and inputting the training set and the testing set into a model for calculation.
The objective of the algorithm in this exemplary embodiment is to continuously update the ranking score of the game object through training so as to continuously approach the true value of the game, that is, to continuously decrease the value of the loss function, which can be realized by the gradient descent method. Ideally, a minimum value of the loss function is found to determine the ranking score of the game object at that time.
And S140, when the loss function is smaller than or equal to the loss threshold or the iteration times are larger than or equal to the iteration threshold, determining the ranking score of the updated game object so as to match the game object according to the ranking score.
There are two methods for iterating the loss function to find the minimum value, one method is to set a loss threshold, for example, the loss threshold may be set to 0.01, when the loss function is smaller than the loss threshold, the iteration is stopped, and the ranking score of the game object is calculated according to the value of the loss function at this time, so as to match the game object according to the ranking score; another method is to set an iteration threshold, for example, the iteration threshold may be set to 50, the iteration is stopped when the number of iterations is greater than or equal to the iteration threshold, and the ranking score of the game object is calculated based on the value of the loss function at that time, so that the game object is matched based on the ranking score.
The ranking score, the match time parameter and the opponent ranking score of a game object are used as characteristic data for training, and compared with other existing machine learning libraries, the training method is different in that the existing machine learning libraries generally have a fixed function form, parameters in the existing machine learning libraries are continuously trained, and the parameters trained according to different data sets are different; however, in the learning library in the present exemplary embodiment, the type of the function is specified in advance, and the feature value therein is continuously trained by using the idea of machine learning.
Through experiments, the prediction accuracy of the present exemplary embodiment on the current data set is 0.637, which is much improved compared with the prediction accuracy of 0.49 of the ELO algorithm in the general case, and is also much improved compared with the prediction accuracy of 0.527 of the regression model and the prediction accuracy of 0.54 of the tree model. In addition, in terms of computational efficiency, implementation of all algorithms of the present example embodiment, including gradient descent, algorithm iteration, and the like, can be implemented by c + +, without a redundant process, and in some existing open source Python learning libraries, the same data iteration needs 1 or more hours for 10 times, while c + + version code iteration of the algorithm of the present example embodiment needs only about 9 minutes for 50 times, which means that the method in the present example embodiment also greatly improves computational efficiency.
The above steps of the present exemplary embodiment will be described in more detail with reference to fig. 2 to 7.
In step S120, the model parameters include the match weight, the average score of the opponent and the predicted winning rate, and as shown in fig. 2, the model parameters are obtained according to the ranking score of the game object, the match time parameter and the ranking score of the opponent, and the method specifically includes the following steps:
and S210, obtaining the match weight according to the match time parameter and a preset adjusting parameter.
And S220, obtaining the average score of the opponents according to the match weight and the ranking score of the game object.
And step S230, obtaining a predicted winning rate according to the ranking score of the game object and the ranking score of the opponent.
The calculation methods of these model parameters will be described in detail below with reference to fig. 3 to 5.
In step S210, the competition time parameters include a maximum competition time, a minimum competition time, and a competition duration between the game object and the opponent, and as shown in fig. 3, the obtaining of the competition weight according to the competition time parameter and the preset adjustment parameter may specifically include the following steps:
and S310, obtaining a weight parameter according to the maximum competition time, the minimum competition time and the competition duration of the game object and the opponent.
The match weight represents the weight of the importance degree of each match, the match time is taken as an important reference basis, and the weight parameter is a parameter required to be calculated in the process of calculating the match weight. Considering that the level of a player may change with time, especially in a tournament of this type, the more recent time may represent the latest true level of the player, and thus the weighting parameter α i,j The calculation method of (2) is as follows:
Figure BDA0002380859380000091
wherein, t i,j Indicates the length of time of a match, t, for player i versus player j max The maximum race time recorded in the data set (i.e., the time of the most recent race, such as the time when the player played the last race at 2018.01.0112, which is the maximum race time), t min Indicating the minimum recorded game time in the data set (i.e., the time of the earliest game).
And S320, obtaining the match weight according to the weight parameter and the preset adjusting parameter.
After the weight parameters are obtained, the competition weight is calculated according to the weight parameters and the preset adjusting parameters, and the calculating method comprises the following steps:
Figure BDA0002380859380000092
and after multiple times of debugging, the training result is the best when theta is 2.7 in the current data set.
In step S220, as shown in fig. 4, obtaining the average score of the opponent according to the match weight and the ranking score of the game object may specifically include the following steps:
and S410, obtaining the match weight of all matches of the game object, wherein the match duration is greater than or equal to the duration threshold value, and the corresponding opponent ranking score.
In the exemplary embodiment, the calculation of the opponent average time may only consider the competition weight in the competition in which the competition duration is greater than or equal to the duration threshold, and the corresponding opponent ranking score, the duration threshold may be set to twenty minutes, or twenty-five minutes, etc., when the competition duration is longer, the level of the opponent player and the level of the current player are considered to be comparable, and the interference of the crush competition is eliminated. Where ranking score can be understood as the ability value of the player, the higher the ranking score the stronger the ability value.
And S420, summing the game weights of which the game duration is greater than or equal to the duration threshold value to obtain a game weight sum.
Summing the match weights with the match duration being greater than or equal to the duration threshold to obtain a match weight sum v i The calculation formula of (c) is as follows:
Figure BDA0002380859380000101
where Ni represents all opponent sets for which the duration of the match currently encountered by player i is greater than or equal to the duration threshold.
And S430, obtaining the opponent weights according to the match weights with the match duration being greater than or equal to the duration threshold and the corresponding opponent ranking scores, and summing the opponent weights to obtain an opponent weight sum.
Obtaining the opponent weight according to the competition weight with the competition duration larger than or equal to the duration threshold and the corresponding opponent ranking score, summing the opponent weights to obtain an opponent weight sum, and obtaining an opponent weight sum u i The calculation formula of (a) is as follows:
Figure BDA0002380859380000102
and S440, obtaining the opponent average score of the game object according to the opponent weight sum and the match weight sum.
Will sum up the opponent weights u i Sum of competing weights v i The ratio of (a) is used as the average of the opponents of the game object, and the calculation formula is as follows:
Figure BDA0002380859380000103
in step S230, as shown in fig. 5, obtaining the predicted winning rate according to the ranking score of the game object and the ranking score of the opponent may specifically include the following steps:
and step S510, obtaining a winning rate parameter according to the difference value of the ranking scores of the opponent and the ranking scores of the game objects.
By r i Representing ranking scores, i.e. rank scores, r, of game objects j Representing the opponent ranking score, i.e., the rank score of the opponent. r is j And r i The difference is the winning rate parameter of the game object and the opponent.
And S520, obtaining the predicted winning rate of the game object according to the winning rate parameters.
The predicted winning rate calculation formula of the game object is as follows:
Figure BDA0002380859380000104
in the present exemplary embodiment, the predicted odds expectation relative to the conventional ELO algorithm model
Figure BDA0002380859380000105
The form of the method is simplified and has stronger adaptability.
After determining the model parameters according to the above steps, the kernel of the algorithm is proposed next, i.e. a loss function is defined according to the model parameters.
In step S120, as shown in fig. 6, determining the loss function according to the model parameter may specifically include the following steps:
and S610, obtaining a residual error of the loss function according to the difference value of the predicted winning rate and the real winning rate, and obtaining a function main body of the loss function according to the residual error and the match weight.
Obtaining a residual error of the loss function according to the difference value between the predicted winning rate and the real winning rate, and obtaining a function body of the loss function according to the residual error and the competition weight, wherein the calculation formula of the function body of the loss function is as follows:
Figure BDA0002380859380000111
/>
wherein T represents the set of all the battles,
Figure BDA0002380859380000112
representing the predicted winning rate, σ, of the game object ij The actual winning rate of the game object can be calculated according to the competition winning and losing parameters of the game object.
And S620, obtaining a regular term parameter according to the ranking score and the adversary average of the game object, and obtaining a regular term of the loss function according to the regular term parameter and a preset regular term weight.
And taking the opponents of each game object as the regular item indexes, wherein the opponents equally consider the game with the game duration being greater than or equal to the duration threshold, and when the game duration is longer, the opponents are more inclined to consider that the level of the opponent player and the level of the current player have certain comparability, so that the interference of the rolling game is eliminated. The regular term can continuously approximate the level of an opponent while updating the match result feedback, so that the phenomenon of overfitting is avoided. The regularization term calculation formula of the loss function is as follows:
Figure BDA0002380859380000113
where D represents the set of all players and λ is a parameter representing the weight occupied by the regularization term in the penalty function.
And S630, taking the sum of the function body of the loss function and the regular term as the loss function.
The loss function is the sum of a function body of the loss function and a regular term, and the calculation formula is as follows:
Figure BDA0002380859380000114
after the loss function is obtained, the ranking score of the game object can be calculated through iterative training, and therefore the game object is matched according to the ranking score.
In step S130, as shown in fig. 7, the step of iteratively training the loss function by using the true win rate of the game object as the training data to update the ranking score of the game object may specifically include the following steps:
step S710, the real winning rate of the game object is used as a training data input loss function.
And S720, reducing the value of the loss function according to the descending direction of the gradient, and updating the ranking score of the game object.
Step S730, recalculating the value of the loss function according to the updated ranking score of the game object, and updating the ranking score of the game object again according to the recalculated loss function.
In the above steps, firstly, the real win rate of the game object is calculated according to the game win and lose parameters of the game object in the characteristic data, and the real win rate corresponding to the game object is used as the training data input loss function to carry out iterative training.
The purpose of the algorithm in this exemplary embodiment is to continually update the ranking score r of the game object through training 0 ,r 1 ,…r n Therefore, the actual value of the game is continuously approached, and the regular term is added into the loss function, namely, the regular term is continuously approached to the opponent average value with reference value while the actual value of the game is approached, namely, the value of the loss function is required to be continuously reduced, and the ideal situation is to find the minimum value of the loss function. However, since the loss function is a non-linear and non-convex function, it is not guaranteed to find the global minimum of the function, in which case it can be calculated by training the minimum several times.
As to how to reduce the value of the loss function, the gradient descent method is adopted in this exemplary embodiment, since the lowest point and the highest point of the function are not known in the descending process, when each step descends, the direction in which the gradient is the largest at the current point is selected to descend, and corresponding to the mathematical method, a partial derivative is solved for each feature, and each player is taken as a feature, and is mathematically a dimension, so that the dimension of the function increases with the increase of the number of players, and the updating method is to simplify after solving the partial derivative, and the updating for each iteration is as follows:
Figure BDA0002380859380000121
the process of gradient descent can be summarized as follows:
a. setting an initial value, which is an all-zero vector in this model;
b. continuously updating the ranking fraction to reduce the loss function according to the gradient descending direction;
c. when the loss function is decreased until the loss function cannot be decreased (ideally), the algorithm is ended, and the ranking score value is the ranking score of the game object.
Wherein η is the learning rate. In the present exemplary embodiment, the accuracy of the player win or loss prediction can be further improved by optimizing the learning rate.
The method for optimizing the learning rate changes the fixed learning rate into a numerical value which is reduced along with the increase of the iteration times, avoids the situation that the learning rate cannot approach to the better advantage due to oscillation back and forth at a low point when the iteration times are less, greatly reduces the iteration times, is easier to converge and is important optimization in terms of time performance. The calculation formula is as follows:
Figure BDA0002380859380000131
wherein p is the iteration frequency, and the denominator is multiplied by 10, so that the problem that the better local optimal solution is crossed when the iteration just starts is avoided.
After each prediction, the training model can be updated once according to the feedback of the game result, the information of the game is recorded, and after a certain number (for example, ten thousand) is accumulated, the model is updated and trained, and iteration is added, so that the whole system model has the effect of online updating.
It can be found through experiments that in the model in the present exemplary embodiment, the prediction accuracy of the model rises to 0.601 in the data set of the experiment, where the training set is data in 400 ten thousand game sessions and the test set is data in 20 ten thousand game sessions.
After the learning rate optimization, the prediction accuracy of the model reaches 0.637 in 400 ten thousand training sets and 20 ten thousand test sets, so that the prediction accuracy is further improved.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken into multiple step executions, etc.
Furthermore, the disclosure also provides a matching device of the game object. Referring to fig. 8, the matching means of the game object may include a feature data extraction module 810, a loss function determination module 820, a ranking score update module 830, and a game object matching module 840. Wherein:
the feature data extraction module 810 may be configured to obtain log data from the game log, and extract feature data of the game object from the log data; wherein the characteristic data comprises ranking scores of the game objects, a competition time parameter, opponent ranking scores and a competition win-lose parameter;
the loss function determining module 820 may be configured to obtain a model parameter according to the ranking score of the game object, the competition time parameter, and the opponent ranking score, and determine a loss function according to the model parameter;
the ranking score updating module 830 may be configured to obtain a real win ratio of the game object according to the match win/lose parameter of the game object, and perform iterative training on the loss function using the real win ratio of the game object as training data to update the ranking score of the game object;
the game object matching module 840 may be configured to determine a ranking score of the updated game object when the loss function is less than or equal to the loss threshold or the number of iterations is greater than or equal to the iteration threshold, so as to match the game object according to the ranking score.
In some exemplary embodiments of the present disclosure, the loss function determination module 820 may include a competition weight determination unit, an opponent average determination unit, and a predicted win ratio determination unit. Wherein:
the competition weight determining unit can be used for obtaining competition weights according to the competition time parameters and preset adjusting parameters;
the opponent average determining unit can be used for obtaining the opponent average according to the match weight and the ranking score of the game object;
the predicted win rate determination unit may be configured to derive a predicted win rate based on the ranking score of the game object and the opponent ranking score.
In some exemplary embodiments of the present disclosure, the game weight determining unit may include a weight parameter determining unit and a game weight calculating unit. Wherein:
the weight parameter determination unit may be configured to obtain a weight parameter according to the maximum competition time, the minimum competition time, and a competition duration of the game object and the opponent;
the competition weight calculation unit can be used for obtaining the competition weight according to the weight parameter and the preset adjustment parameter.
In some exemplary embodiments of the present disclosure, the opponent average determination unit may include a tournament weight acquisition unit, a tournament weight summing unit, an opponent weight summing unit, and an opponent average calculation unit. Wherein:
the competition weight acquiring unit may be configured to acquire a competition weight in which a competition duration in all competitions of the game object is greater than or equal to a duration threshold value, and a corresponding opponent ranking score;
the competition weight summing unit can be used for summing the competition weights of which the competition duration is greater than or equal to the duration threshold value to obtain a competition weight sum;
the opponent weight summing unit can be used for obtaining the opponent weight according to the competition weight with the competition duration larger than or equal to the duration threshold and the corresponding opponent ranking score, and summing the opponent weights to obtain an opponent weight sum;
the opponent equally dividing computing unit may be configured to derive an opponent equally dividing of the game object based on the opponent weight sum and the tournament weight sum.
In some exemplary embodiments of the present disclosure, the predicted win rate determination unit may include a win rate parameter determination unit and a predicted win rate calculation unit. Wherein:
the winning rate parameter determining unit may be configured to obtain a winning rate parameter according to a difference between the opponent ranking score and the ranking score of the game object;
the predicted winning rate calculation unit can be used for obtaining the predicted winning rate of the game object according to the winning rate parameters.
In some exemplary embodiments of the present disclosure, the loss function determination module 820 may further include a function body determination unit, a regularization term determination unit, and a loss function calculation unit. Wherein:
the function body determining unit can be used for obtaining a residual error of the loss function according to the difference value between the predicted winning rate and the real winning rate, and obtaining a function body of the loss function according to the residual error and the competition weight;
the regular term determining unit can be used for obtaining a regular term parameter according to the ranking score and the adversary average of the game object and obtaining a regular term of the loss function according to the regular term parameter and a preset regular term weight;
the loss function calculation unit may be configured to use a sum of a function body of the loss function and the regularization term as the loss function.
In some exemplary embodiments of the present disclosure, the ranking score updating module 830 may include a training data input unit, a loss function reduction unit, and a ranking score updating unit. Wherein:
the training data input unit may be configured to input a true win rate of the game object as a training data input loss function;
the loss function decreasing unit may be configured to decrease the value of the loss function in the gradient decreasing direction and update the ranking score of the game object;
the ranking score updating unit may be configured to recalculate a value of the loss function according to the updated ranking score of the game object, and update the ranking score of the game object again according to the recalculated loss function.
The details of each module/unit in the above-mentioned game object matching device have already been described in detail in the corresponding method embodiment section, and are not described herein again.
FIG. 9 illustrates a schematic structural diagram of a computer system suitable for use with the electronic device to implement an embodiment of the invention.
It should be noted that the computer system 900 of the electronic device shown in fig. 9 is only an example, and should not bring any limitation to the function and the application scope of the embodiment of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU) 901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for system operation are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to an embodiment of the present invention, the processes described below with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 909 and/or installed from the removable medium 911. The computer program executes various functions defined in the system of the present application when executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the method as described in the embodiments below.
It should be noted that although in the above detailed description several modules of the device for action execution are mentioned, this division is not mandatory. Indeed, the features and functions of two or more of the modules described above may be embodied in one module, according to embodiments of the present disclosure. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice in the art to which the disclosure pertains.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. A method of matching game objects, comprising:
obtaining log data from a game log, and extracting feature data of the game object from the log data; wherein the feature data includes a ranking score, a tournament time parameter, an opponent ranking score, and a tournament win or loss parameter of the gaming object;
obtaining model parameters according to the ranking scores of the game objects, the competition time parameters and the opponent ranking scores, and determining a loss function according to the model parameters;
obtaining the real winning rate of the game object according to the competition win-win parameters of the game object, and performing iterative training on the loss function by taking the real winning rate of the game object as training data to update the ranking score of the game object;
when the loss function is smaller than or equal to a loss threshold value or the iteration times are larger than or equal to an iteration threshold value, determining the ranking score of the updated game object so as to match the game object according to the ranking score;
the model parameters comprise competition weight, the competition time parameters comprise maximum competition time, minimum competition time and competition duration of the game object and an opponent, the competition weight is determined according to the competition time parameters and preset adjusting parameters, and the competition weight determining method comprises the following steps:
obtaining a weight parameter according to the maximum competition time, the minimum competition time and the competition duration of the game object and the opponent;
and obtaining the match weight according to the weight parameter and the preset adjusting parameter.
2. The method for matching game objects according to claim 1, wherein the model parameters further include an opponent average and a predicted winning rate, and the obtaining of the model parameters based on the ranking score, the match time parameter and the opponent ranking score of the game object includes:
obtaining an average score of an opponent according to the match weight and the ranking score of the game object;
and obtaining a predicted winning rate according to the ranking score of the game object and the opponent ranking score.
3. The method for matching game objects according to claim 2, wherein said obtaining an opponent average based on said match weight and said ranking score of said game object comprises:
obtaining match weights of all matches of the game objects, wherein the match duration is greater than or equal to a duration threshold value, and corresponding opponent ranking scores;
summing the competition weights of which the competition duration is greater than or equal to the duration threshold value to obtain a competition weight sum;
obtaining the opponent weights according to the match weights with the match duration being greater than or equal to the duration threshold and the corresponding opponent ranking scores, and summing the opponent weights to obtain an opponent weight sum;
and obtaining the opponent average score of the game object according to the opponent weight sum and the match weight sum.
4. The method for matching game objects according to claim 2, wherein said obtaining a predicted winning rate from said ranking score of said game object and said opponent ranking score comprises:
obtaining a winning rate parameter according to the difference value of the counterparty ranking score and the ranking score of the game object;
and obtaining the predicted winning rate of the game object according to the winning rate parameters.
5. A method of matching a game object according to claim 2, wherein said determining a loss function from said model parameters comprises:
obtaining a residual error of the loss function according to the difference value between the predicted winning rate and the real winning rate, and obtaining a function main body of the loss function according to the residual error and the competition weight;
obtaining a regular term parameter according to the ranking score of the game object and the adversary, and obtaining a regular term of the loss function according to the regular term parameter and a preset regular term weight;
and taking the sum of the function body of the loss function and the regular term as the loss function.
6. The method for matching a game object according to claim 3, wherein the iteratively training the loss function using the true win ratio of the game object as training data to update the ranking score of the game object comprises:
inputting the actual win rate of the game object as training data into the loss function;
decreasing the value of the loss function in the direction of gradient decrease, and updating the ranking score of the game object;
and recalculating the value of the loss function according to the updated ranking score of the game object, and updating the ranking score of the game object again according to the recalculated loss function.
7. An apparatus for matching a game object, comprising:
the characteristic data extraction module is used for acquiring log data from a game log and extracting the characteristic data of the game object from the log data; wherein the characteristic data includes a ranking score, a tournament time parameter, an opponent ranking score, and a tournament win or lose parameter of the game object;
the loss function determining module is used for obtaining model parameters according to the ranking scores of the game objects, the competition time parameters and the opponent ranking scores and determining a loss function according to the model parameters;
a ranking score updating module, configured to obtain a real win rate of the game object according to the match win/lose parameter of the game object, and perform iterative training on the loss function by using the real win rate of the game object as training data to update the ranking score of the game object;
the game object matching module is used for determining the ranking score of the updated game object when the loss function is smaller than or equal to a loss threshold or the iteration number is larger than or equal to an iteration threshold so as to match the game object according to the ranking score;
the model parameters comprise competition weight, the competition time parameters comprise maximum competition time, minimum competition time and competition duration of the game object and an opponent, the competition weight is determined according to the competition time parameters and preset adjusting parameters, and the competition weight determining method comprises the following steps:
obtaining a weight parameter according to the maximum competition time, the minimum competition time and the competition duration of the game object and the opponent;
and obtaining the match weight according to the weight parameter and the preset adjusting parameter.
8. An electronic device, comprising:
a processor; and
a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the matching method for game objects according to any one of claims 1 to 6.
9. A computer-readable medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the matching method of a game object according to any one of claims 1 to 6.
CN202010082629.0A 2020-02-07 2020-02-07 Game object matching method and device, electronic equipment and computer readable medium Active CN111318025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010082629.0A CN111318025B (en) 2020-02-07 2020-02-07 Game object matching method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010082629.0A CN111318025B (en) 2020-02-07 2020-02-07 Game object matching method and device, electronic equipment and computer readable medium

Publications (2)

Publication Number Publication Date
CN111318025A CN111318025A (en) 2020-06-23
CN111318025B true CN111318025B (en) 2023-04-14

Family

ID=71168901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010082629.0A Active CN111318025B (en) 2020-02-07 2020-02-07 Game object matching method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN111318025B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111882072B (en) * 2020-07-09 2023-11-14 北京华如科技股份有限公司 Intelligent model automatic course training method for playing chess with rules
CN111760282B (en) * 2020-08-06 2023-08-15 腾讯科技(深圳)有限公司 Interface display method, device, terminal and storage medium
CN112245936B (en) * 2020-10-30 2024-04-16 北京达佳互联信息技术有限公司 Account matching method, account matching device and server
CN113111225A (en) * 2021-03-28 2021-07-13 根尖体育科技(北京)有限公司 Automatic matching team forming method for basketball game
CN113076415B (en) * 2021-04-30 2024-04-02 中国平安人寿保险股份有限公司 Article ordering method and device, computer equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106075912A (en) * 2016-06-07 2016-11-09 维沃移动通信有限公司 A kind of method that online game is helped each other and network game system
CN107158708A (en) * 2016-03-08 2017-09-15 电子技术公司 Multi-player video game matching optimization
CN109078333A (en) * 2018-08-09 2018-12-25 深圳市东方博雅科技有限公司 A kind of method and device matching game good friend
CN109603159A (en) * 2018-12-18 2019-04-12 网易(杭州)网络有限公司 Match the method, apparatus and system of game player
CN110639200A (en) * 2019-09-29 2020-01-03 网易(杭州)网络有限公司 Auxiliary game running method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10748376B2 (en) * 2017-09-21 2020-08-18 NEX Team Inc. Real-time game tracking with a mobile device using artificial intelligence

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107158708A (en) * 2016-03-08 2017-09-15 电子技术公司 Multi-player video game matching optimization
CN106075912A (en) * 2016-06-07 2016-11-09 维沃移动通信有限公司 A kind of method that online game is helped each other and network game system
CN109078333A (en) * 2018-08-09 2018-12-25 深圳市东方博雅科技有限公司 A kind of method and device matching game good friend
CN109603159A (en) * 2018-12-18 2019-04-12 网易(杭州)网络有限公司 Match the method, apparatus and system of game player
CN110639200A (en) * 2019-09-29 2020-01-03 网易(杭州)网络有限公司 Auxiliary game running method and device and electronic equipment

Also Published As

Publication number Publication date
CN111318025A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN111318025B (en) Game object matching method and device, electronic equipment and computer readable medium
CN109621422B (en) Electronic chess and card decision model training method and device and strategy generation method and device
US11141663B2 (en) Multiplayer video game matchmaking optimization
Sifa et al. The playtime principle: Large-scale cross-games interest modeling
CN109091868B (en) Method, apparatus, computer equipment and the storage medium that battle behavior determines
WO2015103964A1 (en) Method, apparatus, and device for determining target user
CN110175619B (en) Method, device and storage medium for determining card-playing set based on machine learning model
CN107335220B (en) Negative user identification method and device and server
CN111274151B (en) Game testing method, related device and storage medium
CN112926744A (en) Incomplete information game method and system based on reinforcement learning and electronic equipment
CN111265878B (en) Data processing method and device, electronic equipment and storage medium
CN112843725A (en) Intelligent agent processing method and device
CN110851542A (en) Data processing method and device, electronic equipment and computer readable storage medium
US20220288499A1 (en) Automated coaching for online gaming
CN111035934A (en) Game teaching method, device, electronic equipment and storage medium
CN112245936B (en) Account matching method, account matching device and server
Rebstock et al. Learning policies from human data for skat
CN111701240B (en) Virtual article prompting method and device, storage medium and electronic device
Dehpanah et al. Evaluating team skill aggregation in online competitive games
Gaina et al. General win prediction from agent experience
Huang et al. Predicting round result in Counter-Strike: Global Offensive using machine learning
Pan et al. Application of Deep Reinforcement Learning in Guandan Game
CN117695669A (en) Method, device, equipment and storage medium for processing player data
US20240042320A1 (en) Method for determining action of bot automatically playing champion within battlefield of league of legends game, and computing system for performing same
US20230347250A1 (en) System and method for matching users of client applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant