Chess manual searching method and device, electronic equipment and storage medium
By transforming the chess pieces of the local chess shape of the Go board, a unique position code was generated, which solved the problem of inefficient automatic search of chess scores in Go teaching, and achieved rapid and accurate chess score query, improving teaching effect.
Patent Information
- Application Number
- CN202411299714.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In Go teaching, due to the unchanging characteristics of chess-shaped octagonal rotation and chess piece black and white interchange, automatic search of chess scores cannot be achieved through precise matching, resulting in low query efficiency and unavailability to guarantee.
By identifying the chess pieces of the local chess shape of the chess board, an initial chess group is generated, and the chess piece coordinates are transformed according to the given symmetry axis, the target position is determined, and the chess score search is performed based on the target position, and a unique position code is generated to quickly and accurately query the chess score.
It improves the efficiency and accuracy of chess score search, can quickly find all chess scores containing local chess shapes, and improves the effectiveness of Go teaching.
Smart Images

Figure CN119166845A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of chess and card teaching, and in particular to a chess record search method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of artificial intelligence (AI) technology, Go robots have achieved remarkable achievements. Among them, the success of AlphaGo not only refreshed people's understanding of AI technology, but also greatly promoted the modernization of Go teaching.
[0003] In the process of teaching Go, in order to quickly understand certain knowledge points and apply them in actual combat, it is necessary to find a complete chess record containing a certain layout and shape, so as to achieve game practice or technical explanation in certain fixed chess game scenarios. However, due to the characteristics of Go that the chess shape can rotate in an octagon and the black and white pieces can be interchanged, it is impossible to automatically search for the layout and shape of Go through precise matching. If the manual query of the chess record is performed through human observation, not only the workload is huge and the query efficiency is relatively low, but the accuracy of the chess record query results cannot be guaranteed. Summary of the invention
[0004] In view of this, the embodiments of the present disclosure provide a chess record search method, device, electronic device, and storage medium to at least partially solve the above problems.
[0005] According to a first aspect of an embodiment of the present disclosure, a chess record search method is provided, comprising: identifying a chess piece category and a chess piece coordinate of each chess piece in a local chess shape on a chessboard to obtain an initial chess set of the local chess shape; transforming the chess piece coordinate of each chess piece in the initial chess set according to at least one given symmetry axis of the chessboard to obtain at least one transformed chess set of the initial chess set; determining a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set respectively; performing a chess record search based on the target positions of at least a part of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape.
[0006] According to a second aspect of an embodiment of the present disclosure, a chess record search method and apparatus is provided, comprising: an identification module, used to identify the chess piece category and chess piece coordinates of each chess piece in a local chess shape on a chessboard, and obtain an initial chess set of the local chess shape; a transformation module, used to transform the chess piece coordinates of each chess piece in the initial chess set according to at least one given symmetry axis of the chessboard, and obtain at least one transformed chess set of the initial chess set; a processing module, used to determine a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set respectively; and a search module, used to perform a chess record search based on the target positions of at least a part of the chess pieces in the local chess shape, and obtain at least one target chess record of the local chess shape.
[0007] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory storing a program, wherein the program comprises instructions, and when the instructions are executed by the processor, the processor executes the chess record search method described in the first aspect.
[0008] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the chess record search method as described in the first aspect.
[0009] In summary, the chess record search method provided by various aspects of the present disclosure transforms and sorts the chess piece coordinates of each chess piece in a local chess shape to generate a unique position code, so as to quickly and accurately query all chess records containing the local chess shape, which not only improves the efficiency of chess record search, but also improves the effect of Go teaching. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:
[0011] Figure 1 The figure is a process flow chart of a chess record search method according to an exemplary embodiment of the present disclosure.
[0012] FIG. 2A to FIG. 2B The figure is a schematic diagram of an application of the chess record search method according to the exemplary embodiment of the present disclosure.
[0013] Figure 3 The present invention is a schematic diagram of data generation for implementing the chess record search method according to the exemplary embodiment of the present disclosure.
[0014] FIG. 4A to FIG. 4D The figure is a schematic diagram of an application of the chess record search method according to the exemplary embodiment of the present disclosure.
[0015] Figure 5 It is a structural block diagram of a chess record search method and device according to an exemplary embodiment of the present disclosure.
[0016] Figure 6 It is a schematic diagram of the architecture of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0018] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0019] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0020] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more". The names of the messages or information exchanged between the multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0021] Since Go has the characteristics of octagonal rotation of chess pieces and the interchange of black and white chess pieces, it is impossible to automatically search for the layout of Go chess pieces through precise matching.
[0022] In view of this, various embodiments of the present disclosure provide a method for searching chess records, which aims to utilize the characteristics of Go that the octagonal rotation of the chess shape and the black and white interchange of the chess pieces remain unchanged, and to quickly and accurately find all chess records containing the local chess shape by performing category conversion and coordinate transformation on the chess pieces in any local chess shape. The method is suitable for fast query of chess records of various chess types.
[0023] The specific implementation of each embodiment of the present disclosure will be described in detail below in conjunction with the accompanying drawings.
[0024] Figure 1 The following is a flowchart of a chess record search method according to an exemplary embodiment of the present disclosure. As shown in the figure, this embodiment mainly includes the following steps:
[0025] Step 102: Identify the chess piece category and chess piece coordinates of each chess piece in the local chess shape on the chessboard to obtain an initial chess piece group of the local chess shape.
[0026] In some embodiments, the chess piece categories include own chess pieces and opponent chess pieces, and the initial chess group includes a first initial chess group and a second initial chess group.
[0027] In some embodiments, a local chess shape in a chessboard may be saved to obtain an original chess record of the local chess shape (e.g., an SGF chess record file), the chess piece category and chess piece coordinates of each chess piece in the original chess record may be identified to obtain a first initial chess set of the local chess shape, and the chess piece category of each chess piece in the first initial chess set may be transformed from one's own chess piece to an opponent's chess piece or from an opponent's chess piece to one's own chess piece to obtain a second initial chess set of the local chess shape.
[0028] In this embodiment, the chessboard is a Go chessboard, and the chess piece categories include black pieces and white pieces.
[0029] For example, in Figure 2A and Figure 2B In the example shown, the original chess record includes white chess 1, black chess 1, black chess 2 and black chess 3, and the generated first initial chess group is [white chess 1, black chess 1, black chess 2, black chess 3]. The black and white colors of each chess piece in the first initial chess group can be swapped to generate a second initial chess group [black chess 1', white chess 1', white chess 2', white chess 3'].
[0030] Step 104: transform the chess piece coordinates of each chess piece in the initial chess set according to at least one given symmetry axis of the chess board 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, and based on each given axis of symmetry of the chessboard, the chess piece coordinates of each chess piece in the target chess group are transformed to obtain a transformed chess group of the target chess group corresponding to each given axis of symmetry.
[0032] In this embodiment, the given symmetry axis may include a diagonal symmetry axis, a transverse symmetry axis, a transverse diagonal symmetry axis, a vertical symmetry axis, a vertical diagonal symmetry axis, a center point symmetry, and a center point diagonal symmetry axis.
[0033] Specifically, the chess piece coordinates of each chess piece in the first initial chess set [white chess piece 1, black chess piece 1, black chess piece 2, black chess piece 3] can be transformed according to the 7 given symmetry axes to obtain 7 transformed chess sets of the first initial chess set (refer to Figure 2A ), and transform the chess piece coordinates of each chess piece in the second initial chess set [black chess 1', white chess 1', white chess 2', white chess 3'] to obtain 7 transformed chess sets of the second initial chess set (reference Figure 2B ).
[0034] Step 106: Determine a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set.
[0035] In some embodiments, the initial chess group and each transformed chess group of the initial chess group can be determined as unit chess groups in a chess group set, and the position coding value of each chess piece in each unit chess group can be determined according to the chess piece coordinates of each chess piece in each unit chess group.
[0036] For example, Figure 2A The first initial chess group and the seven transformed chess groups of the first initial chess group are determined as the unit chess groups in the first chess group set. Figure 2A The chess piece coordinates of each chess piece in each unit chess group are obtained, and the position coding values of "White Chess 1" in each unit chess group are "ar", "ct", "tr", "rt", "tc", "ra", "ca", "ac", and the position coding values of "Black Chess 1" in each unit chess group are "aq", "dt", "qt", "tq", "td", "qa", "da", "ad", and so on. Figure 2B The second initial chess group and the 7 transformed chess groups of the second initial chess group are determined as the unit chess groups in the second chess group set. Figure 2B The chess piece coordinates of each chess piece in each unit chess group are obtained, and the position coding values of "Black chess 1'" in each unit chess group are "ar", "ct", "tr", "rt", "tc", "ra", "ca", "ac", and the position coding values of "White chess 1'" are "aq", "dt", "qt", "tq", "td", "qa", "da", "ad", and so on.
[0037] In some embodiments, the position code value of each chess piece in the same unit chess set in the chess set can be combined to obtain the position code array of the eight unit chess sets in the chess set (refer to Figure 3 ).
[0038] In some embodiments, for any current chess piece among the chess pieces, a comparison is performed based on the position code value of the current chess piece in each unit chess group, and the smallest position code value is determined as the unique target position code of the current chess piece.
[0039] In this embodiment, the position code values of the current chess piece in each unit chess group can be compared according to the natural order of English letters, and the smallest position code value is used as the target position code of the current chess piece. Figure 3 In the example shown, for the first chess piece ("Black 1") in each unit chess group of the first chess group set, the position coding values "aq", "qa", "ad", "da", "sq", "qs", "sc", and "cs" of "Black 1" in the 8 unit chess groups are compared, and "ad" is determined as the target position coding of "Black 1".
[0040] In some embodiments, the target position code of each chess piece can be combined according to the position sequence of each chess piece in each unit chess set to form a target chess set. 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 different chess piece categories in each unit chess group and the target chess group. For example, "#" is used to separate the white and black chess pieces in each unit chess group and the target chess group, where the left side of "#" represents the position code of the black chess piece, and the right side of "#" represents the position code of the white chess piece.
[0042] Step 108: Perform a chess record search based on the target positions of at least a portion of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape.
[0043] In some embodiments, the search code of the local chess shape can be determined according to the position code value of each chess piece in the local chess shape, and the chess record search is performed based on the search code of the local chess shape to obtain each target chess record of the local chess shape. Figure 4A The local chess shape (chess shape to be searched) shown in Figure 4B The target chess record (corresponding to the original local chess shape), Figure 4C The target chess game (corresponding to the angular symmetric transformation of the local chess shape), Figure 4D The target chess game (the chess shape is transformed symmetrically corresponding to the center point of the local chess shape).
[0044] Specifically, by using the inverted index generated by the original chess record, the full set of chess record numbers corresponding to the target chess group can be quickly queried, and a subset of all chess piece coordinates of the target chess group can be calculated based on the full set of chess record numbers to obtain all target chess record numbers.
[0045] In some embodiments, after obtaining at least one target chess record of a local chess shape, an inverted index data structure of the local chess shape can be generated and stored according to the correspondence between the target position of each chess piece in the local chess shape, the chess record number of each target chess record, and the initial chess group corresponding to the local chess shape.
[0046] For example, Figure 3 The local chess shapes shown correspond to the inverted index data structure of the first initial chess group and the inverted index data structure corresponding to the second initial chess group. Each inverted index data structure is composed of three structural units: "chess piece position", "chess record number" and "chess record type". Among them, the chess record type "0" is used to identify the target chess record obtained by searching based on the "first initial chess group (chess piece category conversion is not performed)", and the chess record type "1" is used to identify the target chess record obtained by searching based on the "second initial chess group (chess piece category conversion is performed)".
[0047] In some embodiments, each target game record of the local game shape may be highlighted.
[0048] In summary, the chess record search method of this embodiment converts the chess piece type and coordinate position of each chess piece in the original chess shape (partial chess shape) according to the characteristics of Go that the chess shape can be rotated in an octagonal manner and the chess pieces can be interchanged without changing black and white. A plurality of transformed chess shapes of the original chess shape are obtained. By comparing the coordinate position of each chess piece in different chess shapes, the one with the smallest coordinate value is used as the unique position code of each chess piece to perform chess record query. All chess records containing the partial chess shape can be accurately queried, thereby effectively improving the efficiency of chess record search.
[0049] In addition, this embodiment uses the inverted index data structure of the local chess shape to realize the rapid query of chess records and improve the efficiency of chess record query. By highlighting the chess record content that matches the original chess shape, it is convenient for users to intuitively understand the chess record query results and improve the user experience.
[0050] Figure 5 The structure block diagram of the chess record search method device of the exemplary embodiment of the present disclosure is shown. As shown in the figure, the chess record search method device 500 of this embodiment includes:
[0051] An identification module 502 is used to identify the chess piece category and chess piece coordinates of each chess piece in a local chess shape on the chessboard, and obtain an initial chess piece group of the local chess shape;
[0052] A transformation module 504, configured to transform the chess piece coordinates of each chess piece in the initial chess set according to at least one given symmetry axis of the chess board, to obtain at least one transformed chess set of the initial chess set;
[0053] A processing module 506 is used to determine a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set;
[0054] The search module 508 is configured to perform a chess record search based on the target positions of at least a part of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape.
[0055] In some embodiments, the chess piece categories include own chess pieces and opponent chess pieces, and the initial chess group includes a first initial chess group and a second initial chess group.
[0056] In some embodiments, the recognition module 502 is further used to: save the local chess shape in the chessboard to obtain the original chess record of the local chess shape; identify the chess piece category and chess piece coordinates of each chess piece in the original chess record to obtain the first initial chess group of the local chess shape; transform the chess piece category of each chess piece in the first initial chess group from the own chess piece to the opponent's chess piece or from the opponent's chess piece to the own chess piece to obtain the second initial chess group of the local chess shape.
[0057] In some embodiments, the transformation module 504 is further used to: determine one of the first initial chess group and the second initial chess group as the target chess group; based on each given symmetry axis of the chessboard, transform the chess piece coordinates of each chess piece in the target chess group to obtain a transformed chess group of the target chess group corresponding to each given symmetry axis; wherein the given symmetry axis includes a diagonal symmetry axis, a horizontal symmetry axis, a horizontal diagonal symmetry axis, a vertical symmetry axis, a vertical diagonal symmetry axis, a center point symmetry axis, and a center point diagonal symmetry axis.
[0058] In some embodiments, the processing module 506 is further used to: determine the initial chess group and each transformed chess group of the initial chess group as unit chess groups in a chess group set; obtain the position coding 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 the chess pieces, perform a comparison according to the position coding value of the current chess piece in each unit chess group, and determine the smallest position coding value as the target position coding of the current chess piece.
[0059] In some embodiments, the search module 508 is further used to: determine the search code of the local chess shape from the position code value of each chess piece in the local chess shape, perform chess record search based on the search code of the local chess shape, and obtain each target chess record of the local chess shape, wherein the local chess shape includes at least three chess pieces.
[0060] In some embodiments, after obtaining at least one target chess record of the local chess shape, an inverted index data structure of the local chess shape can be generated according to the correspondence between the target position of each chess piece in the local chess shape, the chess record number of each target chess record, and the initial chess group corresponding to the local chess shape.
[0061] In some embodiments, the chessboard includes a Go board, and the chess piece categories include black pieces and white pieces.
[0062] The embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the chess record search method described in each exemplary embodiment of the present disclosure.
[0063] The exemplary embodiments of the present disclosure also provide an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and when the computer program is executed by the at least one processor, the electronic device executes the chess record search method according to each exemplary embodiment of the present disclosure.
[0064] Please refer to Figure 6 , a block diagram of an electronic device 600 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, 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 processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0065] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to 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. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0066] A plurality of components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 may be any type of device capable of inputting information to the electronic device 600, and the input unit 606 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 607 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 may include, but is not limited to, a disk, an optical disk. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0067] The computing unit 601 may be a variety of general and / or special 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 dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the chess search method as described above may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. In some embodiments, the computing unit 601 may be configured to perform the chess search method described above in any other appropriate manner (e.g., by means of firmware).
[0068] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0069] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, 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, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. 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 (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0072] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0073] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and the server relationship is generated by computer programs running on respective computers and having a client-server relationship with each other.
[0074] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present disclosure can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present disclosure.
[0075] The above implementation methods are only used to illustrate the embodiments of the present disclosure, and are not limitations of the embodiments of the present disclosure. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present disclosure. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present disclosure. The scope of patent protection of the embodiments of the present disclosure should be defined by the claims.
Claims
1. A chess record search method, comprising: Identify the chess piece category and chess piece coordinates of each chess piece in the local chess shape on the chessboard, and obtain an initial chess piece group of the local chess shape; According to at least one given symmetry axis of the chessboard, transform the chess piece coordinates of each chess piece in the initial chess set to obtain at least one transformed chess set of the initial chess set; Determine a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set; A chess record search is performed based on the target positions of at least a part of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape.
2. The method according to claim 1, wherein: The chess piece categories include own chess pieces and opponent chess pieces, and the initial chess groups include a first initial chess group and a second initial chess group; The step of identifying the chess piece category and chess piece coordinates of each chess piece in the local chess shape on the chessboard to obtain the initial chess piece group of the local chess shape includes: Saving the local chess shape in the chessboard to obtain an original chess record of the local chess shape; Identify the chess piece category and chess piece coordinates of each chess piece in the original chess record to obtain the first initial chess piece group of the local chess shape; The chess piece category of each chess piece in the first initial chess set is changed from the own chess piece to the opponent's chess piece or from the opponent's chess piece to the own chess piece, so as to obtain the second initial chess set of the local chess shape.
3. The method according to claim 1, wherein: transforming the chess piece coordinates of each chess piece in the initial chess set according to at least one given symmetry axis of the chess board to obtain at least one transformed chess set of the initial chess set; Determine one of the first initial chess group and the second initial chess group as a target chess group; Based on each given symmetry axis of the chessboard, transforming the chess piece coordinates of each chess piece in the target chess set to obtain a transformed chess set of the target chess set corresponding to each given symmetry axis; The given symmetry axis includes a diagonal symmetry axis, a transverse symmetry axis, a transverse diagonal symmetry axis, a vertical symmetry axis, a vertical diagonal symmetry axis, a center point symmetry axis, and a center point diagonal symmetry axis.
4. The method according to any one of claims 1 to 3, wherein: Determining a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set includes: Determine the initial chess group and each transformed chess group of the initial chess group as each unit chess group in a chess group set; Determine 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 the chess pieces, comparison is performed according to the position code value of the current chess piece in each unit chess group, and the smallest position code value is determined as the target position code of the current chess piece.
5. The method according to claim 4, wherein: The step of performing a chess record search based on the target positions of at least a part of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape includes: Determine the search code of the local chess shape according to the position code value of each chess piece in the local chess shape; Performing a chess record search based on the search code of the local chess shape to obtain each target chess record of the local chess shape; Wherein, the local chess shape includes at least three chess pieces.
6. The method according to claim 1 or 5, wherein: The initial chess group includes a first initial chess group and a second initial chess group; After obtaining at least one target chess record of the local chess shape, the method further includes: According to the corresponding relationship between the target position of each chess piece in the local chess shape, the chess record number of each target chess record, and the initial chess group corresponding to the local chess shape, an inverted index data structure of the local chess shape is generated.
7. The method according to claim 1, wherein: The chessboard includes a Go chessboard, and the chess piece categories include black pieces and white pieces.
8. A chess record search device, comprising: An identification module, used to identify the chess piece category and chess piece coordinates of each chess piece in a local chess shape on the chessboard, and obtain an initial chess piece group of the local chess shape; A transformation module, used for transforming the chess piece coordinates of each chess piece in the initial chess set according to at least one given symmetry axis of the chess board, to obtain at least one transformed chess set of the initial chess set; A processing module, used for determining a target position of each chess piece according to the chess piece coordinates of each chess piece in the initial chess set and each transformed chess set; The search module is used to perform a chess record search based on the target positions of at least a part of the chess pieces in the local chess shape to obtain at least one target chess record of the local chess shape.
9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to execute the chess record search method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the chess record searching method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data processing method and device for chess game
CN107433032A
A method and apparatus for score processing and a computer-readable storage medium
CN109145809A
A retrieval system of baduk records and a method ofthe same
KR1020020032009A
Method and server for providing artificial intelligence for baduk service
KR1020150129265A
Baduk records recording device and system thereof
KR1020170111706A
