A chess killing method, device and storage medium
By identifying the information and rules of a chess game, the target checkmate method in a decisive situation can be determined, solving the problem of accuracy in identifying checkmate methods in chess and improving the fun and teaching effectiveness of chess.
Patent Information
- Application Number
- CN202211021941.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2042-08-24
AI Technical Summary
The lack of accurate chess checkmate identification schemes in existing technologies results in lower enjoyment of chess games and hinders the dissemination of chess and the batch identification of checkmates in chess records.
By determining the game information of the game to be identified, the checkmate situation is identified, and the target checkmate method is matched in the preset checkmate method set according to priority. The game information and rules are used to judge the position and layout of the pieces and identify the target checkmate method of the checkmate situation.
It enhances the fun and accuracy of chess games, enabling quick identification of checkmate strategies in decisive situations, thus facilitating the promotion and teaching of chess.
Smart Images

Figure CN115463406B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of artificial intelligence, and more particularly, embodiments of the present application relate to a chess killing method, device and storage medium. BACKGROUND
[0002] This section is intended to provide background information to facilitate a better understanding of embodiments of the application recited in the claims. The description herein does not constitute admission of prior art.
[0003] In the field of chess recognition, the interest of playing chess is increased through automatic recognition of chess pieces.
[0004] In the prior art, some ways of recognizing go killing have appeared, but there is no relatively accurate scheme for recognizing chess killing, and the type of killing triggered by the user when the killing is recognized cannot be recognized. In this way, it is not conducive to the spread of chess, nor is it conducive to the batch recognition of the situation triggering a certain killing in the chess record. SUMMARY
[0005] However, there is no scheme for recognizing chess killing in the prior art, which makes the interest of playing chess relatively low.
[0006] Therefore, it is very necessary to provide a chess killing recognition method to automatically recognize chess killing in the process of playing chess, which is conducive to the spread of chess and can improve the interest of playing chess. It can also enable the initial user to continuously improve the chess skill in the process of learning various chess killing.
[0007] In this context, embodiments of the present application aim to provide a chess killing recognition method.
[0008] In a first aspect of the embodiments of the present application, a chess killing recognition method is provided, comprising:
[0009] determining the playing information of the to-be-recognized chess game;
[0010] based on the playing information, identifying the killing situation of the situation of the to-be-recognized chess game;
[0011] in response to identifying the killing situation, determining a target killing method matching the killing situation in a preset killing method set based on the playing information and the playing rules of the to-be-recognized chess game.
[0012] In an embodiment of the present application, the determination of the playing information of the to-be-recognized chess game comprises: obtaining a first chess piece set of the to-be-recognized chess game; determining a first position of a first chess piece in the first chess piece set in the to-be-recognized chess game; and determining the playing information based on the first position and the first chess piece set.
[0013] Thus, by binding the chess pieces in the to-be-identified chess game and the positions of the chess pieces in the chess game, the game information of the to-be-identified chess game is obtained, so that the type and the coordinates of each first chess piece in the to-be-identified chess game can be reflected in the game information, and the subsequent determination of whether the to-be-identified chess game enters the checkmate situation can be facilitated.
[0014] In another embodiment of the present application, in response to the identification of the checkmate situation, the target killing method matching the checkmate situation is determined from the preset killing method set based on the game information and the game rule of the to-be-identified chess game, including: in response to the identification of the checkmate situation, the priority order between different preset killing methods in the preset killing method set is determined; and based on the game information and the game rule, the target killing method matching the checkmate situation is determined from the preset killing method set according to the priority order.
[0015] Thus, by determining the priority order between different preset killing methods in the preset killing method set and matching the target killing method for the checkmate situation according to the priority order, the target killing method for the checkmate situation can be quickly matched, and the accuracy of determining the target killing method for the checkmate situation can be improved.
[0016] In yet another embodiment of the present application, the target killing method matching the checkmate situation is determined from the preset killing method set according to the priority order based on the game information and the game rule, including: based on the priority order, the current preset killing method corresponding to the current priority is determined; based on the game information and the game rule, it is determined whether the current preset killing method matches the checkmate situation; in response to the current preset killing method not matching the checkmate situation, the next priority of the current priority is determined based on the priority order; wherein the next priority is lower than the current priority; based on the game information and the game rule, it is determined whether the preset killing method corresponding to the next priority matches the checkmate situation; and in response to the preset killing method corresponding to the next priority matching the checkmate situation, the preset killing method corresponding to the next priority is determined as the target killing method.
[0017] Thus, by sequentially identifying the target killing method according to the priority order in the preset killing method set from high priority to low priority until the target killing method for the checkmate situation is identified, the redundant identification process can be reduced, the target killing method for the checkmate situation can be quickly matched, and the target killing method for the checkmate situation can be output to the user.
[0018] In a further embodiment of the present application, the priority of the preset killing method set comprises: a first type of priority corresponding to at least one preset killing method arranged in a priority order; in the case where the current priority belongs to the first type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the absolute killing situation comprises: determining, based on the game rule, a second chess piece set matched by the current preset killing method and a first ideal position of the second chess piece set in the current preset killing method; in the absolute killing situation, determining a second position of a second chess piece in the second chess piece set based on the game information; and in the case where the first ideal position and the second position match, determining that the current preset killing method matches the absolute killing situation.
[0019] In this way, for the preset killing method in the first type of priority, whether the current preset killing method matches the absolute killing situation is determined by judging whether the ideal position of the second chess piece in the current preset killing method is the same as the position of the second chess piece in the absolute killing situation, so that a target killing method matched for the absolute killing situation can be output, so that the user can learn the absolute killing method of the game in time.
[0020] In a further embodiment of the present application, the determining, based on the game rule, the second chess piece set matched by the current preset killing method comprises: determining, based on the game rule, a winning side and a losing side in the absolute killing situation; and determining, based on the current preset killing method, a chess piece matched with at least one of the winning side and the losing side to obtain the second chess piece set.
[0021] In this way, by first determining the winning side and the losing side in the absolute killing situation, the chess pieces involved in the current preset killing method can be more accurately analyzed, so that the matching degree of the second chess piece set and the current preset killing method is higher.
[0022] In a further embodiment of the present application, in the case where the current preset killing method is a preset killing method with the highest priority in the first type of priority, the determining, based on the current preset killing method, a chess piece matched with at least one of the winning side and the losing side to obtain the second chess piece set comprises: determining, based on the preset killing method with the highest priority, a first target game round of the winning side of the to-be-identified game; wherein the first target game round is a game round in the to-be-identified game that satisfies a preset first game order; and determining a chess piece of the first target game round in the absolute killing situation to obtain the second chess piece set; and the determining the first ideal position of the second chess piece set in the current preset killing method comprises: determining a center position of a field in the losing side of the to-be-identified game as the first ideal position.
[0023] Thus, for the preset killing method with the highest priority in the preset killing method set, the piece of the winning party in the first target game round is identified as the second piece set, so that the second piece set can be used to more accurately determine whether the preset killing method with the highest priority matches the checkmate situation.
[0024] In another embodiment of the application, the method further comprises: in response to the preset killing method with the lowest priority in the preset killing method set not matching the checkmate situation, determining a checkmate type of the checkmate situation based on the game information and the game rules; and updating the preset killing method set based on the checkmate type to obtain an updated preset killing method set.
[0025] Thus, in the case that the target killing method in the preset killing method set does not match the checkmate situation, the checkmate type is set according to the game information in the checkmate situation, and the preset killing method set is enriched by the checkmate type, so that the preset killing method set can be updated in real time, and more game situations can be provided with target killing methods by the updated preset killing method set.
[0026] In another embodiment of the application, the priority of the preset killing method set comprises: a second type of priority, the second type of priority corresponding to at least one preset killing method arranged in priority order, the second type of priority being lower than the first type of priority.
[0027] In the case that the current priority belongs to the second type of priority, the determination of whether the current preset killing method matches the checkmate situation based on the game information and the game rules comprises: determining a third piece set in the winning party of the checkmate situation that matches the current preset killing method and a first target piece in the losing party of the checkmate situation that matches the current preset killing method based on the game information and the game rules; determining a candidate third piece that can reach a third position of the first target piece in the third piece set; and determining that the current preset killing method matches the checkmate situation in the case that the number of the candidate third pieces is greater than or equal to a preset number threshold.
[0028] Thus, for the current preset killing method of the second type of priority, the number of pieces of the winning party that can reach the first target piece of the losing party is analyzed to accurately determine whether the target killing method of the checkmate situation is the current preset killing method, so that the killing method of the checkmate situation can be output to the user for learning the checkmate situation.
[0029] In another embodiment of the application, the priority of the preset killing method set comprises: a third type of priority, the third type of priority corresponding to at least one preset killing method arranged in priority order, the third type of priority being lower than the second type of priority.
[0030] In a case where the current priority belongs to the third type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the absolute killing situation comprises: determining, based on the game information, a second target game round matched with the current preset killing method, wherein the second target game round is a game round in the to-be-identified chess game that meets a preset second game order; the second game order is different from the first game order; in the absolute killing situation, a fourth position and a chess piece type of a fourth chess piece set of the second target game round are determined; based on the game rule, a second ideal position and an ideal type of the fourth chess piece set in the current preset killing method are determined; in a case where the fourth position matches the second ideal position and the chess piece type matches the ideal type, a first ideal game path of a losing side in the to-be-identified chess game is determined; in a case where the fourth chess piece set limits the first ideal game path, it is determined that the current preset killing method matches the absolute killing situation.
[0031] In this way, for the preset killing method in the third type of priority, whether the target killing method of the absolute killing situation is the preset killing method belonging to the third type of priority can be accurately identified by judging whether the position and the type of the chess piece match the ideal position and the ideal type in the current preset killing method, and further judging whether the ideal game path of the losing side is limited.
[0032] In another embodiment of the application, the priority of the preset killing method set comprises a fourth type of priority, the fourth type of priority corresponds to at least one preset killing method arranged in a priority order, and the fourth type of priority is lower than the third type of priority.
[0033] In a case where the current priority belongs to the fourth type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the absolute killing situation comprises: determining, based on the game information and the game rule, a relative positional relationship between a chess piece matched with the current preset killing method and the winning side and the losing side in the absolute killing situation; and determining that the current preset killing method matches the absolute killing situation in a case where the relative positional relationship meets a preset positional relationship.
[0034] In this way, by analyzing the relative positional relationship between the winning side and the losing side in the absolute killing situation, whether the current preset killing method belonging to the fourth type of priority matches the absolute killing situation can be quickly and accurately determined.
[0035] In another embodiment of the application, the priority of the preset killing method set comprises a fifth type of priority, the fifth type of priority corresponds to at least one preset killing method arranged in a priority order, and the fifth type of priority is lower than the fourth type of priority.
[0036] In a case that the current priority belongs to the fifth type of priority, the determining whether the current preset killing method matches the decisive situation based on the game information and the game rule comprises: determining a second target chess piece in a winning side of the decisive situation and a third target chess piece in a losing side of the decisive situation which match the current preset killing method respectively based on the game rule; determining a fifth position of the second target chess piece in the decisive situation and a sixth position of the third target chess piece in the decisive situation based on the game information; determining a third ideal position of the second target chess piece in the current preset killing method and a fourth ideal position of the third target chess piece in the current preset killing method; determining a second ideal game path of the losing side in a case that the fifth position matches the third ideal position and the sixth position matches the fourth ideal position; and determining that the current preset killing method matches the decisive situation in a case that the second target chess piece or the third target chess piece limits the second ideal game path.
[0037] Thus, for the preset killing method in the fifth type of priority, by judging whether the position of the target chess piece matches the ideal position in the current preset killing method and further judging whether the ideal game path of the losing side is limited, it can be accurately identified whether the target killing method of the decisive situation is the preset killing method belonging to the fifth type of priority.
[0038] In another embodiment of the present application, the priority of the preset killing method set comprises a sixth type of priority, the sixth type of priority corresponds to at least one preset killing method arranged in a priority order, and the sixth type of priority is lower than the fifth type of priority.
[0039] In a case that the current priority belongs to the sixth type of priority, the determining whether the current preset killing method matches the decisive killing situation based on the game information and the game rule includes: determining, based on the game rule, a fourth target chess piece in the losing side of the decisive killing situation that matches the current preset killing method; in a case that the fourth target chess piece is in a first preset chessboard area corresponding to the current preset killing method, determining, based on the game rule, a fifth target chess piece in the winning side of the decisive killing situation that matches the current preset killing method; in a case that the fifth target chess piece is in the first preset chessboard area, determining, based on the game information, a number of chess pieces between the fourth target chess piece and the fifth target chess piece on the first preset chessboard area; in a case that the number of chess pieces is a preset number of chess pieces, determining, based on the game information, whether the fourth target chess piece is in a second preset chessboard area corresponding to the current preset killing method; wherein the second preset chessboard area is different from the first preset chessboard area; and in response to the fourth target chess piece being in the second preset chessboard area, determining that the current preset killing method matches the decisive killing situation.
[0040] In this way, for the preset killing method in the sixth type of priority, by judging whether the position of the target chess piece is between the preset chessboard area and the number of chess pieces between the target chess piece of the losing side and the target chess piece of the winning side, it can be accurately identified whether the target killing method of the decisive killing situation is the preset killing method belonging to the sixth type of priority.
[0041] In another embodiment of the present application, after the target killing method that matches the decisive killing situation is determined from the preset killing method set based on the game information and the game rule of the to-be-identified chess game in response to the identification of the decisive killing situation, the method further includes at least one of the following: displaying the target killing method in a display mode corresponding to a preset application requirement; updating a preset teaching database based on the target killing method and the game information of the to-be-identified chess game; wherein the preset teaching database is used to provide Xiangqi teaching examples; and updating and outputting a chess game ranking list corresponding to the to-be-identified chess game based on the target killing method.
[0042] In this way, the user is provided with multiple interaction modes according to the identified target killing method, so that the user can learn the killing method of Xiangqi and the interest of the user in Xiangqi can be improved.
[0043] In a further embodiment of the present application, the game to be identified comprises Chinese Xiangqi, and the identification of the checkmate situation of the game to be identified based on the game information comprises: identifying a checkmated player of the Chinese Xiangqi based on the game information of the Chinese Xiangqi; in response to identifying the checkmated player, detecting a breaking path of the checkmated player; and in response to failing to detect the breaking path, determining that the Chinese Xiangqi enters the checkmate situation.
[0044] Thus, for the Chinese Xiangqi, by identifying the checkmated player in the game first, it is determined whether the breaking path can be detected, so that in the case where the breaking path is not detected, it is determined that the game of the Chinese Xiangqi enters the checkmate situation, which can accurately and simply analyze whether the game to be identified enters the checkmate situation, and facilitate subsequent identification of the target killing method of the game entering the checkmate situation.
[0045] In a second aspect of the embodiments of the present application, a Xiangqi killing method identification device is provided, comprising:
[0046] A first determination module is configured to determine game information of a game to be identified.
[0047] A first identification module is configured to identify a checkmate situation of the game to be identified based on the game information.
[0048] A second determination module is configured to, in response to identifying the checkmate situation, determine a target killing method matching the checkmate situation from a preset killing method set based on the game information and a game rule of the game to be identified.
[0049] According to the game information of the game to be identified in the embodiments of the present application, the situation of the game to be identified is first identified as a checkmate situation, which can accurately determine whether the game to be identified enters the checkmate situation; when the checkmate situation is identified, a target killing method matching the checkmate situation is determined from a preset killing method set based on the game information and the game to be identified, so that in the case where the game to be identified enters the checkmate situation, the target killing method matching the checkmate situation is identified from the preset killing method set, thereby accurately identifying the target killing method of the checkmate situation of the game to be identified, and further facilitating the promotion of the identified target killing method object chess and providing a better game experience for users. BRIEF DESCRIPTION OF DRAWINGS
[0050] The above and other objects, features and advantages of the exemplary embodiments of the present application will be more apparent from the following detailed description taken in conjunction with the accompanying drawings, in which:
[0051] Figure 1A schematic diagram of an implementation framework of the chess killing method recognition method according to an embodiment of the present application is shown;
[0052] Figure 2 A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0053] Figure 3 A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0054] Figure 4 A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0055] Figure 5A A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0056] Figure 5B A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0057] Figure 5C A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0058] Figure 5D A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0059] Figure 5E A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0060] Figure 5F A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0061] Figure 5G A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0062] Figure 6A A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0063] Figure 6B A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0064] Figure 6C A schematic diagram of an implementation framework of the chess killing method recognition method according to another embodiment of the present application is shown;
[0065] Figure 6D Fig. 2 schematically shows an implementation logic diagram of a chess killing method recognition method according to another embodiment of the present application;
[0066] Figure 6E Fig. 2 schematically shows an implementation logic diagram of a chess killing method recognition method according to another embodiment of the present application;
[0067] Figure 7 Fig. 3 schematically shows a structural composition diagram of a chess killing method recognition device according to an embodiment of the present application;
[0068] Figure 8 Fig. 3 schematically shows a structural composition diagram of a chess killing method recognition device according to an embodiment of the present application.
[0069] In the drawings, the same or corresponding reference numbers represent the same or corresponding parts. DETAILED DESCRIPTION
[0070] The principles and spirits of the present application will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are given only to enable those skilled in the art to better understand and implement the present application, and do not limit the scope of the present application in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art. SUMMARY
[0072] The present inventors found that there is no relatively perfect Chinese chess killing method recognition scheme in the related art that can recognize the killing method triggered by the user when the input (Forsyth-Edwards Notation, FEN) chess position record specification or the FEN score generated by the user in real time can recognize the killing method. In this way, it is not conducive to the teaching of Chinese chess and the dissemination of killing method concepts, and it is also not conducive to batch recognition of the situation triggering a certain killing method in the score.
[0073] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be specifically introduced below.
[0074] OVERVIEW OF APPLICATION SCENARIOS
[0075] Firstly, reference is made to Figure 1 , Figure 1The implementation framework of the chess killing method recognition method according to the embodiment of the present application is schematically shown. The chess killing method recognition device 300 is connected to the game information acquisition device 100 or the server 400 through the network 200. The network 200 can be a wide area network or a local area network, or a combination of the two. The chess killing method recognition device 300 and the game information acquisition device 100 can be physically separate or integrated. The game information acquisition device 100 can send or store the acquired game information to the chess killing method recognition device 300 through the network 200. The chess killing method recognition device 300 determines whether the to-be-recognized chess game enters the killing situation through the game information. After determining that the to-be-recognized chess game enters the killing situation, the target killing method matching the killing situation is further identified in the preset killing method set. Thus, for the to-be-recognized chess game entering the killing situation, the target killing method matching the killing situation is identified, which can improve the intelligence of the chess killing method recognition, facilitate the popularization of chess, and improve the interest of the game chess.
[0076] In some embodiments, Figure 1 The system shown can also have no network 200 and game information acquisition device 100, and only have chess killing method recognition device 300, so that the chess killing method recognition device acquires the game information of the to-be-recognized chess game. In other embodiments, the game information acquisition device 100 and the chess killing method recognition device 300 can be integrated, such as a terminal device with a camera, such as a mobile phone, so that the game information acquisition device 100 and the chess killing method recognition device 300 can be connected through wired transmission rather than network.
[0077] In some embodiments, the server 400 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and big data and artificial intelligence platforms, etc. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present application.
[0078] Exemplary Methods
[0079] The application scenarios of the application are described below in combination with Figure 4 The application scenarios of the application are described below in combination with Figure 2A method for Chinese chess checkmate recognition according to an exemplary embodiment of the present application will be described. It should be noted that the above application scenarios are only shown for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. On the contrary, the embodiments of the present application can be applied to any applicable scenario.
[0080] Figure 2 An implementation flowchart of a Chinese chess checkmate recognition method according to another embodiment of the present application is schematically shown, and the following description is made in combination with Figure 2 The following description is made in combination with the steps shown in
[0081] In step S101, the game information of a to-be-recognized chess game is determined.
[0082] Here, the to-be-recognized chess game can be a chess game of any type and in a game state, can be a chess game being played, and can also be a chess game whose game state is preserved after the game ends. The to-be-recognized chess game can be a chess game being played in real time by two players, and can also be a saved chess score, such as a FEN chess score of the to-be-recognized chess game in a game state. The game information of the to-be-recognized chess game is used to represent the chessboard of the to-be-recognized chess game, and includes the current game state of the to-be-recognized chess game, and can also include the game steps of the to-be-recognized chess game in the entire chess game. In some possible implementation manners, the game information of the to-be-recognized chess game can be obtained by image acquisition of the to-be-recognized chess game or image reception from other devices, and the game information of the to-be-recognized chess game can be obtained by image recognition of the image; or the game information of the to-be-recognized chess game can be obtained by FEN chess score content recognition.
[0083] In step S102, based on the game information, the game state of the to-be-recognized chess game is identified as a checkmate game state.
[0084] Here, the chessboard in the game information can be recognized to obtain the positions of the chess pieces of the two players in the chess game. Thus, the positions of the chess pieces of the two players are used to determine whether the to-be-recognized chess game enters a checkmate game state. In implementation, the game information can be recognized by a neural network to determine whether the to-be-recognized chess game enters a checkmate game state. For example, the chess piece arrangement of the two players in the game information is used to determine whether one of the two players wins and the other player loses, that is, whether the to-be-recognized chess game enters a checkmate game state.
[0085] In some possible implementation manners, taking the to-be-recognized chess game as Chinese chess as an example, whether the to-be-recognized chess game enters a checkmate game state can be determined by the following process:
[0086] First, based on the game information of the Chinese chess, the player of the two players of the Chinese chess who is under attack is identified.
[0087] Here, according to the game information of the Chinese chess, the game party being checkmated and the game party checkmating are determined; the game party being checkmated is not necessarily the losing party, and if a breaking path is detected subsequently, it means that the game party being checkmated can break the game of the game party checkmating and may become the winning party.
[0088] Then, in response to identifying the game party being checkmated, a breaking path of the game party being checkmated is detected.
[0089] Here, if the game party being checkmated is identified, a breaking path of the game party being checkmated is further detected in the game. If the game party being checkmated is not identified, it means that the game has not entered the checkmate situation; and the step returns to the previous step to continue to acquire the game information of the game.
[0090] Finally, in response to not detecting the breaking path, it is determined that the Chinese chess enters the checkmate situation.
[0091] Here, if the breaking path is not detected, it means that the game party being checkmated cannot break the chess step of the game party checkmating, so it can be determined that the Chinese chess enters the checkmate situation. If the breaking path is detected, it means that the game party being checkmated can break the chess step of the game party checkmating, so it can be determined that the Chinese chess does not enter the checkmate situation; and the step returns to the previous step to continue to acquire the game information of the game. In this way, for the Chinese chess, by identifying the game party being checkmated first and then judging whether the breaking path can be detected, it is determined that the game enters the checkmate situation when the breaking path is not detected, which can accurately and simply analyze whether the game to be identified enters the checkmate situation, and facilitate subsequent identification of the target kill method of the game entering the checkmate situation.
[0092] Step S103, in response to identifying the checkmate situation, determining a target kill method matching the checkmate situation from a preset kill method set based on the game information and the game rules of the game to be identified.
[0093] Here, if it is identified that the to-be-identified chess game enters a checkmate situation or is about to enter a checkmate situation, according to the rules of the game, by analyzing the layout of the chess pieces of the two players in the game information, a specific target killing method of the to-be-identified chess game can be determined in a preset killing method set. The preset killing method set includes multiple types of killing methods of the to-be-identified chess game. The preset killing method can be a preset killing method type, or can be set based on the current situation of the to-be-identified chess game. For example, according to the current situation of the to-be-identified chess game, if the killing method of the current situation is not included in the preset killing method set, the killing method of the current situation can be set as a new killing method, and saved in the preset killing method set to update the preset killing method set. The target killing method matched with the checkmate situation is the killing method type of the winning side in the two players in the checkmate situation. The rules of the game of the to-be-identified chess game are the types of the chess pieces of the to-be-identified chess game, and the rules of the game when the two players play the game. In a specific example, taking the to-be-identified chess game as Chinese chess as an example, the preset killing method set can include: a big knife heart killing method, a side tiger killing method, a fishing horse killing method, a double general killing method, a heavy cannon killing method, a double car killing method, a smothered palace killing method, a horse behind the cannon killing method, a face-to-face smile killing method, a hanging corner horse killing method, a lying slot horse killing method, and an iron door bolt killing method.
[0094] In the embodiments of the present application, by obtaining the game information of the to-be-identified chess game, first, the situation of the to-be-identified chess game is identified as a checkmate situation; in this way, it can be accurately determined whether the to-be-identified chess game enters a checkmate situation; when the checkmate situation is identified, based on the game information and the game of the to-be-identified chess game, a target killing method matched with the checkmate situation is determined in a preset killing method set; in this way, in the case that the to-be-identified chess game enters a checkmate situation, the target killing method matched with the checkmate situation is identified from the preset killing method set, so that the target killing method of the checkmate situation of the to-be-identified chess game can be accurately identified, and further, the identified target killing method object chess is promoted, thereby providing a better game experience for the user.
[0095] In some embodiments, the game information of the to-be-identified chess game is obtained by identifying the positions of the chess pieces in the to-be-identified chess game, that is, the above step S101 can be implemented by the following steps S111 and S113 (not shown in the figure):
[0096] Step S111, obtaining a first chess piece set of the to-be-identified chess game.
[0097] Here, the first chess piece set includes the chess pieces of the two players in the current situation of the to-be-identified chess game, and can also include the chess pieces of the two players in the current situation of the to-be-identified chess game. Taking the to-be-identified chess game as Chinese chess as an example, the first chess piece set can include: the horses, generals, elephants, cars, elephants, soldiers, cannons, and so on of the two players.
[0098] Step S112, determine the first position of the first chess piece in the first chess piece set in the to-be-recognized chess game.
[0099] Here, for each first chess piece in the obtained first chess piece set, the position of the chess piece in the to-be-recognized chess game is recognized. Taking the to-be-recognized chess game as Chinese chess as an example, the positions of the first chess piece in the first chess piece set in the horizontal and vertical lines of the chess game are recognized. In some possible implementation manners, the number of the chessboard square in the FEN chess notation can be obtained by converting the coordinates of the first chess piece in the to-be-recognized chess game into the number of the chessboard square in the FEN chess notation, and the number is taken as the first position.
[0100] Step S113, determine the playing information based on the first position and the first chess piece set.
[0101] Here, the first chess piece in the first chess piece set is bound with the first position of the first chess piece, and the playing information is obtained; in this way, the type of each first chess piece and the position of the chess piece in the chess game can be included in the playing information. For example, the playing information includes a horse and the position of the horse in the chess game.
[0102] The above steps S111 and S113 bind the chess pieces in the to-be-recognized chess game and the positions of the chess pieces in the chess game, to obtain the playing information of the to-be-recognized chess game, so that the type of each first chess piece and the coordinates in the to-be-recognized chess game can be reflected in the playing information, which facilitates subsequent judgment of whether the to-be-recognized chess game enters a checkmate situation through the playing information.
[0103] In some embodiments, in the case that the to-be-recognized chess game enters a checkmate situation, a target checkmate method of the checkmate situation is recognized according to the priority order between different checkmate methods in the preset checkmate method set, that is, the above step S103 can be implemented through the following steps S131 and S132 (not shown in the figure):
[0104] Step S131, in response to recognizing the checkmate situation, determine the priority order between different preset checkmate methods in the preset checkmate method set.
[0105] Here, if the checkmate situation is recognized, the priority order between the preset checkmate methods in the preset checkmate method set is obtained. The priority order is used to represent the order of different preset checkmate methods in the preset checkmate method set when the target checkmate method is recognized. For example, taking the to-be-recognized chess game as Chinese chess as an example, the priority order is: big knife heart-removing checkmate method, side tiger checkmate method, fishing horse checkmate method, double general checkmate method, heavy cannon checkmate method, double car checkmate method, smothered palace checkmate method, horse behind cannon checkmate method, opposite face smile checkmate method, hanging corner horse checkmate method, lying slot horse checkmate method, and iron door bolt checkmate method. In this way, when the target checkmate method of the checkmate situation is recognized, the target checkmate method in the preset checkmate method set is recognized according to the priority order.
[0106] Step S132, determining, based on the game information and the game rule, a target kill method in the preset kill method set matching the absolute kill situation according to the priority order.
[0107] Here, for each preset kill method, according to the game rule, the piece layout of the game parties under the preset kill method can be obtained, i.e. the piece position of the game parties under the preset kill method. According to the priority order, firstly, the piece layout corresponding to the preset kill method with the highest priority is determined, and the piece layout of the game parties in the to-be-identified game can be obtained through the game information of the to-be-identified game. In this way, the piece layout of the to-be-identified game and the piece layout of the game parties under the preset kill method are compared, and if the two piece layouts are the same, it can be determined that the preset kill method is the target kill method of the to-be-identified game. If the preset kill method with the highest priority is the target kill method, the identification process is stopped. If the preset kill method with the highest priority is not the target kill method, it is continued to identify whether the preset kill method with the second highest priority matches the absolute kill situation, and so on, until the target kill method is identified in the preset kill method set, and the identification is stopped. If the target kill method is not identified in the preset kill method set, a new kill method can be set according to the game information of the absolute kill situation, and the new kill method is saved in the preset kill method set. In this way, by determining the priority order of different preset kill methods in the preset kill method set and matching the target kill method for the absolute kill situation according to the priority order, the target kill method for the absolute kill situation can be quickly matched, and the accuracy of determining the target kill method for the absolute kill situation can be improved.
[0108] In some embodiments, the identification of the target kill method is performed from high priority to low priority according to the priority order of different kill methods in the preset kill method set, i.e. the above step S132 can be implemented by the steps shown in FIG. 2: Figure 3
[0109] Step S201, determining, based on the priority order, a current preset kill method corresponding to a current priority.
[0110] Here, according to the priority order, the current priority during the identification of the target kill method is determined first, i.e. the current priority is obtained. For example, after the identification of the preset kill methods with the first two priorities is completed, neither of them matches the absolute kill situation, then it is continued to identify whether the preset kill method with the third highest priority matches the absolute kill situation, and the third highest priority is the current priority, and the preset kill method corresponding to the third highest priority is the current preset kill method corresponding to the current priority.
[0111] Step S202, determining, based on the game information and the game rule, whether the current preset kill method matches the absolute kill situation.
[0112] Here, the ideal chess move of the two players in the preset killing method can be determined according to the game rule; and the chess move of the two players in the killing situation can be obtained according to the game information. The preset killing method corresponding to the next priority can be determined according to the ideal chess move of the two players and the chess move in the killing situation.
[0113] In step S203, in response to the preset killing method not matching the killing situation, a next priority of the current priority is determined according to the priority order.
[0114] Here, the next priority is lower than the current priority, that is, the next priority is a priority lower than the current priority. For example, the current priority is the highest priority, and the next priority is the second highest priority.
[0115] In step S204, whether the preset killing method corresponding to the next priority matches the killing situation is determined according to the game information and the game rule.
[0116] Here, the ideal chess move of the two players in the preset killing method corresponding to the next priority can be determined according to the game rule; and the chess move of the two players in the killing situation can be obtained according to the game information. The preset killing method corresponding to the next priority can be determined according to the ideal chess move of the two players and the chess move in the killing situation.
[0117] In step S205, in response to the preset killing method corresponding to the next priority matching the killing situation, the preset killing method corresponding to the next priority is determined as the target killing method.
[0118] Here, if the ideal chess move in the preset killing method corresponding to the next priority is the same as the chess move in the killing situation, the preset killing method corresponding to the next priority is determined as the target killing method.
[0119] In the embodiment of the present application, the target killing method is identified according to the priority order in the preset killing method set from high priority to low priority until the target killing method of the killing situation is identified, so that the redundant identification process can be reduced, the target killing method of the killing situation can be quickly matched, and the target killing method of the killing situation can be output for the user.
[0120] In some embodiments, the priority of the preset killing method set includes multiple types of priorities, wherein each type of priority corresponds to at least one preset killing method arranged according to the priority order. In the case where the current priority belongs to the first type of priority, the above step S202 can be implemented by the following steps S221 to S223 (not shown in the figure):
[0121] Step S221, determining a second chess piece set matched with the current preset killing method and a first ideal position of the second chess piece set in the current preset killing method based on the playing rule.
[0122] Here, the second chess piece set matched with the current preset killing method refers to the chess pieces involved in the current preset killing method under the playing rule. Taking the chess game of Chinese chess as an example, the current preset killing method is the killing method of big knife and heart, and the chess pieces involved in the killing method are the chess piece at the center of the field, and the pawn or the car. Therefore, the chess piece at the center of the field, the pawn or the car is the second chess piece set. The first ideal position of the second chess piece set in the current preset killing method refers to the position of the second chess piece set in the chess game in the current preset killing method. For example, the first ideal position of the pawn or the car is the center position of the field of the losing party in the current preset killing method of big knife and heart.
[0123] Step S222, determining a second position of a second chess piece in the second chess piece set based on the playing information in the killing situation.
[0124] Here, in the killing situation, the second position of the second chess piece in the killing situation can be determined based on the obtained playing information.
[0125] Step S223, determining that the current preset killing method matches the killing situation when the first ideal position matches the second position.
[0126] Here, if the first ideal position and the second position are the same, it means that the first ideal position and the second position match, i.e. the current preset killing method matches the killing situation, and then it is determined that the current preset killing method is the target killing method of the killing situation, and the identification of other preset killing methods is stopped. In this way, for the preset killing method in the first priority, it is determined whether the current preset killing method has a killing situation match by judging whether the ideal position of the second chess piece in the current preset killing method is the same as the position of the second chess piece in the killing situation, so as to output the matched target killing method for the killing situation, so that the user can timely understand the killing method of the chess game.
[0127] In some embodiments, the winning party and the losing party in the killing situation are analyzed first, and then the second chess piece set is more accurately determined, i.e. the step S221 of determining the second chess piece set matched with the current preset killing method based on the playing rule can be realized by the following steps:
[0128] First, determine the winning party and the losing party in the killing situation based on the playing rule.
[0129] Here, the winning side and the losing side in the checkmate situation can be accurately identified according to the game rule of the to-be-identified chess game; that is, the losing side and the winning side in the checkmate situation can be determined when it is identified that the to-be-identified chess game enters the checkmate situation.
[0130] In the second step, based on the current preset killing method, a chess piece matching at least one of the winning side and the losing side is determined to obtain the second chess piece set.
[0131] Here, according to the game rule of the to-be-identified chess game, the chess piece of the losing side and the chess piece of the winning side involved in the current preset killing method can be determined; in this way, the second chess piece set includes not only the second chess pieces but also the sides to which the second chess pieces belong, that is, whether the second chess pieces belong to the losing side or the winning side. In this way, by determining the winning side and the losing side in the checkmate situation, the chess pieces involved in the current preset killing method can be more accurately analyzed, and the matching degree of the second chess piece set and the current preset killing method is higher.
[0132] In some possible implementation manners, in a case where the current preset killing method is a preset killing method with the highest priority in the first type of priority, the second chess piece set can be determined through the following process:
[0133] First, based on the preset killing method with the highest priority, a first target game round of the winning side of the to-be-identified chess game is determined.
[0134] Here, the first target game round is a game round of the to-be-identified chess game that satisfies a preset first game order. The preset first game order can be set according to the type of the preset killing method; for example, in a case where the preset killing method is a big-knife heart-piercing killing method, the preset first game order can be the third-to-last hand of the to-be-identified chess game, that is, the second-to-last hand of the winning side. If the current preset killing method is a preset killing method with the highest priority in the first type of priority, it indicates that the current preset killing method is a preset killing method with the highest priority in the preset killing method set.
[0135] Then, a chess piece of the first target game round in the checkmate situation is determined to obtain the second chess piece set.
[0136] Here, in the checkmate situation, the chess piece involved in the first target game round is identified, that is, the second chess piece set. For example, in a case where the preset killing method is a big-knife heart-piercing killing method, the chess piece in the second-to-last hand of the winning side is identified, that is, the second chess piece.
[0137] Finally, a center position of a field of the losing side of the to-be-identified chess game is determined as the first ideal position.
[0138] Here, in the case that the current preset killing method is the preset killing method with the highest priority in the first type of priority, the center position of the grid of the losing party of the chess game to be identified is taken as the first ideal position. In this way, for the preset killing method with the highest priority in the preset killing method set, the chess pieces of the winning party in the first target game round are identified as the second chess piece set, so that whether the preset killing method with the highest priority matches the checkmate situation can be more accurately judged through the second chess piece set.
[0139] In some embodiments, if no target killing method matching the checkmate situation is identified in the preset killing method set, a new target killing method is set through the checkmate situation, and the preset killing method set is updated synchronously, which can be realized by the following process:
[0140] Firstly, in response to the preset killing method with the lowest priority in the preset killing method set not matching the checkmate situation, the checkmate type of the checkmate situation is determined based on the game information and the game rules.
[0141] Here, if the preset killing method with the lowest priority in the preset killing method set does not match the checkmate situation, it means that all preset killing methods in the preset killing method set are not the target killing method of the checkmate situation. According to the game information in the checkmate situation and the game rules of the chess game, the checkmate type of the checkmate situation is reset.
[0142] Secondly, the preset killing method set is updated based on the checkmate type to obtain an updated preset killing method set.
[0143] Here, the reset checkmate type is stored in the preset killing method set to obtain an updated preset killing method set with more types of killing methods. In this way, in the case that no target killing method matching the checkmate situation is matched in the preset killing method set, the checkmate type is set according to the game information in the checkmate situation, and the preset killing method set is enriched through the checkmate type, so as to realize real-time updating of the preset killing method set, so that more chess games can be provided with target killing methods through the updated preset killing method set subsequently.
[0144] In some embodiments, in the case that the priority of the preset killing method set includes the second type of priority, and the current priority belongs to the second type of priority, the above step S202 can be realized by the following steps:
[0145] Firstly, based on the game information and the game rules, a third chess piece set matching the current preset killing method in the winning party of the checkmate situation and a first target chess piece matching the current preset killing method in the losing party of the checkmate situation are determined.
[0146] Here, the second type of priority corresponds to at least one preset killing method arranged in a priority order, and the second type of priority is lower than the first type of priority; for example, the first type of priority includes two preset killing methods arranged in a priority order, and the second type of priority includes one preset killing method, and the preset killing method in the second type of priority has a lower priority than the preset killing method in the first type of priority. If the current priority belongs to the second type of priority, the winning side in the killing situation is determined by analyzing the game rules, and all pieces of the winning side can be obtained by further analyzing the game information. Then, the third piece set involved in the current preset killing method can be identified from all pieces of the winning side. Similarly, the first target piece involved in the current preset killing method can be identified from all pieces of the losing side. In a specific example, the current preset killing method is a double general killing method belonging to the second type of priority, the third piece set matching the current preset killing method in the winning side is all attacking pieces on the board of the winning side, and the first target piece matching the current preset killing method in the losing side is the general or the king of the losing side.
[0147] Secondly, in the third piece set, a candidate third piece capable of reaching the third position of the first target piece is determined.
[0148] Here, the third position of the first target piece is the position of the first target piece in the killing situation. In the third piece set of the winning side, it is determined whether there is a third piece, i.e., a candidate third piece, capable of reaching the third position in one step.
[0149] Thirdly, in the case where the number of candidate third pieces is greater than or equal to a preset number threshold, it is determined that the current preset killing method matches the killing situation.
[0150] Here, if there are two or more candidate third pieces, it indicates that the killing situation matches the current preset killing method, and it is determined that the target killing method of the killing situation is the current preset killing method. In this way, by analyzing the number of winning pieces capable of reaching the first target piece of the losing side for the current preset killing method of the second type of priority, it is accurately determined whether the target killing method of the killing situation is the current preset killing method, so as to output the killing method of the killing situation to the user, so that the user can learn the killing situation.
[0151] In some embodiments, in the case where the priority of the killing method set includes a third type of priority, and the current priority belongs to the third type of priority, the above step S202 can be implemented by the following steps:
[0152] Firstly, based on the game information, a second target game round matching the current preset killing method is determined.
[0153] Here, the third type of priority corresponds to at least one preset killing method arranged in a priority order, and the third type of priority is lower than the second type of priority. Taking Chinese chess as an example, the preset killing method corresponding to the third type of priority can include heavy cannon, double wrong car, smothered palace, and cannon after horse. The second target game round is a game round in the to-be-identified chess game that meets a preset second game order; and the second game order is different from the first game order. The preset second game order can be set based on the preset killing method. For example, the preset killing method is heavy cannon, double wrong car, smothered palace, and cannon after horse, and the preset second game order can be the last step of the chess game. In this way, the second target game round is the last game of the two parties in the entire chess game.
[0154] In the second step, in the checkmate situation, a fourth position and a chess piece type of a fourth chess piece set in the second target game round are determined.
[0155] Here, in the checkmate situation, the chess pieces and the chess piece types in the second target game round can be obtained according to the game information of the checkmate situation. For example, the second target game round is the last step, and then the position and the chess piece type of the fourth chess piece set in the last step of the checkmate situation are identified. The chess piece type can represent the game party to which the chess piece belongs and the specific chess piece image. For example, the chess piece type is a winning party cannon.
[0156] In the third step, a second ideal position and an ideal type of the fourth chess piece set in the current preset killing method are determined based on the game rule.
[0157] Here, according to the game rule of the to-be-identified chess game, the position of each fourth chess piece in the fourth chess piece set in the current preset killing method and the ideal type of the chess piece are analyzed. For example, the current preset killing method is heavy cannon, and the fourth chess piece set includes a winning party cannon and a losing party cannon. According to the game rule corresponding to the heavy cannon killing method, the second ideal position of the winning party cannon is the position of the losing party in the last step of the game, and the second ideal position of the losing party cannon is the position of the cannon on the cannon rack when the winning party cannon attacks the opponent. The ideal type is the winning party cannon and the losing party cannon.
[0158] In the fourth step, the first ideal game path of the losing party in the to-be-identified chess game is determined in a case where the fourth position matches the second ideal position and the chess piece type matches the ideal type.
[0159] Here, if the fourth position matches the second ideal position, it is further determined whether the chess piece type matches the ideal type. If the fourth position matches the second ideal position and the chess piece type matches the ideal type, the first ideal game path of the losing party in the to-be-identified chess game is further obtained. The first ideal game path is a virtual move of the losing party against the checkmate.
[0160] Fifthly, in the case that the fourth chess set limits the first ideal cross-play path, it is determined that the current preset killing method matches the checkmate position.
[0161] Here, if the fourth chess set can limit the first ideal cross-play path, it indicates that the existence of the fourth chess set makes the first ideal cross-play path unable to be realized, i.e., the losing side is eventually checkmated, and further indicates that the current preset killing method matches the checkmate position. In this way, for the preset killing method in the third priority, by judging whether the position and type of the chess piece match the ideal position and ideal type in the current preset killing method, and further judging whether the ideal cross-play path of the losing side is limited, it can be accurately determined whether the target killing method of the checkmate position is the preset killing method belonging to the third priority.
[0162] In some embodiments, in the case that the priority of the killing method set includes a fourth priority, and the current priority belongs to the fourth priority, the above step S202 can be implemented by the following steps:
[0163] Firstly, based on the cross-play information and the cross-play rule, a relative position relationship of the chess piece matched with the current preset killing method between the winning side and the losing side in the checkmate position is determined.
[0164] Here, the chess piece matched with the current preset killing method can be determined according to the cross-play rule, and the relative position relationship of the chess piece between the winning side and the losing side can be identified according to the cross-play information of the chess game. For example, the current preset killing method is face-to-face smile, the chess piece matched with the current preset killing method is the general / rook of the winning side and the rook / general of the losing side, and the relative position relationship is the position relationship on the chessboard in the checkmate position. For example, the relative position relationship is on the same bus, i.e., the chess piece of the winning side and the chess piece of the losing side face each other.
[0165] Secondly, in the case that the relative position relationship satisfies a preset position relationship, it is determined that the current preset killing method matches the checkmate position.
[0166] Here, the preset position relationship can be set based on the current preset killing method, for example, the current preset killing method is face-to-face smile, and the preset position relationship is face-to-face. If the rook of the winning side and the general of the losing side face each other, it is determined that the face-to-face smile killing method matches the checkmate position, and further it is determined that the target killing method of the checkmate position is the face-to-face smile killing method. In this way, by analyzing the relative position relationship between the winning side and the losing side in the checkmate position, it can be quickly and accurately determined whether the current preset killing method belonging to the fourth priority matches the checkmate position.
[0167] In some embodiments, in the case that the priority of the killing method set includes a fifth priority, and the current priority belongs to the fourth priority, the above step S202 can be implemented by the following steps:
[0168] In the first step, based on the game rule, a second target chess piece in the winning side and a third target chess piece in the losing side are determined, which match the current preset killing method.
[0169] Here, the fifth priority corresponds to at least one preset killing method arranged in a priority order, and the fifth priority is lower than the fourth priority. Taking Chinese chess as an example, the preset killing method of the fifth priority includes hanging horse and lying horse, and the priority of hanging horse is higher than that of lying horse. Taking the current preset killing method as hanging horse as an example, the second target chess piece matched by hanging horse is the horse in the winning side, and the third target chess piece matched by hanging horse is the general / king in the losing side.
[0170] In the second step, the fifth position of the second target chess piece in the killing situation and the sixth position of the third target chess piece in the killing situation are determined based on the game information.
[0171] Here, according to the corresponding information of the killing situation, the fifth position of the second target chess piece in the chessboard of the killing situation and the sixth position of the third target chess piece in the chessboard are analyzed.
[0172] In the third step, the third ideal position of the second target chess piece in the current preset killing method and the fourth ideal position of the third target chess piece in the current preset killing method are determined.
[0173] Here, for the current preset killing method, the third ideal position and the fourth ideal position of the second target chess piece and the third target chess piece under the current preset killing method can be obtained according to the game rule; that is, the positions of the second target chess piece and the third target chess piece in the chessboard under the current preset killing method.
[0174] In the fourth step, the second ideal game path of the losing side is determined when the fifth position matches the third ideal position and the sixth position matches the fourth ideal position.
[0175] Here, it is first determined whether the fifth position matches the third ideal position and the sixth position matches the fourth ideal position, and if both are matched, the ideal virtual move of the losing side in the chess game to counter the winning side is further obtained, that is, the second ideal game path is obtained; the second ideal game path can be multiple, that is, the losing side has multiple possible counter paths in the chess game to counter the winning side.
[0176] In the fifth step, the current preset killing method is determined to match the killing situation when the second target chess piece or the third target chess piece limits the second ideal game path.
[0177] Here, if the second target chess piece or the third target chess piece can limit the second ideal chess playing path, it means that the existence of the second target chess piece or the third target chess piece makes the second ideal chess playing path unable to be realized, that is, the losing side is finally checkmated, and further, it means that the current preset killing method matches the checkmate position. In this way, for the preset killing method in the fifth priority, by judging whether the position of the target chess piece matches the ideal position in the current preset killing method, and further judging whether the ideal chess playing path of the losing side is limited, it can be accurately identified whether the target killing method of the checkmate position is the preset killing method belonging to the fifth priority.
[0178] In some embodiments, in the case that the priority of the set of killing methods includes a sixth priority, and the current priority belongs to the fifth priority, the above step S202 can be implemented by the following steps:
[0179] Firstly, based on the chess playing rules, a fourth target chess piece in the losing side of the checkmate position is determined, which matches the current preset killing method.
[0180] Here, the sixth priority corresponds to at least one preset killing method arranged in order of priority, and the sixth priority is lower than the fifth priority. Taking Chinese chess as an example, the preset killing method of the fifth priority includes the iron door bolt killing method. Taking the current preset killing method as the door bolt killing method as an example, the fourth target chess piece position matched by the door bolt killing method is the general / king of the losing side.
[0181] Secondly, in the case that the fourth target chess piece is in a first preset chessboard area corresponding to the current preset killing method, based on the chess playing rules, a fifth target chess piece in the winning side of the checkmate position is determined, which matches the current preset killing method.
[0182] Here, the first preset chessboard area is set according to the current preset killing method; for example, the current preset killing method is the iron door bolt, and the first preset chessboard area is the position on the fifth vertical line of the chessboard. If the target chess piece is on the fifth vertical line, further according to the chess playing rules, the cannon in the winning side of the checkmate position, which matches the current preset killing method, that is, the fifth target chess piece, is identified.
[0183] Thirdly, in the case that the fifth target chess piece is in the first preset chessboard area, based on the chess playing information, the number of chess pieces between the fourth target chess piece and the fifth target chess piece on the first preset chessboard area is determined.
[0184] Here, if the fifth target chess piece exists in the first preset chessboard area, then the number of chess pieces between the fourth target chess piece and the fifth target chess piece is further determined in the first preset chessboard area according to the game information of the checkmate situation. Taking the current preset killing method as the iron door bolt, if the cannon of the winning side is on the fifth vertical line, the number of chess pieces between the cannon of the winning side and the general / rook of the losing side is further determined.
[0185] In the fourth step, when the number of chess pieces is the preset number of chess pieces, whether the fourth target chess piece is in the second preset chessboard area corresponding to the current preset killing method is determined based on the game information.
[0186] Here, the second preset chessboard area is different from the first preset chessboard area. Taking the current preset killing method as the iron door bolt, the second preset chessboard area is the position of the bottom line of the losing side. The preset number of chess pieces is set based on the current preset killing method, for example, the preset number of chess pieces under the iron door bolt killing method is 2. In this way, if the number of chess pieces is 2, whether the fourth target chess piece (i.e., the general / rook of the losing side) is on the bottom line of the losing side is determined.
[0187] In the fifth step, in response to the fourth target chess piece being in the second preset chessboard area, it is determined that the current preset killing method matches the checkmate situation.
[0188] Here, if the fourth target chess piece is in the second preset chessboard area, it means that the current preset killing method matches the checkmate situation. For example, taking the current preset killing method as the iron door bolt killing method, if the general / rook of the losing side as the fourth target chess piece is on the bottom line of the losing side as the second preset chessboard area, it is determined that the iron door bolt killing method matches the checkmate situation. In this way, for the preset killing method in the sixth priority, by determining whether the position of the target chess piece is between the preset chessboard area and the number of chess pieces between the target chess piece of the losing side and the target chess piece of the winning side, it can be accurately determined whether the target killing method of the checkmate situation is the preset killing method belonging to the sixth priority.
[0189] In some embodiments, after the target killing method of the checkmate situation is identified, the user can be interacted with in the following ways:
[0190] Method one: the target killing method is displayed in a display mode corresponding to a preset application requirement.
[0191] Here, the preset application requirement can be a requirement input by the user, such as outputting the target killing method in the form of an image, outputting the target killing method in the form of text, outputting the target killing method in the form of voice, or outputting the target killing method in the form of animation, etc.
[0192] Method two: based on the target killing method and the game information of the to-be-identified chess game, a preset teaching database is updated.
[0193] Here, the preset teaching database is used to provide Chinese chess teaching examples. In order to enable the user to more conveniently learn Chinese chess, the teaching database is updated according to the identified target killing method and the game information of the to-be-identified chess game; so that the user can obtain the specific game process of any target killing method through the teaching database.
[0194] Method three: updating and outputting the chess game ranking list corresponding to the to-be-identified chess game based on the target killing method.
[0195] Here, the game results of the two game parties are ranked according to the target killing method of each chess game, so as to construct an honor medal system; in this way, the sense of honor and the sense of achievement of the user can be improved. In this way, the user is provided with multiple interaction modes according to the identified target killing method; in this way, the user can not only learn the killing method of Chinese chess, but also improve the interest of the user in Chinese chess.
[0196] In the following, an exemplary application of the embodiment of the application in an actual application scenario will be described, which is taken as an example of the identification of the killing method of Chinese chess.
[0197] Figure 4 The implementation flowchart of the Chinese chess killing method identification method according to another embodiment of the application is schematically shown, and the following description is made in combination with the steps shown in Figure 4
[0198] Step S401, obtaining a chess game instance.
[0199] Here, the chess game instance can be an external FEN chess score 411 or a user game 412. After accepting the externally transmitted FEN chess score or the real-time game information generated in the user game process, the chess game instance can use the killing method identification method of the killing method identification engine to identify whether the current situation triggers a certain pre-defined killing method at any time.
[0200] Step S402, determining whether there is a checkmate in the current chess game according to the chess game instance.
[0201] Here, if there is a checkmate in the current chess game, step S403 is entered; if there is no checkmate in the current chess game, step S404 is entered, and the identification process is ended. When the killing method identification method engine is triggered, it is firstly judged whether the situation of the current chess game has reached the checkmate situation, that is, one of the two game parties is under attack by the other party, and the attacked party cannot break the attack situation, then it is considered as a checkmate situation. If the current situation is not a checkmate situation, directly return "false" to represent that no killing method is identified at present. Otherwise, step S403 is entered.
[0202] Step S403, detecting various killing methods according to a preset killing method identification priority or a custom priority.
[0203] Here, the killing method recognition engine 413 is activated to detect various killing methods. These methods include: the "Heart-Splitting Kill," the "Flanking Tiger Kill," the "Fishing Horse Kill," the "Double General Kill," the "Heavy Cannon Kill," the "Double Chariot Mismatch Kill," the "Smoke Palace Kill," the "Horse Back Cannon Kill," the "Opposite Laugh Kill," the "Hanging Corner Horse Kill," the "Lying Crouch Horse Kill," and the "Iron Gate Bolt Kill," among others.
[0204] Step S404: Determine the actual target and killing method.
[0205] Step S405: Output the target killing method.
[0206] In some embodiments, in step S403, if the current situation is a checkmate situation, then specific checkmates are identified sequentially according to the input checkmate priority table or the preset checkmate priority table. The preset checkmate priority table lists the priorities of the checkmates from highest to lowest as follows: **Heartbreaker > Side Tiger > Fishing Horse > Double General > Heavy Cannon, Double Chariots > Silent Palace > Back Cannon > Opposite Laugh > Corner Horse > Crouching Horse > Iron Gate Bolt.** If none of the above checkmates are successful, the current situation may be an unknown checkmate or a normal checkmate situation, and the checkmate type is directly returned as: Checkmate, to ensure compatibility with checkmate types not yet supported by the engine.
[0207] In some embodiments, the logic for identifying the "heart-splitting" killing method is as follows: Figure 5A As shown, combined with Figure 5A The steps shown are explained below:
[0208] Step S501: Determine that one player has been checkmated in the current game.
[0209] Step S502: In the current game, determine the losing side.
[0210] Here, we determine whether the losing side in this game, i.e., the side that is checkmated, is the red or the black side.
[0211] Step S503: Determine the color of the losing side.
[0212] Here, if the losing side is red, proceed to step S504; if the losing side is black, proceed to step S505.
[0213] Step S504: Determine the position of the center of the red team's command tent as grid number 183.
[0214] Step S505: Determine the position of the center of the black side's general's tent as grid number 71.
[0215] Step S506: Determine whether the last third-party winner occupies the center position of the losing side.
[0216] Here, if the third-to-last party winner occupies the losing party central pawn position, go to step S507; if the third-to-last party winner does not occupy the losing party central pawn position, go to step S508.
[0217] In some possible implementations, according to the chess rules, the second-to-last hand (i.e. the third-to-last hand of the entire game) of the checkmating party uses a pawn or a car to occupy the above-mentioned losing party central position. Therefore, the drop record of the current game can be obtained from the engine instance of the playing system, and the drop record of the third-to-last hand is taken to see whether the pawn or the car of the winning party occupies the central position of the losing party.
[0218] Step S507, determine that the hit target killing method is the big knife and heart.
[0219] Here, since the priority of the big knife and heart is the highest, as long as the big knife and heart killing method is hit, the current situation is directly determined as the big knife and heart.
[0220] Step S508, determine that the big knife and heart killing method is not hit.
[0221] In the embodiment of the application, the last step (i.e. the last step of the killing chess using party) of the checkmate uses a pawn or a car to occupy the central position of the other party (the central pawn is also eaten), and only needs to occupy the position, and the central pawn can not be eaten, i.e. it is determined as the big knife and heart.
[0222] In some embodiments, the identification logic of the side tiger killing method is as shown in Figure 5B The following is described in combination with the steps shown in Figure 5B
[0223] Step S521, determine that a party user in the current game is checkmated.
[0224] Step S522, determine the color of the losing party in the current game.
[0225] Here, if the losing party is the black party, go to step S523; if the losing party is the red party, go to step S524.
[0226] Step S523, determine whether the red party horse is dropped on the position with grid number 69 or 73.
[0227] Step S524, determine whether the black party horse is dropped on the position with grid number 181 or 185.
[0228] Here, if the target position does not exist the horse of the winning party, it is impossible to be the side tiger, and the process is directly ended, and go to step S525 to determine that the killing method of the current game is not the side tiger. If the target position exists the horse of the winning party, go to step S526.
[0229] Step S526, determine whether the winning side's horse plays a role of auxiliary killing or killing.
[0230] Here, if the winning side's horse does not play a role of auxiliary killing or killing, it is determined that the current game is not a side tiger 51, and the process returns to step S524. If the winning side's horse plays a role of auxiliary killing or killing, the process proceeds to step S527.
[0231] Here, if the winning side's horse does not play a role of auxiliary killing or killing, it is determined that the current game is not a side tiger 51, and the process returns to step S524. If the winning side's horse plays a role of auxiliary killing or killing, the process proceeds to step S527.
[0232] Step S527, determine whether a higher priority killing method is hit.
[0233] Here, if a higher priority killing method is hit, it is determined that the current game is not a side tiger 52. If a higher priority killing method is not hit, the process proceeds to step S528.
[0234] Step S528, determine whether the losing side's general is on the 4th or 6th road.
[0235] Here, if the losing side's general is not on the 4th or 6th road, or the losing side's general is on the 4th or 6th road but the side tiger is not on the same side as the general, it is determined that the current game is not a side tiger 53, and the process ends. If the losing side's general is on the 4th or 6th road and the side tiger is on the same side as the general, it is determined that the current game is a side tiger 54. If the losing side's general has no road to go, and the last step causes killing is the side tiger, it is also a side tiger killing method.
[0236] In the embodiment of the present application, the side tiger priority is only second to the big knife and heart, so as long as the big knife and heart is not hit, the side tiger is hit, and the current situation triggered by the side tiger killing method can be directly determined.
[0237] In some embodiments, the identification logic of the fishing horse killing method is as shown in Figure 5C The following is described in combination with the steps shown in Figure 5C
[0238] Step S531, determine whether a party user in the current game is killed.
[0239] Here, the fishing horse killing method is that when the general is in the position of 3 or 7, the horse of the opponent is in the position of the general, and the route of the general of the general side is controlled by the horse, causing the killing of the chess.
[0240] Step S532, determine the color of the losing side in the current game.
[0241] Here, if the losing side is the black side, go to step S533; if the losing side is the red side, go to step S534.
[0242] Step S533, judge whether the red horse is in the position of grid serial number 85 or 89.
[0243] Here, if the red horse is not in the position of grid serial number 85 or 89, determine that the killing method of the current game is non-fishing horse 55; if the red horse is in the position of grid serial number 85 or 89, go to step S535.
[0244] Step S534, judge whether the black horse is in the position of grid serial number 165 or 169.
[0245] Here, if the black horse is not in the position of grid serial number 165 or 169, go to step S52, determine that the killing method of the current game is non-fishing horse; if the black horse is in the position of grid serial number 165 or 169, go to step S535.
[0246] Step S535, judge whether the winning side's horse plays a role of auxiliary killing or killing.
[0247] Here, if the winning side's horse plays a role of auxiliary killing or killing, go to step S536; if the winning side's horse does not play a role of auxiliary killing or killing, determine that the killing method of the current game is non-fishing horse 56. At the same time, in the case that there is no fishing horse in the specified position, if the general of the losing side can move to a position to solve the situation of being dead, it means that the fishing horse of the winning side does not play a role of auxiliary killing, and it is not a fishing horse killing method, end the process. In the case that there is a fishing horse in the specified position, see whether the position that the general of the losing side can reach is also reached by the fishing horse of the winning side. If the fishing horse of the winning side cannot reach the position that the general of the losing side can move, it means that the fishing horse of the winning side does not play a role of auxiliary killing, and it is not a fishing horse, end the process.
[0248] Step S536, determine whether a higher priority killing method is hit.
[0249] Here, if a higher priority killing method is hit, determine that the killing method of the current game is non-fishing horse 57; if a higher priority killing method is not hit, go to step S537.
[0250] Step S537, determine the current game method as fishing horse.
[0251] Here, if the losing side has no way to go, and the last step causes the absolute kill is fishing horse, it is also fishing horse kill method, return the kill method type as fishing horse, end the flow; if no higher priority kill method is hit, and the fishing horse kill method is hit, then determine the current situation belongs to fishing horse kill method, return the kill method type as fishing horse.
[0252] In some embodiments, the identification logic of double general kill method is as shown in Figure 5D , combined with the following steps as shown in Figure 5D :
[0253] Step S541, determine that a party user in the current game is absolutely killed.
[0254] Here, the double general kill method is that the general / king of a party is attacked by two or more different chess pieces at the same time.
[0255] Step S542, filter out all the chess pieces of the winning side.
[0256] Step S543, determine whether there are two or more attacking chess pieces that can reach the position of the opponent's general in one step.
[0257] Here, if there are no two or more attacking chess pieces that can reach the position of the opponent's general in one step, determine the current game method as non-double general 58; if there are two or more attacking chess pieces that can reach the position of the opponent's general in one step, go to step S544.
[0258] In some possible implementations, let all the filtered chess pieces make a virtual move from the position of the chess piece to the position of the losing side's general or king, and if it can reach, add the counter. After all the attacking chess pieces of the winning side have tried, determine whether the added counter is greater than or equal to 2, if so, it means that the double general situation is reached, go to step S544. Otherwise, determine the current game method as non-double general 58, end the flow.
[0259] Step S544, determine whether a higher priority kill method is hit.
[0260] Here, if a higher priority kill method is hit, determine the current game method as non-double general 59; if no higher priority kill method is hit, go to step S545.
[0261] Step S545, determine the current game method as double general.
[0262] In some embodiments, the identification logic of heavy cannon kill method is as shown in Figure 5E , combined with the following steps as shown inFigure 5E The steps shown are described as follows:
[0263] Step S551, determine whether a user in the current game is checkmated.
[0264] Here, the double cannon checkmate is that two cannons are on the same horizontal or vertical line, and there is no other piece between the two cannons, so that the other pieces of the losing side cannot reach the front of the general / king and cause the checkmate.
[0265] Step S552, determine whether the piece of the losing side that was last attacked by the general is a cannon of the winning side.
[0266] Here, if the piece of the losing side that was last attacked by the general is not a cannon of the winning side, it is determined that the checkmate of the current game is not a double cannon 60; if the piece of the losing side that was last attacked by the general is a cannon of the winning side, proceed to step S553.
[0267] Step S553, determine whether the cannon that attacked the opponent is another cannon of the winning side.
[0268] Here, if the cannon that attacked the opponent is not another cannon of the winning side, it is determined that the checkmate of the current game is not a double cannon 61; if the cannon that attacked the opponent is another cannon of the winning side, proceed to step S554. Obtain all pieces on the same horizontal or vertical line as the general of the losing side, and determine whether the general of the losing side is attacked by the cannon of the winning side, and the cannon that attacks is another cannon of the winning side. If so, it means that the double cannon checkmate is hit, proceed to step S554. Otherwise, it is not a double cannon, end the flow.
[0269] Step S554, determine whether a higher priority checkmate is hit.
[0270] Here, if a higher priority checkmate is hit, it is determined that the checkmate of the current game is not a double cannon 62; if a higher priority checkmate is not hit, proceed to step S555.
[0271] Step S555, determine that the checkmate of the current game is a double cannon.
[0272] Here, if a checkmate with higher priority than a double cannon is not hit, and a double cannon checkmate is hit, it is determined that the current situation is a double cannon checkmate, and return the checkmate type as a double cannon.
[0273] In some embodiments, the identification logic of the double cannon checkmate is as shown in Figure 5F The steps shown are described as follows: Figure 5F
[0274] Step S561, determine whether a user in the current game is checkmated.
[0275] Here, the double car mistake killing method is a situation formed by two cars (one car directly forms a capture to the opponent's general, and the general can also move to the walkable range of the other car), so that the opponent cannot block the response by moving the chess pieces or moving the general to respond to the killing chess.
[0276] Step S562, determine whether the chess piece of the last step general failure party is a car.
[0277] Here, if the chess piece of the last step general failure party is not a car, it is determined that the killing method of the current chess game is a non-double car mistake 63; if the chess piece of the last step general failure party is a car, step S563 is entered.
[0278] Step S563, determine whether the response path is affected by another car of the winning party and cannot respond.
[0279] Here, if the response path of the failure party is not affected by another car of the winning party and cannot respond, it is determined that the killing method of the current chess game is a non-double car mistake 64; if the response path of the failure party is affected by another car of the winning party and cannot respond, step S564 is entered.
[0280] In some possible implementations, first, filter out the cars that can reach the failure party's general on the same horizontal or vertical line as the failure party's general, and if there is none, it is impossible to be a double car mistake, and the process ends; second, if at least one car can be filtered out, and after the failure party's general is virtually moved one step, it will be general by another car (not the car of the general failure party) of the winning party, then it is determined that the double car mistake killing method is hit, and step S564 is entered. Otherwise, it is a non-double car mistake killing method, and the process ends.
[0281] Step S564, determine whether a higher priority killing method is hit.
[0282] Here, if a higher priority killing method is hit, it is determined that the killing method of the current chess game is a non-double car mistake 65; if a higher priority killing method is not hit, step S565 is entered.
[0283] Step S565, determine that the killing method of the current chess game is a double car mistake.
[0284] Here, if a killing method with higher priority than a double car mistake is not hit, and a double car mistake killing method is hit, it is determined that the current situation is a double car mistake killing method, and the type of killing method is returned to a car mistake.
[0285] In some embodiments, the identification logic of the smothered general killing method is as shown in Figure 5G , and the following is described in combination with the steps shown in Figure 5G .
[0286] Step S571, determine whether a user of one party is killed in the current chess game.
[0287] Here, the smothered general killing method is a killing method in which a general is attacked by a cannon, the opponent's piece blocks the path of the cannon, and the cannon is a piece of the player.
[0288] Step S572 determines whether the piece of the player that failed in the last step of the general attack is a cannon.
[0289] Here, if the piece of the player that failed in the last step of the general attack is not a cannon, it is determined that the killing method of the current game is not a smothered general 66; if the piece of the player that failed in the last step of the general attack is a cannon, step S573 is entered.
[0290] Step S573 determines whether the path of the cannon is blocked by the player's own piece and cannot be attacked.
[0291] Here, if the path of the cannon is not blocked by the player's own piece and cannot be attacked, it is determined that the killing method of the current game is not a smothered general 67; if the path of the cannon is blocked by the player's own piece and cannot be attacked, step S574 is entered.
[0292] In some possible implementations, if the cannon is attacked, and the cannon piece is not the piece of the player that failed, it is not a smothered general, and the process ends. If the cannon is attacked, and the cannon piece is the piece of the player that failed, all possible solutions to the game are obtained (when obtaining, ignore the blocking of the player's own piece on the target position, that is, if there is a player's own piece on the target position when the game is solved, it is considered that there is no piece on the target position. However, this solution needs to be marked to facilitate subsequent judgment), if there is no solution, it is not a smothered general, and the process ends. Otherwise, if there is no other solution except the solution in which the cannon piece is the player's own piece, it is determined that the current game is not a smothered general, and the process ends. Otherwise, if there is still a solution that cannot be reached due to the blocking of the player's own piece after the cannon piece is removed, the smothered general killing method is hit.
[0293] Step S574 determines whether a killing method with higher priority is hit.
[0294] Here, if a killing method with higher priority is hit, it is determined that the killing method of the current game is not a smothered general 68; if a killing method with higher priority is not hit, step S575 is entered.
[0295] Step S575 determines that the killing method of the current game is a smothered general.
[0296] Here, if a killing method with higher priority than the smothered general is not hit, and the smothered general killing method is hit, it is determined that the current situation is a smothered general killing method, and the type of the killing method is returned as a smothered general.
[0297] In some embodiments, the identification logic of the back-cannon killing method is as shown in Figure 6A , combined with Figure 6AThe illustrated steps are described as follows:
[0298] Step S601, determine whether a user in the current game is checkmated.
[0299] Here, the horse and the opponent's general are on the same straight line or horizontal line, and the horse and the general are separated by one empty square, which limits the general from moving left or right or up or down, and then the horse is used as a cannon platform to attack the general behind the horse, which is a horse-cannon combination killing method.
[0300] Step S602, determine whether the last move of the general is a cannon.
[0301] Here, if the last move of the general is not a cannon, it is determined that the current game is not a horse-cannon killing method; if the last move of the general is a cannon, proceed to step S602.
[0302] Step S603, determine whether the cannon platform of the general is a horse of the winning side.
[0303] Here, if the cannon platform of the general is a horse of the winning side, proceed to step S604; if the cannon platform of the general is not a horse of the winning side, it is determined that the current game is not a horse-cannon killing method.
[0304] Step S604, determine whether the horse as a cannon platform limits the up and down movement of the general of the losing side.
[0305] Here, if the horse as a cannon platform does not limit the up and down movement of the general of the losing side, it is determined that the current game is not a horse-cannon killing method; if the horse as a cannon platform limits the up and down movement of the general of the losing side, proceed to step S605.
[0306] In some possible implementations, the general of the losing side has a horse and a cannon of the winning side on the same horizontal or vertical line, and the horse is positioned between the general of the losing side and the cannon of the winning side, and there is only one empty square between the horse and the general of the losing side (if on the horizontal line, the difference in the number of squares between the horse and the general of the losing side is 2, and if on the vertical line, the difference in the number of squares between the horse and the general of the losing side is 32), and the horse must be the cannon platform of the general of the losing side, if not, it is determined that the current game is not a horse-cannon killing method, and the process ends. If so, the horse must be able to limit the up and down or left and right movement of the general of the losing side (e.g., the horse's foot is cut off, and it cannot limit the up and down or left and right movement of the general of the losing side), then it is not a horse-cannon, and the process ends. Otherwise, proceed to step S606.
[0307] Step S605, determine whether a higher priority killing method is hit.
[0308] Here, if a kill method with higher priority is hit, it is determined that the kill method of the current game is not a post-horse cannon; if a kill method with higher priority is not hit, step S606 is entered.
[0309] Step S606, it is determined that the kill method of the current game is a post-horse cannon.
[0310] Here, if a kill method with higher priority than the post-horse cannon is not hit, and the post-horse cannon is hit, it is determined that the post-horse cannon kill method is returned, and the kill method type is the post-horse cannon.
[0311] In some embodiments, the identification logic of the opposite smile kill method is as shown in Figure 6B , and the following is described in combination with the steps shown in Figure 6B .
[0312] Step S621, it is determined that a user of one party is killed in the current game.
[0313] Here, when the user is under attack, the only way to respond to the attack (the piece that needs to be moved is the general or king, and if there is no general or king of the opposite party that can respond to the attack) is blocked by the opposite king (general), and it is determined that the opposite smile is hit.
[0314] Step S622, it is determined whether the failure party can respond to the attack when the failure party responds to the attack.
[0315] Here, if the failure party can respond to the attack when the failure party responds to the attack, step S623 is entered; if the failure party cannot respond to the attack when the failure party responds to the attack, it is determined that the kill method of the current game is not the opposite smile.
[0316] In some possible implementations, the failure party response scheme is obtained, and if there is a scheme in the response scheme that can respond successfully if the general / king of the opposite party is not in the current position, it means that the opposite smile kill method is hit.
[0317] Step S623, it is determined whether a kill method with higher priority is hit.
[0318] Here, if a kill method with higher priority is hit, it is determined that the kill method of the current game is not the opposite smile; if a kill method with higher priority is not hit, step S624 is entered.
[0319] Step S624, it is determined that the kill method of the current game is the opposite smile.
[0320] Here, if a kill method with higher priority than the opposite smile is not hit, and the opposite smile is hit, it is determined that the opposite smile kill method is returned, and the kill method type is the opposite smile.
[0321] In some embodiments, the identification logic of the hanging corner horse kill method is as shown in Figure 6C , and the following is described in combination with the steps shown in Figure 6C .The illustrated steps are described as follows:
[0322] Step S631, determine whether a user in the current game is killed.
[0323] Here, when the general, the position of the 4 or 6 way of the general is hung on the horse, and the route of the general of the general is controlled by the horse, resulting in the killing of the chess.
[0324] Step S632, determine the color of the losing side in the current game.
[0325] Here, if the losing side is black, step S633 is entered, and if the losing side is red, step S634 is entered.
[0326] Step S633, determine whether the red horse is on the grid number 86 or 88.
[0327] Here, if the red horse is on the grid number 86 or 88, step S635 is entered; if the red horse is not on the grid number 86 or 88, it is determined that the current game is not a hanging horse.
[0328] Step S634, determine whether the black horse is on the grid number 166 or 168
[0329] Here, if the black horse is on the grid number 166 or 168, step S635 is entered; if the black horse is not on the grid number 166 or 168, it is determined that the current game is not a hanging horse.
[0330] In some possible implementations, determine whether the position that the general of the losing side can reach is also reached by the hanging horse of the winning side. If the hanging horse of the winning side cannot reach the position that the general of the losing side can move, it means that the hanging horse of the winning side plays a role in assisting the killing of the chess, and the hanging horse is not counted, and the process is ended.
[0331] Step S635, determine whether the horse of the winning side plays a role in assisting the killing or killing.
[0332] Here, if the horse of the winning side does not play a role in assisting the killing or killing, it is determined that the current game is not a hanging horse; if the horse of the winning side plays a role in assisting the killing or killing, step S636 is entered.
[0333] In some possible implementation manners, if the king / rook of the losing party can move to a position to resolve the checkmate situation when the hanging corner horse does not exist at the specified position, it indicates that the hanging corner horse does not play an auxiliary killing role and is not a hanging corner horse killing method, and the process ends; if the king / rook of the losing party has no way to move, and the last step causes the checkmate, the hanging corner horse is also a hanging corner horse killing method, and the process ends with the return of the killing method type as the hanging corner horse.
[0334] In step S636, it is determined whether a higher-priority killing method is hit.
[0335] Here, if the higher-priority killing method is hit, it is determined that the killing method of the current game is not a hanging corner horse; if the higher-priority killing method is not hit, step S637 is entered.
[0336] In step S637, it is determined that the killing method of the current game is a hanging corner horse.
[0337] Here, if the killing method of the higher-priority hanging corner horse is not hit, and the killing method of the hanging corner horse is hit, it is determined that the current situation belongs to the hanging corner horse killing method, and the process ends with the return of the killing method type as the hanging corner horse.
[0338] In some embodiments, the identification logic of the lying horse killing method is as shown in Figure 6D , and the following is described in combination with the steps shown in Figure 6D .
[0339] In step S641, it is determined that a user of one party is checkmated in the current game.
[0340] Here, the lying horse killing method is that the 4 or 6 road position of the general party has a lying horse, and the route of the general (rook) of the general party is controlled by the lying horse, causing the killing.
[0341] In step S642, it is determined that the color of the losing party in the current game.
[0342] Here, if the losing party is the black party, step S643 is entered, and if the losing party is the red party, step S644 is entered.
[0343] In step S643, it is determined whether the red horse is located at the position with grid serial number 69 or 73.
[0344] Here, if the red horse is located at the position with grid serial number 69 or 73, step S645 is entered; if the red horse is not located at the position with grid serial number 69 or 73, it is determined that the killing method of the current game is not a lying horse.
[0345] In step S644, it is determined whether the black horse is located at the position with grid serial number 181 or 185.
[0346] Here, if the black horse is landed on the position with the grid number of 181 or 185, step S645 is entered; if the black horse is not landed on the position with the grid number of 181 or 185, it is determined that the current chess game is not the killing method of the lying horse.
[0347] In some possible implementation manners, it is determined whether the position that can be reached by the general of the losing party can also be reached by the lying horse of the winning party. If the lying horse of the winning party cannot reach the position that can be reached by the general of the losing party, it is indicated that the lying horse of the winning party plays an auxiliary killing role, and the lying horse is not counted, and the process is ended.
[0348] Step S645, it is determined whether the horse of the winning party plays an auxiliary killing role or a killing role.
[0349] Here, if the horse of the winning party does not play an auxiliary killing role or a killing role, it is determined that the current chess game is not the killing method of the lying horse; if the horse of the winning party plays an auxiliary killing role or a killing role, step S646 is entered.
[0350] In some possible implementation manners, if the general of the losing party can move to a position to resolve the checkmated situation under the condition that the lying horse does not exist in the specified position, it is indicated that the lying horse of the winning party does not play an auxiliary killing role, and the lying horse killing method is not counted, and the process is ended; if the general of the losing party has no way to move, and the lying horse causes the killing in the last step, the lying horse killing method is also counted, the type of the killing method is returned as the lying horse, and the process is ended.
[0351] Step S646, it is determined whether a killing method with higher priority is hit.
[0352] Here, if the killing method with higher priority is hit, it is determined that the current chess game is not the killing method of the lying horse; if the killing method with higher priority is not hit, step S647 is entered.
[0353] Step S647, it is determined that the current chess game is the killing method of the lying horse.
[0354] Here, if the killing method with higher priority than the lying horse is not hit, and the killing method of the lying horse is hit, it is determined that the current situation belongs to the killing method of the lying horse, and the type of the killing method is returned as the lying horse.
[0355] In some embodiments, the identification logic of the iron door bolt killing method is as shown in Figure 6E , and the following is described in combination with the steps as shown in Figure 6E .
[0356] Step S651, it is determined that a user of one party is killed in the current chess game.
[0357] Here, the iron bolt killing method is: using the middle cannon to hold the three pieces of the opponent in the middle road, and the three pieces must contain the general or the king (specifically 5 roads), and then the other pieces are used to the bottom line to general.
[0358] Step S652, determine whether the losing side's king is in the fifth vertical line (numbered 4).
[0359] Here, if the losing side's king is not in the fifth vertical line, it is determined that the current game killing method is not iron bolt; if the losing side's king is in the fifth vertical line, step S653 is entered.
[0360] Step S653, determine whether there is a winning side's cannon on the fifth vertical line.
[0361] Here, if there is no winning side's cannon on the fifth vertical line, it is determined that the current game killing method is not iron bolt; if there is a winning side's cannon on the fifth vertical line, step S654 is entered.
[0362] Step S654, determine whether there are two losing side's pieces between the losing side's general and the winning side's cannon on the fifth vertical line.
[0363] Here, if there are two losing side's pieces, step S655 is entered; if there are no two losing side's pieces, it is determined that the current game killing method is not iron bolt.
[0364] In some possible implementations, the losing side's king / general must be on the fifth vertical line (vertical line number 4) otherwise it is not iron bolt, end the process. If the losing side's king / general must be on the fifth vertical line, there must be a winning side's cannon on the fifth vertical line, and there are and only two pieces between the winning side's cannon and the losing side's king / general, otherwise it is not iron bolt, return the result, end the process; otherwise, step S655 is entered.
[0365] Step S655, determine whether the general losing side's piece is on the losing side's bottom line.
[0366] Here, if the losing side is red, the bottom line is numbered 9; if the losing side is black, the bottom line is numbered 0. If the general losing side's piece is not on the losing side's bottom line, it is determined that the current game killing method is not iron bolt; if the general losing side's piece is on the losing side's bottom line, step S656 is entered.
[0367] Step S656, determine whether a higher priority killing method is hit.
[0368] Here, if a higher priority killing method is hit, it is determined that the current game killing method is not iron bolt; if a higher priority killing method is not hit, step S657 is entered.
[0369] Step S657, determine that the current game killing method is iron bolt.
[0370] Here, if the priority of the killing method is higher than that of the iron door bolt, and the iron door bolt is hit, it is determined that the current situation is the iron door bolt killing method, and the killing method type iron door bolt is returned.
[0371] If the above preset killing methods are not hit, the current situation may be an unknown killing method, and thus the killing method type absolute killing is directly returned.
[0372] In the embodiment of the application, the chess killing method type can be analyzed according to the FEN transmitted or the chess game data generated in the real-time game process of the user, and the current situation is determined to belong to the sofa type. The killing method rule is dynamically expanded and the killing method priority is specified. The Chinese chess killing method recognition method provided by the embodiment of the application is suitable for the scene of detecting the Chinese chess killing method type according to the FEN or the real-time game chess of the user. The killing method recognition engine can be used to: perform batch killing method recognition on the FEN chess score and construct a killing method teaching database, which is used for the killing method question bank of Chinese chess lovers; and identify the killing method used by the user in real time during the game and assist in displaying certain animation or sound effect, which can improve the sense of honor and achievement of the user and promote the improvement of the interest of the user in Chinese chess; and the honor medal system can be constructed through the killing method.
[0373] The embodiment of the application provides a Chinese chess killing method recognition device, Figure 7 The structure of the Chinese chess killing method recognition device according to the embodiment of the application is schematically shown in a structure composition schematic diagram, as shown in Figure 7 The Chinese chess killing method recognition device 700 includes:
[0374] A first determination module 701 is configured to determine the game information of a to-be-recognized chess game.
[0375] A first identification module 702 is configured to identify an absolute killing situation of the situation of the to-be-recognized chess game based on the game information.
[0376] A second determination module 703 is configured to determine a target killing method matched with the absolute killing situation in a preset killing method set based on the game information and the game rule of the to-be-recognized chess game in response to the identification of the absolute killing situation.
[0377] In the above device, the first determination module 701 is further configured to: acquire a first chess piece set of the to-be-recognized chess game; determine a first position of a first chess piece in the first chess piece set in the to-be-recognized chess game; and determine the game information based on the first position and the first chess piece set.
[0378] In the apparatus, the second determining module 703 is further configured to: in response to identifying the winning position, determine a priority order among different preset killing methods in the preset killing method set; and determine, according to the game information and the game rule, a target killing method in the preset killing method set that matches the winning position according to the priority order.
[0379] In the apparatus, the second determining module 703 is further configured to: determine, according to the priority order, a current preset killing method corresponding to a current priority; determine, according to the game information and the game rule, whether the current preset killing method matches the winning position; in response to the current preset killing method not matching the winning position, determine, according to the priority order, a next priority lower than the current priority; determine, according to the game information and the game rule, whether a preset killing method corresponding to the next priority matches the winning position; and in response to the preset killing method corresponding to the next priority matching the winning position, determine that the preset killing method corresponding to the next priority is the target killing method.
[0380] In the apparatus, the priority of the preset killing method set includes a first type of priority, and the first type of priority corresponds to at least one preset killing method arranged according to a priority order. In a case where the current priority belongs to the first type of priority, the second determining module 703 is further configured to: determine, according to the game rule, a second chess piece set matched by the current preset killing method and a first ideal position of the second chess piece set in the current preset killing method; determine, according to the game information, a second position of a second chess piece in the second chess piece set in the winning position; and in a case where the first ideal position matches the second position, determine that the current preset killing method matches the winning position.
[0381] In the apparatus, the second determining module 703 is further configured to: determine, according to the game rule, a winning side and a losing side in the winning position; and determine, according to the current preset killing method, a chess piece matching at least one of the winning side and the losing side to obtain the second chess piece set.
[0382] In the apparatus, in a case where the current preset killing method is a preset killing method with a highest priority in the first type of priority, the second determining module 703 is further configured to: determine, according to the preset killing method with the highest priority, a first target game round of a winning side of the to-be-identified chess game; the first target game round is a game round in the to-be-identified chess game that satisfies a preset first game order; determine a chess piece in the winning position in the first target game round to obtain the second chess piece set; and determine a center position of a nine-square grid of a losing side of the to-be-identified chess game as the first ideal position.
[0383] In the apparatus, the apparatus further includes:
[0384] The third determining module is configured to, in response to the preset killing method with the lowest priority in the preset killing method set not matching the winning position, determine a winning type of the winning position based on the game information and the game rule;
[0385] The first updating module is configured to update the preset killing method set based on the winning type to obtain an updated preset killing method set.
[0386] In the apparatus, the priority of the preset killing method set includes a second type of priority, the second type of priority corresponds to at least one preset killing method arranged in a priority order, and the second type of priority is lower than a first type of priority; in a case where the current priority belongs to the second type of priority, the second determining module 703 is further configured to determine a third chess piece set in a winning side of the winning position that matches the current preset killing method and a first target chess piece in a losing side of the winning position based on the game information and the game rule; determine a candidate third chess piece that can reach a third position of the first target chess piece in the third chess piece set; and determine that the current preset killing method matches the winning position in a case where a quantity of the candidate third chess pieces is greater than or equal to a preset quantity threshold.
[0387] In the apparatus, the priority of the preset killing method set includes a third type of priority, the third type of priority corresponds to at least one preset killing method arranged in a priority order, and the third type of priority is lower than a second type of priority; in a case where the current priority belongs to the third type of priority, the second determining module 703 is further configured to determine a second target game round that matches the current preset killing method based on the game information; the second target game round is a game round that meets a preset second game order in the to-be-identified game; the second game order is different from a first game order; determine a fourth position and a chess piece type of a fourth chess piece set of the second target game round in the winning position; determine a second ideal position and an ideal type of the fourth chess piece set in the current preset killing method based on the game rule; determine a first ideal game path of a losing side in the to-be-identified game in a case where the fourth position matches the second ideal position and the chess piece type matches the ideal type; and determine that the current preset killing method matches the winning position in a case where the fourth chess piece set limits the first ideal game path.
[0388] In the apparatus, the priority of the set of preset killing methods comprises: a fourth type of priority, the fourth type of priority corresponding to at least one preset killing method arranged in a priority order, the fourth type of priority being lower than the third type of priority; in a case where the current priority belongs to the fourth type of priority, the second determination module 703 is further configured to: based on the game information and the game rule, determine a relative positional relationship between the current preset killing method and the winning side and the losing side of the decisive game; and in a case where the relative positional relationship satisfies a preset positional relationship, determine that the current preset killing method matches the decisive game.
[0389] In the apparatus, the priority of the set of preset killing methods comprises: a fifth type of priority, the fifth type of priority corresponding to at least one preset killing method arranged in a priority order, the fifth type of priority being lower than the fourth type of priority; in a case where the current priority belongs to the fifth type of priority, the second determination module 703 is further configured to: based on the game rule, respectively determine a second target chess piece in the winning side of the decisive game and a third target chess piece in the losing side of the decisive game, which match the current preset killing method; based on the game information, determine a fifth position of the second target chess piece in the decisive game and a sixth position of the third target chess piece in the decisive game; determine a third ideal position of the second target chess piece in the current preset killing method and a fourth ideal position of the third target chess piece in the current preset killing method; in a case where the fifth position matches the third ideal position and the sixth position matches the fourth ideal position, determine a second ideal game path of the losing side; in a case where the second target chess piece or the third target chess piece limits the second ideal game path, determine that the current preset killing method matches the decisive game.
[0390] In the apparatus, the priority of the preset killing method set comprises a sixth type priority, the sixth type priority corresponds to at least one preset killing method arranged in a priority order, and the sixth type priority is lower than the fifth type priority; in a case where the current priority belongs to the sixth type priority, the second determination module 703 is further configured to determine, based on the playing rule, a fourth target chess piece in the losing party of the killing position that matches the current preset killing method; in a case where the fourth target chess piece is in a first preset chessboard area corresponding to the current preset killing method, determine, based on the playing rule, a fifth target chess piece in the winning party of the killing position that matches the current preset killing method; in a case where the fifth target chess piece is in the first preset chessboard area, determine, based on the playing information, a number of chess pieces located between the fourth target chess piece and the fifth target chess piece on the first preset chessboard area; in a case where the number of chess pieces is a preset number of chess pieces, determine, based on the playing information, whether the fourth target chess piece is in a second preset chessboard area corresponding to the current preset killing method; the second preset chessboard area is different from the first preset chessboard area; and in response to the fourth target chess piece being in the second preset chessboard area, determine that the current preset killing method matches the killing position.
[0391] In the apparatus, the apparatus further comprises an interaction module configured to: display the target killing method by using a display mode corresponding to a preset application requirement; update a preset teaching database based on the target killing method and the playing information of the to-be-identified chess game; the preset teaching database is configured to provide a Chinese chess teaching example; and update and output a chess game ranking list corresponding to the to-be-identified chess game based on the target killing method.
[0392] In the apparatus, the to-be-identified chess game comprises Chinese chess, and the first identification module 702 is further configured to: identify, based on the playing information of the Chinese chess, a playing party that is under attack in the playing parties of the Chinese chess; in response to identifying the playing party that is under attack, detect a breaking path of the playing party that is under attack; and in response to not detecting the breaking path, determine that the Chinese chess enters the killing position.
[0393] Exemplary Devices
[0394] After the method of the exemplary embodiments of the present application is introduced, next, reference is made to Figure 8The chess killing method recognition device of the exemplary embodiment of the present application is described, which is 800 for implementing the chess killing method recognition method in the above embodiment by running the computer executable instructions on the memory by the processor. The chess killing method recognition device 800 comprises a processor 801, a communication interface 802, a memory 803, and a communication bus for realizing data transmission between each part. Among them, the communication interface 802 can assist the internal data transmission of the chess killing method recognition device 800, and can also realize the data transmission between the external device, such as the communication interface 802 as an external communication interface, which can realize the data transmission between the chess killing method recognition device 800 and the display screen and other output devices. The external communication interface can include standard wired interface and wireless interface. The processor 801 is configured to execute the image processing program in the memory to realize the chess killing method recognition method provided by the above embodiment. It should be noted that the chess killing method recognition device 800 can include but not limited to the above-mentioned components and the like, and the number of components can be configured or adjusted according to actual needs and the situation of the chess killing method recognition device 800, which is not limited here.
[0395] It should be noted that although several means or sub-means of the chess killing method recognition device are mentioned in the above detailed description, such division is merely not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more means described above can be embodied in one means. Conversely, the features and functions of one means described above can be further divided into several means.
[0396] In addition, although the operations of the method of the present application are described in a specific order in the accompanying drawings, this does not require or imply that the operations must be performed in this specific order, or that all of the shown operations must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, combined into one step, and / or divided into multiple steps.
[0397] It should be understood that each block of the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, so as to produce a machine, which executes the functions / operations specified in the block of the flowchart and / or block diagram.
[0398] These computer program instructions can also be stored in a computer- readable medium that can direct a computer, other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions
[0399] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0400] The use of the verbs "comprise", "comprising", "include", "including" and "includes" in the specification is not intended to exclude other elements or steps. The use of the articles "a" and "an" is not intended to be limiting in the sense of a single item, but rather is to be read as meaning "one or more".
[0401] While the principles and spirit of the application have been described with reference to several specific embodiments, it is to be understood that the application is not limited to the specific embodiments disclosed and that the division of aspects is not meant to imply that features from these aspects cannot be combined to benefit. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is intended to cover all such modifications and arrangements.
Claims
1. A method for identifying a chess kill, characterized in that, The method comprises: determining the game information of a game to be identified; based on the game information, identifying a checkmate situation of the game situation of the game to be identified; in response to identifying the checkmate situation, determining a target killing method matching the checkmate situation from a preset killing method set based on the game information and the game rules of the game to be identified; in response to identifying the checkmate situation, determining a target killing method matching the checkmate situation from a preset killing method set based on the game information and the game rules of the game to be identified, comprising: in response to identifying the checkmate situation, determining the priority order between different preset killing methods in the preset killing method set; the priority of the preset killing method set includes a first type of priority and a second type of priority, and the first type of priority and the second type of priority correspond to at least one preset killing method arranged in priority order respectively, and the second type of priority is lower than the first type of priority; based on the game information and the game rules, determine the target killing method in the preset killing method set that matches the checkmate situation according to the priority order; in the case where the current priority belongs to the second type of priority, the target killing method in the preset killing method set that matches the checkmate situation is determined according to the priority order based on the game information and the game rules, comprising: based on the priority order, determine the current preset killing method corresponding to the current priority; based on the game information and the game rules, determine a third piece set matching the current preset killing method in the winning side of the checkmate situation and a first target piece matching the current preset killing method in the losing side of the checkmate situation; in the third piece set, determine the candidate third piece that can reach the third position of the first target piece; in the case where the number of candidate third pieces is greater than or equal to a preset number threshold, it is determined that the current preset killing method matches the checkmate situation.
2. The method of claim 1, wherein, The determination of the game information of the game to be identified comprises: obtaining a first piece set of the game to be identified; determine the first position of the first piece in the first piece set in the game to be identified; based on the first position and the first piece set, determine the game information.
3. The method of claim 1, wherein, based on the priority order, determine the current preset killing method corresponding to the current priority; based on the game information and the game rules, determine whether the current preset killing method matches the checkmate situation; in response to the current preset killing method not matching the checkmate situation, determine the next priority of the current priority based on the priority order; wherein the next priority is lower than the current priority; based on the game information and the game rules, determine whether the preset killing method corresponding to the next priority matches the checkmate situation; in response to the preset killing method corresponding to the next priority matching the checkmate situation, determine the preset killing method corresponding to the next priority as the target killing method. 4. The method of claim 3, wherein, The priority of the preset kill method set comprises: a first type of priority, the first type of priority corresponding to at least one preset kill method arranged in priority order; In the case where the current priority belongs to the first type of priority, the determination of whether the current preset kill method matches the absolute kill situation based on the game information and the game rule comprises: determining, based on the game rule, a second chess piece set matched by the current preset kill method and a first ideal position of the second chess piece set in the current preset kill method; determining, in the absolute kill situation, a second position of a second chess piece in the second chess piece set based on the game information; in the case where the first ideal position and the second position match, determining that the current preset kill method matches the absolute kill situation.
5. The method of claim 4, wherein, The determination of the second chess piece set matched by the current preset kill method based on the game rule comprises: determining, based on the game rule, a winning side and a losing side in the absolute kill situation; determining, based on the current preset kill method, a chess piece matched with at least one of the winning side and the losing side to obtain the second chess piece set.
6. The method of claim 5, wherein, In the case where the current preset kill method is a preset kill method with the highest priority in the first type of priority, the determination of the chess piece matched with at least one of the winning side and the losing side based on the current preset kill method to obtain the second chess piece set comprises: determining, based on the preset kill method with the highest priority, a first target game round of the winning side of the to-be-identified chess game; wherein the first target game round is a game round in the to-be-identified chess game that satisfies a preset first game order; determining a chess piece of the first target game round in the absolute kill situation to obtain the second chess piece set; The determination of the first ideal position of the second chess piece set in the current preset kill method comprises: determining a center position of a field in the losing side of the to-be-identified chess game as the first ideal position.
7. The method of claim 3, wherein, The method further comprises: in response to the preset kill method with the lowest priority in the preset kill method set not matching the absolute kill situation, determining, based on the game information and the game rule, an absolute kill type of the absolute kill situation; updating the preset kill method set based on the absolute kill type to obtain an updated preset kill method set.
8. The method of claim 3, wherein, The priority of the preset kill method set comprises: a third type of priority, the third type of priority corresponding to at least one preset kill method arranged in priority order, and the third type of priority being lower than a second type of priority; In the case where the current priority belongs to the third type of priority, the determination of whether the current preset kill method matches the absolute kill situation based on the game information and the game rule comprises: determining, based on the game information, a second target game round matched with the current preset kill method; wherein the second target game round is a game round in the to-be-identified chess game that satisfies a preset second game order; and the second game order is different from a first game order; determining, in the absolute kill situation, a fourth position and a chess piece type of a fourth chess piece set of the second target game round; determine, based on the game rule, a second ideal position and an ideal type of the fourth chess piece set in the current preset killing method; determine a first ideal game path of a losing party in the to-be-identified chess game in a case that the fourth position matches the second ideal position and the chess piece type matches the ideal type; determine that the current preset killing method matches the checkmate situation in a case that the fourth chess piece set limits the first ideal game path.
9. The method of claim 3, wherein, The priority of the preset killing method set includes: a fourth type of priority, the fourth type of priority corresponds to at least one preset killing method arranged in a priority order, and the fourth type of priority is lower than the third type of priority; In a case that the current priority belongs to the fourth type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the checkmate situation includes: determine, based on the game information and the game rule, a relative position relationship between a chess piece matched by the current preset killing method and a winning party and a losing party in the checkmate situation; determine that the current preset killing method matches the checkmate situation in a case that the relative position relationship satisfies a preset position relationship.
10. The method of claim 3, wherein, The priority of the preset killing method set includes: a fifth type of priority, the fifth type of priority corresponds to at least one preset killing method arranged in a priority order, and the fifth type of priority is lower than the fourth type of priority; In a case that the current priority belongs to the fifth type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the checkmate situation includes: determine, based on the game rule, a second target chess piece in the winning party of the checkmate situation and a third target chess piece in the losing party of the checkmate situation which match the current preset killing method respectively; determine a fifth position of the second target chess piece in the checkmate situation and a sixth position of the third target chess piece in the checkmate situation based on the game information; determine a third ideal position of the second target chess piece in the current preset killing method and a fourth ideal position of the third target chess piece in the current preset killing method; determine a second ideal game path of the losing party in a case that the fifth position matches the third ideal position and the sixth position matches the fourth ideal position; determine that the current preset killing method matches the checkmate situation in a case that the second target chess piece or the third target chess piece limits the second ideal game path.
11. The method of claim 3, wherein, The priority of the preset killing method set includes: a sixth type of priority, the sixth type of priority corresponds to at least one preset killing method arranged in a priority order, and the sixth type of priority is lower than the fifth type of priority; In a case that the current priority belongs to the sixth type of priority, the determining, based on the game information and the game rule, whether the current preset killing method matches the checkmate situation includes: determine, based on the game rule, a fourth target chess piece in the losing party of the checkmate situation which matches the current preset killing method; In a case where the fourth target chess piece is in a first preset chessboard region corresponding to the current preset killing method, a fifth target chess piece that matches the current preset killing method is determined as a winning side of the checkmate situation based on the game rule; In a case where the fifth target chess piece is in the first preset chessboard region, a number of chess pieces located between the fourth target chess piece and the fifth target chess piece on the first preset chessboard region is determined based on the game information; In a case where the number of chess pieces is a preset number of chess pieces, it is determined whether the fourth target chess piece is in a second preset chessboard region corresponding to the current preset killing method based on the game information, wherein the second preset chessboard region is different from the first preset chessboard region; In response to the fourth target chess piece being in the second preset chessboard region, it is determined that the current preset killing method matches the checkmate situation.
12. The method of claim 1, wherein, After the target killing method that matches the checkmate situation is determined in the preset killing method set based on the game information and the game rule of the to-be-identified chess game in response to the checkmate situation being identified, the method further includes at least one of the following: The target killing method is displayed in a display mode corresponding to a preset application requirement; A preset teaching database is updated based on the target killing method and the game information of the to-be-identified chess game, wherein the preset teaching database is used to provide a Chinese chess teaching example; A chess game ranking list corresponding to the to-be-identified chess game is updated and output based on the target killing method.
13. The method of claim 1, wherein, The to-be-identified chess game includes Chinese chess, and the identification of the checkmate situation of the situation of the to-be-identified chess game based on the game information includes: A game side that is under attack in the Chinese chess is identified based on the game information of the Chinese chess; In response to the game side that is under attack being identified, a breaking path of the game side that is under attack is detected; In response to the breaking path not being detected, it is determined that the Chinese chess enters the checkmate situation.
14. A shogi kill move recognition device characterized by comprising: The device includes: A first determination module configured to determine game information of a to-be-identified chess game; A first identification module configured to identify a checkmate situation of a situation of the to-be-identified chess game based on the game information; A second determination module configured to determine a target killing method that matches the checkmate situation in a preset killing method set based on the game information and a game rule of the to-be-identified chess game in response to the checkmate situation being identified; The second determination module is further configured to determine a priority order between different preset killing methods in the preset killing method set in response to the checkmate situation being identified, wherein a priority of the preset killing method set includes a first type of priority and a second type of priority, the first type of priority and the second type of priority correspond to at least one preset killing method arranged in a priority order respectively, and the second type of priority is lower than the first type of priority; and the target killing method that matches the checkmate situation in the preset killing method set is determined according to the priority order based on the game information and the game rule. The second determining module is further configured to, in a case where the current priority belongs to the second type of priority, determine, based on the priority order, a current preset killing method corresponding to the current priority; determine, based on the game information and the game rule, a third chess piece set in the winning side of the decisive position that matches the current preset killing method and a first target chess piece in the losing side of the decisive position that matches the current preset killing method; determine, in the third chess piece set, a candidate third chess piece that can reach a third position of the first target chess piece; and determine that the current preset killing method matches the decisive position in a case where a quantity of the candidate third chess pieces is greater than or equal to a preset quantity threshold.
15. A computer storage medium, comprising, The computer storage medium has stored thereon computer executable instructions, which, when executed, implement the chess killing method identification method according to any one of claims 1 to 13.
16. A shogi kill move recognition device characterized by comprising: The chess killing method identification device includes a memory and a processor, the memory has stored thereon computer executable instructions, and the processor, when executing the computer executable instructions on the memory, can implement the chess killing method identification method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Go set chess playing method and device, electronic equipment and storage medium
CN113934766A