Method for generating chess move image and related methods, devices, equipment and storage medium
By parsing chess game files to generate chess game images, the tedious problem of manual screenshots in the existing technology is solved, the effect of quickly generating chess game images in batches is achieved, and the convenience of chess game dissemination is improved.
Patent Information
- Application Number
- CN202211167727.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-23
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2042-09-23
AI Technical Summary
In the prior art, manually taking screenshots or scanning chess game images is cumbersome and cannot quickly generate chess game images in batches, which affects the speed of chess game dissemination and restoration.
Generate chess game images corresponding to the target game file by parsing the target game file, including identifying the game information and rendering the chessboard interface, taking screenshots using pre-configured screenshot tools, and supporting automated processing of standard and uncovered game games.
It realizes the batch generation of chess game images without human intervention, quickly restores the chess game, and improves the convenience and efficiency of chess game dissemination.
Smart Images

Figure CN115518382B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology. More specifically, embodiments of the present invention relate to a method for generating a chess move image and related methods, devices, equipment, and storage media. Background Art
[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No statement herein is admitted to be prior art by inclusion in this section.
[0003] In the related art, there are several ways to obtain chess game pictures: 1) When a user is watching a chess game on a mobile phone or computer, or when a user is browsing a chess game, the user can take a screenshot of the target chess game through the screenshot function of the mobile phone or computer; 2) By scanning the electronic version of the target chess game.
[0004] The above methods of obtaining chess game images all require manual operation, and only one chess game image can be obtained each time. The operation is cumbersome, and the speed of restoring the chess game is slow, which is not conducive to the dissemination of the chess game. Summary of the Invention
[0005] However, due to the need to quickly restore the chess game, the existing technology manually takes screenshots or scans the electronic version of the chess game, which requires a lot of human intervention. It is also cumbersome to implement in scenarios where batches of chess game images are required, and the operation speed is slow.
[0006] Therefore, in the prior art, manually taking screenshots of a chess game is a very annoying process.
[0007] Therefore, there is a great need for an improved method for generating chess game images that can automatically and batch generate chess game images so as to quickly restore the chess game and disseminate the chess game.
[0008] In this context, embodiments of the present invention are intended to provide a method for generating a chess move image and related methods, devices, equipment, and storage media.
[0009] In a first aspect of an embodiment of the present invention, a method for generating a chess move image is provided, the method comprising: obtaining a target chess game file, wherein the target chess game file is a file in a preset format for representing a target chess game; and generating a chess move image corresponding to the target chess game by parsing the target chess game file.
[0010] In one embodiment of the present invention, generating the chess move image corresponding to the target chess game by parsing the target chess game file includes: parsing the target chess game file to obtain chess game information of the target chess game; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain the chess move image.
[0011] In one embodiment of the present invention, before parsing the target game record file to obtain the game information of the target game, the method further includes: determining whether there is a characteristic character in the target game record file; if the characteristic character does not exist in the target game record file, determining that the target game is a standard game; otherwise, determining that the target game is a revealed game.
[0012] In one embodiment of the present invention, parsing the target game file to obtain the game information of the target game includes: when the target game is a standard game, determining that the target game file is a FEN file that uses standard FEN rules to represent the target game; calling a game engine instance to initialize the target game according to the FEN file, so as to convert the FEN file into a two-dimensional game array, wherein the two-dimensional game array includes the game information to be used for rendering the chessboard interface.
[0013] In one embodiment of the present invention, parsing the target chess record file to obtain the game information of the target chess game includes: when the target chess game is a Jieqi game, determining that the target chess record file is a preset FEN file that uses a preset FEN rule to represent the target chess game; disassembling the preset FEN file to obtain a plurality of characters; and identifying the meaning of each character according to the preset FEN rule to obtain the game information.
[0014] In one embodiment of the present invention, the identifying the character meaning corresponding to each character according to the preset FEN rule to obtain the chess game information includes: in the initial situation of the target chess game, identifying the characteristic characters in the preset FEN file corresponding to the hidden chess pieces of the target side of the two players; in the chess move situation of the target chess game, dividing the character strings corresponding to each chess move from the preset FEN file, and identifying the movement process of each chess piece according to the preset FEN rule and each character string.
[0015] In one embodiment of the present invention, rendering a chessboard interface according to the chess game information to restore the target chess game includes: determining the chess square position and chess piece type corresponding to each chess square on the chessboard according to the chess game information; using a pre-configured rendering tool to draw each chess square on the chessboard interface according to the chess square position and chess piece type corresponding to each chess square to restore the target chess game.
[0016] In one embodiment of the present invention, taking a screenshot of the chessboard interface to obtain the chess move image includes: taking a screenshot of the chessboard interface using a preconfigured screenshot tool to obtain the chess move image, wherein the preconfigured screenshot tool corresponds to the preconfigured rendering tool.
[0017] In an embodiment of the present application, the screenshot tool preconfigured for the chessboard interface comprises at least one of the following: a whole screenshot of a chessboard container for rendering the chessboard interface; a region screenshot of the chessboard container for rendering the chessboard interface; and a screenshot function for generating the screenshot of the chessboard interface, wherein the screenshot function is a built-in function of a canvas object for rendering the chessboard interface.
[0018] In a second aspect of the embodiments of the present application, a method for displaying a game image is provided, the method comprising: detecting a preview operation for a target game, wherein the target game is associated with a target game file, and the target game file is in a preset format; and in response to the preview operation, displaying a game image generated according to the target game file.
[0019] In an embodiment of the present application, the displaying the game image generated according to the target game file in response to the preview operation comprises: in response to the preview operation, accessing a preset file server to access the game image corresponding to the target game file in the preset file server; and displaying the game image on a target interface.
[0020] In an embodiment of the present application, before the accessing the preset file server, the method further comprises: obtaining the game image, wherein the game image is generated according to the method of any one of the first aspect; and saving the game image and the target game file to the preset file server.
[0021] In a third aspect of the embodiments of the present application, a method for monitoring a game is provided, the method comprising: detecting a monitoring operation for a target game, wherein the target game is represented by a target game file, the target game file is in a preset format, and the monitoring operation is used to request monitoring the legality of each game operation in the target game; and in response to the monitoring operation, displaying a legality monitoring result of each game operation in the target game on a target interface.
[0022] In an embodiment of the present application, before the displaying the legality monitoring result of each game operation in the target game on the target interface in response to the monitoring operation, the method further comprises: displaying an interactive window on the target interface to upload the target game file corresponding to the target game through the interactive window; or recording each game operation by using the preset format file to obtain the target game file when detecting each game operation on the target interface.
[0023] In an embodiment of the present application, before displaying the legality monitoring result of each move operation in the target chess game on the target interface in response to the monitoring operation, the method further comprises: obtaining at least one move image corresponding to the target chess score file, wherein the at least one move image is generated according to the method steps of any one of the first aspect described above; and presenting the legality monitoring result of the move operation on the target interface according to the move operation presented by the at least one move image.
[0024] In an embodiment of the present application, the displaying the legality monitoring result of each move operation in the target chess game on the target interface in response to the monitoring operation comprises: determining whether any target move operation in the move operation conforms to a preset move rule; if the target move operation conforms to the preset move rule, presenting a first prompt window on the target interface to prompt that the target move operation is a legal operation; otherwise, presenting a second prompt window on the target interface to prompt that the target move operation is not legal.
[0025] In a fourth aspect of the embodiments of the present application, a sharing method of a move image is provided, the method comprising: detecting a sharing operation for a target chess game, wherein the target chess game is represented by a target chess score file, and the target chess score file is a preset format file; and presenting a sharing interface on a target terminal in response to the sharing operation, wherein the sharing interface is used to share a move image corresponding to the target chess score file to a second account on the target terminal, and a first account belonging to the same platform as the second account is logged in on the target terminal.
[0026] In an embodiment of the present application, after detecting the sharing operation for the target chess game, the method further comprises: displaying a first interactive window on the user interface of the target terminal, wherein the first interactive window is used to present candidate chess score files; in a case where a selection operation on a candidate chess score file in the first interactive window is detected, the selected candidate chess score file is taken as the target chess score file; or displaying a second interactive window on the user interface of the target terminal, wherein the second interactive window is used to upload a chess score file; in a case where a chess score file uploaded from the second interactive window is detected, the uploaded chess score file is taken as the target chess score file.
[0027] In an embodiment of the present application, before presenting the sharing interface on the target terminal, the method further comprises: obtaining a move image corresponding to the target chess score file, wherein the move image is generated according to the method steps of any one of the first aspect described above.
[0028] In an embodiment of the present application, after displaying the sharing interface on the target terminal, the method further comprises at least one of the following: displaying a first sending button on the sharing interface, wherein the first sending button is used to send the chess move image to the second account; displaying a second sending button on the sharing interface, wherein the second sending button is used to send the pattern code corresponding to the chess move image to the second account; and displaying a third sending button on the sharing interface, wherein the third sending button is used to send the link address corresponding to the chess move image to the second account.
[0029] In a fifth aspect of the embodiments of the present application, a device for generating a chess move image is provided, and the device comprises: an acquisition module, configured to acquire a target chess score file, wherein the target chess score file is a file in a preset format for representing a target chess game; and a generation module, configured to generate a chess move image corresponding to the target chess game by analyzing the target chess score file.
[0030] In an embodiment of the present application, the generation module comprises: an analysis unit, configured to analyze the target chess score file to obtain game information of the target chess game; a rendering unit, configured to render a chessboard interface according to the game information to restore the target chess game; and a screenshot unit, configured to take a screenshot of the chessboard interface to obtain the chess move image.
[0031] In an embodiment of the present application, the device further comprises: a first determination module, configured to determine whether a feature character exists in the target chess score file before the analysis unit analyzes the target chess score file to obtain the game information of the target chess game; and a second determination module, configured to determine that the target chess game is a standard chess game if the feature character does not exist in the target chess score file, and otherwise, determine that the target chess game is a chess-uncovering game.
[0032] In an embodiment of the present application, the analysis unit comprises: a first determination subunit, configured to determine that the target chess score file is a FEN file representing the target chess game in a standard FEN rule if the target chess game is a standard chess game; and an initialization subunit, configured to call a game engine instance to initialize the target chess game according to the FEN file, so as to convert the FEN file into a two-dimensional game array, wherein the two-dimensional game array comprises game information to be used for rendering the chessboard interface.
[0033] In an embodiment of the present application, the parsing unit comprises: a second determining subunit, configured to determine that the target chess game is a chess-uncovering game, and then determine that the target chess score file is a preset FEN file representing the target chess game in a preset FEN rule; a disassembling subunit, configured to disassemble the preset FEN file to obtain a plurality of characters; and an identifying subunit, configured to identify the character meaning corresponding to each character according to the preset FEN rule, to obtain the chess game information.
[0034] In an embodiment of the present application, the identifying subunit is configured to identify a hidden chess piece of a target side in the initial position of the target chess game from the characteristic character in the preset FEN file, and identify the moving process of each chess piece according to the preset FEN rule and each string corresponding to each move in the preset FEN file.
[0035] In an embodiment of the present application, the rendering unit comprises: a third determining subunit, configured to determine the chessboard position and the chess piece type corresponding to each chessboard in the chess game information; and a drawing subunit, configured to draw each chessboard on the chessboard interface according to the chessboard position and the chess piece type corresponding to each chessboard by using a preconfigured rendering tool, to restore the target chess game.
[0036] In an embodiment of the present application, the screenshot unit comprises: a screenshot subunit, configured to take a screenshot of the chessboard interface by using a preconfigured screenshot tool to obtain the move image, wherein the preconfigured screenshot tool corresponds to the preconfigured rendering tool.
[0037] In an embodiment of the present application, the screenshot subunit is configured to perform at least one of the following: taking a whole screenshot of a chessboard container rendering the chessboard interface; taking a regional screenshot of the chessboard container rendering the chessboard interface; and calling a screenshot function to generate a screenshot of the chessboard interface, wherein the screenshot function is a built-in function of a canvas object used to render the chessboard interface.
[0038] In a sixth aspect of the embodiments of the present application, a move image display device is provided, which comprises: a detection module, configured to detect a preview operation for a target title, wherein the target title is associated with a target chess game, the target chess game is represented by a target chess score file, and the target chess score file is a preset format file; and a display module, configured to display a move image generated according to the target chess score file in response to the preview operation.
[0039] In an embodiment of the present application, the display module comprises: an access unit configured to, in response to the preview operation, access a preset file server to access a move image corresponding to the target chess file in the preset file server; and a display unit configured to display the move image on a target interface.
[0040] In an embodiment of the present application, before the access unit accesses the preset file server, the device further comprises: an acquisition module configured to acquire the move image, wherein the move image is generated by the device of the fifth aspect described above; and a saving module configured to save the move image and the target chess file into the preset file server.
[0041] In a seventh aspect of the embodiments of the present application, a chess game monitoring device is provided, which comprises: a detection module configured to detect a monitoring operation for a target chess game, wherein the target chess game is represented by a target chess file, the target chess file is a preset format file, and the monitoring operation is used to request monitoring of legality of each move operation in the target chess game; and a first display module configured to, in response to the monitoring operation, display a legality monitoring result of each move operation in the target chess game on a target interface.
[0042] In an embodiment of the present application, before the first display module displays the legality monitoring result of each move operation in the target chess game on the target interface in response to the monitoring operation, the device further comprises: a second display module configured to display an interactive window on the target interface to upload a target chess file corresponding to the target chess game through the interactive window; or a recording module configured to, when each move operation on the target interface is detected, record each move operation by using the preset format file to obtain the target chess file.
[0043] In an embodiment of the present application, the device further comprises: an acquisition module configured to, before the first display module displays the legality monitoring result of each move operation in the target chess game on the target interface in response to the monitoring operation, acquire at least one move image corresponding to the target chess file, wherein the at least one move image is generated by the device of the fifth aspect described above; and a monitoring module configured to display the legality monitoring result of the move operation on the target interface according to the move operation presented by the at least one move image.
[0044] In one embodiment of the present invention, the first display module includes: a determination unit, configured to determine whether any target chess-moving operation among the chess-moving operations complies with preset chess-moving rules; a display unit, configured to display a first prompt window on the target interface when the target chess-moving operation complies with the preset chess-moving rules, to prompt that the target chess-moving operation is a legal operation; otherwise, display a second prompt window on the target interface to prompt that the target chess-moving operation is illegal.
[0045] In an eighth aspect of the embodiments of the present invention, a device for sharing chess move images is provided, the device comprising: a detection module for detecting a sharing operation on a target chess game, wherein the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format; a display module for displaying a sharing interface on a target terminal in response to the sharing operation, wherein the sharing interface is used to share the chess move image corresponding to the target chess record file to a second account on the target terminal, and a first account belonging to the same platform as the second account is logged in to the target terminal.
[0046] In one embodiment of the present invention, the device further includes: a first display module, configured to display a first interactive window on the user interface of the target terminal after the detection module detects a sharing operation for the target chess game, wherein the first interactive window is used to display candidate chess game files; when a selection operation for a candidate chess game file in the first interactive window is detected, the selected candidate chess game file is used as the target chess game file; or, a second display module, configured to display a second interactive window on the user interface of the target terminal, wherein the second interactive window is used to upload chess game files; when a chess game file uploaded from the second interactive window is detected, the uploaded chess game file is used as the target chess game file.
[0047] In one embodiment of the present invention, the device further includes: an acquisition module, configured to acquire a chess move image corresponding to the target chess game file before the display module displays the sharing interface on the target terminal, wherein the chess move image is generated by the device described in the fifth aspect above.
[0048] In one embodiment of the present invention, after the display module displays the sharing interface on the target terminal, the device further includes at least one of the following: a third display module, used to display a first send button on the sharing interface, wherein the first send button is used to send the chess move image to the second account; a fourth display module, used to display a second send button on the sharing interface, wherein the second send button is used to send the pattern code corresponding to the chess move image to the second account; a fifth display module, used to display a third send button on the sharing interface, wherein the third send button is used to send the link address corresponding to the chess move image to the second account.
[0049] In a ninth aspect of the embodiments of the present invention, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in the above method embodiment.
[0050] In a tenth aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of the above-mentioned apparatus embodiment when run.
[0051] According to the method for generating chess move images according to the embodiment of the present invention, it is possible to quickly generate chess move images corresponding to a preset format file for a preset format file without human intervention. It is possible to generate batch chess game images and quickly restore the chess game, making it more convenient to disseminate the chess game and bringing a better experience to users. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily apparent by reading the following detailed description with reference to the accompanying drawings, in which several embodiments of the present invention are shown by way of example and not limitation, in which:
[0053] Figure 1 Schematically illustrates an application scenario according to an embodiment of the present invention;
[0054] Figure 2 The flowchart of the method for generating a chess move image according to an embodiment of the present invention is schematically shown;
[0055] Figure 3 The following schematically illustrates the process of a method for generating a chess move image according to another embodiment of the present invention;
[0056] Figure 4 Schematically illustrating a chessboard image generator provided by the present invention according to an embodiment of the present invention;
[0057] Figure 5The following schematically shows a flow chart of a method for displaying a chess move image according to an embodiment of the present invention;
[0058] Figure 6 A chess game preview process according to an embodiment of the present invention is schematically shown;
[0059] Figure 7 The following schematically shows a flow chart of a chess game monitoring method according to an embodiment of the present invention;
[0060] Figure 8 Schematically illustrates a process for FEN to generate screenshots and monitor the game in real time;
[0061] Figure 9 The following schematically shows a flow chart of a method for sharing a chess move image according to an embodiment of the present invention;
[0062] Figure 10 A user-side screenshot sharing process according to an embodiment of the present invention is schematically shown;
[0063] Figure 11 Schematically illustrates a device for generating a chess move image according to an exemplary embodiment of the present invention;
[0064] Figure 12 Schematically shows a display device for a chess move image according to an exemplary embodiment of the present invention;
[0065] Figure 13 Schematically shows a device for monitoring a chess game according to an exemplary embodiment of the present invention;
[0066] Figure 14 Schematically illustrates a device for sharing a chess move image according to an exemplary embodiment of the present invention;
[0067] Figure 15 Schematically illustrates an electronic device according to an exemplary embodiment of the present invention;
[0068] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION
[0069] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0070] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a method, apparatus, device, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.
[0071] According to an embodiment of the present invention, a method for generating a chess move image and related methods, devices, equipment and storage media are proposed.
[0072] In this article, it is important to understand that the terms involved are:
[0073] FEN Rules: FEN (Forsyth-Edwards Notation) is a standard for recording chess positions. Using this standard, a position can be represented simply with a single line of "FEN format string," eliminating the need for elaborate phrases like "Red king at the bottom line of fourth row, Black king at the bottom line of fifth row..." Because FEN is a text-based format (involving only a very limited number of letters, numbers, and symbols), it greatly facilitates the sharing of chess positions online. Instead of drawing chess diagrams on paper or describing them clumsily with complex text, chess game editors can create positions using chess game editing software, automatically generating a FEN format string that can then be posted to text-enabled online platforms such as web pages, BBSs, and electronic forums.
[0074] In addition, any number of elements in the drawings is for illustration and not limitation, and any naming is for distinction only and does not have any limiting meaning.
[0075] The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention. SUMMARY OF THE INVENTION
[0077] The inventors have found that existing chessboard images basically require users to directly take screenshots of the chessboard on the page, but this becomes extremely troublesome in the scenario of batch screenshots; when sharing chess games with traditional solutions, users are required to manually take screenshots and share them, which is rather cumbersome; currently, there is no solution on the market that can directly generate chessboard images based on chess game records, which is not conducive to users quickly restoring the chess game and sharing it after obtaining the chess records from the Internet.
[0078] The present invention provides a method for generating chess move images. The process of generating chess move images can include obtaining a target chess record file, which is a file in a preset format used to represent a target chess game, parsing the target chess record file, and generating a corresponding chess move image for the target chess game. This method, after obtaining the chess record, can quickly generate a screenshot of the game by parsing the record, thus enabling a solution for generating chessboard images from chess record files in both browser and server environments.
[0079] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.
[0080] Application Scenario Overview
[0081] In this embodiment, the above-described method for generating chess move images can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network and can be used to provide services to the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server.
[0082] The aforementioned network may include, but is not limited to, at least one of the following: a wired network and a wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, and a local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity) and Bluetooth.
[0083] First, refer to Figure 1 , Figure 1 The application scenario according to the embodiment of the present invention is schematically shown. First, refer to Figure 1 , which illustrates application scenarios in which embodiments of the present invention may be implemented. Figure 1 The scenario shown in the figure includes a terminal 200 and a server 100. The terminal 200 can be a mobile terminal, such as a mobile electronic device such as a mobile phone, a tablet computer, a laptop computer, a personal digital assistant, or a desktop computer. The server 100 can be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal 200 and the server 100 can be connected to each other through, for example, the mobile Internet.
[0084] The steps of obtaining the target game record file and generating the game image can be performed on the server 100 or on the terminal 200. More specifically, for example, a user operates a software app installed on the terminal 200 to obtain the target game record file. The software app then parses the target game record file and generates a screenshot of the game image, thereby quickly restoring the game.
[0085] Exemplary Methods
[0086] The following combination Figure 1 For application scenarios, refer to Figure 2 A method for processing a chess move image according to an exemplary embodiment of the present invention is introduced.
[0087] It should be noted that the above application scenarios are only shown for the purpose of facilitating the understanding of 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.
[0088] The present application is applicable to the chess game restoration scenario using FEN rule notation, but is not limited thereto.
[0089] For example, as shown in Figure 2 The flowchart of the generation method of the chess image of an embodiment of the present application is shown in Figure 2 The method can include the following steps:
[0090] In step S202, a target chess score file is obtained, wherein the target chess score file is a preset format file for representing a target chess game;
[0091] In this embodiment, the preset format file can be a FEN file, i.e., a chess score file representing a chess game using FEN rules; or a preset FEN file, i.e., a chess score file representing a chess game using a FEN file containing special characters, which are used to represent hidden pieces in a chess game.
[0092] The execution subject of the generation method of the chess image provided in the present application can be a chess game picture generator, which can be a terminal device, a server, or other hardware device, or software installed on a hardware device.
[0093] In this embodiment, there are many ways to obtain the target chess score file, such as: 1) the user copies the chess score FEN from other chess websites; 2) the user exports the FEN after playing chess on other chess websites, etc.
[0094] In step S204, the target chess image corresponding to the target chess game is generated by analyzing the target chess score file.
[0095] This scheme can restore the chess game represented by the target chess score file by analyzing the target chess score file after receiving the external chess score file, and further generate the chess image corresponding to the chess game, i.e., the screenshot of the chess game.
[0096] This scheme supports the generation of the chessboard image in the browser and server environment.
[0097] Taking the server 100 as an example, the server 100 is embedded with a chess game picture generator, the server 100 has the service of the picture generator, the server 100 receives the chess score FEN imported by the external (such as the client on the terminal 200), analyzes the chess score FEN to directly generate the chess game picture, and can realize the batch screenshot corresponding to the chess game.
[0098] Optionally, taking the terminal 200 as an example, the terminal 200 is installed with a chess playing client, the chess game picture generator is embedded into the chess playing client, and after receiving the chess score FEN (for example, downloaded from the server 100), a picture is directly generated by analyzing the chess score FEN, which can support the user to generate a screenshot in real time during the chess playing.
[0099] According to the chess playing image generation method, the preset format file can be quickly generated, no human intervention is needed, batch chess game pictures can be generated, a chess game can be quickly restored, the chess game is more convenient to spread, and a better experience is brought to the user.
[0100] In one possible implementation of the present case, referring to Figure 3 For the flowchart of the chess playing image generation method of another embodiment of the present application, the step S204 includes the following steps:
[0101] In step S301, the target chess score file is analyzed to obtain the game information of the target chess game.
[0102] The target chess score file in the present embodiment can record the position information of each chess grid on the chessboard and the chess piece type of the chess piece on the chess grid, and the analysis of the chess score FEN file can obtain the position of each chess grid on the chess game and the chess piece type (i.e., the above-mentioned game information).
[0103] Taking the target chess score file as the FEN file as an example, the FEN file is: rnbakabnr / 9 / 1c5c1 / p1p1p1p1p / 9 / 9 / P1P1P1P1P / 1C5C1 / 9 / RNBAKABNR; the FEN file is analyzed according to the FEN rule, and the initial chess game of the standard chess can be restored.
[0104] Before the above step S301, it further includes: determining whether the target chess score file contains a feature character; if the target chess score file does not contain a feature character, it is determined that the target chess game is a standard chess game; otherwise, it is determined that the target chess game is a chess revealing chess game.
[0105] Before analyzing the target chess score file, it is first determined whether the feature characters "x" and "X" exist in the transmitted chess score FEN; if the feature characters do not exist in the chess score FEN, the chess score FEN represents a standard chess game, such as a standard Chinese chess; if the feature characters "x" and "X" exist in the chess score FEN, the current transmitted FEN is a chess revealing mode FEN. Taking the chess revealing mode FEN (i.e., the above-mentioned preset chess score file) as an example, x represents a dark chess piece in the black side, X represents a dark chess piece in the red side, and the preset FEN file corresponding to the initial situation of the chess revealing chess game is: xxxxkxxxx / 9 / 1x5x1 / x1x1x1x1x / 9 / 9 / X1X1X1X1X / 1X5X1 / 9 / XXXXKXXXX.
[0106] In a possible implementation of the embodiment, the step S301 includes: when the target chess game is a standard chess game, determining that the target chess score file is a FEN file representing the target chess game in a standard FEN rule; and calling a chess engine instance to initialize the target chess game according to the FEN file, so as to convert the FEN file into a two-dimensional chess game array, where the two-dimensional chess game array includes chess game information to be used for rendering a chessboard interface.
[0107] The chess engine in the embodiment is used to parse a FEN score, and parse a mark character in the FEN score, so as to obtain chess piece arrangement information (i.e., the two-dimensional chess game array) on a chessboard. If the chess engine is not used, the task can also be completed by using other methods that can parse the chess piece arrangement information in the FEN score according to the FEN rule and initialize the chess piece arrangement of the initial chessboard. The selection of the FEN score parsing method is not limited herein. According to the embodiment, the chess piece arrangement in the FEN can be obtained only by introducing the FEN score, and the chessboard interface can be easily generated, thereby assisting in rendering the chessboard UI.
[0108] Taking Chinese chess as an example, a Chinese chess engine instance game (i.e., the chess engine instance) is created in advance, the mark character in the Chinese chess FEN is parsed by using the Chinese chess engine, and the chess piece arrangement of the initial chessboard of the Chinese chess is generated. The parsing process follows the Chinese Chess Computer Application Specification. Then, the initialization method “fromFen” in the engine instance is called, and the externally provided Chinese chess FEN score is input, the mark character in the Chinese chess FEN score is parsed, the chess piece arrangement information in the Chinese chess FEN is obtained, and the chess piece arrangement of the initial chessboard is initialized.
[0109] In another optional example, after the externally provided Chinese chess FEN score is input, the characteristic mark symbol in the FEN string can also be directly analyzed, and the parsing rule only needs to be parsed according to the FEN notation specification of the Chinese chess, so as to obtain the type of the chess piece on each position on the chessboard, and place the chess piece on the specified position, thereby completing the initialization of the chess game.
[0110] In step S302, the chessboard interface is rendered according to the chess game information, so as to restore the target chess game.
[0111] In specific implementation, the step S302 includes: determining the chess grid position and the chess piece type corresponding to each chess grid on the chessboard according to the chess game information; and using a preconfigured rendering tool to draw each chess grid on the chessboard interface according to the chess grid position and the chess piece type corresponding to each chess grid, so as to restore the target chess game.
[0112] In this embodiment, when the chess game is a standard chess game, the two-dimensional chess game array obtained according to the above embodiment and the chess game information provided by the above two-dimensional chess game array can use a pre-configured UI framework.
[0113] For example, the two-dimensional array has 10 rows and 9 columns. Each column in each row stores information about the corresponding chess piece on the Chinese chess board, including the internal number (sq) of the square (i.e., the position of the square) and the type (char) of the piece on the square. For example, in the first row and first column of the initial chess game, the information stored is: the square number (sq) is 51, and the piece type (char) is br, where 51 represents a specific square on the board, and br indicates that the piece on the square is a black (b) rook (r).
[0114] With the above two-dimensional array, the following methods can be used, but not limited to these methods, to render the UI layer:
[0115] 1) Use HTML tags to render directly;
[0116] 2) Use Canvas to draw;
[0117] 3) Use game engines such as Egret and Cocos2D for drawing.
[0118] Step S303: Take a screenshot of the chessboard interface to obtain a chess move image.
[0119] In specific implementation, the above step S303 includes: taking a screenshot of the chessboard interface using a pre-configured screenshot tool to obtain a chess move image, wherein the pre-configured screenshot tool corresponds to the pre-configured rendering tool.
[0120] In this embodiment, according to different drawing methods, corresponding screenshot methods are used to take screenshots.
[0121] Among them, the screenshot method includes at least one of the following: taking a screenshot of the entire chessboard container that renders the chessboard interface; taking a regional screenshot of the chessboard container that renders the chessboard interface; calling a screenshot function to generate a screenshot of the chessboard interface, wherein the screenshot function is provided by the canvas object used to render the chessboard interface.
[0122] In this embodiment, after the chessboard is drawn in the desired style, different methods of generating chessboard screenshots can be used according to different drawing methods. For example,
[0123] 1) Use HTML tags to render directly:
[0124] a. You can use "HTML2Canvas" to take a screenshot of the entire chessboard container, which is suitable for generating chessboard screenshots in a browser environment;
[0125] b.The area screenshot of the chessboard container can be taken using the "puppeteer" headless browser, which is suitable for generating a screenshot scene on a server.
[0126] 2) Draw using canvas or other game engines:
[0127] Directly obtain the canvas object used for drawing, and use the ".toDataURL()" function of the canvas to directly generate a "base64" type picture.
[0128] The chess image generation method provided by the present application will be further described below in combination with a specific embodiment.
[0129] Figure 4 The present application provides a chessboard image generator, as shown in Figure 4 , which includes the following contents:
[0130] Step S401, externally input FEN;
[0131] Step S402, parse the game information according to the FEN;
[0132] Step S403, render the chessboard using a custom rendering channel;
[0133] Step S404, generate a chessboard screenshot;
[0134] The chessboard picture generator in the embodiment can be regarded as a complete module, and the chess score picture is directly obtained through the implementation of the above steps S401-S404; the chess score picture generator can be embedded into a browser or a server environment, so that the user can quickly restore the game and spread after obtaining the chess score from the network.
[0135] In another possible implementation of the present case, the above step S301 includes the following steps:
[0136] Step S501, when the target game is a chess-uncovering game, it is determined that the target chess score file is a preset FEN file representing the target game in a preset FEN rule;
[0137] Step S502, disassemble the preset FEN file to obtain a plurality of characters;
[0138] Step S503, according to the preset FEN rule, identify the character meaning corresponding to each character to obtain the game information.
[0139] In addition to generating normal light chessboard pictures according to the standard FEN, the scheme also supports generating chessboard pictures according to the Chinese chess FEN notation of uncovering chess. In the embodiment, taking the uncovering chess in Chinese chess as an example, there are special characters "x" and "X" in the transmitted chess FEN file, wherein x represents the dark chess of the black side, and X represents the dark chess of the red side.
[0140] In particular implementation, when a FEN of an uncovering chess mode is obtained, the parsing manner of the basic chess FEN part is generally the same as that of the standard FEN, that is, the automatic machine is used to decompose each character in the basic position FEN, feed it to the automatic machine to identify the type and perform the corresponding processing. The only difference is that "x" and "X" are added to support the marking of the dark chess that has not been uncovered.
[0141] In an example, it is judged whether the transmitted FEN contains the characteristic characters "x" and "X" to judge whether the current FEN is an uncovering chess mode FEN. If yes, it is indicated that the current FEN is an uncovering chess mode FEN, and the rules for drawing the chessboard are as follows:
[0142] When a FEN of an uncovering chess mode is obtained, the parsing manner of the basic chess FEN part is generally the same as that of the standard FEN, that is, the automatic machine is used to decompose each character in the basic position FEN, feed it to the automatic machine to identify the type and perform the corresponding processing. The only difference is that "x" and "X" are added to support the marking of the dark chess that has not been uncovered.
[0143] When a character at a certain position in the FEN string is parsed, the following rules are used:
[0144] "xX": it is indicated that there is a chess piece at the current parsed position, and it is a dark chess piece that has not been uncovered. If it is "x", it represents a chess piece of the black side, and if it is "X", it represents a chess piece of the red side. At this time, a set is used to record the chess piece at the position of the current grid as a dark chess piece, and the chess piece is allowed to be placed according to the preset movement of each grid before being uncovered.
[0145] " / ": it is indicated that the data of a certain row in the chessboard has been parsed, and the data of the next row is ready to be parsed. At this time, the current row number is marked as 1.
[0146] "1-9": if the parsed character is any one of the numbers from 1 to 9, it is indicated that there are y empty grids on the current row from the current column, and there is no chess piece on the empty grids. Wherein, y is equal to the number corresponding to the parsed character.
[0147] "rnbakcp": If the parsed characters are any of these, it indicates that a black piece exists in the current row and column. Based on the pre-set conversion rules, the position is marked with the piece type. Each character square corresponds to the following piece type: r - rook, n - knight, b - bishop, a - scholar, k - general, c - cannon, p - pawn.
[0148] "RNBAKCP": If the parsed characters are any of these, it means there is a red piece in the current row and column. Based on the pre-set conversion rules, the position is marked with the piece type. Each character square corresponds to the following piece type: R - Rook, N - Knight, B - Prime Minister, A - Minister, K - King, C - Cannon, P - Pawn.
[0149] “”: When a space is parsed, it means that the FEN part of the initial situation has been parsed, and the current player can start parsing. If the character after the space is "b", it means that it is the black player's turn to make a move, otherwise it is the red player's turn to make a move.
[0150] At this point, the basic FEN parsing has been completed. Next, we need to parse the move records passed in by the user to restore the historical records of the chess game.
[0151] FEN uses "moves" as a separator, followed by a list of historical moves, with spaces separating each move. You can use spaces to split a whole list of moves into multiple moves, such as: "a3a4 <11> a6a5 <28> c3c4 <13> ” is split into: “a3a4 <11> ”, “a6a5 <28> ","c3c4 <13> ", and then extract the chess coordinates and the starting point chess piece number according to each chess move record, such as "a3a4 <11> Extract the row coordinates "a3a4" and the piece number "11." Then, based on the row coordinates, place the piece according to the preset placement rules for the piece at the starting coordinate position (for example, position a3 corresponds to the position of a pawn in normal game mode. Therefore, if the piece is not revealed, the pawn must be placed according to the pawn's rules). After placing the piece, the piece type is replaced with the corresponding exposed piece type based on the parsed piece number, such as replacing it with the "Xiang" piece numbered "11." This completes the hidden move process. The exposed move process is no different from the normal game mode and will not be explained in detail here.
[0152] After parsing the chessboard revealing mode FEN according to the above rules, the process proceeds to step S403 to render the chessboard based on the chessboard information obtained from the analysis.
[0153] After the chessboard rendering is completed, the process directly proceeds to step S404 to generate a chessboard image.
[0154] Through the above steps, the present invention can efficiently generate chessboard images through the input FEN chess records in the browser environment and the server environment, solving the problem of batch generation of chessboard images.
[0155] The present invention also provides a method for displaying a chess move image, which is used to implement the above-mentioned embodiments and preferred implementation methods, and will not be repeated here. Figure 5 A flowchart of a method for displaying a chess move image according to an embodiment of the present invention is shown. Figure 5 As shown, the following steps are included:
[0156] Step S601: A preview operation for a target problem is detected, wherein the target problem is associated with a target chess game, and the target chess game is represented by a target chess record file, which is a file in a preset format.
[0157] The above-described method for displaying chess move images can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network and can be used to provide services to the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server.
[0158] In this embodiment, the target question is associated with a target chess game. The question can be a question bank for learning chess, such as level-breaking exercises, fixed-step exercises, etc. In this embodiment, a target question can be associated with at least one chess game, for example, a chess multiple-choice exercise includes 4 options, each option is associated with a chess game.
[0159] In addition, the target chess game in this embodiment is notated using a preset format file, such as standard FEN notation, or the above-mentioned preset FEN notation.
[0160] Step S602: In response to the preview operation, display the chess move image generated according to the target chess record file.
[0161] In one example, upon receiving a preview operation request from a user for a target question on a user interface, the client will respond to the user's preview operation by querying a chess game screenshot (i.e., the chess move image mentioned above) associated with the target question, and then display the chess game screenshot on the user interface.
[0162] Before the above step S601, the method further includes: in response to the preview operation, accessing a preset file server to access a chess move image corresponding to the target chess record file in the preset file server; and displaying the chess move image on the target interface.
[0163] Specifically, the target chess record file and chess move images are stored in a file server such as CDN in advance. After receiving the preview operation request, the file server is directly accessed and the preview image can be directly displayed on the user interface.
[0164] Furthermore, before accessing the preset file server, the process includes: obtaining a chess move image, wherein the chess move image is generated according to the above steps S202 to S204; and then saving the chess move image and the target chess record file to the preset file server.
[0165] After receiving the external imported FEN file, the chess image generator generates the corresponding chess move image according to the steps S202 to S204 above, and then saves the chess move image and FEN file to a file server such as CDN; when the user operates the preview request on the interface, the chess game screenshot corresponding to the FEN file can be directly displayed on the interface.
[0166] This embodiment will be further described below in conjunction with a specific embodiment.
[0167] Figure 6 FIG2 illustrates a chess game preview process according to an embodiment of the present invention. Figure 6 As shown, the following steps are included:
[0168] Step S701, receiving external FEN; for example, FEN crawled by a web crawler, FEN currently being played by a user, or system preset practice FEN, etc.
[0169] Step S702: Import FEN into the game image generator. The game image generator generates screenshots as follows: It creates a game instance (i.e., the game engine instance described above) and passes the parsed game information to FEN. Next, it uses the custom game rendering pipeline (i.e., the pre-configured rendering tool described above) to generate a board image.
[0170] Step S703: Import the originally imported FEN and chess game images and other information into a library (such as a CDN file server) as a system chess game database.
[0171] According to the implementation of the above steps S701 to S703, FEN can generate chess game preview images in batches; based on this, this solution can be applied to application scenarios such as displaying question preview images on the front-end killing method practice page; preview images of level-breaking questions; and preview images of fixed-step practice questions.
[0172] In the related art, screenshots of chess games are taken manually through mobile phones or computers. This method can only capture Figure 1 For question bank scenarios that require large quantities of screenshots, the operation is quite cumbersome and does not facilitate users' ability to view preview images of the question bank. Through the above implementation, chess game screenshots can be generated in batches directly by inputting FEN, i.e., the above preview images. After the screenshots are generated, they can be uploaded to the CDN file server. When the user opens the application corresponding to any of the above application scenarios, the chess game images corresponding to the FEN can be directly displayed.
[0173] The present invention also provides a chess game monitoring method, which is used to implement the above-mentioned embodiments and preferred implementation methods, and will not be repeated here. Figure 7 A flowchart of a chess game monitoring method according to an embodiment of the present invention is schematically shown. Figure 7 As shown, the following steps are included:
[0174] Step 801: Detecting a monitoring operation for a target chess game, wherein the target chess game is represented by a target chess record file in a preset format, and the monitoring operation is used to request monitoring of the legality of each chess operation in the target chess game;
[0175] The above-described chess game monitoring method can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network and can be used to provide services to the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server.
[0176] In this embodiment, the target chess game can be the chess game being played on the user interface; it can also be a chess record file corresponding to the target chess game, such as the above-mentioned standard FEN chess record or preset FEN chess record. By operating the standard FEN chess record or the preset FEN chess record, the legality of the chess operations in the chess game can also be monitored.
[0177] Step 802: In response to the monitoring operation, the legality monitoring results of each chess operation in the target chess game are displayed on the target interface.
[0178] This solution is applicable to scenarios such as monitoring games. Through the above implementation method, after detecting the user's monitoring operation on the target chess game, the legality result of the chess operation can be directly generated according to the chess record (i.e., chess record file) during the chess process.
[0179] Specifically, before the above step S802, it also includes: displaying an interactive window on the target interface to upload the target chess game corresponding to the target chess game through the interactive window; or, when each chess operation on the target interface is detected, using a preset format file to record each chess operation to obtain the target chess game file.
[0180] In a preferred embodiment of the present invention, when a monitoring operation on a target chess game is detected, an interactive window is displayed on the terminal 200 , through which a local chess game file of the terminal 200 or a chess game file downloaded from the server 100 can be uploaded.
[0181] In another preferred mode of the embodiment, the chess APP on the terminal 200 is playing, and if the monitoring operation request of the user is detected, the chess operation is recorded in real time by a preset format file, such as a standard FEN or a preset FEN, to obtain a standard FEN file or a preset FEN file (i.e., the target chess score file).
[0182] Further, before the step S802, there is further included: obtaining at least one chess operation image corresponding to the target chess score file, wherein the at least one chess operation image is generated according to the steps S202-S204; and presenting the legality monitoring result of the chess operation on the target interface according to the chess operation presented by the at least one chess operation image.
[0183] Specifically, the terminal 200 embeds a chess score picture generator, imports the target chess score file into the chess score picture generator, generates the corresponding game screenshot according to the steps S202-S204, and then reacts to the chess operation according to the at least one game screenshot.
[0184] In an optional embodiment, the step S802 includes: determining whether any target chess operation in the chess operations conforms to a preset chess operation rule; if the target chess operation conforms to the preset chess operation rule, presenting a first prompt window on the target interface to prompt that the target chess operation is a legal operation; otherwise, presenting a second prompt window on the target interface to prompt that the target chess operation is illegal.
[0185] In the embodiment, the chess operation can be obtained according to the change of the game picture, such as the chess operation of placing a soldier according to the game screenshot, the legality of the chess operation is verified according to the chess operation rule of the soldier in the standard chess, if the chess operation is illegal, the illegal result is sent to the user interface, and a prompt window is presented on the user interface to inform the user.
[0186] When the game is a chess opening, the chess score file in the embodiment is a preset FEN file, if the chess operation of a certain hidden chess is detected according to the change of the game, the initial position before the chess operation of the hidden chess is determined, and the legality of the chess operation of the hidden chess is verified according to the chess operation rule of the corresponding open chess according to the initial position.
[0187] The game is a process of change, through the above-mentioned embodiments, a game screenshot can be generated according to the current game after each operation of the user, and it can be clearly seen which chess piece is moving through the comparison of the screenshots, based on this, the legality monitoring of the game is introduced, and the purpose of real-time monitoring is achieved.
[0188] The present invention will be further described below with reference to a specific embodiment:
[0189] Figure 8 The following schematically illustrates a process of FEN generating screenshots for real-time monitoring of a match: Figure 8 As shown, taking the chess game as an example, the main steps include:
[0190] Step S901: Detecting that a user participates in a chess game and makes a move;
[0191] Step S902: Obtain the FEN file corresponding to the move operation through the FEN image generator (i.e., the aforementioned chess game image generator), pass the FEN file to the pre-created chess game engine instance, parse the FEN to obtain the chess game information, generate a chessboard image using the custom chessboard rendering pipeline, and upload the chessboard image to the competition monitoring server;
[0192] In this embodiment, the FEN image generator can be embedded in the terminal or the server. The screenshot process does not necessarily have to occur on the user side. The user side can also upload the FEN of the current chess game in real time, and the server generates the image and displays it, which improves the detection efficiency of the game monitoring.
[0193] Step S903: The game monitoring backend (i.e., the aforementioned game monitoring server) obtains a real-time screenshot of the user's moves and uses a specific AI algorithm or manual review to verify the legitimacy of the moves to determine if there is any anomaly in the user's game.
[0194] Among them, specific AI algorithms and manual review are complementary review operations. Specific AI algorithms can assist manual review in making decisions.
[0195] In this implementation step, the monitoring background can also introduce an engine library to verify the legality of the chess game. The engine library in this embodiment includes the above-mentioned chess game engine instance, and also contains instances for verifying the legality of the chess game, such as automatic review operations. Directly calling the engine library can realize the generation of chess game images and the verification of the legality of the chess game, so as to improve the background operation efficiency and thus improve the chess game detection efficiency.
[0196] Through the above implementation, a screenshot can be generated based on the current chess game after each user makes a move. By comparing the screenshots before and after, the chess piece's move process can be determined. By using the chess game image generator to automatically generate screenshots based on FEN chess records and introducing an engine library to verify the legality of chess piece moves, the efficiency of game monitoring is greatly improved compared to the manual review of chess games in existing solutions.
[0197] The present invention also provides a method for sharing chess move images, which is used to implement the above-mentioned embodiments and preferred implementation methods, and will not be repeated here. Figure 9A flowchart of a method for sharing a chess move image according to an embodiment of the present invention is schematically shown. Figure 9 As shown, the following steps are included:
[0198] Step S1001: detecting a sharing operation for a target chess game, wherein the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format;
[0199] This solution is suitable for scenarios where a chessboard image needs to be directly generated based on the input FEN chess records, as well as scenarios such as user chess game sharing.
[0200] The chess games shared in this embodiment are chess record files recorded in a preset format, such as standard FEN, preset FEN, etc.
[0201] Preferably, a sharing button is provided on the user interface of the chess client, and the user can share the chess game recorded in the FEN file by triggering the sharing button.
[0202] Step S1002: In response to the sharing operation, a sharing interface is displayed on the target terminal, wherein the sharing interface is used to share the chess move image corresponding to the target chess record file to the second account on the target terminal, and a first account belonging to the same platform as the second account is logged in to the target terminal.
[0203] In this embodiment, the first account and the second account belong to the same platform, that is, they share a unified backend server;
[0204] On the target client logged in with the first account, a sharing operation for the target chess game is detected, and the sharing interface is directly displayed on the chess client. The backend generates a screenshot of the chess game based on the FEN chess record of the chess game, and then sends the screenshot of the chess game to the second account.
[0205] Preferably, after the above step S1001, the method further includes: displaying a first interactive window on the user interface of the target terminal, wherein the first interactive window is used to display candidate game record files; when a selection operation on a candidate game record file in the first interactive window is detected, the selected candidate game record file is used as the target game record file; or, displaying a second interactive window on the user interface of the target terminal, wherein the second interactive window is used to upload game record files; when a game record file uploaded from the second interactive window is detected, the uploaded game record file is used as the target game record file.
[0206] In a possible implementation of the present case, after the sharing operation is detected, the first interaction window or the second interaction window is displayed on the user interface;
[0207] Furthermore, a plurality of candidate game record files are displayed through the first interactive window, and the candidate game record files can be locally saved; then, according to user needs, a game record file selected from the plurality of candidate game record files is used as a target game record file; or, through the second interactive window, a game record file is uploaded from the server side.
[0208] Through the above implementation, a window for uploading target chess record files is provided for users to facilitate chess game dissemination.
[0209] In another possible implementation of the present invention, after the above step S1001, the following steps are further included:
[0210] Displaying a first send button on the sharing interface, wherein the first send button is used to send the chess move image to the second account;
[0211] Displaying a second send button on the sharing interface, wherein the second send button is used to send the pattern code corresponding to the chess move image to the second account;
[0212] A third send button is displayed on the sharing interface, wherein the third send button is used to send the link address corresponding to the chess move image to the second account.
[0213] According to the above embodiment, multiple sending buttons are set on the sharing interface, such as the first sending button, which is used to send the chess row image directly to the second account; the second sending button encodes at least one chess row image, obtains a pattern code and sends it to the second account. After the second account receives the pattern code, it performs pattern recognition and parses to obtain at least one chess row image contained in the pattern code; the third sending button encodes at least one chess row image as a link address, and then sends the link address to the second account. The second account opens the link to view the at least one chess row image.
[0214] Sharing chess move images with friends through any of the above sharing methods avoids the situation where the FEN file is directly sent to friends but the friends cannot recognize the FEN chess record, which is not conducive to the sharing and dissemination of chess records.
[0215] In addition, before displaying the sharing interface on the target terminal, the chess move image is generated according to the above steps S202 to S204.
[0216] The following further illustrates the method for sharing chess move images provided by the present invention with reference to a specific embodiment:
[0217] Figure 10 A user-side screenshot sharing process according to an embodiment of the present invention is schematically shown. Figure 10 As shown, the following steps are included:
[0218] On the user side, open the game page and play the game, then click the screenshot button and the share button;
[0219] Through the FEN image generator, obtain the current chess game instance FEN, pass it in, and parse the pre-created chess game instance to obtain chess game information; then, use the custom chessboard rendering pipeline to generate the chessboard image;
[0220] Display a chessboard sharing image with the chessboard FEN QR code on the user side interface and share it with friends;
[0221] The sharing method includes at least one of the following: directly sharing a screenshot of the chessboard with friends, sharing a QR code generated based on the chess move image with friends, sharing a link address generated based on the screenshot of the chessboard with friends;
[0222] Friends view the received chess move image. For example, if a friend generates a move based on a shared screenshot of a chess game, they can recognize the received QR code and restore the chess game based on the FEN identified in the QR code to complete the endgame, thus achieving the most intuitive display of the current chess game situation.
[0223] If a user needs to obtain a chess record FEN from the Internet and wants to share it with friends, if only the FEN is shared, others will hardly be able to understand the FEN chess record, which is not conducive to the sharing and dissemination of the chess record. In this case, through the above-mentioned embodiment, the FEN is directly converted into an image for sharing. The target user sees the chess game image generated based on the FEN and can directly and clearly see the chess piece arrangement.
[0224] Exemplary devices
[0225] After introducing the method of the exemplary embodiment of the present invention, next, reference is made to Figure 7 A chess game processing device according to an exemplary embodiment of the present invention is introduced.
[0226] The implementation of the chess game processing device can be referenced to the implementation of the above-mentioned method, and any repetitions will not be repeated here. The terms "unit" or "module" used below may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0227] The embodiment of the present invention provides a device for generating a chess move image. Figure 11 FIG. 1 schematically shows a device for generating a chess move image according to an exemplary embodiment of the present invention. Figure 11As shown, the device includes: an acquisition module 1101, used to obtain a target chess game file, wherein the target chess game file is a preset format file used to represent a target chess game; a generation module 1102, connected to the above-mentioned acquisition module 1101, used to generate a chess move image corresponding to the target chess game by parsing the target chess game file.
[0228] In one embodiment of the present invention, the generation module 1102 includes: a parsing unit, used to parse the target chess game file to obtain the game information of the target chess game; a rendering unit, used to render the chessboard interface according to the game information to restore the target chess game; and a screenshot unit, used to take a screenshot of the chessboard interface to obtain a chess move image.
[0229] In one embodiment of the present invention, the apparatus further includes: a first determination module configured to determine whether a characteristic character exists in the target game record file before the parsing unit parses the target game record file to obtain game information of the target game; and a second determination module configured to determine that the target game is a standard game if the characteristic character does not exist in the target game record file; otherwise, determine that the target game is a revealed game.
[0230] In one embodiment of the present invention, the parsing unit includes: a first determining subunit, configured to, when a target chess game is a standard chess game, determine that the target chess game file is a FEN file that uses standard FEN rules to represent the target chess game; and an initializing subunit, configured to call a chess game engine instance, initialize the target chess game according to the FEN file, and convert the FEN file into a two-dimensional chess game array, wherein the two-dimensional chess game array includes chess game information to be used for rendering a chessboard interface.
[0231] In one embodiment of the present invention, the parsing unit includes: a second determining subunit, configured to, when the target chess game is a Jieqi chess game, determine that the target chess record file is a preset FEN file that uses preset FEN rules to represent the target chess game; a disassembling subunit, configured to disassemble the preset FEN file to obtain a plurality of characters; and an identifying subunit, configured to identify the meaning of each character according to the preset FEN rules to obtain chess game information.
[0232] In one embodiment of the present invention, the recognition sub-unit is used to: in the initial situation of the target chess game, identify the characteristic characters in the preset FEN file corresponding to the hidden chess pieces of the target side of the two players; in the chess move situation of the target chess game, divide the character strings corresponding to each chess move from the preset FEN file, and identify the movement process of each chess piece according to the preset FEN rules and each character string.
[0233] In one embodiment of the present invention, the rendering unit includes: a third determination sub-unit, used to determine the chess square position and chess piece type corresponding to each chess square on the chessboard based on the chess game information; a drawing sub-unit, used to use a pre-configured rendering tool to draw each chess square on the chessboard interface according to the chess square position and chess piece type corresponding to each chess square to restore the target chess game.
[0234] In one embodiment of the present invention, the screenshot unit includes: a screenshot sub-unit, which is used to use a pre-configured screenshot tool to take a screenshot of the chessboard interface to obtain a chess move image, wherein the pre-configured screenshot tool corresponds to the pre-configured rendering tool.
[0235] In one embodiment of the present invention, the screenshot sub-unit is used to perform at least one of the following: taking an entire screenshot of the chessboard container that renders the chessboard interface; taking a regional screenshot of the chessboard container that renders the chessboard interface; calling a screenshot function to generate a screenshot of the chessboard interface, wherein the screenshot function is provided by the canvas object used to render the chessboard interface.
[0236] In an embodiment of the present invention, a device for displaying chess move images is provided. Figure 12 Schematically shows a display device for chess moves according to an exemplary embodiment of the present invention, such as Figure 12 As shown, the device includes: a detection module 1201, which is used to detect a preview operation for a target problem, wherein the target problem is associated with a target chess game, and the target chess game is represented by a target chess record file, which is a file in a preset format; and a display module 1202, which is connected to the above-mentioned detection module 1201 and is used to display a chess move image generated according to the target chess record file in response to the preview operation.
[0237] In one embodiment of the present invention, the display module 1202 includes: an access unit, configured to access a preset file server in response to a preview operation to access a move image corresponding to a target chess record file in the preset file server; and a display unit, configured to display the move image on a target interface.
[0238] In one embodiment of the present invention, before the access unit accesses the preset file server, the above-mentioned device further includes: an acquisition module for acquiring a chess move image, wherein the chess move image is generated by the device of the fifth aspect; and a saving module for saving the chess move image and the target chess record file to the preset file server.
[0239] In an embodiment of the present invention, a device for monitoring a chess game is provided. Figure 13 FIG. 1 is a diagram schematically showing a monitoring device for a chess game according to an exemplary embodiment of the present invention. Figure 13As shown, the device includes: a detection module 1301, which is used to detect a monitoring operation on a target chess game, wherein the target chess game is represented by a target chess record file, which is a preset format file, and the monitoring operation is used to request monitoring of the legality of each chess operation in the target chess game; a first display module 1302, which is connected to the above-mentioned detection module 1301 and is used to respond to the monitoring operation and display the legality monitoring results of each chess operation in the target chess game on the target interface.
[0240] In one embodiment of the present invention, before the first display module displays the legality monitoring results of each chess operation in the target chess game on the target interface in response to the monitoring operation, the above-mentioned device further includes: a second display module, which is used to display an interactive window on the target interface so as to upload the target chess game record file corresponding to the target chess game through the interactive window; or a recording module, which is used to record each chess operation in a preset format file when each chess operation is detected on the target interface to obtain the target chess game record file.
[0241] In one embodiment of the present invention, the above-mentioned device further includes: an acquisition module, which is used to obtain at least one chess line image corresponding to the target chess record file before the first display module displays the legality monitoring results of each chess operation in the target chess game on the target interface in response to the monitoring operation, wherein the at least one chess line image is generated by the device of the fifth aspect; and a monitoring module, which is used to display the legality monitoring results of the chess operation on the target interface based on the chess operation presented by the at least one chess line image.
[0242] In one embodiment of the present invention, the first display module 1302 includes: a determination unit, used to determine whether any target chess-moving operation among the chess-moving operations complies with the preset chess-moving rules; a display unit, used to display a first prompt window on the target interface when the target chess-moving operation complies with the preset chess-moving rules, to prompt that the target chess-moving operation is a legal operation; otherwise, display a second prompt window on the target interface to prompt that the target chess-moving operation is illegal.
[0243] In an embodiment of the present invention, a device for sharing chess move images is provided. Figure 14 Schematically shows a device for sharing chess move images according to an exemplary embodiment of the present invention. Figure 14 As shown, the above-mentioned device includes: a detection module 1401, which is used to detect a sharing operation on a target chess game, wherein the target chess game is represented by a target chess game file, and the target chess game file is a preset format file; a display module 1402, connected to the above-mentioned detection module 1401, which is used to respond to the sharing operation and display a sharing interface on the target terminal, wherein the sharing interface is used to share the chess move image corresponding to the target chess game file to a second account on the target terminal, and a first account belonging to the same platform as the second account is logged in to the target terminal.
[0244] In an embodiment of the present application, the device further comprises: a first display module configured to display a first interaction window on the user interface of the target terminal after the detection module detects the sharing operation for the target game, wherein the first interaction window is configured to display candidate score files; and in a case where a selection operation on a candidate score file in the first interaction window is detected, the selected candidate score file is taken as the target score file; or a second display module configured to display a second interaction window on the user interface of the target terminal, wherein the second interaction window is configured to upload a score file; and in a case where a score file uploaded from the second interaction window is detected, the uploaded score file is taken as the target score file.
[0245] In an embodiment of the present application, the device further comprises an acquisition module configured to acquire a move image corresponding to the target score file before the display module displays the sharing interface on the target terminal, wherein the move image is generated by the device of the fifth aspect.
[0246] In an embodiment of the present application, after the display module 1402 displays the sharing interface on the target terminal, the device further comprises at least one of: a third display module configured to display a first sending button on the sharing interface, wherein the first sending button is configured to send the move image to the second account; a fourth display module configured to display a second sending button on the sharing interface, wherein the second sending button is configured to send a pattern code corresponding to the move image to the second account; and a fifth display module configured to display a third sending button on the sharing interface, wherein the third sending button is configured to send a link address corresponding to the move image to the second account.
[0247] It should be noted that each of the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all of the modules are located in the same processor; or each of the modules is located in a different processor in any combination.
[0248] As shown in Figure 15 The embodiments of the present application provide an electronic device, which comprises a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 complete mutual communication through the communication bus 114,
[0249] The memory 113 is configured to store a computer program.
[0250] In an embodiment of the present application, the processor 111 is configured to execute the program stored in the memory 113, and implement the method steps provided in any one of the preceding method embodiments.
[0251] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method steps provided by any one of the foregoing method embodiments.
[0252] Optionally, specific examples in the embodiment can refer to the examples described in the foregoing embodiments and optional implementation manners, and the embodiment will not be described here again.
[0253] 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 illustrated 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.
[0254] 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 implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0255] These computer program instructions can also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks.
[0256] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer implemented process such that the instructions executed by the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0257] The use of the verb "comprise", "comprising", and words of similar meaning in the application document does not exclude the presence of elements other than those stated in the application document. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
[0258] 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 the aspects is not meant to imply that features from these aspects cannot be combined to benefit, but is merely for ease of presentation. The application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the claims appended hereto. The scope of the claims appended is to be construed in the broadest sense to encompass all such modifications and equivalent structures and functions.
Claims
1. A method for generating a chess move image, characterized in that: The method comprises: Obtaining a target chess game file, wherein the target chess game file is a file in a preset format for representing a target chess game; Generate a move image corresponding to the target chess game by parsing the target chess game file, wherein the move image is a screenshot of the chess game represented by the target chess game file; The step of generating a chess move image corresponding to the target chess game by parsing the target chess game file includes: parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain the chess move image.
2. The method according to claim 1, characterized in that Before parsing the target chess game file to obtain the game information of the target chess game, the method further includes: Determine whether the target chess game file contains a characteristic character; If the target chess game file does not contain the characteristic character, the target chess game is determined to be a standard chess game; otherwise, the target chess game is determined to be a revealed chess game.
3. The method according to claim 2, characterized in that The step of parsing the target chess game file to obtain the target chess game information includes: When the target chess game is a standard chess game, determining that the target chess record file is a FEN file that uses standard FEN rules to represent the target chess game; The game engine instance is called to initialize the target game according to the FEN file to convert the FEN file into a two-dimensional game array, wherein the two-dimensional game array includes game information to be used for rendering the chessboard interface.
4. The method according to claim 2, characterized in that The step of parsing the target chess game file to obtain the target chess game information includes: When the target chess game is a Jieqi chess game, determining that the target chess record file is a preset FEN file that uses a preset FEN rule to represent the target chess game; Decomposing the preset FEN file to obtain multiple characters; According to the preset FEN rule, the character meaning corresponding to each character is identified to obtain the chess game information.
5. The method according to claim 4, characterized in that The step of identifying the meaning of each character corresponding to each character according to the preset FEN rule to obtain the chess game information includes: In the initial position of the target chess game, identifying the characteristic characters in the preset FEN file corresponding to the dark pieces of the target player in the two players; In the chess move situation of the target chess game, character strings corresponding to each chess move are divided from the preset FEN file, and the movement process of each chess piece is identified according to the preset FEN rules and each character string.
6. The method according to any one of claims 1 to 5, characterized in that Rendering a chessboard interface according to the chess game information to restore the target chess game includes: Determine the chess square position and chess piece type corresponding to each chess square on the chessboard according to the chess game information; A pre-configured rendering tool is used to draw each chess square on the chessboard interface according to the chess square position and chess piece type corresponding to each chess square, so as to restore the target chess game.
7. The method according to claim 6, characterized in that The taking a screenshot of the chessboard interface to obtain the chess move image includes: A pre-configured screenshot tool is used to take a screenshot of the chessboard interface to obtain the chess move image, wherein the pre-configured screenshot tool corresponds to the pre-configured rendering tool.
8. The method according to claim 7, characterized in that The taking a screenshot of the chessboard interface using a pre-configured screenshot tool includes at least one of the following: Taking a screenshot of the entire chessboard container that renders the chessboard interface; Taking a regional screenshot of the chessboard container that renders the chessboard interface; A screenshot function is called to generate a screenshot of the chessboard interface, wherein the screenshot function is provided by the canvas object used to render the chessboard interface.
9. A method for displaying a chess move image, characterized in that: The method comprises: A preview operation for a target problem is detected, wherein the target problem is associated with a target chess game, the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format; In response to the preview operation, displaying a chess move image generated according to the target chess game file, wherein the chess move image is a screenshot of the chess game represented by the target chess game file; The chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain an image.
10. The method according to claim 9, characterized in that In response to the preview operation, displaying a move image generated according to the target game record file includes: In response to the preview operation, accessing a preset file server to access a move image corresponding to the target chess record file in the preset file server; The chess move image is displayed on the target interface.
11. The method according to claim 10, characterized in that Before accessing the preset file server, the method further includes: Acquire the chess move image, wherein the chess move image is generated according to the method steps of any one of claims 1 to 8; The chess move image and the target chess record file are saved in the preset file server.
12. A method for monitoring a chess game, characterized in that: The method comprises: A monitoring operation for a target chess game is detected, wherein the target chess game is represented by a target chess game file, which is a file in a preset format, and the monitoring operation is used to request monitoring of the legality of each chess move in the target chess game; the target chess game file includes a chess move image, which is a screenshot of the chess game represented by the target chess game file; the chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; a chessboard interface is rendered according to the chess game information to restore the target chess game; and a screenshot of the chessboard interface is taken to obtain an image; In response to the monitoring operation, the legality monitoring results of each chess operation in the target chess game are displayed on the target interface.
13. The method according to claim 12, characterized in that Before displaying the legality monitoring results of each chess operation in the target chess game on the target interface in response to the monitoring operation, the method further includes: Displaying an interactive window on the target interface to upload a target chess record file corresponding to the target chess game through the interactive window; or, When each chess move operation on the target interface is detected, each chess move operation is recorded using the preset format file to obtain the target chess record file.
14. The method according to claim 13, characterized in that Before displaying the legality monitoring results of each chess operation in the target chess game on the target interface in response to the monitoring operation, the method further includes: Obtaining at least one chess line image corresponding to the target chess record file, wherein the at least one chess line image is generated according to the method steps of any one of claims 1 to 8; According to the chess-moving operation presented by the at least one chess-row image, a legality monitoring result of the chess-moving operation is displayed on the target interface.
15. The method according to claim 12, characterized in that In response to the monitoring operation, displaying the legality monitoring results of each chess operation in the target chess game on the target interface includes: Determine whether any target chess move in each chess move complies with a preset chess move rule; If the target chess-moving operation complies with the preset chess-moving rules, a first prompt window is displayed on the target interface to prompt that the target chess-moving operation is a legal operation; otherwise, a second prompt window is displayed on the target interface to prompt that the target chess-moving operation is illegal.
16. A method for sharing chess move images, characterized in that: The method comprises: A sharing operation for a target chess game is detected, wherein the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format; In response to the sharing operation, a sharing interface is displayed on the target terminal, wherein the sharing interface is used to share the chess move image corresponding to the target chess record file to a second account on the target terminal, wherein a first account belonging to the same platform as the second account is logged into the target terminal, wherein the chess move image is a screenshot of the chess game represented by the target chess record file; The chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain an image.
17. The method according to claim 16, characterized in that After detecting a sharing operation on the target chess game, the method further includes: Displaying a first interactive window on the user interface of the target terminal, wherein the first interactive window is used to display candidate game record files; when a selection operation of a candidate game record file in the first interactive window is detected, using the selected candidate game record file as the target game record file; or A second interactive window is displayed on the user interface of the target terminal, wherein the second interactive window is used to upload a game record file; and when a game record file uploaded from the second interactive window is detected, the uploaded game record file is used as the target game record file.
18. The method according to claim 16 or 17, characterized in that Before displaying the sharing interface on the target terminal, the method further includes: Obtain a chess move image corresponding to the target chess record file, wherein the chess move image is generated according to the method steps of any one of claims 1-8.
19. The method according to claim 16, wherein After displaying the sharing interface on the target terminal, the method further includes at least one of the following: Displaying a first send button on the sharing interface, wherein the first send button is used to send the chess move image to the second account; Displaying a second sending button on the sharing interface, wherein the second sending button is used to send the pattern code corresponding to the chess move image to the second account; A third sending button is displayed on the sharing interface, wherein the third sending button is used to send the link address corresponding to the chess move image to the second account.
20. A device for generating a chess move image, characterized in that: The device comprises: An acquisition module, configured to acquire a target chess game file, wherein the target chess game file is a file in a preset format for representing a target chess game; a generation module, configured to generate a move image corresponding to the target chess game by parsing the target chess game file, wherein the move image is a screenshot of the chess game represented by the target chess game file; The chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain an image.
21. A device for displaying chess moves, characterized in that: The device comprises: a detection module, configured to detect a preview operation on a target problem, wherein the target problem is associated with a target chess game, the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format; a display module, configured to display a chess move image generated according to the target chess game file in response to the preview operation, wherein the chess move image is a screenshot of the chess game represented by the target chess game file; The chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain an image.
22. A chess game monitoring device, characterized in that: The device comprises: a detection module configured to detect a monitoring operation on a target chess game, wherein the target chess game is represented by a target chess game record file, which is a file in a preset format, and the monitoring operation is configured to request monitoring of the legality of each chess move in the target chess game; the target chess game record file includes a chess move image, which is a screenshot of the chess game represented by the target chess game record file; the chess move image is obtained by parsing the target chess game record file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; a chess board interface is rendered according to the chess game information to restore the target chess game; and a screenshot of the chess board interface is taken to obtain an image; The first display module is used to display the legality monitoring results of each chess operation in the target chess game on the target interface in response to the monitoring operation.
23. A device for sharing chess move images, characterized in that: The device comprises: a detection module, configured to detect a sharing operation on a target chess game, wherein the target chess game is represented by a target chess record file, and the target chess record file is a file in a preset format; a display module configured to display a sharing interface on a target terminal in response to the sharing operation, wherein the sharing interface is configured to share a chess move image corresponding to the target chess record file on the target terminal to a second account, wherein a first account belonging to the same platform as the second account is logged into the target terminal, wherein the chess move image is a screenshot of the chess game represented by the target chess record file; The chess move image is obtained by parsing the target chess game file to obtain chess game information of the target chess game, wherein the chess game information includes the position and type of each chess piece; rendering a chessboard interface according to the chess game information to restore the target chess game; and taking a screenshot of the chessboard interface to obtain an image.
24. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 19 are implemented.
25. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 19 are implemented.
Citation Information
Patent Citations
Handwritten chess manual auxiliary input method and device based on deep learning
CN112948619A
Chess situation conversion method and device based on template matching and storage medium
CN114444621A
Chinese chess capable of being played in visible mode and blind mode
CN203971359U