A method, apparatus, device, medium and product for refreshing an outline view

CN123011923APending Publication Date: 2026-10-30WUHAN DAMENG DATABASE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611162306.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本发明提供了一种大纲视图的刷新方法、装置、设备、介质和产品,以解决在更新大纲视图时,主线程负载集中,界面卡顿或闪烁的技术问题

Benefits of technology

[0009]根据本发明的另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使处理器执行时实现本发明任一实施例所述的方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123011923A_ABST
    Figure CN123011923A_ABST
Patent Text Reader

Abstract

The application discloses a kind of outline view refreshing method, device, equipment, medium and product, it is related to computer technical field, method includes: extracting from full node information and outline data paired node data;For each group paired node data, when there is attribute difference in paired node data first node data and second node data, the attribute of second node data in paired node data is updated as the attribute of first node data in paired node data, when there is visual data difference in paired node data first node data and second node data, second node data in paired node data is added to the node set to be updated;Based on remaining node data, update outline data, and add remaining node data to the node set to be updated;Based on the node set to be updated, the refresh of outline view is executed.The problem that main thread load is concentrated, interface is stuck or flickers is solved.The refreshing method is also applicable to the SQL outline of database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, medium, and product for refreshing an outline view. Background Technology

[0002] Outline view, as a structured navigation view, displays the file structure in a tree-like hierarchical list, helping users quickly locate and jump to nodes such as headings, classes, functions, or data tables within the file.

[0003] In existing outline view refresh methods, after receiving all node information, the display module usually triggers a refresh operation immediately upon detecting any difference, or directly updates the entire outline view.

[0004] However, when there are a large number of file nodes and users edit frequently, even if only a small amount of content in the full node information changes, the refresh operation will be executed multiple times in a short period of time, causing the main thread to be overloaded and resulting in interface lag or flickering. Summary of the Invention

[0005] This invention provides a method, apparatus, device, medium, and product for refreshing an outline view, in order to solve the technical problem of concentrated main thread load and interface lag or flickering when updating the outline view.

[0006] According to one aspect of the present invention, a method for refreshing an outline view is provided, comprising: Obtain all node information of the outline view and outline data maintained for the file. The outline view is used to display the structure of the file in a tree-like hierarchy. The all node information includes multiple first node data arranged in an ordered manner after parsing the file. The outline data includes multiple second node data arranged in an ordered manner. Multiple sets of paired node data are extracted sequentially from the full node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position. For each pair of node data, if there is an attribute difference between the first node data and the second node data in the pair of node data, the attribute of the second node data in the pair of node data is updated to the attribute of the first node data in the pair of node data. If there is a visual data difference between the first node data and the second node data in the pair of node data, the second node data in the pair of node data is added to the node set to be updated. The visual data includes the node data displayed on the outline view interface. Based on the full node information and the remaining node data in the outline data, the outline data is updated, and the remaining node data is added to the set of nodes to be updated. The remaining nodes include the full node information and the node data in the outline data that have not formed the paired node data. Based on the set of nodes to be updated, the outline view is refreshed.

[0007] According to another aspect of the present invention, a refresh device for an outline view is provided, comprising: The acquisition module acquires the full node information of the outline view and the outline data maintained for the file. The outline view is used to display the structure of the file in a tree-like hierarchy. The full node information includes multiple first node data arranged in an ordered manner after parsing the file, and the outline data includes multiple second node data arranged in an ordered manner. The extraction module extracts multiple sets of paired node data sequentially from the full set of node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position. The update module, for each set of paired node data, updates the attributes of the second node data in the paired node data to the attributes of the first node data in the paired node data if there are attribute differences between the first node data and the second node data in the paired node data; and adds the second node data in the paired node data to the set of nodes to be updated if there are visual data differences between the first node data and the second node data in the paired node data. The visual data includes node data displayed on the outline view interface. The module adds nodes to the set of nodes to be updated based on the full node information and the remaining node data in the outline data. The remaining nodes include the full node information and the node data in the outline data that have not formed the paired node data. The refresh module refreshes the outline view based on the set of nodes to be updated.

[0008] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method described in any embodiment of the present invention.

[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the method described in any embodiment of the present invention.

[0010] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the method described in any embodiment of the present invention.

[0011] The outline view refresh method provided in this invention compares the extracted node data (which consists of all node information and the outline data maintained for the file, sorted in the same order) with each other. When attribute differences exist, the outline data is updated; when visual data differences exist, the node is added to the set of nodes to be updated; and a refresh is performed based on this set. This invention filters nodes by adding those with visual data differences to the set of nodes to be updated, and then performs a refresh based on this set. This reduces the amount of data used during refresh, solving the technical problem of concentrated main thread load and interface lag or flickering caused by overall outline view refresh. It achieves the technical effects of reducing refresh frequency, alleviating main thread burden, and avoiding interface lag or flickering.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a flowchart of a method for refreshing an outline view provided in an embodiment of the present invention.

[0015] Figure 2 This is a flowchart of another method for refreshing an outline view provided by an embodiment of the present invention.

[0016] Figure 3 This is a flowchart of the comparison module in an outline view refresh method provided in an embodiment of the present invention.

[0017] Figure 4 This is a flowchart of the refresh module in an outline view refresh method provided in an embodiment of the present invention.

[0018] Figure 5 This is a schematic diagram of the structure of an outline view refresh device provided in an embodiment of the present invention.

[0019] Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0022] Outline view is a structured navigation view that displays the structure of the current document in a tree-like hierarchical list. For example, headings in document types like Word or Markdown, classes or functions in code files like Java or Python, and table / column / schema names in SQL scripts can all serve as nodes in the outline view. Through the outline view, users can quickly locate the desired nodes and navigate to them for editing.

[0023] The outline view is updated in real time; each user edit triggers a refresh. During the outline view update process, the parsing module analyzes the document content, extracts content fragments that can serve as outline nodes, and ultimately generates outline nodes organized in a tree structure. Each node stores attributes such as its name, type, and the location of its corresponding content fragment. The display module needs to compare the full set of node information processed by the parsing module with the currently maintained outline data and decide whether to refresh the interface accordingly. In existing technologies, after receiving the full set of node information, the display module typically triggers a refresh operation immediately upon detecting any discrepancies, or directly updates the entire outline view without further processing the comparison results. When the number of nodes is large and the parsing results change frequently (e.g., due to user manual editing), even if only a small amount of content in the full set of node information changes, it can lead to multiple refresh operations executed in a short period, concentrating the load on the main thread and potentially causing interface lag or flickering. Therefore, a method is needed that refines the comparison results and schedules and controls the refresh operations while maintaining the input method for the full set of node information.

[0024] In one embodiment, Figure 1 This is a flowchart of a method for refreshing an outline view according to an embodiment of the present invention. This embodiment is applicable to outline view refreshing scenarios. The method can be executed by an outline view refreshing device, which can be implemented in hardware and / or software and can be configured in an electronic device (such as a computer, server, etc.). Figure 1 As shown, the method includes: S110. Obtain all node information of the outline view and the outline data maintained for the file.

[0025] The outline view is used to display the structure of the file in a tree-like hierarchy. The full node information includes multiple first node data arranged in an ordered manner after parsing the file, and the outline data includes multiple second node data arranged in an ordered manner.

[0026] An outline view is a navigation interface element that displays the document structure in a tree-like hierarchical list. This view reflects the hierarchical structure and logical relationships of the document's content by organizing structural units into nodes. Structural units include headings at various levels, class definitions, function definitions, and one or more data tables, allowing users to quickly locate, browse, and jump to specific content locations within the document.

[0027] The full node information can be a dataset obtained by parsing the entire current content of the file, containing all extracted node attributes. This dataset is presented as a series of ordered first node data. Each first node data corresponds to a structural unit in the file and originates from the latest data obtained after re-parsing the file at the current moment, representing the latest state of the file structure. Its attributes may include the node's name, type, and the location of the corresponding content segment. In this embodiment, the full node information can be denoted as Q_new.

[0028] Outline data can be a set of data maintained for a file to characterize the current state of the outline view. This set of data is presented as multiple ordered second-node data, which can be a structural unit in the corresponding file. The second-node data originates from the outline data maintained before the refresh and represents the old state currently displayed on the interface. In this embodiment, the outline data can be denoted as Q_old.

[0029] In this invention, the full node information of the outline view can be obtained by parsing the file, and the outline view can be obtained from the data maintained locally for the file.

[0030] By acquiring the full node information of the outline view and the outline data maintained for the file, where the full node information represents the latest structural state of the file and the outline data represents the old state currently displayed on the interface, two versions of data are provided as a basis for the subsequent extraction and comparison of node data with the same sorting position.

[0031] S120. Extract multiple sets of paired node data sequentially from the full node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position.

[0032] The sorting position can be the location of node data within the tree hierarchy. Node data can include first node data and second node data. The first node data can be its position within the full node information. The second node data can be its position within the outline data. The same sorting position means that the first and second node data have the same sort order number in both the full node information and the outline data. Since both the full node information and the outline data are arranged in a tree hierarchy traversal order, node data with the same sorting position correspond to the same relative position in the file structure, and therefore can be compared pairwise as newer and older versions of the same node.

[0033] Starting from the first first node data of the full node information and the first second node data of the outline data, according to the sorting order, a group of first node data and second node data in the same sorting position are obtained one by one to form a pair of node data. Then the next group is obtained, until all the node data of one dataset is extracted.

[0034] In this embodiment, by sequentially extracting the first node data and the second node data with the same sorting position from the full node information and the outline data as paired node data, a corresponding relationship is established between the nodes in the same sorting position in the two sets of data, so that the attributes can be compared pairwise in the order of arrangement.

[0035] S130. For each set of paired node data, if there is an attribute difference between the first node data and the second node data in the paired node data, update the attribute of the second node data in the paired node data to the attribute of the first node data in the paired node data. If there is a visual data difference between the first node data and the second node data in the paired node data, add the second node data in the paired node data to the set of nodes to be updated.

[0036] The visual data includes node data displayed on the outline view interface.

[0037] Visual data can include user-visible information such as node descriptors and types displayed on the interface.

[0038] The set of nodes to be updated can be a collection used to store node data that needs to be refreshed in the outline view interface. When there are visual differences in a pair of node data, the second node data in the pair is added to the set of nodes to be updated to indicate that the content displayed by that node in the outline view interface needs to be refreshed. In this embodiment, the set of nodes to be updated can be denoted as Q_upd.

[0039] When there are attribute differences between the first node data and the second node data, the value of the corresponding attribute in the second node data is modified to match the value of the same attribute in the first node data, so that the second node data is consistent with the first node data at the attribute level.

[0040] In this embodiment, by judging the paired node data, the attributes of the second node data are updated when there are attribute differences, so that the outline data and the full node information are consistent at the attribute level, and accurate historical data is prepared for the next round of refresh. At the same time, when there are visible data differences, the second node data is added to the set of nodes to be updated, and invisible data differences do not trigger refresh, thereby avoiding unnecessary refresh operations caused by changes in invisible data.

[0041] S140. Based on the full node information and the remaining node data in the outline data, update the outline data and add the remaining node data to the set of nodes to be updated.

[0042] The remaining nodes include the full node information and the node data in the outline data that did not form the paired node data.

[0043] The remaining node data can be the node data in the full node information and outline data that did not participate in forming paired node data. Specifically, after all the node data in the full node information and outline data that are in the same sorting position have been extracted, if the number of node data in the two datasets is different, then the node data that was not extracted in one dataset is the remaining node data.

[0044] In this embodiment, the remaining node data after the paired node data is extracted is processed to ensure that the outline data is consistent with the full node information. At the same time, the nodes to be added and the nodes to be deleted are added to the set of nodes to be updated, so that all structural changes caused by the inconsistency in the number of nodes are also included in the subsequent refresh process, ensuring that the changes in the file structure are fully reflected in the outline view interface.

[0045] In one embodiment, updating the outline data based on the full node information and the remaining node data in the outline data, and adding the remaining node data to the set of nodes to be updated, includes: If the remaining node data is the remaining node data in the full node data, the remaining node data is added to the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a second tag information is added to the remaining node data. The second tag information is used to mark the remaining node data as node data to be added to the outline view interface.

[0046] The second marker information can be used to identify remaining node data as nodes to be added. During subsequent refresh processes, this information enables the refresh module to recognize that the operation type corresponding to the node data is "add," meaning that the corresponding node element needs to be added to the appropriate position in the outline view interface. In this embodiment, the second marker information can be denoted as "add."

[0047] If the remaining node data is the same as the remaining node data in the full node information, then this remaining node data is added as a new entry to the outline data. Since there is no corresponding second node data for this remaining node data in the outline data, it indicates that this node is a newly added structural unit in the file. Therefore, it needs to be added to the outline data to fill in the originally missing node data, thereby maintaining consistency with the full node information at the data level.

[0048] Furthermore, this node is not yet displayed in the current outline view, so it needs to be added to the set of nodes to be updated. Adding the remaining node data to the end of the set of nodes to be updated means appending the remaining node data after the existing node data in the set of nodes to be updated, so that they are arranged in the order of appending.

[0049] In this embodiment, when the remaining node data is the remaining node data in the full node information, on the one hand, the remaining node data is added to the outline data to supplement the originally missing node data, thereby maintaining consistency with the full node information at the data level and preparing complete outline data for the next round of refresh; on the other hand, the remaining node data is added to the end of the node set to be updated and marked as to be added, so that the newly added structural units in the file can be included in the refresh range in the same order as the existing nodes, ensuring that the newly added nodes are correctly displayed in the outline view interface, while maintaining an orderly processing flow.

[0050] In one embodiment, updating the outline data based on the full node information and the remaining node data in the outline data, and adding the remaining node data to the set of nodes to be updated, includes: If the remaining node data is the remaining node data in the outline data, delete the remaining node data from the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a third tag information is added to the remaining node data. The third tag information is used to mark the remaining node data as node data deleted from the outline view nodes.

[0051] The third marker information can be information that identifies node data as a node to be deleted. During subsequent refresh processes, this information enables the refresh module to know that the operation type corresponding to the node data is deletion, meaning that the corresponding node element needs to be removed from the outline view interface. In this embodiment, the third marker information can be denoted as del.

[0052] If there are still unextracted second node data in the outline data, it means that there is no corresponding first node data for that node in the full node information, i.e., the structural unit no longer exists in the file structure. The second node data can be removed from the outline data to ensure consistency between the outline data and the current actual structure of the file. Furthermore, if the node is still displayed in the current outline view, it can be added to the set of nodes to be updated, and the corresponding view element can be removed from the interface.

[0053] In this embodiment, when the remaining node data is the remaining node data in the outline data, the remaining node data is deleted from the outline data to ensure that the outline data is consistent with the current actual structure of the file. At the same time, the remaining node data is added to the end of the set of nodes to be updated and a third marker is added, so that the node to be deleted can enter the subsequent refresh process together with the node to be updated added in the previous steps, and can be accurately identified as the node to be deleted in the subsequent refresh through the third marker information. This ensures that the structural units that have been removed from the file can be correctly removed from the outline view interface, and avoids the appearance of nodes that no longer exist in the interface.

[0054] S150. Based on the set of nodes to be updated, refresh the outline view.

[0055] Based on the data of each node in the set of nodes to be updated and their corresponding tag information, perform the corresponding interface update operation on the outline view interface to ensure that the content displayed on the outline view interface is consistent with the current structural state of the file.

[0056] In one embodiment, refreshing the outline view based on the set of nodes to be updated includes: The process involves iteratively retrieving at least one node's data from the set of nodes to be updated; Each time the node data is acquired, it is packaged into a refresh task, and the refresh task is added to the task queue; Execute the refresh task in the task queue.

[0057] A refresh task can be an executable task unit that contains at least one node data to be updated and its corresponding tagging information.

[0058] A task queue can be a data structure for storing and managing refresh tasks. Specifically, the task queue arranges refresh tasks in a first-in, first-out (FIFO) order. After a refresh task is added to the task queue, it is arranged in the queue according to the order of addition, waiting to be executed. In this embodiment, the task queue can be denoted as Q_task.

[0059] Each time, at least one node data is retrieved from the set of nodes to be updated, and then the next retrieval operation is initiated, continuing to retrieve the next batch of node data from the set of nodes to be updated, until all node data in the set of nodes to be updated has been retrieved.

[0060] Packaging each acquired node data into a refresh task can be done by packaging the node data and its tagging information into a task unit, which can then be added to the task queue.

[0061] In this embodiment, at least one node data is obtained from the set of nodes to be updated in a loop. Each obtained node data is packaged into a refresh task and added to the task queue. This allows all node data in the set of nodes to be updated to be converted into multiple refresh tasks in batches, and managed and scheduled in a unified manner in the form of tasks. At the same time, by executing the refresh tasks in the task queue, each refresh task is executed sequentially according to the order of the task queue. This avoids processing all nodes to be updated at once, which would cause the main thread to be overloaded, thereby reducing the burden of a single refresh operation and reducing the risk of interface lag or flickering.

[0062] The outline view refresh method provided in this invention compares the extracted node data (which consists of all node information and the outline data maintained for the file, sorted in the same order) with each other. When attribute differences exist, the outline data is updated; when visual data differences exist, the node is added to the set of nodes to be updated; and a refresh is performed based on this set. This invention filters nodes by adding those with visual data differences to the set of nodes to be updated, and then performs a refresh based on this set. This reduces the amount of data used during refresh, solving the technical problem of concentrated main thread load and interface lag or flickering caused by overall outline view refresh. It achieves the technical effects of reducing refresh frequency, alleviating main thread burden, and avoiding interface lag or flickering.

[0063] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0064] In one embodiment, for each set of paired node data, when there is an attribute difference between the first node data and the second node data in the paired node data, updating the attribute of the second node data in the paired node data to the attribute of the first node data in the paired node data includes: For each pair of node data, compare whether the attributes of the first node data and the attributes of the second node data in the pair of node data are the same; If so, process the paired node data as described below; If not, update the attributes of the second node data within the paired node data to the attributes of the first node data within the paired node data.

[0065] Each attribute field in a node is validated item by item. If the value of any attribute is different, the two sets of nodes are considered to be different. Only when all attribute values ​​of the two sets of nodes are completely identical are they considered to be the same, and the process jumps directly to the next set of paired node data.

[0066] In this embodiment, by verifying all attributes of each pair of node data item by item, the data is determined to be identical only when all attribute values ​​are exactly the same and the update is skipped. If any attribute value is different, the data is determined to be different and the second node data is updated, thus ensuring that the outline data can maintain complete consistency with the full amount of node information at the data level.

[0067] In one embodiment, Figure 2 This is a flowchart of another outline view refresh method provided by an embodiment of the present invention. This embodiment is a further refinement of the above embodiments. Figure 2 As shown, the method includes: S210. Obtain all node information of the outline view and the outline data maintained for the file.

[0068] The outline view is used to display the structure of the file in a tree-like hierarchy. The full node information includes multiple first node data arranged in an ordered manner after parsing the file, and the outline data includes multiple second node data arranged in an ordered manner.

[0069] By acquiring the full node information of the outline view and the outline data maintained for the document, two versions of data foundation are provided for the subsequent extraction and comparison of paired node data.

[0070] S220. Extract multiple sets of paired node data sequentially from the full node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position.

[0071] By extracting the first and second node data with the same sorting position from the full node information and outline data in sequence as paired node data, a corresponding relationship is established between nodes in the same sorting position in the two sets of data, so that attribute comparison can be performed pairwise in the order of arrangement.

[0072] S230. For each pair of node data, if there is an attribute difference between the first node data and the second node data in the pair of node data, update the attribute of the second node data in the pair of node data to the attribute of the first node data in the pair of node data.

[0073] The visual data includes node data displayed on the outline view interface.

[0074] By updating the attributes of the second node data when there are attribute differences between paired node data, the outline data can be updated synchronously with all node information during the comparison process, preparing accurate historical data for the next round of refresh. At the same time, when there are visible data differences, the second node data is added to the set of nodes to be updated, so that visible data differences that only involve the interface display are included in the refresh scope, avoiding unnecessary refresh operations caused by changes in invisible data.

[0075] S240. For each set of paired node data, determine the difference type of the paired node data. If the difference type indicates that there is a visible difference between the first node data and the second node data in the paired node data, add the second node data in the paired node data to the set of nodes to be updated and add the corresponding first tag information.

[0076] The first tagging information is used to mark the corresponding node data as updated node data.

[0077] The first marker information can be information that identifies node data as a node to be updated. During subsequent refresh processes, this information enables the refresh module to know that the operation type corresponding to the node data is update, meaning that the elements of the corresponding node need to be refreshed in the outline view interface. In this embodiment, the first marker information can be denoted as upd.

[0078] By determining the difference type for each pair of node data, and adding the second node data to the set of nodes to be updated and adding the first marker information when there are visible data differences, the visible data differences that only involve the interface display are included in the refresh scope, avoiding unnecessary refresh operations caused by changes in invisible data. At the same time, different operation types are distinguished by the marker information, so that the subsequent refresh process can accurately identify the operation type of the node to be updated.

[0079] In one embodiment, after determining the difference type of the paired node data, the method further includes: If the difference type indicates that there is no visible difference between the first node data and the second node data in the paired node data, then process the next pair of node data.

[0080] By skipping pairs of nodes that do not have visible data differences after determining the difference type, and not adding them to the set of nodes to be updated, it is ensured that only visible data differences that affect the interface display will trigger subsequent refresh operations. Invisible data differences will not cause the interface to refresh, thereby further reducing unnecessary refresh operations and reducing the load on the main thread.

[0081] S250. Based on the full node information and the remaining node data in the outline data, update the outline data and add the remaining node data to the set of nodes to be updated.

[0082] The remaining nodes include the full node information and the node data in the outline data that did not form the paired node data.

[0083] By processing the remaining node data after extracting paired node data and updating the outline data accordingly, the remaining node data is added to the set of nodes to be updated. This ensures that structural changes caused by inconsistent node numbers can be included in the subsequent refresh process, thereby ensuring that changes in the file structure are fully reflected in the outline view interface.

[0084] S260. Based on the set of nodes to be updated, refresh the outline view.

[0085] This embodiment provides a method for refreshing an outline view. It extracts paired node data by acquiring all node information and extracting the outline data in the same sorted position. When attribute differences exist, the attributes of the second node data are updated. When visible data differences exist, the second node data is added to the set of nodes to be updated. If no visible data differences exist, the second node data is skipped and not added to the set of nodes to be updated. This ensures that only visible data differences affecting the interface display trigger subsequent refresh operations; invisible data differences do not cause interface refreshes, thereby further reducing unnecessary refresh operations and lowering the load on the main thread. The remaining node data is processed and added to the set of nodes to be updated. A refresh is then performed based on this set. This solves the technical problem in existing technologies where unnecessary refresh operations are caused by the lack of differentiation between difference types, leading to concentrated main thread load and causing interface lag or flickering. This achieves the technical effects of reducing refresh frequency, alleviating the burden on the main thread, and avoiding interface lag or flickering.

[0086] In one embodiment, executing the refresh task in the task queue includes: Determine whether there is any node data to be updated in the refresh task; If so, obtain the tagging information of the node data to be updated; If the marked information is the first marked information, refresh the elements of the corresponding node in the outline view; If the marker information is the second marker information, add the element of the corresponding node to the outline view; If the tagging information is the third tagging information, remove the element of the corresponding node in the outline view.

[0087] Elements can be visual components corresponding to node data in the outline view interface. Each node in the outline view is presented on the interface as a visual component, which can include a node icon, node name text, node type identifier, etc. Refreshing the element of a corresponding node means updating the displayed content of the visual component corresponding to that node; adding the element of a corresponding node means creating and displaying the visual component corresponding to a new node in the outline view interface; removing the element of a corresponding node means deleting the visual component corresponding to the node from the outline view interface.

[0088] In this embodiment, by obtaining the tagging information of the node data to be updated, and performing refresh, add or remove corresponding node elements according to the different types of tagging information, the refresh module can accurately identify the operation type to be performed for each node according to the tagging information, and perform corresponding interface updates for different operation types.

[0089] The entire refresh process can be divided into two parts: a comparison module and a refresh module. The comparison module (implemented as described in this invention through the update and add modules) is responsible for determining which nodes in the outline view need to be updated; the refresh module is responsible for updating the nodes. Node data can be divided into two categories: visible data and invisible data. Visible data can be node data directly displayed on the outline view interface, such as user-visible information like node descriptors and types used for interface display. Invisible data can be node data not displayed on the outline view interface, such as node row numbers and column numbers used for internal positioning or logical processing. Both visible and invisible data are node attributes. During UI rendering, visible data needs to be actively acquired and displayed on the interface; changes to node attributes do not cause UI refresh, but require active notification to the UI for a refresh operation.

[0090] In one embodiment, Figure 3 This is a flowchart of the comparison module in an outline view refresh method provided by an embodiment of the present invention. The processing flow of the comparison module is as follows: Step 1: After receiving the full node information (denoted as Q_new) output by the parsing module, the full node information is first compared sequentially with the currently maintained outline data (denoted as Q_old) by taking the head node. The processing flow for each pair of nodes is as follows: 1. When the two are completely equal and there is no visible or invisible data difference, continue to compare the next pair of nodes, that is, compare whether the attributes of the first node data and the attributes of the second node data in the paired node data are the same; if so, process the next pair of node data.

[0091] 2. When discrepancies exist, first update the Q_old node data (mark the nodes that need updating, update them all at once, and only update the parts that differ), that is, update the attributes of the second node data in the paired node data to the attributes of the first node data in the paired node data, and then perform the following operations according to the difference type: 1) If there is no visible data difference, continue comparing the next pair of nodes.

[0092] 2) If there is a visible data difference, add the node to the update queue (denoted as Q_upd) and mark it as upd. That is, add the second node data in the paired node data to the set of nodes to be updated and add the corresponding first mark information.

[0093] Step 2: After the comparison is complete, since the number of Q_old and Q_new may be inconsistent (ordered), it is necessary to process the remaining unpaired nodes: 1. If there are remaining nodes in Q_old, delete these nodes directly from Q_old and add them to Q_upd (end), marked as del. That is, if the remaining node data is the remaining node data in the outline data, delete the remaining node data from the outline data; add the remaining node data to the end of the set of nodes to be updated, and add the third tag information of the remaining node data.

[0094] 2. If there are remaining nodes in Q_new, add these nodes directly to the end of Q_old and Q_upd (end), and mark them as add. That is, if the remaining node data is the remaining node data in the full node data, add the remaining node data to the outline data; add the remaining node data to the end of the set of nodes to be updated, and add the second tag information of the remaining node data.

[0095] Step 3: Process the nodes in Q_upd and wrap them into a refresh task: 1. Take up to n nodes from Q_upd, wrap them into an update task (i.e., refresh task), and add them to Q_task (i.e., task queue).

[0096] 2. Continue with step 1 until Q_upd is empty. The final Q_task is the refresh task set, at which point the comparison task is complete.

[0097] In one embodiment, Figure 4 This is a flowchart of the refresh module in a refresh method for an outline view provided in an embodiment of the present invention. When the task list of the refresh module is not empty, it acquires and processes one refresh task at a time to avoid lag caused by updating too many nodes at once. The processing flow of the refresh module is as follows: 1. If Q_task is not empty, proceed to step 2; otherwise, wait.

[0098] 2. Retrieve one refresh task from Q_task.

[0099] 3. Retrieve the node to be updated from the refresh task and denote it as node.

[0100] 4. Calculate the new UI style for node and display it on the screen.

[0101] 5. If there are still nodes to be updated in the refresh task, return to step 3; otherwise, wait for the next task.

[0102] In one embodiment, Figure 5 This is a schematic diagram of the structure of an outline view refresh device provided in an embodiment of the present invention. Figure 5 As shown, the device includes: The acquisition module 510 is used to acquire the full node information of the outline view and the outline data maintained for the file. The outline view is used to display the structure of the file in a tree-like hierarchy. The full node information includes multiple first node data arranged in an ordered manner after parsing the file. The outline data includes multiple second node data arranged in an ordered manner.

[0103] The extraction module 520 is used to extract multiple sets of paired node data sequentially from the full node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position.

[0104] The update module 530 is configured to, for each set of paired node data, update the attributes of the second node data in the paired node data to the attributes of the first node data in the paired node data when there are attribute differences between the first node data and the second node data in the paired node data, and add the second node data in the paired node data to the set of nodes to be updated when there are visual data differences between the first node data and the second node data in the paired node data, wherein the visual data includes node data displayed on the outline view interface.

[0105] The addition module 540 is used to update the outline data based on the full node information and the remaining node data in the outline data, and add the remaining node data to the node set to be updated. The remaining nodes include the full node information and the node data in the outline data that have not formed the paired node data.

[0106] The refresh module 550 is used to refresh the outline view based on the set of nodes to be updated.

[0107] In one embodiment, the update module 530 is specifically used for: For each pair of node data, compare whether the attributes of the first node data and the attributes of the second node data in the pair of node data are the same; If so, process the paired node data as described below; If not, update the attributes of the second node data within the paired node data to the attributes of the first node data within the paired node data.

[0108] In one embodiment, the update module 530 includes: An adding unit is used to determine the difference type of the paired node data for each group of paired node data. If the difference type indicates that there is a visible difference between the first node data and the second node data in the paired node data, the second node data in the paired node data is added to the node set to be updated, and corresponding first tag information is added. The first tag information is used to mark the corresponding node data as updated node data.

[0109] In one embodiment, the update module 530 further includes a processing unit for: After determining the difference type of the paired node data, if the difference type indicates that there is no visible data difference between the first node data and the second node data in the paired node data, the next pair of node data is processed.

[0110] In one embodiment, module 540 is added, specifically for: If the remaining node data is the remaining node data in the full node data, the remaining node data is added to the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a second tag information is added to the remaining node data. The second tag information is used to mark the remaining node data as node data to be added to the outline view interface.

[0111] In one embodiment, module 540 is added, specifically for: If the remaining node data is the remaining node data in the outline data, delete the remaining node data from the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a third tag information is added to the remaining node data. The third tag information is used to mark the remaining node data as node data deleted from the outline view nodes.

[0112] In one embodiment, the refresh module 550 includes: The acquisition unit is used to cyclically acquire at least one node data from the set of nodes to be updated; The packaging unit is used to package each acquired node data into a refresh task and add the refresh task to the task queue; An execution unit is used to execute the refresh task in the task queue.

[0113] In one embodiment, the execution unit is specifically used for: Determine whether there is any node data to be updated in the refresh task; If so, obtain the tagging information of the node data to be updated; If the marked information is the first marked information, refresh the elements of the corresponding node in the outline view; If the marker information is the second marker information, add the element of the corresponding node to the outline view; If the tagging information is the third tagging information, remove the element of the corresponding node in the outline view.

[0114] The apparatus provided in the embodiments of the present invention can execute any method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.

[0115] In one embodiment, Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 6 The diagram illustrates a schematic representation of an electronic device 10 that can be used to implement embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0116] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor 11, and the computer program is executed by the at least one processor 11 to enable the at least one processor 11 to perform the method provided by the present invention.

[0117] The processor 11 can perform various appropriate actions and processes based on a computer program stored in the read-only memory (ROM) 12 or a computer program loaded from the storage unit 18 into the random access memory (RAM) 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0118] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0119] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the methods provided in this invention.

[0120] In some embodiments, the method provided by the present invention can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to execute the method by any other suitable means (e.g., by means of firmware).

[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard parts (ASSPs), systems-on-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0123] In the context of this invention, a computer-readable storage medium stores computer instructions that are used to cause a processor to execute and implement the method provided by this invention.

[0124] The present invention also provides a computer program product comprising a computer program that, when executed by a processor, implements the method provided according to embodiments of the present invention. A computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. The computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, the computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0125] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0126] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0127] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0128] This invention also provides a computer program product, including a computer program that, when executed by a processor, can implement the methods provided in any embodiment of this invention.

[0129] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone 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 remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0130] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0131] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for refreshing an outline view, characterized in that, include: Obtain all node information of the outline view and outline data maintained for the file. The outline view is used to display the structure of the file in a tree-like hierarchy. The all node information includes multiple first node data arranged in an ordered manner after parsing the file. The outline data includes multiple second node data arranged in an ordered manner. Multiple sets of paired node data are extracted sequentially from the full node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position. For each pair of node data, if there is an attribute difference between the first node data and the second node data in the pair of node data, the attribute of the second node data in the pair of node data is updated to the attribute of the first node data in the pair of node data. If there is a visual data difference between the first node data and the second node data in the pair of node data, the second node data in the pair of node data is added to the node set to be updated. The visual data includes the node data displayed on the outline view interface. Based on the full node information and the remaining node data in the outline data, the outline data is updated, and the remaining node data is added to the set of nodes to be updated. The remaining nodes include the full node information and the node data in the outline data that have not formed the paired node data. Based on the set of nodes to be updated, the outline view is refreshed.

2. The method according to claim 1, characterized in that, For each pair of node data, if there is an attribute difference between the first node data and the second node data in the pair of node data, updating the attribute of the second node data in the pair of node data to the attribute of the first node data in the pair of node data includes: For each pair of node data, compare whether the attributes of the first node data and the attributes of the second node data in the pair of node data are the same; If so, process the paired node data as described below; If not, update the attributes of the second node data within the paired node data to the attributes of the first node data within the paired node data.

3. The method according to claim 1, characterized in that, When there is a visible difference between the first node data and the second node data in the paired node data, adding the second node data in the paired node data to the set of nodes to be updated includes: For each pair of node data, the difference type of the pair of node data is determined. If the difference type indicates that there is a visible difference between the first node data and the second node data in the pair of node data, the second node data in the pair of node data is added to the set of nodes to be updated, and corresponding first tag information is added. The first tag information is used to mark the corresponding node data as updated node data.

4. The method according to claim 3, characterized in that, After determining the difference type of the paired node data, the process also includes: If the difference type indicates that there is no visible difference between the first node data and the second node data in the paired node data, then process the next pair of node data.

5. The method according to claim 1, characterized in that, The step of updating the outline data based on the full node information and the remaining node data in the outline data, and adding the remaining node data to the set of nodes to be updated, includes: If the remaining node data is the remaining node data in the full node data, the remaining node data is added to the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a second tag information is added to the remaining node data. The second tag information is used to mark the remaining node data as node data to be added to the outline view interface.

6. The method according to claim 1, characterized in that, The step of updating the outline data based on the full node information and the remaining node data in the outline data, and adding the remaining node data to the set of nodes to be updated, includes: If the remaining node data is the remaining node data in the outline data, delete the remaining node data from the outline data; The remaining node data is added to the end of the set of nodes to be updated, and a third tag information is added to the remaining node data. The third tag information is used to mark the remaining node data as node data deleted from the outline view nodes.

7. The method according to claim 1, characterized in that, The step of refreshing the outline view based on the set of nodes to be updated includes: The process involves iteratively retrieving at least one node's data from the set of nodes to be updated; Each time the node data is acquired, it is packaged into a refresh task, and the refresh task is added to the task queue; Execute the refresh task in the task queue.

8. The method according to claim 7, characterized in that, Executing the refresh task in the task queue includes: Determine whether there is any node data to be updated in the refresh task; If so, obtain the tagging information of the node data to be updated; If the marked information is the first marked information, refresh the elements of the corresponding node in the outline view; If the marker information is the second marker information, add the element of the corresponding node to the outline view; If the tagging information is the third tagging information, remove the element of the corresponding node in the outline view.

9. A device for refreshing an outline view, characterized in that, include: The acquisition module acquires the full node information of the outline view and the outline data maintained for the file. The outline view is used to display the structure of the file in a tree-like hierarchy. The full node information includes multiple first node data arranged in an ordered manner after parsing the file, and the outline data includes multiple second node data arranged in an ordered manner. The extraction module extracts multiple sets of paired node data sequentially from the full set of node information and the outline data. Each set of paired node data includes a first node data and a second node data with the same sorting position. The update module, for each set of paired node data, updates the attributes of the second node data in the paired node data to the attributes of the first node data in the paired node data if there are attribute differences between the first node data and the second node data in the paired node data; and adds the second node data in the paired node data to the set of nodes to be updated if there are visual data differences between the first node data and the second node data in the paired node data. The visual data includes node data displayed on the outline view interface. The module adds nodes to the set of nodes to be updated based on the full node information and the remaining node data in the outline data. The remaining nodes include the full node information and the node data in the outline data that have not formed the paired node data. The refresh module refreshes the outline view based on the set of nodes to be updated.

10. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the method of any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1-8.