Chessboard display method and device, electronic equipment and storage medium
By defining object attribute information and target area in the chessboard display method and scaling the display accordingly, the problem of inconvenient operation caused by small objects in chess games is solved, improving user experience and device intelligence.
Patent Information
- Application Number
- CN202211400788.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-11-09
AI Technical Summary
In existing technologies, the objects on the board of chess games with many lines are too small, which makes it inconvenient for users to operate, distracts their attention, and reduces the operating experience and accuracy.
By determining the object's attribute information based on the chessboard information, building a data tree, determining the target area and scaling factor, scaling the chessboard and rendering the display, the accuracy of the object's attribute information and the accuracy of the chessboard scaling are improved.
It improves the convenience and accuracy of user operation, focuses user attention, enhances the user experience, and increases the automation and intelligence of the equipment.
Smart Images

Figure CN115920364B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer science and technology, and more specifically, the embodiments of the present invention relate to a chessboard display method and apparatus, electronic device and storage medium. Background Technology
[0002] This section is intended to provide background or context for embodiments of the invention as set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] Currently, board games have become a very popular form of intellectual stimulation, offering endless possibilities and endless fun. They are also highly beneficial for intellectual development and character cultivation. Applications of board games include, but are not limited to, real-time gameplay, online game study, and problem-solving.
[0004] In related technologies, in some board games, due to the large number of lines (e.g., Go with 19 lines), the objects are relatively small, making it inconvenient for users to operate, thereby reducing the user's operating experience and accuracy, and failing to meet the user's needs well. Summary of the Invention
[0005] Therefore, there is a great need for an improved chessboard display method and related products to enhance the ease of operation, thereby improving operational efficiency and accuracy, and ultimately enhancing the user's operating experience.
[0006] In this context, embodiments of the present invention are intended to provide a chessboard display method and apparatus, an electronic device, and a storage medium.
[0007] In a first aspect of the present invention, a chessboard display method is provided, comprising:
[0008] Based on the chessboard information to be displayed, determine the attribute information of at least one object in the chessboard;
[0009] Based on the attribute information of each object, a target area containing the target object is determined, wherein the target object includes at least one displayed object and an object to be displayed.
[0010] Based on the target area, determine the scaling factor for scaling the chessboard;
[0011] The chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method.
[0012] In one embodiment of the present invention, determining the attribute information of at least one object in the chessboard based on the chessboard information to be displayed includes: establishing a data tree corresponding to the chessboard information to be displayed using a preset construction method; and determining the attribute information of at least one object in the chessboard based on the data tree. Thus, obtaining the object's attribute information using the constructed data tree not only reduces the time required to acquire the object's attribute information but also improves the accuracy of the object's attribute information.
[0013] In another embodiment of the present invention, the at least one object includes at least one displayed object and at least one object to be displayed; determining the attribute information of at least one object in the chessboard based on the data tree includes: obtaining the attribute information of each of the displayed objects based on a first node of the data tree; obtaining the attribute information of each of the objects to be displayed based on a second node of the data tree, wherein the second node and the first node are at different levels in the data tree. Thus, different objects and the relationships between them are represented by nodes at different levels of the data tree. On the one hand, this improves the accuracy of the object attribute information and facilitates the management of each object; on the other hand, it reduces the amount of object data stored.
[0014] In another embodiment of the present invention, determining the scaling factor for scaling the chessboard based on the target area includes: determining a target scaling position from at least one preset scaling position based on the target area; and determining the scaling factor based on the target scaling position. Thus, on the one hand, using the target area to determine the target scaling position from at least one preset scaling position can improve the accuracy of the target scaling position; on the other hand, determining the scaling factor through the target scaling position can improve the accuracy of the scaling factor, thereby improving the accuracy of chessboard scaling.
[0015] In another embodiment of the present invention, determining the scaling factor based on the target scaling position includes: acquiring first path information corresponding to the target scaling position; acquiring second path information of the chessboard; and determining the scaling factor based on the first path information and the second path information. Thus, on the one hand, by acquiring the pre-established first path information corresponding to the target scaling position, the accuracy of the first path information can be improved, thereby improving the accuracy of the scaling factor; on the other hand, determining the scaling factor based on the first path information and the second path information of the chessboard can improve the accuracy of the scaling factor, thereby improving the accuracy of chessboard scaling.
[0016] In another embodiment of the present invention, determining the scaling factor based on the first path information and the second path information includes: determining the ratio between the first path information and the second path information; and obtaining the scaling factor based on the ratio. Thus, determining the scaling factor based on the ratio between different path information can improve the accuracy of the scaling factor, thereby improving the accuracy of chessboard scaling.
[0017] In another embodiment of the present invention, determining the target scaling position from at least one preset scaling position based on the target region includes: determining the maximum / minimum position information corresponding to the target region based on the target region; obtaining a data structure corresponding to each scaling position, each data structure including flag information corresponding to each position on the chessboard, each flag information representing whether an object exists at the corresponding position on the chessboard; and determining the target scaling position based on the maximum / minimum position information and the data structure corresponding to each scaling position. Thus, by comparing the maximum / minimum position information corresponding to the target region with the data structures corresponding to different scaling positions to determine the target scaling position from different scaling positions, the accuracy of the target scaling position can be improved, thereby improving the accuracy of the scaling factor, and consequently improving the accuracy of chessboard scaling.
[0018] In another embodiment of the present invention, determining the target scaling position based on the extreme value position information and the data structure corresponding to each scaling position includes: for each scaling position, obtaining target flag information matching the extreme value position information from the flag information corresponding to each position in the data structure; and determining the target scaling position based on each target flag information. Thus, by comparing the extreme value position information with the flag information corresponding to each position in each scaling position to determine the target scaling position from different scaling positions, the accuracy of the target scaling position can be improved, thereby improving the accuracy of the scaling factor, and further improving the accuracy of chessboard scaling.
[0019] In another embodiment of the present invention, each of the target marker information includes first target marker information and second target marker information, wherein the first target marker information and the second target marker information respectively characterize marker information at different positions in the extreme value position information; determining the target scaling position based on each of the target marker information includes: for each target marker information, if both the first target marker information and the second target marker information are preset identifiers, taking the scaling position corresponding to the target marker information as the target scaling position. Thus, by comparing each first target marker information and the second target marker information with preset identifiers to determine the final target marker information from different target marker information, the accuracy of the final target marker information can be improved, thereby improving the accuracy of the target scaling position, and further improving the accuracy of the scaling factor.
[0020] In a second aspect of the present invention, a chessboard display device is provided, the device comprising:
[0021] The first determining module is used to determine the attribute information of at least one object in the chessboard based on the chessboard information to be displayed;
[0022] The second determining module is used to determine a target area containing the target object based on the attribute information of each object, wherein the target object includes at least one displayed object and an object to be displayed.
[0023] The third determining module is used to determine the scaling factor for scaling the chessboard based on the target area;
[0024] The display module is used to scale the chessboard according to the scaling factor and render and display the scaled chessboard using a preset rendering method.
[0025] In a third aspect of the present invention, an electronic device is provided, including a processor and a memory, the memory storing a computer program executable on the processor, characterized in that the processor executes the computer program to implement the method described in any of the preceding claims.
[0026] In a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method described in any of the preceding claims.
[0027] According to the chessboard display method, apparatus, electronic device, and storage medium of the present invention, on the one hand, by parsing the chessboard information, a scaled chessboard including the target area is generated and displayed, which improves the convenience of user operation and focuses the user's attention, thereby improving the efficiency and accuracy of user operation, and thus enhancing the user's operating experience and better meeting the user's needs; on the other hand, by automatically scaling the chessboard display according to the scaling factor, the automation and intelligence of the device can be improved. Attached Figure Description
[0028] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:
[0029] Figure 1A The diagram illustrates an application scenario of a chessboard display provided by an embodiment of the present invention.
[0030] Figure 1B A schematic flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown.
[0031] Figure 2 A schematic flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown.
[0032] Figure 3 A schematic flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown.
[0033] Figure 4A A schematic diagram of an existing Go board is shown.
[0034] Figure 4B A schematic flowchart of a chessboard display method according to an embodiment of the present invention is shown.
[0035] Figure 4C The diagram illustrates a scaled-down Go board according to an embodiment of the present invention.
[0036] Figure 5 A schematic block diagram illustrating the composition of a chessboard display device according to an embodiment of the present invention is shown.
[0037] Figure 6 A schematic diagram of the hardware entity of an electronic device according to an embodiment of the present invention is shown.
[0038] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0039] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are given merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art. Invention Overview
[0041] The inventors have discovered that in current online game scenarios such as game record analysis and problem-solving, sometimes all objects are located in a specific position on the board (e.g., the top left corner, bottom right corner, etc.). For board games with multiple lines (e.g., 19x19 Go, 23x23 Go), since the board size and object placement are basically fixed, each object on the board is relatively small. If the board of the corresponding line is still fully displayed, it will not only easily distract the user's attention but also affect the user's operation, thereby reducing the user's operating experience.
[0042] In view of this, embodiments of the present invention provide at least one chessboard display method and apparatus, electronic device, and storage medium. According to an embodiment of the present invention, in the process of displaying a chessboard, firstly, based on the chessboard information to be displayed, attribute information of at least one object in the chessboard is determined; secondly, based on the attribute information of each object, a target area containing a target object is determined, the target object including at least one already displayed object and a currently to be displayed object; then, based on the target area, a scaling factor for scaling the chessboard is determined; finally, the chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method. Thus, on the one hand, by parsing the chessboard information to generate and display a scaled chessboard including the target area, the convenience of user operation is improved while also focusing the user's attention, thereby improving the efficiency and accuracy of user operation, and thus enhancing the user's operating experience and better meeting user needs; on the other hand, by automatically scaling the chessboard display according to the scaling factor, the automation and intelligence of the device can be improved.
[0043] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.
[0044] Overview of application scenarios for chessboard displays
[0045] First refer to Figure 1A , Figure 1A The diagram schematically illustrates an application scenario of a chessboard display provided by an embodiment of the present invention. For example... Figure 1A As shown, the display page includes at least a chessboard 101, which is a 19-line chessboard, i.e., horizontally from line A to line S and vertically from line A to line S. The chessboard 101 includes at least one displayed piece 102. Since each piece 102 is concentrated in the upper right corner of the chessboard, the chessboard 101 can be enlarged to a 13-line chessboard, i.e., horizontally from line A to line M and vertically from line G to line S.
[0046] In the process of displaying the chessboard, firstly, based on the chessboard information to be displayed, the attribute information of at least one object in the chessboard is determined; secondly, based on the attribute information of each object, a target area containing the target object is determined, the target object including at least one already displayed object and the object to be displayed; then, based on the target area, a scaling factor for scaling the chessboard is determined; finally, the chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method.
[0047] It should be noted that the display page can be displayed on any suitable electronic device with a user interface. In implementation, the electronic device displaying the page can be the same as or different from the device executing the chessboard display method; this is not limited. For example, the electronic device executing the chessboard display method can be a laptop computer, and the electronic device displaying the page can also be the laptop computer. The display page can be an interactive interface of a client running on the laptop computer, or a webpage displayed in a browser running on the laptop computer. Alternatively, the electronic device executing the chessboard display method can be a server, and the electronic device displaying the page can be a laptop computer. The display page can be an interactive interface of a client running on the laptop computer, or a webpage displayed in a browser running on the laptop computer. The laptop computer can access the server through the client or the browser. The electronic device can be a laptop computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), or any other type of terminal, and can also be implemented as a server. A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, 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 communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0048] Exemplary chessboard display method
[0049] The following is combined Figure 1A Application scenarios, refer to Figure 1B This description outlines a method for displaying a chessboard according to an exemplary embodiment of the present invention. It should be noted that the above application scenarios are shown only to facilitate understanding of the spirit and principles of the invention, and the embodiments of the invention are not limited in any way. Rather, the embodiments of the invention can be applied to any applicable scenario.
[0050] This invention provides a chessboard display method, which can be executed by an electronic device. Figure 1B The flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown schematically. Figure 1B As shown, the method includes the following steps S11 to S14, wherein:
[0051] Step S11: Based on the chessboard information to be displayed, determine the attribute information of at least one object in the chessboard.
[0052] Here, the chessboard information to be displayed can be obtained from any suitable file capable of representing chessboard information. For example, SGF (Smart Game Format) game records, images, etc. In implementation, those skilled in the art can choose the appropriate file format for the chessboard information according to actual needs; this embodiment of the invention does not impose any limitations.
[0053] In some implementations, the chessboard information to be displayed can be selected by a gesture or operation entered by the user on the display page through an input component of the electronic device. This input component may include, but is not limited to, a keyboard, mouse, touchscreen, touchpad, audio input device, etc. For example, if the user enters a preset gesture on the display page, the chessboard information in the corresponding SGF file will be used as the chessboard information to be displayed. As another example, if the user selects a chessboard image in a selection area on the display page using the mouse, the chessboard information corresponding to that image will be used as the chessboard information to be displayed.
[0054] In some implementations, the chessboard information to be displayed can be determined by voice input from the user. For example, if the user inputs "chessboard A", the chessboard information corresponding to "chessboard A" will be used as the chessboard information to be displayed.
[0055] In some implementations, the chessboard information to be displayed can be remotely selected by the user. For example, the user selects a specific SGF chess notation on the interface of another electronic device and sends the SGF chess notation to the electronic device via Bluetooth or a wireless network. The electronic device then uses the chessboard information corresponding to the SGF chess notation as the chessboard information to be displayed.
[0056] In some implementations, the chessboard information to be displayed can also be captured by an electronic device. For example, the electronic device captures an image of the chessboard using a camera, and obtains the chessboard information to be displayed from that image.
[0057] In practice, those skilled in the art can independently determine the method of displaying the chessboard information according to actual needs, and the embodiments of the present invention are not limited thereto.
[0058] Objects on the chessboard can include, but are not limited to, chess pieces and markers. The types of chess pieces correspond to the type of chess game. For example, in Gomoku and Go, the pieces include black and white pieces. In Chinese chess, the pieces include rooks, knights, and cannons. Markers can include, but are not limited to, triangles, squares, circles, cubes, crosses, and tigers.
[0059] An object's attribute information may include, but is not limited to, the object's position, the object's color, etc.
[0060] In some implementations, a data tree corresponding to the chessboard information to be displayed is constructed, and the attribute information of each object is determined based on this data tree. The data tree can be any tree structure capable of representing the chessboard information, such as a game tree or a strategy tree. In implementation, those skilled in the art can choose the tree structure according to actual needs, and this embodiment of the invention does not impose any limitations.
[0061] Step S12: Based on the attribute information of each object, determine the target region containing the target object.
[0062] Here, the target object includes at least one already displayed object and the object to be displayed. In implementation, the target area can be a rectangular region enclosed by the target objects, i.e., the boundary formed by the target objects. In some implementations, the target area is obtained based on the position information of each object. In implementation, the vertices of the rectangular region are obtained based on the position information of each object, and the rectangular region enclosed by these vertices is taken as the target area.
[0063] Step S13: Based on the target area, determine the scaling factor for scaling the chessboard.
[0064] Here, scaling can include, but is not limited to, shrinking and enlarging. For example, this scaling factor can be used to enlarge the chessboard for display. Or, for another example, this scaling factor can be used to shrink the chessboard for display. The scaling factor represents the size by which the chessboard is scaled.
[0065] In some implementations, the scaling factor is determined by the target area and the chessboard. The methods for determining the scaling factor may include, but are not limited to, the ratio / mean / variance / mean squared error between the size of the target area and the size of the chessboard, the weighted ratio / mean / variance / mean squared error of the size of the target area and the size of the chessboard, the difference between the size of the target area and the size of the chessboard, and the ratio / mean / variance / mean squared error between the size of the target area and the size of the chessboard. In practice, those skilled in the art can choose the method for determining the scaling factor according to actual needs; this embodiment of the invention does not limit this method. For example, when the size of the target area is approximately one-quarter of the size of the chessboard, the scaling factor can be 4. Or, for example, when the size of the target area is one-quarter of the size of the chessboard, the scaling factor can be 2.
[0066] In some implementations, a target scaling position is determined from at least one scaling position using a target region, and the scaling factor is determined based on the path information of the target scaling position and the path information of the chessboard.
[0067] Here, at least one scaling position can be a set of positions divided according to preset rules. These preset rules may include, but are not limited to, the default configuration of the electronic device, user-defined settings, user preferences, and usage frequency. In some embodiments, the scaling position may include, but is not limited to, at least one of the following: top left corner, top right corner, bottom left corner, bottom right corner, center, top left side, top right side, bottom left side, and bottom right side. In implementation, those skilled in the art can set more or fewer scaling positions according to actual needs; this embodiment of the invention does not impose such limitations.
[0068] The number of paths corresponding to different scaling positions can be the same or different. For example, the number of paths corresponding to scaling positions such as the top left, top right, bottom left, and bottom right can be 13, the number of paths corresponding to scaling positions such as the top left, top right, bottom left, and bottom right can be 9, and the number of paths corresponding to scaling positions containing at least two positions can be the number of paths of the chessboard.
[0069] In some implementations, a correspondence between zoom position and channel number information can be pre-established and stored in an electronic device or other electronic device. When the correspondence is stored in an electronic device, the electronic device determines the channel number information matching the zoom position in the correspondence. When the correspondence is stored in other electronic devices, the electronic device sends the zoom position to the other electronic device, enabling the other electronic device to determine the channel number information matching the zoom position in the correspondence and return the channel number information to the electronic device. In practice, those skilled in the art can determine the correspondence between zoom position and channel number information according to actual needs; this embodiment of the invention does not impose limitations. For example, if the electronic device determines the channel number information matching the top-left corner in the correspondence based on the zoom position as the top-left corner, it finds 13 channels.
[0070] The methods for determining the scaling factor may include, but are not limited to, the ratio / mean / variance / mean squared error between the path information of the target scaling position and the path information of the chessboard; rounding the ratio / mean / variance / mean squared error between the path information of the target scaling position and the path information of the chessboard; weighting the ratio / mean / variance / mean squared error between the path information of the target scaling position and the path information of the chessboard separately; and rounding the ratio / mean / variance / mean squared error between the weighted ratio of the path information of the target scaling position and the path information of the chessboard separately. The rounding method may include, but is not limited to, rounding up and rounding down. In implementation, those skilled in the art can choose the method for determining the scaling factor according to actual needs, and this embodiment of the invention does not impose limitations.
[0071] In some implementations, the scaling factor θ can be obtained using the following formula (1-1):
[0072]
[0073] Where u1 represents the number of paths on the chessboard, and u2 represents the number of paths at the target scaling position.
[0074] For example, if the number of lanes at the target scaling position is 13 and the number of lanes on the chessboard is 19, then the scaling factor can be 19 / 13, which is approximately 1.4.
[0075] Step S14: Scale the chessboard according to the scaling factor, and render and display the scaled chessboard using a preset rendering method.
[0076] Here, the scaling method can include, but is not limited to, proportional scaling and non-proportional scaling. The objects being scaled can include, but are not limited to, at least one of the following: chess pieces, markers, the horizontal dimension of the chessboard, and the vertical dimension of the chessboard. For example, with a scale factor of 2, a non-proportional scaling method, and the objects being scaled including the horizontal dimension of the chess pieces, markers, and the chessboard, the horizontal dimension of the chess pieces, markers, and the chessboard is enlarged by a factor of 2, while the vertical dimension of the chessboard remains unchanged. As another example, with a scale factor of 1.5, a proportional scaling method, and the objects being scaled including the horizontal dimension of the chess pieces, the horizontal dimension of the chessboard, and the vertical dimension of the chessboard, the horizontal dimension of the chess pieces, the horizontal dimension of the chessboard, and the vertical dimension of the chessboard are enlarged by a factor of 1.5.
[0077] Rendering methods can include, but are not limited to, partial rendering and global rendering. Partial rendering refers to redrawing a portion of the scaled chessboard. Global rendering refers to redrawing the entire scaled chessboard. For example, for a 19x19 chessboard, in implementation, the scaled chessboard and objects to be displayed can be rendered directly on the display page, or the scaled 19x19 chessboard and its objects can be rendered first, and then the chessboard and objects to be displayed can be moved to the display page. The display page can be the page corresponding to the chessboard to be displayed in the next moment.
[0078] In the embodiments of the present invention described above, attribute information of at least one object in the chessboard is determined based on the chessboard information to be displayed; a target area containing a target object is determined based on the attribute information of each object, the target object including at least one already displayed object and a currently to be displayed object; a scaling factor for scaling the chessboard is determined based on the target area; the chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method. Thus, on the one hand, by parsing the chessboard information to generate and display a scaled chessboard including the target area, the convenience of user operation is improved while also focusing the user's attention, thereby improving the efficiency and accuracy of user operation, and ultimately enhancing the user's operating experience and better meeting user needs; on the other hand, by automatically scaling the chessboard display according to the scaling factor, the automation and intelligence of the device can be improved.
[0079] Figure 2 The flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown schematically. Figure 2 As shown, the method includes the following steps S21 to S25, wherein:
[0080] Step S21: Using the preset construction method, build the data tree corresponding to the chessboard information to be displayed.
[0081] Here, the construction method can be any suitable way to build a data tree. For example, a construction engine, data parsing methods, etc. For instance, a custom `newFromSgf` method can be used to parse the SGF chess notation and generate the corresponding data tree. In implementation, those skilled in the art can choose the method for building the data tree according to actual needs; this embodiment of the invention does not impose any limitations.
[0082] The data tree can be any tree structure capable of representing chessboard information. Examples include game trees and strategic tree structures. In implementation, those skilled in the art can choose the tree structure according to actual needs; this embodiment of the invention does not impose any limitations.
[0083] In some implementations, the data tree includes at least one level, and each level includes at least one node. In practice, each node represents attribute information between objects and the relationships between them. For example, parsing the `data` object in the game tree yields information about all objects placed on the board at the start of the game. Similarly, parsing the `children` object in the game tree provides information about objects that will be used later.
[0084] Step S22: Based on the data tree, determine the attribute information of at least one object in the chessboard.
[0085] Here, at least one object can include, but is not limited to, displayed pieces, displayed markers, pieces to be displayed, and markers to be displayed. Attribute information can include, but is not limited to, color and position. In implementation, the attribute information of each object can be obtained by parsing the data tree.
[0086] Step S23: Based on the attribute information of each object, determine the target area containing the target object, wherein the target object includes at least one displayed object and an object to be displayed.
[0087] Step S24: Based on the target area, determine the scaling factor for scaling the chessboard.
[0088] Step S25: Scale the chessboard according to the scaling factor, and render and display the scaled chessboard using a preset rendering method.
[0089] Here, steps S23 to S25 correspond to steps S12 to S14, respectively. In implementation, the specific implementation methods of steps S12 to S14 can be referred to.
[0090] In the embodiments of the present invention described above, a data tree corresponding to the chessboard information to be displayed is established using a preset construction method; based on the data tree, attribute information of at least one object in the chessboard is determined; based on the attribute information of each object, a target area containing a target object is determined, the target object including at least one already displayed object and a currently to be displayed object; based on the target area, a scaling factor for scaling the chessboard is determined; the chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method. Thus, obtaining the object attribute information using the constructed data tree not only reduces the time required to acquire the object attribute information but also improves the accuracy of the object attribute information.
[0091] In some embodiments, the at least one object includes at least one displayed object and at least one object to be displayed; step S22 includes steps S221 to S222, wherein:
[0092] Step S221: Based on the first node of the data tree, obtain the attribute information of each of the displayed objects.
[0093] Here, the first node stores at least the attribute information of each displayed object. For example, the `data` object is stored in the first node, and this `data` object includes the attribute information of all displayed objects. For instance, the content of `data` might be:
[0094] (;CA[GB2312]AB[ep][gp]AW[ek][em]CR[pl]TR[po]SQ[lm]......)
[0095] Among them, CA[GB2312] indicates that the encoding method used by the current character is GB2312, AB[ep][gp] indicates that a black piece is placed at the positions ep and gp, AW[ek][em] indicates that a white piece is placed at the positions ek and em, CR[pl] indicates that a circular mark is placed at pl, TR[po] indicates that a triangle mark is placed at po, and SQ[lm] indicates that a square mark is placed at lm.
[0096] Step S222: Based on the second node of the data tree, obtain the attribute information of each object to be displayed.
[0097] Here, the second node is at a different level than the first node in the data tree. The second node stores at least the attribute information of each object to be displayed. For example, the `children` object is stored in the second node, and this `children` object includes the attribute information of all objects to be displayed. For instance, parsing the identifiers ['B', 'W', 'CR', 'MA', 'SQ', 'TR'] in the `children` object reveals the pieces and markers that were not placed on the board at the start but will be placed later. Here, B represents a black piece to be placed later, W represents a white piece to be placed later, CR represents a circle marker to be added later, MA represents an "X" shaped marker to be added later, SQ represents a square marker to be added later, and TR represents a triangle marker to be added later.
[0098] In the embodiments of the present invention described above, attribute information of each displayed object is obtained based on the first node of the data tree; and attribute information of each object to be displayed is obtained based on the second node of the data tree. In this way, different objects and the relationships between them are represented by nodes at different levels of the data tree. On the one hand, this improves the accuracy of object attribute information and facilitates the management of each object; on the other hand, it reduces the amount of object data stored.
[0099] Figure 3 The flowchart illustrating the implementation of a chessboard display method according to an embodiment of the present invention is shown schematically. Figure 3 As shown, the method includes the following steps S31 to S35, wherein:
[0100] Step S31: Based on the chessboard information to be displayed, determine the attribute information of at least one chess piece object in the chessboard.
[0101] Step S32: Based on the attribute information of each object, determine the target area containing the target object, wherein the target object includes at least one displayed object and an object to be displayed.
[0102] Here, steps S31 to S32 correspond to steps S11 to S12, respectively. In implementation, the specific implementation methods of steps S11 to S12 can be referred to.
[0103] Step S33: Based on the target area, determine the target scaling position from at least one preset scaling position.
[0104] Here, at least one scaling position can be a set of positions divided according to preset rules. These preset rules may include, but are not limited to, the default configuration of the electronic device, user-defined settings, user preferences, and usage frequency. In some embodiments, the scaling position may include, but is not limited to, at least one of the following: top left corner, top right corner, bottom left corner, bottom right corner, center, top left side, top right side, bottom left side, and bottom right side. In implementation, those skilled in the art can set more or fewer scaling positions according to actual needs; this embodiment of the invention does not impose such limitations.
[0105] The methods for determining the target scaling position can include, but are not limited to, custom methods, and methods based on the similarity between the target region and each scaling position. This similarity can be obtained using any suitable method capable of calculating similarity. Examples include distance metrics (such as Manhattan distance or Euclidean distance), cosine similarity, normal distribution, and Pearson correlation coefficient. In implementation, those skilled in the art can choose the method for calculating similarity according to actual needs; this embodiment of the invention does not impose limitations.
[0106] In some implementations, the target scaling location may include at least one scaling location.
[0107] Step S34: Based on the target scaling position, determine the scaling factor for scaling the chessboard.
[0108] Here, the scaling factor can be the same or different for different target scaling positions.
[0109] In some implementations, a correspondence between scaling positions and scaling factors can be pre-established and stored in an electronic device or other electronic device. When the correspondence is stored in an electronic device, the electronic device determines the scaling factor matching the scaling position in the correspondence based on the scaling position. When the correspondence is stored in other electronic devices, the electronic device sends the scaling position to the other electronic device, enabling the other electronic device to determine the scaling factor matching the scaling position in the correspondence based on the scaling position and return the scaling factor to the electronic device. In practice, those skilled in the art can determine the correspondence between scaling positions and scaling factors according to actual needs; this embodiment of the invention does not impose limitations. For example, the electronic device might find a scaling factor of 1.5 matching the top-left corner in the correspondence based on the scaling position being the top-left corner. Or, the electronic device might find a scaling factor of 1 matching both the top-left and bottom-right corners in the correspondence based on the scaling position being the top-left and bottom-right corners.
[0110] In some implementations, the scaling factor is determined by comparing the number of paths at the target scaling position with the number of paths on the chessboard. Methods for determining the scaling factor may include, but are not limited to, the ratio / mean / variance / mean squared error between the number of paths at the target scaling position and the number of paths on the chessboard; rounding the ratio / mean / variance / mean squared error between ...
[0111] Step S35: Scale the chessboard according to the scaling factor, and render and display the scaled chessboard using a preset rendering method.
[0112] Here, step S35 corresponds to step S14 mentioned above. In implementation, the specific implementation method of step S14 mentioned above can be referred to.
[0113] In the embodiments of the present invention described above, attribute information of at least one chess piece object in the chessboard is determined based on the chessboard information to be displayed; a target area containing a target object is determined based on the attribute information of each object, the target object including at least one already displayed object and a currently to be displayed object; a target scaling position is determined from at least one preset scaling position based on the target area; a scaling factor for scaling the chessboard is determined based on the target scaling position; the chessboard is scaled according to the scaling factor, and the scaled chessboard is rendered and displayed using a preset rendering method. Thus, on the one hand, determining the target scaling position from at least one preset scaling position using the target area can improve the accuracy of the target scaling position; on the other hand, determining the scaling factor through the target scaling position can improve the accuracy of the scaling factor, thereby improving the accuracy of chessboard scaling.
[0114] In some embodiments, step S33 includes steps S331 to S333, wherein:
[0115] Step S331: Based on the target region, determine the maximum and minimum position information corresponding to the target region.
[0116] Here, the location information of the extreme values can include, but is not limited to, the minimum x-coordinate, the minimum y-coordinate, the maximum x-coordinate, and the maximum y-coordinate. In practice, the minimum x-coordinate and minimum y-coordinate can be obtained from the top left corner of the target area, and the maximum x-coordinate and maximum y-coordinate can be obtained from the bottom right corner of the target area.
[0117] Step S332: Obtain the data structure corresponding to each scaling position.
[0118] Here, each of the data structures includes marker information corresponding to each position on the chessboard, and each marker information indicates whether an object exists at the corresponding position on the chessboard. The data structure can be any structure capable of storing data, such as an array, table, or queue. In implementation, those skilled in the art can determine the implementation method of the data structure according to actual needs, and this embodiment of the invention does not impose any limitations.
[0119] The data structure size can be the same or different for different scaling positions. For example, the data structure for scaling positions such as top left, top right, bottom left, and bottom right can be a 19*19 array. As another example, the data structure for scaling positions such as top left, top right, bottom left, and bottom right can be a 9*9 array.
[0120] The identification information can be implemented in any suitable way that can distinguish the presence or absence of an object. For example, 0 and 1, true and false, etc. In implementation, those skilled in the art can choose the implementation method of the identification information according to actual needs, and the embodiments of the present invention are not limited thereto.
[0121] Step S333: Determine the target scaling position based on the maximum / minimum position information and the data structure corresponding to each scaling position.
[0122] Here, the extreme value location information is compared with each data structure to obtain the target scaling position.
[0123] In the embodiments of the present invention described above, the maximum / minimum position information corresponding to the target region is determined based on the target region; a data structure corresponding to each scaling position is obtained, each data structure including flag information corresponding to each position on the chessboard, each flag information representing whether an object exists at the corresponding position on the chessboard; and the target scaling position is determined based on the maximum / minimum position information and the data structure corresponding to each scaling position. Thus, by comparing the maximum / minimum position information corresponding to the target region with the data structures corresponding to different scaling positions to determine the target scaling position from different scaling positions, the accuracy of the target scaling position can be improved, thereby improving the accuracy of the scaling factor, and consequently improving the accuracy of chessboard scaling.
[0124] In some embodiments, step S333 includes steps S351 to S352, wherein:
[0125] Step S351: For each scaling position, obtain the target flag information that matches the maximum / minimum position information from the flag information corresponding to each position of the data structure.
[0126] Here, the target marker information includes marker information corresponding to each extreme value location. For example, the extreme value location information includes the minimum x-coordinate, the minimum y-coordinate, the maximum x-coordinate, and the maximum y-coordinate. In this case, the target marker information includes the marker information corresponding to the minimum location information (i.e., the minimum x-coordinate and the minimum y-coordinate) and the marker information corresponding to the maximum location information (i.e., the maximum x-coordinate and the maximum y-coordinate).
[0127] Step S352: Determine the target scaling position based on each of the target marker information.
[0128] Here, each target marker is compared with preset marker information. If each target marker matches the preset marker information, the scaling position corresponding to that target marker is taken as the target scaling position. The preset marker information represents the existence of an object.
[0129] In some embodiments, each of the target marker information includes first target marker information and second target marker information; step S352 includes step S361, wherein:
[0130] Step S361: For each target marker information, if both the first target marker information and the second target marker information are preset identifiers, the scaling position corresponding to the target marker information is taken as the target scaling position.
[0131] Here, the first target marker information and the second target marker information respectively represent the marker information at different positions in the extreme value position information. In this way, by comparing each first target marker information and the second target marker information with a preset identifier to determine the final target marker information from different target marker information, the accuracy of the final target marker information can be improved, thereby improving the accuracy of the target scaling position, and further improving the accuracy of the scaling factor.
[0132] For example, if both matrixLT[minY][minX] and matrixLT[maxY][maxX] are true, the top-left corner is used as the scaling position for the target. Here, matrixLT is the array corresponding to the top-left corner. As another example, if both matrixRB[minY][minX] and matrixRB[maxY][maxX] are true, the bottom-right corner is used as the scaling position for the target. Here, matrixRB is the array corresponding to the bottom-right corner.
[0133] In the embodiments of the present invention described above, for each scaling position, target flag information matching the extreme value position information is obtained from the flag information corresponding to each position in the data structure; based on each target flag information, the target scaling position is determined. Thus, by comparing the extreme value position information with the flag information corresponding to each position in each scaling position to determine the target scaling position from different scaling positions, the accuracy of the target scaling position can be improved, thereby improving the accuracy of the scaling factor, and further improving the accuracy of chessboard scaling.
[0134] In some embodiments, step S34 includes steps S341 to S343, wherein:
[0135] Step S341: Obtain the first path information corresponding to the target scaling position.
[0136] Here, the first path information corresponding to different target scaling positions can be the same or different.
[0137] Step S342: Obtain the second line information of the chessboard.
[0138] Here, the second line information refers to the line information of the chessboard itself. For example, the second line information can be 19 lines, 23 lines, etc. In practice, the second line information is not less than the first line information.
[0139] Step S343: Determine the scaling factor based on the first path information and the second path information.
[0140] Here, the methods for determining the scaling factor may include, but are not limited to, the ratio / mean / variance / mean squared error between the first and second channel information, rounding the ratio / mean / variance / mean squared error between the first and second channel information, the ratio / mean / variance / mean squared error after weighting the first and second channel information respectively, and rounding the ratio / mean / variance / mean squared error after weighting the first and second channel information respectively. The rounding method may include, but is not limited to, rounding up or rounding down. In implementation, those skilled in the art can choose the method for determining the scaling factor according to actual needs; this embodiment of the invention does not limit this. For example, the scaling factor can be obtained through the above formula (1-1).
[0141] In some embodiments, step S343 includes steps S371 to S372, wherein:
[0142] Step S371: Determine the ratio between the first channel information and the second channel information.
[0143] Step S372: Based on the ratio, obtain the scaling factor.
[0144] Here, the methods for obtaining the scaling factor may include, but are not limited to, the ratio itself, rounding the ratio, weighting the ratio, or rounding the ratio after weighting. Rounding methods may include, but are not limited to, rounding up or rounding down. In implementation, those skilled in the art can choose the method for determining the scaling factor according to actual needs; this embodiment of the invention does not impose limitations. Thus, determining the scaling factor based on the ratio between different path information can improve the accuracy of the scaling factor, thereby improving the accuracy of chessboard scaling.
[0145] For example, if the second line information of the chessboard is 19 and the first line information corresponding to the target scaling position is 13, then the scaling factor can be 19 / 13, which is approximately 1.4.
[0146] In the embodiments of the present invention described above, the following steps are taken: first path information corresponding to the target scaling position is obtained; second path information of the chessboard is obtained; and the scaling factor is determined based on the first path information and the second path information. In this way, on the one hand, by obtaining the pre-established first path information corresponding to the target scaling position, the accuracy of the first path information can be improved, thereby improving the accuracy of the scaling factor; on the other hand, by determining the scaling factor based on the first path information and the second path information of the chessboard, the accuracy of the scaling factor can be improved, thereby enhancing the accuracy of chessboard scaling.
[0147] Exemplary application scenarios
[0148] The following explanation uses online Go game record study / problem solving as an example. During the process of studying game records / solving problems, sometimes all objects will be located in a certain position on the board (e.g., the upper left corner, the lower right corner, etc.). For board games with more lines (e.g., 19x19 Go, 23x29 Go), since the board size and the placement of objects are basically fixed, the objects on the board are relatively small. Figure 4A A schematic diagram of an existing Go board is shown, such as... Figure 4A As shown, the display page includes at least a chessboard 401, which is a 19-line chessboard, that is, horizontally from line A to line S and vertically from line A to line S. The chessboard 401 includes at least one displayed chess piece 402, and each chess piece 402 is concentrated in the upper right corner of the chessboard.
[0149] The inventors analyzed the chessboard display solutions provided in related technologies and found that if all objects are located in a certain position on the chessboard (e.g., the upper left corner, the lower right corner, etc.), displaying the corresponding chessboard line in its entirety would not only easily distract the user but also affect the user's operation, thereby reducing the user's operating experience.
[0150] In response to the problems existing in the chessboard display solutions provided in the aforementioned related technologies, the inventors focused their work on providing the function of automatically scaling and displaying the chessboard.
[0151] Figure 4B The schematic diagram illustrates a flowchart of a chessboard display method according to an embodiment of the present invention, such as... Figure 4B As shown, the method includes steps S411 to S417, wherein:
[0152] Step S411: Obtain the SGF chess record (corresponding to the aforementioned chessboard information to be displayed) through the component, and use the preset construction method to build the game tree (corresponding to the aforementioned data tree) corresponding to the SGF chess record.
[0153] Here, the SGF game record is parsed using a custom newFromSgf method to generate the game tree.
[0154] Step S412: Obtain the attribute information of each displayed object based on the data object in the game tree;
[0155] Step S413: Obtain the attribute information of each object to be displayed based on the children objects in the game tree;
[0156] Step S414: Determine the target area based on the attribute information of each displayed object and the attribute information of each object to be displayed;
[0157] Here, the letter coordinate information of each displayed object and each object to be displayed is converted into numerical coordinate information. The minimum horizontal coordinate minX, minimum vertical coordinate minY, maximum horizontal coordinate maxX, and maximum vertical coordinate maxY are found from each numerical coordinate information. The area enclosed by the minimum horizontal coordinate minX, minimum vertical coordinate minY, maximum horizontal coordinate maxX, and maximum vertical coordinate maxY is taken as the target area.
[0158] Step S415: Obtain the target scaling position by combining the maximum and minimum position information corresponding to the target area with the data structure corresponding to each preset scaling position;
[0159] Here, the top-left corner (minX, minY) and bottom-right corner (maxX, maxY) of the target area are used as reference points and compared with the four arrays matrixLT (top-left), matrixRT (top-right), matrixRB (bottom-right), and matrixLB (bottom-left) to obtain the target scaling position. Here, matrixLT, matrixRT, matrixRB, and matrixLB are all 19*19 arrays. In some implementations, matrixLT represents the first 13 rows and first 13 columns of the chessboard, all with 1s and the rest with 0s. matrixLB represents the last 13 rows and first 13 columns of the chessboard, all with 1s and the rest with 0s. matrixRT represents the first 13 rows and last 13 columns of the chessboard, all with 1s and the rest with 0s. matrixRB represents the last 13 rows and last 13 columns of the chessboard, all with 1s and the rest with 0s. For example, matrixLT can be represented as the following array:
[0160]
[0161] When both matrixLT[minY][minX] and matrixLT[maxY][maxX] are true, all represented objects fall in the top left corner of the chessboard.
[0162] When both matrixRT[minY][minX] and matrixRT[maxY][maxX] are true, all represented objects fall in the upper right corner of the chessboard;
[0163] When both matrixRB[minY][minX] and matrixRB[maxY][maxX] are true, all the represented objects fall in the lower right corner of the chessboard;
[0164] When both matrixLB[minY][minX] and matrixLB[maxY][maxX] are true, all represented objects fall in the lower left corner of the chessboard;
[0165] In other cases, the original chessboard is used as the target scaling location.
[0166] Step S416: Based on the path information corresponding to the target scaling position (corresponding to the aforementioned first path information) and the path information of the chessboard (corresponding to the aforementioned second path information), obtain the scaling ratio (corresponding to the aforementioned scaling factor);
[0167] Step S417: Scale the chessboard according to the scaling ratio, and render and display the scaled chessboard according to the preset rendering method.
[0168] Here, the rendering method can include, but is not limited to, global rendering and partial rendering. Global rendering refers to re-rendering the entire scaled chessboard and then moving the rendered chessboard to the desired display position. Partial rendering refers to re-rendering only the position to be displayed. For example, if the target scaling position is the upper right corner and the scale factor is 1.4, then you can either enlarge only the upper right corner of the chessboard by 1.4 times for display, or you can enlarge the entire chessboard by 1.4 times and move it to the upper right corner for display.
[0169] Figure 4C The diagram illustrates a scaled-down chessboard according to an embodiment of the present invention, as shown below. Figure 4C As shown, the display page includes at least a chessboard 411, which is a 19-line chessboard, i.e., horizontally from line A to line S and vertically from line A to line S. The chessboard 411 includes at least one displayed piece 412. Since each piece 412 is concentrated in the upper right corner of the chessboard, the chessboard 411 can be enlarged to a 13-line chessboard and moved to the upper right corner for display. That is, the chessboard 411 included in the display page is horizontally from line A to line M and vertically from line G to line S.
[0170] In this way, on the one hand, by parsing the chessboard information, generating and displaying a scaled chessboard including the target area, the convenience of user operation is improved while also focusing the user's attention, thereby improving the efficiency and accuracy of user operation, and thus enhancing the user's operating experience and better meeting the user's needs; on the other hand, by automatically scaling the chessboard display according to the scaling factor, the automation and intelligence of the device can be improved.
[0171] Exemplary chessboard display device
[0172] After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 5 A chessboard display device according to an exemplary embodiment of the present invention will be described.
[0173] Figure 5The diagram schematically illustrates the structural composition of a chessboard display device according to an embodiment of the present invention, such as... Figure 5 As shown, the chessboard display device 500 includes: a first determining module 510, a second determining module 520, a third determining module 530, and a display module 540. Wherein:
[0174] The first determining module 510 is used to determine the attribute information of at least one object in the chessboard based on the chessboard information to be displayed;
[0175] The second determining module 520 is used to determine a target area containing a target object based on the attribute information of each object, wherein the target object includes at least one displayed object and an object to be displayed.
[0176] The third determining module 530 is used to determine the scaling factor for scaling the chessboard based on the target area;
[0177] The display module 540 is used to scale the chessboard according to the scaling factor and render and display the scaled chessboard using a preset rendering method.
[0178] In some embodiments, the first determining module 510 is further configured to: establish a data tree corresponding to the chessboard information to be displayed using a preset construction method; and determine the attribute information of at least one object in the chessboard based on the data tree.
[0179] In some embodiments, the at least one object includes at least one displayed object and at least one object to be displayed; the first determining module 510 is further configured to: obtain attribute information of each of the displayed objects based on a first node of the data tree; and obtain attribute information of each of the objects to be displayed based on a second node of the data tree, wherein the second node is at a different level than the first node in the data tree.
[0180] In some embodiments, the third determining module 530 is further configured to: determine a target scaling position from at least one preset scaling position based on the target region; and determine the scaling factor based on the target scaling position.
[0181] In some embodiments, the third determining module 530 is further configured to: obtain first path information corresponding to the target scaling position; obtain second path information of the chessboard; and determine the scaling factor based on the first path information and the second path information.
[0182] In some embodiments, the third determining module 530 is further configured to: determine the ratio between the first path information and the second path information; and obtain the scaling factor based on the ratio.
[0183] In some embodiments, the third determining module 530 is further configured to: determine the maximum / minimum position information corresponding to the target region based on the target region; obtain a data structure corresponding to each scaling position, wherein each data structure includes flag information corresponding to each position on the chessboard, and each flag information respectively indicates whether an object exists at the position corresponding to the chessboard; and determine the target scaling position based on the maximum / minimum position information and the data structure corresponding to each scaling position.
[0184] In some embodiments, the third determining module 530 is further configured to: for each scaling position, obtain target flag information matching the maximum / minimum position information from the flag information corresponding to each position of the data structure; and determine the target scaling position based on each target flag information.
[0185] In some embodiments, each of the target marker information includes first target marker information and second target marker information, wherein the first target marker information and the second target marker information respectively characterize marker information at different positions in the maximum / minimum position information; the third determining module 530 is further configured to: for each target marker information, if both the first target marker information and the second target marker information of the target marker information are preset identifiers, take the scaling position corresponding to the target marker information as the target scaling position.
[0186] The descriptions of the apparatus embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the apparatus provided by the present invention can be used to perform some or all of the steps in the method described in the above method embodiments. For technical details not disclosed in the apparatus embodiments of the present invention, please refer to the descriptions of the method embodiments of the present invention for understanding.
[0187] Exemplary electronic devices
[0188] After introducing the method of exemplary embodiments of the present invention, the following references are made. Figure 6 An electronic device according to an exemplary embodiment of the present invention will be described.
[0189] Figure 6 The diagram illustrates, schematically, a hardware entity diagram of an electronic device according to an embodiment of the present invention, such as... Figure 6 As shown, the hardware entity of the electronic device 600 includes: a processor 601, a communication interface 602, and a memory 603, wherein:
[0190] The processor 601 typically controls the overall operation of the electronic device 600.
[0191] Communication interface 602 enables electronic devices to communicate with other terminals or servers via a network.
[0192] The memory 603 is configured to store instructions and applications executable by the processor 601, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 601 and various modules in the electronic device 600. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 601, the communication interface 602, and the memory 603 can be performed via bus 604.
[0193] This invention provides an electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the computer program to implement any of the methods described above.
[0194] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the methods described above. The computer-readable storage medium can be transient or non-transient.
[0195] This invention provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied as a computer storage medium; in another optional embodiment, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.
[0196] It should be noted that although several devices or sub-devices of the electronic device and chessboard display device have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more devices described above can be embodied in one device. Conversely, the features and functions of one device described above can be further divided and embodied by multiple devices.
[0197] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0198] It should be understood that each block of a flowchart and / or block diagram, as well as combinations of blocks in a 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, a special-purpose computer, or other programmable data processing device to produce a machine that, when executed by a computer or other programmable data processing device, creates means for implementing the functions / operations specified in the blocks of the flowchart and / or block diagram.
[0199] These computer program instructions may also be stored in a computer-readable medium that enables 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 a product comprising an instruction apparatus that implements the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0200] Computer program instructions may 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 that execute on the computer or other programmable apparatus can provide a process for implementing the functions / operations specified in the boxes of a flowchart and / or block diagram.
[0201] The use of the verbs "including" and "contains" and their inflections in the application documents does not preclude the existence of elements or steps other than those described in the application documents. The article "a" or "one" preceding an element does not preclude the existence of multiple such elements.
[0202] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be interpreted in the broadest sense, thereby encompassing all such modifications and equivalent structures and functions.
Claims
1. A method of displaying a board, characterized by, The method comprises: determining attribute information of at least one object in the chessboard based on the to-be-displayed chessboard information; determining a target region containing a target object based on the attribute information of each object, the target object including at least one displayed object and a current to-be-displayed object; determining a scaling factor for scaling the chessboard based on the target region; scaling the chessboard according to the scaling factor and rendering and displaying the scaled chessboard by using a preset rendering mode, the rendering mode including local rendering or global rendering; determining the scaling factor for scaling the chessboard based on the target region includes: determining a target scaling position from preset at least one scaling position based on the target region; and determining the scaling factor based on the target scaling position; determining the scaling factor based on the target scaling position includes: obtaining first road information corresponding to the target scaling position; obtaining second road information of the chessboard; and determining the scaling factor based on the first road information and the second road information; determining the target scaling position based on the target region includes: determining extreme value position information corresponding to the target region based on the target region; obtaining a data structure corresponding to each scaling position, each data structure including flag information corresponding to each position in the chessboard, each flag information representing whether there is an object at the corresponding position in the chessboard; and determining the target scaling position based on the extreme value position information and the data structure corresponding to each scaling position.
2. The method of claim 1, wherein, determining attribute information of at least one object in the chessboard based on the to-be-displayed chessboard information includes: establishing a data tree corresponding to the to-be-displayed chessboard information by using a preset construction mode; determining attribute information of at least one object in the chessboard based on the data tree.
3. The method of claim 2, wherein, The at least one object includes at least one displayed object and at least one to-be-displayed object; determining attribute information of at least one object in the chessboard based on the data tree includes: obtaining attribute information of each displayed object based on a first node of the data tree; obtaining attribute information of each to-be-displayed object based on a second node of the data tree, the second node being different from the first node in a level in the data tree.
4. The method of claim 1, wherein, determining the scaling factor based on the first road information and the second road information includes: determining a ratio between the first road information and the second road information; obtaining the scaling factor based on the ratio.
5. The method of claim 1, wherein, determining the target scaling position based on the extreme value position information and the data structure corresponding to each scaling position includes: for each data structure corresponding to a scaling position, obtaining target flag information matching the extreme value position information from flag information corresponding to each position in the data structure; determining the target scaling position based on each target flag information.
6. The method of claim 5, wherein, Each of the target mark information includes first target mark information and second target mark information, and the first target mark information and the second target mark information represent mark information at different positions in the extreme position information respectively. The target scaling position is determined based on each of the target mark information, including: For each target mark information, if the first target mark information and the second target mark information of the target mark information are both preset marks, the scaling position corresponding to the target mark information is taken as the target scaling position.
7. A board display device, characterized by comprising: The device includes: A first determining module configured to determine attribute information of at least one object in a chessboard based on chessboard information to be displayed; A second determining module configured to determine a target region containing a target object based on the attribute information of each object, the target object including at least one displayed object and a current object to be displayed; A third determining module configured to determine a scaling factor for scaling the chessboard based on the target region; A display module configured to scale the chessboard according to the scaling factor and render and display the scaled chessboard using a preset rendering method, the rendering method including local rendering or global rendering; The third determining module is further configured to determine a target scaling position from at least one preset scaling position based on the target region, and determine the scaling factor based on the target scaling position. The third determining module is further configured to obtain first path information corresponding to the target scaling position, obtain second path information of the chessboard, and determine the scaling factor based on the first path information and the second path information. The third determining module is further configured to determine extreme position information corresponding to the target region based on the target region, obtain a data structure corresponding to each scaling position, each data structure including mark information corresponding to each position in the chessboard, each mark information representing whether there is an object at the corresponding position in the chessboard, and determine the target scaling position based on the extreme position information and the data structure corresponding to each scaling position.
8. An electronic device comprising a processor and a memory, the memory storing a computer program executable on the processor, characterized in that, The processor executes the computer program to implement the method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program is executed by a processor to implement the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for automatically clipping and displaying target image
CN103414945A
Chessboard data processing method and device
CN106390452A