Element search method, device, electronic device and storage medium

By responding to element search instructions and looking for target element blocks under a custom layout, finding all displayable elements at a lower time complexity, solving the problems of high time complexity and insufficient integrity in the prior art.

CN115017375BActive Publication Date: 2025-04-29BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210626329.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2025-04-29
Estimated Expiration
2042-06-02

AI Technical Summary

Technical Problem

In the prior art, under custom layout, the element search scheme has the problems of high time complexity and insufficient integrity, and it is difficult to effectively find elements that can be displayed in the current display area among multiple page elements.

Method used

By responding to element search instructions, the target element block located in the current display area is found from the built page element block, and the displayed elements are found for each target element block, which reduces the time complexity of the global traversal, and ensures the integrity of the search by traversing the page elements corresponding to the target element block.

Benefits of technology

It is realized to find all displayable elements based on a lower time complexity, solving the problems of high time complexity and insufficient integrity in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115017375B_ABST
    Figure CN115017375B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose an element search method, device, electronic device and storage medium. The method comprises: in response to an element search instruction, searching for a target element block located in the current display area from each constructed page element block, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position; for each target element block, searching for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block. The technical solution of the disclosed embodiments can find all displayable elements based on a relatively low time complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to an element search method, device, electronic device, and storage medium. Background Art

[0002] With the development of computer technology, current mobile operating systems allow developers to customize the layout of multiple page elements on the same page.

[0003] In actual applications, there may be a situation where these multiple page elements cannot be displayed in the current display area of ​​the mobile terminal at the same time. Therefore, how to find the displayable elements that can be displayed in the current display area from the multiple page elements is crucial for the correct display of the page.

[0004] However, in the case of custom layout, existing element search schemes have the problems of high time complexity and insufficient completeness. Summary of the invention

[0005] The embodiments of the present disclosure provide an element search method, device, electronic device, and storage medium to search for all displayable elements based on lower time complexity.

[0006] In a first aspect, an embodiment of the present disclosure provides an element search method, which may include:

[0007] In response to the element search instruction, a target element block located in the current display area is searched from each constructed page element block, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position;

[0008] For each target element block, a displayable element that can be displayed in the current display area is searched from at least one page element corresponding to the target element block.

[0009] In a second aspect, the embodiment of the present disclosure further provides an element search device, which may include:

[0010] A target element block search module is used to respond to the element search instruction and search for a target element block located in the current display area from the constructed page element blocks, wherein the page element block corresponds to at least one page element and covers at least one page element in terms of spatial position;

[0011] The displayable element search module is used to search for a displayable element that can be displayed in the current display area from at least one page element corresponding to each target element block.

[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which may include:

[0013] one or more processors;

[0014] a memory for storing one or more programs,

[0015] When one or more programs are executed by one or more processors, the one or more processors implement the element search method provided by any embodiment of the present disclosure.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the element search method provided by any embodiment of the present disclosure is implemented.

[0017] The technical solution in the disclosed embodiment, by responding to the element search instruction, finds the target element block located in the current display area from each constructed page element block, wherein the page element block corresponds to at least one page element and covers the at least one page element in spatial position, which means that the page element corresponding to the target element block is likely to be a displayable element that can be displayed in the current display area, so when searching for displayable elements later, there is no need to traverse each page element, only to search in the page elements corresponding to the limited target element block, thereby solving the problem of high time complexity caused by global traversal; further, considering that the page elements corresponding to the target element block may be disordered in spatial position (i.e. not arranged in order), in order not to miss any displayable elements, the page elements corresponding to the target element block can be traversed to find the displayable elements therefrom, thereby solving the problem of not being able to find all the displayable elements. The above technical solution achieves the effect of finding all the displayable elements based on low time complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0019] Figure 1 is a flowchart of an element search method in an embodiment of the present disclosure;

[0020] Figure 2 is a flowchart of another element search method in an embodiment of the present disclosure;

[0021] Figure 3 is a schematic diagram of an optional example of another element search method in an embodiment of the present disclosure;

[0022] Figure 4 is a flowchart of another element search method in an embodiment of the present disclosure;

[0023] Figure 5 is a schematic diagram of an optional example of another element search method in an embodiment of the present disclosure;

[0024] Figure 6 is a flowchart of another element search method in an embodiment of the present disclosure;

[0025] Figure 7 is a schematic diagram of an optional example of another element search method in an embodiment of the present disclosure;

[0026] Figure 8 is a structural block diagram of an element search device in an embodiment of the present disclosure;

[0027] Fig. 9 It is a structural schematic diagram of an electronic device in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0029] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0034] Figure 1 It is a flowchart of an element search method provided in an embodiment of the present disclosure. This embodiment can be applied to the case where a displayable element that can be displayed in the current display area is found from multiple page elements through a constructed page element block. The method can be executed by an element search device provided in an embodiment of the present disclosure, and the device can be implemented by software and / or hardware. The device can be integrated in an electronic device, and the electronic device can be various terminal devices or a server.

[0035] See also Figure 1 The method of the embodiment of the present disclosure specifically includes the following steps:

[0036] S110. In response to an element search instruction, a target element block located in the current display area is searched from the constructed page element blocks, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position.

[0037] The element search instruction may include an instruction for searching for displayable elements that can be displayed in the current display area from multiple page elements. Exemplarily, when a sliding operation on the display screen of the mobile terminal is detected, the element search instruction is triggered to search for displayable elements that match the sliding operation from multiple page elements in response to the element search instruction, and the current display area where these displayable elements are located is the area where the display screen is located after responding to the sliding operation.

[0038] These page elements can be laid out on the same page through a custom layout or a preset layout, and in the element layout process, corresponding page element blocks can be constructed for these page elements, each page element block can correspond to at least one page element, and cover the at least one page element in the spatial position, which is like the process of dividing these page elements again. On this basis, optionally, for the case where each page element block corresponds to at least one page element, this can be understood as each page element block contains at least one page element or each page element block stores at least one element identifier of a page element, etc., which is not specifically limited here. Optionally, the above-mentioned page element block can be constructed according to the line break identifier set by the relevant personnel for the page element. For example, in response to an element layout instruction for a certain page element, when the line break identifier of the page element is True, the page element can be laid out in a line break and a new page element block can be constructed for it; otherwise, the page element can continue to be laid out on the line currently being laid out, and it can be corresponded to the page element block currently in the construction state (i.e., not yet completed). Alternatively, the above page element blocks may also be constructed according to certain preset line break conditions, which will be elaborated in detail later and will not be repeated here.

[0039] For the page element blocks constructed for multiple page elements, some of the page element blocks are located in the current display area, while some are not. Therefore, the target element block located in the current display area can be found from these page element blocks.

[0040] S120: For each target element block, search for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block.

[0041] Among them, since each page element block can cover each page element corresponding to itself in spatial position, this means that the page elements corresponding to those page element blocks that are not located in the current display area will not contain displayable elements that can be displayed in the current display area. In other words, the displayable elements will only correspond to the target element block. Therefore, for each target element block, considering that the page elements corresponding to the target element block may not be orderly in spatial position, in order not to miss any displayable elements, the page elements corresponding to the target element block can be traversed to find the displayable elements.

[0042] The technical solution in the disclosed embodiment, by responding to the element search instruction, finds the target element block located in the current display area from each constructed page element block, wherein the page element block corresponds to at least one page element and covers the at least one page element in spatial position, which means that the page element corresponding to the target element block is likely to be a displayable element that can be displayed in the current display area, so when searching for displayable elements later, there is no need to traverse each page element, only to search in the page elements corresponding to the limited target element block, thereby solving the problem of high time complexity caused by global traversal; further, considering that the page elements corresponding to the target element block may be disordered in spatial position (i.e. not arranged in order), in order not to miss any displayable elements, the page elements corresponding to the target element block can be traversed to find the displayable elements therefrom, thereby solving the problem of not being able to find all the displayable elements. The above technical solution achieves the effect of finding all the displayable elements based on low time complexity.

[0043] An optional technical solution, based on the above embodiment, searching for displayable elements that can be displayed in the current display area from at least one page element corresponding to the target element block may include: taking the page element corresponding to the target element block as the corresponding element; for each corresponding element, if the corresponding element intersects with the current display area, taking the corresponding element as the displayable element that can be displayed in the current display area. The displayable element can be understood as a corresponding element that is completely or partially located in the current display area. Therefore, here, whether the corresponding element is a displayable element can be determined by judging whether the corresponding element intersects with the current display area, thereby achieving the effect of fast and accurate search of the displayable element.

[0044] Another optional technical solution, based on the above embodiment, the element identifier of at least one page element corresponding to the target element block is stored in the target element block; searching for displayable elements that can be displayed in the current display area from at least one page element corresponding to the target element block may include: obtaining the element identifier of at least one page element from the target element block, determining the page element corresponding to each element identifier of at least one page element; searching for displayable elements that can be displayed in the current display area from the page elements corresponding to each element identifier of the at least one page element. Wherein, when constructing each page element block, the element identifier of the page element corresponding to each page element block can be stored in itself. In this way, when searching for displayable elements based on the target element block, the page element corresponding to the target element block can be accurately determined by the element identifier stored in the target element block, so as to find the displayable elements from these page elements. It should be noted that since the target element block stores the element identifier instead of the page element, this means that the storage space occupied by the target element block in the computer is reduced without affecting the accuracy and speed of element search. In practical applications, optionally, the above element identifier can be represented by an index subscript.

[0045] Figure 2 It is a flow chart of another element search method provided in the embodiment of the present disclosure. This embodiment is optimized based on the various optional schemes in the above-mentioned embodiments. In this embodiment, optionally, each page element block is sequentially sorted in the layout direction of each page element, and the target element block located in the current display area is found from each constructed page element block, which may include: finding a reference element block located in the current display area from each constructed page element block; based on the reference element block, finding the target element block located in the current display area from each sequentially sorted page element block. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0046] Correspondingly, such as Figure 2 As shown, the method of this embodiment may specifically include the following steps:

[0047] S210. In response to an element search instruction, each constructed page element block is obtained, wherein a page element block corresponds to at least one page element and covers at least one page element in spatial position, and each page element block is arranged in sequence in the layout direction of each page element.

[0048] As mentioned above, these page elements can be laid out on the same page through a custom layout method. The specific layout method can be a horizontal layout, a vertical layout, or a waterfall layout. The layout direction corresponding to the vertical layout and the waterfall layout is a vertical direction. At this time, the user can achieve the effect of page sliding by sliding up and down on the display screen; the layout direction corresponding to the horizontal layout is a left-right layout. At this time, the user can achieve the effect of page sliding by sliding left and right on the display screen. Of course, no matter what layout method is used, these page elements may be arranged in order or disorderly in space. This is related to the actual layout situation and is not specifically limited here.

[0049] It should be emphasized that the page element blocks constructed based on these page elements are sequentially arranged in the layout direction of each page element, thereby achieving the orderliness of these page element blocks in the layout direction, and this also achieves the orderliness of these page elements in the layout direction to a certain extent. Figure 3 As shown, the largest rectangular boxes in the middle of the left and right sides are the current display areas. The left side shows the page elements (cell) after vertical layout, and the right side shows the page element blocks (rect) constructed based on these page elements. These page element blocks are sorted in the layout direction (here is the vertical direction), and the upper and lower boundaries of the sorted page element blocks are respectively ordered and increased. In addition, considering the application scenarios that may be involved in the embodiments of the present disclosure, the above-mentioned page element blocks can also be called row rectangles. It should be noted that in order to simplify the description, when explaining the remaining diagrams later, the page elements in the diagrams can be directly described as cells, and the page element blocks can be described as rects.

[0050] S220: Find a reference element block located in the current display area from each page element block.

[0051] Among them, since the page element blocks are arranged in sequence in the layout direction, the page element block located in the current display area can be found and used as the benchmark element block, so that all target element blocks located in the current display area can be found based on the benchmark element block.

[0052] S230 . Based on the reference element block, search for a target element block located in the current display area from the sequentially sorted page element blocks.

[0053] Among them, since the reference element block is located in the current display area, and these page element blocks are arranged in sequence in the layout direction, this means that when searching for the target element block, there is no need to traverse all the page element blocks. It is only necessary to traverse the reference element block as an anchor point, and stop traversing when a page element block that is not located in the current display area is found. This further reduces the time complexity of searching for displayable elements (for example, when the time complexity of globally traversing each page element is O(N), the time complexity of the above technical solution is only O(logN)+O(1)), and because no target element block will be missed, the integrity of the search for displayable elements is guaranteed. It should be noted that since the reference element block is located in the current display area, the reference element block is also the target element block.

[0054] For example, see Figure 3 , assuming that the reference element block is rect2, here we take upward traversal as an example, rect1 belongs to the target element block because it is in the current display area; continue to traverse upward, rect0 is not the target element block because it is not in the current display area, and because the target element blocks are sorted in the layout direction, this means that the page element blocks that continue to traverse upward cannot be the target element blocks, and the traversal can be stopped at this time. The situation of downward traversal is similar and will not be repeated here.

[0055] S240: For each target element block, search for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block.

[0056] According to the technical solution of the disclosed embodiment, since each page element block is sequentially arranged in the layout direction of each page element, a reference element block located in the current display area can be found from each page element block, and then a target element block located in the current display area can be found from each sequentially arranged page element block based on the reference element block. This can further reduce the time complexity of searching for displayable elements and ensure the integrity of searching for displayable elements because no target element block will be missed.

[0057] Figure 4 It is a flowchart of another element search method provided in the embodiment of the present disclosure. This embodiment is optimized based on the various optional schemes in the above embodiments. In this embodiment, optionally, the page element block can be pre-constructed by the following steps: obtaining the layout mode of the element to be laid out and the element maximum value of the element coordinates of the element to be laid out, wherein the element to be laid out is the page element to be laid out; according to the layout mode and the element maximum value, constructing a page element block corresponding to the element to be laid out. Among them, the explanation of the terms that are the same or corresponding to the above embodiments will not be repeated here.

[0058] Correspondingly, such as Figure 4 As shown, the method of this embodiment may specifically include the following steps:

[0059] S310: Obtain a layout mode of an element to be laid out and an element maximum value of an element coordinate of the element to be laid out, wherein the element to be laid out is a page element to be laid out.

[0060] Among them, the layout method can be the horizontal layout, vertical layout or waterfall layout mentioned above. Of course, it can also be other layout methods, which are not specifically limited here. The element coordinates can be the coordinates of the elements to be laid out in the regional coordinate system. The regional coordinate system can be a coordinate system constructed based on the current display area, such as a coordinate system constructed with the upper left corner vertex of the current display area as the origin, the horizontal direction as the x-axis and the vertical direction as the y-axis. Each element to be laid out corresponds to at least one element coordinate (x, y). The element maximum value can be the maximum value among these element coordinates, which may be the maximum value in the layout direction or the maximum value in the reverse direction perpendicular to the layout direction. It is not specifically limited here. For example, Figure 3 As shown, assuming that cell10 is the element to be laid out, in the vertical layout, the element maximum value may be the x in the element coordinates of the upper right corner vertex or the lower right corner vertex of cell10, which is the maximum value in the reverse direction.

[0061] S320. According to the layout mode and the maximum value of the element, a page element block corresponding to the element to be laid out is constructed, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position, and each page element block is arranged in sequence in the layout direction of each page element.

[0062] Among them, after obtaining the layout mode and element maximum value of the element to be laid out, a page element block corresponding to the element to be laid out can be constructed based on the two. The page element block may be a new page element block. This is a construction process from scratch. At this time, the element to be laid out is like Figure 3 cell4, cell7 and cell10 in the page element block currently under construction, etc.; it may also be the process of continuing to build the page element block currently under construction, such as corresponding the element to be laid out to the page element block currently under construction, so that the page element block currently under construction corresponds to a certain laid out element and an element to be laid out. At this time, the element to be laid out is like Figure 3 In cell3, the layout element is like Figure 3 cell1 and cell2 in .

[0063] S330 . In response to the element search instruction, search for a reference element block located in the current display area from each page element block.

[0064] S340 . Based on the reference element block, search for a target element block located in the current display area from the sequentially sorted page element blocks.

[0065] S350: For each target element block, search for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block.

[0066] The technical solution of the disclosed embodiment obtains page element blocks corresponding to the elements to be laid out through the layout mode of the elements to be laid out and the element maximum value, thereby achieving the effect of automatically constructing page element blocks during the element layout process.

[0067] An optional technical solution, based on the above embodiment, the layout mode includes vertical layout or horizontal layout, the element maximum value is the maximum value of the element coordinate in the reverse direction perpendicular to the layout direction, and according to the layout mode and the element maximum value, a page element block corresponding to the element to be laid out is constructed, including: obtaining the area size of the current display area in the reverse direction; if the element maximum value is greater than the area size, a new page element block corresponding to the element to be laid out is constructed. Figure 3 As shown in , it first lays out (places) elements in the horizontal direction, and then wraps them when they cannot be placed horizontally; the horizontal layout is the opposite, it first lays out elements in the vertical direction, and then wraps them (i.e., wraps them in columns in a sense) when they cannot be placed vertically. For both vertical and horizontal layouts, the area size of the current display area in the reverse direction can be obtained, such as Figure 3 x1 in the vertical layout shown. When the maximum element size is greater than the area size, it means that if the element to be laid out is placed in the row (or column) currently being laid out, the element to be laid out will exceed the current display area, so it is necessary to wrap the row (or column) to place the element to be laid out, and build a new page element block for the element to be laid out.

[0068] On this basis, optionally, the above-mentioned element search method may further include: if the maximum value of the element is less than or equal to the area size, the element to be laid out is matched to the page element block currently in the construction state, so as to construct the page element block corresponding to the element to be laid out. In other words, if the element to be laid out is placed in the row (or column) currently being placed, it will not exceed the current display area, and the element to be laid out can continue to be placed in this row (or column), and the element to be laid out is matched to the page element block currently in the construction state, so as to construct the page element block corresponding to the element to be laid out.

[0069] Another optional technical solution, based on the above embodiment, is a waterfall layout, the element maximum value is the maximum value of the element coordinates in the layout direction, and according to the layout mode and the element maximum value, a page element block corresponding to the element to be laid out is constructed, which may include: obtaining the element block maximum value of the element block coordinates in the layout direction of the page element block currently under construction; if the element maximum value is greater than the element block maximum value, then constructing a new page element block corresponding to the element to be laid out. Among them, the element block maximum value may be the maximum value of the element block coordinates in the layout direction of the page element block currently under construction. When the element maximum value is greater than the element block maximum value, it is necessary to construct a new page element block for the element to be laid out, thereby obtaining a new page element block corresponding to the element to be laid out. In order to more vividly understand the construction process of the page element block under the waterfall layout, it is exemplified below with reference to specific examples. See. Figure 5 , after placing cell1-cell3 in sequence, cell4 cannot be placed in the same row with cell3, so it is added under the shortest cell2 among cells1-cell3; among cell1, cell4 and cell3, cell4 is the shortest, so cell5 is added under cell4; among cell1, cell5 and cell4, cell5 is the shortest, so cell6 is added under cell5. At this time, the maximum value of the element of cell6 in the layout direction has exceeded the maximum value of the element block of the page element block currently in the construction state (i.e., the page element block corresponding to cell1-cell5), so a new page element block is constructed for cell6. The processing of cell7 and cell8 is similar and will not be repeated here. On this basis, optionally, in addition to determining whether to construct a new page element block based on the numerical relationship between the maximum value of the element and the maximum value of the element block, the numerical relationship between the number of page elements in the row currently being placed and the number of columns in the current display area (such as the number of columns in the figure is 3) can also be considered. For example, when the maximum value of the element is greater than the maximum value of the element block and the number of page elements in the row currently being placed is greater than the number of columns, a new page element block can be constructed for the element to be laid out.

[0070] Based on any of the above technical solutions, optionally, the element block coordinate value of the page element block can be the union of the element coordinate values ​​of each page element corresponding to the page element block. In other words, the page element block can just cover the corresponding page element in spatial position, and will not cover the page element that has no corresponding relationship with it. In this way, when searching for displayable elements, it can avoid multiple judgments on whether the same page element is in the current display area, thereby further ensuring the timeliness of element search.

[0071] Figure 6It is a flow chart of another element search method provided in the embodiment of the present disclosure. This embodiment is optimized based on the various optional schemes in the above-mentioned embodiments. In this embodiment, optionally, based on the reference element block, searching for the target element block located in the current display area from the sequentially sorted page element blocks may include: determining the adjacent element blocks adjacent to the reference element block from the sequentially sorted page element blocks, wherein the adjacent element blocks include the previous element block or the next element block; updating the adjacent element block to the reference element block; if the reference element block is located in the current display area, taking the reference element block as the target element block, and repeating the step of determining the adjacent element blocks adjacent to the reference element block from the sequentially sorted page element blocks. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.

[0072] Correspondingly, such as Figure 6 As shown, the method of this embodiment may specifically include the following steps:

[0073] S410. In response to an element search instruction, each constructed page element block is obtained, wherein a page element block corresponds to at least one page element and covers at least one page element in spatial position, and each page element block is arranged in sequence in the layout direction of each page element.

[0074] S420: Find a reference element block located in the current display area from each page element block.

[0075] S430 , determining a neighboring element block adjacent to the reference element block from the sequentially sorted page element blocks, wherein the neighboring element block includes a previous element block or a next element block.

[0076] The adjacent element block may be the previous element block or the next element block of the reference element block in the sequentially arranged element blocks of each page. For example, see Figure 3 , if the reference element block is rect2, then the adjacent element block can be rect1 or rect3.

[0077] S440, updating the adjacent element block to the reference element block, and determining whether the reference element block is located in the current display area, if yes, taking the reference element block as the target element block, and returning to execute S430.

[0078] That is to say, the reference element block found initially is used as an anchor point for forward and backward traversal to find all target element blocks in the current display area. During the traversal process, when a page element block that is not located in the current display area is found in any traversal direction, the search in that traversal direction can be stopped because the page element blocks are sorted in sequence in the layout direction, thereby further ensuring the timeliness of element search.

[0079] S450: For each target element block, search for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block.

[0080] The technical solution of the disclosed embodiment further reduces the time complexity of element search by traversing back and forth with the initially found benchmark element block as an anchor point, and then stops traversing when traversing to a page element block that is not located in the current display area, thereby ensuring the timeliness of element search.

[0081] An optional technical solution, based on the above embodiment, before the reference element block is located in the current display area, the above element search method may further include: determining whether the reference element block intersects with the current display area to obtain an intersection result; and determining whether the reference element block is located in the current display area according to the intersection result. In other words, whether the reference element block is located in the current display area can be determined by whether the reference element block intersects with the current display area. When the two intersect, it means that there is an overlap between the two. At this time, the reference element block is located in the current display area. Otherwise, the reference element block is not located in the current display area.

[0082] Another optional technical solution, based on the above embodiment, before the reference element block is located in the current display area, the above element search method may further include: obtaining the first minimum value and the first maximum value of the element block coordinates of the reference element block in the layout direction, and the second minimum value and the second maximum value of the area coordinates of the current display area in the layout direction; determining whether the reference element block is located in the current display area according to whether the first minimum value is greater than the second maximum value, or whether the first maximum value is less than the second minimum value. In other words, when the layout mode is vertical, if the upper boundary of the reference element block exceeds the lower boundary of the current display area or the lower boundary of the reference element block exceeds the upper boundary of the current display area, it means that the reference element block is not located in the current display area. Similarly, when the layout mode is horizontal, if the left boundary of the reference element block exceeds the right boundary of the current display area or the right boundary of the reference element block exceeds the left boundary of the current display area, it means that the reference element block is not located in the current display area. The above technical solution achieves the effect of quickly and accurately judging whether the reference element block is located in the current display area by comparing the coordinate maximum values.

[0083] On the basis of any of the above technical solutions, optionally, finding the reference element block located in the current display area from each page element block that has been constructed can include: for each page element block that has been constructed and sorted in sequence, taking the page element block located in the middle position of each page element block as the middle element block, if the middle element block is located in the current display area, then taking the middle element block as the reference element block; otherwise, finding the reference element block from the search range, wherein one end of each page element block sorted in sequence in the search range is the middle element block, and the other end is the first or last page element block in each page element block. In order to understand the above technical solution more vividly, the following is an exemplary description of it in conjunction with a specific example. Exemplarily, assuming that each page element block includes rect0-rect8, then the page element block located in the middle position is rect4 (i.e., the middle element block). If rect4 is located in the current display area, then rect4 is used as the reference element block; otherwise, based on rect0-rect4 (or rect4-rect8) to form a search range, the middle element block (such as rect2 or rect6) is obtained in the search range in accordance with the above steps, and then it is determined whether it is located in the current display area. And so on, until the base element block is found.

[0084] In order to better understand the element search method described in the embodiment of the present disclosure as a whole, the following will continue with Figure 3 For example, see Figure 3 , the middle element block found on its right is rect2. Since rect2 intersects with the current display area, it is used as the benchmark element block. Taking rect2 as the anchor point, traverse forward and backward. For example, if rect1 is in the current display area, continue traversing forward. If rect0 is not in the current display area, stop traversing. The backward traversal is similar, and the target element blocks rect1, rect3 and rect2 are obtained. Figure 7 Then, taking rect1 as an example, the corresponding cells 4-cell 6 are traversed in turn to determine whether they are in the current display area. Cell 4 and cell 5 intersect with the current display area, and they are determined to be displayable elements. Cell 6 does not intersect with the current display area, and it is determined that it is not a displayable element. Figure 7 As shown in the upper right. The processing of rect2 and rect3 is similar, so that the displayable elements cell4-cell11 are obtained, as shown in Figure 7As shown in the lower right. It should be emphasized that, assuming that cell5 is not in the current display area and cell6 is in the current display area, since here it is determined whether each cell in rect1 is in the current display area, there will be no problem of not continuing to determine cell6 because cell5 is not in the current display area, resulting in poor integrity of element search.

[0085] Figure 8 This is a structural block diagram of an element search device provided in an embodiment of the present disclosure, and the device is used to execute the element search method provided in any of the above embodiments. The device and the element search method of the above embodiments belong to the same concept. For details not described in detail in the embodiment of the element search device, refer to the embodiment of the above element search method. Figure 8 The device may specifically include: a target element block search module 510 and a displayable element search module 520.

[0086] The target element block search module 510 is used to respond to the element search instruction and search for a target element block located in the current display area from the constructed page element blocks, wherein the page element block corresponds to at least one page element and covers at least one page element in terms of spatial position;

[0087] The displayable element search module 520 is used to search for a displayable element that can be displayed in the current display area from at least one page element corresponding to each target element block.

[0088] Optionally, the page element blocks are sequentially arranged in the layout direction of the page elements, and the target element block search module 510 may include:

[0089] A reference element block search unit, used to search for a reference element block located in the current display area from each constructed page element block;

[0090] The target element block search unit is used to search for a target element block located in the current display area from the sequentially sorted page element blocks based on the reference element block.

[0091] On this basis, an optional page element block is pre-built through the following modules:

[0092] An element maximum value acquisition module is used to acquire the layout mode of the element to be laid out and the element maximum value of the element coordinates of the element to be laid out, wherein the element to be laid out is a page element to be laid out;

[0093] The page element block construction module is used to construct the page element block corresponding to the element to be laid out according to the layout mode and the element maximum value.

[0094] On this basis, optionally, the layout mode includes vertical layout or horizontal layout, the element maximum value is the maximum value of the element coordinate in the reverse direction perpendicular to the layout direction, and the page element block construction module may include:

[0095] A region size acquisition unit, used to acquire the region size of the current display region in the reverse direction;

[0096] The first page element block construction unit is used to construct a new page element block corresponding to the element to be laid out if the maximum value of the element is greater than the area size.

[0097] On this basis, optionally, the page element block building module can also include:

[0098] The second construction unit of the page element block is used to correspond the element to be laid out to the page element block currently in the construction state if the element maximum value is less than or equal to the area size, so as to construct a page element block corresponding to the element to be laid out.

[0099] Another optional layout method is waterfall layout. The maximum value of an element is the maximum value of the element coordinates in the layout direction. The page element block building module may include:

[0100] An element block maximum value obtaining unit, used to obtain the element block maximum value of the element block coordinates of the page element block currently in the construction state in the layout direction;

[0101] The third page element block construction unit is used to construct a new page element block corresponding to the element to be laid out if the element maximum value is greater than the element block maximum value.

[0102] Optionally, based on any of the above-mentioned element searching devices, the element block coordinate value of the page element block is a union of element coordinate values ​​of each page element corresponding to the page element block.

[0103] Alternatively, the target element block search unit may include:

[0104] An adjacent element block determining subunit is used to determine an adjacent element block adjacent to the reference element block from the sequentially arranged element blocks of each page, wherein the adjacent element block includes a previous element block or a next element block;

[0105] A reference element block updating subunit, used for updating an adjacent element block to a reference element block;

[0106] The target element block obtains a subunit for taking the reference element block as the target element block if the reference element block is located in the current display area, and repeatedly executing the step of determining adjacent element blocks adjacent to the reference element block from the sequentially arranged page element blocks.

[0107] On this basis, optionally, the target element block search unit may further include:

[0108] The intersection result obtaining subunit is used to determine whether the reference element block intersects with the current display area before the reference element block is located in the current display area, and obtain the intersection result;

[0109] The reference element block first judgment subunit is used to determine whether the reference element block is located in the current display area according to the intersection result.

[0110] Alternatively, the target element block search unit may further include:

[0111] a maximum value acquisition subunit, used for acquiring a first minimum value and a first maximum value of the element block coordinates of the reference element block in the layout direction, and a second minimum value and a second maximum value of the area coordinates of the current display area in the layout direction before the reference element block is located in the current display area;

[0112] The second determination subunit of the reference element block is used to determine whether the reference element block is located in the current display area according to whether the first minimum value is greater than the second maximum value, or whether the first maximum value is less than the second minimum value.

[0113] Alternatively, the reference element block search unit may include:

[0114] The first reference element block search subunit is used to take the page element block located in the middle of each page element block as the middle element block for each page element block that has been constructed and sorted in sequence, and if the middle element block is located in the current display area, take the middle element block as the reference element block;

[0115] The second reference element block search subunit is used to find the reference element block from within the search range, wherein one end of each page element block sequentially arranged in the search range is the middle element block, and the other end is the first or last page element block in each page element block.

[0116] Optionally, the display element search module 520 may include:

[0117] A corresponding element determination unit, used to take the page element corresponding to the target element block as the corresponding element;

[0118] The first displayable element search unit is used for, for each corresponding element, if the corresponding element intersects with the current display area, taking the corresponding element as a displayable element that can be displayed in the current display area.

[0119] Optionally, the element identifier of at least one page element corresponding to the target element block is stored in the target element block, and the display element search module 520 may include:

[0120] A page element determination unit, used to obtain an element identifier of at least one page element from the target element block, and determine the page element corresponding to each of the element identifiers of the at least one page element;

[0121] The second displayable element searching unit is used to search for displayable elements that can be displayed in the current display area from the page elements corresponding to the element identifiers of the at least one page element.

[0122] The element search device provided by the embodiment of the present disclosure responds to the element search instruction through the target element block search module, and searches for the target element block located in the current display area from the constructed page element blocks, wherein the page element block corresponds to at least one page element and covers the at least one page element in the spatial position, which means that the page element corresponding to the target element block is likely to be a displayable element that can be displayed in the current display area. Therefore, when searching for displayable elements subsequently, it is not necessary to traverse each page element, but only to search for the page elements corresponding to the limited target element blocks, thereby solving the problem of high time complexity caused by global traversal; further, considering that the page elements corresponding to the target element block may be disordered in the spatial position, in order not to miss any displayable elements, the displayable element search module traverses the page elements corresponding to the target element block to find the displayable elements, thereby solving the problem of not being able to find all the displayable elements. The above device achieves the effect of finding all the displayable elements based on low time complexity.

[0123] The element search device provided in the embodiments of the present disclosure can execute the element search method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0124] It is worth noting that in the embodiment of the above-mentioned element search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present disclosure.

[0125] Reference below Fig. 9 , which shows an electronic device (eg, Fig. 9The electronic device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), 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. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

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

[0127] Typically, the following devices may be connected to the I / O interface 605: an input device 606 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 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Fig. 9 6 shows an electronic device 600 having 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.

[0128] 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 non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0129] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, 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 wires, 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 the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In 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. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The 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 conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0130] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0131] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0132] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0133] In response to the element search instruction, a target element block located in the current display area is searched from each constructed page element block, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position;

[0134] For each target element block, a displayable element that can be displayed in the current display area is searched from at least one page element corresponding to the target element block.

[0135] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through 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., through the Internet using an Internet service provider).

[0136] 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 disclosure. 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 implementations as replacements, 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.

[0137] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the unit does not limit the unit itself in some cases. For example, the target element block search module may also be described as "a module that responds to an element search instruction and searches for a target element block located in the current display area from each constructed page element block, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position".

[0138] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0139] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0140] According to one or more embodiments of the present disclosure, [Example 1] provides an element search method, which may include:

[0141] In response to the element search instruction, a target element block located in the current display area is searched from each constructed page element block, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position;

[0142] For each target element block, a displayable element that can be displayed in the current display area is searched from at least one page element corresponding to the target element block.

[0143] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, wherein each page element block is sequentially sorted in the layout direction of each page element, and a target element block located in the current display area is found from each constructed page element block, which may include:

[0144] Find the reference element block located in the current display area from the constructed page element blocks;

[0145] Based on the reference element block, a target element block located in the current display area is found from the sequentially sorted page element blocks.

[0146] According to one or more embodiments of the present disclosure, [Example 3] provides the method of Example 2, where the page element block is pre-constructed by the following steps:

[0147] Obtaining a layout mode of an element to be laid out and an element maximum value of an element coordinate of the element to be laid out, wherein the element to be laid out is a page element to be laid out;

[0148] According to the layout mode and the maximum value of the element, a page element block corresponding to the element to be laid out is constructed.

[0149] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 3, wherein the layout mode includes vertical layout or horizontal layout, and the element maximum value is the maximum value of the element coordinate in the reverse direction perpendicular to the layout direction. Then, according to the layout mode and the element maximum value, constructing a page element block corresponding to the element to be laid out may include:

[0150] Get the area size of the current display area in the reverse direction;

[0151] If the maximum value of the element is greater than the area size, a new page element block corresponding to the element to be laid out is constructed.

[0152] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 4, and the above element search method may also include:

[0153] If the maximum value of the element is less than or equal to the area size, the element to be laid out is mapped to the page element block currently in the construction state, so as to construct a page element block corresponding to the element to be laid out.

[0154] According to one or more embodiments of the present disclosure, [Example 6] provides the method of Example 3, wherein the layout mode is a waterfall layout, the element maximum value is the maximum value of the element coordinates in the layout direction, and according to the layout mode and the element maximum value, constructing a page element block corresponding to the element to be laid out may include:

[0155] Get the maximum value of the element block coordinates of the page element block currently in the construction state in the layout direction;

[0156] If the maximum value of the element is greater than the maximum value of the element block, a new page element block corresponding to the element to be laid out is constructed.

[0157] According to one or more embodiments of the present disclosure, [Example 7] provides a method described in any one of Examples 1 to 6, wherein the element block coordinate value of the page element block includes the union of the element coordinate values ​​of each page element corresponding to the page element block.

[0158] According to one or more embodiments of the present disclosure, [Example 8] provides the method of Example 2, which searches for a target element block located in the current display area from the sequentially sorted page element blocks, and may include:

[0159] Determine an adjacent element block adjacent to the reference element block from the sequentially ordered page element blocks, wherein the adjacent element block includes a previous element block or a next element block;

[0160] Updating the adjacent element block to the benchmark element block;

[0161] If the reference element block is located in the current display area, the reference element block is used as the target element block, and the step of determining the adjacent element blocks adjacent to the reference element block from the sequentially arranged page element blocks is repeatedly performed.

[0162] According to one or more embodiments of the present disclosure, [Example 9] provides the method of Example 8. Before the reference element block is located in the current display area, the element search method may further include:

[0163] Determine whether the reference element block intersects with the current display area and obtain an intersection result;

[0164] Determine whether the reference element block is located in the current display area according to the intersection result.

[0165] According to one or more embodiments of the present disclosure, [Example 10] provides the method of Example 8. Before the reference element block is located in the current display area, the element search method may further include:

[0166] Acquire a first minimum value and a first maximum value of the element block coordinates of the reference element block in the layout direction, and a second minimum value and a second maximum value of the area coordinates of the current display area in the layout direction;

[0167] Whether the reference element block is located in the current display area is determined according to whether the first minimum value is greater than the second maximum value, or whether the first maximum value is less than the second minimum value.

[0168] According to one or more embodiments of the present disclosure, [Example 11] provides the method of Example 2, which may include: finding a reference element block located in the current display area from each constructed page element block;

[0169] For each page element block that has been constructed and arranged in sequence, the page element block located in the middle of each page element block is used as the middle element block. If the middle element block is located in the current display area, the middle element block is used as the reference element block.

[0170] Otherwise, a reference element block is found within the search range, wherein one end of each page element block sequentially arranged within the search range is a middle element block, and the other end is the first or last page element block among the page element blocks.

[0171] According to one or more embodiments of the present disclosure, [Example 12] provides the method of Example 1, which searches for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block, and may include:

[0172] The page element corresponding to the target element block is used as the corresponding element;

[0173] For each corresponding element, if the corresponding element intersects with the current display area, the corresponding element is taken as a displayable element that can be displayed in the current display area.

[0174] According to one or more embodiments of the present disclosure, [Example 13] provides the method of Example 1, wherein the element identifier of at least one page element corresponding to the target element block is stored in the target element block;

[0175] Searching for a displayable element that can be displayed in the current display area from at least one page element corresponding to the target element block may include:

[0176] Acquire an element identifier of at least one page element from the target element block, and determine the page element corresponding to each of the element identifiers of the at least one page element;

[0177] From the page elements corresponding to the element identifiers of at least one page element, a displayable element that can be displayed in the current display area is searched.

[0178] According to one or more embodiments of the present disclosure, [Example 14] provides an element search device, which may include:

[0179] A target element block search module is used to respond to the element search instruction and search for a target element block located in the current display area from the constructed page element blocks, wherein the page element block corresponds to at least one page element and covers at least one page element in spatial position;

[0180] The displayable element search module is used to search for a displayable element that can be displayed in the current display area from at least one page element corresponding to each target element block.

[0181] 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 disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

[0182] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0183] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A method for searching an element, characterized in that: include: In response to the element search instruction, a constructed page element block is obtained, wherein the page element block corresponds to at least one page element and covers the at least one page element in spatial position, and the page element blocks are arranged in sequence in the layout direction of each page element; If the middle element block located in the middle of the page element blocks is within the current display area, the middle element block is used as the reference element block; otherwise, the reference element block is found within a search range with the middle element block at one end and the first or last page element block at the other end; Based on the reference element block, searching for a target element block located in the current display area from the sequentially sorted page element blocks; For each of the target element blocks, a displayable element that can be displayed in the current display area is searched from the at least one page element corresponding to the target element block.

2. The method according to claim 1, characterized in that The page element block is pre-built through the following steps: Acquire a layout mode of an element to be laid out and an element maximum value of element coordinates of the element to be laid out, wherein the element to be laid out is the page element to be laid out; The page element block corresponding to the element to be laid out is constructed according to the layout mode and the element maximum value.

3. The method according to claim 2, characterized in that The layout mode includes vertical layout or horizontal layout, the element maximum value is the maximum value of the element coordinate in the reverse direction perpendicular to the layout direction, and constructing the page element block corresponding to the element to be laid out according to the layout mode and the element maximum value includes: Obtaining the area size of the current display area in the reverse direction; If the maximum value of the element is greater than the area size, a new page element block corresponding to the element to be laid out is constructed.

4. The method according to claim 3, characterized in that: Also includes: If the element maximum value is less than or equal to the area size, the element to be laid out is matched to the page element block currently in a construction state, so as to construct the page element block corresponding to the element to be laid out.

5. The method according to claim 2, characterized in that: The layout mode is a waterfall layout, the element maximum value is the maximum value of the element coordinates in the layout direction, and the page element block corresponding to the element to be laid out is constructed according to the layout mode and the element maximum value, including: Obtaining the maximum value of the element block coordinates of the page element block currently in the construction state in the layout direction; If the element maximum value is greater than the element block maximum value, a new page element block corresponding to the element to be laid out is constructed.

6. The method according to any one of claims 1 to 5, characterized in that: The element block coordinate value of the page element block is the union of the element coordinate values ​​of the page elements corresponding to the page element block.

7. The method according to claim 1, characterized in that The step of searching, based on the reference element block, for a target element block located in the current display area from the sequentially ordered page element blocks comprises: Determine an adjacent element block adjacent to the reference element block from the sequentially ordered page element blocks, wherein the adjacent element block includes a previous element block or a next element block; Updating the adjacent element block to the reference element block; If the reference element block is located in the current display area, the reference element block is used as the target element block, and the step of determining the adjacent element blocks adjacent to the reference element block from the sequentially arranged page element blocks is repeatedly performed.

8. The method according to claim 7, characterized in that Before the step of if the reference element block is located in the current display area, the method further includes: Determine whether the reference element block intersects with the current display area, and obtain an intersection result; It is determined according to the intersection result whether the reference element block is located in the current display area.

9. The method according to claim 7, characterized in that: Before the step of if the reference element block is located in the current display area, the method further includes: Acquire a first minimum value and a first maximum value of the element block coordinates of the reference element block in the layout direction, and a second minimum value and a second maximum value of the area coordinates of the current display area in the layout direction; Whether the reference element block is located in the current display area is determined according to whether the first minimum value is greater than the second maximum value, or whether the first maximum value is less than the second minimum value.

10. The method according to claim 1, characterized in that If the middle element block located in the middle position of the page element blocks is in the current display area, the middle element block is used as the reference element block; otherwise, the reference element block is found in a search range where one end is the middle element block and the other end is the first or last page element block, including: The page element block located in the middle of the page element blocks is used as the middle element block, and if the middle element block is located in the current display area, the middle element block is used as the reference element block; Otherwise, the reference element block is found within the search range, wherein one end of each of the page element blocks sequentially arranged within the search range is the middle element block, and the other end is the first or last page element block among the page element blocks.

11. The method according to claim 1, characterized in that: The searching for a displayable element that can be displayed in the current display area from the at least one page element corresponding to the target element block includes: Taking the page element corresponding to the target element block as the corresponding element; For each corresponding element, if the corresponding element intersects with the current display area, the corresponding element is used as a displayable element that can be displayed in the current display area.

12. The method according to claim 1, characterized in that The element identifier of the at least one page element corresponding to the target element block is stored in the target element block; The searching for a displayable element that can be displayed in the current display area from the at least one page element corresponding to the target element block includes: Acquire the element identifier of the at least one page element from the target element block, and determine the page element corresponding to each of the element identifiers of the at least one page element; From the page elements corresponding to the element identifiers of the at least one page element, displayable elements that can be displayed in the current display area are searched.

13. An element search device, characterized in that: include: a target element block search module, configured to search for a target element block located in the current display area from the constructed page element blocks in response to an element search instruction, wherein the page element block corresponds to at least one page element and covers the at least one page element in terms of spatial position; A displayable element search module, configured to search, for each target element block, for a displayable element that can be displayed in the current display area from the at least one page element corresponding to the target element block; The page element blocks are sequentially arranged in the layout direction of the page elements, and the target element block search module includes: a reference element block searching unit, configured to use the middle element block located in the middle of the constructed page element blocks as the reference element block if the middle element block is in the current display area; otherwise, to search for the reference element block within a search range having the middle element block at one end and the first or last page element block at the other end; The target element block searching unit is used to search for a target element block located in the current display area from the sequentially arranged page element blocks based on the reference element block.

14. An electronic device, characterized in that: include: one or more processors; A memory 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 implement the element search method as described in any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the element search method as described in any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • System, method and non-transitory computer-readable medium for selecting user interface element types for display with a search result according to item category features of prior item selections

    US11257144B1

  • Systems and methods for intelligent layered interactive derived programmatic elements for fixed content

    US20210294469A1