Block log presentation method

Through the structured log presentation method, errors and warnings are automatically identified, anchor links and color marks are generated, which solves the problem of large and messy log files, and achieves rapid fault location and efficient information retrieval.

CN120407348APending Publication Date: 2025-08-01SHENZHEN ANKE BAITENG TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510864789.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When facing complex business logic, the log files are huge, resulting in slow opening or unloading, the presentation method is messy, it is difficult to quickly locate faults, and the efficiency of screening key information is inefficient.

Method used

By extracting overview information of structured log content, generating anchor links and color marks, automatically identifying errors or warnings, time-consuming calculations and block rendering, using API extensions to tag logs, and generating collapsed tags and asynchronous nodes.

Benefits of technology

It realizes efficient and structured log presentation, and operation and maintenance personnel can quickly locate faults, shorten troubleshooting time, and improve information retrieval accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407348A_ABST
    Figure CN120407348A_ABST
Patent Text Reader

Abstract

The invention discloses a method for presenting a block log, which comprises the following steps of: recording a log, and obtaining structured log content; extracting overview information of the structured log content according to user requirements; judging whether an error or a warning exists in the process of extracting the overview information, if so, extracting error or warning information generated in the structured log content, analyzing nodes of the error or warning information, generating anchor point links and marking highlighted colors; if not, extracting a process input parameter, generating a folding label for the content exceeding the specified length in the label or the feature of the structured log content, and generating the log content; log content is directly generated for the content conforming to the specified length; in the process of generating the log content, consumed time of an upper node and a lower node is calculated, and colors are marked for the consumed time. According to the log management scheme, overview extraction, error node positioning and performance visualization are carried out according to needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of log presentation, and more particularly to a method for presenting block logs. Background Art

[0002] After successfully implementing patented technology CN116049115B, software logs now achieve high-performance recording and automatic storage, along with automatic or scenario-based organization capabilities (for example, real-time format conversion based on display requirements). However, when faced with complex business logic, a single business process often generates massive log volumes, ranging from hundreds to tens of thousands of lines. Faced with such massive data volumes, traditional log presentation methods are insufficient, failing to meet the urgent needs of operations and maintenance personnel for efficient troubleshooting and rapid data analysis using large models.

[0003] Current log presentation technology faces numerous bottlenecks: First, log files are often large (constrained by pre-set parameters and prone to expansion), making them slow to open or even impossible to load in many text editors, making presentation itself a hurdle. Second, fault location relies excessively on inefficient and limited-precision keyword fuzzy searches, making it like looking for a needle in a haystack amidst a vast sea of information. Third, plain text logs lack structure, resulting in a disorganized and chaotic reading experience, like reading a lengthy treatise without a table of contents or layout. Fourth, users are forced to scan the entire text line by line, like searching for clues in a maze, making it difficult to quickly identify key information. Fifth, the large amount of non-critical information mixed in severely interferes with the extraction of valid content, forcing operations and maintenance personnel to waste considerable time on irrelevant information and resulting in inefficient reading. Therefore, developing innovative log presentation technologies to significantly improve information acquisition efficiency and retrieval accuracy has become a critical issue that needs to be addressed. Summary of the Invention

[0004] The purpose of the present invention is to provide a block log presentation method, which realizes efficient and structured log presentation by extracting overview, intelligently marking key error nodes, and calculating time consumption and coloring.

[0005] To achieve the above object, the present invention provides the following technical solutions: A method for presenting block logs, comprising the following steps: S1. Record the log and obtain the structured log content; extract the overview information of the structured log content according to user needs; S2. When determining whether there are errors or warnings in the process of extracting the overview information, if so, extract the error or warning information generated in the structured log content, analyze the nodes of the error or warning information, generate anchor links and mark them with prominent colors; S3. If not, extract the process input parameters, generate folded tags for the content in the tags or features of the structured log content that exceeds the specified length, and generate the log content; for the content that meets the specified length, directly generate the log content; S4. During the process of generating the log content, calculate the elapsed time between the upper and lower nodes, and mark the color of the elapsed time to achieve the presentation of block logs.

[0006] Furthermore, in S1, while recording the log, it also includes: expanding the API of the log and adding different tags to different logs.

[0007] Furthermore, in S1, to extract the overview information of the structured log content according to user requirements, the following steps are included: S101. After the sorted log records are stored structurally, do not generate the log content that is convenient for users to read for the time being; S102. When receiving the user's viewing action, based on the structurally stored data, expand and generate the visual log content; S103. Convert the structurally stored data sequence into a memory object, and at the same time extract the overview information from the structurally stored data to facilitate the user's quick reading.

[0008] Furthermore, in S1, the overview information includes: log ID, main thread consumption time, maximum log level, number of errors generated, number of warnings generated, number of child threads generated during the execution process, and longest elapsed time of the child thread time information.

[0009] Furthermore, the expanded API includes: SQL, XML, JSON, LoopStart, LoopEnd, HttpStart, HttpEnd, BlockStart, and BlockEnd.

[0010] Furthermore, when the elapsed time for extracting the overview information in S2 is greater than the set time, analyze the node of the log with the highest elapsed time in the whole process, generate an anchor link for the node of the log, generate an anchor link and mark a prominent color for the main thread elapsed time content, and the user can jump to the corresponding log node by clicking the added anchor.

[0011] Furthermore, when the number of child threads in the overview information is greater than 0, analyze the thread situation generated in the whole process and calculate the execution time of the longest elapsed time child thread, generate an anchor connection for the node of the first or longest elapsed time child thread log, and add an anchor and mark a prominent color for the corresponding number of child threads. The user can jump to the corresponding log node by simply clicking this anchor.

[0012] Further, in step S3, the process of extracting the process input parameters further includes: detecting whether the structured log content provides input parameters according to the specification or whether the thread calls according to the specification; if there is a problem, a warning message of the log record is generated, and the user is informed that the log record needs to be adjusted.

[0013] Further, in step S4, the process of generating the log content includes the following steps: S401. Identify the tags or features of the log content. When the tags or features include SQL, JSON, XML tags, extract the content that conforms to these formats, format the extracted content, generate a folded tag, and generate a unique ID for the folded tag; S402. When the tags or features include LoopStart, HttpStart, BlockStart tags, extract from the current log node backward until the corresponding End tag is found, generate a folded tag for this content, and at the same time detect whether the record type of this content is warning, error, or long-duration content; if it is a warning or error, change the presentation color of this content; S403. If the tags or features do not include LoopStart, HttpStart tags, but the number of logged log nodes exceeds 100 lines, automatically detect the duplicate log content. If duplicate content is detected, extract the duplicate content, and then repeat step B2, extract from the current log node backward until the corresponding End tag is found, generate a folded tag for this content, and at the same time detect whether this content contains warning, error, or long-duration content. If so, change the presentation color of this content; S404. Calculate the time consumption of the upper and lower nodes during the generation process. When it is greater than the specified monitoring time, automatically mark the consumed time as red for easy reading; S405. For extremely large log content, automatically generate asynchronous content nodes. If the folded content has no warning, error, or long execution time, only generate one tag. After the important content is displayed, insert the folded content into these tags through the ID of the folded tag; or judge whether there is content by monitoring the user click event. If there is no content, automatically obtain the content and present it; S406. When storing multiple log logic blocks in one file or merging multiple log contents for presentation, generate a folded tag for each log logic segment.

[0014] According to the specific embodiments provided by the present invention, the present invention has the following technical effects compared with the prior art: The present invention automatically identifies error / warning messages, locates problem nodes using environmental monitoring information, generates anchor links and prominent color markings, enabling operation and maintenance personnel to quickly jump to key error points, significantly shortening the troubleshooting time; by calculating and visualizing (color marking) the time taken by adjacent nodes, it intuitively shows the performance bottlenecks of each link in the business process, helping to quickly identify time-consuming operations and providing a basis for performance optimization; it transforms the original, chaotic text logs into structured "block logs" with interactive elements (such as folding, anchors) and visual cues (color markings), making the information organization clearer and the interaction between users and the logs more convenient; it automatically extracts overview information and combines it with intelligent markings of errors / warnings to help users quickly filter and focus on the most relevant parts, reducing the time cost of screening through a large amount of non-critical information and improving the accuracy and efficiency of information retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0016] The following further illustrates a method for presenting block logs of the present invention in conjunction with the drawings; Figure 1 is a schematic diagram of the overall process of the method for presenting block logs of the present invention; Figure 2 is a schematic diagram of the business process for extracting overview information of structured log content in the present invention; Figure 3 is a comparison diagram of the viewing effects of the log presentation method in the present invention and the prior art; among them, (a) is the viewing effect of the prior art, and (b) is the viewing effect of the present invention; Figure 4 is a comparison diagram of the first rendering effects of the log presentation method in the present invention and the prior art; among them, (a) is the first rendering effect of the prior art; (b) is the first rendering effect of the present invention; Figure 5 is a comparison diagram of the second viewing effects of the log presentation method in the present invention and the prior art; among them, (a) is the first rendering effect of the prior art; (b) is the first rendering effect of the present invention; Figure 6 is a comparison diagram of the third viewing effects of the log presentation method in the present invention and the prior art; among them, (a) is the first rendering effect of the prior art; (b) is the first rendering effect of the present invention; Figure 7It is a schematic diagram of generating log content by using the log presentation method in the present invention. Detailed implementation manners

[0017] The following combines the accompanying drawings and embodiments to further describe in detail the detailed implementation manners of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0018] To better understand the purpose, structure and function of the present invention, the following further describes the present invention in detail in conjunction with the accompanying drawings.

[0019] The present invention provides a method for presenting block logs, including the following steps, as Figure 1 shown: S1. Record the logs and obtain the structured log content; extract the overview information of the structured log content according to user requirements; In the above S1, extracting the overview information of the structured log content according to user requirements specifically includes: Through html, markdown or other graphical interface technologies, the sorted content is generated according to the format standards required by the interface technology, and after generation, these technologies are responsible for presenting in the interaction, including the following steps: S101. After the sorted log records are stored structurally, the log content convenient for users to read is not generated temporarily; S102. When receiving the viewing action of the user, based on the structurally stored data, expand and generate the visual log content; S103. Convert the data sequence of the structurally stored data into a memory object, and at the same time extract the overview information from the structurally stored data to facilitate users to quickly read.

[0020] In this embodiment, when recording the logs, it also includes: expanding the API of the logs and attaching different tags to different logs, and performing special processing according to different tags during subsequent presentation. The expanded APIs include but are not limited to SQL, XML, JSON, LoopStart, LoopEnd, HttpStart, HttpEnd, BlockStart and BlockEnd. After users use these APIs, tags are automatically attached to the log content, which is convenient for the generation of subsequent presentation content.

[0021] The structured log content includes: whether the input parameters are provided according to the specification or whether the thread calls according to the specification. After intercepting the logs, it is decided according to the user settings whether to organize them immediately according to the presentation method or store them as structured data, and then organize and present them when needed for reading.

[0022] S2. When determining whether there are errors or warnings during the process of extracting overview information, if so, extract the error or warning information generated in the structured log content, analyze the nodes of the error or warning information, and generate an anchor link and a highlighted color tag; In this embodiment, if there are errors or warnings in the log content and the corresponding content provides a solution according to the specification, the content of the solution is extracted to the position of the third line to facilitate users to quickly solve the problem.

[0023] In the above S2, the overview information includes: log ID, main thread consumption time, maximum log level, number of errors generated, number of warnings generated, number of child threads generated during the execution process, and execution time information of the longest-consuming child thread.

[0024] When the time taken for the extraction process of the overview information is greater than the specified time set, analyze the node of the log with the highest consumption time in the whole process, generate an anchor link for the node of the log, and generate an anchor link and a highlighted color tag for the main thread consumption time content. Users can jump to the corresponding log node by clicking the added anchor.

[0025] When the number of child threads of the overview information is greater than 0, analyze the thread situation generated in the whole process and calculate the execution time of the longest-consuming child thread, generate an anchor connection for the node of the log of the first or longest-consuming child thread, and add an anchor and a highlighted color tag to the corresponding number of child threads. Users can jump to the corresponding log node by simply clicking this anchor.

[0026] S3. If not, extract the process input parameters, generate a collapsible label for the content in the tags or features of the structured log content that exceeds the specified length, and generate the log content; for the content that meets the specified length, directly generate the log content; In this embodiment, the process input parameters are extracted to the fourth line, and a collapsible label is generated for the content that exceeds a certain length, such as exceeding 200 characters. Detect whether there are problems with the log records, such as whether the input parameters are provided according to the specification, whether the threads are called according to the specification, etc. If there are problems, generate a warning message for the log record, and this message informs the user that the log record method needs to be adjusted.

[0027] S4. During the process of generating the log content, calculate the consumption time of the upper and lower nodes and mark the color of the consumption time to achieve the presentation of the block log.

[0028] In the above S4, the process of generating the log content includes the following steps: S401. Identify the tags or features of the log content. When there are SQL, JSON, XML tags in the tags or features, extract the content that conforms to these formats, format the extracted content, and generate a collapsible label, and generate a unique ID for the collapsible label; S402. When there are LoopStart, HttpStart, and BlockStart tags in the label or feature, extract backward from the current log node until the corresponding End tag is found, generate a collapsible tag for this content, and at the same time detect whether the record type of this content is a warning, error, or long-duration content; if it is a warning or error, change the display color of this content; In this embodiment, as Figure 4 in (b), as Figure 5 in (b), as Figure 6 in (b) and Figure 7 the text with color words in are all key information, and the following examples are given: as Figure 4 the red word "Error" in (b) of indicates that there is a warning message in the log content, while "Errors: 3" indicates that there are 3 error messages; "Warns: 3" indicates that there are 3 warning messages. When clicking on the colored text, you can directly locate the anchor position where the problem appears; for example: clicking on the red word "Error" can directly locate to Figure 4 the place where the red word "Expand to view loop log ---- Connotation error" in (b) of, and the user can select the specified anchor point in the form of a pop-up window or dropdown, which can facilitate the user to view the errors that occur and search for solutions targeted at the errors that occur.

[0029] S403. If there are no LoopStart and HttpStart tags in the label or feature, but the number of logged log nodes exceeds 100 lines, automatically detect the duplicate log content. If duplicate content is detected, extract the duplicate content, and then repeat step B2, extract backward from the current log node until the corresponding End tag is found, generate a collapsible tag for this content, and at the same time detect whether there are warnings, errors, or long-duration content in this content. If so, change the display color of this content; S404. Calculate the time consumption of the upper and lower nodes during the generation process. When it is greater than the specified monitoring time (for processes greater than 1 millisecond, generate the specific consumption time in milliseconds, for nodes exceeding 10 milliseconds), automatically mark the consumption time as red for easy reading; S405. For extremely large chunks of log content, automatically generate asynchronous content nodes. If the collapsed content has no warnings, errors, or overly long execution times, only generate one tag. After the important content is displayed, insert the collapsed content into these tags through the ID of the collapsible tag; or by monitoring the user click event, determine whether there is content. If there is no content, automatically obtain the content and present it; S406. When storing multiple log logical blocks in one file or merging multiple log contents for presentation, a folding label is generated for each log logical segment.

[0030] Next, continue to analyze and generate the specific log content, and the following is a specific description, as Figure 2 shown below: 1) Identify the log content label or feature. For example, the identification of a tagless JSON is as follows: if the content contains both "[ or {" and ":" and "}" at the same time, it can be identified, and the other identification principles are similar; 2) If the label or feature of the content conforms to SQL, JSON, or XML, extract the content that conforms to these formats, format the extracted content. At the same time, since this content may occupy many lines, generate a folding label for this content, generate a unique ID for the folding label (subsequently used for positioning), and monitor whether the record type of this content is a warning, error, or long-duration content. If it is a warning or error, change the presentation color of this content, such as red, for easy user reading; 3) If the content contains tags such as LoopStart, HttpStart, BlockStart, etc., extract from the current log node backward until the corresponding End tag is found, and generate a folding label for this content. At the same time, detect whether this content contains warnings, errors, or long-duration content. If so, change the presentation color of this content, such as red, for easy user reading; 4) If the content does not contain tags such as LoopStart and HttpStart, but the logged log nodes exceed 100 lines, automatically detect the duplicate log content. If duplicate content is detected, extract the content, and then repeat step 3) to prevent the continuous and repeated log content from occupying a large amount of space when the caller does not use such tags; 5) These generated folding labels are folded by default, and the user needs to click to expand to view the detailed content. However, for the content that has generated errors or warnings, it will be automatically expanded to reduce user operations; 6) For the program classes or methods recorded in the log, they will be identified with other colors, such as, for easy user access to the execution process; 7) During the generation process, calculate the time consumption of the upper and lower nodes. For processes greater than 1 millisecond, generate the specific consumption time in milliseconds. For nodes exceeding 10 milliseconds, automatically mark the consumption time as red for easy reading.

[0031] 8) For extremely large log content (such as over a thousand lines or over 100,000 bytes), automatically generate asynchronous content nodes to improve presentation performance. When there are no warnings, errors, or overly long execution times in the collapsed content, only generate one label. After the important content is displayed, insert the collapsed content into these labels through the ID of the collapsed label. It is also possible to monitor the user click event to determine if there is content. If there is no content, automatically obtain and present the content, thereby achieving the purpose of high-performance presentation, solving performance issues and significantly reducing lags in editors, browsers, etc.; When storing multiple log logic blocks in one file or merging multiple log contents for presentation, generate a collapsed label for each log logic segment.

[0032] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for presenting block logs, characterized in that, Including the following steps: S1. Record the logs and obtain the structured log content; extract the overview information of the structured log content according to the user requirements; S2. When it is determined that there are errors or warnings during the process of extracting the overview information, if so, extract the error or warning information generated in the structured log content, analyze the nodes of the error or warning information, and generate anchor links and marked highlighting colors; S3. If not, extract the process input parameters, generate collapsible labels for the content in the tags or features of the structured log content that exceeds the specified length, and generate the log content; for the content that meets the specified length, directly generate the log content; S4. During the process of generating the log content, calculate the elapsed time between the upper and lower nodes and mark the elapsed time with colors to achieve the presentation of block logs.

2. The method for presenting block logs according to claim 1, wherein In S1, while recording the logs, it also includes: expanding the API of the logs and adding different tags to different logs.

3. The method for presenting block logs according to claim 1, characterized in that In S1, extracting the overview information of the structured log content according to the user requirements includes the following steps: S101. After the sorted log records are stored structurally, the log content that is convenient for users to read is not generated temporarily; S102. When receiving the user's viewing action, based on the structurally stored data, expand and generate the visual log content; S103. Convert the data sequence of the structurally stored data into a memory object, and at the same time extract the overview information from the structurally stored data for the user to quickly read.

4. The method for presenting a block log according to claim 1, wherein In S1, the overview information includes: log ID, main thread consumption time, maximum log level, number of errors generated, number of warnings generated, number of child threads generated during the execution process, and execution time information of the longest-consuming child thread.

5. The method for presenting a block log according to claim 2, wherein The extended APIs include: SQL, XML, JSON, LoopStart, LoopEnd, HttpStart, HttpEnd, BlockStart, and BlockEnd.

6. The method for presenting block logs according to claim 4, wherein In S2, when the time taken for the extraction process of the overview information is greater than the set time, analyze the node of the log with the highest elapsed time in the whole process, generate an anchor link for the node of the log, generate an anchor link and mark the highlighting color for the main thread elapsed time content, and the user can jump to the corresponding log node by clicking the added anchor.

7. The method for presenting block logs according to claim 4, wherein When the number of child threads in the overview information is greater than 0, analyze the thread situation generated in the whole process and calculate the execution time of the longest-consuming child thread, generate an anchor connection for the node of the first or longest-consuming child thread log, and add anchors and mark the highlighting color for the corresponding number of child threads. The user can jump to the corresponding log node by simply clicking this anchor.

8. The method for presenting a block log according to claim 1, characterized in that, In S3, the process of extracting the process input parameters also includes: detecting whether the structured log content provides input parameters according to the specification or whether the thread calls according to the specification; if there are problems, generate warning information for the log record and inform the user that the log record needs to be adjusted.

9. The method for presenting a block log according to claim 1, wherein In S4, the process of generating the log content includes the following steps: S401. Identify the tags or features of the log content. When the tags or features include SQL, JSON, or XML tags, extract the content that conforms to these formats, format the extracted content, generate a collapsible tag, and generate a unique ID for the collapsible tag; S402. When the tags or features include LoopStart, HttpStart, or BlockStart tags, extract from the current log node backward until the corresponding End tag is found, generate a collapsible tag for this content, and at the same time detect whether the record type of this content is warning, error, or long-duration content; if it is a warning or error, change the presentation color of this content; S403. If the tags or features do not include LoopStart or HttpStart tags, but the number of logged log nodes exceeds 100 lines, automatically detect duplicate log content. If duplicate content is detected, extract the duplicate content, and then repeat the process in step B2: extract from the current log node backward until the corresponding End tag is found, generate a collapsible tag for this content, and at the same time detect whether this content contains warning, error, or long-duration content. If so, change the presentation color of this content; S404. Calculate the time consumption between the upper and lower nodes during the generation process. When it is greater than the specified monitoring time, automatically mark the consumption time as red for easy reading; S405. For extremely large chunks of log content, automatically generate asynchronous content nodes. If the collapsed content has no warnings, errors, or excessive execution time, only generate one tag. After the important content is displayed, insert the collapsed content into these tags through the ID of the collapsible tag; or by monitoring the user click event, determine whether there is content. If there is no content, automatically obtain the content and present it; S406. When storing multiple log logic blocks in one file or merging multiple log contents for presentation, generate a collapsible tag for each log logic segment.

Citation Information

Patent Citations

  • Log highlighting method and device, storage medium and Android terminal

    CN108959199A

  • Problem analysis assisting method and device and electronic equipment

    CN115168082A

  • Software log processing method

    CN116049115A

  • Dynamic log series and business logic graphical analysis method and system

    CN119357147A

  • Method and system for log file processing and generating a graphical user interface based thereon

    US20090249250A1