Chess teaching method and device, storage medium and electronic equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-08
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]目前,棋类教学通常依赖于教师的讲解、示范以及学员之间的对弈练习,难以满足不同学员在个性化学习上的需求,存在较大的局限性
[0014]通过上述技术方案,获取用于表征用户当前棋局中棋子布局方式的目标棋局状态信息,将目标棋局状态信息输入至教学模型,得到走法概率分布信息和胜率评估值,根据走法概率分布信息,确定用于表征当前棋局复杂程度的博弈熵,根据胜率评估值,确定用于表征棋局变化程度的棋局关键值,根据博弈熵和棋局关键值,确定教学价值评分,若教学价值评分大于预设阈值,执行针对用户的教学操作。由此,能够利用教学模型对当前棋局状态进行分析,确定其走法概率分布和胜率评估值,再通过博弈熵和棋局关键值这样的动态指标,实时评估棋局的复杂程度和变化程度,并进一步计算出教学价值评分,以根据教学价值评分实现对用户的个性化教学。这样,能够在用户对弈的过程中自动对棋局进行全面且深入的分析,再基于分析结果在合适的时机为用户提供教学,实现对用户的智能化指导,有利于提升用户的学习效率。
Smart Images

Figure CN122551648A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a chess teaching method, apparatus, storage medium, and electronic device. Background Technology
[0002] Currently, chess instruction typically relies on teacher explanations, demonstrations, and peer-to-peer practice, which struggles to meet the personalized learning needs of diverse learners and presents significant limitations. With the development of artificial intelligence, algorithms like AlphaZero have emerged and are widely used in chess-playing scenarios. However, these algorithms focus on achieving victory in matches and still cannot solve the challenges of chess instruction. Summary of the Invention
[0003] The purpose of this disclosure is to provide a chess teaching method, device, storage medium, and electronic device.
[0004] To achieve the above objectives, according to a first aspect of this disclosure, a chess teaching method is provided, the method comprising: Obtain target game state information that represents the current chess piece layout in the user's game; The target game state information is input into the teaching model to obtain the move probability distribution information and the win rate evaluation value. The move probability distribution information includes the probability corresponding to each of the various moves. Based on the probability distribution information of the moves, determine the game entropy used to characterize the complexity of the current game situation; Based on the win rate assessment value, determine the key values of the game to characterize the degree of change in the game; The teaching value score is determined based on the game entropy and the key values of the game. If the teaching value score is greater than a preset threshold, a teaching operation will be performed for the user.
[0005] Optionally, the method further includes: Based on the target game state information, determine the game matching value between the current game and the reference game, wherein the reference game is a game in the history that is associated with the specified game result. The process of determining the teaching value score based on the game entropy and the key values of the game includes: The teaching value score is obtained by weighted summation of the game entropy, the key value of the game, and the matching value of the game.
[0006] Optionally, determining the matching value between the current game state and the reference game state based on the target game state information includes: Based on the target chess game state information, determine the target feature vector corresponding to the current chess game; Obtain the reference feature vectors corresponding to each of the multiple stored reference chess positions; The similarity between the target feature vector and each of the reference feature vectors is determined respectively; The maximum value in the similarity score is determined as the game matching value.
[0007] Optionally, determining the key values for characterizing the degree of change in the game based on the win rate assessment value includes: Obtain the win rate assessment value corresponding to the previous game in the current game, and use it as a win rate reference value; The key value of the game is determined based on the difference between the win rate assessment value corresponding to the target game state information and the win rate reference value.
[0008] Optionally, the teaching model is generated in the following way: Multiple sets of training samples are obtained, each set of training samples including game state information samples, move probability information samples and game result labels; The training model is trained based on the training samples to obtain the teaching model; wherein, in each training iteration: The chess game state information sample is input into the training model to be trained in this training to obtain the predicted move probability distribution information and predicted win rate evaluation value output by the training model to be trained in this training. Based on the predicted path probability distribution information and the path probability information sample, the first loss is determined; The second loss is determined based on the predicted win rate assessment value and the game result label; The training game entropy is determined based on the predicted move probability distribution information, and the training game key value is determined based on the predicted win rate evaluation value. A third loss is determined based on the training game entropy and the training game key value. The third loss is negatively correlated with the target product, which is the product of the training game entropy and the training game key value. The model to be trained is updated based on the first loss, the second loss, and the third loss to obtain the model to be trained for the next training session.
[0009] Optionally, obtaining multiple sets of training samples includes: The model to be trained is used to play a game, generating at least one complete game; wherein, during the game, for each move, the following operations are performed: Record the current piece layout as a sample of the game state information; The chess game state information sample is input into the model to be trained to obtain the initial move probability distribution information output by the model to be trained; The initial movement probability distribution information is processed using a preset strategy improvement algorithm to obtain the movement probability information sample; At the end of a complete game of chess, the result of the game is recorded as the game result label.
[0010] Optionally, if the teaching value score is greater than a preset threshold, the method further includes: Based on the probability distribution information of the travel paths, at least one recommended travel path is determined; The execution of the teaching operation for the user includes at least one of the following: Based on the recommended move, determine the target area corresponding to the recommended move in the chessboard area, and display the identification information in the target area; Determine the target win rate assessment value corresponding to the recommended move, and display the recommended move and the target win rate assessment value.
[0011] According to a second aspect of this disclosure, a chess teaching device is provided, the device comprising: The first acquisition module is used to acquire target chess state information that represents the chess piece layout in the user's current chess game; The first processing module is used to input the target chess game state information into the teaching model to obtain the move probability distribution information and the win rate evaluation value. The move probability distribution information includes the probability corresponding to each of the various moves. The first determining module is used to determine the game entropy, which characterizes the complexity of the current game, based on the move probability distribution information. The second determining module is used to determine key values of the game that characterize the degree of change in the game based on the win rate evaluation value. The third determining module is used to determine the teaching value score based on the game entropy and the key values of the game. The teaching module is used to perform teaching operations for the user if the teaching value score is greater than a preset threshold.
[0012] According to a third aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in the first aspect of this disclosure.
[0013] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method described in the first aspect of this disclosure.
[0014] The above technical solution acquires target game state information to characterize the current piece layout in a user's game. This target game state information is input into a teaching model to obtain move probability distribution information and win rate evaluation values. Based on the move probability distribution information, a game entropy is determined to characterize the complexity of the current game. Based on the win rate evaluation value, a key game value is determined to characterize the degree of change in the game. Based on the game entropy and key game value, a teaching value score is determined. If the teaching value score is greater than a preset threshold, a teaching operation is executed for the user. Thus, the teaching model can analyze the current game state, determine its move probability distribution and win rate evaluation value, and then use dynamic indicators such as game entropy and key game value to evaluate the complexity and degree of change of the game in real time, further calculating a teaching value score to achieve personalized teaching for the user. This allows for a comprehensive and in-depth analysis of the game during the user's game, and provides teaching to the user at appropriate times based on the analysis results, achieving intelligent guidance and improving the user's learning efficiency.
[0015] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a chess teaching method provided according to one embodiment of the present disclosure; Figure 2 This is a block diagram of a chess teaching device provided according to one embodiment of the present disclosure; Figure 3 This is a block diagram illustrating an electronic device according to an exemplary embodiment; Figure 4 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0017] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.
[0018] Figure 1 This is a flowchart of a chess teaching method provided according to one embodiment of this disclosure. For example... Figure 1 As shown, the method provided in this disclosure may include steps 11 to 16.
[0019] In step 11, target game state information is obtained to characterize the layout of the pieces in the user's current game.
[0020] Optionally, the current game state information can be acquired via image acquisition devices, sensors, or manual user input, serving as the target game state information. The game state information may include the current moves of both players on the board; the players include the user (your own side) and the opponent (your opponent). For example, the image acquisition device may include a camera or webcam capable of capturing images of the game board to obtain the target game state information. Alternatively, sensors (e.g., pressure sensors) may be installed on the game board to directly detect and acquire the target game state information. Furthermore, a conversion relationship between user input and game state information can be established to obtain the target game state information based on the user's input.
[0021] The target chess game state information may include, but is not limited to, the piece type, position, and ownership of each piece on the current chessboard. Piece type is determined based on the type of piece; in Chinese chess, for example, piece types may include rook, knight, and cannon. Piece position can be represented by coordinates on the chessboard coordinate system. Piece ownership includes ownership by one of the two players. For example, the target chess game state information can be represented by vectors.
[0022] In step 12, the target game state information is input into the teaching model to obtain the move probability distribution information and the win rate evaluation value.
[0023] The move probability distribution information includes the probabilities corresponding to various moves. These various moves can include all possible moves during the current game. The move probability distribution information can be used to characterize the probability of each move being selected in the current game state. Assuming there are two moves, A1 and A2, the move probability distribution information can include the probability of move A1 and the probability of move A2. The win rate evaluation value is used to assess the user's win rate in the current game.
[0024] The teaching model disclosed herein can predict the probability distribution of different moves and the user's probability of winning based on the game state information. The teaching model may include a value network and a policy network, wherein the policy network is used to output the probability distribution information of moves, and the value network is used to output the win rate evaluation value.
[0025] Alternatively, in this disclosure, the teaching model can be generated in the following ways: Multiple sets of training samples are obtained. Each set of training samples includes a chess state information sample, a move probability information sample, and a game result label. The training model is obtained by training the model to be trained based on the training samples; wherein, in each training iteration: Input the chess game state information sample into the model to be trained in this training, and obtain the predicted move probability distribution information and predicted win rate evaluation value output by the model to be trained in this training. The first loss is determined based on the predicted path probability distribution information and the path probability information sample; The second loss is determined based on the predicted win rate assessment value and the game result label; The training game entropy is determined based on the predicted move probability distribution information, and the training game key value is determined based on the predicted win rate evaluation value. Based on the training game entropy and the key values of the training game, a third loss is determined. The third loss is negatively correlated with the target product, which is the product of the training game entropy and the key values of the training game. The training model is updated based on the first loss, the second loss, and the third loss to obtain the training model for the next training session.
[0026] Optionally, training samples can be obtained directly from existing public databases, or they can be collected through self-play. The content of the game state information samples is similar to that described above, and their acquisition methods are also similar. The move probability information samples are similar to the move probability distribution information described above, and will not be repeated here. The game result is the outcome of a game at the end of the game, which may include, but is not limited to, a win, a loss, or a draw, and is recorded as a game result label.
[0027] In one possible implementation, obtaining multiple sets of training samples may include the following steps: The model to be trained is used to play a game, generating at least one complete game; during the game, for each move, the following operations are performed: Record the current piece layout as a sample of the game state information; Input the chess game state information sample into the model to be trained to obtain the initial move probability distribution information output by the model to be trained; The initial move probability distribution information is processed using a pre-defined strategy to obtain move probability information samples. At the end of a complete game, the result of the game is recorded as a game result label.
[0028] The model to be trained can be a neural network. Based on the model, multiple self-play games are conducted, and a set of training samples can be collected for each move. The same game (a complete game where the winner is determined) shares the same game result label. The model to be trained can include a policy network and a value network.
[0029] In each move, the current piece layout can be recorded as a game state information sample. This sample is then input into the model to be trained, yielding an initial move probability distribution. Next, a pre-defined strategy improvement algorithm processes this initial move probability distribution, resulting in optimized move probability information samples. These optimized samples are used as training samples to guide the model in generating better moves during subsequent training, thus improving training efficiency. For example, the pre-defined strategy improvement algorithm could be a Monte Carlo tree search algorithm. Another example is the AlphaZero algorithm.
[0030] At the end of a complete game, the outcome of the game is determined, and a game result label can be recorded based on this outcome.
[0031] Through the above methods, a large number of training samples can be collected as the self-play continues.
[0032] After obtaining sufficient training samples, the model to be trained can be trained based on these samples. In each training session, a set of training samples can be used, and the game state information samples of this set of training samples can be input into the model to be trained in this session to obtain the predicted move probability distribution information and predicted win rate evaluation value output by the model to be trained in this session.
[0033] Subsequently, based on the predicted move probability distribution information and move probability information samples, the first loss can be determined. Based on the predicted win rate evaluation value and the game result label, the second loss can be determined. The first and second losses can each be calculated using appropriate loss functions according to actual needs, such as mean squared error, mean absolute error, cross-entropy, etc.
[0034] In addition, the training game entropy can be determined based on the predicted move probability distribution information, and the training game key value can be determined based on the predicted win rate evaluation value. Then, a third loss can be determined based on the training game entropy and the training game key value. The third loss can be set to be negatively correlated with the target product, which is the product of the training game entropy and the training game key value.
[0035] Game entropy reflects the complexity of the current game situation. For example, game entropy can be determined in the following ways: H ( p ): H ( p )= ∑ pilogpi in, p iFor the probability distribution information of predicted moves, the first... i The probability of each possible move.
[0036] Key values in a game can characterize the impact of a user's moves on their win rate. For example, key values can be obtained by calculating the difference between the win rate assessment value and the win rate assessment value corresponding to the user's previous move.
[0037] The product of game entropy and key value of the game is equivalent to combining the complexity of the game and the importance of the situation. Based on this, we can evaluate the value of the target game state information in teaching. Evaluation based on the dimension of teaching value helps to avoid guiding users to learn overly complex but meaningless situations, and thus guides users to learn more complex games with high value and educational significance.
[0038] Therefore, the model to be trained can be updated based on the first loss, second loss, and third loss to obtain the model to be trained in the next training iteration. For example, weights can be assigned to the first loss, second loss, and third loss respectively, and a weighted sum can be performed to obtain the total loss. The model can then be updated based on the total loss if training is not yet complete.
[0039] For example, the total loss can be calculated as follows: Total loss = First loss + Second loss + λ ×Third loss in, λ This is a constant adjustment coefficient. It is adjusted by... λ The value of can control the intensity of the influence of teaching value on model optimization.
[0040] Using the above method, the model to be trained can be iteratively trained based on multiple sets of training samples. If the model's training stoppage condition is not met, the total loss of the model is determined by the loss calculation method described above, and the model is updated for the next training iteration until the model's training stoppage condition is met. Optionally, the model's training stoppage condition can be set according to actual needs, such as reaching a preset number of training iterations, reaching a preset training duration, or the total loss being less than a preset loss. This disclosure does not impose strict limitations, and any feasible model training stoppage condition falls within the protection scope of this disclosure.
[0041] In step 13, the game entropy used to characterize the complexity of the current game is determined based on the move probability distribution information.
[0042] In step 14, key values for characterizing the degree of change in the game are determined based on the win rate assessment value.
[0043] The method for calculating game entropy has been explained in the previous text and will not be repeated here.
[0044] In one possible implementation, step 14 may include the following steps: Obtain the win rate assessment value corresponding to the previous game in the current game, and use it as a win rate reference value; The key values of the game are determined by the difference between the win rate assessment value and the win rate reference value corresponding to the target game state information.
[0045] The win rate assessment value corresponding to the previous game in the current game can be the win rate assessment value obtained by inputting the game state information of the previous game into the teaching model.
[0046] Based on the win rate reference value, the difference between the win rate assessment value corresponding to the target game state information and the win rate reference value can be determined as the key value of the game. The difference can be positive, negative or zero.
[0047] In step 15, the teaching value score is determined based on the game entropy and the key values of the game.
[0048] In one possible implementation, the teaching value score can be set as a function, and the dependent variable value of the function is negatively correlated with the product of the game entropy and the key value of the game.
[0049] Under a setting where the pedagogical value score is negatively correlated with the product of game entropy and key value, in situations with high game entropy (i.e., many variations in the game) and low, negative key value (i.e., the player is at a disadvantage), the pedagogical value derived from the product of game entropy and key value will result in a situation with low pedagogical value. This means that although the situation is complex, it may not be a particularly good teaching example. Conversely, if the game entropy is high and the key value is large and positive (i.e., the player is at an advantage), the pedagogical value derived from the product of game entropy and key value will result in a situation with high pedagogical value. This means that the situation is both complex and meaningful for learning, making it a more worthy focus and application in teaching.
[0050] For example, teaching value rating L mv It can be determined in the following ways: Lmv =
[0051] in, For the first t The game entropy of the step, For the first t The key value of a move in a game.
[0052] In another possible implementation, the method provided in this disclosure may further include the following steps: Based on the target game state information, determine the game matching value between the current game and the reference game.
[0053] The reference game can be a game from historical games that is associated with a specified game result. The specified game result can be the player's own defeat; thus, the reference game is the board layout from historical games that led to the user's defeat. Optionally, historical games can be obtained from a public database, or they can be obtained based on games generated during the self-play process described above.
[0054] Optionally, based on historical chess games, a feature vector corresponding to each historical chess game can be extracted using a feature extraction model. Then, a clustering algorithm is used to cluster these feature vectors, with each cluster forming a reference chess game. Reference chess games are essentially typical chess games from historical games that are likely to lead to a loss. Based on this, multiple reference chess games can be identified, and the feature vector of each reference chess game can also be determined, allowing for the association and storage of the two.
[0055] In one possible implementation, determining the match value between the current game state and the reference game state based on the target game state information may include the following steps: Based on the target game state information, determine the target feature vector corresponding to the current game state; Obtain the reference feature vectors corresponding to each of the multiple stored reference chess positions; Determine the similarity between the target feature vector and each reference feature vector; The maximum value in the similarity score is determined as the game matching value.
[0056] Optionally, the target chess game state information can be input into the feature extraction model described above to obtain the target feature vector.
[0057] Based on the target feature vector, its similarity can be calculated with the reference feature vector of each reference game, and the game matching value can be determined based on the similarity. For example, the highest similarity can be determined as the game matching value. Alternatively, a preset number of similarities with higher similarity can be selected (e.g., sorted from highest to lowest similarity and taking the top preset number, or selecting similarities above a similarity threshold), and the game matching value can be obtained by calculating the average, median, etc. For example, the similarity between the target feature vector and the reference feature vector can be determined using cosine similarity.
[0058] In this implementation, the teaching value score can be determined in the following way: The teaching value score is obtained by weighted summation of game entropy, key value of the game, and matching value of the game.
[0059] Therefore, the teaching value score can be determined by comprehensively considering factors such as the complexity of the game, whether the player has an advantage, and whether it is similar to a game that is likely to lead to defeat, so as to determine whether teaching is necessary for the user.
[0060] This approach introduces game entropy and key values of the game, and sets up a teaching value score to quantify the learnability of the game, eliminating the need for any manual annotation and improving teaching efficiency.
[0061] In step 16, if the teaching value score is greater than a preset threshold, a teaching operation is performed for the user.
[0062] The teaching value score can reflect the teaching value of the current game. When the teaching value score is high, it means that the current game has learning significance. When the teaching value score is low, it means that the current game is not suitable for teaching or there is no need to teach it.
[0063] Therefore, if the teaching value score is greater than the preset threshold, teaching can be conducted on the user, that is, teaching operations can be performed on the user.
[0064] In one possible implementation, if the teaching value score is greater than a preset threshold, the method provided in this disclosure may further include the following steps: Based on the probability distribution information of the routes, at least one recommended route is determined; Performing instructional actions for users may include at least one of the following: Based on the recommended move, determine the target area in the chessboard area that corresponds to the recommended move, and display the identification information in the target area; Determine the target win rate assessment value corresponding to the recommended move, and display the recommended move and the target win rate assessment value.
[0065] Optionally, based on the probability distribution information of the routes, at least one route with the highest probability can be selected as the recommended route.
[0066] Next, based on the recommended move, the target area corresponding to the recommended move on the chessboard can be determined, and a marker can be displayed in the target area to visually guide the user and inform them of the importance of the area, facilitating learning. For example, the position where the piece is about to be placed can be determined based on the recommended move, and the target area can be determined based on that position. For instance, the position where the piece is about to be placed can be defined as the target area, or the position where the piece is about to be placed and its surrounding preset range can be defined as the target area.
[0067] Furthermore, for each recommended move, the piece layout after playing according to the recommended move can be determined, resulting in new game state information (hereinafter referred to as simulated game state information). This new game state information is then input into the teaching model to obtain the win rate evaluation value output by the teaching model, which serves as the target win rate evaluation value.
[0068] Based on this, each recommended move and its corresponding target win rate evaluation value will be output for users to view and refer to.
[0069] Optionally, supplementary explanatory information can be generated based on the recommended move and its corresponding target win rate assessment value to help users better understand the move. For example, for each recommended move, the recommended move, its corresponding simulated game state information, and the target win rate assessment value can be input into a large language model. Prompt words can be set to allow the large language model to generate explanatory information, which, along with the recommended move and the target win rate assessment value, can then be output to the user for faster comprehension.
[0070] The above technical solution acquires target game state information to characterize the current piece layout in a user's game. This target game state information is input into a teaching model to obtain move probability distribution information and win rate evaluation values. Based on the move probability distribution information, a game entropy is determined to characterize the complexity of the current game. Based on the win rate evaluation value, a key game value is determined to characterize the degree of change in the game. Based on the game entropy and key game value, a teaching value score is determined. If the teaching value score is greater than a preset threshold, a teaching operation is executed for the user. Thus, the teaching model can analyze the current game state, determine its move probability distribution and win rate evaluation value, and then use dynamic indicators such as game entropy and key game value to evaluate the complexity and degree of change of the game in real time, further calculating a teaching value score to achieve personalized teaching for the user. This allows for a comprehensive and in-depth analysis of the game during the user's game, and provides teaching to the user at appropriate times based on the analysis results, achieving intelligent guidance and improving the user's learning efficiency.
[0071] Figure 2 This is a block diagram of a chess teaching device provided according to one embodiment of the present disclosure. For example... Figure 2 As shown, the apparatus 20 provided in this disclosure may include: The first acquisition module 21 is used to acquire target chess state information that represents the chess piece layout in the user's current chess game; The first processing module 22 is used to input the target chess game state information into the teaching model to obtain the move probability distribution information and the win rate evaluation value. The move probability distribution information includes the probability corresponding to each of the various moves. The first determining module 23 is used to determine the game entropy, which characterizes the complexity of the current game, based on the move probability distribution information. The second determining module 24 is used to determine key values of the game that characterize the degree of change in the game based on the win rate evaluation value. The third determining module 25 is used to determine the teaching value score based on the game entropy and the key values of the game. Teaching module 26 is used to perform teaching operations for the user if the teaching value score is greater than a preset threshold.
[0072] Optionally, the device 20 further includes: The fourth determining module is used to determine the matching value between the current game and the reference game based on the target game state information. The reference game is a game in the history that is associated with the specified game result. The third determining module 25 includes: The calculation submodule is used to perform a weighted summation of the game entropy, the key value of the game, and the matching value of the game to obtain the teaching value score.
[0073] Optionally, the fourth determining module includes: The first determining submodule is used to determine the target feature vector corresponding to the current chess game based on the target chess game state information; The first acquisition submodule is used to acquire the reference feature vectors corresponding to each of the multiple stored reference chess positions; The second determining submodule is used to determine the similarity between the target feature vector and each of the reference feature vectors respectively; The third determining submodule is used to determine the maximum value in the similarity as the game matching value.
[0074] Optionally, the second determining module 24 includes: The second acquisition submodule is used to acquire the win rate evaluation value corresponding to the previous game of the current game, as a win rate reference value; The fourth determination submodule is used to determine the key value of the game based on the difference between the win rate evaluation value corresponding to the target game state information and the win rate reference value.
[0075] Optionally, the teaching model is generated through the following modules: The second acquisition module is used to acquire multiple sets of training samples, each set of training samples including chess state information samples, move probability information samples and game result labels; The training module is used to train the model to be trained based on the training samples to obtain the teaching model; wherein, in each training iteration: The second processing module is used to input the chess game state information sample into the training model to be trained in this training, and obtain the predicted move probability distribution information and predicted win rate evaluation value output by the training model to be trained in this training. The fifth determining module is used to determine the first loss based on the predicted path probability distribution information and the path probability information sample; The sixth determining module is used to determine the second loss based on the predicted win rate evaluation value and the game result label; The seventh determining module is used to determine the training game entropy based on the predicted move probability distribution information, and to determine the training game key value based on the predicted win rate evaluation value. The eighth determining module is used to determine a third loss based on the training game entropy and the training game key value. The third loss is negatively correlated with the target product, which is the product of the training game entropy and the training game key value. The third processing module is used to update the model to be trained based on the first loss, the second loss, and the third loss to obtain the model to be trained for the next training session.
[0076] Optionally, the second acquisition module includes: A generation submodule is used to play a game using the model to be trained and generate at least one complete game. The processing submodule is used to, during the game, for each move: The current piece layout is recorded as a game state information sample; the game state information sample is input into the model to be trained to obtain the initial move probability distribution information output by the model to be trained; the initial move probability distribution information is processed using a preset strategy improvement algorithm to obtain the move probability information sample; at the end of a complete game, the game result is recorded as the game result label.
[0077] Optionally, the device 20 further includes: The ninth determining module is used to determine at least one recommended route based on the route probability distribution information if the teaching value score is greater than a preset threshold. The teaching module 26 is used to: determine the target area corresponding to the recommended move in the chessboard area, and display the identification information in the target area; determine the target win rate evaluation value corresponding to the recommended move, and display the recommended move and the target win rate evaluation value.
[0078] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0079] Figure 3 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. Figure 3 As shown, the electronic device 700 may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.
[0080] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in the chess teaching method described above. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. I / O interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof; therefore, the corresponding communication component 705 may include a Wi-Fi module, a Bluetooth module, or an NFC module.
[0081] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the chess teaching method described above.
[0082] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the chess teaching method described above. For example, the computer-readable storage medium may be the memory 702 including program instructions described above, which may be executed by the processor 701 of the electronic device 700 to complete the chess teaching method described above.
[0083] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the chess teaching method described above.
[0084] Figure 4 This is a block diagram illustrating an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. (Refer to...) Figure 4 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor 1922 may be configured to execute the computer program to perform the chess teaching method described above.
[0085] Additionally, the electronic device 1900 may also include a power supply component 1926 and a communication component 1950. The power supply component 1926 can be configured to perform power management of the electronic device 1900, and the communication component 1950 can be configured to enable communication of the electronic device 1900, such as wired or wireless communication. Furthermore, the electronic device 1900 may also include an input / output (I / O) interface 1958. The electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM etc.
[0086] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the chess teaching method described above. For example, the computer-readable storage medium may be the memory 1932 including the program instructions described above, which may be executed by the processor 1922 of the electronic device 1900 to complete the chess teaching method described above.
[0087] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the chess teaching method described above.
[0088] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.
[0089] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.
[0090] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.
Claims
1. A chess teaching method, characterized in that, The method includes: Obtain target game state information that represents the current chess piece layout in the user's game; The target game state information is input into the teaching model to obtain the move probability distribution information and the win rate evaluation value. The move probability distribution information includes the probability corresponding to each of the various moves. Based on the probability distribution information of the moves, determine the game entropy used to characterize the complexity of the current game situation; Based on the win rate assessment value, determine the key values of the game to characterize the degree of change in the game; The teaching value score is determined based on the game entropy and the key values of the game. If the teaching value score is greater than a preset threshold, a teaching operation will be performed for the user.
2. The method according to claim 1, characterized in that, The method further includes: Based on the target game state information, determine the game matching value between the current game and the reference game, wherein the reference game is a game in the history that is associated with the specified game result. The process of determining the teaching value score based on the game entropy and the key values of the game includes: The teaching value score is obtained by weighted summation of the game entropy, the key value of the game, and the matching value of the game.
3. The method according to claim 2, characterized in that, The step of determining the matching value between the current game state and the reference game state based on the target game state information includes: Based on the target chess game state information, determine the target feature vector corresponding to the current chess game; Obtain the reference feature vectors corresponding to each of the multiple stored reference chess positions; The similarity between the target feature vector and each of the reference feature vectors is determined respectively; The maximum value in the similarity score is determined as the game matching value.
4. The method according to claim 1, characterized in that, The step of determining key game values to characterize the degree of change in the game based on the win rate assessment value includes: Obtain the win rate assessment value corresponding to the previous game in the current game, and use it as a win rate reference value; The key value of the game is determined based on the difference between the win rate assessment value corresponding to the target game state information and the win rate reference value.
5. The method according to claim 1, characterized in that, The teaching model is generated in the following way: Multiple sets of training samples are obtained, each set of training samples including game state information samples, move probability information samples and game result labels; The training model is trained based on the training samples to obtain the teaching model; wherein, in each training iteration: The chess game state information sample is input into the training model to be trained in this training to obtain the predicted move probability distribution information and predicted win rate evaluation value output by the training model to be trained in this training. Based on the predicted path probability distribution information and the path probability information sample, the first loss is determined; The second loss is determined based on the predicted win rate assessment value and the game result label; The training game entropy is determined based on the predicted move probability distribution information, and the training game key value is determined based on the predicted win rate evaluation value. A third loss is determined based on the training game entropy and the training game key value. The third loss is negatively correlated with the target product, which is the product of the training game entropy and the training game key value. The model to be trained is updated based on the first loss, the second loss, and the third loss to obtain the model to be trained for the next training session.
6. The method according to claim 5, characterized in that, The acquisition of multiple sets of training samples includes: The model to be trained is used to play a game, generating at least one complete game; wherein, during the game, for each move, the following operations are performed: Record the current piece layout as a sample of the game state information; The chess game state information sample is input into the model to be trained to obtain the initial move probability distribution information output by the model to be trained; The initial movement probability distribution information is processed using a preset strategy improvement algorithm to obtain the movement probability information sample; At the end of a complete game of chess, the result of the game is recorded as the game result label.
7. The method according to claim 1, characterized in that, If the teaching value score is greater than a preset threshold, the method further includes: Based on the probability distribution information of the travel paths, at least one recommended travel path is determined; The execution of the teaching operation for the user includes at least one of the following: Based on the recommended move, determine the target area corresponding to the recommended move in the chessboard area, and display the identification information in the target area; Determine the target win rate assessment value corresponding to the recommended move, and display the recommended move and the target win rate assessment value.
8. A chess teaching device, characterized in that, The device includes: The first acquisition module is used to acquire target chess state information that represents the chess piece layout in the user's current chess game; The first processing module is used to input the target chess game state information into the teaching model to obtain the move probability distribution information and the win rate evaluation value. The move probability distribution information includes the probability corresponding to each of the various moves. The first determining module is used to determine the game entropy, which characterizes the complexity of the current game, based on the move probability distribution information. The second determining module is used to determine key values of the game that characterize the degree of change in the game based on the win rate evaluation value. The third determining module is used to determine the teaching value score based on the game entropy and the key values of the game. The teaching module is used to perform teaching operations for the user if the teaching value score is greater than a preset threshold.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.
10. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-7.