CN112446424A - Word card game data processing method, system and storage medium - Google Patents
Word card game data processing method, system and storage medium Download PDFInfo
- Publication number
- CN112446424A CN112446424A CN202011281187.9A CN202011281187A CN112446424A CN 112446424 A CN112446424 A CN 112446424A CN 202011281187 A CN202011281187 A CN 202011281187A CN 112446424 A CN112446424 A CN 112446424A
- Authority
- CN
- China
- Prior art keywords
- card
- decision
- data
- face
- model
- 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.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 18
- 238000012549 training Methods 0.000 claims abstract description 71
- 238000000034 method Methods 0.000 claims abstract description 43
- 238000013528 artificial neural network Methods 0.000 claims abstract description 40
- 238000013135 deep learning Methods 0.000 claims abstract description 36
- 230000009471 action Effects 0.000 claims description 130
- 239000011159 matrix material Substances 0.000 claims description 36
- 238000006243 chemical reaction Methods 0.000 claims description 24
- 230000008569 process Effects 0.000 claims description 19
- 238000012545 processing Methods 0.000 claims description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 9
- 230000000007 visual effect Effects 0.000 claims description 5
- 238000003491 array Methods 0.000 claims description 4
- 238000011478 gradient descent method Methods 0.000 claims description 3
- 238000007711 solidification Methods 0.000 abstract description 4
- 230000008023 solidification Effects 0.000 abstract description 4
- 238000003062 neural network model Methods 0.000 description 6
- 241000220317 Rosa Species 0.000 description 5
- 235000013399 edible fruits Nutrition 0.000 description 5
- 239000004744 fabric Substances 0.000 description 5
- 239000004615 ingredient Substances 0.000 description 5
- 238000013479 data entry Methods 0.000 description 4
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000013501 data transformation Methods 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000003066 decision tree Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001537 neural effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000011176 pooling Methods 0.000 description 1
- 230000001902 propagating effect Effects 0.000 description 1
- 238000010408 sweeping Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2413—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
- G06F18/24133—Distances to prototypes
- G06F18/24137—Distances to cluster centroïds
- G06F18/2414—Smoothing the distance, e.g. radial basis function networks [RBFN]
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F1/00—Card games
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/80—Information retrieval; Database structures therefor; File system structures therefor of semi-structured data, e.g. markup language structured data such as SGML, XML or HTML
- G06F16/84—Mapping; Conversion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F18/2155—Generating training patterns; Bootstrap methods, e.g. bagging or boosting characterised by the incorporation of unlabelled data, e.g. multiple instance learning [MIL], semi-supervised techniques using expectation-maximisation [EM] or naïve labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F1/00—Card games
- A63F2001/008—Card games adapted for being playable on a screen
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Molecular Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Evolutionary Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Electrically Operated Instructional Devices (AREA)
Abstract
The invention provides a word card game data processing method, a system and a storage medium, wherein the method comprises the following steps: inputting historical card game data, and converting the historical card game data into a two-dimensional array form to obtain a historical card game array; converting the historical card game array into training characteristic data through a preset classification decision; converting the face feature data to be decided into decision face feature data through a preset classification decision; training the training characteristic data based on the deep learning neural network to obtain a decision model; and performing decision operation on the face feature data to be decided according to the decision model, and outputting a decision. The invention can automatically learn the card playing rules of the word card game from the data of a large number of real players' historical card games, does not need to compile the complex logic judgment of human card playing into codes, and also avoids various logic loopholes and thinking solidification.
Description
Technical Field
The invention mainly relates to the technical field of game data processing, in particular to a method, a system and a storage medium for processing word card game data.
Background
The character cards are an ancient traditional card game, particularly popular in the Guiliu area and are also called Guilin character cards. The game is a non-complete information game, namely, any party participating in the game cannot acquire all information of the game situation and can only make game decisions according to the information mastered by the party. In online network games, it is possible that a player may not be a real player but an AI system that can make automatic game decisions based on card information. How to build an AI system that can interact with a human player and has a good game experience is a very challenging problem.
Common implementation manners of the current game AI system include a finite state machine method, a behavior decision tree method, a heuristic search method and the like. However, the above methods are insufficient for designing the AI system of the word card game, or require the AI system to consider all the combinations of the face states in advance, which results in infeasible calculation, or require a large number of search calculations, or the decision function is difficult to design and is easy to have logic omission.
Disclosure of Invention
The invention aims to solve the technical problem of the prior art and provides a word card game data processing method, a word card game data processing system and a storage medium.
The technical scheme for solving the technical problems is as follows: a word card game data processing method, comprising:
recording historical card game data and card face data to be decided;
converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
training the training characteristic data based on a deep learning neural network to obtain a decision model;
converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and performing decision operation on the face feature data to be decided according to the decision model, and outputting a decision.
Another technical solution of the present invention for solving the above technical problems is as follows: a card game data processing system, comprising:
the data input subsystem is used for inputting historical card game data and card face data to be decided;
the data conversion subsystem is used for converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
the data training subsystem is used for training the training characteristic data based on a deep learning neural network to obtain a decision model;
the data conversion subsystem is also used for converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and the data decision subsystem is used for carrying out decision operation on the face characteristic data to be decided according to the decision model and outputting a decision.
Another technical solution of the present invention for solving the above technical problems is as follows: a word card game data processing system comprising a memory, a processor and a computer program stored in the memory and executable on the processor, when executing the computer program, implementing a word card game data processing method as described above.
Another technical solution of the present invention for solving the above technical problems is as follows: a computer-readable storage medium storing a computer program which, when executed by a processor, implements a word card game data processing method as described above.
The invention has the beneficial effects that: the method can convert historical card game data and card face data to be decided into characteristic data for deep learning neural network training, and a decision model capable of outputting a word card action scheme is obtained based on the deep learning neural network; the invention can automatically learn the card playing rules of the word card game from the data of a large number of real players' historical card games, does not need to compile the complex logic judgment of human card playing into codes, and also avoids various logic loopholes and thinking solidification.
Drawings
Fig. 1 is a schematic flow chart of a word card game data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a connection of a card game data processing system according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of card hand data collection provided by an embodiment of the present invention;
FIG. 4 is a schematic flow chart of decision input feature data transformation provided by an embodiment of the present invention;
FIG. 5 is a schematic flow chart of decision output feature data transformation provided by an embodiment of the present invention;
FIG. 6 is a schematic flow chart of a method for training a card-playing action model according to an embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a schematic diagram of a method for processing data of a card game according to an embodiment of the present invention.
As shown in fig. 1, the method for processing data of a word card game based on a deep learning neural network includes:
recording historical card game data and card face data to be decided;
converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
training the training characteristic data based on a deep learning neural network to obtain a decision model;
converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and performing decision operation on the face feature data to be decided according to the decision model, and outputting a decision.
In particular, a large amount of historical card data, which may amount to tens or even hundreds of millions of card data, is required in training a deep learning neural network. Therefore, on the premise of recording complete card information, the amount of stored data needs to be reduced as much as possible.
The flow of acquiring the card game data is described below with reference to fig. 3:
starting to collect;
generating a next action card;
recording an array consisting of status bytes of all eighty cards;
splicing the array elements according to the time sequence;
judging whether to card, if yes, finishing the collection, and if not, continuing to collect the next action card;
thereby obtaining historical card play data.
A complete card game begins when the dealer first touches the card and ends when the card is touched by the dealer (or when no one has touched the card).
The invention takes the action of the action card as a time section and records the state data of each card at the moment; after all action cards are recorded in sequence according to time sequence, decision information and decision results mastered by each player at any moment in the game can be restored.
The data acquisition method of each time section comprises the following steps: the status of each card (eighty total) is recorded, including in which hand the card is (not yet dealt in the pile, at the dealer's top, at the dealer's bottom), whether the card is currently in motion, what the current motion is (no motion, touching the card, playing the card, eating the card, hitting the card, sweeping the card, steering, shuffling the card). All the state data of all eighty cards can be recorded by an array containing 80 elements, for example, the array is marked as A ═ a1,a2,…,a80]Then the meaning of each array element is as shown in table one:
table one:
a1 | byte data of a card one state |
a2 | Byte data of a card one state |
a3 | Byte data of a card one state |
a4 | Byte data of a card one state |
a5 | Byte data of the two-card state |
a6 | Byte data of the two-card state |
a7 | Byte data of the two-card state |
a8 | Byte data of the two-card state |
a9 | Byte data of the three-state of the card |
a10 | Byte data of the three-state of the card |
a11 | Byte data of the three-state of the card |
a12 | Byte data of the three-state of the card |
a13 | Byte data of the four state of the card |
a14 | Byte data of the four state of the card |
a15 | Byte data of the four state of the card |
a16 | Byte data of the four state of the card |
a17 | Byte data of the "five" state of the card |
a18 | Byte data of the "five" state of the card |
a19 | Byte data of the "five" state of the card |
a20 | Byte data of the "five" state of the card |
… | … |
a79 | Byte data of the card "pick" state |
a80 | Byte data of the card "pick" state |
The card game data acquisition method can save data storage capacity while ensuring that card game information is not lost, and is particularly useful when a large amount of card game data is stored.
In the embodiment, the historical card game data and the card face data to be decided can be converted into the characteristic data for deep learning neural network training, and a decision model capable of outputting the word card action scheme is obtained based on the deep learning neural network; the invention can automatically learn the card playing rules of the word card game from the data of a large number of real players' historical card games, does not need to compile the complex logic judgment of human card playing into codes, and also avoids various logic loopholes and thinking solidification. When the game playing method is slightly modified and the game rules are slightly changed, algorithm coding does not need to be carried out on the system again, and only new card game data are used for retraining the model of the deep neural network and learning a new playing method and new rules.
Optionally, as an embodiment of the present invention, the process of converting the historical card game data into a two-dimensional array form includes:
the historical card game data comprises card face data of the same time section, and the ith element a is obtained corresponding to the card face data of each word cardiWherein i is 1,2, …,80, each element aiThe card face is an array unit, the value of the array unit is an eight-bit single-byte unsigned integer, wherein the first bit to the seventh bit represent card face actions of the same time section and corresponding card face state information, and the eighth bit represents extended information;
by said 80 elements aiConstructing an array of identical time sections, wherein the array is marked as A ═ a1,a2,…,a80];
And carrying out two-dimensional splicing on the plurality of time section arrays of the historical card game data according to rows to obtain a historical card game array.
In the embodiment, scattered data in the historical card game data can be converted into an integral array form, so that further conversion of characteristic data is facilitated.
Optionally, as an embodiment of the present invention, the process of converting the historical card game array into training feature data through a preset classification decision includes:
reading a plurality of card faces Xi taking the current player as a visual angle from the card face state information in the historical card game array, and establishing a first two-dimensional matrix of each card face Xi and a first classification decision according to the set first classification decision;
reading a plurality of card faces Yi taking the previous player of the current player and the next player of the current player as visual angles from the card face state information in the historical card game array, and establishing a second two-dimensional matrix of each card face Yi and a second classification decision according to the set second classification decision;
splicing the first two-dimensional matrix and the second two-dimensional matrix according to the first classification decision and the second classification decision to obtain a total decision two-dimensional matrix for training deep learning neural network input;
determining action cards from the historical card game array, and converting the action cards into action card type characteristic data for training deep learning neural network output according to the action types of the action cards;
and taking the total decision two-dimensional matrix and the action card type feature data as the training feature data.
Specifically, an input part and an output part of the deep learning neural network need to be trained, the input part is trained through a total decision two-dimensional matrix, and the output part is trained through action board type characteristic data. The data conversion device converts and extracts decision information of the array data of the time section according to a decision visual angle of a game player, and an obtained conversion result is a two-dimensional matrix of game decision input characteristic data.
In the embodiment, historical card game data can be selected purposefully to serve as a training data set of the deep learning neural network for training, so that a corresponding deep learning neural network model is obtained, and AI systems with different 'intelligent' levels are generated.
Optionally, as an embodiment of the present invention, the process of establishing the first two-dimensional matrix of the respective cards Xi and the first classification decision according to the set first classification decision includes:
matching the face state information corresponding to each face Xi with each decision in the first classification decision, marking the face corresponding to the face state information which is successfully matched as 1, marking the face corresponding to the face state information which is failed to be matched as 0, and obtaining a first two-dimensional matrix of 0 and 1 according to the marking information;
the process of establishing the second two-dimensional matrix of each brand Yi and the second classification decision according to the set second classification decision comprises the following steps:
and matching the face state information corresponding to each face Xi with each decision in the second classification decisions, marking the face corresponding to the successfully matched face state information as 1, marking the face corresponding to the unsuccessfully matched face state information as 0, and obtaining a second two-dimensional matrix of 0 and 1 according to the marking information.
Optionally, as an embodiment of the present invention, the first sorting decision includes whether it is a hand of the current player, whether it is a cover of the current player, whether it is a bright card of the current player, whether it is a card touched by the current player, whether it is a bright card of the next player of the current player, whether it is a card touched by the next player of the current player, whether it is a bright card of the previous player of the current player, whether it is a card touched by the previous player of the current player;
the second classification decision comprises whether the current player's next card is played, whether the current player's last card is currently played, and whether the current player's card is played.
For the input part, the specific conversion idea is as follows: firstly, which action card is determined by the flag bit (byte 4 bit) of the action card data, then which player is making a decision can be determined according to the action card data (byte 1-2 bit), the player is selected as the current player, all card face information obtained by the current player is extracted according to decision classification according to the view angle when the current player plays games, and the card face information is stored in a two-dimensional matrix mode.
The storage modes for defining the two-dimensional matrix are divided into two types:
the first is a full arrangement, that is, eighty cards are arranged in 8 rows and 10 columns, if a certain card is definitely judged to accord with a decision classification in the decision classification, the element of the corresponding position of the two-dimensional matrix is 1, otherwise, the element is 0. As shown in table two:
table two:
a | II | III | Fourthly | Five of them | Six ingredients | Seven-piece | Eight-part | Nine-piece | Ten pieces of cloth |
A | II | III | Fourthly | Five of them | Six ingredients | Seven-piece | Eight-part | Nine-piece | Ten pieces of cloth |
A | II | III | Fourthly | Five of them | Six ingredients | Seven-piece | Eight-part | Nine-piece | Ten pieces of cloth |
A | II | III | Fourthly | Five of them | Six ingredients | Seven-piece | Eight-part | Nine-piece | Ten pieces of cloth |
A | Two-purpose bed | Three-way | Four | Wu's wine | Land | Seven (Chinese character) | Eight | Rose fruit | Picking-up device |
A | Two-purpose bed | Three-way | Four | Wu's wine | Land | Seven (Chinese character) | Eight | Rose fruit | Picking-up device |
A | Two-purpose bed | Three-way | Four | Wu's wine | Land | Seven (Chinese character) | Eight | Rose fruit | Picking-up device |
A | Two-purpose bed | Three-way | Four | Wu's wine | Land | Seven (Chinese character) | Eight | Rose fruit | Picking-up device |
For example, if the hand belonging to the current player is "one, three, four, five, six, eight, nine, ten, one, three, four, seven, Jiu", then the two-dimensional matrix obtained by converting "whether the hand belongs to the current player" is classified according to the decision, that is, "the first two-dimensional matrix" is obtained, as shown in table three,
table three:
specifically, the first classification decision (decision classification of conversion of full rank) includes whether it is a hand of the current player, whether it is a cover of the current player, whether it is a bright card of the current player, whether it is a card touched by the current player, whether it is a bright card of the next house of the current player, whether it is a card touched by the next house of the current player, whether it is a bright card of the previous house of the current player, whether it is a card touched by the previous house of the current player, and whether it is a card touched by the previous house of the current player.
The second is a non-repeated arrangement, that is, twenty non-repeated cards are arranged in 2 rows and 10 columns (as shown in the following table), if a certain card appears in a certain decision classification, the element of the corresponding position of the two-dimensional matrix is 1, otherwise, the element is 0. As shown in table four, the following steps are carried out,
table four:
a | II | III | Fourthly | Five of them | Six ingredients | Seven-piece | Eight-part | Nine-piece | Ten pieces of cloth |
A | Two-purpose bed | Three-way | Four | Wu's wine | Land | Seven (Chinese character) | Eight | Rose fruit | Picking-up device |
For example, if the stroke belonging to the current player is "five", the resulting two-dimensional matrix is converted, i.e., the "second two-dimensional matrix" is obtained. As shown in table five, the first and second,
table five:
0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
the second classification decision (decision classification for conversion without repeating arrangement) includes whether the current player's card is touched by the next house, whether the current player's card is played by the next house, whether the current player's card is touched by the previous house, whether the current player's card is played by the previous house, and whether the current player's card is touched.
Specifically, because the number of columns of the two-dimensional matrix of each decision classification is the same, the matrices of all the decision classifications can be stacked and spliced according to rows, and finally a larger two-dimensional matrix, namely a total decision two-dimensional matrix, is obtained. As shown in table six:
table six:
in the above embodiment, in the above splicing manner, the final conversion result is a two-dimensional matrix with 98 rows and 10 columns, and the elements of the two-dimensional matrix can be used as input units of the deep learning neural network in the data training subsystem and the data decision subsystem. It should be noted that, because a two-dimensional matrixing representation mode is adopted as an input, it is feasible to adopt a deep learning neural network model and a training algorithm specially designed for two-dimensional image data.
Specifically, an output part of the deep learning neural network needs to be trained, and action card type feature data used by the output part needs to be obtained.
As shown in fig. 4, for the input part, the conversion flow of the decision input feature data is as follows:
determining the current action board according to the action board data zone bit;
determining a decision perspective of a current player;
converting the two-dimensional array characteristics according to different decision classifications;
stacking elements of the two-dimensional array according to rows for splicing;
and obtaining a conversion result.
For the output part, the specific conversion idea is as follows: firstly, the flag bit (4 th bit in byte) of the action card data can determine which action card is the action card, and then the data (1 st-2 nd bit in byte) of the action card can determine which player is making a decision and select the player as the current decision. Finally, based on the action card data (bits 5-7 of the byte), it can be determined which action the decision result is (e.g., 010 means playing, 011 means eating, and 100 means hitting).
The action types comprise a card-playing action, a card-bumping action, a card-eating action and a fixing action. It is understood that a stationary action may be understood as an action other than a card-out action, a card-hit action, a card-eating action.
As shown in fig. 5, for the output part, the conversion flow of the decision output feature data is as follows:
determining the current action board according to the action board data zone bit;
determining a decision perspective of a current player;
different conversions are carried out according to the action types of the action cards, and the action card arrays comprise action card arrays corresponding to card-out actions, card-impacting actions, card-eating actions and fixed actions (other actions).
For data whose action is a deal, the result of the conversion is an array of 20 elements, where the value definition of each array element is shown in table seven:
watch seven
For data with the action of hit, the conversion result is an array containing 21 elements, wherein the value definition of each array element is shown in table eight:
table eight
For data with actions of eating cards, the conversion result is an array containing 39 elements, wherein the value definition of each array element is shown in table nine:
table nine:
no conversion is required for data where the action is of another action type than a discard, hit, or eat. As these other actions do not need to learn how to make a decision, but are instead mandatory.
It should be understood that the process of obtaining the face array to be decided is the same as the process of obtaining the historical face array, and thus the description is omitted.
The process of converting the card face feature data to be decided into decision card face feature data through the preset classification decision is the same as the process of converting the historical card face array into training feature data through the preset classification decision, and therefore the process is not repeated.
Optionally, as an embodiment of the present invention, the action types include a card-out action, a card-hit action, a card-eat action, and a card-hold action.
Optionally, as an embodiment of the present invention, the deep learning neural network includes a card-out motion model, a card-hit motion model and a card-eating motion model;
the process of training the training characteristic data based on the deep learning neural network to obtain a decision model comprises the following steps:
respectively taking the training characteristic data as a training set and a verification set, respectively inputting the training set into a card-playing action model, a card-bumping action model, a card-eating action model and a fixed action model of the deep learning neural network, and respectively updating network parameters of the card-playing action model, the card-bumping action model, the card-eating action model and the fixed action model through a neural network back propagation and gradient descent method;
and respectively inputting the verification set into the updated card-playing action model, card-bumping action model and card-eating action model, determining whether the updated card-playing action model, card-bumping action model, card-eating action model and fixed action model are fitted through the verification set, and finishing training if the updated card-playing action model, card-bumping action model, card-eating action model and fixed action model are fitted to obtain a decision model, wherein the decision model comprises the trained card-playing action model, the trained card-bumping action model, the trained card-eating action model and the trained fixed action model.
Specifically, the data training apparatus uses deep learning and neural network techniques to perform decision process learning from decision input feature data to decision output result data.
Aiming at three actions of playing cards, bumping cards and eating cards, the deep learning neural network decision model is trained independently.
Specifically, the following describes a method for designing and processing a deep learning neural network model of a card-playing action.
Structural design of the neural network model: the card game system is characterized in that a structural design of a two-dimensional convolutional neural network is adopted, an input layer is decision input characteristic data (a 98x10 two-dimensional matrix) obtained by converting card game data with the action of 'card-out' through a data conversion subsystem, an output layer is decision output result data (an array containing 20 elements) obtained by converting the card game data with the action of 'card-out', and an intermediate layer is formed by combining a plurality of convolutional layers, a batch normalization layer, a pooling layer and the like. The number, structure and parameters of the neural unit nodes in the middle layer are unknown and can be obtained only by learning and training through data.
The model training method comprises the following steps: the training data is first divided into two parts, the training set and the validation set, in proportion. And for the data of the training set, continuously adjusting parameters of each layer of the neural network by using a universal neural network back propagation and gradient descent method, so that the error loss between the output result of the neural network and the real decision output result is continuously reduced. And the data of the verification set does not participate in the parameter calculation of the neural network, and is only used for judging whether the model obtained by training is fitted or not and whether the training needs to be stopped or not.
As shown in fig. 6, the following describes the training process by taking the training of the card-playing motion model as an example:
training is started;
inputting training characteristic data input by a card-playing action decision;
dividing a training set and a verification set according to a proportion;
inputting the data of the training set to the current network;
calculating error loss of the network output and the real decision result value, inputting a verification set, determining whether the error loss is not over-fitted and does not meet the condition, reversely propagating and calculating the gradient, and updating the network parameters; and (5) meeting the conditions and finishing training.
In the embodiment, the deep learning neural network model framework for constructing the word brand AI system and the corresponding input and output structure definitions are provided, model learning and training can be performed by combining various deep learning neural network models, and the method has universality.
Optionally, as an embodiment of the present invention, the performing decision operation on the face feature data to be decided according to the decision model, and outputting a decision includes:
inputting the face feature data to be decided into the trained card-playing action model for decision-making operation, and outputting a card-playing decision;
inputting the face feature data to be decided into the trained hit card action model for decision operation, and outputting a hit card decision;
inputting the face feature data to be decided into the trained card eating motion model to perform decision operation, and outputting a card eating decision;
and inputting the face feature data to be decided into the trained fixed action model for decision operation, and outputting a fixed action decision.
Fig. 2 is a connection diagram of a data processing system for a card game according to an embodiment of the present invention.
Alternatively, as another embodiment of the present invention, as shown in fig. 2, a card game data processing system includes:
the data input subsystem is used for inputting historical card game data and card face data to be decided;
the data conversion subsystem is used for converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
the data training subsystem is used for training the training characteristic data based on a deep learning neural network to obtain a decision model;
the data conversion subsystem is also used for converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and the data decision subsystem is used for carrying out decision operation on the face characteristic data to be decided according to the decision model and outputting a decision.
Optionally, as an embodiment of the present invention, the data entry subsystem is further configured to receive a data entry instruction from a user, and the data entry subsystem is configured to receive the data entry instruction and the data conversion instruction from the user.
In the embodiment, after the system is released and on-line, the invention can perform reinforced learning training on the model of the deep neural network according to the collected operation data for the problems found in the operation of the system, and update the model and improve the operation system in time.
Alternatively, as another embodiment of the present invention, a word card game data processing system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, implements the word card game data processing method as described above.
Alternatively, as another embodiment of the present invention, a computer-readable storage medium stores a computer program which, when executed by a processor, implements the word card game data processing method as described above.
The method can convert historical card game data and card face data to be decided into characteristic data for deep learning neural network training, and a decision model capable of outputting a word card action scheme is obtained based on the deep learning neural network; the invention can automatically learn the card playing rules of the word card game from the data of a large number of real players' historical card games, does not need to compile the complex logic judgment of human card playing into codes, and also avoids various logic loopholes and thinking solidification. When the game playing method is slightly modified and the game rules are slightly changed, algorithm coding does not need to be carried out on the system again, and only new card game data are used for retraining the model of the deep neural network and learning a new playing method and new rules.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (10)
1. A method for processing data of a card game, comprising:
recording historical card game data and card face data to be decided;
converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
training the training characteristic data based on a deep learning neural network to obtain a decision model;
converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and performing decision operation on the face feature data to be decided according to the decision model, and outputting a decision.
2. The word card game data processing method according to claim 1, wherein the process of converting the historical hand data into a two-dimensional array form includes:
the historical card game data comprises card face data of the same time section, and the ith element a is obtained corresponding to the card face data of each word cardiWherein i is 1,2, …,80, each element aiThe card face is an array unit, the value of the array unit is an eight-bit single-byte unsigned integer, wherein the first bit to the seventh bit represent card face actions of the same time section and corresponding card face state information, and the eighth bit represents extended information;
by said 80 elements aiConstructing an array of identical time sections, wherein the array is marked as A ═ a1,a2,…,a80];
And carrying out two-dimensional splicing on the plurality of time section arrays of the historical card game data according to rows to obtain a historical card game array.
3. The word card game data processing method according to claim 2, wherein the process of converting the historical card game array into training feature data by a preset classification decision includes:
reading a plurality of card faces Xi taking the current player as a visual angle from the card face state information in the historical card game array, and establishing a first two-dimensional matrix of each card face Xi and a first classification decision according to the set first classification decision;
reading a plurality of card faces Yi taking the previous player of the current player and the next player of the current player as visual angles from the card face state information in the historical card game array, and establishing a second two-dimensional matrix of each card face Yi and a second classification decision according to the set second classification decision;
splicing the first two-dimensional matrix and the second two-dimensional matrix according to the first classification decision and the second classification decision to obtain a total decision two-dimensional matrix for training deep learning neural network input;
determining action cards from the historical card game array, and converting the action cards into action card type characteristic data for training deep learning neural network output according to the action types of the action cards;
and taking the total decision two-dimensional matrix and the action card type feature data as the training feature data.
4. The card game data processing method according to claim 3, wherein the process of establishing the first two-dimensional matrix of the respective face Xi and the first sorting decision based on the set first sorting decision comprises:
matching the face state information corresponding to each face Xi with each decision in the first classification decision, marking the face corresponding to the face state information which is successfully matched as 1, marking the face corresponding to the face state information which is failed to be matched as 0, and obtaining a first two-dimensional matrix of 0 and 1 according to the marking information;
the process of establishing the second two-dimensional matrix of each brand Yi and the second classification decision according to the set second classification decision comprises the following steps:
and matching the face state information corresponding to each face Xi with each decision in the second classification decisions, marking the face corresponding to the successfully matched face state information as 1, marking the face corresponding to the unsuccessfully matched face state information as 0, and obtaining a second two-dimensional matrix of 0 and 1 according to the marking information.
5. The word card game data processing method according to claim 4, wherein the first classification decision includes whether it is a hand of the current player, whether it is a cover of the current player, whether it is a bright card of the current player, whether it is a card that the current player has touched, whether it is a card that the current player has played, whether it is a bright card of a next player of the current player, whether it is a card that a next player of the current player has touched, whether it is a bright card of a previous player of the current player, whether it is a card that a previous player of the current player has touched, whether it is a card that a previous player of the current player has played;
the second classification decision comprises whether the current player's next card is played, whether the current player's last card is currently played, and whether the current player's card is played.
6. The word card game data processing method according to claim 1, wherein the deep learning neural network includes a card-out motion model, a card-hit motion model, and a card-eating motion model;
the process of training the training characteristic data based on the deep learning neural network to obtain a decision model comprises the following steps:
respectively taking the training characteristic data as a training set and a verification set, respectively inputting the training set into a card-playing action model, a card-bumping action model, a card-eating action model and a fixed action model of the deep learning neural network, and respectively updating network parameters of the card-playing action model, the card-bumping action model, the card-eating action model and the fixed action model through a neural network back propagation and gradient descent method;
and respectively inputting the verification set into the updated card-playing action model, card-bumping action model and card-eating action model, determining whether the updated card-playing action model, card-bumping action model, card-eating action model and fixed action model are fitted through the verification set, and finishing training if the updated card-playing action model, card-bumping action model, card-eating action model and fixed action model are fitted to obtain a decision model, wherein the decision model comprises the trained card-playing action model, the trained card-bumping action model, the trained card-eating action model and the trained fixed action model.
7. The data processing method of the word card game as claimed in claim 6, wherein the step of performing decision operation on the face feature data to be decided according to the decision model and outputting a decision comprises:
inputting the face feature data to be decided into the trained card-playing action model for decision-making operation, and outputting a card-playing decision;
inputting the face feature data to be decided into the trained hit card action model for decision operation, and outputting a hit card decision;
inputting the face feature data to be decided into the trained card eating motion model to perform decision operation, and outputting a card eating decision;
and inputting the face feature data to be decided into the trained fixed action model for decision operation, and outputting a fixed action decision.
8. A card game data processing system, comprising:
the data input subsystem is used for inputting historical card game data and card face data to be decided;
the data conversion subsystem is used for converting the historical card game data into a two-dimensional array form to obtain a historical card game array, and converting the historical card game array into training characteristic data through a preset classification decision;
the data training subsystem is used for training the training characteristic data based on a deep learning neural network to obtain a decision model;
the data conversion subsystem is also used for converting the decision-making board surface data into a two-dimensional array form to obtain a board surface array to be decided, and converting the board surface array to be decided into decision-making board surface characteristic data through a preset classification decision;
and the data decision subsystem is used for carrying out decision operation on the face characteristic data to be decided according to the decision model and outputting a decision.
9. A word card game data processing system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the word card game data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the data processing method of the card game according to any one of claims 1 to 7 is implemented.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011281187.9A CN112446424B (en) | 2020-11-16 | 2020-11-16 | Word card game data processing method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011281187.9A CN112446424B (en) | 2020-11-16 | 2020-11-16 | Word card game data processing method, system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112446424A true CN112446424A (en) | 2021-03-05 |
CN112446424B CN112446424B (en) | 2024-02-27 |
Family
ID=74738749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011281187.9A Active CN112446424B (en) | 2020-11-16 | 2020-11-16 | Word card game data processing method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112446424B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112685921A (en) * | 2021-03-12 | 2021-04-20 | 中至江西智能技术有限公司 | Mahjong intelligent decision method, system and equipment for efficient and accurate search |
CN115115995A (en) * | 2022-08-29 | 2022-09-27 | 四川天启智能科技有限公司 | Mahjong game decision method based on self-learning model |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055339A (en) * | 2016-06-08 | 2016-10-26 | 天津联众逸动科技发展有限公司 | Method for determining card playing strategy of computer player in two-against-one game |
CN107998661A (en) * | 2017-12-26 | 2018-05-08 | 苏州大学 | A kind of aid decision-making method, device and the storage medium of online battle game |
CN108764445A (en) * | 2018-04-28 | 2018-11-06 | 国家电网公司 | The multi-party dynamic game method and system of asymmetrical information based on convolutional neural networks |
CN109508789A (en) * | 2018-06-01 | 2019-03-22 | 北京信息科技大学 | Predict method, storage medium, processor and the equipment of hands |
CN109621422A (en) * | 2018-11-26 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Electronics chess and card decision model training method and device, strategy-generating method and device |
US20190251603A1 (en) * | 2018-02-15 | 2019-08-15 | Sampsa Valtteri Jaatinen | Systems and methods for a machine learning based personalized virtual store within a video game using a game engine |
JP2019164753A (en) * | 2018-11-16 | 2019-09-26 | 株式会社Cygames | System, method, and program for inspecting game program, machine leaning support device, and data structure |
CN110478908A (en) * | 2019-08-22 | 2019-11-22 | 网易(杭州)网络有限公司 | The control method and device of Random Factor Mahjong, storage medium, electronic equipment |
CN110852436A (en) * | 2019-10-18 | 2020-02-28 | 桂林力港网络科技股份有限公司 | Data processing method, device and storage medium for electronic poker game |
CN111506514A (en) * | 2020-07-01 | 2020-08-07 | 深圳云步互娱网络科技有限公司 | Intelligent testing method and system applied to elimination game |
-
2020
- 2020-11-16 CN CN202011281187.9A patent/CN112446424B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055339A (en) * | 2016-06-08 | 2016-10-26 | 天津联众逸动科技发展有限公司 | Method for determining card playing strategy of computer player in two-against-one game |
CN107998661A (en) * | 2017-12-26 | 2018-05-08 | 苏州大学 | A kind of aid decision-making method, device and the storage medium of online battle game |
US20190251603A1 (en) * | 2018-02-15 | 2019-08-15 | Sampsa Valtteri Jaatinen | Systems and methods for a machine learning based personalized virtual store within a video game using a game engine |
CN108764445A (en) * | 2018-04-28 | 2018-11-06 | 国家电网公司 | The multi-party dynamic game method and system of asymmetrical information based on convolutional neural networks |
CN109508789A (en) * | 2018-06-01 | 2019-03-22 | 北京信息科技大学 | Predict method, storage medium, processor and the equipment of hands |
JP2019164753A (en) * | 2018-11-16 | 2019-09-26 | 株式会社Cygames | System, method, and program for inspecting game program, machine leaning support device, and data structure |
CN109621422A (en) * | 2018-11-26 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Electronics chess and card decision model training method and device, strategy-generating method and device |
CN110478908A (en) * | 2019-08-22 | 2019-11-22 | 网易(杭州)网络有限公司 | The control method and device of Random Factor Mahjong, storage medium, electronic equipment |
CN110852436A (en) * | 2019-10-18 | 2020-02-28 | 桂林力港网络科技股份有限公司 | Data processing method, device and storage medium for electronic poker game |
CN111506514A (en) * | 2020-07-01 | 2020-08-07 | 深圳云步互娱网络科技有限公司 | Intelligent testing method and system applied to elimination game |
Non-Patent Citations (5)
Title |
---|
YAN P 等: "Using convolution and deep learning in gomoku game artificial intelligence", 《PARALLEL PROCESSING LETTERS》, vol. 28, no. 03, pages 1 - 13 * |
徐方婧 等: "基于卷积神经网络的"斗地主"策略", 《计算机与现代化》, no. 11, pages 28 - 32 * |
李轶: "德州扑克计算机博弈智能决策模型研究", 《中国优秀硕士学位论文全文数据库 (基础科学辑)》, no. 08, pages 002 - 311 * |
郭勤: "基于深度强化学习的视频游戏决策模型研究与应用", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 07, pages 140 - 136 * |
陈鹏: "面向实时策略游戏微操的智能博弈决策方法", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 09, pages 140 - 161 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112685921A (en) * | 2021-03-12 | 2021-04-20 | 中至江西智能技术有限公司 | Mahjong intelligent decision method, system and equipment for efficient and accurate search |
CN115115995A (en) * | 2022-08-29 | 2022-09-27 | 四川天启智能科技有限公司 | Mahjong game decision method based on self-learning model |
Also Published As
Publication number | Publication date |
---|---|
CN112446424B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103198358B (en) | Information processing apparatus, information processing method, and program | |
CN110852436B (en) | Data processing method, device and storage medium for electronic poker game | |
CN112446424A (en) | Word card game data processing method, system and storage medium | |
CN109033309B (en) | Data processing method, device, equipment and storage medium | |
Gao et al. | Bloody Mahjong playing strategy based on the integration of deep learning and XGBoost | |
CN110458295B (en) | Chess and card level generation method, training method and device based on artificial intelligence | |
CN111701240B (en) | Virtual article prompting method and device, storage medium and electronic device | |
CN111506514B (en) | Intelligent testing method and system applied to elimination game | |
CN110457534A (en) | A kind of data processing method based on artificial intelligence, device, terminal and medium | |
CN111330255B (en) | Amazon chess-calling generation method based on deep convolutional neural network | |
Susanto et al. | Maze generation based on difficulty using genetic algorithm with gene pool | |
Cuccu et al. | Playing Atari with few neurons: Improving the efficacy of reinforcement learning by decoupling feature extraction and decision making | |
Phon-Amnuaisuk | Evolving and discovering Tetris gameplay strategies | |
CN107694094A (en) | A kind of bridge gambling party sample generating method | |
Jakubik | A neural network approach to hearthstone win rate prediction | |
Li et al. | Research on fight the landlords’ single card guessing based on deep learning | |
Purmonen | Predicting game level difficulty using deep neural networks | |
Safak et al. | Automated maze generation for Ms. Pac-Man using genetic algorithms | |
CN112044082B (en) | Information detection method and device and computer readable storage medium | |
Cen et al. | Regression networks for robust win-rates predictions of AI gaming bots | |
CN110478907B (en) | Mahjong AI data processing method based on big data driving | |
CN114004359A (en) | Mahjong-to-custom-cut prediction method and device, storage medium and equipment | |
CN113274738B (en) | Card type data acquisition method and related device for whipped egg game | |
Barone et al. | Evolving computer opponents to play a game of simplified poker | |
CN113426109A (en) | Method for cloning chess and card game behaviors based on factorization machine |
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 |