Chess game search methods, devices, electronic equipment and storage media
By identifying the types and coordinates of pieces in local chessboard shapes, transforming the piece coordinates using the chessboard's axis of symmetry, generating transformed chess groups, and determining target positions, this method solves the problem of low efficiency in automatic chess score searching in Go teaching, achieving fast and accurate chess score lookup and improving teaching effectiveness.
Patent Information
- Application Number
- CN202411299714.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In Go teaching, due to the octagonal rotation of the Go board and the fact that the black and white stones remain unchanged when interchanged, it is impossible to automatically search for game records through precise matching, resulting in low query efficiency and unreliable accuracy.
By identifying the piece categories and coordinates of local chess positions on the chessboard, transforming the piece coordinates using the chessboard's axis of symmetry, generating transformed chess groups, determining the target positions of the pieces, and performing a chess notation search based on the target positions to generate the target chess notation.
It enables fast and accurate game record search, improving the efficiency and accuracy of Go teaching and enhancing the user experience.
Smart Images

Figure CN119166845B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chess and card game teaching technology, and in particular to a chess game record search method, device, electronic device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, Go-playing robots have achieved remarkable success. Among them, the success of AlphaGo has not only refreshed people's understanding of AI technology, but also greatly promoted the modernization of Go teaching.
[0003] In Go teaching, to quickly understand certain knowledge points and apply them in actual games, it's necessary to find complete game records containing a specific opening shape for practice or technical explanation in fixed game scenarios. However, due to Go's octagonal rotation of shapes and the fact that black and white stones remain constant, it's impossible to automatically search for game records for opening shapes through precise matching. Manually searching game records through observation is not only extremely labor-intensive and inefficient, but the accuracy of the search results cannot be guaranteed. Summary of the Invention
[0004] In view of the above, embodiments of this disclosure provide a chess notation search method, apparatus, electronic device, and storage medium to at least partially solve the above-mentioned problems.
[0005] According to a first aspect of the present disclosure, a chess notation search method is provided, comprising: identifying the piece category and piece coordinates of each piece in a local chess shape on a chessboard to obtain an initial chess group of the local chess shape; transforming the piece coordinates of each piece in the initial chess group according to at least one given axis of symmetry of the chessboard to obtain at least one transformed chess group of the initial chess group; determining a target position for each piece according to the piece coordinates of each piece in the initial chess group and each transformed chess group respectively; and performing a chess notation search based on the target positions of at least a portion of the pieces in the local chess shape to obtain at least one target chess notation of the local chess shape.
[0006] According to a second aspect of the present disclosure, a chess notation search method apparatus is provided, comprising: an identification module for identifying the piece category and coordinates of each piece in a local chess shape on a chessboard, thereby obtaining an initial chess group of the local chess shape; a transformation module for transforming the coordinates of each piece in the initial chess group according to at least one given axis of symmetry of the chessboard, thereby obtaining at least one transformed chess group of the initial chess group; a processing module for determining a target position for each piece based on the coordinates of each piece in the initial chess group and each transformed chess group; and a search module for performing a chess notation search based on the target positions of at least a portion of the pieces in the local chess shape, thereby obtaining at least one target chess notation of the local chess shape.
[0007] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the chess notation search method described in the first aspect.
[0008] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are configured to cause the computer to perform the chess notation search method as described in the first aspect.
[0009] In summary, the game record search methods and solutions provided in this disclosure, by transforming and sorting the coordinates of each piece in a local game shape to generate a unique position code, can quickly and accurately query all game records containing local game shapes. This not only improves the efficiency of game record search but also enhances the effectiveness of Go teaching. Attached Figure Description
[0010] Further details, features, and advantages of this disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0011] Figure 1 A flowchart illustrating the chess notation search method as an exemplary embodiment of this disclosure.
[0012] Figures 2A to 2B A schematic diagram illustrating the application of the chess notation search method for implementing exemplary embodiments of this disclosure.
[0013] Figure 3 A schematic diagram illustrating data generation for implementing the chess notation search method of the exemplary embodiments of this disclosure.
[0014] Figures 4A to 4D A schematic diagram illustrating the application of the chess notation search method for implementing exemplary embodiments of this disclosure.
[0015] Figure 5 This is a structural block diagram of a chess notation search method apparatus that is an exemplary embodiment of the present disclosure.
[0016] Figure 6 This is a schematic diagram of the architecture of an electronic device that is an exemplary embodiment of this disclosure. Detailed Implementation
[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0018] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0019] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that, unless explicitly stated in the context, they should be understood as "one or more". The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0021] Because Go has the characteristics of an octagonal rotating board shape and the fact that black and white pieces remain unchanged when interchanged, it is impossible to automatically search for game records using precise matching methods for Go layouts.
[0022] In view of this, the embodiments of this disclosure provide a chess notation search method, which aims to take advantage of the characteristics of Go, such as the octagonal rotation of the board shape and the invariance of black and white pieces when they are interchanged. By performing category conversion and coordinate transformation on the pieces in any local board shape, it can quickly and accurately find all chess notations containing the local board shape, and is applicable to the rapid query of chess notations of various chess types.
[0023] The specific implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0024] Figure 1 This is a flowchart illustrating the chess notation search method as an exemplary embodiment of the present disclosure. As shown in the figure, this embodiment mainly includes the following steps:
[0025] Step 102: Identify the piece category and coordinates of each piece in the local chess pattern on the chessboard to obtain the initial chess group of the local chess pattern.
[0026] In some embodiments, the piece categories include friendly pieces and opponent pieces, and the initial pieces group includes a first initial pieces group and a second initial pieces group.
[0027] In some embodiments, the local chess pattern on the chessboard can be saved to obtain the original chess record of the local chess pattern (e.g., an SGF chess record file), the chess piece category and chess piece coordinates of each piece in the original chess record can be identified to obtain the first initial chess group of the local chess pattern, and the chess piece category of each piece in the first initial chess group can be changed from one's own piece to the opponent's piece or from the opponent's piece to one's own piece to obtain the second initial chess group of the local chess pattern.
[0028] In this embodiment, the chessboard is a Go board, and the types of chess pieces include black and white pieces.
[0029] For example, in Figure 2A and Figure 2B In the example shown, the original game record contains white piece 1, black piece 1, black piece 2, and black piece 3. The first initial game group generated is [white piece 1, black piece 1, black piece 2, black piece 3]. The black and white colors of each piece in the first initial game group can be swapped to generate the second initial game group [black piece 1', white piece 1', white piece 2', white piece 3'].
[0030] Step 104: Based on at least one given axis of symmetry of the chessboard, transform the coordinates of each piece in the initial chess set to obtain at least one transformed chess set of the initial chess set.
[0031] In some embodiments, one of the first initial chess group and the second initial chess group can be determined as the target chess group. Based on each given axis of symmetry of the chessboard, the coordinates of each piece in the target chess group are transformed to obtain the transformed chess group of the target chess group corresponding to each given axis of symmetry.
[0032] In this embodiment, a given axis of symmetry may include a diagonal axis of symmetry, a horizontal axis of symmetry, a horizontal diagonal axis of symmetry, a vertical axis of symmetry, a vertical diagonal axis of symmetry, a center point symmetry, and a center point diagonal axis of symmetry.
[0033] Specifically, based on seven given axes of symmetry, the coordinates of each piece in the first initial group [White 1, Black 1, Black 2, Black 3] can be transformed to obtain seven transformed groups of the first initial group (see reference). Figure 2A The coordinates of each piece in the second initial group [Black 1', White 1', White 2', White 3'] are transformed to obtain 7 transformed groups of the second initial group (see reference). Figure 2B ).
[0034] Step 106: Determine a target position for each piece based on its coordinates in the initial set and each transformed set.
[0035] In some embodiments, the initial chess group and each transformed chess group of the initial chess group can be determined as a unit chess group in a chess group set, and the position code value of each piece in each unit chess group can be determined according to the piece coordinates of each piece in each unit chess group.
[0036] For example, it can be Figure 2A The first initial chess group and the seven transformed chess groups shown are determined as the unit chess groups in the first chess group set, according to Figure 2A The coordinates of each piece in each unit group are used to obtain the position codes of "White 1" in each unit group as "ar", "ct", "tr", "rt", "tc", "ra", "ca", "ac", and the position codes of "Black 1" in each unit group as "aq", "dt", "qt", "tq", "td", "qa", "da", "ad", and so on. Figure 2B The second initial chess group shown and the seven transformed chess groups of the second initial chess group are determined as the unit chess groups in the second chess group set, according to Figure 2B The coordinates of each piece in each unit group are used to obtain the position code values of "Black 1'" in each unit group as "ar", "ct", "tr", "rt", "tc", "ra", "ca", "ac", and the position code values of "White 1'" as "aq", "dt", "qt", "tq", "td", "qa", "da", "ad", and so on.
[0037] In some embodiments, the position code values of each piece in the same unit group within the chess group set can be combined to obtain a position code array of 8 unit groups in the chess group set (see reference). Figure 3 ).
[0038] In some embodiments, for any current piece among all pieces, a comparison is performed based on the position code value of the current piece in each unit group, and the smallest position code value is determined as the unique target position code of the current piece.
[0039] In this embodiment, the position code value of the current piece in each unit group can be compared according to the natural alphabetical order, and the smallest position code value is used as the target position code of the current piece. For example, in Figure 3 In the example shown, for the first piece ("Black 1") in each unit group of the first set of chess pieces, the position code values of "Black 1" in the eight unit groups are compared with "aq", "qa", "ad", "da", "sq", "qs", "sc", and "cs", and "ad" is determined as the target position code of "Black 1".
[0040] In some embodiments, the target position codes of each piece can be combined according to the positional order of each piece in each unit group to form a target group, as shown in the reference. Figure 3 The first target chess group [ad bc bd#ac] and the second target chess group [ac#ad bc bd] are shown.
[0041] In some embodiments, a given separator can be used to separate the different types of pieces in each unit group and the target group. For example, "#" can be used to separate the white and black pieces in each unit group and the target group, where the left side of "#" represents the position code of the black piece and the right side of "#" represents the position code of the white piece.
[0042] Step 108: Perform a chess record search based on the target positions of at least some pieces in the local chess pattern to obtain at least one target chess record of the local chess pattern.
[0043] In some embodiments, the search code of the local chess pattern can be determined based on the positional encoding value of each piece in the local chess pattern, and a chess notation search can be performed based on the search code of the local chess pattern to obtain each target chess notation of the local chess pattern. For example, it can be based on... Figure 4A The local chess pattern shown (the chess pattern to be searched) yields... Figure 4B The target game record (corresponding to the original local shape), Figure 4C The target game record (corresponding to the angle-symmetric transformation of the local game shape). Figure 4D The target chess notation (corresponding to the symmetrical transformation of the center point of the local chess shape).
[0044] Specifically, by using the inverted index generated from the original chess notation, the complete set of chess notation numbers corresponding to the target chess group can be quickly retrieved. Based on the complete set of chess notation numbers, a subset containing the coordinates of all pieces in the target chess group can be calculated to obtain all the target chess notation numbers.
[0045] In some embodiments, after obtaining at least one target chess score of a local chess pattern, an inverted index data structure of the local chess pattern can be generated and stored based on the target position of each piece in the local chess pattern, the chess score number of each target chess score, and the correspondence between the initial chess group corresponding to the local chess pattern.
[0046] For example, Figure 3 The local chess patterns shown correspond to the inverted index data structure of the first initial chess group and the inverted index data structure of the second initial chess group. Each inverted index data structure consists of three structural units: "piece position", "chess record number", and "chess record type". Among them, chess record type "0" is used to identify the target chess record obtained based on the search of "first initial chess group (without piece category conversion)" and chess record type "1" is used to identify the target chess record obtained based on the search of "second initial chess group (with piece category conversion)".
[0047] In some embodiments, each target chess piece in a local chess pattern can be highlighted.
[0048] In summary, the game record search method of this embodiment, based on the characteristics of Go—that the shape of the board rotates in an octagon and the black and white of the pieces remain unchanged—transforms the piece type and coordinate position of each piece in the original shape (local shape) to obtain multiple transformed shapes of the original shape. By comparing the coordinate position of each piece in different shapes, the smallest coordinate value is used as the unique position code for each piece to perform game record lookup. This method can accurately retrieve all game records containing local shapes, effectively improving the efficiency of game record search.
[0049] Furthermore, this embodiment utilizes an inverted index data structure of local chess positions to enable rapid querying of chess scores, improving query efficiency. By highlighting the chess score content that matches the original chess position, users can easily and intuitively understand the query results, enhancing the user experience.
[0050] Figure 5 A structural block diagram of a chess notation search method apparatus according to an exemplary embodiment of the present disclosure is shown. As shown, the chess notation search method apparatus 500 of this embodiment includes:
[0051] The identification module 502 is used to identify the piece category and coordinates of each piece in a local chess pattern on the chessboard, and to obtain the initial chess group of the local chess pattern;
[0052] Transformation module 504 is used to transform the coordinates of each piece in the initial chess group according to at least one given axis of symmetry of the chessboard, so as to obtain at least one transformed chess group of the initial chess group.
[0053] Processing module 506 is used to determine a target position for each piece based on the piece coordinates in the initial piece group and each transformed piece group respectively;
[0054] Search module 508 is used to perform a chess score search based on the target positions of at least some pieces in the local chess pattern, and obtain at least one target chess score of the local chess pattern.
[0055] In some embodiments, the piece categories include friendly pieces and opponent pieces, and the initial set includes a first initial set and a second initial set.
[0056] In some embodiments, the identification module 502 is further configured to: save the local chess pattern on the chessboard to obtain the original chess record of the local chess pattern; identify the chess piece category and chess piece coordinates of each piece in the original chess record to obtain the first initial chess group of the local chess pattern; and change the chess piece category of each piece in the first initial chess group from the player's piece to the opponent's piece or from the opponent's piece to the player's piece to obtain the second initial chess group of the local chess pattern.
[0057] In some embodiments, the transformation module 504 is further configured to: determine one of the first initial chess group and the second initial chess group as the target chess group; transform the coordinates of each piece in the target chess group based on each given axis of symmetry of the chessboard to obtain the transformed chess group of the target chess group corresponding to each given axis of symmetry; wherein, the given axis of symmetry includes a diagonal axis of symmetry, a horizontal axis of symmetry, a horizontal diagonal axis of symmetry, a vertical axis of symmetry, a vertical diagonal axis of symmetry, a center point axis of symmetry, and a center point diagonal axis of symmetry.
[0058] In some embodiments, the processing module 506 is further configured to: determine the initial chess group and each transformed chess group of the initial chess group as a unit chess group in a chess group set; obtain the position code value of each chess piece in each unit chess group according to the chess piece coordinates of each chess piece in each unit chess group; for any current chess piece among all chess pieces, perform a comparison according to the position code value of the current chess piece in each unit chess group, and determine the smallest position code value as the target position code of the current chess piece.
[0059] In some embodiments, the search module 508 is further configured to: determine the search code of the local chess pattern from the position code value of each piece in the local chess pattern, perform a chess record search based on the search code of the local chess pattern, and obtain each target chess record of the local chess pattern, wherein the local chess pattern includes at least three pieces.
[0060] In some embodiments, after obtaining at least one target chess score of the local chess pattern, an inverted index data structure of the local chess pattern can be generated based on the target position of each piece in the local chess pattern, the chess score number of each target chess score, and the correspondence between the initial chess group corresponding to the local chess pattern.
[0061] In some embodiments, the chessboard includes a Go board, and the types of pieces include black and white pieces.
[0062] This disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the chess notation search method described in the exemplary embodiments of this disclosure.
[0063] Exemplary embodiments of this disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, causing the electronic device to perform the chess notation search method according to various exemplary embodiments of this disclosure.
[0064] Please refer to Figure 6 The present invention describes a structural block diagram of an electronic device 600 that can serve as a server or client of this disclosure, which is an example of a hardware device that can be applied to various aspects of this disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the disclosure described and / or claimed herein.
[0065] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0066] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to electronic device 600. Input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 may include, but is not limited to, disks and optical discs. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0067] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the chess notation search method described above can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured to perform the chess notation search method described above by any other suitable means (e.g., by means of firmware).
[0068] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0069] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0070] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0071] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0072] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or middleware components (e.g., an application server), or frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0073] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other.
[0074] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this disclosure can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this disclosure.
[0075] The above embodiments are only used to illustrate the embodiments of this disclosure, and are not intended to limit the embodiments of this disclosure. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this disclosure. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this disclosure, and the patent protection scope of the embodiments of this disclosure should be defined by the claims.
Claims
1. A method for searching chess scores, comprising: Identify the piece category and coordinates of each piece in a local chess pattern on the chessboard to obtain the initial piece group of the local chess pattern; Based on at least one given axis of symmetry of the chessboard, the coordinates of each piece in the initial chess group are transformed to obtain at least one transformed chess group of the initial chess group; Based on the coordinates of each piece in the initial chess group and each transformed chess group, determine a target position for each piece, including: determining the initial chess group and each transformed chess group of the initial chess group as a unit chess group in a chess group set; Based on the coordinates of each piece in each unit group, determine the position code value of each piece in each unit group; for any current piece, perform a comparison based on the position code value of the current piece in each unit group, and determine the smallest position code value as the target position code of the current piece; Based on the target positions of at least some pieces in the local chess pattern, a chess record search is performed to obtain at least one target chess record of the local chess pattern.
2. The method according to claim 1, wherein, The types of chess pieces include friendly pieces and opponent's pieces, and the initial chess group includes a first initial chess group and a second initial chess group; The process of identifying the piece category and coordinates of each piece in a local chess pattern on the chessboard to obtain the initial piece group of the local chess pattern includes: Save the local chess pattern on the chessboard to obtain the original chess score of the local chess pattern; Identify the piece category and coordinates of each piece in the original chess notation to obtain the first initial group of the local chess shape; The piece category of each piece in the first initial piece group is changed from a friendly piece to an opponent's piece or vice versa, to obtain the second initial piece group of the local shape.
3. The method according to claim 2, wherein, The coordinates of each piece in the initial chess group are transformed according to at least one given axis of symmetry of the chessboard to obtain at least one transformed chess group of the initial chess group; One of the first initial chess group and the second initial chess group is determined as the target chess group; Based on each given axis of symmetry of the chessboard, the coordinates of each piece in the target chess group are transformed to obtain the transformed chess group of the target chess group corresponding to each given axis of symmetry. The given axis of symmetry includes a diagonal axis of symmetry, a horizontal axis of symmetry, a horizontal diagonal axis of symmetry, a vertical axis of symmetry, a vertical diagonal axis of symmetry, a center point axis of symmetry, and a center point diagonal axis of symmetry.
4. The method according to claim 1, wherein, The step of performing a chess notation search based on the target positions of at least a portion of the pieces in the local chess formation to obtain at least one target chess notation of the local chess formation includes: The search code for the local chess pattern is determined based on the position code value of each piece in the local chess pattern. Based on the search encoding of the local chess pattern, a chess record search is performed to obtain each target chess record of the local chess pattern; The local chess pattern includes at least three pieces.
5. The method according to claim 1 or 4, wherein, The initial chess group includes a first initial chess group and a second initial chess group; The method further includes, after obtaining at least one target chess score of the local chess pattern: Based on the target position of each piece in the local chess pattern, the chess number of each target chess record, and the correspondence between the initial chess group corresponding to the local chess pattern, an inverted index data structure for the local chess pattern is generated.
6. The method according to claim 1, wherein, The chessboard includes a Go board, and the types of pieces include black and white pieces.
7. A chess notation search device, comprising: The identification module is used to identify the piece category and coordinates of each piece in a local chess pattern on the chessboard, and to obtain the initial chess group of the local chess pattern; A transformation module is used to transform the coordinates of each piece in the initial chess group according to at least one given axis of symmetry of the chessboard, so as to obtain at least one transformed chess group of the initial chess group; The processing module is used to determine a target position for each piece based on its coordinates in the initial chess group and each transformed chess group, including: defining the initial chess group and each transformed chess group of the initial chess group as unit chess groups in a chess group set; determining the position code value of each piece in each unit chess group based on its coordinates; and for any current piece, performing a comparison based on the position code value of the current piece in each unit chess group, and determining the smallest position code value as the target position code of the current piece. The search module is used to perform a chess score search based on the target positions of at least some pieces in the local chess pattern, and obtain at least one target chess score of the local chess pattern.
8. An electronic device, comprising: processor; as well as Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the chess notation search method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the chess notation search method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data processing method and device for chess game
CN107433032A
A retrieval system of baduk records and a method ofthe same
KR1020020032009A