Page generation method and device

By detecting and eliminating overlapping and stacked elements in grid pages in the low-code field, the simulation and rendering of two-dimensional grid layouts are realized, solving the problem of difficulty in building pages for users, improving the flexibility of page generation and user experience.

CN118535144APending Publication Date: 2024-08-23BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410581458.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the low-code field, it is difficult for users to build the desired page when using grid layout, and it is difficult to achieve flexible page layout and rendering with existing technology.

Method used

By detecting the user dragging elements in the grid page, determining the set of overlapping and stacked elements, performing overlap elimination and stacking elimination, and generating the target page, the simulation and rendering of the two-dimensional grid layout are realized.

Benefits of technology

It improves the flexibility and user experience of page generation, enables users to adjust the position and size of elements independently, achieves flexible layout and rendering, and simplifies the page building process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535144A
    Figure CN118535144A
Patent Text Reader

Abstract

The embodiment of the invention provides a page generation method and device. The page generation method comprises the steps that firstly, in response to the detection that a user drags a to-be-added element in a grid page, an overlapped element set overlapped with the to-be-added element is determined from the grid page, then overlapping elimination is conducted on the overlapped element set, multiple added elements in the grid page are determined, and the added elements are stored in the grid page; and in response to determining that the to-be-added element and the plurality of added elements in the grid page have stacked elements, performing stack elimination on the to-be-added element and the plurality of added elements, determining a plurality of processing elements in the grid page, and finally rendering the plurality of processing elements to generate a target page. According to the embodiment of the invention, the to-be-added element can be dragged in the grid page, and the two-dimensional grid layout is simulated, so that the flexibility of page generation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the fields of computer technology and Internet technology, and in particular, to a page generation method and device. Background Art

[0002] In the low-code field, most canvas grid layouts use the front-end layout configuration and provide users with a visual interface. Users need to perform some configuration when using it to achieve the page effect they expect, so it is very difficult to build the page that users want. Summary of the invention

[0003] Embodiments of the present disclosure provide a page generation method, device, electronic device, and computer-readable medium.

[0004] In a first aspect, an embodiment of the present disclosure provides a page generation method, the method comprising: in response to detecting that a user drags an element to be added in a grid page, determining a set of overlapping elements that overlap with the element to be added from the grid page; eliminating overlaps of the set of overlapping elements to determine multiple added elements in the grid page; in response to determining that there are stacked elements between the element to be added and multiple added elements in the grid page, eliminating stacks between the element to be added and the multiple added elements to determine multiple processing elements in the grid page; and rendering the multiple processing elements to generate a target page.

[0005] In some embodiments, the grid page is obtained based on the following steps: dividing the page to be processed into grids according to a preset number of grid columns and a preset grid row height to generate a grid page.

[0006] In some embodiments, in response to detecting that a user drags an element to be added in a grid page, a set of overlapping elements that overlap with the element to be added is determined from the grid page, including: in response to detecting that a user drags the element to be added in the grid page, converting the page coordinates of the element to be added into grid coordinates; comparing the grid coordinates with the grid coordinates of multiple added elements in the grid page, and determining a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0007] In some embodiments, the grid coordinates are compared with the grid coordinates of multiple added elements in the grid page, and a set of overlapping elements that overlap with the element to be added is determined from the multiple added elements, including: determining boundary information of the element to be added based on the grid coordinates of the element to be added; determining boundary information of the multiple added elements based on the grid coordinates of the multiple added elements; comparing the boundary information of the element to be added with the boundary information of multiple added elements, and determining a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0008] In some embodiments, overlapping elimination is performed on a set of overlapping elements to determine a plurality of added elements in a grid page, including: sequentially moving the overlapping elements in the set of overlapping elements by a preset number of grid units in a preset direction, and labeling the overlapping elements in the set of overlapping elements; determining whether there are unlabeled overlapping elements in the set of overlapping elements; and determining a plurality of added elements in the grid page in response to determining that there are no unlabeled overlapping elements.

[0009] In some embodiments, overlapping elimination is performed on a set of overlapping elements to determine a plurality of added elements in a grid page, further comprising: in response to determining that unmarked overlapping elements exist, moving the unmarked overlapping elements in a preset direction by a preset number of grid units, and labeling the unmarked overlapping elements.

[0010] In some embodiments, in response to determining that there are stacked elements between an element to be added and multiple elements already added in a grid page, the element to be added and the multiple elements already added are stacked and eliminated, and multiple processing elements in the grid page are determined, including: judging whether there are stacked elements between the element to be added and the multiple elements already added in the grid page according to the grid coordinates of the element to be added and the grid coordinates of the multiple elements already added; in response to determining that there are stacked elements between the element to be added and the multiple elements already added, sorting the element to be added and the multiple elements already added into an element queue based on a preset sorting condition; for each element in each element queue, moving the element that is stacked with the element in a preset direction; in response to determining that the element queue satisfies the stacking elimination condition, determining the element to be added and the multiple elements already added in the element queue as multiple processing elements.

[0011] In some embodiments, rendering multiple processing elements to generate a target page includes: converting grid coordinates of the multiple processing elements into page coordinates; and rendering the multiple processing elements according to the page coordinates to generate the target page.

[0012] In some embodiments, the grid coordinates of multiple processing elements are converted into page coordinates, including: in response to determining that the page parameters of the page to be processed have changed, based on the current page parameters of the page to be processed and the number of grids of the grid page, generating a new grid page; based on the new grid page and the grid coordinates of the multiple processing elements, determining new grid coordinates of the multiple processing elements; converting the new grid coordinates into new page coordinates; rendering the multiple processing elements according to the page coordinates to generate a target page, including: rendering the multiple processing elements according to the new page coordinates to generate a new target page.

[0013] In a second aspect, an embodiment of the present disclosure provides a page generation device, which includes a determination module, an overlap elimination module, a stack elimination module, and a generation module. The determination module is configured to determine a set of overlapping elements that overlap with the element to be added from the grid page in response to detecting that a user drags an element to be added in a grid page; the overlap elimination module is configured to eliminate overlaps on the set of overlapping elements and determine multiple added elements in the grid page; the stack elimination module is configured to eliminate stacks on the element to be added and multiple added elements in response to determining that there are stacked elements between the element to be added and multiple added elements in the grid page, and determine multiple processing elements in the grid page; the generation module is configured to render multiple processing elements and generate a target page.

[0014] In some embodiments, the grid page is obtained based on the following steps: dividing the page to be processed into grids according to a preset number of grid columns and a preset grid row height to generate a grid page.

[0015] In some embodiments, the determination module is further configured to: in response to detecting that the user drags the element to be added in the grid page, convert the page coordinates of the element to be added into grid coordinates; compare the grid coordinates with the grid coordinates of multiple added elements in the grid page, and determine a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0016] In some embodiments, the determination module is further configured to: determine the boundary information of the element to be added based on the grid coordinates of the element to be added; determine the boundary information of multiple added elements based on the grid coordinates of multiple added elements; compare the boundary information of the element to be added with the boundary information of multiple added elements, and determine a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0017] In some embodiments, the overlap elimination module is further configured to: sequentially move the overlapping elements in the overlapping element set in a preset direction by a preset number of grid units, and label the overlapping elements in the overlapping element set; determine whether there are unlabeled overlapping elements in the overlapping element set; and in response to determining that there are no unlabeled overlapping elements, determine a plurality of added elements in the grid page.

[0018] In some embodiments, the overlap elimination module is further configured to: in response to determining that there are unmarked overlapping elements, move the unmarked overlapping elements in a preset direction by a preset number of grid units, and label the unmarked overlapping elements.

[0019] In some embodiments, the stack elimination module is further configured to: determine whether there are stacked elements among the elements to be added and the multiple elements already added in the grid page based on the grid coordinates of the elements to be added and the grid coordinates of the multiple elements already added; in response to determining that there are stacked elements among the elements to be added and the multiple elements already added, sort the elements to be added and the multiple elements already added into element queues based on preset sorting conditions; for each element in each element queue, move the elements stacked with the elements in a preset direction; in response to determining that the element queue meets the stack elimination condition, determine the elements to be added and the multiple elements already added in the element queue as multiple processing elements.

[0020] In some embodiments, the generation module is further configured to: convert the grid coordinates of the multiple processing elements into page coordinates; and render the multiple processing elements according to the page coordinates to generate a target page.

[0021] In some embodiments, the generation module is further configured to: in response to determining that the page parameters of the page to be processed have changed, generate a new grid page based on the current page parameters of the page to be processed and the number of grids of the grid page; determine new grid coordinates of multiple processing elements based on the new grid page and the grid coordinates of multiple processing elements; convert the new grid coordinates into new page coordinates; render multiple processing elements according to the new page coordinates to generate a new target page.

[0022] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement a page generation method as described in any embodiment of the first aspect.

[0023] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, the page generation method described in any embodiment of the first aspect is implemented.

[0024] The page generation method provided by the embodiment of the present disclosure, the above-mentioned execution body first responds to detecting that the user drags the element to be added in the grid page, determines from the grid page a set of overlapping elements that overlap with the element to be added, then eliminates the overlap of the overlapping element set, determines multiple added elements in the grid page, and then responds to determining that there are stacked elements between the element to be added and the multiple added elements in the grid page, eliminates the stacking of the element to be added and the multiple added elements, determines multiple processing elements in the grid page, and finally renders the multiple processing elements to generate a target page. The element to be added can be dragged in the grid page, and the simulation of the two-dimensional grid layout is realized. The page can be quickly built using a low-code method, so that the user can adjust the position and size of the elements independently according to needs, and the page is flexibly laid out and rendered, which improves the ease of use of the canvas and the user's building experience, thereby improving the flexibility of page generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0026] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present disclosure may be applied;

[0027] Figure 2 is a flow chart of an embodiment of a page generation method according to the present disclosure;

[0028] Figure 3 is a schematic diagram of an application scenario of the page generation method according to the present disclosure;

[0029] Figure 4 is a flow chart of an embodiment of determining a set of overlapping elements according to the present disclosure;

[0030] Figure 5 is a flowchart of another embodiment of determining a set of overlapping elements according to the present disclosure;

[0031] Figure 6 is a flow chart of an embodiment of performing overlap elimination on a set of overlapping elements according to the present disclosure;

[0032] Figure 7 is a flow chart of an embodiment of stacking and eliminating an element to be added and multiple elements that have been added according to the present disclosure;

[0033] Figure 8 is a flow chart of an embodiment of generating a target page according to the present disclosure;

[0034] Fig. 9is a structural schematic diagram of an embodiment of a page generating device according to the present disclosure;

[0035] Fig.10 It is a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. DETAILED DESCRIPTION

[0036] The present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant disclosure, rather than to limit the disclosure. It is also necessary to explain that, for ease of description, only the parts related to the relevant disclosure are shown in the accompanying drawings.

[0037] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0038] Figure 1 An exemplary system architecture 100 is shown to which the page generation method and the page generation apparatus according to the embodiments of the present disclosure can be applied.

[0039] like Figure 1 As shown, the system architecture 100 may include terminal devices 104, 105, 106, a network 107, and servers 101, 102, 103. The network 107 is used to provide a medium for communication links between the terminal devices 104, 105, 106 and the servers 101, 102, 103. The network 107 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0040] The user can interact with the servers 101, 102, 103 belonging to the same server cluster through the terminal devices 104, 105, 106 via the network 107 to receive or send information, etc. Various applications can be installed on the terminal devices 104, 105, 106, such as page drawing applications, data analysis applications, instant messaging tools, social platform software, search applications, shopping applications, browser applications, etc.

[0041] The terminal devices 104, 105, and 106 may be hardware or software. When the terminal device is hardware, it may be various electronic devices having a display screen and supporting communication with the server, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc. When the terminal device is software, it may be installed in the electronic devices listed above. It may be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0042] Terminal devices 104, 105, and 106 can present a grid page through the screen. If it is detected that the user drags the element to be added in the grid page, a set of overlapping elements that overlap with the element to be added is determined from the grid page, and then terminal devices 104, 105, and 106 can eliminate overlaps on the set of overlapping elements to determine multiple added elements in the grid page. Afterwards, if it is determined that there are stacked elements between the element to be added and the multiple added elements in the grid page, terminal devices 104, 105, and 106 can eliminate stacks between the element to be added and the multiple added elements to determine multiple processing elements in the grid page. Finally, terminal devices 104, 105, and 106 can render the multiple processing elements to generate a target page, and display the target page to the user through the screen.

[0043] Servers 101, 102, and 103 may be servers that provide various services, such as a backend server that receives a request sent by a terminal device that establishes a communication connection with the backend server. The backend server may receive and analyze the request sent by the terminal device and generate a processing result.

[0044] It should be noted that the server can be hardware or software. When the server is hardware, it can be various electronic devices that provide various services to the terminal device. When the server is software, it can be implemented as multiple software or software modules that provide various services to the terminal device, or it can be implemented as a single software or software module that provides various services to the terminal device. No specific limitation is made here.

[0045] It should be noted that the page generation method provided in the embodiment of the present disclosure can be executed by the terminal devices 104, 105, and 106. Accordingly, the page generation apparatus can be set in the terminal devices 104, 105, and 106.

[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0047] Figure 2 A flow chart 200 of an embodiment of a page generation method according to the present disclosure is shown. The page generation method comprises the following steps:

[0048] Step 210 , in response to detecting that the user drags the element to be added in the grid page, a set of overlapping elements that overlap with the element to be added is determined from the grid page.

[0049] In this step, the execution body (e.g. Figure 1The terminal devices 104, 105, and 106 in the example can display a grid page to the user through a screen, and the user can drag elements in the grid page to build the required page. The above-mentioned execution body can detect whether the user is dragging an element in the grid page by detecting the drag operation. If it is detected that the user is dragging an element to be added in the grid page, each position information of the element to be added during the dragging process can be obtained in real time. The element to be added can be the target element that the user is dragging after adding other elements.

[0050] The above-mentioned execution entity can obtain the current position information of the element to be added in real time, and compare the current position information of the element to be added with the position information of multiple elements already existing in the grid page. If it is determined that the current position information of the element to be added overlaps with the position information of multiple elements, it is determined that the element to be added and the multiple elements have an intersection. The above-mentioned execution entity can determine the overlapping multiple elements or one element as a set of overlapping elements that overlap with the element to be added.

[0051] It can be understood that there will be multiple position information when dragging the element to be added to the target position required by the user. For each position information, the above-mentioned execution entity will use the position information as the current position information, and for the current position information of the element to be added, determine the set of overlapping elements that overlap with the element to be added from the grid page.

[0052] As an example, elements a, b, c and d already exist in the above-mentioned grid page. The user drags element e to be added in the grid page. The above-mentioned execution entity can determine the position information of element e to be added during the dragging process, and compare the position information of element e to be added with the position information of element a to determine whether there is overlap between element e to be added and element a, compare the position information of element e to be added with element b to determine whether there is overlap between element e to be added and element b, compare the position information of element e to be added with element c to determine whether there is overlap between element e to be added and element c, compare the position information of element e to be added with element d to determine whether there is overlap between element e to be added and element d. If it is determined that element e to be added overlaps with elements a and element b, then the set of overlapping elements that overlap with element e to be added includes elements a and element b.

[0053] As an implementation of the present disclosure, the above-mentioned grid page can be obtained based on the following steps: according to a preset number of grid columns and a preset grid row height, the page to be processed is grid-divided to generate a grid page.

[0054] Specifically, the execution subject may receive a page creation request from a user, and create a page to be processed according to the page creation request. The execution subject may perform grid division on the page to be processed according to the grid parameters input by the user or the preset grid parameters, and the grid parameters include a preset number of grid columns and a preset grid row height. Then the execution subject may perform grid division on the page height and page width of the page to be processed according to the preset number of grid columns and the preset grid row height, that is, the page to be processed may be grid divided in the column direction according to the preset number of grid columns and the page width of the page to be processed, and the page to be processed may be grid divided in the row direction according to the preset grid row height and the page height of the page to be processed, thereby generating a grid page corresponding to the page to be processed.

[0055] In this implementation, by using the preset number of grid columns and the preset grid row height to divide the processed page into grids, a simulated grid layout is achieved, and the preset number of grid columns and the preset grid row height can be more in line with the current page parameters, making the grid division more accurate and flexible.

[0056] Step 220 , eliminating overlaps of the overlapping element set to determine a plurality of added elements in the grid page.

[0057] In this step, after the above-mentioned execution entity determines the set of overlapping elements, in order to prevent the existence of complete overlap between elements, it is necessary to eliminate overlaps in the set of overlapping elements. The above-mentioned execution entity can perform a move operation on each overlapping element in the set of overlapping elements, and move each overlapping element from its original position to a new position according to the current position information of the element to be added and the position information of each overlapping element, so that each overlapping element after the move does not completely overlap with the element to be added and is different from the original position.

[0058] After the above-mentioned execution entity eliminates overlap for each overlapping element in the overlapping element set, it can obtain all the elements in the grid page and determine multiple added elements in the grid page except the element to be added, wherein the multiple added elements may include elements on which overlap elimination has been performed, and may also include elements without overlap.

[0059] Step 230 , in response to determining that there are stacked elements between the element to be added and the multiple elements already added in the grid page, the element to be added and the multiple elements already added are stacked and eliminated, and multiple processing elements in the grid page are determined.

[0060] In this step, after the above-mentioned execution entity determines the multiple added elements and the elements to be added in the grid page, it can compare the position information of the multiple added elements with the position information of the elements to be added to determine whether there is overlap between the elements to be added and the multiple added elements, thereby determining whether there are stacked elements between the elements to be added and the multiple added elements.

[0061] If it is determined that there are stacked elements between the element to be added and multiple elements already added in the grid page, and it is necessary to eliminate the stacking of the element to be added and the multiple elements already added, the above-mentioned execution entity can treat the multiple elements already added and the element to be added as grid elements in the grid page, and for each grid element, compare the position information of the grid element with the position information of other grid elements; if there is overlapping stacking with other grid elements, move the other grid elements; and according to the position information of the grid element and the position information of other grid elements, move each other grid element from its original position to a new position until there is no overlapping stacking between the grid element and other grid elements.

[0062] After the above-mentioned execution entity completes stack elimination for each grid element, each grid element in the grid page is independent, and no stacking occurs between the grid elements. The above-mentioned execution entity can determine the grid elements on the grid page that have completed stack elimination as multiple processing elements in the grid page, that is, determine the elements to be added and the multiple added elements after stack elimination in the grid page as multiple processing elements in the grid page.

[0063] Step 240: Render multiple processing elements to generate a target page.

[0064] In this step, after the above-mentioned execution entity determines the multiple processing elements in the raster page, the multiple processing elements can be rendered. In the rendering stage, the multiple processing elements are rendered to the two-dimensional grid position to obtain the rendered raster page, and the rendered raster page and the rendered multiple processing elements are converted to the page to be processed corresponding to the raster page to generate a target page, which can include the rendered multiple processing elements.

[0065] The page generation method provided by the embodiment of the present disclosure, the above-mentioned execution body first responds to detecting that the user drags the element to be added in the grid page, determines from the grid page a set of overlapping elements that overlap with the element to be added, then eliminates the overlap of the overlapping element set, determines multiple added elements in the grid page, and then responds to determining that there are stacked elements between the element to be added and the multiple added elements in the grid page, eliminates the stacking of the element to be added and the multiple added elements, determines multiple processing elements in the grid page, and finally renders the multiple processing elements to generate a target page. The element to be added can be dragged in the grid page, and the simulation of the two-dimensional grid layout is realized. The page can be quickly built using a low-code method, so that the user can adjust the position and size of the elements independently according to needs, and the page is flexibly laid out and rendered, which improves the ease of use of the canvas and the user's building experience, thereby improving the flexibility of page generation.

[0066] Continue to refer Figure 3 , Figure 3 FIG. 1 is a schematic diagram of an application scenario of the page generation method according to this embodiment. Figure 3 In the application scenario, as shown in FIG310, the terminal device displays a grid page to the user through the screen, and the grid page includes elements A, B, and C that the user has added. The terminal device detects that the user drags the element D to be added in the grid page along the direction of the line, and obtains the position information of the element to be added in real time during the dragging process. The position information of the element D to be added overlaps with the position information of element A, and it is determined that the element D to be added overlaps with element A, but does not overlap with elements B and element C, and element A is determined to be an overlapping element. As shown in FIG320, the terminal device moves element A down by one grid unit, and then element A and element C are stacked. As shown in FIG330, the terminal device can perform stack elimination on the element D, element A, element B and element C to be added, perform stack judgment and stack elimination on each element, and the element D to be added does not overlap with the element A, element B and element C, and element A and element C are stacked, so element C is moved down by one grid unit, and element A and element C are not stacked. The elements D, element A, element B and element C to be added in the grid page are not stacked, and the elements D, element A, element B and element C to be added can be determined as multiple processing elements. As shown in FIG340, the terminal device renders multiple processing elements, that is, renders the elements D, element A, element B and element C to be added, and renders multiple processing elements to the two-dimensional grid position in the rendering stage to obtain the rendered grid page, and converts the rendered grid page and the rendered multiple processing elements to the page to be processed corresponding to the grid page to generate the target page.

[0067] refer to Figure 4 , Figure 4 A flowchart 400 of an embodiment of determining a set of overlapping elements is shown, that is, the above step 210, in response to detecting that a user drags an element to be added in a grid page, determining a set of overlapping elements that overlap with the element to be added from the grid page, which may include the following steps:

[0068] Step 410 , in response to detecting that the user drags the element to be added in the grid page, converting the page coordinates of the element to be added into grid coordinates.

[0069] In this step, since the grid page is a page obtained by grid-dividing the page to be processed, the above-mentioned execution body can detect whether the user is dragging an element in the grid page by detecting the drag operation. If it is detected that the user is dragging the element to be added in the grid page, the page coordinates of the element to be added during the dragging process can be obtained in real time. The page coordinates include the actual offset distance of the element to be added relative to the origin of the upper right corner of the page to be processed, and the page coordinates of the element to be added can be obtained through the underlying drag library (react-draggable).

[0070] The above-mentioned execution entity converts the page coordinates of the element to be added into grid coordinates according to the unit grid parameters of the grid page. The page coordinates of the element to be added can be divided by the unit grid parameters and rounded to the nearest integer to determine the grid coordinates of the element to be added. The unit grid parameters can include a unit grid width (colWidth) and a unit grid height (rowHeigth). The grid coordinates can include the coordinates of the x-axis in the grid, the coordinates of the y-axis in the grid, the horizontal span in the grid, and the vertical span in the grid.

[0071] The above-mentioned execution entity may divide the distance of the element to be added from the left side of the origin by the unit grid width, and round it off to determine the x-axis coordinate of the element to be added in the grid, that is, use x=Math.round(distance from the left side of the origin / unit grid width) to calculate the x-axis coordinate in the grid; the above-mentioned execution entity may divide the distance of the element to be added from the top of the origin by the unit grid height, and round it off to determine the y-axis coordinate of the element to be added in the grid, that is, use y=Math.round(distance from the top of the origin / unit grid height) to calculate the y-axis coordinate in the grid; the above-mentioned execution entity may divide the element width of the element to be added by the unit grid width , and round it off to determine the horizontal span of the element to be added in the grid, that is, use w=Math.round(element width of the element to be added / unit grid width) to calculate the horizontal span in the grid; the above-mentioned execution subject can divide the element height of the element to be added by the unit grid height, and round it off to determine the vertical span of the element to be added in the grid, that is, use h=Math.round(element height of the element to be added / unit grid height) to calculate the vertical span in the grid, so that the above-mentioned execution subject can determine the grid coordinates including the x-axis coordinates in the grid, the y-axis coordinates in the grid, the horizontal span in the grid, and the vertical span in the grid.

[0072] Step 420 , compare the grid coordinates with the grid coordinates of multiple added elements in the grid page, and determine a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0073] In this step, after the execution subject determines the grid coordinates of the element to be added, the grid coordinates of multiple added elements in the grid page can be obtained. The multiple added elements can be multiple elements that the user has added in the grid page. Then the execution subject can compare the grid coordinates of the element to be added with the grid coordinates of multiple added elements in the grid page to determine whether there is an intersection between the grid coordinates of the element to be added and the grid coordinates of multiple added elements in the grid page. If it is determined that the grid coordinates of the element to be added and the grid coordinates of multiple added elements in the grid page have an intersection, it is determined that the element to be added overlaps with the multiple added elements, and the execution subject can determine the multiple added elements or one added element that overlap as a set of overlapping elements that overlap with the element to be added.

[0074] In this embodiment, by converting the page coordinates of the elements to be added into grid coordinates, it is convenient for users to quickly understand the size of the grid occupied by the elements to be added and the position of the elements to be added in the grid page, and further using the grid coordinates to determine the set of overlapping elements, the set of overlapping elements can be determined in the grid layout, making the set of overlapping elements more accurate, thereby improving the efficiency and accuracy of determining the set of overlapping elements.

[0075] refer to Figure 5 , Figure 5 A flowchart 500 of another embodiment of determining a set of overlapping elements is shown. The above step 420, comparing the grid coordinates with the grid coordinates of multiple added elements in the grid page, and determining a set of overlapping elements that overlap with the element to be added from the multiple added elements, may include the following steps:

[0076] Step 510: Determine the boundary information of the element to be added according to the grid coordinates of the element to be added.

[0077] The x-coordinate in the grid, the y-coordinate in the grid, the horizontal span in the grid, and the vertical span in the grid

[0078] In this step, the execution subject may determine the boundary information of the element to be added according to the grid coordinates of the element to be added, and the boundary information may include left boundary information, right boundary information, upper boundary information and lower boundary information of the element to be added.

[0079] Specifically, the above-mentioned execution entity can determine the left boundary information, right boundary information, upper boundary information and lower boundary information of the element to be added according to the x-axis coordinate of the element to be added in the grid, the y-axis coordinate of the element to be added in the grid, the horizontal span in the grid and the vertical span in the grid.

[0080] Step 520: Determine boundary information of the multiple added elements according to the grid coordinates of the multiple added elements.

[0081] In this step, the execution entity may determine the boundary information of the multiple added elements according to the grid coordinates of the multiple added elements, and the boundary information may include left boundary information, right boundary information, upper boundary information and lower boundary information of the multiple added elements.

[0082] Specifically, the above-mentioned execution entity can determine the left boundary information, right boundary information, upper boundary information and lower boundary information of each added element according to the x-axis coordinate of each added element in the grid, the y-axis coordinate of each added element in the grid, the horizontal span in the grid and the vertical span in the grid.

[0083] Step 530: compare the boundary information of the element to be added with the boundary information of multiple elements that have been added, and determine a set of overlapping elements that overlap with the element to be added from the multiple elements that have been added.

[0084] In this step, the above-mentioned execution entity may compare the boundary information of the element to be added with the boundary information of multiple elements that have been added, and determine whether the boundary information of the element to be added has overlapping parts with the boundary information of multiple elements that have been added. If there is overlapping part, it is determined that the element to be added overlaps with multiple elements, and the above-mentioned execution entity may determine multiple overlapping elements or one element as a set of overlapping elements that overlap with the element to be added.

[0085] As an example, if the right boundary information of the element L1 to be added is less than or equal to the left boundary information of the element L2 to be added, it means that the added element L1 is on the left side of the element L2 to be added, and there is no overlap in the right boundary information; if the left boundary information of the element L1 to be added is greater than or equal to the right boundary information of the element L2 to be added, it means that the added element L1 is on the right side of the element L2 to be added, and there is no overlap in the left boundary information; if the lower boundary information of the element L1 to be added is less than or equal to the upper boundary information of the element L2 to be added, it means that the added element L1 is above the element L2 to be added, and there is no overlap in the lower boundary information; if the upper boundary information of the element L1 to be added is greater than or equal to the lower boundary information of the element L2 to be added, it means that the added element L1 is below the element L2 to be added, and there is no overlap in the upper boundary information. Based on the above judgment, it is determined that the element L1 to be added does not overlap with the element L2 to be added. In the judgment process, if any of the items does not meet the conditions, it is determined that there is overlap between the element L1 to be added and the element L2 to be added.

[0086] In this embodiment, by using grid coordinates to determine boundary information, and further using the boundary information to determine overlapping element sets, overlapping element sets can be determined in the grid layout, making the overlapping element sets more accurate, thereby improving the efficiency and accuracy of determining the overlapping element sets.

[0087] refer to Figure 6 , Figure 6 A flowchart 600 of an embodiment of performing overlapping elimination on a set of overlapping elements is shown, that is, the above step 220, performing overlapping elimination on the set of overlapping elements to determine a plurality of added elements in the grid page, may include the following steps:

[0088] Step 610: sequentially move the overlapping elements in the overlapping element set in a preset direction by a preset number of grid units, and label the overlapping elements in the overlapping element set.

[0089] In this step, after the execution subject obtains the overlapping element set, it can sequentially eliminate overlaps for each overlapping element in the overlapping element set, and can move each overlapping element in a preset direction by a preset number of grid units, for example, increasing the overlapping element by 1 grid unit, that is, moving the overlapping element downward by one grid unit. After moving the overlapping elements, the execution subject labels the moved overlapping elements, for example, labeling the overlapping element L with L.moved=true, so that it no longer participates in subsequent overlap elimination, to avoid triggering an unlimited loop calculation.

[0090] Step 620: Determine whether there are any unmarked overlapping elements in the overlapping element set.

[0091] In this step, the execution subject may read the label of each overlapping element in the overlapping element set to determine whether there are unlabeled overlapping elements in the overlapping element set.

[0092] Step 630, in response to determining that there are no unmarked overlapping elements, determining a plurality of added elements in the grid page.

[0093] In this step, if it is determined that there are no unmarked overlapping elements in the overlapping element set, the above-mentioned execution entity can obtain all the elements in the grid page, and determine multiple added elements in the grid page except the elements to be added, wherein the multiple added elements may include elements after the overlap elimination is performed, and may also include elements without overlap.

[0094] In this embodiment, by moving the overlapping elements in the overlapping element set, it is ensured that each overlapping element does not overlap with the element to be added, which facilitates stacking elimination in the subsequent compact layout and improves the accuracy of the position of each overlapping element.

[0095] Continue to refer Figure 6 The above step 220, removing overlaps from the overlapping element set to determine a plurality of added elements in the grid page, may also include the following steps:

[0096] Step 640 , in response to determining that there are unmarked overlapping elements, the unmarked overlapping elements are moved in a preset direction by a preset number of grid units, and the unmarked overlapping elements are labeled.

[0097] In this step, if it is determined that there are unmarked overlapping elements in the overlapping element set, the above-mentioned execution subject may continue to eliminate the overlap of the unmarked overlapping elements, and may move the unmarked overlapping elements in a preset direction by a preset number of grid units, for example, increasing the unmarked overlapping elements by 1 grid unit, that is, moving the overlapping elements downward by one grid unit. After moving the unmarked overlapping elements, the above-mentioned execution subject labels the moved overlapping elements until there are no unmarked overlapping elements in the overlapping element set.

[0098] Then the execution body may obtain all elements in the grid page, and determine multiple added elements in the grid page except the element to be added, wherein the multiple added elements may include elements after overlap elimination and elements without overlap.

[0099] In this embodiment, by moving the overlapping elements in the overlapping element set and marking the overlapping elements, the labels can be used to prevent the moved overlapping elements from participating in the subsequent overlap elimination, thereby avoiding triggering an unlimited loop calculation, ensuring that each overlapping element does not overlap with the element to be added, facilitating stacking elimination in the subsequent compact layout, and improving the accuracy of the position of each overlapping element.

[0100] refer to Figure 7 , Figure 7 A flowchart 700 of an embodiment of performing stack elimination on an element to be added and multiple elements that have been added is shown, that is, the above step 230, in response to determining that there are stacked elements between the element to be added and multiple elements that have been added in the grid page, performing stack elimination on the element to be added and the multiple elements that have been added, and determining multiple processing elements in the grid page may include the following steps:

[0101] Step 710: Determine whether there is a stacking element among the elements to be added and the multiple elements already added in the grid page.

[0102] In this step, after the above-mentioned execution entity determines the multiple added elements in the grid page, it can judge the elements to be added in the grid page and the multiple added elements to determine whether there is an overlapping part between every two elements of the elements to be added in the grid page and the multiple added elements, that is, to determine whether there are stacked elements among the elements to be added in the grid page and the multiple added elements.

[0103] Step 720 , in response to determining that there are stacked elements among the elements to be added and the multiple elements that have been added, sort the elements to be added and the multiple elements that have been added into an element queue based on a preset sorting condition.

[0104] In this step, if it is determined that there are stacked elements among the elements to be added and the multiple elements that have been added, the above-mentioned execution entity can extract the elements to be added and the multiple elements that have been added in the grid page, and use preset sorting conditions to sort the elements to be added and the multiple elements that have been added into an element queue. The preset sorting conditions may include sorting the elements in ascending order of rows and columns to determine an element queue, which includes the elements to be added and the multiple elements that have been added that have been sorted according to the preset sorting rules.

[0105] Specifically, the execution subject may process the row coordinates and column coordinates of the element to be added and the row coordinates and column coordinates of each added element according to preset sorting conditions, sort the element to be added and multiple added elements in ascending order of rows and columns, and determine an element queue.

[0106] Step 730: for each element in each element queue, move the element stacked with the element in a preset direction.

[0107] In this step, the execution subject may declare an empty target queue (compareWith) after determining the element queue. The execution subject determines the element that is stacked with each element in each element queue, and moves the determined element in a preset direction, which may be downward, until no stacking occurs, and stores the element in the target queue.

[0108] Specifically, the above-mentioned execution subject can compare the first element with other elements in the element queue according to the arrangement order, determine the stacking element that is stacked with the first element from other elements, move the stacking element downward until it is not stacked with the first element, and store the first element in the target queue. Then, for the second element, compare the second element with other elements in the element queue, determine the stacking element that is stacked with the second element from other elements, move the stacking element downward until it is not stacked with the second element, and store the second element in the target queue. The above-mentioned execution subject processes each subsequent element in the arrangement order and stores it in the target queue until there is no stacking element in the element queue.

[0109] Step 740 : In response to determining that the element queue satisfies the stack elimination condition, the to-be-added element and the multiple added elements in the element queue are determined as multiple processing elements.

[0110] In this step, the above-mentioned execution entity can determine whether there are any stack elements that have not been stacked and eliminated in the element queue. If it is determined that there are no stack elements that have not been stacked and eliminated in the element queue, it is determined that the element queue meets the stack elimination condition, and the stack elimination condition includes that all elements in the element queue have been stacked and eliminated. The above-mentioned execution entity determines the to-be-added elements and multiple added elements in the element queue as multiple processing elements.

[0111] Furthermore, if it is determined through judgment that there are still stack elements in the element queue that have not been stacked and eliminated, it is determined that the element queue does not meet the stack elimination conditions, and it is necessary to continue to stack and eliminate the stack elements until it is determined that the element queue meets the stack elimination conditions. The above-mentioned execution entity determines the elements to be added and multiple elements that have been added in the element queue as multiple processing elements.

[0112] Furthermore, if it is determined that there is no stacking element among the elements to be added and the multiple elements already added in the grid page, the execution subject may directly determine the elements to be added and the multiple elements already added as multiple processing elements.

[0113] In this embodiment, for each element in each element queue, the elements stacked with the elements are moved in a preset direction to eliminate the mutual stacking of the elements, making the overall layout more compact, and storing the de-stacked elements in the target queue, which provides a reference for subsequent element processing and avoids an unlimited loop processing process.

[0114] refer to Figure 8 , Figure 8A flowchart 800 of an embodiment of generating a target page is shown, that is, the above step 240, rendering multiple processing elements to generate a target page, which may include the following steps:

[0115] Step 810, converting the grid coordinates of the plurality of processing elements into page coordinates.

[0116] In this step, after the execution entity determines multiple processing elements, it can read the grid coordinates of the multiple processing elements, and convert the grid coordinates of the multiple processing elements into page coordinates according to the unit grid parameters of the grid page. The grid coordinates of each processing element can be multiplied by the unit grid parameters and rounded to the nearest integer to determine the page coordinates of each processing element. The unit grid parameters can include a unit grid width (colWidth) and a unit grid height (rowHeigth). The grid coordinates can include an x-axis coordinate in the grid, a y-axis coordinate in the grid, a horizontal span in the grid, and a vertical span in the grid. The page coordinates include an actual offset distance of the processing element relative to the origin of the upper right corner of the page to be processed.

[0117] The execution subject may multiply the x-axis coordinate of each processing element in the grid by the unit grid width and round it off to determine the distance of each processing element from the left side of the origin, that is, the distance from the left side of the origin = Math.round (unit grid width * x); the execution subject may multiply the y-axis coordinate of each processing element in the grid by the unit grid height and round it off to determine the distance of each processing element from the top of the origin, that is, the distance from the top of the origin = Math.round (unit grid height * y); the execution subject may multiply the y-axis coordinate of each processing element in the grid by the unit grid height and round it off to determine the distance of each processing element from the top of the origin, that is, the distance from the top of the origin = Math.round (unit grid height * y); The horizontal span in the grid is multiplied by the unit grid width and rounded to the nearest integer to determine the element width of each processing element, that is, element width = Math.round (unit grid width * w); the above-mentioned execution entity can multiply the vertical span of each processing element in the grid by the unit grid width and rounded to the nearest integer to determine the element height of each processing element, that is, element height = Math.round (unit grid height * h), so that the above-mentioned execution entity can determine the page coordinates including the distance from the left side of the origin, the distance from the top of the origin, the element width and the element height.

[0118] Step 820, rendering multiple processing elements according to the page coordinates to generate a target page.

[0119] In this step, the execution entity may render multiple processing elements according to the page coordinates of each processing element, render each processing element at a specified position on the page to be processed, and generate a target page, which may include the rendered multiple processing elements.

[0120] In this embodiment, the grid coordinates of the plurality of processing elements are converted into page coordinates through the converted layout, and the processing elements are rendered using the page coordinates, so that the target page can be generated more accurately, making the target page more accurate.

[0121] As an implementation method of the present disclosure, the above-mentioned step 240, rendering multiple processing elements to generate a target page, may include the following steps: in response to determining that the page parameters of the page to be processed have changed, generating a new grid page based on the current page parameters of the page to be processed and the number of grids of the grid page; determining new grid coordinates of the multiple processing elements based on the new grid page and the grid coordinates of the multiple processing elements; converting the new grid coordinates into new page coordinates; and rendering the multiple processing elements according to the new page coordinates to generate a new target page.

[0122] Specifically, the execution subject can detect the page to be processed in real time. If it is determined that the page parameters of the page to be processed have changed and it is necessary to make the page to be processed adaptively adjustable, the execution subject can adjust the grid page according to the current page parameters of the page to be processed and the number of grids of the grid page, keep the number of grids unchanged, and re-divide the unit width of the grid according to the current page width to generate a new grid page. Then, the execution subject can convert the grid coordinates of multiple processing elements according to the unit grid parameters of the new grid page to determine the new grid coordinates of the multiple processing elements, and convert the new grid coordinates of the multiple processing elements into new page coordinates according to the unit grid parameters of the new grid page. The new grid coordinates of each processing element can be multiplied by the unit grid parameters, and rounded to determine the new page coordinates of each processing element. After that, the execution subject can render multiple processing elements according to the new page coordinates of each processing element, and render each processing element at the specified position on the page to be processed to generate a new target page.

[0123] In this implementation, by automatically adjusting the grid page and grid coordinates based on the current page parameters of the page to be processed, reflow calculation can be performed after the page size changes. While keeping the number of grids unchanged, the new page width is used to ensure that the same display effect can be achieved on different pages, thereby improving the flexibility and accuracy of page generation.

[0124] refer to Fig. 9 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a page generation device. Figure 2 The method embodiments shown correspond.

[0125] like Fig. 9As shown, the page generating device 900 of this embodiment may include: a determining module 910 , an overlapping eliminating module 920 , a stack eliminating module configured as 930 , and a generating module 940 .

[0126] The determination module 910 is configured to determine a set of overlapping elements that overlap with the element to be added from the grid page in response to detecting that the user drags the element to be added in the grid page;

[0127] The overlap elimination module 920 is configured to eliminate overlaps of the overlapping element set and determine a plurality of added elements in the grid page;

[0128] The stacking elimination module 930 is configured to, in response to determining that there are stacked elements between the element to be added and the multiple elements already added in the grid page, eliminate the stacking of the element to be added and the multiple elements already added, and determine multiple processing elements in the grid page;

[0129] The generating module 940 is configured to render the multiple processing elements to generate a target page.

[0130] In some optional implementations of the present embodiment, the grid page is obtained based on the following steps: the page to be processed is grid-divided according to a preset number of grid columns and a preset grid row height to generate a grid page.

[0131] In some optional implementations of the present embodiment, the determination module 910 is further configured to: in response to detecting that the user drags the element to be added in the grid page, convert the page coordinates of the element to be added into grid coordinates; compare the grid coordinates with the grid coordinates of multiple added elements in the grid page, and determine a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0132] In some optional implementations of the present embodiment, the determination module 910 is further configured to: determine the boundary information of the element to be added based on the grid coordinates of the element to be added; determine the boundary information of multiple added elements based on the grid coordinates of multiple added elements; compare the boundary information of the element to be added with the boundary information of multiple added elements, and determine a set of overlapping elements that overlap with the element to be added from the multiple added elements.

[0133] In some optional implementations of the present embodiment, the overlap elimination module 920 is further configured to: sequentially move the overlapping elements in the overlapping element set in a preset direction by a preset number of grid units, and label the overlapping elements in the overlapping element set; determine whether there are unlabeled overlapping elements in the overlapping element set; in response to determining that there are no unlabeled overlapping elements, determine a plurality of added elements in the grid page.

[0134] In some optional implementations of the present embodiment, the overlap elimination module 920 is further configured to: in response to determining that there are unmarked overlapping elements, move the unmarked overlapping elements in a preset direction by a preset number of grid units, and label the unmarked overlapping elements.

[0135] In some optional implementations of the present embodiment, the stacking elimination module 930 is further configured to: determine whether there are stacking elements among the elements to be added and the multiple elements already added in the grid page based on the grid coordinates of the elements to be added and the grid coordinates of the multiple elements already added; in response to determining that there are stacking elements among the elements to be added and the multiple elements already added, sort the elements to be added and the multiple elements already added into element queues based on preset sorting conditions; for each element in each element queue, move the elements that are stacked with the elements in a preset direction; in response to determining that the element queue meets the stacking elimination condition, determine the elements to be added and the multiple elements already added in the element queue as multiple processing elements.

[0136] In some optional implementations of the present embodiment, the generation module 940 is further configured to: convert the grid coordinates of the multiple processing elements into page coordinates; render the multiple processing elements according to the page coordinates to generate a target page.

[0137] In some optional implementations of the present embodiment, the generation module 940 is further configured to: in response to determining that the page parameters of the page to be processed have changed, generate a new grid page based on the current page parameters of the page to be processed and the number of grids of the grid page; determine new grid coordinates of multiple processing elements based on the new grid page and the grid coordinates of multiple processing elements; convert the new grid coordinates into new page coordinates; render multiple processing elements according to the new page coordinates to generate a new target page.

[0138] The page generation device provided by the above-mentioned embodiment of the present disclosure, the above-mentioned execution body first responds to detecting that the user drags the element to be added in the grid page, determines from the grid page a set of overlapping elements that overlap with the element to be added, then eliminates the overlap of the overlapping element set, determines multiple added elements in the grid page, and then responds to determining that there are stacked elements between the element to be added and the multiple added elements in the grid page, eliminates the stacking of the element to be added and the multiple added elements, determines multiple processing elements in the grid page, and finally renders the multiple processing elements to generate a target page. The element to be added can be dragged in the grid page, and the simulation of the two-dimensional grid layout is realized. The page can be quickly built using a low-code method, so that the user can independently adjust the position and size of the elements as needed, and the page is flexibly laid out and rendered, which improves the ease of use of the canvas and the user's building experience, thereby improving the flexibility of page generation.

[0139] Those skilled in the art will appreciate that the above device also includes some other well-known structures, such as a processor, a memory, etc. In order to unnecessarily obscure the embodiments of the present disclosure, these well-known structures are described in detail. Fig. 9 Not shown.

[0140] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0141] Reference below Fig.10 , which shows a schematic diagram of the structure of an electronic device 1000 suitable for implementing an embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as smart screens, notebook computers, PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0142] like Fig.10 As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0143] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Fig.10 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0144] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium of the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus, or a device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

[0145] Computer program code for performing the operations of the embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).

[0146] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a determination module, an overlap elimination module, a stack elimination module and a generation module, wherein the names of these modules do not constitute a limitation on the modules themselves in some cases.

[0148] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device; or may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: in response to detecting that a user drags an element to be added in a grid page, determines a set of overlapping elements that overlap with the element to be added from the grid page; eliminates overlaps of the set of overlapping elements, and determines multiple added elements in the grid page; in response to determining that there are stacked elements between the element to be added and multiple added elements in the grid page, eliminates stacks between the element to be added and multiple added elements, and determines multiple processing elements in the grid page; renders multiple processing elements to generate a target page.

[0149] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A page generation method, the method include: In response to detecting that an element to be added is dragged in a grid page, determining a set of overlapping elements that overlap with the element to be added from the grid page; Eliminating overlaps of the overlapping element set to determine a plurality of added elements in the grid page; In response to determining that there are stacked elements between the element to be added and the multiple elements already added in the grid page, stacking and eliminating the element to be added and the multiple elements already added, and determining multiple processing elements in the grid page; The multiple processing elements are rendered to generate a target page.

2. The method according to claim 1, in, The grid page is obtained based on the following steps: The page to be processed is divided into grids according to the preset number of grid columns and the preset grid row height to generate the grid page.

3. The method according to claim 1, in, In response to detecting that a user drags an element to be added in a grid page, determining a set of overlapping elements that overlap with the element to be added from the grid page includes: In response to detecting that a user drags an element to be added in a grid page, converting the page coordinates of the element to be added into grid coordinates; The grid coordinates are compared with the grid coordinates of a plurality of added elements in the grid page, and a set of overlapping elements that overlap with the element to be added is determined from the plurality of added elements.

4. The method according to claim 3, in, The step of comparing the grid coordinates with the grid coordinates of a plurality of elements already added in the grid page, and determining a set of overlapping elements from the plurality of elements already added that overlap with the element to be added, comprises: Determining boundary information of the element to be added according to the grid coordinates of the element to be added; Determining boundary information of the plurality of added elements according to the grid coordinates of the plurality of added elements; The boundary information of the element to be added is compared with the boundary information of the multiple elements that have been added, and a set of overlapping elements that overlap with the element to be added is determined from the multiple elements that have been added.

5. The method according to claim 1, in, The step of eliminating overlaps of the overlapping element set to determine a plurality of added elements in the grid page includes: Sequentially moving the overlapping elements in the overlapping element set by a preset number of grid units in a preset direction, and marking the overlapping elements in the overlapping element set with labels; Determine whether there are unmarked overlapping elements in the overlapping element set; In response to determining that there are no unmarked overlapping elements, a plurality of added elements in the grid page is determined.

6. The method according to claim 5, in, The step of eliminating overlaps of the overlapping element set to determine a plurality of added elements in the grid page further includes: In response to determining that there are unmarked overlapping elements, the unmarked overlapping elements are moved in a preset direction by a preset number of grid units, and the unmarked overlapping elements are labeled.

7. The method according to claim 1, in, In response to determining that there are stacked elements between the element to be added and the multiple elements already added in the grid page, stacking and eliminating the element to be added and the multiple elements already added, and determining multiple processing elements in the grid page, comprises: According to the grid coordinates of the element to be added and the grid coordinates of the multiple elements that have been added, determining whether there is a stacking element among the element to be added and the multiple elements that have been added in the grid page; In response to determining that there is a stacking element among the elements to be added and the multiple elements that have been added, sorting the elements to be added and the multiple elements that have been added into an element queue based on a preset sorting condition; For each element in each of the element queues, move the element stacked with the element in a preset direction; In response to determining that the element queue satisfies a stack elimination condition, an element to be added and a plurality of added elements in the element queue are determined as the plurality of processing elements.

8. The method according to claim 1, in, The rendering of the multiple processing elements to generate a target page includes: converting the grid coordinates of the plurality of processing elements into page coordinates; The multiple processing elements are rendered according to the page coordinates to generate the target page.

9. The method according to claim 8, in, The step of converting the grid coordinates of the plurality of processing elements into page coordinates comprises: In response to determining that the page parameters of the page to be processed have changed, generating a new grid page based on the current page parameters of the page to be processed and the number of grids of the grid page; Determining new grid coordinates of the plurality of processing elements based on the new grid page and the grid coordinates of the plurality of processing elements; converting the new grid coordinates into new page coordinates; and, The step of rendering the plurality of processing elements according to the page coordinates to generate the target page includes: The multiple processing elements are rendered according to the new page coordinates to generate a new target page.

10. A page generation device, the device include: A determination module, configured to, in response to detecting that a user drags an element to be added in a grid page, determine a set of overlapping elements that overlap with the element to be added from the grid page; an overlap elimination module, configured to eliminate overlaps of the overlapping element set and determine a plurality of added elements in the grid page; a stacking elimination module configured to, in response to determining that there are stacked elements between the element to be added and the multiple elements already added in the grid page, perform stacking elimination on the element to be added and the multiple elements already added, and determine multiple processing elements in the grid page; The generating module is configured to render the plurality of processing elements to generate a target page.

11. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method according to any one of claims 1 to 9.

12. A computer readable medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Cited By

  • Component visualization front-end page automatic layout method, system and device and medium

    CN119396399A