Real-time log message display method based on tree structure
Through the real-time log message display method based on tree structure, the log data is parsed into a dictionary structure and presented in a tree UI, which solves the problem of intuitiveness and low efficiency of log message display in the existing technology, and realizes efficient and clear log data display.
Patent Information
- Application Number
- CN202510391937.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-08-08
AI Technical Summary
Existing log message analysis tools are less intuitive and less efficient when displaying complex log data, especially when dealing with multi-layer nested relationships, and the maintenance work is large.
The real-time log message display method based on the tree structure is adopted, and the log data is parsed into a dictionary structure and presented in a tree UI. The tree structure processing and comparison links are used to construct the tree structure display content of the real-time log message, and only the change part is incrementally updated.
It improves the efficiency and intuitiveness of log data display, reduces the maintenance workload of tools, and can clearly present the hierarchical relationships of log data to ensure real-time display.
Smart Images

Figure CN120448378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of log message display, and in particular to a real-time log message display method based on a tree structure. Background Art
[0002] To ensure the stable operation of urban rail transit signaling systems, real-time display of messages in log data is crucial for development and maintenance personnel to identify and resolve signaling system issues. However, existing log message parsing tools often use hard-coded methods to display parsed content in real time. Parsing results are displayed in the tool's UI in the form of tables or other lists. Each message field is rigidly mapped to a corresponding column in a table or a fixed position in a list. These hard-coded binding relationships lead to poor maintainability of log message parsing tools. Messages with different structures may require different binding relationships, making tool development and maintenance a significant workload. This maintenance becomes increasingly difficult as the number of log message types increases. Furthermore, two-dimensional tables or lists struggle to represent hierarchically nested message field relationships. When log fields have multiple nested relationships, for example, the parsed message result contains field a, which is an object, which contains field b, which may be an array containing complex object data such as c, d, and e, current table or list binding and display methods cannot clearly express this hierarchical relationship.
[0003] The patent "Log Display Method, Device and Electronic Device", publication number: CN113495828A, publication date: October 12, 2021, specifically discloses: obtaining log information of software operation, formatting and storing the log information; obtaining log window information and log display information in response to a trigger instruction on the display interface; generating a log display window on the display interface based on the log window information; obtaining stored log information based on the log display information; and displaying the log information in the log display window. However, when the log messages are more complex and the number is large, it is impossible to intuitively display the relationship between the message contents, and each log data corresponds to the generation of a log display window separately, which is inefficient. Summary of the Invention
[0004] In order to solve the problems of poor intuitiveness and low efficiency in the display of log messages in the prior art, the present application provides a real-time log message display method based on a tree structure. The tree structure display content is constructed based on the parsing structure matching of the log data, and the data is displayed in an intuitive tree structure. At the same time, based on the field comparison between the historical log data and the current log data, the difference between the two messages is identified, and only the changed parts are incrementally updated, thereby improving the efficiency of log data display and ensuring real-time display.
[0005] To achieve the above-mentioned technical objectives, the present application provides a technical solution, which is a real-time log message display method based on a tree structure, comprising the following steps: in response to the reception of log data, determining whether the current log data belongs to the first log data based on the reception of log data in a preset previous time period; if the current log data belongs to the first log data, matching the current log data parsing structure with the preset structure type, and calling the tree structure processing link corresponding to the preset structure type according to the matching result; if the current log data does not belong to the first log data, obtaining a comprehensive parsing structure based on the log data in the preset previous time period and the current log data, matching the comprehensive parsing structure with the preset structure type, and calling the corresponding tree structure comparison link according to the matching result; and constructing the tree structure display content of the real-time log message based on the output content of the tree structure processing link and the tree structure comparison link.
[0006] Furthermore, the method further includes: in response to receiving the log data, parsing the binary message in the current log data into a dictionary.
[0007] Furthermore, the matching of the current log data parsing structure with the preset structure type and calling the tree structure processing link corresponding to the preset structure type according to the matching result include: matching each parsing structure in the current log data with the preset structure type; if the parsing structure is a dictionary, calling the dictionary processing link to process the parsing content and obtain the dictionary processing output content; if the parsing structure is an array, calling the array processing link to process the parsing content and obtain the array processing output content.
[0008] Furthermore, the calling of the dictionary processing link to process the parsed content and obtain the dictionary processing output content includes: extracting all key-value pairs in the parsed content, creating a tree view item for each key-value pair, constructing a reference relationship of the tree view items based on the hierarchical relationship of the parsed content, and using the reference relationship between the tree view items as the dictionary processing output content.
[0009] Furthermore, the array processing link is called to process the parsed content, and obtaining the array processing output content includes: extracting array elements in the parsed content, creating a tree view item for each array element, constructing a reference relationship of the tree view items based on the hierarchical relationship of the parsed content, and using the reference relationship between the tree view items and the tree view items as the array processing output content.
[0010] Furthermore, the method of obtaining a comprehensive parsing structure based on the log data of a preset previous time period and the current log data, matching the comprehensive parsing structure with the preset structure type, and calling the corresponding tree structure comparison link based on the matching result includes: obtaining a comprehensive parsing structure based on the log data parsing structure of the preset previous time period and the current log data parsing structure, judging whether the parsing structures in the comprehensive parsing structure are the same; if so, calling the tree structure comparison link according to the preset structure type corresponding to the comprehensive parsing structure; if not, calling the tree structure processing link according to the current log data parsing structure.
[0011] Furthermore, the calling of the tree structure comparison link according to the preset structure type corresponding to the comprehensive analysis structure includes: if the preset structure type corresponding to the comprehensive analysis structure is a dictionary, the dictionary comparison link is called, and the tree structure update content is output according to the key-value pair comparison result of the log data analysis content of the preset previous time period and the current log data analysis content; if the preset structure type corresponding to the comprehensive analysis structure is an array, the array comparison link is called, and the tree structure update content is output according to the array element comparison result of the log data analysis content of the preset previous time period and the current log data analysis content.
[0012] Furthermore, the output of the tree structure update content based on the comparison result of the key-value pairs of the log data parsing content of the preset previous time period and the current log data parsing content includes: if the number of key-value pairs of the current log data parsing content is greater than the number of key-value pairs of the log data parsing content of the preset previous time period, then a new tree view item is created based on the difference key-value pairs; if the number of key-value pairs of the current log data parsing content is less than the number of key-value pairs of the log data parsing content of the preset previous time period, then a corresponding number of tail tree view items are deleted based on the difference key-value pairs; and the tree view item of the common key-value pair part of the current log data parsing content and the log data parsing content of the preset previous time period is updated according to the current log data parsing content.
[0013] Furthermore, the output of the tree structure update content based on the comparison result of the array elements of the log data parsing content of the preset previous time period and the current log data parsing content includes: if the number of array elements of the current log data parsing content is greater than the number of array elements of the log data parsing content of the preset previous time period, then a new tree view item is created based on the different array elements; if the number of array elements of the current log data parsing content is less than the number of array elements of the log data parsing content of the preset previous time period, then a corresponding number of tail tree view items are deleted based on the different array elements; and the common array element part of the current log data parsing content and the log data parsing content of the preset previous time period is updated as a tree view item based on the current log data parsing content.
[0014] Furthermore, the construction of the tree structure display content of the real-time log message based on the output content of the tree structure processing link and the tree structure comparison link includes: constructing the tree structure display content of the real-time log message based on the output content of the tree structure processing link, and updating the tree structure display content of the real-time log message based on the output content of the tree structure comparison link.
[0015] The beneficial effects of this application are as follows: by parsing the log message into a dictionary structure and presenting the dictionary structure in the form of a tree UI. Dictionaries are easy to represent using trees. Any type of log data can be easily parsed into a dictionary and displayed in a tree UI. All log data displays use a set of display algorithms, and the addition, modification, and deletion of log data do not require algorithm changes, which greatly reduces the maintenance workload of the tool and improves efficiency. Displaying the log parsing results in a tree structure can clearly and intuitively present the hierarchical relationship of the log data. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a flowchart of a tree-structured real-time log message display method for this application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of this application more clear, the application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific implementation method described here is only an optimal embodiment of this application, which is only used to explain this application and does not limit the scope of protection of this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0018] like Figure 1 As shown in the first embodiment of the present application, a real-time log message display method based on a tree structure includes the following steps: In response to receiving the log data, determining whether the current log data belongs to the first log data based on the log data reception status of a preset previous time period; If the current log data belongs to the first log data, the current log data parsing structure is matched with the preset structure type, and the tree structure processing link corresponding to the preset structure type is called according to the matching result; If the current log data does not belong to the first log data, a comprehensive parsing structure is obtained based on the log data of the preset previous time period and the current log data, and the comprehensive parsing structure is matched with the preset structure type, and the corresponding tree structure comparison link is called according to the matching result; The tree structure display content of the real-time log message is constructed based on the output content of the tree structure processing link and the tree structure comparison link.
[0019] In this embodiment, a tree structure is constructed to display content based on the parsed structure matching of the log data, and the data is displayed in an intuitive tree structure, so that system operation and maintenance personnel, developers, and testers can more easily identify and analyze useful information in massive log data, which helps to locate and solve problems more quickly and improve work efficiency.
[0020] Specifically, determining whether the current log data belongs to the first log data based on the log data reception status of the preset previous time period includes: If there is historical log data received in the preset previous time period, it is considered that the current log data does not belong to the first log data; if there is no historical log data received in the preset previous time period, it is considered that the current log data belongs to the first log data.
[0021] The preset preceding period can be set according to actual needs, such as setting the period between the initial running time and the current time as the preset preceding period, thereby avoiding interference from irrelevant data and improving the accuracy and simplicity of the message display.
[0022] A real-time log message display method based on a tree structure, further comprising: In response to receiving the log data, the binary message in the current log data is parsed into a dictionary.
[0023] Binary messages in log data are often complex in structure, making them difficult to display or process directly. By parsing log messages into a dictionary structure and presenting it in a tree-like UI, any type of log data can be easily parsed and displayed in a tree-like UI. All log data is displayed using a single display algorithm, and adding, modifying, or deleting log data does not require changing the algorithm, significantly reducing tool maintenance workload.
[0024] According to the current log data parsing structure and the preset structure type, the tree structure processing steps of the preset structure type are called according to the matching results, including: Match each parsed structure in the current log data with the preset structure type; If the parsed structure is a dictionary, the dictionary processing step is called to process the parsed content and obtain the dictionary processing output content; If the parsed structure is an array, the array processing link is called to process the parsed content and obtain the array processing output content.
[0025] Among them, calling the dictionary processing link to process the parsed content, and obtaining the dictionary processing output content includes: Extract all key-value pairs in the parsed content, create a tree view item for each key-value pair, build a reference relationship between the tree view items based on the hierarchical relationship of the parsed content, and use the tree view items and the reference relationship between the tree view items as a dictionary to process the output content.
[0026] Call the array processing link to process the parsed content, and obtain the array processing output content including: Extract array elements from the parsed content, create a tree view item for each array element, build a reference relationship between the tree view items based on the hierarchical relationship of the parsed content, and use the reference relationship between the tree view items as an array to process the output content.
[0027] Log data may contain various types of information, which may exist in the form of dictionaries, arrays, or other data structures. According to the analysis of the current log data, multiple parsing structures corresponding to the log data are obtained, and different processing links are called for different parsing structures. When the parsing structure of a parsed content is a dictionary, the dictionary processing link is called to process the parsed content, and a tree view item is constructed according to its key-value pair, and a reference relationship, i.e., a parent relationship, of the tree view item is constructed according to the hierarchical relationship of the parsed content. When the parsing structure of a parsed content is an array, the array processing link is called to process the parsed content, and a tree view item is created according to its array elements, and a reference relationship, i.e., a parent relationship, of the tree view item is constructed according to the hierarchical relationship of the parsed content. In this way, the current log data is displayed in a tree structure to improve intuitiveness.
[0028] Obtain a comprehensive analysis structure based on the log data of the preset previous period and the current log data, match the comprehensive analysis structure with the preset structure type, and call the corresponding tree structure comparison step based on the matching result, including: A comprehensive parsing structure is obtained using the log data parsing structure of the preset previous time period and the current log data parsing structure, and it is determined whether the parsing structures in the comprehensive parsing structure are the same. If so, the tree structure comparison link is called according to the preset structure type corresponding to the comprehensive parsing structure. If not, the tree structure processing link is called according to the current log data parsing structure.
[0029] Among them, the call tree structure comparison link according to the preset structure type corresponding to the comprehensive parsing structure includes: If the preset structure type corresponding to the comprehensive parsing structure is a dictionary, the dictionary comparison step is called to output the updated content of the tree structure based on the comparison result of the key-value pairs between the parsed content of the log data of the preset previous time period and the parsed content of the current log data; If the preset structure type corresponding to the comprehensive analysis structure is an array, the array comparison link is called to output the tree structure update content based on the comparison result of the array elements of the log data analysis content of the preset previous time period and the current log data analysis content.
[0030] Different processing methods are performed depending on whether the log data parsing structure of the preset previous time period is the same as the current log data parsing structure. When the log data parsing structure of the preset previous time period is the same as the current log data parsing structure, the tree structure comparison link is called according to the parsing structure. If the parsing structure is a dictionary, the parsing content of the preset previous time period, that is, the key-value pairs of the dictionary, are compared with the key-value pairs of the current log data, and the tree structure is updated according to the comparison result.
[0031] Specifically, the output tree structure update content according to the key-value pair comparison result of the log data parsing content of the preset previous time period and the current log data parsing content includes: If the number of key-value pairs in the current log data parsing content is greater than the number of key-value pairs in the log data parsing content in the preset previous time period, a new tree view item is created based on the different key-value pairs; If the number of key-value pairs in the current log data parsing content is less than the number of key-value pairs in the log data parsing content in the preset previous time period, then a corresponding number of tail tree view items are deleted according to the different key-value pairs; The common key-value pair portion of the current log data parsing content and the log data parsing content of the preset previous time period is updated in the tree view item according to the current log data parsing content.
[0032] If the current log data does not belong to the first data, then the tree structure has been constructed based on the log data of the preset previous time period before the current log data is received. At this time, the difference between the current log data and the log data of the preset previous time period is compared. In the part with the same number of key-value pairs, the content of the tree view item is updated according to the current log data, and in the part with different number of key-value pairs, addition and subtraction operations are performed according to the difference. Therefore, all log data are displayed using a set of display algorithms. The addition, modification and deletion of log data do not require changing the algorithm. Only the changed part is incrementally updated. The maintenance workload of the tool is greatly reduced, the efficiency is improved, and the real-time display of log messages is ensured.
[0033] Similarly, the output tree structure update content based on the comparison result of the array element of the log data parsing content of the preset previous time period and the current log data parsing content includes: If the number of array elements of the current log data parsed content is greater than the number of array elements of the log data parsed content in the preset previous time period, a new tree view item is created based on the different array elements; If the number of array elements of the current log data parsed content is less than the number of array elements of the log data parsed content in the preset previous time period, then a corresponding number of tail tree view items are deleted according to the difference in array elements; The common array element portion of the current log data parsing content and the log data parsing content of the preset previous time period is updated in the tree view item according to the current log data parsing content.
[0034] The Dictionary Comparison and Array Comparison phases are called for dictionary and array data types, respectively. This allows for processing complex log messages containing multiple data structures, enabling comparison and updates of new and old data, and dynamically reflecting changes in log data. Whether adding, removing, or modifying key-value pairs in the dictionary, or changing array elements, these changes are accurately updated in the tree structure, displaying the latest data status in real time.
[0035] According to the current log data parsing structure, the call tree structure processing steps include: Match the current log data parsing structure with the preset structure type, and call the tree structure processing link corresponding to the preset structure type according to the matching result.
[0036] If the current log parsing structure is inconsistent with the log data parsing structure of the preset previous time period, a new tree structure is directly constructed based on the current log data.
[0037] The tree structure display content of the real-time log message is constructed based on the output content of the tree structure processing stage and the tree structure comparison stage, including: The tree structure display content of the real-time log message is constructed based on the output content of the tree structure processing link, and the tree structure display content of the real-time log message is updated based on the output content of the tree structure comparison link.
[0038] The output of the tree structure processing phase includes dictionary processing and array processing output. The output of the tree structure comparison phase includes new tree view item content, deleted tree view item content, and updated tree view item content. Creating new tree view items based on the different array elements outputs new tree view item content. Deleting a corresponding number of tail tree view items based on the different array elements outputs deleted tree view item content. Updating tree view items based on the parsed content of the current log data outputs updated tree view item content.
[0039] As the second embodiment of this application, a specific embodiment is provided for illustration. It is used to bind with UI elements in WPF so that when the dictionary changes, the data structure is updated synchronously, and the interface is automatically updated through the WPF message mechanism. <treeviewdictitemmodel>Type storage dictionary, using ObservableCollection <treeviewarrayitemmodel>The type stores arrays. The TreeViewDictItemModel type stores dictionary element key-value pairs, including the attribute Title for storing the key of the dictionary element, the attribute Content for storing the value of the dictionary element, and the attribute Parent for storing the dictionary. The TreeViewArrayItemModel type stores an element of an array, including the attribute Index for indicating the sequence number of the array element in the array, the attribute Content for storing the value of the array element, and the attribute Parent for storing the array. The above-mentioned Content attribute can store integers, floating-point numbers, strings, and ObservableCollection. <treeviewdictitemmodel>、ObservableCollection <treeviewarrayitemmodel>All properties have message notification functions. When a property changes, the UI will be notified to update (implemented through the WPF INotifyPropertyChanged interface).
[0040] Parse the binary message in the log data into a dictionary. If it is the first data, determine whether its parsed structure is a dictionary or an array, call different tree structure processing links according to the parsed structure, and bind the generated intermediate structure, i.e., the tree view item, to WPFTreeView: If it is a dictionary, all key-value pairs of the dictionary are taken out, and each key-value pair creates a TreeViewDictItemModel with Title as the key and the return value saved to the Content property to generate an ObservableCollection <treeviewdictitemmodel>, the Parent of each TreeViewDictItemModel stores this reference and then returns this reference; If it is an array, all elements of the array are taken out, and a TreeViewArrayItemModel is created for each element. The Index is the sequence number of the array element, and the return value is saved to the Content property to generate an ObservableCollection <treeviewarrayitemmodel>, each TreeViewArrayItemModel's Parent stores this reference and then returns this reference.
[0041] If it is not the first data, obtain and compare the new data, old data, and the intermediate structure corresponding to the old data. The new data is the current log data, and the old data is the log data of the preset previous period. When the parsed structure of the old and new data is the same, call different tree structure comparison links according to the parsed structure and update the intermediate structure: When the comprehensive parsing structure is a dictionary, compare the new dictionary, the old dictionary, and the intermediate data structure ObservableCollection corresponding to the old dictionary <treeviewdictitemmodel>Define the number of key-value pairs N of the new dictionary, and the number of key-value pairs of the old dictionary is M. If N > M, take the key-value pairs at positions from M + 1 to N in the new dictionary, store the keys as Title, the return values of the values as Content, and the intermediate data structure as Parent, construct a TreeViewDictItemModel, and add it to the intermediate data structure. If N < M, remove N - M elements from the end of the intermediate data structure. Compare each key-value pair in the common part (the first MIN(N, M) data) of the new and old dictionaries, update the Title of the corresponding element in the intermediate data structure with the new title, and update the Content of the corresponding element in the intermediate structure with the new data, the old data, and the return value of the intermediate structure corresponding to the old data.
[0042] When the comprehensive parsing structure is an array, compare the new array, the old array, and the ObservableCollection of the intermediate data structure corresponding to the old array <treeviewarrayitemmodel>Define the number of elements in the new array as N, and the number of elements in the old array as M. If N > M, take the elements of the new array at positions from M + 1 to N, store the sequence number as Index, the return value of the value as Content, the intermediate data structure as Parent, construct the TreeViewArrayItemModel, and add it to the intermediate data structure. If N < M, remove N - M elements from the end of the intermediate data structure. For the common part (the first MIN(N, M) data) of the new and old arrays, update the Content of the corresponding elements in the intermediate structure with the new data, the old data, and the return value of the intermediate structure corresponding to the old data.
[0043] In this embodiment, by parsing the log message into a dictionary structure and presenting the dictionary structure in the form of a tree UI. Dictionaries are inherently easy to represent with trees. Any type of log data can be easily parsed into a dictionary and displayed in a tree UI. All log data displays use a single display algorithm, and there is no need to change the algorithm for the addition, change, or deletion of log data, greatly reducing the maintenance workload of the tool. Moreover, by displaying the log parsing result in a tree structure, the hierarchical relationship of the log data can be clearly and intuitively presented. Compared with the traditional two-dimensional table, the tree structure display of this embodiment can not only display simple log messages, but is also very suitable for displaying log messages with complex nested relationships, and is more applicable to the rail transit signal system.
[0044] The above specific implementation manners are the preferred implementation manners of a real-time log message display method based on a tree structure in this application, and do not limit the specific scope of this application. The scope of this application includes but is not limited to this specific implementation manner. Any equivalent changes made according to the shape and structure of this application are within the protection scope of this application.< / treeviewarrayitemmodel> < / treeviewdictitemmodel> < / treeviewarrayitemmodel> < / treeviewdictitemmodel> < / treeviewarrayitemmodel> < / treeviewdictitemmodel> < / treeviewarrayitemmodel> < / treeviewdictitemmodel>
Claims
1. A real-time log message display method based on a tree structure, characterized by: The steps include: In response to receiving the log data, determining whether the current log data belongs to the first log data based on the log data reception status of a preset previous time period; If the current log data belongs to the first log data, the current log data parsing structure is matched with the preset structure type, and the tree structure processing link corresponding to the preset structure type is called according to the matching result; If the current log data does not belong to the first log data, a comprehensive parsing structure is obtained based on the log data of the preset previous time period and the current log data, and the comprehensive parsing structure is matched with the preset structure type, and the corresponding tree structure comparison link is called according to the matching result; The tree structure display content of the real-time log message is constructed based on the output content of the tree structure processing link and the tree structure comparison link.
2. The method for displaying real-time log messages based on a tree structure according to claim 1, wherein: Also includes: In response to receiving the log data, the binary message in the current log data is parsed into a dictionary.
3. The method for displaying real-time log messages based on a tree structure according to claim 1, wherein: The process of matching the current log data parsing structure with the preset structure type and calling the tree structure processing corresponding to the preset structure type according to the matching result includes: Match each parsed structure in the current log data with the preset structure type; If the parsed structure is a dictionary, the dictionary processing step is called to process the parsed content and obtain the dictionary processing output content; If the parsed structure is an array, the array processing link is called to process the parsed content and obtain the array processing output content.
4. The method for displaying real-time log messages based on a tree structure according to claim 3, wherein: The calling of the dictionary processing step processes the parsed content, and obtaining the dictionary processing output content includes: Extract all key-value pairs in the parsed content, create a tree view item for each key-value pair, build a reference relationship between the tree view items based on the hierarchical relationship of the parsed content, and use the tree view items and the reference relationship between the tree view items as a dictionary to process the output content.
5. The method for displaying real-time log messages based on a tree structure according to claim 3, wherein: The calling array processing step processes the parsed content, and obtaining the array processing output content includes: Extract array elements from the parsed content, create a tree view item for each array element, build a reference relationship between the tree view items based on the hierarchical relationship of the parsed content, and use the reference relationship between the tree view items as an array to process the output content.
6. The method for displaying real-time log messages based on a tree structure according to claim 1, wherein: The step of obtaining a comprehensive analysis structure based on log data of a preset previous time period and current log data, matching the comprehensive analysis structure with a preset structure type, and calling a corresponding tree structure comparison step based on the matching result includes: A comprehensive parsing structure is obtained using the log data parsing structure of the preset previous time period and the current log data parsing structure, and it is determined whether the parsing structures in the comprehensive parsing structure are the same. If so, the tree structure comparison link is called according to the preset structure type corresponding to the comprehensive parsing structure. If not, the tree structure processing link is called according to the current log data parsing structure.
7. The method for displaying real-time log messages based on a tree structure according to claim 6, wherein: The step of comparing the call tree structure according to the preset structure type corresponding to the comprehensive parsing structure includes: If the preset structure type corresponding to the comprehensive parsing structure is a dictionary, the dictionary comparison step is called to output the updated content of the tree structure based on the comparison result of the key-value pairs between the parsed content of the log data of the preset previous time period and the parsed content of the current log data; If the preset structure type corresponding to the comprehensive analysis structure is an array, the array comparison link is called to output the tree structure update content based on the comparison result of the array elements of the log data analysis content of the preset previous time period and the current log data analysis content.
8. The method for displaying real-time log messages based on a tree structure according to claim 7, wherein: Outputting the updated content of the tree structure according to the comparison result of the key-value pairs between the log data parsed content of the preset previous time period and the current log data parsed content includes: If the number of key-value pairs in the current log data parsing content is greater than the number of key-value pairs in the log data parsing content in the preset previous time period, a new tree view item is created based on the different key-value pairs; If the number of key-value pairs in the current log data parsing content is less than the number of key-value pairs in the log data parsing content in the preset previous time period, then a corresponding number of tail tree view items are deleted according to the different key-value pairs; The common key-value pair portion of the current log data parsing content and the log data parsing content of the preset previous time period is updated in the tree view item according to the current log data parsing content.
9. The method for displaying real-time log messages based on a tree structure according to claim 7, wherein: Outputting the updated content of the tree structure according to the comparison result of the array elements of the log data parsed content of the preset previous time period and the current log data parsed content includes: If the number of array elements of the current log data parsed content is greater than the number of array elements of the log data parsed content in the preset previous time period, a new tree view item is created based on the different array elements; If the number of array elements of the current log data parsed content is less than the number of array elements of the log data parsed content in the preset previous time period, then a corresponding number of tail tree view items are deleted according to the difference in array elements; The common array element portion of the current log data parsing content and the log data parsing content of the preset previous time period is updated in the tree view item according to the current log data parsing content.
10. The method for displaying real-time log messages based on a tree structure according to claim 1, wherein: The tree structure display content of the real-time log message constructed based on the output content of the tree structure processing link and the tree structure comparison link includes: The tree structure display content of the real-time log message is constructed based on the output content of the tree structure processing link, and the tree structure display content of the real-time log message is updated based on the output content of the tree structure comparison link.
Citation Information
Patent Citations
Log display method and device and electronic equipment
CN113495828A