Information processing method and device, computer device and storage medium

By recognizing and replacing the format of log information, generating replacement text, and displaying it visually, the problem of high difficulty in querying log information is solved, and the efficiency of log information processing and querying is improved.

CN115525802BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-06-25
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

The existing method of displaying log information directly in the user interface increases the difficulty for users to query, and how to reduce the difficulty of querying log information has become a research hotspot.

Method used

By recognizing the format of log information, extracting object text and generating replacement text, updating log information, and using rendering functions for visualization, HTML rendering is avoided to prevent XSS attacks, and interactive object tags and highlighting query functions are provided.

Benefits of technology

It improves the efficiency of log information processing, reduces storage resource consumption, enhances the efficiency and accuracy of log information retrieval, and simplifies the storage and rendering of log information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525802B_ABST
    Figure CN115525802B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose an information processing method and device, computer equipment and a storage medium, wherein the method comprises: obtaining log information, the log information comprising one or more log texts; performing format identification on the text format of each log text in the log information, and extracting an object text from the one or more log texts according to the identification result of the format identification; analyzing the type of the object text, and generating a replacement text of the object text according to the analyzed type; and updating the log information by using the replacement text, which can improve the processing efficiency of the log information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an information processing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] With the continuous development of internet technology, more and more applications are emerging. To effectively analyze the operation of these applications, technicians typically collect log information generated during their operation and analyze this log data. However, current methods for analyzing log information usually involve directly displaying the collected log information in the user interface's log list. This direct display increases the difficulty for users to query the log information. Therefore, how to process log information to reduce the difficulty for users to query it has become a current research hotspot. Summary of the Invention

[0003] This invention provides an information processing method, apparatus, computer device, and storage medium that can improve the efficiency of log information processing.

[0004] On one hand, embodiments of the present invention provide an information processing method, including:

[0005] Obtain log information, which includes one or more log texts;

[0006] The text format of each log text in the log information is identified, and the object text is extracted from the one or more log texts based on the identification result of the format identification.

[0007] The type of the object text is parsed, and a replacement text for the object text is generated based on the parsed type;

[0008] The log information is updated using the replacement text.

[0009] In another aspect, embodiments of the present invention provide an information processing apparatus, comprising:

[0010] An acquisition unit is used to acquire log information, wherein the log information includes one or more log texts;

[0011] The text format of each log text in the log information is identified, and the object text is extracted from the one or more log texts based on the identification result of the format identification.

[0012] The processing unit is used to parse the type of the object text and generate replacement text for the object text based on the parsed type;

[0013] The processing unit is also used to update the log information using the replacement text.

[0014] In one embodiment, each log text in the log information is text after escaping; the log text is the object text or character text.

[0015] After escaping, the object text in the log information will be identified using the first symbol, the character text in the log information will be identified using the second symbol, and a space will be added between the object text and the character text.

[0016] In one embodiment, the processing unit is specifically used for:

[0017] From the log texts included in the log information, search for target characters that are not identified by the second symbol and are not spaces;

[0018] Repeat the above steps, and use the text composed of the found target characters as the object text;

[0019] In the log information, all text other than the object text is character text.

[0020] In one embodiment, the second symbol includes quotation marks, which include opening quotation marks and closing quotation marks; the processing unit is specifically used for:

[0021] Identify the opening quotation mark from the log information, and after identifying the opening quotation mark, identify the reference character that is not a quotation mark from the log information;

[0022] Identify the back quotation mark corresponding to the opening quotation mark from the log information;

[0023] Repeat the above steps, and use the text consisting of the reference characters located between the opening quotation mark and the corresponding closing quotation mark in the log information as the character text;

[0024] The text other than the character text in the log information is used as the object text.

[0025] In one embodiment, the object text type includes composite type and single type. The composite type object text includes at least two data types of text, and the single type object text includes text of one data type. The data types include at least one or more of the following: object type, array type, and string type. The processing unit is specifically used for:

[0026] If the parsed type is the composite type, a replacement placeholder is generated and used as the replacement text for the object text. The replacement placeholder includes at least one or more of the following fields: symbol identifier, line number of the object text in the log information, and sequence number of the object text.

[0027] If the parsed type is the single type, then the characters in the object text are used as the replacement text of the object text.

[0028] In one embodiment, the replacement text is located in an even-numbered segment of the updated log information; the processing unit is further configured to extract the replacement text located in the even-numbered segment from the updated log information in response to a display trigger operation for the updated log information;

[0029] The acquisition unit is also used to acquire a rendering function for rendering and displaying the replaced text;

[0030] The processing unit is further configured to call the rendering function to render and display the object text replaced by the replacement text according to the position of the replacement text in the updated log information.

[0031] In one embodiment, if the log information includes log text that also includes character text, and the character text is located in the odd-numbered segments of the updated log information; the processing unit is further configured to extract the character text located in the odd-numbered segments from the updated log information;

[0032] The processing unit is also configured to return and display each character in the character text as is, according to the position of the character text in the updated log information.

[0033] In one embodiment, the processing unit is specifically used for:

[0034] The rendering function is invoked to replace each object in the object text replaced by the replacement text with an interactive object label, and the interactive object label is rendered and displayed.

[0035] In one embodiment, the number of objects included in the object text replaced by the replacement text is one or more; the processing unit is specifically used for:

[0036] Obtain the priority of any one of the one or more objects of the object text, and determine the rendering attributes of the object based on the priority, wherein the rendering attributes include color attributes or transparency attributes;

[0037] The rendering function is invoked, and any object in the text replaced by the replacement text is rendered and displayed according to the rendering attributes.

[0038] In one embodiment, the object text replaced by the replacement text is collapsed when rendered, and the character text included in the log information is expanded when rendered.

[0039] The acquisition unit is also used to acquire log search information input by the user and construct a regular expression based on the log search information;

[0040] The processing unit is further configured to perform a search and match in the collapsed object text according to the constructed regular expression, expand the object text that matches the regular expression, and highlight the objects that match the regular expression in the expanded object text.

[0041] In one embodiment, the processing unit is specifically used for:

[0042] The log search information is cleaned, and strings are extracted from the cleaned search information; wherein, the information cleaning includes one or more of the following: deduplication, truncation, and space removal.

[0043] A regular expression is constructed based on the extracted strings; if there is only one extracted string, then the extracted string is the regular expression; if there are at least two extracted strings, then the at least two strings are concatenated using a concatenation operator, and the concatenated string is the regular expression.

[0044] In another aspect, embodiments of the present invention provide a computer device, including a processor, an input device, an output device, and a memory, wherein the processor, input device, output device, and memory are interconnected, wherein the memory is used to store a computer program supporting the computer device in executing the above-described method, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the following steps:

[0045] Obtain log information, which includes one or more log texts;

[0046] The text format of each log text in the log information is identified, and the object text is extracted from the one or more log texts based on the identification result of the format identification.

[0047] The type of the object text is parsed, and a replacement text for the object text is generated based on the parsed type;

[0048] The log information is updated using the replacement text.

[0049] In another aspect, embodiments of the present invention provide a computer-readable storage medium storing program instructions, which, when executed by a processor, are used to perform the information processing method as described in the first aspect.

[0050] In this embodiment, after obtaining log information, the computer device can perform format recognition on the text format of each log text included in the log information. Then, based on the recognition result, it can extract object text from the log text included in the log information. Furthermore, the computer device can parse the type of the object text and generate a replacement text for the object text based on the parsed object text type. The replacement text is then used to update the log information, allowing the computer device to render and display the log information based on the updated log information. Replacing the object text in the original log information with the replacement text reduces the storage resources occupied by the computer device for storing log information. Moreover, it can also improve the processing efficiency of the computer device in rendering and displaying based on the updated log information. Attached Figure Description

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

[0052] Figure 1a This is a schematic diagram of log information provided in an embodiment of the present invention;

[0053] Figure 1b This is a schematic diagram illustrating the identification and processing of log information provided in an embodiment of the present invention;

[0054] Figure 2 This is a schematic flowchart of an information processing method provided in an embodiment of the present invention;

[0055] Figure 3 This is a schematic diagram of a nondeterministic finite state automaton provided in an embodiment of the present invention;

[0056] Figure 4 This is a schematic flowchart of an information processing method provided in an embodiment of the present invention;

[0057] Figure 5a This is a schematic diagram illustrating the identification of log information provided in an embodiment of the present invention;

[0058] Figure 5b This is a schematic diagram of displaying log information provided in an embodiment of the present invention;

[0059] Figure 5c This is a schematic diagram illustrating how log information is highlighted according to an embodiment of the present invention;

[0060] Figure 5d This is a schematic diagram illustrating how log information is displayed according to an embodiment of the present invention;

[0061] Figure 6 This is a schematic block diagram of an information processing device provided in an embodiment of the present invention;

[0062] Figure 7 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0063] This application proposes an information processing method that enables a computer device to extract object text from log information by recognizing the text within the log information. After extracting the object text, the method can further parse the type of the object text, thereby replacing and updating the original log information. Based on this replacement and update, the computer device can improve the efficiency of subsequent processing of the updated log information, thus improving the efficiency of log information retrieval by technicians. Log information is used to record system operation events and plays an important role in processing historical data, diagnosing problems, and understanding system activities. Log information can be used to assist technicians in understanding the activities of complex systems, especially complex system activities executed in applications with minimal user interaction. In this application embodiment, the log information mainly includes log information collected for cloud development of mini-programs within applications. In one embodiment, the application can be a computer program that performs one or more specific tasks, runs in user mode, interacts with the user, and has a visual user interface. Specifically, the application can be a social application, a game application, or an information application, etc., while a mini-program refers to an application that depends on the application but can be used without downloading or installing it. In one embodiment, cloud development for mini-programs is currently the officially recommended backend service solution. During the use of cloud development, the collection and review of log information is crucial. The collection and review of log information helps technicians to perform structured analysis of the mini-program based on the content recorded in the log information, thereby improving the efficiency and accuracy of the analysis. The information processing method for processing log information proposed in this application can effectively improve the efficiency of computer equipment in processing log information, thereby improving the efficiency of technicians in analyzing mini-programs, and thus achieving a further improvement in the efficiency of mini-program analysis.

[0064] In one embodiment, cloud development refers to a developer tool for mini-programs, designed to help developers easily and efficiently develop and debug mini-programs. Therefore, cloud development for mini-programs can be understood as a serverless backend service for mini-program developers, requiring no maintenance. After cloud development of a mini-program is completed, a log service can be provided, allowing computer devices to collect plain text log information generated by the mini-program. This log information includes one or more log texts. Among these log texts, those used to record important system operations and assisting technical personnel in program analysis are in a fixed object format. In other words, among the multiple log texts included in the log information, the log text used to record important information is the object text. Therefore, the information processing method proposed in this application can extract the object text from the log information by identifying the important object text within the plain text log information. In one embodiment, the log information obtained by the computer device from the mini-program device can be either the log information before or after escaping processing. That is, after the log information of the mini-program is generated, it can be directly sent to the computer device, which can then escape each character in the log information to obtain one or more log texts. Alternatively, the terminal device running the mini-program can first escape the characters in the log information generated by the mini-program and then send the escaped log information to the computer device. In this embodiment, there is no restriction on the executing entity that performs the escaping processing on the log information.

[0065] After the log information has been escaped, characters in object format will be marked with a first symbol, while ordinary characters will be marked with a second symbol. This object format includes JSON (JavaScript Object Notation) object format, where JSON is a lightweight data interchange format. In one embodiment, since characters in JSON object format are recorded using a fixed target format, it can be understood that the text in JSON object format is the JSON object. JSON objects are enclosed in curly braces ({}). JSON objects are written as key-value pairs, where the key is a string and the corresponding value is a valid JSON data type. Valid JSON data types include string types, number types, object types, etc. Furthermore, when writing JSON objects using key-value pairs, the key and value are separated by a colon, and each key-value pair is separated by a comma. Therefore, the first symbol mentioned above is curly braces, and the second symbol used to identify ordinary characters is quotation marks. Specifically, as shown below... Figure 1aAs shown, the string "xxxxxxxx" marked with 10 and enclosed in quotes is ordinary character text in the log text, while the string marked with 11 and enclosed in curly braces is the object text of the JSON object.

[0066] Since important information in log messages is recorded in object text, and the format of object text differs from that of ordinary text after escaping, computer devices can extract object text from one or more log texts within the log message by recognizing the text format of the log text. After extracting the object text, the computer device can further determine its type. Once the type is determined, the computer device can generate corresponding replacement text based on the object text type to simplify the log message. It's understandable that if the extracted object text is a composite type containing at least two data types, then the extracted object text contains many objects, and the computer device can generate a shorter replacement placeholder to replace the extracted object text. Conversely, if the extracted object text contains only one data type, then the single-type object text contains only one object, and the computer device can directly return the characters contained in the object text as is.

[0067] After recognizing the format of log text in log information, the computer device can mark the log text based on the recognition result, and then filter out the target text from the log information. The process of the computer device marking the log text based on the result of the text format recognition can be as follows: Figure 1b As shown, after generating a replacement text for the object text, the computer device can use this replacement text to update the original object text in the log information, thereby obtaining the updated log information. After obtaining the updated log information, the computer device can also perform visual rendering output, which allows technicians to effectively analyze the operation and development process of the mini-program based on the rendered log information, thereby achieving effective restoration of the log structure.

[0068] Please see Figure 2 This is a schematic flowchart of an information processing method provided in an embodiment of this application, such as... Figure 2 As shown, the method may include:

[0069] S201, retrieve log information, which includes one or more log texts.

[0070] S202, perform format recognition on the text format of each log text in the log information, and extract the object text from one or more log texts based on the recognition result.

[0071] In steps S201 and S202, after obtaining the log information, the computer device can extract the object text from the log information by recognizing the difference in format between the object text used to record important information and ordinary character text. In one embodiment, the computer device can use regular expressions to perform format recognition processing on the log text. The regular expression describes a string matching pattern, which can be used to check whether a string contains a certain substring, replace matching substrings, or extract substrings that meet certain conditions from a string. The execution logic of the regular expression used by the computer device for format recognition may include either of the following two steps:

[0072] ① Find a character that is neither a space nor a quotation mark, repeat it at least once, and as many times as possible.

[0073] ② First find a quotation mark, then find a character that is not a quotation mark, and repeat as many times as possible;

[0074] Alternatively, find one quotation mark, find the second quotation mark, match it once, and repeat the loop as many times as possible.

[0075] When the computer device performs the above-mentioned format recognition steps, the rules in ① and ② are applied at least once, and as many times as possible, and the current match is not captured.

[0076] In one embodiment, the computer device may also employ a nondeterministic finite state automaton to recognize the text format of the log text in the log information. This nondeterministic finite state automaton can be used as follows: Figure 3 As shown, the nondeterministic finite state automaton is a finite state automaton where each state and input symbol pair can have multiple possible next states. This nondeterministic finite state automaton transforms each input symbol into a new state by consuming the string of input symbols, until all input symbols are exhausted. Figure 3 The nondeterministic finite automaton shown uses ` to represent quotation marks, s to represent a space, and ^ to represent any character except ..., as shown in the example. Figure 3 The [^`s] in the text represents characters other than quotation marks and spaces. Therefore, it can be understood that, through... Figure 3The nondeterministic finite state automaton shown allows the computer device to capture the entire text matched by a regular expression as many times as possible (i.e., global matching), thereby achieving the segmentation of the information log. Specifically, because the computer device uses a greedy algorithm (i.e., multiple matches with backtracking as needed) to identify the format of the log text and extract the object text, even if the log information contains nested quotation marks and parentheses, it can still be segmented correctly.

[0077] After the computer device extracts the object text from the log text, it can parse the object text to determine the type of the object text, and then generate the corresponding replacement text based on the type of the object text, and then proceed to step S203.

[0078] S203, parse the type of the object text and generate replacement text for the object text based on the parsed type.

[0079] S204, use replacement text to update log information.

[0080] In steps S203 and S204, since the object text in the log text is a JSON object, the computer device can use the language's native JSON parsing engine to parse the JSON object. Based on the parsing result of the JSON parsing engine, the computer device can determine the type of the JSON object and, depending on the type of the JSON object, use different strategies to generate replacement text for the object text. Specifically, the strategies used by the computer device to generate replacement text for the object text based on the parsing result of the object text type include:

[0081] (1) If the computer device determines that the object text is a complex object (or composite object) after parsing the type of the object text, where a complex object is an object that includes objects, arrays, etc., a replacement placeholder can be generated and a hash table can be used to retain the relationship between the replacement placeholder and the object itself for use in subsequent stages. The format of the replacement placeholder can be: [CC-OBJ-log line-serial number].

[0082] (2) If the parsed result is a string or a primitive type such as a number, return it as is.

[0083] After the computer device generates a replacement text for the object text based on the parsing of the object text type, the log information can be updated based on the replacement text. In one embodiment, the process of the computer device updating the log information with the replacement text is the process of replacing the object text in the log information with the replacement text. After the computer device replaces the object text with replacement text, it can also perform visual rendering of the updated log information. When rendering the updated log information, the computer device uses a rendering function to replace the object text with interactive object tags, rather than rendering it using HTML (HyperText Markup Language). When rendering the object text in the log information using HTML, the user-related content recorded in the log information is output as dynamic content. However, in this embodiment, when rendering the object text in the log information based on a rendering function, each object in the object text is rendered as an interactive object tag. In other words, according to the method of rendering the object text in the log information in this application, the objects in the object text are rendered as plain text for output. This allows the computer device to achieve log information rendering output without using HTML, thereby effectively avoiding XSS (CrossSite Scripting). This reduces the attack surface of cross-site scripting (XSS) attacks, thus saving the overhead of filtering log content on computer devices to combat such attacks. XSS attacks involve exploiting website vulnerabilities to maliciously steal information from users. Furthermore, by replacing log information with interactive object tags during rendering, the computer device can provide interactive capabilities for technicians. In one embodiment, the computer device can also provide highlighted query display and collapsed display functions when rendering interactive object tags, thereby effectively improving the smoothness of log querying for technicians.

[0084] In this embodiment, after obtaining log information, the computer device can perform format recognition on the text format of each log text included in the log information. Then, based on the recognition result, it can extract object text from the log text included in the log information. Furthermore, the computer device can parse the type of the object text and generate a replacement text for the object text based on the parsed object text type. The replacement text is then used to update the log information, allowing the computer device to render and display the log information based on the updated log information. Replacing the object text in the original log information with the replacement text reduces the storage resources occupied by the computer device for storing log information. Moreover, it can also improve the processing efficiency of the computer device in rendering and displaying based on the updated log information.

[0085] Please see Figure 4 This is a schematic flowchart of an information processing method proposed in an embodiment of this application, such as... Figure 4 As shown, the method may include:

[0086] S401, retrieve log information, which includes one or more log texts.

[0087] S402, perform format recognition on the text format of each log text in the log information, and extract the object text from one or more log texts based on the recognition result.

[0088] In steps S401 and S402, the log texts in the log information obtained by the computer device are texts after escaping processing; the log texts are either object texts or character texts. After escaping, the object texts in the log information are identified using a first symbol, and the character texts are identified using a second symbol, with a space added between the object texts and the character texts. Since the object texts in the log information are JSON objects, the first symbol can be curly braces, and the second symbol can be quotation marks. Based on the differences in the recording format of the texts in the log information, when the computer device performs format recognition on the text format of each log text and extracts the object text from one or more log texts according to the recognition result, it can first search for target characters in each log text that are not identified by the second symbol and are not spaces. By repeating the above steps, the computer device can use the text composed of the found target characters as the object text. All other texts in the log information besides the object text are character texts.

[0089] In one embodiment, since the second symbol includes quotation marks, and quotation marks include opening quotation marks and closing quotation marks, when the computer device performs format recognition on the text format of each log text in the log information and extracts object text from one or more log texts based on the format recognition result, it can first identify the opening quotation mark from the log information, and after identifying the opening quotation mark, identify the reference character that is not a quotation mark from the log information; then, it can identify the closing quotation mark corresponding to the opening quotation mark from the log information; by repeating the above steps, the text composed of the reference character located between the opening quotation mark and the corresponding closing quotation mark in the log information can be regarded as character text, and the other text in the log information other than character text can be regarded as object text. Wherein, after the computer device performs format recognition on the text format of each log text in the log information as described above, it can extract object text as follows: Figure 5a As shown, it can be seen that based on the computer device's recognition of the text format in the log text, it can successfully distinguish JSON strings from ordinary text, numbers, and other information. Furthermore, based on the computer device's recognition of the text format of each log text in plain text log information, as well as the segmentation of JSON objects (i.e., object text) and text parts (i.e. character text) in the log information, it is possible to effectively simplify the log information in the computer device.

[0090] S403, parse the type of the object text and generate replacement text for the object text based on the parsed type. The replacement text is located in the even-numbered segments of the updated log information.

[0091] S404 uses replacement text to update log information.

[0092] In steps S403 and S404, after parsing the type of the object text, the computer device obtains a type that includes composite types and single types. Composite type object text includes text of at least two data types, while single type object text includes text of one data type. The data types include at least one or more of the following: object type, array type, and string type. When the computer device generates replacement text for the object text based on the parsed type, if the parsed type is composite, the computer device generates a replacement placeholder and uses it as the replacement text for the object text. The replacement placeholder includes at least one or more of the following fields: symbol identifier, the line number of the object text in the log information, and the sequence number of the object text. If the parsed type is single, the computer device uses the characters in the object text as their original form as the replacement text for the object text. The original character form is the character without quotation marks. For example, if the original character form in the object text is {“abc”}, then when the computer device uses the original character form in the object text as the replacement text for the object text, the replacement character is “abc”.

[0093] In one embodiment, based on the computer device's parsing of the object text type in the log information, after the computer device generates replacement text for the object text, it can use the replacement text to update the log information. After the computer device updates the log information, it can further render and output the updated log information. When rendering and outputting the updated log information, the computer device can replace the pre-reserved replacement text (such as the replacement placeholder mentioned above) in the log information with an interactive object structure. The specific rendering process includes the following steps:

[0094] ① Segment the input text (i.e., the updated log information) according to specific rules for replacing placeholder text;

[0095] ② For the segmented text, find all even-numbered segments and hand them over to the provided predefined rendering function for processing (hereinafter referred to as "rendering function"). The replacement text is located in the even-numbered segments of the updated log information. Based on the search of even-numbered segments, the computer device can find the replacement placeholder in the updated log information.

[0096] ③ The rendering function replaces even-numbered text segments with tags of interactive objects (i.e., interactive object tags, or interactive object tags), which provide interactive capabilities;

[0097] ④ Return the text of other sections as is.

[0098] In other words, when the computer device needs to render and display the updated log information, it can render and display it based on the rendering function, that is, it will execute step S405.

[0099] S405, in response to a display trigger operation for updated log information, extracts replacement text located in even-numbered segments from the updated log information.

[0100] S406, Obtain the rendering function used to render and display the replacement text.

[0101] S407, according to the position of the replacement text in the updated log information, call the rendering function to render and display the object text replaced by the replacement text.

[0102] In steps S405 to S407, after updating the log information with replacement text, the computer device can also render and display the updated log information. It is understood that, based on the unique recording format of log information, the object text in the log information is recorded in even-numbered segments, while the character text is recorded in odd-numbered segments. This means that in the updated log information, the replacement text is also located in an even-numbered segment. Therefore, when rendering and displaying the updated log information, the computer device can identify segments in the updated log information by recognizing space characters, and then extract the replacement text located in even-numbered segments from the updated log information. The rendering function is then called to render and display the object text replaced by the replacement text. If the log information includes character text, then the character text is located in an odd-numbered segment of the updated log information. Therefore, the computer device can extract the character text located in an odd-numbered segment from the updated log information and return each character in the character text as is, according to its position in the updated log information.

[0103] In one embodiment, when the computer device calls the rendering function to render and display the object text replaced by the replacement text, it can call the rendering function to replace each object in the object text replaced by the replacement text with interactive object tags and render and display the interactive object tags. It can be understood that the way of rendering each object in the object text replaced by the replacement text as interactive object tags based on the rendering function is to render the objects included in the object text in the original log information as interactive text, which can also solve the risk of XSS attacks caused by HTML rendering. When a computer device calls a rendering function to render and display the object text replaced by the replacement text, since the object text replaced by the replacement text includes one or more objects, the computer device can first obtain the priority of any one of the one or more objects in the object text, and determine the rendering attribute of any object based on the priority. The rendering attribute includes color attribute or transparency attribute. Furthermore, the computer device can call the rendering function and render and display any one of the objects in the object text replaced by the replacement text according to the rendering attribute. It can be understood that any two objects included in the object text have different priorities, and their corresponding rendering colors (or transparency) are also different. For example, the rendering color of an object with a higher priority may be red, while the rendering color of an object with a lower priority may be gray. The transparency of an object with a higher priority may be 100%, while the transparency of another object with a lower priority may be 50%, and so on. In this embodiment, the method by which the computer device renders and displays corresponding objects to different degrees based on object priority is not limited.

[0104] In one embodiment, when a computer device renders and displays updated log information, the object text replaced by the replacement text is collapsed during rendering, while the character text included in the log information is expanded during rendering. Specifically, this can be as follows: Figure 5bAs shown, based on the expanded display of character text, technicians can quickly browse the log information, thereby improving the smoothness of their code debugging process. When rendering objects in the object text, the computer device can either collapse all objects, displaying only the character text in the user interface; or it can collapse only a portion of the objects, displaying only a portion of the objects in the user interface along with the character text. In one embodiment, when rendering a portion of the objects in the object text, the computer device can select objects with higher priority from the object text as the objects to be displayed in the user interface; or it can randomly select a portion of the objects from the object text for rendering in the user interface.

[0105] Based on the rendered log information, technicians can use this computer device to retrieve and query the log information. In specific implementation, the computer device can obtain the log search information input by the user and construct a regular expression based on the log search information. Furthermore, the computer device can perform a search and match on the collapsed object text according to the constructed regular expression, expand and display the object text that matches the regular expression, and highlight the objects that match the regular expression in the expanded object text. When constructing the regular expression based on the log search information, the computer device can first perform information cleaning processing on the log search information and extract strings from the cleaned search information. Information cleaning includes one or more of the following: deduplication, truncation, and whitespace removal. Then, the computer device can construct a regular expression based on the extracted strings. If there is only one extracted string, the extracted string is the regular expression; if there are at least two extracted strings, the at least two strings are concatenated using a concatenation symbol, and the concatenated string is the regular expression.

[0106] The following is combined Figure 5c The process of technicians retrieving and querying log information using computer equipment is explained. Specifically, when the computer equipment performs a retrieval and query based on the content entered by the technicians, the following steps can be executed:

[0107] ① Remove duplicates and truncate the input from the technicians, removing spaces from the input;

[0108] ② Escape the input content after removing spaces, such as using special characters in regular expressions (backslash, question mark, vertical bar, etc.);

[0109] ③ Concatenate the processed input content with vertical bars to construct a regular expression;

[0110] If the user inputs "abc 123", then after the computer device processes the user input as described above, the constructed regular expression can be "abc|123".

[0111] ④ Use the constructed regular expression to segment the log information displayed on the user interface, and render the matched parts (i.e. the parts that match the regular expression) as highlighted tags, and render the other parts as ordinary text tags.

[0112] Understandably, by highlighting log information, technicians can quickly find the information they need, thus reducing the time spent by technicians when troubleshooting backend issues and improving the efficiency of application development.

[0113] Then combine Figure 5d This document provides a detailed explanation of the entire process by which computer equipment processes log information. Specifically, it details the steps the computer equipment takes after acquiring log information, and how the acquired log information is... Figure 5d Log information marked with 50 can be processed by a computer device based on the recognition of the text format of the log text. The device can then extract object text from the log text based on the recognition result, and further generate corresponding replacement text based on the parsing of the question-and-answer type of the extracted object text to replace and update the original log information. In one embodiment, the object text extracted by the computer device from the log information may be as follows: Figure 5d The object text marked with 51 in the middle, and the corresponding replacement text generated based on the object text can be as follows: Figure 5d The placeholder for the replacement object is marked with 52. After the computer device updates the original log information based on the replacement text, when the updated log information needs to be displayed, the computer device can locate the corresponding replacement text from the updated log information, obtain the rendering function for rendering the replacement text, and then use the rendering function to render the object text replaced by the replacement text. When the computer device uses the rendering function to render the object text replaced by the replacement text, it will provide collapse and highlight functions to improve the efficiency of object querying for technical users. It will also effectively distinguish objects of different levels based on the priority of each object in the log information, thereby enabling the computer device to distinguish log information from the same request and improve the information processing efficiency of the computer device. In one embodiment, the schematic diagram of the computer device rendering the object text and displaying it on the user interface can be as follows: Figure 5dThe interface marked with 53 is shown in the image. This interface renders and displays objects according to their priority, with different priorities using different colors (i.e., in...). Figure 5d The interface marked with 53 uses different shades of gray for rendering and display.

[0114] In this embodiment, after acquiring log information and extracting object text from it based on the recognition of the text format of each log text, the computer device can further parse the type of the object text to generate replacement text. This replacement text can then be used to update the log information. Furthermore, when the log information needs to be triggered for display, the computer device can locate the replacement text from the updated log information and use a rendering function to render and display the object text replaced by the replacement text. This improves the efficiency of log information retrieval, makes code debugging smoother for technicians, reduces the time required for background problem investigation based on log information, and enhances application development efficiency.

[0115] Based on the description of the above information processing method embodiments, this invention also proposes an information processing apparatus, which can be a computer program (including program code) running on the aforementioned computer device. This information processing apparatus can be used to perform tasks such as... Figure 2 and Figure 4 For the information processing method described above, please refer to [link / reference]. Figure 6 The information processing device includes an acquisition unit 601 and a processing unit 602.

[0116] Acquisition unit 601 is used to acquire log information, the log information including one or more log texts;

[0117] The text format of each log text in the log information is identified, and the object text is extracted from the one or more log texts based on the identification result of the format identification.

[0118] Processing unit 602 is used to parse the type of the object text and generate replacement text for the object text based on the parsed type;

[0119] The processing unit 602 is also used to update the log information using the replacement text.

[0120] In one embodiment, each log text in the log information is text after escaping; the log text is the object text or character text.

[0121] After escaping, the object text in the log information will be identified using the first symbol, the character text in the log information will be identified using the second symbol, and a space will be added between the object text and the character text.

[0122] In one embodiment, the processing unit 602 is specifically used for:

[0123] From the log texts included in the log information, search for target characters that are not identified by the second symbol and are not spaces;

[0124] Repeat the above steps, and use the text composed of the found target characters as the object text;

[0125] In the log information, all text other than the object text is character text.

[0126] In one embodiment, the second symbol includes quotation marks, which include opening quotation marks and closing quotation marks; the processing unit 602 is specifically used for:

[0127] Identify the opening quotation mark from the log information, and after identifying the opening quotation mark, identify the reference character that is not a quotation mark from the log information;

[0128] Identify the back quotation mark corresponding to the opening quotation mark from the log information;

[0129] Repeat the above steps, and use the text consisting of the reference characters located between the opening quotation mark and the corresponding closing quotation mark in the log information as the character text;

[0130] The text other than the character text in the log information is used as the object text.

[0131] In one embodiment, the object text type includes composite type and single type. The composite type object text includes at least two data types of text, and the single type object text includes one data type of text. The data types include at least one or more of the following: object type, array type, and string type. The processing unit 602 is specifically used for:

[0132] If the parsed type is the composite type, a replacement placeholder is generated and used as the replacement text for the object text. The replacement placeholder includes at least one or more of the following fields: symbol identifier, line number of the object text in the log information, and sequence number of the object text.

[0133] If the parsed type is the single type, then the characters in the object text are used as the replacement text of the object text.

[0134] In one embodiment, the replacement text is located in an even-numbered segment of the updated log information; the processing unit 602 is further configured to extract the replacement text located in the even-numbered segment from the updated log information in response to a display trigger operation for the updated log information;

[0135] The acquisition unit 601 is also used to acquire a rendering function for rendering and displaying the replacement text;

[0136] The processing unit 602 is further configured to call the rendering function to render and display the object text replaced by the replacement text according to the position of the replacement text in the updated log information.

[0137] In one embodiment, if the log information includes log text that also includes character text, and the character text is located in the odd-numbered segments of the updated log information; the processing unit 602 is further configured to extract the character text located in the odd-numbered segments from the updated log information;

[0138] The processing unit 602 is further configured to return and display each character in the character text as is, according to the position of the character text in the updated log information.

[0139] In one embodiment, the processing unit 602 is specifically used for:

[0140] The rendering function is invoked to replace each object in the object text replaced by the replacement text with an interactive object label, and the interactive object label is rendered and displayed.

[0141] In one embodiment, the number of objects included in the object text replaced by the replacement text is one or more; the processing unit 602 is specifically used for:

[0142] Obtain the priority of any one of the one or more objects of the object text, and determine the rendering attributes of the object based on the priority, wherein the rendering attributes include color attributes or transparency attributes;

[0143] The rendering function is invoked, and any object in the text replaced by the replacement text is rendered and displayed according to the rendering attributes.

[0144] In one embodiment, the object text replaced by the replacement text is collapsed when rendered, and the character text included in the log information is expanded when rendered.

[0145] The acquisition unit 601 is also used to acquire log search information input by the user and construct a regular expression based on the log search information;

[0146] The processing unit 602 is further configured to perform a search and match in the collapsed object text according to the constructed regular expression, expand the object text that matches the regular expression, and highlight the objects that match the regular expression in the expanded object text.

[0147] In one embodiment, the processing unit 602 is specifically used for:

[0148] The log search information is cleaned, and strings are extracted from the cleaned search information; wherein, the information cleaning includes one or more of the following: deduplication, truncation, and space removal.

[0149] A regular expression is constructed based on the extracted strings; if there is only one extracted string, then the extracted string is the regular expression; if there are at least two extracted strings, then the at least two strings are concatenated using a concatenation operator, and the concatenated string is the regular expression.

[0150] In this embodiment, after the acquisition unit 601 acquires the log information, the processing unit 602 performs format recognition on the text format of each log text included in the log information. Based on the recognition result, the object text can be extracted from the log text included in the log information. Furthermore, the processing unit 602 can parse the type of the object text and generate a replacement text for the object text based on the parsed object text type. The replacement text is then used to update the log information, so that the log information can be rendered and displayed based on the updated log information. The replacement of the object text in the original log information with the replacement text can reduce the storage resources occupied for storing the log information and also improve the processing efficiency of rendering and displaying based on the updated log information.

[0151] Please see Figure 7 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device can be a terminal device or a server, and is not limited thereto in this embodiment. Figure 7The computer device shown in this embodiment may include: one or more processors 701; one or more input devices 702; one or more output devices 703; and a memory 704. The processors 701, input devices 702, output devices 703, and memory 704 are connected via a bus 705. The memory 704 stores a computer program, which includes program instructions, and the processor 701 executes the program instructions stored in the memory 704.

[0152] The memory 704 may include volatile memory, such as random-access memory (RAM); the memory 704 may also include non-volatile memory, such as flash memory, solid-state drive (SSD), etc.; the memory 704 may also include a combination of the above types of memory.

[0153] The processor 701 may be a central processing unit (CPU). The processor 701 may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), etc. The PLD may be a field-programmable gate array (FPGA), generic array logic (GAL), etc. The processor 701 may also be a combination of the above structures.

[0154] In this embodiment of the invention, the memory 704 is used to store a computer program, the computer program including program instructions, and the processor 701 is used to execute the program instructions stored in the memory 704 to implement the above-mentioned... Figure 2 and Figure 4 The steps of the corresponding method.

[0155] In one embodiment, the processor 701 is configured to invoke the program instructions to execute:

[0156] Obtain log information, which includes one or more log texts;

[0157] The text format of each log text in the log information is identified, and the object text is extracted from the one or more log texts based on the identification result of the format identification.

[0158] The type of the object text is parsed, and a replacement text for the object text is generated based on the parsed type;

[0159] The log information is updated using the replacement text.

[0160] In one embodiment, each log text in the log information is text after escaping; the log text is the object text or character text.

[0161] After escaping, the object text in the log information will be identified using the first symbol, the character text in the log information will be identified using the second symbol, and a space will be added between the object text and the character text.

[0162] In one embodiment, the processor 701 is configured to invoke the program instructions to execute:

[0163] From the log texts included in the log information, search for target characters that are not identified by the second symbol and are not spaces;

[0164] Repeat the above steps, and use the text composed of the found target characters as the object text;

[0165] In the log information, all text other than the object text is character text.

[0166] In one embodiment, the second symbol includes quotation marks, which include opening quotation marks and closing quotation marks; the processor 701 is configured to invoke the program instructions to execute:

[0167] Identify the opening quotation mark from the log information, and after identifying the opening quotation mark, identify the reference character that is not a quotation mark from the log information;

[0168] Identify the back quotation mark corresponding to the opening quotation mark from the log information;

[0169] Repeat the above steps, and use the text consisting of the reference characters located between the opening quotation mark and the corresponding closing quotation mark in the log information as the character text;

[0170] The text other than the character text in the log information is used as the object text.

[0171] In one embodiment, the object text type includes a composite type and a single type. The composite type object text includes text of at least two data types, and the single type object text includes text of one data type. The data types include at least one or more of the following: object type, array type, and string type. The processor 701 is configured to call the program instructions to execute:

[0172] If the parsed type is the composite type, a replacement placeholder is generated and used as the replacement text for the object text. The replacement placeholder includes at least one or more of the following fields: symbol identifier, line number of the object text in the log information, and sequence number of the object text.

[0173] If the parsed type is the single type, then the characters in the object text are used as the replacement text of the object text.

[0174] In one embodiment, the replacement text is located in an even-numbered segment of the updated log information; the processor 701 is configured to invoke the program instructions to execute:

[0175] In response to a display trigger operation for the updated log information, the replacement text located in the even-numbered segments is extracted from the updated log information;

[0176] Obtain the rendering function used to render and display the replaced text;

[0177] According to the position of the replacement text in the updated log information, the rendering function is called to render and display the object text replaced by the replacement text.

[0178] In one embodiment, if the log information includes character text, the character text is located in an odd-numbered segment of the updated log information; the processor 701 is configured to call the program instructions to execute:

[0179] Extract the character text located in the odd-numbered segments from the updated log information;

[0180] According to the position of the character text in the updated log information, each character in the character text is returned and displayed as is.

[0181] In one embodiment, the processor 701 is configured to invoke the program instructions to execute:

[0182] The rendering function is invoked to replace each object in the object text replaced by the replacement text with an interactive object label, and the interactive object label is rendered and displayed.

[0183] In one embodiment, the number of objects included in the object text replaced by the replacement text is one or more; the processor 701 is configured to invoke the program instructions to execute:

[0184] Obtain the priority of any one of the one or more objects of the object text, and determine the rendering attributes of the object based on the priority, wherein the rendering attributes include color attributes or transparency attributes;

[0185] The rendering function is invoked, and any object in the text replaced by the replacement text is rendered and displayed according to the rendering attributes.

[0186] In one embodiment, the object text replaced by the replacement text is collapsed during rendering, and the character text included in the log information is expanded during rendering; the processor 701 is configured to call the program instructions to execute:

[0187] Obtain the log search information input by the user, and construct a regular expression based on the log search information;

[0188] Based on the constructed regular expression, a search and match is performed in the collapsed object text, and the object text that matches the regular expression is expanded and displayed. The objects that match the regular expression in the expanded object text are then highlighted.

[0189] In one embodiment, the processor 701 is configured to invoke the program instructions to execute:

[0190] The log search information is cleaned, and strings are extracted from the cleaned search information; wherein, the information cleaning includes one or more of the following: deduplication, truncation, and space removal.

[0191] A regular expression is constructed based on the extracted strings; if there is only one extracted string, then the extracted string is the regular expression; if there are at least two extracted strings, then the at least two strings are concatenated using a concatenation operator, and the concatenated string is the regular expression.

[0192] This invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned actions. Figure 2 or Figure 4The method embodiment shown. The computer-readable storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0193] The above-disclosed embodiments are merely partial examples of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that all or part of the processes for implementing the above embodiments, and equivalent variations made in accordance with the claims of the present invention, still fall within the scope of the invention.

Claims

1. An information processing method, characterized in that, include: Obtain log information, which includes one or more log texts; The text format of each log text in the log information is identified, and object text is extracted from the one or more log texts based on the identification result of the format identification; the object text type includes composite type and single type, the composite type object text includes at least two data types of text, the single type object text includes one data type of text, and the data type includes at least one or more of the following: object type, array type, string type; The method of parsing the type of the object text and generating replacement text for the object text based on the parsed type includes: if the parsed type is the composite type, generating a replacement placeholder and using the replacement placeholder as the replacement text for the object text, wherein the replacement placeholder includes at least one or more of the following fields: symbol identifier, line number of the object text in the log information, and sequence number of the object text; if the parsed type is the single type, using the characters in the object text as is as the replacement text for the object text. The log information is updated using the replacement text.

2. The method as described in claim 1, characterized in that, Each log text in the log information is text after escaping; the log text is either object text or character text. After escaping, the object text in the log information will be identified using the first symbol, the character text in the log information will be identified using the second symbol, and a space will be added between the object text and the character text.

3. The method as described in claim 2, characterized in that, The step of recognizing the format of each log text in the log information and extracting the object text from the one or more log texts based on the recognition result includes: From the log texts included in the log information, find the target character that is not identified by the second symbol and is not a space; Repeat the above steps, and use the text composed of the found target characters as the object text; In the log information, all text other than the object text is character text.

4. The method as described in claim 2, characterized in that, The second symbol includes quotation marks, which include opening quotation marks and closing quotation marks; the step of recognizing the text format of each log text in the log information and extracting object text from the one or more log texts based on the recognition result includes: Identify the opening quotation mark from the log information, and after identifying the opening quotation mark, identify the reference character that is not a quotation mark from the log information; Identify the back quotation mark corresponding to the opening quotation mark from the log information; Repeat the above steps, and use the text consisting of reference characters located between the opening quotation mark and the corresponding closing quotation mark in the log information as character text; The text other than the character text in the log information is used as the object text.

5. The method as described in claim 1, characterized in that, The replacement text is located in an even-numbered segment of the updated log information; the method further includes: In response to a display trigger operation for the updated log information, the replacement text located in the even-numbered segments is extracted from the updated log information; Obtain the rendering function used to render and display the replaced text; According to the position of the replacement text in the updated log information, the rendering function is called to render and display the object text replaced by the replacement text.

6. The method as described in claim 5, characterized in that, If the log information includes character text, and the character text is located in the odd-numbered segments of the updated log information; the method further includes: Extract the character text located in the odd-numbered segments from the updated log information; According to the position of the character text in the updated log information, each character in the character text is returned and displayed as is.

7. The method as described in claim 5, characterized in that, The step of calling the rendering function to render and display the object text replaced by the replacement text includes: The rendering function is invoked to replace each object in the object text replaced by the replacement text with an interactive object label, and the interactive object label is rendered and displayed.

8. The method as described in claim 5, characterized in that, The number of objects included in the object text replaced by the replacement text is one or more; the step of calling the rendering function to render and display the object text replaced by the replacement text includes: Obtain the priority of any one of the one or more objects of the object text, and determine the rendering attributes of the object based on the priority, wherein the rendering attributes include color attributes or transparency attributes; The rendering function is invoked, and any object in the text replaced by the replacement text is rendered and displayed according to the rendering attributes.

9. The method as described in claim 5, characterized in that, The object text replaced by the replacement text is collapsed during rendering, while the character text included in the log information is expanded during rendering; the method further includes: Obtain the log search information input by the user, and construct a regular expression based on the log search information; Based on the constructed regular expression, a search and match is performed in the collapsed object text, and the object text that matches the regular expression is expanded and displayed. The objects that match the regular expression in the expanded object text are then highlighted.

10. The method as described in claim 9, characterized in that, The step of constructing a regular expression based on the log search information includes: The log search information is cleaned, and strings are extracted from the cleaned search information; wherein, the information cleaning includes one or more of the following: deduplication, truncation, and space removal. A regular expression is constructed based on the extracted strings; if there is only one extracted string, then the extracted string is the regular expression; if there are at least two extracted strings, then the at least two strings are concatenated using a concatenation operator, and the concatenated string is the regular expression.

11. An information processing device, characterized in that, include: An acquisition unit is used to acquire log information, the log information including one or more log texts; The text format of each log text in the log information is identified, and object text is extracted from the one or more log texts based on the identification result of the format identification; the object text type includes composite type and single type, the composite type object text includes at least two data types of text, the single type object text includes one data type of text, and the data type includes at least one or more of the following: object type, array type, string type; A processing unit is configured to parse the type of the object text and generate replacement text for the object text based on the parsed type. The method of generating replacement text for the object text based on the parsed type includes: if the parsed type is the composite type, generating a replacement placeholder and using the replacement placeholder as the replacement text for the object text, wherein the replacement placeholder includes at least one or more of the following fields: symbol identifier, the line number of the object text in the log information, and the sequence number of the object text; if the parsed type is the single type, using the characters in the object text as is as the replacement text for the object text. The processing unit is also used to update the log information using the replacement text.

12. A computer device, characterized in that, The device includes a processor, an input device, an output device, and a memory, wherein the processor, the input device, the output device, and the memory are interconnected, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is configured to invoke the program instructions to execute the method as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1 to 10.

14. A computer program product comprising computer instructions stored in a computer-readable storage medium, wherein a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the computer device to perform the method as described in any one of claims 1 to 10.