Log information display method and device, electronic equipment and storage medium
By displaying target log information and its context log information in electronic devices, the location difficulty caused by the huge amount of log information in the system log file is solved, and the effect of rapid positioning and improving analysis efficiency is achieved.
Patent Information
- Application Number
- CN202311023269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-02-21
AI Technical Summary
The large amount of log information in the electronic device system log file makes it difficult for users to browse, and the prior art is difficult to quickly locate specific log information and provide context information.
Provides a method of displaying log information, by displaying target log information and its log fragments in the original log file, the log fragments include target log information and its context log information. The method receives instructions for target log information and displays relevant information based on parsing instructions or search instructions.
Quickly locate target log information in the original log file, and display its context log information at the same time, so as to facilitate users to browse associated log information, improve log file analysis efficiency, reduce usage thresholds, and improve user experience.
Smart Images

Figure CN119493779A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a log information display method, device, electronic device and storage medium. Background Art
[0002] The system log file of an electronic device records various events that occur in the electronic device system, such as the startup, operation, and shutdown of various services in the system. Users can understand the status of system operation by viewing the log information in the log file. However, due to the large amount of log information in the system log file, it is difficult for users to browse the log file. Therefore, the application of system log analysis technology is becoming more and more extensive. System log analysis technology can parse log files, help users quickly discover system anomalies and quickly locate log information, and improve the availability and stability of the system. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a log information display method, device, electronic device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a log information display method is provided, the method comprising:
[0005] Display target log information;
[0006] receiving a first instruction for the target log information;
[0007] A log segment of the target log information in the original log file is displayed, where the log segment includes the target log information and context log information of the target log information.
[0008] In an exemplary embodiment, the displaying target log information includes:
[0009] Receive parsing instructions;
[0010] When the original log file is a log file generated when a system abnormal event occurs, the target log information is displayed based on the parsing instruction, and the target log information represents the log information corresponding to the system abnormal event in the original log file.
[0011] In an exemplary embodiment, the displaying target log information includes:
[0012] Receiving search instructions for target keywords;
[0013] Based on the search instruction, the target log information is displayed, where the target log information represents the log information corresponding to the target keyword.
[0014] In an exemplary embodiment, before displaying the target log information, the log information display method further includes:
[0015] The original log file is parsed to obtain a log information file tree and feature information, wherein the log information file tree represents a set of log information distributed according to platform type and content type, and the feature information represents key features corresponding to each content type.
[0016] In an exemplary embodiment, before displaying the log segment of the target log information in the original log file, the method further includes:
[0017] Based on the characteristic information, determining context information corresponding to the target log information;
[0018] Based on the context information and the log information file tree, context log information of the target log information is determined.
[0019] In an exemplary embodiment, when the target log information is displayed based on the search instruction, before the target log information is displayed, the method further includes:
[0020] The target log information is determined based on the target keyword and the log information file tree.
[0021] In an exemplary embodiment, when receiving the search instruction, the method further includes:
[0022] Index keywords are displayed, wherein the index keywords represent search prompt information.
[0023] In an exemplary embodiment, before displaying the index keywords, the method further includes:
[0024] The index keyword is determined according to the feature information and a first mapping relationship, where the first mapping relationship represents a mapping relationship between the index keyword and the feature information.
[0025] In an exemplary embodiment, when receiving the parsing instruction, the method further includes:
[0026] When the original log file is a log file generated when a system abnormal event occurs, inference information is displayed based on the parsing instruction, and the inference information represents the cause of the occurrence of the system abnormal event.
[0027] In an exemplary embodiment, when displaying a plurality of the inference information, the method further includes:
[0028] receiving a second instruction for a target service type;
[0029] The target service type information is displayed, where the target service type information includes target log information corresponding to the target service type and inference information corresponding to the target service type.
[0030] In an exemplary embodiment, before displaying the inference information, the method further includes:
[0031] The inferred information is determined based on the feature information and a second mapping relationship, where the second mapping relationship represents a mapping relationship between the inferred information and the feature information.
[0032] In an exemplary embodiment, parsing the original log file to obtain the log information file tree and feature information includes:
[0033] Classify the log information in the original log file according to the log information platform type to obtain the manufacturer system log, platform system log, and basic system log;
[0034] Classify the log information in each platform type according to the log information content type to obtain the general service system log, the general time series system log, and the customized service system log;
[0035] The log information in each of the content types is matched with the information base of each of the content types to obtain the key features corresponding to each of the content types.
[0036] In an exemplary embodiment, the key features include:
[0037] System status information corresponding to the general service system log, context information corresponding to the general time series system log, and service information corresponding to the customized service system log.
[0038] According to a second aspect of an embodiment of the present disclosure, a log information display device is provided, the device comprising:
[0039] A first display module is configured to display target log information;
[0040] A receiving module, configured to receive a first instruction for the target log information;
[0041] The second display module is configured to display a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
[0042] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0043] processor;
[0044] a memory for storing processor-executable instructions;
[0045] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.
[0046] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in the first aspect of the embodiment of the present disclosure.
[0047] The above method disclosed in the present invention has the following beneficial effects: it is capable of quickly locating target log information in the original log file, and at the same time, it is capable of displaying the context log information of the target log information, so that users can browse the associated log information of the target log information, enhance the clarity of viewing log files, and improve the efficiency of users in analyzing log files. In addition, more intuitive visual operation prompts and visual display methods can lower the threshold for using analyzed log files and improve user experience.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0050] Figure 1 is a flow chart of a log information display method according to an exemplary embodiment;
[0051] Figure 2 is a schematic diagram of a log information display interface according to an exemplary embodiment;
[0052] Figure 3 is a flow chart of a log information display method according to an exemplary embodiment;
[0053] Figure 4 is a schematic diagram of a log information display interface according to an exemplary embodiment;
[0054] Figure 5 is a flow chart of a log information display method according to an exemplary embodiment;
[0055] Figure 6 is a schematic diagram of a log information display interface according to an exemplary embodiment;
[0056] Figure 7 is a flow chart of a log information display method according to an exemplary embodiment;
[0057] Figure 8 is a schematic diagram showing a method for displaying log information according to an exemplary embodiment;
[0058] Fig. 9 is a block diagram of a log information display device according to an exemplary embodiment;
[0059] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0061] With the continuous development of computer technology, system log analysis technology is also constantly innovating and developing. In related technologies, log analysis platforms are usually used to collect, store, analyze and visualize a large amount of log information in log files, such as ELK Stack, Splunk, Graylog and other log analysis platforms. However, first of all, since these log analysis platforms are universal and are mainly used to parse application-side logs and server-side logs, when using these log analysis platforms to parse system-side logs, it is difficult to find specific system-side problems and it is difficult to accurately locate specific system-side log information, and the located log information does not have code-level contextual linkage, which is not convenient for users to browse its related information; secondly, when using these log analysis platforms, users are required to configure and deploy, so a certain learning cost is required.
[0062] In an exemplary embodiment of the present disclosure, in order to overcome the problems existing in the related art, a log information display method is provided, including: displaying target log information; receiving a first instruction for the target log information; and displaying a log fragment of the target log information in an original log file, the log fragment including the target log information and the context log information of the target log information. The method in this embodiment can quickly locate the target log information in the original log file, and can also display the context log information of the target log information, so that the user can browse the associated log information of the target log information, enhance the clarity of viewing the log file, and improve the efficiency of the user in analyzing the log file.
[0063] In an exemplary embodiment of the present disclosure, a log information display method is provided. Figure 1 is a flow chart of a log information display method according to an exemplary embodiment. Figure 1 As shown, the following steps are included:
[0064] Step S101, display target log information;
[0065] Step S102, receiving a first instruction for target log information;
[0066] Step S103: displaying a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
[0067] The method in the disclosed embodiment is applied to electronic devices, including computer devices such as laptops and desktop computers, and terminal devices such as smart phones and tablet computers. The original log file is opened in the code editor of the electronic device, and the original log file is the log file that the user wants to browse and view. The code editor is a general code editor, such as VSCode (Visual Studio Code) in the computer device, and the log information display interface is displayed on the opened original log file. The log information display interface can be displayed in the form of a floating box, or in the form of a tab, or in other ways, which is not limited in the disclosed embodiment. The original log file is a log file of a terminal device with an Android operating system, which can be an application side log or a server side log, or a system side log. In the disclosed embodiment, the original log file is taken as an example of a system side log, that is, the original log file is a system log file of a terminal device with an Android operating system.
[0068] In step S101, target log information is displayed on the log information display interface. The target log information is the log information that the user needs to view, and may be the log information corresponding to the system abnormal event, or may be the log information searched and located by the user.
[0069] In step S102, the first instruction is a touch operation such as single click, double click, left click of mouse, right click of mouse, etc. The first instruction can act on the target log information. Before receiving the first instruction, the target log information is displayed in the first display mode; after receiving the second instruction, the target log information is displayed in the second display mode. For example, the first instruction is single click. Before clicking the target log information, the target log information is displayed in black font; after clicking the target log file information, the target log information is displayed in gray font. The first instruction can also act on the identifier corresponding to the target log information. The identifier can be any symbol to prompt the user to perform a click operation. For example, the identifier is an eye graphic symbol. Before receiving the first instruction, the identifier is displayed in the first display mode; after receiving the second instruction, the identifier is displayed in the second display mode. For example, the first instruction is single click, and the identifier is an eye graphic symbol. Before clicking the identifier, the identifier is displayed with a closed eye graphic symbol; after clicking the identifier, the identifier is displayed with an open eye graphic symbol.
[0070] In step S103, the context log information of the target log information indicates the log information associated with the target log information, which may be the program context of the target log information, indicating the operating environment of the system event corresponding to the target log information, for example, if there are external variables in the system event, the log information corresponding to the system event related to the external variables is the program context of the target log information; or it may be the time sequence context of the target log information, indicating the time sequence of the system event corresponding to the target log information. Displaying the log fragment in the original log file interface is equivalent to locating the target log information in the original log file, and distinguishing the target log information from the context log information through different display methods, for example, by highlighting the target log information.
[0071] In one example, Figure 2 is a schematic diagram of a log information display interface according to an exemplary embodiment. Figure 2 As shown, display interface 201 represents the editor interface, the original log file is opened in display interface 201, display interface 202 represents the log information display interface, display interface 202 is displayed in the form of a tab of the editor, target log information 203 and an identifier 204 corresponding to the target log information 203 are displayed on the display interface, after clicking the identifier 204, a log fragment 205 is displayed in the original log file, and the log fragment 205 includes the highlighted target log information 203 and the context log information 206 of the normally displayed target log information 203.
[0072] In the exemplary embodiments of the present disclosure, the target log information can be quickly located in the original log file, and the context log information of the target log information can be displayed, which is convenient for users to browse the related log information of the target log information, enhances the clarity of viewing log files, and improves the efficiency of users in analyzing log files. In addition, more intuitive visual operation prompts and visual display methods can lower the threshold for using analyzed log files and improve user experience.
[0073] In an exemplary embodiment of the present disclosure, a log information display method is provided. Figure 3 is a flow chart of a log information display method according to an exemplary embodiment. Figure 3 As shown, the following steps are included:
[0074] Step S301, receiving a parsing instruction;
[0075] Step S302, when the original log file is a log file generated when a system abnormal event occurs, based on the parsing instruction, display target log information, where the target log information represents log information corresponding to the system abnormal event in the original log file;
[0076] Step S303, when the original log file is a log file generated when a system abnormal event occurs, based on the parsing instruction, inference information is displayed, and the inference information represents the cause of the system abnormal event;
[0077] Step S304, when multiple inference information is displayed, receiving a second instruction for the target service type;
[0078] Step S305, displaying target service type information, where the target service type information includes target log information corresponding to the target service type and inference information corresponding to the target service type;
[0079] Step S306, receiving a first instruction for target log information;
[0080] Step S307: displaying a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
[0081] The specific implementation of steps S306-S307 is similar to the implementation of steps S102-S103, and will not be described in detail again.
[0082] The method in the embodiment of the present disclosure can be used as a plug-in in an editor. When a user opens the plug-in, tabs with multiple functions will be displayed, including a tab for parsing function and a tab for searching function.
[0083] In step S301, the parsing instruction indicates that according to the log file, whether a system abnormal event occurs during system operation, and at the same time, the log information corresponding to the system abnormal event in the log file is determined. When the user clicks the tab corresponding to the parsing function, the parsing instruction is received.
[0084] In step S302, when the original log file is a log file generated when a system abnormal event occurs, after receiving the parsing instruction, the parsing determines that a system abnormal event occurs, and the parsing determines the log information corresponding to the system abnormal event in the original log file. System abnormal events are, for example, insufficient memory, deadlock, etc. When the original log file is a log file generated when no system abnormal event occurs, after receiving the parsing instruction, the parsing determines that no system abnormal event occurs, and then a word similar to "0error" is displayed to indicate that there is no system abnormal event.
[0085] In step S303, when the original log file is a log file generated when a system abnormal event occurs, when determining the target log information corresponding to the system abnormal event, the original log file is parsed to determine the cause of the system abnormal event. In the log information display interface, the inferred information is displayed while displaying the target log information.
[0086] Displaying inferred information can help users identify abnormal events more quickly, thereby resolving system abnormalities more quickly.
[0087] In steps S304-S305, if multiple system abnormal events occur, multiple target log information and multiple inference information will be determined. In order to facilitate user viewing, multiple system abnormal events are classified according to the service type in the system, and the target log information and inference information corresponding to each system abnormal event are displayed by category. The services in the system include multiple service types such as Android framework core services, alarm or timer services, communication services, positioning services, etc., and abnormal events may occur in each service type. If multiple system abnormal events occur, multiple service types in which system abnormal events occur are displayed in the log information display interface, and the user selects the service type to be viewed, that is, the target service type, and the second instruction is a click operation on the service type to be viewed. When the second instruction is received, the target service type information is displayed, that is, the target log information and inference information corresponding to the system abnormal event under the target service type.
[0088] The target log information and inference information corresponding to each system abnormal event are displayed in categories. The information of system abnormal events can be selectively displayed according to the user's viewing needs, making it convenient for users to check each system abnormal event in turn, avoiding displaying too much system abnormal event information and interfering with the user's analysis of each abnormal event.
[0089] In one example, Figure 4 is a schematic diagram of a log information display interface according to an exemplary embodiment. Figure 4 As shown, the display interface 401 represents the editor interface. When the log file generated when the system abnormal event occurs is opened in the display interface 401, the display interface 402 represents the log information display interface. The display interface 402 is displayed in the form of a tab of the editor. The display interface 402 includes a tab 403 of the parsing function. Clicking the tab 403 will display the corresponding display interface 403. Different service types are displayed on the display interface 403, including service type 1, service type 2, and service type 3. When the service type 1 is clicked, the target log information 404 corresponding to the service type 1 and the identifier 405 corresponding to the target log information 404, as well as the inference information 406 and the alarm information 407 are displayed. After clicking the identifier 405, the log fragment 408 is displayed in the original log file. The log fragment 408 includes the highlighted target log information 404 and the context log information 409 of the normally displayed target log information 404. Among them, the alarm information 407 is used to warn the error information. The alarm information will not affect the system operation, while the system abnormal event will affect the system operation.
[0090] In the exemplary embodiment of the present disclosure, steps S301-S302 and steps S306-S307 may be implemented as an independent embodiment, and step S303 and steps S304-S305 are optional, and one or more of these steps may be omitted or replaced in different embodiments.
[0091] In an exemplary embodiment of the present disclosure, a log information display method is provided. Figure 5 is a flow chart of a log information display method according to an exemplary embodiment. Figure 5 As shown, the following steps are included:
[0092] Step S501, receiving a search instruction for a target keyword;
[0093] Step S502, based on the search instruction, displaying target log information, where the target log information represents log information corresponding to the target keyword;
[0094] Step S503, displaying index keywords, where the index keywords represent search prompt information;
[0095] Step S504, when multiple target log information is displayed, receiving a second instruction for the target service type;
[0096] Step S505, displaying target service type information, the target service type information including target log information corresponding to the target service type;
[0097] Step S506, receiving a first instruction for target log information;
[0098] Step S507: displaying a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
[0099] The specific implementation of steps S506-S507 is similar to the implementation of steps S102-S103, and will not be described in detail again.
[0100] The method in the embodiment of the present disclosure can be used as a plug-in in an editor. When a user opens the plug-in, tabs with multiple functions will be displayed, including a tab for parsing function and a tab for searching function.
[0101] In step S501, the search instruction indicates searching for a target keyword in the original log file, where the target keyword is a user-defined search term. When the user clicks on a tab corresponding to the search function, a search interface is displayed, which includes a search box and a search button. The user enters the target keyword in the search box and clicks on the search button to receive the search instruction.
[0102] In step S502, after receiving the search instruction, the log information related to the target keyword is searched in the original log file. If relevant log information is found, the search result is displayed as the target log information; if no relevant log information is found, a prompt message is displayed to prompt the user that no log information that meets the conditions is found.
[0103] In step S503, the index keyword is search prompt information. The user can directly click the index keyword to search with the index keyword as the target keyword, or can customize related target keywords to search based on the index keyword.
[0104] Steps S504-S505, if the search results include multiple log information corresponding to the target keyword, in order to facilitate the user to view, the multiple target log information is classified according to the service type in the system, and all the searched target log information is displayed by category. When multiple target log information is searched, the multiple service types to which the multiple target log information belongs are displayed in the log information display interface, and the user selects the service type to be viewed, that is, the target service type, and the second instruction is a click operation on the service type to be viewed. When the second instruction is received, the target service type information is displayed, that is, the corresponding target log information under the target service type is displayed.
[0105] Displaying search results by category can selectively display target log information based on user viewing needs, avoiding displaying too many search results and interfering with users' viewing of target log information of target service types.
[0106] In one example, Figure 6 is a schematic diagram of a log information display interface according to an exemplary embodiment. Figure 6 As shown, display interface 601 represents an editor interface. When the original log file is opened in display interface 601, display interface 602 represents a log information display interface. Display interface 602 is displayed in the form of a tab of the editor. Display interface 602 includes a tab 603 for a search function. Clicking tab 603 brings up the corresponding display interface 603. A search box 604, a search button 605, and index keywords 606 are displayed on display interface 603. Enter the search keyword in the search box. After clicking the search button, different service types are displayed, including service type 1, service type 2, and service type 3. When service type 1 is clicked, target log information 607 corresponding to the target keyword in service type 1 and an identifier 608 corresponding to the target log information 607 are displayed. After clicking identifier 608, a log fragment 609 is displayed in the original log file. The log fragment 609 includes the highlighted target log information 607 and context log information 610 of the normally displayed target log information 607.
[0107] In the exemplary embodiment of the present disclosure, steps S501-S502 and steps S506-S507 may be implemented as an independent embodiment, and step S503 and steps S504-S505 are optional, and one or more of these steps may be omitted or replaced in different embodiments.
[0108] In an exemplary embodiment of the present disclosure, a log information display method is provided. Figure 7 is a flow chart of a log information display method according to an exemplary embodiment. Figure 7 As shown, the following steps are included:
[0109] Step S701, parsing the original log file to obtain a log information file tree and feature information, wherein the log information file tree represents a set of log information distributed according to platform type and content type, and the feature information represents key features corresponding to each content type;
[0110] When using the parsing function, execute steps S702-S707 and steps S715-S718; when using the search function, execute steps S708-S718;
[0111] Step S702, receiving a parsing instruction;
[0112] Step S703, when the original log file is a log file generated when a system abnormal event occurs, based on the parsing instruction, display target log information, where the target log information represents log information corresponding to the system abnormal event in the original log file;
[0113] Step S704, determining inference information based on the feature information and the second mapping relationship, where the second mapping relationship represents a mapping relationship between the inference information and the feature information;
[0114] Step S705, when the original log file is a log file generated when a system abnormal event occurs, based on the parsing instruction, displaying inference information, the inference information represents the cause of the system abnormal event;
[0115] Step S706, when multiple inference information is displayed, receiving a second instruction for the target service type;
[0116] Step S707, displaying target service type information, where the target service type information includes target log information corresponding to the target service type and inference information corresponding to the target service type;
[0117] Step S708, determining the index keyword according to the characteristic information and the first mapping relationship, wherein the first mapping relationship represents a mapping relationship between the index keyword and the key information;
[0118] Step S709, displaying index keywords, where the index keywords represent search prompt information;
[0119] Step S710, receiving a search instruction for a target keyword;
[0120] Step S711, determining target log information based on the target keyword and the log information file tree, where the target log information represents the log information corresponding to the target keyword;
[0121] Step S712, displaying target log information;
[0122] Step S713, when multiple target log information is displayed, receiving a second instruction for the target service type;
[0123] Step S714, displaying target service type information, the target service type information including target log information corresponding to the target service type;
[0124] Step S715, receiving a first instruction for target log information;
[0125] Step S716, determining context information corresponding to the target log information based on the feature information;
[0126] Step S717, determining context log information of the target log information based on the context information and the log information file tree;
[0127] Step S718: displaying a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
[0128] Among them, the specific implementation methods of steps S702-S703, steps S705-S707, steps S709-S710, steps S712-step S715, and step S718 are similar to the implementation methods of steps S301-S307 and steps S501-S507, and will not be repeated again.
[0129] In step S701, when parsing the original log file, the log information in the original log file is classified, first classified according to the log information platform type, and then the log information in each platform type is classified according to the content type, and the log information in each type is summarized in the form of a file tree, so as to quickly find the required log information in a large amount of log information. The common characteristics of the log information in each content type are used as the key characteristics of each content type. For example, if the log information in a certain content type is all log information corresponding to the memory state in the system, then the key characteristic of the content type is the memory state.
[0130] In one example, the log information in the original log file is classified according to the log information platform type, and is divided into manufacturer system log, platform system log, and basic system log, wherein the manufacturer system log is used to represent the log information of different manufacturers, the platform system log is used to represent the log information of different platforms, such as Qualcomm platform or MediaTek platform, and the basic system log is used to represent the native Android system log information. According to the log information content type, the log information in each platform type is classified to obtain the general service system log, the general timing system log, and the customized service system log, wherein the general service system log represents the system log corresponding to the system general service, such as the system log corresponding to the general service such as communication, positioning, core service, etc., the general timing system log represents the system log with context information, such as the system log with program context information or the system log with timing context, and the customized service system log represents the system log of the system customized service, such as the system log corresponding to the customized service such as the timer switch service, timer service, etc. The log information in each type is summarized in the form of a file tree, which is the log information file tree.
[0131] The information base of each content type is a mapping relationship between each type of log information and the key features of each content type. The log information in each content type is matched with the information base of each content type to obtain the key features corresponding to each content type. Among them, the key features include: system status information corresponding to the general service system log, such as memory status, storage status, broadcast status, etc.; context information corresponding to the general time series system log, such as pid (process id), tid (thread id), uid (user id), tag (label) and other program context information and time series context information; service information corresponding to the customized service system log, such as timer information, etc.
[0132] In step S704, the second mapping relationship is a mapping relationship between inference information and feature information, which can also be called a problem inference library, which is obtained based on historical data and pre-stored in the editor. The historical data includes a mapping relationship between multiple pairs of feature information and the cause of the system abnormal event. After parsing the original log file, the feature information is obtained, and the feature information is matched with the problem inference library to obtain the inference information.
[0133] In step S708, the first mapping relationship is a mapping relationship between index keywords and feature information, which can also be called a search information library, which is obtained based on historical data and pre-stored in the editor. The historical data includes a plurality of mapping relationships between feature information and search keywords. After parsing the original log file, the feature information is obtained, and the feature information is matched with the search information library to obtain the index keyword.
[0134] In step S711, when searching for the target keyword, the target keyword is usually a related word of the index keyword or directly the index keyword. After receiving the search instruction for the target keyword, the feature information is matched from the search information library, and the log information type is determined in turn based on the feature information. Then, combined with the log information file tree, the target log information corresponding to the target keyword can be found.
[0135] In steps S716-S717, after obtaining the target log information, the characteristic information of the target log information is obtained at the same time, including the context information. Based on the context information of the target log information, the characteristic information of the context log information corresponding to the target log information can be obtained. For example, if the pid of the program context information in the characteristic information of the target log information is 3, the pid of the program context information of the characteristic information of the context log information is 2 and 4. The log information type of the context log information corresponding to the target log information is further obtained, and the context log information corresponding to the target log information can be searched and obtained in combination with the log information file tree.
[0136] In an exemplary embodiment of the present disclosure, a log information display method is provided. Figure 8 is a schematic diagram showing a method for displaying log information according to an exemplary embodiment. Figure 8 As shown, the following steps are included:
[0137] S8-1, parsing the original log file, classifying the log information in the original log file, first classifying according to the log information platform type, and classifying the log information in the original log file into manufacturer system log, platform system log, and basic system log, wherein the platform system log includes Qualcomm platform or MediaTek (MTK) platform;
[0138] S8-2, classifying the log information in each platform type according to the log information content type into general service system log, general time series system log, and customized service system log;
[0139] S8-3, summarizing the log information of each type in the form of a file tree, that is, a log information file tree;
[0140] S8-4, the general service system log is matched with the general service information base to extract system status information, including memory status, storage status, broadcast status, etc.;
[0141] S8-5, the general time series system log is matched with the basic information library to extract the time series context information and program context information. The program context information includes pid (process id), tid (thread id), uid (user id), tag (tag), and the time series context information includes time;
[0142] S8-6, matching the customized service system log with the customized service information library to extract service information;
[0143] S8-7, summarizing the system status information, context information, and service information into feature information;
[0144] S8-8, matching the feature information with the problem inference library to obtain inference information and alarm information;
[0145] S8-9, matching the feature information with the search information library to obtain customized search information, i.e., index keywords;
[0146] S8-10, after determining the target log information, highlighting the target log information and displaying the context log information thereof.
[0147] In an exemplary embodiment of the present disclosure, a log information display device is provided. Fig. 9 is a block diagram of a log information display device according to an exemplary embodiment. Fig. 9As shown, including:
[0148] A first display module 901 is configured to display target log information;
[0149] The receiving module 902 is configured to receive a first instruction for target log information;
[0150] The second display module 903 is configured to display log segments of the target log information in the original log file, where the log segments include the target log information and context log information of the target log information.
[0151] In an exemplary embodiment, the first display module 901 is further configured as:
[0152] Receive parsing instructions;
[0153] When the original log file is a log file generated when a system abnormal event occurs, target log information is displayed based on the parsing instruction, and the target log information represents log information corresponding to the system abnormal event in the original log file.
[0154] In an exemplary embodiment, the first display module 901 is further configured as:
[0155] Receiving search instructions for target keywords;
[0156] Based on the search instruction, target log information is displayed, where the target log information represents log information corresponding to the target keyword.
[0157] In an exemplary embodiment, the log information display device further includes a processing module 904, which is configured to:
[0158] Parse the original log file to obtain the log information file tree and feature information. The log information file tree represents a set of log information distributed according to platform type and content type, and the feature information represents the key features corresponding to each content type.
[0159] In an exemplary embodiment, the processing module 904 is further configured to:
[0160] Based on the feature information, determine the context information corresponding to the target log information;
[0161] Based on the context information and the log information file tree, context log information of the target log information is determined.
[0162] In an exemplary embodiment, the processing module 904 is further configured to:
[0163] Based on the target keyword and the log information file tree, the target log information is determined.
[0164] In an exemplary embodiment, the first display module 901 is further configured as:
[0165] Displays index keywords, which represent search prompt information.
[0166] In an exemplary embodiment, the processing module 904 is further configured to:
[0167] An index keyword is determined according to the feature information and a first mapping relationship, where the first mapping relationship represents a mapping relationship between the index keyword and the feature information.
[0168] In an exemplary embodiment, the first display module 901 is further configured as:
[0169] When the original log file is a log file generated when a system abnormal event occurs, inference information is displayed based on the parsing instruction, and the inference information represents the cause of the system abnormal event.
[0170] In an exemplary embodiment, the first display module 901 is further configured as:
[0171] receiving a second instruction for a target service type;
[0172] The target service type information is displayed, where the target service type information includes target log information corresponding to the target service type and inference information corresponding to the target service type.
[0173] In an exemplary embodiment, the processing module 904 is further configured to:
[0174] Based on the feature information and the second mapping relationship, the inferred information is determined, and the second mapping relationship represents a mapping relationship between the inferred information and the feature information.
[0175] In an exemplary embodiment, the processing module 904 is further configured to:
[0176] According to the log information platform type, the log information in the original log file is classified to obtain the manufacturer system log, platform system log, and basic system log;
[0177] According to the log information content type, classify the log information in each platform type to obtain the general service system log, general time series system log, and customized service system log;
[0178] The log information in each content type is matched with the information base of each content type to obtain the key features corresponding to each content type.
[0179] In an exemplary embodiment, key features include:
[0180] System status information corresponding to the general service system log, context information corresponding to the general time series system log, and service information corresponding to the customized service system log.
[0181] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0182] Fig.10 is a block diagram of an electronic device 1000 according to an exemplary embodiment.
[0183] Reference Fig.10 , the electronic device 1000 may include one or more of the following components: a processing component 1002 , a memory 1004 , a power component 1006 , a multimedia component 1008 , an audio component 1010 , an input / output (I / O) interface 1012 , a sensor component 1014 , and a communication component 1016 .
[0184] The processing component 1002 generally controls the overall operation of the electronic device 1000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1002 may include one or more processors 1020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1002 may include one or more modules to facilitate the interaction between the processing component 1002 and other components. For example, the processing component 1002 may include a multimedia module to facilitate the interaction between the multimedia component 1008 and the processing component 1002.
[0185] The memory 1004 is configured to store various types of data to support operations on the electronic device 1000. Examples of such data include instructions for any application or method operating on the electronic device 1000, contact data, phone book data, messages, pictures, videos, etc. The memory 1004 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0186] The power supply component 1006 provides power to various components of the electronic device 1000. The power supply component 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1000.
[0187] The multimedia component 1008 includes a screen that provides an output interface between the electronic device 1000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1008 includes a front camera and / or a rear camera. When the electronic device 1000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0188] The audio component 1010 is configured to output and / or input audio signals. For example, the audio component 1010 includes a microphone (MIC), and when the electronic device 1000 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1004 or sent via the communication component 1016. In some embodiments, the audio component 1010 also includes a speaker for outputting audio signals.
[0189] I / O interface 1012 provides an interface between processing component 1002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0190] The sensor assembly 1014 includes one or more sensors for providing various aspects of status assessment for the electronic device 1000. For example, the sensor assembly 1014 can detect the open / closed state of the electronic device 1000, the relative positioning of components, such as the display and keypad of the electronic device 1000, and the sensor assembly 1014 can also detect the position change of the electronic device 1000 or a component of the electronic device 1000, the presence or absence of user contact with the electronic device 1000, the orientation or acceleration / deceleration of the electronic device 1000, and the temperature change of the electronic device 1000. The sensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0191] The communication component 1016 is configured to facilitate wired or wireless communication between the electronic device 1000 and other devices. The electronic device 1000 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1016 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0192] In an exemplary embodiment, the electronic device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0193] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1004 including instructions, and the instructions can be executed by the processor 1020 of the electronic device 1000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0194] A non-temporary computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a log information display method, the method including any of the above methods.
[0195] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0196] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A log information display method, characterized in that: The method comprises: Display target log information; receiving a first instruction for the target log information; A log segment of the target log information in the original log file is displayed, where the log segment includes the target log information and context log information of the target log information.
2. The log information display method according to claim 1, characterized in that: The display target log information includes: Receive parsing instructions; When the original log file is a log file generated when a system abnormal event occurs, the target log information is displayed based on the parsing instruction, and the target log information represents the log information corresponding to the system abnormal event in the original log file.
3. The log information display method according to claim 1, characterized in that: The display target log information includes: Receiving search instructions for target keywords; Based on the search instruction, the target log information is displayed, where the target log information represents the log information corresponding to the target keyword.
4. The log information display method according to any one of claims 1 to 3, characterized in that: Before displaying the target log information, the log information display method further includes: The original log file is parsed to obtain a log information file tree and feature information, wherein the log information file tree represents a set of log information distributed according to platform type and content type, and the feature information represents key features corresponding to each content type.
5. The log information display method according to claim 4, characterized in that: Before displaying the log segment of the target log information in the original log file, the method further includes: Based on the characteristic information, determining context information corresponding to the target log information; Based on the context information and the log information file tree, context log information of the target log information is determined.
6. The log information display method according to claim 4, characterized in that: When the target log information is displayed based on the search instruction, before the target log information is displayed, the method further includes: The target log information is determined based on the target keyword and the log information file tree.
7. The log information display method according to claim 4, characterized in that: When receiving the search instruction, the method further includes: Index keywords are displayed, wherein the index keywords represent search prompt information.
8. The log information display method according to claim 7, characterized in that: Before displaying the index keywords, the method further includes: The index keyword is determined according to the feature information and a first mapping relationship, where the first mapping relationship represents a mapping relationship between the index keyword and the feature information.
9. The log information display method according to claim 4, characterized in that: When receiving the parsing instruction, the method further includes: When the original log file is a log file generated when a system abnormal event occurs, inference information is displayed based on the parsing instruction, and the inference information represents the cause of the occurrence of the system abnormal event.
10. The log information display method according to claim 9, characterized in that: When displaying a plurality of the inference information, the method further includes: receiving a second instruction for a target service type; The target service type information is displayed, where the target service type information includes target log information corresponding to the target service type and inference information corresponding to the target service type.
11. The log information display method according to claim 10, characterized in that: Before displaying the inferred information, the method further includes: The inferred information is determined based on the feature information and a second mapping relationship, where the second mapping relationship represents a mapping relationship between the inferred information and the feature information.
12. The log information display method according to claim 4, characterized in that: The parsing of the original log file to obtain the log information file tree and feature information includes: Classify the log information in the original log file according to the log information platform type to obtain the manufacturer system log, platform system log, and basic system log; Classify the log information in each platform type according to the log information content type to obtain the general service system log, the general time series system log, and the customized service system log; The log information in each of the content types is matched with the information base of each of the content types to obtain the key features corresponding to each of the content types.
13. The log information display method according to claim 12, characterized in that: The key features include: System status information corresponding to the general service system log, context information corresponding to the general time series system log, and service information corresponding to the customized service system log.
14. A log information display device, characterized in that: The device comprises: A first display module is configured to display target log information; A receiving module, configured to receive a first instruction for the target log information; The second display module is configured to display a log segment of the target log information in the original log file, where the log segment includes the target log information and context log information of the target log information.
15. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the log information display method as described in any one of claims 1-13.
16. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the log information display method as described in any one of claims 1 to 13.