Method for adapting to equipment screen to fill grid array and electronic equipment

By determining the grid size and position based on the device screen resolution and grid array arrangement information, the problem of low grid array generation efficiency and high computing resource consumption on the device screen is solved, and efficient and accurate grid array generation and element display are achieved.

CN118761391APending Publication Date: 2024-10-11SOLO FANTASY NETWORK TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410773205.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When the existing technology generates a grid array on a device screen, it is prone to distortion or incomplete display. It is also inefficient, consumes a lot of computing resources, and is cumbersome to maintain and update templates.

Method used

According to the screen resolution of the target device and the arrangement information of the grid array, determine the size of the first-level grid and the second-level grid, determine the position of the second-level grid through the number and position relationship, and efficiently generate the specified elements, avoiding the resolution of the grid array and the screen. Rate mismatch problem.

Benefits of technology

It achieves efficient and accurate generation of grid arrays on different device screens, reduces the consumption of computing resources, avoids the problem of grid arrays that are too large, too small, or distorted, and eliminates the need to maintain and update templates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761391A_ABST
    Figure CN118761391A_ABST
Patent Text Reader

Abstract

The invention discloses a method for filling a grid array in an equipment screen. The method comprises multi-row and multi-column first-level grids and multi-row and multi-column second-level grids in the first-level grids. The method comprises the following steps: generating a grid array adapted to a screen resolution according to arrangement information of the grid array and the screen resolution of equipment; numbering all second-level grids in the grid array according to a preset sequence, determining the position of a specific second-level grid in the grid array based on the number, and then sequentially determining the position of a first-level grid where the specific second-level grid is located in the grid array and the position of the specific second-level grid in the first-level grid where the specific second-level grid is located; and generating a specified element in the second-level grid according to the position of the specific second-level grid in the first-level grid where the second-level grid is located. The method provided by the invention can adapt to the screen resolution to generate the lattice array, and elements are efficiently and accurately generated in the specified secondary lattice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a method, device, electronic device, and computer-readable storage medium for adapting a device screen to fill a grid array. Background Art

[0002] Generally, grid arrays have a wide range of application scenarios. For example, in board games such as Sudoku, Go, and chess, it is necessary to generate a board on the device screen; in image editing software, it is necessary to divide the image into several tiles on the terminal screen. In the prior art, the same preset grid array available area is usually used. When the grid array is generated on a non-adapted device screen, a series of problems such as distortion or incomplete display of the grid array are prone to occur; at the same time, specific content is generated in the specified grid of the grid array. The prior art usually adopts a traversal method, such as looping through the grid array to generate specific content one by one; or a template matching method, such as using a predefined template to match and generate specific content in the grid array, etc. However, the above methods have problems such as low efficiency, high consumption of computing resources, and cumbersome template maintenance and updating. Summary of the invention

[0003] In view of this, embodiments of the present application provide a method, an apparatus, an electronic device, and a computer-readable storage medium for adapting a device screen to fill a grid array, for solving at least one technical problem.

[0004] The embodiment of the present application provides a method for filling a grid array on an adaptive device screen, wherein the grid array includes a first-level grid with multiple rows and columns, and each of the first-level grids includes a second-level grid with multiple rows and columns; the method includes:

[0005] Determine the size of the primary grid and the secondary grid according to the arrangement information of the target grid array and the screen resolution of the target device, and generate the target grid array in the target device according to the size of the primary grid and the secondary grid, wherein the secondary grid is used to fill the specified element;

[0006] Numbering all secondary grids in the target grid array in a predetermined order, and determining the position of the i-th secondary grid in the target grid array based on the numbering;

[0007] According to the positional relationship between the secondary grid and the primary grid and the position of the ith secondary grid in the target grid array, the position of the jth primary grid where the ith secondary grid is located in the target grid array is determined;

[0008] According to the position of the j-th primary grid in the target grid array and the position of the i-th secondary grid in the target grid array, determine the position of the i-th secondary grid in the j-th primary grid;

[0009] When it is necessary to fill an element into the i-th secondary grid, the generated designated element is displayed in the i-th secondary grid according to the position of the i-th secondary grid in the j-th primary grid.

[0010] Optionally, according to an embodiment of the present application, the arrangement information of the target grid array includes the total number of rows and columns of the secondary grids in the target grid array; the numbering of all the secondary grids in the target grid array according to a predetermined order includes: consecutively numbering all the secondary grids in the target grid array in order from left to right in columns and from bottom to top in rows, and the numbering uses numbers; and the determination of the position of the i-th secondary grid in the target grid array based on the numbering includes: determining the row number and column number of the i-th secondary grid in the target grid array according to the division result of the number of the i-th secondary grid and the total number of rows and the division result of the number of the i-th secondary grid and the total number of columns.

[0011] Optionally, according to an embodiment of the present application, the arrangement information of the target grid array includes the total number of rows and columns of the first-level grids in the target grid array; the positional relationship between the second-level grid and the first-level grid includes: the first-level grid is consistent with the second-level grid, and the row and column arrangement order is defined from left to right by column and from bottom to top by row; and, according to the position of the ith second-level grid in the target grid array, the position of the j-th first-level grid where the ith second-level grid is located is determined, including: determining the row number and column number of the j-th first-level grid in the target grid array according to the division result of the row number of the ith second-level grid and the total number of rows of the first-level grid and the division result of the column number of the ith second-level grid and the total number of columns of the first-level grid.

[0012] Optionally, according to an embodiment of the present application, determining the position of the i-th secondary grid in the j-th first-level grid according to the position of the j-th first-level grid in the target grid array and the position of the i-th secondary grid in the target grid array includes: determining the row number and column number of the i-th secondary grid in the j-th first-level grid according to the subtraction result of the row number of the i-th secondary grid and the row number of the j-th first-level grid, and the subtraction result of the i-th secondary grid and the column number of the j-th first-level grid.

[0013] Optionally, according to an embodiment of the present application, the target grid array includes a primary grid with 3 rows and 3 columns, the primary grid includes a secondary grid with 3 rows and 3 columns, and the target grid array includes a secondary grid with 9 rows and 9 columns.

[0014] Optionally, according to an embodiment of the present application, the position {c, r} of the i-th secondary grid in the target grid array is determined according to the following formula: {c, r} = {i%9, Ceiling(i / 9)}; wherein c is the column number of the secondary grid in the target grid array, r is the row number of the secondary grid in the target grid array, the operation % is the remainder, the operation / is the quotient, and Ceiling is rounding up; wherein, when i%9=0, let c=9.

[0015] Optionally, according to an embodiment of the present application, the position {x, y} of the j-th first-level grid in the target grid array is determined according to the following calculation formula: {x, y} = {Ceiling(c / 3), Ceiling(r / 3)}; wherein x is the column number of the j-th first-level grid in the target grid array, and y is the row number of the j-th first-level grid in the target grid array.

[0016] Optionally, according to an embodiment of the present application, the position of the i-th secondary grid in the j-th primary grid is determined according to the following calculation formula {g x ,g y}: {g x ,g y}={c-(x-1)*3,r-(y-1)*3}; where g x is the column number of the i-th secondary grid in the j-th primary grid, g y is the row number of the i-th secondary grid in the j-th primary grid.

[0017] Optionally, according to an embodiment of the present application, the arrangement information of the target grid array includes the total number of rows and columns of the first-level grids in the target grid array; the positional relationship between the second-level grid and the first-level grid includes: the first-level grid is consistent with the second-level grid, and the row and column arrangement order is defined from left to right by column and from bottom to top by row; and further includes: according to the position of the i-th second-level grid in the target grid array, the number Id of the j-th first-level grid where the i-th second-level grid is located is determined according to the following calculation formula: Id = (c / 3-1)*(3-1)+r%3

[0018] The embodiment of the present application provides an apparatus for filling a grid array on a device screen, comprising: a target grid array generation module, configured to determine the size of a primary grid and a secondary grid according to the arrangement information of the target grid array and the screen resolution of the target device, and to generate a target grid array in the target device according to the size of the primary grid and the secondary grid, wherein the secondary grid is used to fill a specified element; a position determination module, configured to number all the secondary grids in the target grid array according to a predetermined order, and to determine the position of the i-th secondary grid in the target grid array based on the number; and The position of the j-th first-level grid where the ith secondary grid is located is determined in the target grid array according to the position relationship with the first-level grid and the position of the ith secondary grid in the target grid array; the position of the ith secondary grid in the j-th first-level grid is determined according to the position of the j-th first-level grid in the target grid array and the position of the ith secondary grid in the target grid array; the element generation module is configured to display the generated specified element in the ith secondary grid according to the position of the ith secondary grid in the j-th first-level grid when it is necessary to fill the element in the ith secondary grid.

[0019] An embodiment of the present application provides an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the steps of the method described above are implemented.

[0020] An embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the method described above are implemented.

[0021] By adopting the embodiments of the present application, it is possible to adapt to the screen resolution of the target device to generate a grid array of specific arrangement information, and it is possible to effectively prevent the generated grid array from being too large, too small, distorted, etc. due to the incompatibility between the generated grid array and the screen resolution. At the same time, by defining the number of the secondary grids and the positional relationship between the primary grid and the secondary grids, the position of the target grid array where the specific secondary grid is located, the position of the primary grid in the target grid array, and the position of the primary grid in the primary grid are determined. In this way, when it is necessary to generate a specified element in a specific secondary grid, the specified element can be generated efficiently and accurately under the premise of consuming less computing resources and without the need for maintenance and updates. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following briefly introduces the drawings in the embodiments of the present application.

[0023] Figure 1 It is a schematic diagram of the system architecture of an embodiment of the present application.

[0024] Figure 2 It is a flowchart of a method for filling a grid array on a device screen according to an embodiment of the present application.

[0025] Figure 3 It is a schematic diagram of a Sudoku game board operation interface in an embodiment of the present application.

[0026] Figure 4A , 4B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiments of the present application.

[0027] Figure 5A , 5B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiments of the present application.

[0028] Fig. 6A , 6B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiments of the present application.

[0029] Figure 7 It is a structural block diagram of a grid array device for adapting to a device screen filling according to an embodiment of the present application.

[0030] Figure 8 It is a schematic diagram of an electronic device for implementing a method of filling a grid array on a device screen adapted to an embodiment of the present application. DETAILED DESCRIPTION

[0031] The principles and spirit of the present application will be described below with reference to several exemplary embodiments. It should be understood that the purpose of providing these embodiments is to make the principles and spirit of the present application clearer and more thorough, so that those skilled in the art can better understand and implement the principles and spirit of the present application. The exemplary embodiments provided herein are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments herein, all other embodiments obtained by ordinary technicians of the art without creative work are within the scope of protection of this application.

[0032] Embodiments of the present application relate to terminal devices and / or servers. Those skilled in the art will appreciate that the embodiments of the present application may be implemented as a system, apparatus, device, method, computer-readable storage medium, or computer program product. Therefore, the present disclosure may be specifically implemented in at least one of the following forms: complete hardware, complete software, or a combination of hardware and software. According to the embodiments of the present application, the present application claims protection for a method, apparatus, electronic device, computer-readable storage medium, and computer program product for adapting a device screen to fill a grid array. Figure 1A schematic diagram of a system architecture of an embodiment of the present application is shown. Figure 1 As shown, the system includes a terminal device 102 and a server 104. Among them, the terminal device 102 may include at least one of the following: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, various wearable devices, an augmented reality AR device, a virtual reality VR device, etc. A client can be installed on the terminal device 102. For example, the client can be a client that specifically performs a specific function (such as an application app), or a client with multiple application applets (different functions) embedded in it, or a client logged in through a browser. The user can operate on the terminal device 102. For example, the user can open the client installed on the terminal device 102 and input instructions through the client operation, or the user can open the browser installed on the terminal device 102 and input instructions through the browser operation. After the terminal device 102 receives the instruction input by the user, the request information containing the instruction is sent to the server 104. After receiving the request information, the server 104 performs corresponding processing and then returns the processing result information to the terminal device 102. The user instruction is completed through a series of data processing and information interaction.

[0033] In this document, terms such as first, second, third, etc. are only used to distinguish one entity (or operation) from another entity (or operation), but not to require or imply any order or relationship between these entities (or operations).

[0034] The grid array involved in the present application includes multiple rows and columns of primary grids, each of which includes multiple rows and columns of secondary grids, and adjacent primary grids may include a primary interval, and adjacent secondary grids may include a secondary interval. In some embodiments, the grid array can be applied to board games, such as Sudoku games, and the primary grid and the secondary grid can represent "palace" and "grid" respectively; for example, in elimination games, the primary grid is a designated area in the elimination game board, and the secondary grid is a grid position in the elimination game board. In some embodiments, the grid array can be applied to image editing software, such as electronic photo albums, and the primary grid and the secondary grid can represent "photo frame" and "photo" respectively. At this time, the primary interval and the secondary interval represent the distance between adjacent photo frames and the distance between adjacent photos respectively. For convenience, unless otherwise specified, the grid array containing 9×9 secondary grids is taken as an example in the embodiment of the present application. Those skilled in the art can understand that grid arrays of other specifications also fall within the scope of protection of the present application.

[0035] Figure 2 A schematic flow chart of a method for filling a grid array on a device screen according to an embodiment of the present application is shown, and the method comprises the following steps:

[0036] S10: determining the sizes of the primary grid and the secondary grid according to the arrangement information of the target grid array and the screen resolution of the target device, and generating the target grid array in the target device according to the sizes of the primary grid and the secondary grid, wherein the secondary grid is used to fill the specified element;

[0037] S20: numbering all the secondary grids in the target grid array in a predetermined order, and determining the position of the i-th secondary grid in the target grid array based on the numbering;

[0038] S30: determining the position of the jth primary grid where the ith secondary grid is located in the target grid array according to the positional relationship between the secondary grid and the primary grid and the position of the ith secondary grid in the target grid array;

[0039] S40: determining the position of the i-th secondary grid in the j-th primary grid according to the position of the j-th primary grid in the target grid array and the position of the i-th secondary grid in the target grid array;

[0040] S50: When it is necessary to fill an element into the i-th secondary grid, the generated designated element is displayed in the i-th secondary grid according to the position of the i-th secondary grid in the j-th primary grid.

[0041] According to the processing method of the embodiment of the present application, in step S10, the size of the primary grid and the secondary grid is calculated by acquiring or inputting the arrangement information of the target grid array and the screen resolution of the target device, and then performing mathematical operations. For example, the commonly used unit pixel (Pixel, px) of the screen resolution includes the number of horizontal pixels and the number of vertical pixels, and the screen resolution is converted into the size of the primary grid and the secondary grid according to the arrangement information of the target grid array.

[0042] The arrangement information may include a grid array structure, which may specifically be the total number of rows and columns of a primary grid and / or a secondary grid. In one embodiment, the total number of rows of the secondary grid is 9 and the total number of columns is 9. At this time, the total number of rows of the primary grid is 3 and the total number of columns is 3. There are 3×3 secondary grids in each primary grid. Assuming that the screen resolution of the current device is (m, n), the resolution of each primary grid is (k, l), and the resolution of each secondary grid is (a, b). At this time, k=m / 3, l=n / 3, a=m / 9, b=n / 9, and accordingly, a target grid array is generated in the target device. According to the grid array generated according to the embodiment of the present application, since the screen resolution and the arrangement information of the grid array are combined, the resolution of the grid array can be adaptively adjusted according to the conditions of different devices, and the grid array can be effectively prevented from being too large, exceeding the edge of the screen, too small or distorted, etc., which affects the experience.

[0043] In some embodiments, the arrangement information also includes the spacing between the first-level grids or the second-level grids. Still taking the 9×9 grid array as an example, assuming that the spacing between the first-level grids is o and the spacing between the second-level grids is p, then k=(m-(3-1)*o) / 3, l=(n-(3-1)*o) / 3, x=(k-(3-1)*p) / 3, y=(l-(3-1)*p) / 3, and accordingly, a target grid array is generated in the target device. The first-level grids and the second-level grids in the grid array generated in this way have certain boundaries, which improves the user experience.

[0044] In some embodiments, the arrangement information also includes the margin between the first-level grid and the screen. Still taking the 9×9 grid array as an example, assuming that the margin between the first-level grid and the screen is u, then k=(mu*2) / 3, l=(nu*2) / 3, x=k / 3, y=l / 3, and accordingly, a target grid array is generated in the target device. The grid array generated in this way can avoid burrs on the edges of the grid array and improve the user experience.

[0045] In step S20, the predetermined order may be a sequence numbering from left to right or from right to left, and from top to bottom or from bottom to top, for example, from left to right, the leftmost column is the first column, and from top to bottom, the topmost row is the first row. The numbering may be performed using numbers, such as Arabic numerals, binary numbers, or letters or other characters with size or sequence rules. When numbering using Arabic numerals, the secondary grid may be directly numbered according to the number of rows and columns in the target grid array, for example, the grid of the first row and first column may be numbered as {1,1}; or it may be numbered as 1 first and then converted to the corresponding row and column number through a unified conversion rule. The numbering does not necessarily start from 1, but may also start from 0 or other numbers, and those skilled in the art may set it according to actual conditions. When using binary numbers for numbering, the row and column numbers can be directly expressed in binary form. For example, the 2nd row and the 2nd column can be expressed as {10,10}, or 1010, where the first two digits represent the row and the last two digits represent the column. Alternatively, the 2nd row and the 2nd column can be numbered as the binary number 1010, then converted to the decimal number 10, and then converted to the corresponding row and column numbers.

[0046] In some embodiments, the unified conversion rule includes a division operation between the number i and the total number of rows of the secondary grid, and a division operation between the number i and the total number of columns of the secondary grid. For example, in a 9×9 grid array, the secondary grids in the same row have the same quotient compared to 9 in numbering, so the number of rows can be obtained by dividing the quotient in the division operation, and the secondary grids in the same column have the same remainder compared to 9 in numbering, so the number of columns can be obtained by taking the remainder in the division operation.

[0047] In step S30, since each of the first-level grids includes multiple rows and columns of second-level grids, although the second-level grids in the same first-level grid are numbered differently, the positions of the corresponding first-level grids remain unchanged, and in the positional relationship between the second-level grid and the first-level grid, the order of the first-level grid row and column numbers can be consistent with the second-level grid. For example, when the second-level grid is the leftmost and the topmost are the 1st column and the 1st row respectively, the first-level grid also follows this order. The positional relationship between the second-level grid and the first-level grid is determined, and the position of the i-th second-level grid in the target grid array, such as the row and column number, is determined according to the position of the i-th second-level grid in the target grid array determined in step S20, such as the row and column number, to determine the position of the j-th first-level grid in the target grid array, such as the row and column number. For example, if the secondary grid is numbered {5,5} or the binary number {101,101}, it means that its position is the 5th row and the 5th column. Based on its positional relationship with the primary grid, it can be determined that the primary grid is in the 2nd row and the 2nd column in the target grid array. To obtain this position, a unified conversion rule is set to obtain the primary grid position {2,2}; if the secondary grid is numbered 41, it is first converted to the row and column numbers, i.e. {5,5}, and then the primary grid position is obtained.

[0048] In some embodiments, the unified conversion rule includes a division operation between the number of rows of the ith secondary grid and the total number of rows of the first-level grid, and a division operation between the number of columns of the ith secondary grid and the total number of columns of the first-level grid. For example, in a 9×9 grid array, the specification of the first-level grid can be 3×3. At this time, the number of rows of the second-level grids in the same first-level grid has the same quotient compared to 3, so the number of rows of the first-level grid can be obtained by the division quotient in the division operation, and the number of columns of the second-level grid in the same first-level grid has the same remainder compared to 3, so the number of columns of the first-level grid can be obtained by taking the remainder in the division operation.

[0049] In some embodiments, the number of the jth primary grid where the i-th secondary grid is located can also be determined according to the position of the i-th secondary grid in the target grid array. For example, in a 9×9 grid array, the specification of the primary grid can be 3×3. At this time, the number Id of the jth primary grid where the i-th secondary grid is located can be determined according to the following calculation formula: Id = (c / 3-1)*(3-1)+r%3. By determining the number of the j-th primary grid, it is possible to generate a specified element in the i-th secondary grid more accurately.

[0050] In step S40, after determining the positions of the j-th primary grid and the ith secondary grid in the target grid array, the position of the ith secondary grid in the j-th primary grid is further determined. For example, the secondary grid of {5,5} is in the first-level grid of {2,2}, which is located in the 2nd row and 2nd column, i.e., {2,2}. This position can be obtained by setting a unified conversion rule.

[0051] In some embodiments, the unified conversion rule includes mathematical operations on the i-th secondary grid row number and the j-th primary grid row number, and mathematical operations on the i-th secondary grid column number and the j-th primary grid column number.

[0052] In step S50, the element may be a chess piece or a graphic applied to the rules in a board game; may be a picture or a tile in an image editing software; and may be a grid-based content in other scenes. According to the instruction to fill the element into the i-th secondary grid, the generated designated element is displayed in the i-th secondary grid according to the position of the i-th secondary grid in the j-th primary grid. In some embodiments, the designated element may be generated in multiple secondary grids at the same time, for example, multiple tiles of a picture may be included, and the position of each tile in the corresponding primary grid is determined by the above method.

[0053] Figure 3 Schematic diagram of a Sudoku game board operation interface in an embodiment of the present application, such as Figure 3 As shown, according to the method provided in the embodiment of the present application, the generated Sudoku game board can generate specified numbers efficiently and accurately under the premise of consuming less computing resources and without the need for maintenance and updates when it is necessary to generate specified numbers in specific secondary grids.

[0054] The above describes the implementation methods and advantages of the embodiments of the present application through multiple embodiments. The following describes the specific processing process of the embodiments of the present application in detail with reference to specific examples.

[0055] Example 1

[0056] Figure 4A , 4B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiment of the present application, such as Figure 4A , 4B As shown, in the Sudoku board game, the user inputs the arrangement information of the Sudoku board. Assuming that the user wants to obtain a nine-square Sudoku board, that is, a 9×9 grid array, and the number of grids in each square is the same, the user inputs the total number of rows of the second-level grids as 9, the total number of columns of the second-level grids as 9, and the total number of rows of the first-level grids as 3, and the total number of columns of the first-level grids as 3.

[0057] According to the order of all the secondary grids from left to right in columns and from bottom to top in rows, each secondary grid is numbered consecutively, and the numbers are numbered using Arabic numerals. For example, there are 81 secondary grids in the nine-square grid. At this time, the numbers in the bottom row from left to right are 1-9, and the numbers in the row above it are 10-18 from left to right, and so on. The numbers in the top row are 73-81 from left to right.

[0058] Determine the row number r and column number c of the i-th secondary grid in the target grid array according to the numbering. At this time, the position of the secondary grid in the target grid array is {c, r}:

[0059] {c,r}={i%9,Ceiling(i / 9)}

[0060] Among them, the operation % is to take the remainder, the operation / is to take the quotient, and Ceiling is to round up. When i%9=0, let c=9. For example, the position of the 10th secondary grid is in the 2nd row and 1st column, the remainder of 10%9 is 1, and 10 / 9 is rounded up to 2, which is consistent with it, that is, the position of the secondary grid numbered 10 is {1,2}; for example, the position of the 27th secondary grid is in the 3rd row and 9th column, the remainder of 27%9 is 0, and c=9 at this time, and 27 / 9 is rounded up to 3, which is consistent with it, that is, the position of the secondary grid numbered 27 is {9,3}.

[0061] The position relationship between the first-level grid and the second-level grid follows the same order, that is, the first-level grid is at the leftmost column and the bottommost row. According to the position {c, r} of the i-th second-level grid, the position {x, y} of the j-th first-level grid is determined:

[0062] {x,y}={Ceiling(c / 3),Ceiling(r / 3)}

[0063] Where x is the column number of the j-th first-level grid in the target grid array, and y is the row number of the j-th first-level grid in the target grid array. For example, the position of the 10th second-level grid is {1,2}. In the first-level grid of the 1st row and 1st column, 1 / 3 is integer 1 and 2 / 3 is integer 1, which is consistent with it, that is, the position of the first-level grid where the second-level grid numbered 10 is located is {1,1}; for example, the position of the 27th second-level grid is {9,3}. In the first-level grid of the 1st row and 3rd column, 9 / 3 is integer 3 and 3 / 3 is integer 1, which is consistent with it, that is, the position of the first-level grid where the second-level grid numbered 27 is located is {3,1}.

[0064] After determining the position of the first-level grid, the specific position of the i-th second-level grid in the first-level grid is further determined based on it {g x ,g y}:

[0065] {g x ,g y}={c-(x-1)*3,r-(y-1)*3}

[0066] Among them, g x is the column number of the i-th secondary grid in the j-th primary grid, g yis the row number of the ith secondary grid in the jth primary grid. For example, the 10th secondary grid {1,2} is in the primary grid at position {1,1}, and its specific position is the 2nd row and 1st column in the primary grid, 1-(1-1)*3=1, 2-(1-1)*3=2, which is consistent with it, that is, the specific position of the secondary grid numbered 10 in the primary grid is {1,2}; for example, the 27th secondary grid {9,3} is in the primary grid at position {3,1}, and its specific position is the 3rd row and 3rd column in the primary grid, 9-(3-1)*3=3, 3-(1-1)*3=3, which is consistent with it, that is, the specific position of the secondary grid numbered 27 in the primary grid is {3,3}.

[0067] Example 2

[0068] Figure 5A , 5B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiment of the present application, such as Figure 5A , 5B As shown, in the Sudoku board game, the user inputs the arrangement information of the Sudoku board. Assuming that the user wants to obtain a nine-square Sudoku board, that is, a 9×9 grid array, and the number of grids in each square is the same, the user inputs the total number of rows of the second-level grids as 9, the total number of columns of the second-level grids as 9, and the total number of rows of the first-level grids as 3, and the total number of columns of the first-level grids as 3.

[0069] Each secondary grid is numbered consecutively in the order of columns from left to right and rows from top to bottom. The numbers are binary numbers, from 0 to 80 (a total of 81 secondary grids), that is: the 0th grid is in the upper left corner, and the 80th grid is in the lower right corner. Each number can be represented by 7 bits of binary, from 0000000 (0) to 1010000 (80).

[0070] According to the binary number of the i-th secondary grid, it is converted into a decimal number. For example, the binary number 0001010 in the second row and second column is converted into a decimal number 10. Then, through mathematical operations, the row number r and column number c of the i-th secondary grid in the target grid array are obtained. At this time, the position of the secondary grid in the target grid array is {c, r}:

[0071] {c,r}={decimal number%9,decimal number / 9)}

[0072] The operation % is to obtain the remainder, and the operation / is to obtain the quotient. For example, the position of the 11th secondary grid is in the 2nd row and the 2nd column, and its binary number is 0001010, and its decimal number is 10. At this time, c=10%9=1, r=10 / 9=1, so the position of the secondary grid in the Sudoku board is the 2nd row and the 2nd column (c and r start from 0).

[0073] The position relationship between the first-level grid and the second-level grid follows the same order, that is, the first-level grid is at the leftmost column and the topmost row. According to the position {c, r} of the i-th second-level grid, the position {x, y} of the j-th first-level grid is determined:

[0074] {x,y}={c / 3,r / 3}

[0075] Among them, x is the column number of the j-th first-level grid in the target grid array, and y is the row number of the j-th first-level grid in the target grid array. For example, the position of the 11th second-level grid is {2,2}, x=2 / 3=0, y=2 / 3=0, and the position of the j-th first-level grid where the second-level grid is located in the Sudoku chessboard is the 1st row and the 1st column (x and y start from 0).

[0076] After determining the position of the first-level grid, the specific position of the i-th second-level grid in the first-level grid is further determined based on it {g x ,g y}:

[0077] {g x ,g y}={cx*3,ry*3}

[0078] Among them, g x is the column number of the i-th secondary grid in the j-th primary grid, g y is the row number of the i-th secondary grid in the j-th primary grid. For example, according to the c, r, x, y of the 11th secondary grid obtained above, we can calculate: g x =1-0*3=1,g y =1-0*3=1, that is, the specific position of the 11th secondary grid in the primary grid is the 2nd row and the 2nd column (g x , g y Starts at 0).

[0079] Example 3

[0080] Fig. 6A , 6B They are schematic diagrams of the arrangement of the secondary grid and the primary grid in one of the grid arrays of the embodiment of the present application, such as Fig. 6A , 6B As shown, in an electronic photo album, the user inputs the arrangement information of the target grid array, for example, it can be any number of grid rows and columns. Assuming that the user inputs that the total number of secondary grids is 6 rows and 9 columns and the total number of primary grids is 2 rows and 3 columns, the target grid array generated at this time is 6 palaces and 54 grids, and each palace contains 3 rows and 3 columns of grids.

[0081] Each secondary grid is numbered consecutively in the order of columns from left to right and rows from top to bottom. The numbers are numbers. For example, there are 54 secondary grids in the electronic photo album. At this time, the numbers in the top row are 1-9 from left to right, and the numbers in the row below it are 10-18 from left to right, and so on. The numbers in the bottom row are 46-54 from left to right.

[0082] Determine the row number r and column number c of the i-th secondary grid in the target grid array according to the numbering. At this time, the position of the secondary grid in the target grid array is {c, r}:

[0083] {c,r}={(i-1)%9+1,(i-1) / 9+1}

[0084] Among them, the operation % is to take the remainder, and the operation / is to take the quotient. For example, the position of the 17th secondary grid is in the 2nd row and the 8th column, c = (17-1) % 9 + 1 = 8, r = (17-1) / 9 + 1 = 2, which is consistent with it, that is, the position of the secondary grid numbered 17 is {8, 2}; for example, the position of the 38th secondary grid is in the 5th row and the 2nd column, c = (38-1) % 9 + 1 = 2, r = (38-1) / 9 + 1 = 5, which is consistent with it, that is, the position of the secondary grid numbered 38 is {2, 5}.

[0085] Each first-level grid is numbered consecutively in the order of columns from left to right and rows from top to bottom. The numbers are numbers. For example, there are 6 first-level grids in the electronic photo album. At this time, the numbers in the top row are 1-3 from left to right, and the numbers in the row below it are 4-6 from left to right.

[0086] Determine the number j of the first-level grid according to the number of the second-level grid:

[0087] j=Ceiling(i%9 / 3)+3(Ceiling(r / 3)-1)

[0088] Among them, the operation % is to take the remainder, the operation / is to take the quotient, and Ceiling is to round up to an integer. When i%9=0, the value is 9. For example, the first-level grid where the 17th second-level grid is located is numbered 3, j=Ceiling(17%9 / 3)+3(Ceiling(2 / 3)-1)=3, which is consistent with it. For example, the first-level grid where the 38th second-level grid is located is numbered 4, j=Ceiling(38%9 / 3)+3(Ceiling(5 / 3)-1)=4, which is consistent with it.

[0089] According to the position of the i-th secondary grid, determine the first-level grid number j where it is located, and further determine the position {x, y} of the first-level grid in the target grid array:

[0090] {x,y}={((j-1)%3)+1,((j-1) / 3)+1}

[0091] Where x is the column number of the j-th first-level grid in the target grid array, and y is the row number of the j-th first-level grid in the target grid array. For example, the first-level grid where the 17th second-level grid is located is numbered 3, that is, in the first-level grid of the 1st row and 3rd column, x=((3-1)%3)+1=3, y=((3-1) / 3)+1=1, which is consistent with it, that is, the position of the first-level grid where the second-level grid numbered 17 is located is {3,1}; for example, the first-level grid where the 38th second-level grid is located is numbered 4, that is, in the first-level grid of the 2nd row and 1st column, x=((4-1)%3)+1=1, y=((4-1) / 3)+1=2, which is consistent with it, that is, the position of the first-level grid where the second-level grid numbered 38 is located is {1,2}.

[0092] After determining the position of the first-level grid, the specific position of the i-th second-level grid in the first-level grid is further determined based on it {g x ,g y}:

[0093] {g x ,g y}={c-(x-1)*3,r-(y-1)*3}

[0094] Among them, g x is the column number of the i-th secondary grid in the j-th primary grid, g y is the row number of the i-th secondary grid in the j-th primary grid. For example, the 17th secondary grid {8,2} is in the primary grid at position {3,1}, and the specific position is the 2nd row and 2nd column in the primary grid. x =8-(3-1)*3=2,g y =2-(1-1)*3=2, which is consistent with it. That is, the specific position of the secondary grid numbered 17 in the primary grid is {2,2}; for example, the 38th secondary grid {2,5} is in the primary grid at position {1,2}, and its specific position is the 2nd row and 2nd column in the primary grid. g x =2-(1-1)*3=2,g y =5-(2-1)*3=2, which is consistent with it, that is, the specific position of the secondary grid numbered 38 in the primary grid is {2,2}.

[0095] Corresponding to the method embodiment of the present application, the present application also provides a device for adapting the device screen to fill the grid array, such as Figure 7 As shown, a device 100 for adapting a device screen to fill a grid array includes:

[0096] The target grid array generation module 110 is configured to determine the sizes of the primary grid and the secondary grid according to the arrangement information of the target grid array and the screen resolution of the target device, and generate the target grid array in the target device according to the sizes of the primary grid and the secondary grid, wherein the secondary grid is used to fill the specified element;

[0097] The position determination module 120 is configured to number all the secondary grids in the target grid array according to a predetermined order, and determine the position of the i-th secondary grid in the target grid array based on the numbering; determine the position of the j-th primary grid in the target grid array where the i-th secondary grid is located according to the position relationship between the secondary grid and the primary grid and the position of the i-th secondary grid in the target grid array; determine the position of the i-th secondary grid in the j-th primary grid according to the position of the j-th primary grid in the target grid array and the position of the i-th secondary grid in the target grid array;

[0098] The element generation module 130 is configured to display the generated specified element in the i-th secondary grid according to the position of the i-th secondary grid in the j-th primary grid when an element needs to be filled into the i-th secondary grid.

[0099] The electronic device in the embodiment of the present application may be a user terminal device, a server, other computing devices, or a cloud server. Figure 8 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application is shown. The electronic device may include a processor 601 and a memory 602 storing computer program instructions. When the processor 601 executes the computer program instructions, the process or function of any of the above-mentioned embodiments of the method is implemented.

[0100] Specifically, the processor 601 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application. The memory 602 may include a large-capacity memory for data or instructions. For example, the memory 602 may be at least one of the following: a hard disk drive (HDD), a read-only memory (ROM), a random access memory (RAM), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, a universal serial bus (USB) drive or other physical / tangible memory storage device. For another example, the memory 602 may include a removable or non-removable (or fixed) medium. For another example, the memory 602 may be inside or outside the integrated gateway disaster recovery device. The memory 602 may be a non-volatile solid-state memory. In other words, the memory 602 usually includes a tangible (non-transitory) computer-readable storage medium (such as a memory device) encoded with computer-executable instructions, and when the software is executed (such as executed by one or more processors), the operation described in the method of the embodiment of the present application can be performed. The processor 601 implements the process or function of any method in the above embodiments by reading and executing the computer program instructions stored in the memory 602.

[0101] In one example, Figure 8 The electronic device shown may also include a communication interface 603 and a bus 610. Among them, the processor 601, the memory 602, and the communication interface 603 are connected through the bus 610 and complete the communication between each other. The communication interface 603 is mainly used to realize the communication between each module, device, unit and / or device in the embodiment of the present application. The bus 610 includes hardware, software or both, and can couple the components of the online data traffic billing device to each other. For example, the bus may include at least one of the following: an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-end bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a micro channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable buses. The bus 610 may include one or more buses. Although the embodiments of the present application describe or illustrate a specific bus, the embodiments of the present application may consider any suitable bus or interconnection method.

[0102] In combination with the method in the above embodiments, an embodiment of the present application also provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any method in the above embodiments is implemented.

[0103] In addition, an embodiment of the present application further provides a computer program product, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the process or function of any one of the methods in the above embodiments is implemented.

[0104] The above exemplarily describes the flowcharts and / or block diagrams of the methods, devices, systems and computer program products of the embodiments of the present application, and describes the relevant various aspects. It should be understood that each box or combination thereof in the flowchart and / or block diagram can be implemented by computer program instructions, or by dedicated hardware that performs a specified function or action, or by a combination of dedicated hardware and computer instructions. For example, 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 form a machine that enables these instructions executed by such a processor to enable the implementation of the functions / actions specified in each box or combination thereof in the flowchart and / or block diagram. Such a processor can be a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.

[0105] The functional blocks shown in the structured block diagram of the embodiment of the present application can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc.; when implemented in software, it is a program or code segment used to perform the required task. The program or code segment can be stored in a memory, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0106] It should be noted that the present application is not limited to the specific configurations and processes described above or shown in the figures. The above is only a specific implementation mode of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the described system, device, module or unit can refer to the corresponding process in the method embodiment without further description. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with the technical field can think of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and these modifications or substitutions should be included in the scope of protection of the present application.

Claims

1. A method for adapting a device screen to fill a grid array, characterized in that: The grid array includes a plurality of rows and columns of primary grids, and each of the primary grids includes a plurality of rows and columns of secondary grids; the method includes: Determine the size of the primary grid and the secondary grid according to the arrangement information of the target grid array and the screen resolution of the target device, and generate the target grid array in the target device according to the size of the primary grid and the secondary grid, wherein the secondary grid is used to fill the specified element; Numbering all secondary grids in the target grid array in a predetermined order, and determining the position of the i-th secondary grid in the target grid array based on the numbering; According to the positional relationship between the secondary grid and the primary grid and the position of the ith secondary grid in the target grid array, the position of the jth primary grid where the ith secondary grid is located in the target grid array is determined; According to the position of the j-th primary grid in the target grid array and the position of the i-th secondary grid in the target grid array, determine the position of the i-th secondary grid in the j-th primary grid; When it is necessary to fill an element into the i-th secondary grid, the generated designated element is displayed in the i-th secondary grid according to the position of the i-th secondary grid in the j-th primary grid.

2. The method according to claim 1, characterized in that The arrangement information of the target grid array includes the total number of rows and columns of the secondary grids in the target grid array; The step of numbering all the secondary grids in the target grid array in a predetermined order includes: numbering all the secondary grids in the target grid array in a column-by-column order from left to right and a row-by-row order from bottom to top, wherein the numbering is performed in numbers; and The method of determining the position of the i-th secondary grid in the target grid array based on the number includes: determining the row number and column number of the i-th secondary grid in the target grid array according to the division result of the number of the i-th secondary grid and the total number of rows and the division result of the number of the i-th secondary grid and the total number of columns.

3. The method according to claim 2, characterized in that The arrangement information of the target grid array includes the total number of rows and columns of the first-level grids in the target grid array; The positional relationship between the secondary grid and the primary grid includes: the primary grid is consistent with the secondary grid, and the row and column arrangement order is defined from left to right by column and from bottom to top by row; and, The method of determining the position of the jth primary grid where the i-th secondary grid is located in the target grid array according to the position of the i-th secondary grid in the target grid array includes: determining the row number and column number of the j-th primary grid in the target grid array according to the division result of the row number of the i-th secondary grid and the total number of rows of the primary grid and the division result of the column number of the i-th secondary grid and the total number of columns of the primary grid.

4. The method according to claim 3, characterized in that The method of determining the position of the i-th secondary grid in the j-th first-level grid according to the position of the j-th first-level grid in the target grid array and the position of the i-th secondary grid in the target grid array includes: determining the row number and column number of the i-th secondary grid in the j-th first-level grid according to the subtraction result of the row number of the i-th secondary grid and the row number of the j-th first-level grid, and the subtraction result of the column number of the i-th secondary grid and the column number of the j-th first-level grid.

5. The method according to any one of claims 1 to 4, characterized in that The target grid array includes a primary grid with 3 rows and 3 columns, the primary grid includes a secondary grid with 3 rows and 3 columns, and the target grid array includes a secondary grid with 9 rows and 9 columns.

6. The method according to claim 5, characterized in that The position {c, r} of the i-th secondary grid in the target grid array is determined according to the following formula: {c,r}={i%9,Ceiling(i / 9)}; Among them, c is the column number of the secondary grid in the target grid array, r is the row number of the secondary grid in the target grid array, the operation % is to take the remainder, the operation / is to take the quotient, and Ceiling is to round up; among them, when i%9=0, let c=9.

7. The method according to claim 6, characterized in that Determine the position {x, y} of the jth first-level grid in the target grid array according to the following calculation formula: {x,y}={Ceiling(c / 3),Ceiling(r / 3)}; Among them, x is the column number of the j-th first-level grid in the target grid array, and y is the row number of the j-th first-level grid in the target grid array.

8. The method according to claim 7, characterized in that According to the following calculation formula, determine the position of the i-th secondary grid in the j-th primary grid {g x ,g y }: {g x ,g y }={c-(x-1)*3,r-(y-1)*3}; Among them, g x is the column number of the i-th secondary grid in the j-th primary grid, g y is the row number of the i-th secondary grid in the j-th primary grid.

9. The method according to claim 6, characterized in that: The arrangement information of the target grid array includes the total number of rows and columns of the first-level grids in the target grid array; The positional relationship between the secondary grid and the primary grid includes: the primary grid is consistent with the secondary grid, and the row and column arrangement order is defined from left to right by column and from bottom to top by row; The method further includes: determining the number Id of the jth primary grid where the i-th secondary grid is located according to the position of the i-th secondary grid in the target grid array according to the following calculation formula: Id=(c / 3-1)*(3-1)+r%3.

10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; when the electronic device executes the computer program instructions, the method according to any one of claims 1 to 9 is implemented.