A search scrolling positioning method and system suitable for log virtual list scenarios
By grouping virtual lists and searching for array structures of tagged objects, the functions of search, highlighting and scrolling positioning in virtual lists are realized, solving the problem that search scrolling positioning cannot be achieved in the existing technology, and supporting positive order reverse order scrolling .
Patent Information
- Application Number
- CN202411441395.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-10-16
AI Technical Summary
Existing virtual list technology cannot search and highlight tags and scroll to the corresponding search result position, and cannot scroll in reverse order.
By grouping the virtual list logs and designing the corresponding search mark object array structure, the calculation layer obtains the grouping, line and character positions of the search hit object, and the rendering layer renders the corresponding partitions based on the grouping information to achieve rapid search scroll positioning , and supports positive reverse order scrolling.
It realizes searching and highlighting list elements that meet the conditions in the virtual list, and can directly scroll to the corresponding position, supporting positive reverse order scrolling, solving the problem that traditional virtual lists cannot obtain the location of elements outside the visual area.
Smart Images

Figure CN118963632B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a search scroll positioning method and system suitable for a log virtual list scenario. Background Art
[0002] Virtual list is a common solution used when the front end needs to display a huge amount of list data. This solution greatly improves the rendering efficiency and response speed of the list by only rendering the elements in the visible area and reducing the number of elements actually rendered on the page. However, because the list only renders the elements in the visible area, the virtual list cannot obtain the list position outside the visible area and scroll to the corresponding position, so it cannot realize the function of searching and scrolling to the corresponding position (abbreviated as: search scroll positioning).
[0003] Existing virtual list search technologies can often only achieve filtered display of search results, that is, only displaying search results that meet the conditions and hiding search results that do not meet the conditions, or only highlighting search results that meet the conditions, and cannot directly locate and scroll to the previous or next list element position that meets the search conditions; and existing virtual lists often cannot scroll in reverse order, that is, after loading is completed, the last page of data is directly rendered, and then all the data is gradually rendered by scrolling up.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present invention, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present invention is to solve the problem that the existing virtual list technology in the background technology cannot realize search and highlight marking and scroll positioning to the corresponding search result position. To this end, a search scroll positioning method and system suitable for log virtual list scenarios are provided.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] A search scroll positioning method applicable to a log virtual list scenario includes the following steps:
[0008] Step S1: The system loads log list data;
[0009] Step S2: split the log list data into groups and blocks according to the height of the visible area;
[0010] Step S3: After the splitting is completed, the last group block data is displayed;
[0011] Step S4: After the initial log rendering is completed, the system starts to monitor user operations and waits for user operation input;
[0012] Step S5: determining the user operation input type, which is divided into two types: search operation and positioning operation;
[0013] Step S6: When the user performs a search operation, the system performs log retrieval and matching according to the search characters, and groups the log search results into corresponding group block components and row components, and all row components highlight the log search result information;
[0014] Step S7: Calculate the search result highlight focus log position according to the current block group information, and obtain the corresponding row component information;
[0015] Step S8: According to the row component information, adjust the current display group to the group corresponding to the row component information, and perform log rendering within the group;
[0016] Step S9: After the log rendering is completed, the focus log position information is obtained and scrolled to the corresponding position, completing a scroll search positioning operation, and highlighting the current focus log.
[0017] The following is a technical solution further limited by the method in the present invention. When the user performs a positioning operation, it is used to locate and scroll to the previous or next focus log position, and determine whether there is a search result. If not, continue to wait for user operation input; if so, calculate the focus log position according to the log retrieval result data, obtain the corresponding row component information, and adjust the current display group to the group corresponding to the row component information according to the row component information, and perform log rendering within the group. After the log rendering is completed, obtain the focus log position information and scroll to the corresponding position to complete a scrolling search positioning operation.
[0018] The following is a technical solution further defined by the method in the present invention. The height of the visible area is dynamically adjusted by user customization. The log list data is divided into groups and blocks according to the height of the visible area. After the splitting is completed, the block group information is obtained, and the last group block data is displayed. At the same time, the logs in other groups are hidden. At this time, the default group height of the logs in the hidden group is used.
[0019] A search scroll positioning system suitable for a log virtual list scenario, used to implement the above-mentioned search scroll positioning method, comprising a rendering layer and a computing layer, wherein the rendering layer comprises a log search module and a log display module;
[0020] The computing layer groups and records the log list data after the system is initialized;
[0021] The log search module obtains the search data and passes it to the computing layer. When the computing layer receives the search data passed by the log search module, it performs character retrieval on the log group data and records the hit data to obtain the group mark data. After completing the search calculation, the computing layer returns the group mark data to the log display module.
[0022] The following is a technical solution further defined by the system in the present invention. The group mark data is an object array, and its format includes the group subscript, row subscript, and character position of the hit data.
[0023] The following is a technical solution further defined by the system in the present invention, in which characters in the search data are not case-sensitive.
[0024] The following is a technical solution further defined by the system in the present invention: the log display module includes a plurality of log grouping block components, and a log grouping block component includes a plurality of log line components.
[0025] The following is a technical solution further defined by the system in the present invention. After the log display module receives the data returned by the computing layer, it initiates a group positioning request and passes the current search hit object to the log group block component, thereby responding to the group positioning request and performing in-group rendering. After the rendering is completed, the position of the log display module where the object log line component is located is obtained, and it is scrolled to the corresponding position to complete a scrolling search positioning operation.
[0026] The following is a technical solution further defined by the system in the present invention, in which the search hit characters are highlighted and displayed in the log line component.
[0027] Compared with the prior art, the present invention has the following technical effects:
[0028] The present invention groups virtual list logs and designs a corresponding search mark object array structure, obtains and records the group, row, and character position of the search hit object at the calculation layer. When rendering, the corresponding partition is directly rendered according to the group information to solve the problem that the traditional virtual list cannot obtain the position of elements outside the visible area, realizes fast search scrolling positioning, and supports forward and reverse scrolling.
[0029] The present invention is further described below in conjunction with the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 It is a schematic flow chart of the method of the present invention;
[0032] Figure 2 is a system block diagram of the present invention;
[0033] Figure 3 , 4 , 5, and 6 are schematic diagrams of rendering user search results of the present invention;
[0034] Figure 7 , 8 It is a schematic diagram of the focus log position distribution for the scrolling positioning of the previous or next focus log position according to the present invention. DETAILED DESCRIPTION
[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.
[0036] Because the elements in the non-visible area of the virtual list are not actually rendered in the browsing page, the browsing search function cannot search for them and locate them to the corresponding position. At the same time, because the elements in the non-visible area are not actually rendered, the program cannot directly obtain their positions in the list, so it is impossible to perform scrolling and positioning search. Therefore, this embodiment provides a search scrolling and positioning method applicable to a log virtual list scenario and a search scrolling and positioning system applicable to a log virtual list scenario.
[0037] like Figure 1 As shown, a search scroll positioning method suitable for log virtual list scenarios, the main process includes:
[0038] 1. Initial rendering of log: achieving scrolling.
[0039] 1.1. After the system completes loading the log list data, it divides the log list data into groups and blocks to obtain log group data, such as Figure 3 The black window on the right needs to be explained. Figure 3 is a user search result rendering diagram, and the log grouping data is a process data, so only Figure 3 The black window on the right is for the convenience of technicians in the field to understand the process data. During the group splitting process, the system performs group splitting according to the height of the visible area, such as Figure 3The red box in the black window on the right (the red box is a marker and is not part of the rendering diagram) is a group of data. It should be noted that the height of the visible area can be dynamically adjusted by the user. For example, if the height of the visible area is 30 lines, then every 30 lines of logs are divided into a group; similarly, if the user adjusts the height of the visible area to 35 lines, then every 35 lines of logs are divided into a group, and so on.
[0040] 1.2. After the split is completed, the log is rendered for the first time, that is, the last group block data is displayed, that is, the log of the last screen is displayed, and the logs in other groups are hidden. At this time, the logs in the hidden groups also have the default group height. Therefore, the scrolling operation of the log list can be realized, and the logs are loaded according to the scrolling position, that is, the log virtual list, such as Figure 3 The white window on the lower left side needs to be explained. Figure 3 This is a user search result rendering diagram. The last group block data is not displayed at this time. Therefore, only Figure 3 The white window portion at the lower left side is for those skilled in the art to understand the log virtual list.
[0041] It should be noted that the above group splitting process is calculated and recorded at the calculation layer, and then passed to the log group block component and the log line component to form group block data (all group block data constitute block group information), and then the initial rendering is performed.
[0042] 2. Log search operation: realize log search scroll positioning.
[0043] 2.1. After the initial log rendering is completed, the system starts to monitor user operations and waits for user input. That is, the user can Figure 3 Click the search box on the right of the build on the left to search.
[0044] 2.2. When the user performs a search operation, the system retrieves and matches logs based on the search characters, such as Figure 3 As shown in FIG. 1 , the search data ma is obtained. The search data may contain multiple characters, such as m and a. Since characters are not case-sensitive, MA is also a search hit object. In the retrieval process, character retrieval is performed in the log grouping data in step 1.1 above to find the user's search results, i.e., the hit object. At this time, the log grouping data after retrieval is the log retrieval data, as shown in FIG. Figure 3 The black window on the right needs to be explained. Figure 3 is a user search result rendering diagram, and the log retrieval data is a process data, so only Figure 3The black window on the right is for the convenience of those skilled in the art to understand the process data. Figure 3 The red box in the black window on the right is marked with a triangle block), the row mark (such as Figure 4 The black window on the right is expanded with data-pos="", corresponding to Figure 4 The position indicated by the mark 1 in the column indicates the line position subscript), the character position mark (such as Figure 4 The black window on the right is expanded search-f, corresponding to Figure 4 The position indicated by the tag 2 in the figure indicates the search hit highlight tag or search-f light-tag, corresponding to Figure 4 The position indicated by the mark 3 in the figure indicates the current highlight mark). At this time, the matched log retrieval data is the log search result data (or log search result information), such as Figure 3 The black window on the right. It should be noted that the retrieval and matching processes are all processed in the computing layer.
[0045] 2.3. Group the log search results and send them to the corresponding group block components and row components. All row components highlight the log search result information. At this time, the log display module only performs group marking and does not render. Figure 4 The yellow search hit highlight on the left corresponds to Figure 4 The position indicated by the mark 4 in FIG. It should be noted that Figure 4 is a schematic diagram of user search result rendering, and the unrendered grouping mark is a procedural mark, which is only marked inside the row component. Figure 4 The yellow search hit highlight mark on the left is to facilitate the understanding of the non-rendered highlight mark by those skilled in the art.
[0046] 2.4. Since the user can customize the dynamic adjustment of the visible area height, when the visible area height changes, the calculation layer needs to re-calculate steps 1 and 2, that is, the block group information will change.
[0047] For example, before the visible area height is adjusted, the visible area height is 30 lines and has 40 groups, that is, there are 1,200 log lines; after the visible area height is adjusted, the visible area height is 40 lines and has 30 groups. Therefore, the log search result data calculated by the calculation layer will change. The hit object originally in the 9th group may be adjusted to the 8th group. Therefore, the block group information will change.
[0048] 2.5. If the height of the visible area is not adjusted, the log display module can directly adjust the display group according to the log search results that have been highlighted but not rendered in step 2.3. Therefore, the character position (the position of the highlighted focus log in the search result), the line (the corresponding line component information), and the group (the group corresponding to the line component information) are known; adjust the current display group to the group corresponding to the line component information, and render the logs in the group, such as Figure 5 As shown, the yellow box is the unrendered log group, corresponding to Figure 5 The locations indicated by markers 7.1, 7.2, 7.3, and 7.4 in the figure; the red box is the log group in the rendering, corresponding to Figure 5 The positions indicated by the marks 6.1 and 6.2 in FIG. It should be noted that the yellow and red frames are for marking purposes only and are not part of the rendering diagram.
[0049] 2.6. If the height of the visible area is adjusted, the calculation layer needs to recalculate the search result highlight focus log position, obtain the corresponding row component information, and adjust the current display group to the group corresponding to the row component information.
[0050] Combining steps 2.5 and 2.6, we need to consider the real-time dynamic adjustment of the height of the visible area, that is, to consider the current block group information. It should be noted that the current block group information refers to the real-time dynamic information of the block group information. Therefore, the integrated expression of steps 2.5 and 2.6 is: according to the current block group information, the search result highlighting focus log position is calculated, and the corresponding row component information is obtained; according to the row component information, the log display module adjusts the current display group to the group corresponding to the row component information, and performs log rendering within the group.
[0051] 2.7. After the group logs are rendered, obtain the focus log location information and scroll to the corresponding location to complete a scroll search and positioning operation, and highlight the current focus log (i.e. the current hit object), such as Figure 4 The current highlight mark in red on the left corresponds to Figure 4 The position indicated by mark 5 in FIG.
[0052] 3. Log positioning operation: realize scrolling positioning of the previous or next search result.
[0053] When the user performs a positioning operation, it is used to position and scroll to the previous or next focus log position (i.e. the hit object position). The user can Figure 3 The downward click box on the right side of the build on the left side corresponds to Figure 3 Click the position indicated by the mark 9 in the figure or click the box upwards to perform a click operation, corresponding to Figure 3The position indicated by mark 8 in . First, the system determines whether there is a search result. If not, it continues to wait for user input. If it does, it calculates the focus log position based on the log retrieval result data (without considering the current block group information), obtains the corresponding row component information, and adjusts the current display group to the group corresponding to the row component information based on the row component information, and performs log rendering within the group. After the log rendering is completed, the focus log position information is obtained and scrolled to the corresponding position to complete a scrolling search positioning operation. It should be noted that the calculation process is performed at the calculation layer, and in this calculation process, positioning is only performed based on the log retrieval result data, without distinguishing between the group and the row.
[0054] like Figure 6 As shown, when you click Next, the corresponding group is rendered and scrolled to the corresponding position: If it is in the previous rendering group A (corresponding to Figure 6 When the next click is made at the last focus log position of the Render Group B (corresponding to Figure 6 ), scroll to the first focus log position of render group B, and release the previous render group A. It should be noted that the yellow and red boxes are for marking purposes only and are not part of the rendering diagram.
[0055] exist Figure 7 In the scenario shown, the previous and next focus log positions are in different rows of the same group. Therefore, when the next click is performed, the rendering group remains unchanged and the current focus log moves to the next row.
[0056] exist Figure 8 In the scenario shown, the previous and next items of the focus log position are in the same group and in the same row. Therefore, when the next click is made, the rendering group remains unchanged, and the current focus log may still be in the same row or may scroll to the next row.
[0057] like Figure 2 As shown, a search scroll positioning system suitable for log virtual list scenarios is divided into a rendering layer and a computing layer, and the rendering layer is divided into a log search module and a log display module. The log display module includes multiple log grouping block components, and a log grouping block component includes multiple log line components.
[0058] The computing layer groups and records the log list data after the system is initialized.
[0059] The log search module obtains the search data (including multiple characters, and the characters are not case-sensitive) and passes it to the computing layer. When the computing layer receives the search data passed by the log search module, it performs character retrieval on the log group data and records the group subscript, row subscript, and character position of the hit data, thereby obtaining the group mark data, as shown below:
[0060] The grouping mark data is an object array in the following format: [
[0062] Hit object A{
[0063] The subscript of the group,
[0064] The row subscript,
[0065] The character position,
[0066] }
[0067] Hit object B{
[0068] The subscript of the group,
[0069] The row subscript,
[0070] The character position,
[0071] }
[0072] … ]
[0074] After completing the search calculation, the calculation layer returns the grouped tag data (i.e., the search result object array) to the rendering layer log display module.
[0075] After receiving the data returned by the computing layer, the log display module initiates a group positioning request and passes the current search hit object to the log group block component, thereby responding to the group positioning request and performing group rendering. After the rendering is completed, the position of the log display module where the object log line component is located is obtained, and it is scrolled to the corresponding position to complete a scroll search positioning operation. In the log line component, the search hit characters are highlighted and displayed.
[0076] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Any technician familiar with the art can make many possible changes and modifications to the technical solution of the present invention by using the above disclosed methods and technical contents without departing from the scope of the technical solution of the present invention, or modify it into an equivalent embodiment of equivalent changes. Therefore, all equivalent changes made according to the shape, structure and principle of the present invention without departing from the content of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A search and scroll positioning method suitable for a log virtual list scenario, characterized in that: The following steps are involved: Step S1: The system loads log list data; Step S2: The log list data is divided into groups and blocks according to the height of the visible area. The grouping and splitting process is to perform calculation processing and record at the calculation layer, and then pass it to the log grouping block component and the log line component to form grouped block data. All grouped block data constitute block group information; Step S3: After the splitting is completed, the last group block data is displayed; Step S4: After the initial log rendering is completed, the system starts to monitor user operations and waits for user operation input; Step S5: judging the user operation input type, which is divided into two types: search operation and positioning operation. When the user operation input type is a search operation, jumping to steps S6-S9; when the user operation input type is a positioning operation, jumping to step S10; Step S6: When the user performs a search operation, the system performs log retrieval and matching according to the search characters, and groups the log search results into corresponding group block components and row components, and all row components highlight the log search result information; Step S7: Calculate the search result highlight focus log position according to the current block group information, and obtain the corresponding row component information, wherein the current block group information refers to: real-time dynamic information of the block group information; Step S8: According to the row component information, adjust the current display group to the group corresponding to the row component information, and perform log rendering within the group; Step S9: After the log rendering is completed, the focus log position information is obtained and scrolled to the corresponding position, completing a scroll search positioning operation, and highlighting the current focus log; Step S10: When the user performs a positioning operation, it is used to locate and scroll to the previous or next focus log position, and determine whether there is a search result. If not, continue to wait for user input; if so, calculate the focus log position based on the log retrieval result data, obtain the corresponding row component information, and adjust the current display group to the group corresponding to the row component information based on the row component information, and perform log rendering within the group. After the log rendering is completed, obtain the focus log position information and scroll to the corresponding position to complete a scrolling search positioning operation.
2. A search scroll positioning method applicable to a log virtual list scenario as claimed in claim 1, characterized in that: The height of the visible area is dynamically adjusted by the user. The log list data is divided into groups and blocks according to the height of the visible area. After the division is completed, the block group information is obtained, and the last group block data is displayed. At the same time, the logs in other groups are hidden. At this time, the logs of the hidden groups have the default group height.
3. A search scroll positioning system suitable for a log virtual list scenario, used to implement the search scroll positioning method according to claim 1 or 2, characterized in that: It includes a rendering layer and a computing layer, wherein the rendering layer includes a log search module and a log display module; The computing layer groups and records the log list data after the system is initialized; The log search module obtains the search data and passes it to the computing layer. When the computing layer receives the search data passed by the log search module, it performs character retrieval on the log group data and records the hit data to obtain the group mark data. After completing the search calculation, the computing layer returns the group mark data to the log display module.
4. A search scroll positioning system suitable for a log virtual list scenario as claimed in claim 3, characterized in that: The group mark data is an object array, and its format includes the group subscript, row subscript, and character position of the hit data.
5. A search scroll positioning system suitable for a log virtual list scenario as claimed in claim 3, characterized in that: The characters in the search data are not case sensitive.
6. A search scroll positioning system suitable for a log virtual list scenario as claimed in claim 3, characterized in that: The log display module includes multiple log grouping block components, and one log grouping block component includes multiple log line components.
7. A search scroll positioning system suitable for a log virtual list scenario as claimed in claim 6, characterized in that: After receiving the data returned by the computing layer, the log display module initiates a group positioning request and passes the current search hit object to the log group block component, thereby responding to the group positioning request and performing in-group rendering. After the rendering is completed, the position of the log display module where the object log line component is located is obtained, and it is scrolled to the corresponding position to complete a scrolling search positioning operation.
8. A search scroll positioning system suitable for a log virtual list scenario as claimed in claim 7, characterized in that: In the log line component, the search hit characters are highlighted and displayed.
Citation Information
Patent Citations
Data scrolling method and device based on virtual list and computer equipment
CN115421691A
Log preview optimization method and system under large data volume scene
CN117076803A
Generation method and device for improving big data processing capability of cascade selector
CN117827060A