Fault locating method, apparatus and device
By acquiring and parsing logs through a fault location system, structured target information is generated to indicate the fault location results, which solves the problem of low efficiency in collecting logs from multiple systems and improves the efficiency and readability of fault diagnosis.
Patent Information
- Application Number
- CN202210602519.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2042-05-30
AI Technical Summary
When collecting and analyzing logs across multiple troubleshooting systems, troubleshooting efficiency is low and log interpretation is difficult.
The system obtains query parameters through the fault location system, determines the first log and obtains its corresponding semantic information, performs parsing processing to generate a structured second log, extracts multiple field values, and generates target information based on these field values to indicate the fault location result.
It improves troubleshooting efficiency, avoids switching between multiple troubleshooting systems, and enhances log readability.
Smart Images

Figure CN114996043B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a fault location method, apparatus and device. Background Technology
[0002] Electronic devices can have various applications (APPs) installed. During user interaction with an APP, malfunctions may occur. When a malfunction occurs, the APP's developers need to troubleshoot and locate the problem.
[0003] In practice, an app may correspond to multiple troubleshooting systems. For example, if an app includes services such as hotels and airline tickets, the corresponding troubleshooting systems could include hotel troubleshooting systems and airline ticket troubleshooting systems. In related technologies, troubleshooting usually requires collecting and analyzing logs from multiple troubleshooting systems, and these logs are often difficult to understand, leading to low troubleshooting efficiency. Summary of the Invention
[0004] This application provides a fault location method, apparatus, and device to improve the efficiency of fault diagnosis.
[0005] In a first aspect, embodiments of this application provide a fault location method, including:
[0006] Obtain query parameters through the fault location system;
[0007] Based on the query parameters, determine the first log in the log set corresponding to the fault location system;
[0008] Obtain the semantic information corresponding to the first log, the semantic information including multiple fields;
[0009] Target information is generated based on the first log and the semantic information, and the target information is displayed. The target information includes the plurality of fields and the field values corresponding to the fields. The target information is used to indicate the fault location result.
[0010] In one possible implementation, generating target information based on the first log and the semantic information includes:
[0011] The first log is parsed to obtain a structured second log;
[0012] Extract the field values corresponding to the multiple fields from the second log;
[0013] The target information is generated based on the plurality of fields and their corresponding field values.
[0014] In one possible implementation, the first log is parsed to obtain a structured second log, including:
[0015] Identify multi-level logs within the first log;
[0016] Based on the log format of each level of log, the first log is parsed and processed to obtain the second log.
[0017] In one possible implementation, the first log is in a preset format; before parsing the first log, the method further includes:
[0018] Replace the escape characters in the first log with the first preset character;
[0019] When it is determined that the first log is an incomplete log, the first log is truncated, and a first ending character is added to the truncated first log to obtain an updated first log, which is a complete log.
[0020] In one possible implementation, when it is determined that the first log is an incomplete log, the first log is truncated, including:
[0021] Determine whether the last character of the first log is a second preset character;
[0022] If not, the first log is determined to be an incomplete log, and the last second preset character is determined in the first log. At the last second preset character, the first log is truncated. The truncated first log includes the characters between the first character and the last second preset character in the first log.
[0023] In one possible implementation, the first ending character includes a right curly brace and / or a right square bracket; adding the first ending character to the truncated first log to obtain an updated first log includes:
[0024] The first log after truncation is obtained, which includes a first number M of left curly braces and a second number N of right curly braces, where M and N are integers.
[0025] The third number P of the left square brackets and the fourth number Q of the right square brackets are obtained in the first log after the truncation process, where P and Q are integers;
[0026] If M is greater than N, then MN right curly braces are added to the first log after truncation; and if P is greater than Q, then PQ right square brackets are added to the first log after truncation.
[0027] In one possible implementation, M is greater than N, and P is greater than Q; MN right curly braces are added to the first log after truncation, and PQ right square brackets are added to the first log after truncation, including:
[0028] In the first log after the truncation process, determine the positions of M left curly braces, N right curly braces, P left square brackets, and Q right square brackets.
[0029] Based on the positions of the M left curly braces, the N right curly braces, the P left square brackets, and the Q right square brackets, add the M N right curly braces and the PQ right square brackets to the first log after truncation, so that the M left curly braces, M right curly braces, P left square brackets, and P right square brackets are symmetrically distributed in the updated first log.
[0030] In one possible implementation, displaying the target information includes:
[0031] Identify outlier values among the field values corresponding to the multiple fields;
[0032] The abnormal value is displayed in a first format, and other information in the target information other than the abnormal value is displayed in a second format; the abnormal value is used to indicate the fault location result.
[0033] In one possible implementation, obtaining the semantic information corresponding to the first log includes:
[0034] Obtain the log identifier of the first log;
[0035] Based on the log identifier, the semantic information corresponding to the first log is obtained from the preset database.
[0036] In one possible implementation, before obtaining the query parameters through the fault location system, the method further includes:
[0037] Determine the query conditions and the log set corresponding to the fault location system;
[0038] Determine the correspondence between logs and semantic information;
[0039] The fault location system is generated based on the query conditions, the log set, and the corresponding relationship.
[0040] Secondly, embodiments of this application provide a fault location device, comprising: a first acquisition module, a first determination module, a second acquisition module, a first generation module, and a display module, wherein,
[0041] The first acquisition module is used to acquire query parameters through the fault location system;
[0042] The first determining module is used to determine the first log in the log set corresponding to the fault location system according to the query parameters;
[0043] The second acquisition module is used to acquire semantic information corresponding to the first log, the semantic information including multiple fields;
[0044] The first generation module is used to generate target information based on the first log and the semantic information; the target information includes the plurality of fields and the field values corresponding to the fields; the target information is used to indicate the fault location result;
[0045] The display module is used to display the target information.
[0046] In one possible implementation, the first generation module is specifically used for:
[0047] The first log is parsed to obtain a structured second log;
[0048] Extract the field values corresponding to the multiple fields from the second log;
[0049] The target information is generated based on the plurality of fields and their corresponding field values.
[0050] In one possible implementation, the first generation module is specifically used for:
[0051] Identify multi-level logs within the first log;
[0052] Based on the log format of each level of log, the first log is parsed and processed to obtain the second log.
[0053] In one possible implementation, the first generation module is specifically used for:
[0054] Replace the escape characters in the first log with the first preset character;
[0055] When it is determined that the first log is an incomplete log, the first log is truncated, and a first ending character is added to the truncated first log to obtain an updated first log, which is a complete log.
[0056] In one possible implementation, the first generation module is specifically used for:
[0057] Determine whether the last character of the first log is a second preset character;
[0058] If not, the first log is determined to be an incomplete log, and the last second preset character is determined in the first log. At the last second preset character, the first log is truncated. The truncated first log includes the characters between the first character and the last second preset character in the first log.
[0059] In one possible implementation, the first generation module is specifically used for:
[0060] The first log after truncation is obtained, which includes a first number M of left curly braces and a second number N of right curly braces, where M and N are integers.
[0061] The third number P of the left square brackets and the fourth number Q of the right square brackets are obtained in the first log after the truncation process, where P and Q are integers;
[0062] If M is greater than N, then MN right curly braces are added to the first log after truncation; and if P is greater than Q, then PQ right square brackets are added to the first log after truncation.
[0063] In one possible implementation, the first generation module is specifically used for:
[0064] In the first log after the truncation process, determine the positions of M left curly braces, N right curly braces, P left square brackets, and Q right square brackets.
[0065] Based on the positions of the M left curly braces, the N right curly braces, the P left square brackets, and the Q right square brackets, add the M N right curly braces and the PQ right square brackets to the first log after truncation, so that the M left curly braces, M right curly braces, P left square brackets, and P right square brackets are symmetrically distributed in the updated first log.
[0066] In one possible implementation, the display module is specifically used for:
[0067] Identify outlier values among the field values corresponding to the multiple fields;
[0068] The abnormal value is displayed in a first format, and other information in the target information other than the abnormal value is displayed in a second format; the abnormal value is used to indicate the fault location result.
[0069] In one possible implementation, the second acquisition module is specifically used for:
[0070] Obtain the log identifier of the first log;
[0071] Based on the log identifier, the semantic information corresponding to the first log is obtained from the preset database.
[0072] In one possible implementation, the fault location device further includes a second determining module, a third determining module, and a second generating module.
[0073] The second determining module is used to determine the query conditions corresponding to the fault location system and the log set;
[0074] The third determining module is used to determine the correspondence between logs and semantic information;
[0075] The second generation module is used to generate the fault location system based on the query conditions, the log set, and the correspondence.
[0076] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0077] The memory stores computer-executed instructions;
[0078] The processor executes computer execution instructions stored in the memory, causing the processor to perform the fault location method according to any one of the first aspects.
[0079] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the fault location method described in any of the first aspects.
[0080] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the fault location method shown in any of the first aspects.
[0081] In this embodiment, the electronic device can obtain query parameters through a fault location system and determine a first log in the log set corresponding to the fault location system based on the query parameters. Then, it can determine the semantic information corresponding to the first log in a preset database based on the identifier of the first log. The electronic device can parse the first log to obtain a second log and extract multiple field values from the second log. Then, it can determine the field values corresponding to the multiple fields in the second log based on the multiple fields in the semantic information. The electronic device can generate and display target information based on the multiple fields and their corresponding field values. The target information can be used to indicate the fault location result. Since the electronic device can determine the first log through the fault location system, switching between multiple troubleshooting systems is avoided; and since it can obtain the semantic information corresponding to the first log and generate and display target information based on the first log and semantic information, the readability of the first log is improved, thus improving the efficiency of fault troubleshooting. Attached Figure Description
[0082] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0083] Figure 1 A schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application;
[0084] Figure 2 A flowchart illustrating a fault location system generation method provided for an exemplary embodiment of this application;
[0085] Figure 3 A schematic diagram illustrating a method for generating a fault location system, provided as an exemplary embodiment of this application;
[0086] Figure 4 A flowchart illustrating a fault location method provided for an exemplary embodiment of this application;
[0087] Figure 5A A schematic diagram of a target information page provided for an exemplary embodiment of this application. Figure 1 ;
[0088] Figure 5B A schematic diagram of a target information page provided for an exemplary embodiment of this application. Figure 2 ;
[0089] Figure 6 A schematic diagram illustrating the process of parsing and processing a first log as provided in an exemplary embodiment of this application;
[0090] Figure 7 A schematic diagram of a second log provided for an exemplary embodiment of this application;
[0091] Figure 8 This is a schematic diagram of the log restoration process provided in an embodiment of this application;
[0092] Figure 9 A schematic diagram illustrating the process of a fault location method provided in an exemplary embodiment of this application;
[0093] Figure 10 A schematic diagram of the structure of a fault location device provided for an exemplary embodiment of this application;
[0094] Figure 11 A schematic diagram of another fault location device provided as an exemplary embodiment of this application;
[0095] Figure 12 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation
[0096] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0097] Figure 1 This is a schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application. For example... Figure 1 As shown, it includes a fault location system and a log set. The log set can include multiple logs; for example, the log set can include log-1, log-2, ..., log-n.
[0098] The fault location system can obtain query parameters and determine the first log in the log set based on these parameters. For example, the first log can be determined as log-1 or log-2. After determining the first log, fault investigation can be performed based on it to determine the fault location result.
[0099] In related technologies, logs are usually collected and analyzed in multiple troubleshooting systems, and these logs are often difficult to understand, resulting in low efficiency in troubleshooting.
[0100] In this embodiment, the electronic device can determine the first log in the corresponding log set through the fault location system, obtain the semantic information corresponding to the first log, and then generate and display target information based on the first log and the semantic information. The target information can indicate the fault location result. The fault location system has its corresponding log set, and the corresponding first log can be determined through one fault location system, avoiding switching between multiple troubleshooting systems; moreover, the semantic information corresponding to the first log can be obtained to improve the readability of the first log, thereby improving the efficiency of fault troubleshooting.
[0101] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for identical or similar content, the description will not be repeated in different embodiments.
[0102] The technical solution of this application may include two processing steps: the process of generating a fault location system and the process of querying through the fault location system. Below, in conjunction with... Figure 2 First, the process of generating the fault location system will be explained.
[0103] Figure 2 This is a flowchart illustrating a fault location system generation method provided for an exemplary embodiment of this application. Please refer to [link / reference]. Figure 2 The method may include:
[0104] S201. Determine the query conditions and log set corresponding to the fault location system.
[0105] The execution subject in this application embodiment can be an electronic device or a fault location device installed in an electronic device. The fault location device can be implemented through software or a combination of software and hardware. The fault location device can be a processor in the electronic device. For ease of understanding, the following description will use an electronic device as the execution subject.
[0106] Search criteria can be set by staff based on the service type. For example, if the service type is airfare, search criteria could include booking time, user account, etc.
[0107] The log collection can include logs selected by staff from their log favorites. For example, staff can select various logs from their log favorites based on the service type. This log collection corresponds to the fault location system. For example, if the service experiencing the fault is flight ticketing, logs related to flight tickets can be selected to form the log collection, which can include all user logs related to ticket booking, changes, and refunds.
[0108] The log collection can hold multiple logs for staff to choose from.
[0109] Staff can set query conditions and select the corresponding log sets according to the service type, so that electronic devices can determine the query conditions and log sets corresponding to the fault location system.
[0110] S202. Determine the correspondence between logs and semantic information.
[0111] Semantic information can include multiple fields from the logs. For example, if the logs in the log collection are about airline tickets, the electronic device can determine that the corresponding semantic information may include fields such as "log name", "flight model", "departure date", "departure point", and "destination".
[0112] For any given log, electronic devices can semantically represent the log name, fields, field values, and jump logs in the log to obtain semantic information. This allows them to determine the semantic information corresponding to the log and thus establish the correspondence between the log and the semantic information.
[0113] Optionally, after determining the correspondence between logs and semantic information, the correspondence between logs and semantic information can be stored in a preset database to facilitate the sharing of semantic information.
[0114] S203. Generate a fault location system based on the query conditions, log set, and corresponding relationships.
[0115] Once the electronic device determines the query conditions, log sets, and corresponding relationships, it can generate a fault location system.
[0116] It should be noted that electronic devices can generate fault location systems for different scenarios based on different query conditions and log sets. For example, an electronic device can generate a flight ticket fault location system based on query condition 1 and log set 1; and it can generate a hotel fault location system based on query condition 2 and log set 2.
[0117] In this embodiment, the electronic device can determine the query conditions and log set corresponding to the fault location system, and determine the correspondence between the logs and semantic information, thereby generating the fault location system. Because the query conditions and log set corresponding to the fault location system can be quickly configured, and the correspondence between the logs and semantic information can be determined to generate fault location systems for different scenarios, the efficiency of generating the fault location system is improved.
[0118] Below, in conjunction with Figure 3 The process of generating a fault location system is illustrated through specific examples.
[0119] Figure 3This is a schematic diagram illustrating a method for generating a fault location system, provided as an exemplary embodiment of this application. Please refer to... Figure 3 This includes interfaces 301, 302, and 303.
[0120] Please refer to interface 301. Staff can set search criteria based on the service type so that the electronic device can determine the search criteria. For example, if the service type is air ticket service, search criteria 1 can be set as user account, search criteria 2 as booking time, search criteria 3 as departure point, etc.
[0121] Staff can select multiple logs corresponding to the fault location system from the log favorites according to the service type, so that the electronic device can identify the log set. For example, in interface 302, the electronic device can identify that the log set includes multiple logs such as Log 1, Log 2, and Log 3.
[0122] Electronic devices can semantically represent any log in a log set to obtain semantic information, thereby determining the correspondence between any log and the semantic information.
[0123] The system can also be configured to display the query results in an interface similar to interface 303. For example, in interface 303, the query results display interface of the ticket fault location system can include log name, user account, booking time, departure location, etc.
[0124] In the above process, the fault location system can be quickly built by configuring the log set, query conditions, and query result display interface of the fault location system.
[0125] In this embodiment, the electronic device can determine the query conditions and log set corresponding to the fault location system, and determine the correspondence between the logs and semantic information, thereby generating the fault location system. Because the query conditions and log set corresponding to the fault location system can be quickly configured, and the correspondence between the logs and semantic information can be determined to generate fault location systems for different scenarios, the efficiency of generating the fault location system is improved.
[0126] After generating the fault location system, it can be used for querying to locate the fault. Below, we will combine... Figure 4 The method for fault location is explained.
[0127] Figure 4 This is a flowchart illustrating a fault location method provided for an exemplary embodiment of this application. Please refer to [link / reference]. Figure 4 The method may include:
[0128] S401. Obtain query parameters through the fault location system.
[0129] The query parameters are related to the type of fault location system. For example, if the fault location system is for airline tickets, the query parameters may include user account, ticket number, purchase date, etc. If the fault location system is for hotels, the query parameters may include user account, hotel name, etc.
[0130] The fault location system can be deployed in electronic devices. Staff can input query parameters into the fault location system of the electronic device so that the electronic device can obtain the query parameters through the fault location system.
[0131] For example, if the fault location system is a ticket fault location system, staff can enter query parameters such as "user account 1" and "2022-03-02" into the fault location system of the electronic device, and the electronic device can obtain query parameters such as "user account 1" and "2022-03-02" through the fault location system.
[0132] S402. Based on the query parameters, determine the first log in the log set corresponding to the fault location system.
[0133] The first log refers to the log determined by the electronic device based on the query parameters.
[0134] For example, if the fault location system is a flight ticket fault location system, and the logs in the log set are logs related to flight tickets, including all user booking, change, and refund logs, then the electronic device can determine the first log in this log set based on "user account 1" and "2022-03-02". That is, the first log is the log corresponding to user account 1 and 2022-03-02.
[0135] S403. Obtain the semantic information corresponding to the first log.
[0136] In one optional embodiment, the electronic device can obtain the log identifier of the first log and, based on the log identifier, retrieve the semantic information corresponding to the first log from a preset database.
[0137] Optionally, the log identifier can be the log name of the first log entry. For example, the log identifier could be "flight search list page".
[0138] The pre-defined database can store multiple correspondences between logs and semantic information. The process of determining the correspondence between logs and semantic information can be found in step S202, and will not be repeated here.
[0139] For example, if the first log is the log corresponding to user account 1 on 2022-03-02, and the log name is "Mtop.trip.flight.pattren.flightsearch-1.0", then the electronic device can identify "Mtop.trip.flight.pattren.flightsearch-1.0" as the log identifier, and determine the semantic information corresponding to the first log in the preset database based on the log identifier. For example, the corresponding semantic information may include fields such as "user account 1", "flight model", "departure date", "departure point", and "destination".
[0140] S404. Generate target information based on the first log and semantic information, and display the target information.
[0141] Target information can be used to indicate the fault location result. Target information may include multiple fields and their corresponding field values. For example, target information may include the field "booking time" and its corresponding field value "2022-03-02".
[0142] In one optional embodiment, the target information can be generated as follows: parsing the first log to obtain a structured second log; extracting the field values corresponding to multiple fields from the second log; and generating the target information based on the multiple fields and their corresponding field values.
[0143] It should be noted that the first log can be an event tracking log, that is, a log obtained through event tracking such as UserTrack UT or Golden Arrow. Different event tracking points have different specification definitions, so the generated first log has different log formats. For example, the log format can be JavaScript Object Notation (JSON) format, Kivy (kv) format, decoded format, etc.
[0144] Because the log format of the first log is not uniform, it is necessary to parse the first log to obtain a structured second log so that the field values corresponding to multiple fields can be extracted from the second log.
[0145] For example, if the first log contains logs in different formats such as JSON and key-value pairs, the electronic device can parse and process the first log and extract multiple field values from the second log. Suppose it can extract "Mtop.trip.flight.pattren.flightsearch-1.0", "User Account 1", "2022-03-02", "Qingshan", and "Taiyuan". If the semantic information includes multiple fields such as "log name", "user account", "booking time", "departure point", and "destination", the electronic device can determine the corresponding field values for these fields in the second log based on the semantic information. Then, it can generate target information based on these fields and their corresponding values. That is, the generated target information could be "Log name: Mtop.trip.flight.pattren.flightsearch-1.0, User account: User account 1; Booking time: 2022-03-02; Departure point: Qingshan; Destination: Taiyuan".
[0146] Optionally, the target information can be displayed in the following two ways:
[0147] Method 1: Identify outliers among the field values corresponding to multiple fields, display the outliers in a first format, and display other information in the target information other than the outliers in a second format; the outliers are used to indicate the fault location results.
[0148] The first format can be font, color, etc. For example, the first format can be bold font or red font, etc.
[0149] The second format can be a format different from the first format. For example, if the first format is red font, the second format can be black font.
[0150] Below, in conjunction with Figure 5A Method 1 will be illustrated with specific examples.
[0151] Figure 5A A schematic diagram of a target information page provided for an exemplary embodiment of this application. Figure 1 Please see. Figure 5AIf the target information generated by the electronic device is "Log Name: Mtop.trip.flight.pattren.flightsearch-1.0; User Account: User Account 1; Booking Time: 2035-01-08; Departure Point: Qingshan; Destination: Taiyuan", with the first format in bold and the second format in black, then the electronic device can determine that "Booking Time: 2035-01-08" in the target information is abnormal information, and can display this abnormal information in bold and identify it as a fault location result; if the electronic device can determine that "Log Name: Mtop.trip.flight.pattren.flightsearch-1.0; User Account: User Account 1; Departure Point: Qingshan; Destination: Taiyuan" in the target information is not abnormal information, then it can display these multiple non-abnormal information entries in black.
[0152] Method 2: Identify outliers among the field values corresponding to multiple fields. Outliers are used to indicate the fault location results. The fault location results can be displayed above or below the page displaying the target information.
[0153] Below, in conjunction with Figure 5B Method 2 will be illustrated with specific examples.
[0154] Figure 5B A schematic diagram of a target information page provided for an exemplary embodiment of this application. Figure 2 Please see. Figure 5B The content of the target information and Figure 5A The content of the target information is the same, so it will not be repeated here. The difference is that abnormal and non-abnormal information can be displayed in the same format, while at the bottom of the page displaying the target information, "Fault location result is ticket booking time: 2035-01-08" can be displayed.
[0155] In this embodiment, the electronic device can obtain query parameters through a fault location system and determine a first log in the log set corresponding to the fault location system based on the query parameters. Then, it can determine the semantic information corresponding to the first log in a preset database based on the identifier of the first log. The electronic device can parse the first log to obtain a second log and extract multiple field values from the second log. Then, it can determine the field values corresponding to the multiple fields in the second log based on the multiple fields in the semantic information. The electronic device can generate and display target information based on the multiple fields and their corresponding field values. The target information can be used to indicate the fault location result. Since the electronic device can determine the first log through the fault location system, switching between multiple troubleshooting systems is avoided; and since it can obtain the semantic information corresponding to the first log and generate and display target information based on the first log and semantic information, the readability of the first log is improved, thus improving the efficiency of fault troubleshooting.
[0156] exist Figure 4 Based on the illustrated embodiment, the following, in conjunction with Figure 6 The process of parsing the first log to obtain the second log in step S404 above will be further explained.
[0157] Figure 6 This is a schematic diagram illustrating the process of parsing and processing a first log as provided in an exemplary embodiment of this application. Please refer to... Figure 6 The method may include:
[0158] S601. Initialize i to 1.
[0159] The electronic device can determine the X-level log in the first log. The number of the log level can be represented by i, where i = 1, 2, 3, ..., X, and i is a positive integer.
[0160] You can initialize i to 1, which means starting the parsing from the first level of the first log.
[0161] S602, Read the log of the i-th layer.
[0162] Once the electronic device has determined each layer of the log, it can read the i-th layer of the log for parsing.
[0163] S603. Determine if the log of the i-th layer is in JSON format.
[0164] The electronic device can determine whether the log at level i is in JSON format based on its content and syntax. If not, execute S604; if yes, execute S610.
[0165] S604. Determine if the log of the i-th layer is in the format K1=V1&K2=V2.
[0166] The electronic device can determine whether the log at level i is in the format K1=V1&K2=V2 based on the content and format of the log at level i. If not, then execute S605; if yes, then execute S610.
[0167] S605. Determine if the log of the i-th layer is in the format K1=V1, K2=V2.
[0168] The electronic device can determine whether the log at level i is in the format K1=V1, K2=V2 based on the content and writing style of the log at level i. If yes, then execute S610; otherwise, execute S606.
[0169] S606. Decode the log of the i-th layer.
[0170] If the electronic device determines that the format of the i-th layer log is not any of the following: "JSON format", "K1=V1&K2=V2 format", or "K1=V1, K2=V2 format", then the electronic device can decode the i-th layer log.
[0171] S607. Determine whether the flag bit is greater than or equal to 1.
[0172] Optionally, a Flag can be used to indicate the number of times the i-th level log is decoded. Only one decoding process can be performed for any given level of log.
[0173] The electronic device can determine whether Flag is greater than or equal to 1. If yes, it executes S608; otherwise, it executes S609.
[0174] S608. Output the parsing result of the i-th layer log.
[0175] If the electronic device determines that the decoding count Flag of the i-th layer log is greater than or equal to 1, it means that the i-th layer log has been decoded and the parsing result of the i-th layer log can be output.
[0176] S609, Update Flag to Flag+1.
[0177] If the electronic device determines that the decoding count Flag of the i-th layer log is less than 1, since the i-th layer log has been decoded in step S606, the Flag can be updated by adding 1 to the new Flag, indicating that the i-th layer log has been decoded. Then, the next layer log can be parsed, and step S610 can be executed.
[0178] For example, if the electronic device determines that the decoding count Flag of the first layer log is 0, then after decoding the i-th layer log in step S606, Flag can be updated to 1 to indicate that the first layer log has been decoded once. Then the parsing of the first layer log is completed, and the parsing of the second layer log can be performed. Then S610 can be executed.
[0179] S610, Update i to i+1.
[0180] If the electronic device determines that the log at layer i is in any of the following formats: JSON, K1=V1&K2=V2, or K1=V1, K2=V2, or if the log at layer i is not in any of the following formats: JSON, K1=V1&K2=V2, or K1=V1, K2=V2, and the electronic device has already decoded the log at layer i, then i can be updated, and i+1 can be used as the new i, indicating that the parsing of the log at layer i+1 begins.
[0181] For example, if the electronic device determines that the Level 1 log is in any of the following formats: JSON, K1=V1&K2=V2, or K1=V1, K2=V2, then it can update i to 2, indicating that it is starting to parse the Level 2 log. Alternatively, if the electronic device has already decoded the Level 1 log, it can update i to 2, indicating that it is starting to parse the Level 2 log.
[0182] It should be noted that, for any level of log, when parsing, the number of decoding attempts for the i-th level log can be initialized to 0, indicating that the i-th level log has not undergone decoding.
[0183] S611. Determine if i is greater than X.
[0184] The value of i is set to 1, 2, 3, ..., X, with the maximum value of i being X. The last layer of log in the first log is the Xth layer log. If the electronic device determines that i is less than or equal to X, it executes S602; if the electronic device determines that i is greater than X, it means that the Xth layer log has been parsed, that is, the parsing of the first log has been completed, and the parsing ends.
[0185] After parsing the first log through steps S601-S611 above, a structured second log can be obtained. Below, in conjunction with... Figure 7 The second log entry will be explained.
[0186] Figure 7 A schematic diagram of a second log provided for an exemplary embodiment of this application. See also... Figure 7 The second log can include multiple layers of code, and the values of multiple fields can be extracted from the second log. For example... Figure 7 The second log can include three levels of code: Level 1, Level 2, and Level 3. Level 1 code can include Level 2 code 2-1 and Level 2 code 2-2. Level 2 code 2-1 can include Level 3 code 3-1, which can include the date: 2022-02-08, City 1 ID: A, and Time 1: 11:20. Level 2 code 2-2 can include Level 3 code 3-2, which can include the date: 2022-02-08, City 2 ID: B, and Time 2: 14:50, etc. Here, "2022-02-08", "A", "11:20", "B", and "14:50" are the extracted field values.
[0187] In this embodiment, the electronic device can determine the multiple layers of logs in the first log and identify the log format of each layer. Then, based on the log format of each layer, it parses the first log to obtain a structured second log, allowing for the extraction of field values corresponding to multiple fields from the second log. Because the electronic device can parse the first log to obtain the structured second log and extract field values corresponding to multiple fields from the second log for troubleshooting, the efficiency of troubleshooting is improved compared to directly troubleshooting in the first log.
[0188] It should be noted that if the first log is incomplete, it will be impossible to parse and process. Therefore, it is necessary to restore the first log to its JSON structure. Restoration processing may include replacing escape characters in the first log, truncating the first log, and adding the first and last characters. Below, based on any of the above embodiments, combined with... Figure 8 The process of restoring the first log is explained in detail.
[0189] Figure 8 This is a schematic diagram illustrating the log restoration process provided in an embodiment of this application. Please refer to... Figure 8 The method may include:
[0190] S801. Replace the escape character in the first log with the first preset character.
[0191] Escape characters are characters that begin with a backslash ("\"). For example, an escape character can be "\0".
[0192] The first preset character can be empty. For example, the first preset character can be null.
[0193] Since the first log contains a large number of meaningless escape characters, which affects the restoration process of the first log, the escape characters can be replaced with the first preset characters. That is, characters such as "\0" and "\n" in the first log can be replaced with "null".
[0194] S802, Truncate the first log.
[0195] In an optional embodiment, the first log can be truncated as follows: determine whether the last character of the first log is a second preset character; if not, determine that the first log is an incomplete log, determine the last second preset character in the first log, and truncate the first log at the last second preset character; wherein, the truncated first log includes: the characters between the first character and the last second preset character in the first log.
[0196] The second preset character can be a comma. For example, the second preset character can be ",".
[0197] For example, if the first log entry is "api":"mtop.trip.flight.reshop.flightsearch","data":, where the last character is ":", and the second preset character is ",", the electronic device can determine that the last character ":" is not the second preset character ",", thus identifying the first log entry as incomplete. It can then determine the last second preset character "," within the first log entry and truncate the log entry at that point. The truncated first log entry would then be "api":"mtop.trip.flight.reshop.flightsearch",.
[0198] S803. Add the first ending character to the first log after truncation.
[0199] The first ending character can include a right curly brace and / or a right square bracket. For example, the first ending character can be "}" and / or "]".
[0200] When adding the first ending character to the first log, it is necessary to determine the number and position of the first ending character to be added to the first log.
[0201] In an optional embodiment, the number of first ending characters to be added can be determined as follows: obtain the first number M of left curly braces and the second number N of right curly braces in the truncated first log, where M and N are integers; obtain the third number P of left square brackets and the fourth number Q of right square brackets in the truncated first log, where P and Q are integers; if M is greater than N, then add MN right curly braces to the truncated first log, and if P is greater than Q, then add PQ right square brackets to the truncated first log.
[0202] For example, if the electronic device determines that the first number of "{" is 50 and the second number of "}" is 40 in the first log after truncation, it can determine that 10 "}" need to be added to the first log after truncation; if the electronic device determines that the third number of "[" is 42 and the fourth number of "]" is 26 in the first log after truncation, it can determine that 16 "]" need to be added to the first log after truncation.
[0203] In an optional embodiment, the position of the first ending character to be added can be determined as follows: In the truncated first log, determine the positions of M left curly braces, N right curly braces, P left square brackets, and Q right square brackets; based on the positions of the M left curly braces, N right curly braces, P left square brackets, and Q right square brackets, add MN right curly braces and PQ right square brackets to the truncated first log, so that the M left curly braces, M right curly braces, P left square brackets, and P right square brackets are symmetrically distributed in the updated first log.
[0204] For example, if the electronic device determines that the first number of "{" is 5, the second number of "}" is 3, the third number of "[" is 4, and the fourth number of "]" is 2, and the position is "{…{…{…{…{…[…[…[…[………]…]…}…}…}", then the electronic device can determine that 2 "}" and 2 "]" need to be added to the first log after truncation so that the 5 "{", 5 "}", 4 "[" and 4 "]" are symmetrically distributed in the updated first log, such as "{…{…{…{…{…{…[…[…[…[…[………]…]…]…]…}…}…}…}…}", and the updated log is a complete log.
[0205] In this embodiment, if the first log is incomplete, the escape characters in the first log can be replaced with a first preset character. The first log can be truncated at the last second preset character, and right curly braces and right square brackets can be added to adjust their number and position to ensure a symmetrical distribution of left and right curly braces, left and right square brackets in the updated first log. This achieves a structured reconstruction of the first log, facilitating its parsing. Since an incomplete first log can be reconstructed to obtain a structured and complete first log, facilitating its parsing, the system efficiency for parsing the first log can be improved, thereby increasing the efficiency of troubleshooting.
[0206] Below, based on any of the above embodiments, combined with Figure 9 The process of fault location is explained through specific examples.
[0207] Figure 9 A schematic diagram illustrating the process of a fault location method provided for an exemplary embodiment of this application. Please refer to [link / reference]. Figure 9 It includes interface 901, log collection, preset database and interface 902.
[0208] Please refer to interface 901. If the service experiencing the malfunction is flight ticketing, a flight ticketing fault location system can be generated. In this system, staff can input query parameters. For example, query parameters could be "User Account 1" and "2022-03-02". The electronic device can then obtain these parameters through the system and determine the first log entry based on the corresponding log set.
[0209] Since this fault location system is a flight ticket fault location system, the corresponding log set is all logs related to flight tickets, including all user booking, modification, and refund logs. For example, the log set can include log 1, log 2, log 3, log 4, ..., log n. Log 1's log name is "2022-03-02 10:19:06 Flight Ticket Search List Page"; log 2's log name is "2022-03-02 / / User Account 1 / / Booking Log"; log 3's log name is "2022-03-02 / / User Account 2 / / Booking Log"; log 4's log name is "2022-03-02 / / User Account 3 / / Refund Log"; and log n's log name is "2022-03-02 / / User Account n / / Modification Log". Therefore, the electronic device can determine log 2 as the first log in the log set based on the query parameters "User Account 1" and "2022-03-02".
[0210] The default database can store multiple logs and their corresponding semantic information. For example, the default database may include log 1 and its corresponding semantic information 1, log 2 and its corresponding semantic information 2, log 3 and its corresponding semantic information 3, ..., log n and its corresponding semantic information n.
[0211] After identifying the first log entry, the electronic device can determine the corresponding semantic information in a preset database based on the log identifier of the first log entry. For example, if the log identifier of the first log entry is "Log 2", the electronic device can determine the corresponding semantic information as semantic information 2 in the preset database based on "Log 2". Semantic information 2 may include multiple fields. For example, semantic information 2 may include multiple fields such as log name, user account, booking time, departure point, and destination.
[0212] After determining the semantic information 2 corresponding to log 2, the electronic device can determine whether log 2 is a complete log. If it is a complete log, the electronic device can parse each layer of log 2 to obtain a structured second log; if it is an incomplete log, the electronic device can restore log 2 to obtain an updated log 2, and then parse each layer in the updated log 2 to obtain a structured second log.
[0213] The electronic device can extract field values corresponding to multiple fields from the second log. For example, the field values that the electronic device can extract from the second log include "2022-03-02 / / User Account 1 / / Ticket Booking Log", "User Account 1", "2035-01-08", "Qingshan", and "Taiyuan". The electronic device can then generate target information based on multiple fields in semantic information 2 and multiple field values in the second log. The target information can include "Log Name: 2022-03-02 / / User Account 1 / / Ticket Booking Log, User Account: User Account 1, Booking Time: 2035-01-08, Departure Point: Qingshan, Destination: Taiyuan, Fault Location Result: Booking Time: 2035-01-08", which can be displayed as shown in interface 902.
[0214] In this embodiment, the electronic device can obtain query parameters through a fault location system and determine a first log in the log set corresponding to the fault location system based on the query parameters. Then, it can determine the semantic information corresponding to the first log in a preset database based on the identifier of the first log. The electronic device can parse the first log to obtain a second log and extract multiple field values from the second log. Then, it can determine the field values corresponding to the multiple fields in the second log based on the multiple fields in the semantic information. The electronic device can generate and display target information based on the multiple fields and their corresponding field values. The target information can be used to indicate the fault location result. Since the electronic device can determine the first log through the fault location system, switching between multiple troubleshooting systems is avoided; and since it can obtain the semantic information corresponding to the first log and generate and display target information based on the first log and semantic information, the readability of the first log is improved, thus improving the efficiency of fault troubleshooting.
[0215] Figure 10 For a schematic diagram of a fault location device provided as an exemplary embodiment of this application, please refer to [link / reference]. Figure 10 The fault location device includes: a first acquisition module 11, a first determination module 12, a second acquisition module 13, a first generation module 14, and a display module 15, wherein...
[0216] The first acquisition module 11 is used to acquire query parameters through the fault location system;
[0217] The first determining module 12 is used to determine the first log in the log set corresponding to the fault location system according to the query parameters;
[0218] The second acquisition module 13 is used to acquire semantic information corresponding to the first log, the semantic information including multiple fields;
[0219] The first generation module 14 is used to generate target information based on the first log and the semantic information; the target information includes the plurality of fields and the field values corresponding to the fields; the target information is used to indicate the fault location result;
[0220] The display module 15 is used to display the target information.
[0221] The fault location device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0222] In one possible implementation, the first generation module 14 is specifically used for:
[0223] The first log is parsed to obtain a structured second log;
[0224] Extract the field values corresponding to the multiple fields from the second log;
[0225] The target information is generated based on the plurality of fields and their corresponding field values.
[0226] In one possible implementation, the first generation module 14 is specifically used for:
[0227] Identify multi-level logs within the first log;
[0228] Based on the log format of each level of log, the first log is parsed and processed to obtain the second log.
[0229] In one possible implementation, the first generation module 14 is specifically used for:
[0230] Replace the escape characters in the first log with the first preset character;
[0231] When it is determined that the first log is an incomplete log, the first log is truncated, and a first ending character is added to the truncated first log to obtain an updated first log, which is a complete log.
[0232] In one possible implementation, the first generation module 14 is specifically used for:
[0233] Determine whether the last character of the first log is a second preset character;
[0234] If not, the first log is determined to be an incomplete log, and the last second preset character is determined in the first log. At the last second preset character, the first log is truncated. The truncated first log includes the characters between the first character and the last second preset character in the first log.
[0235] In one possible implementation, the first generation module 14 is specifically used for:
[0236] The first log after truncation is obtained, which includes a first number M of left curly braces and a second number N of right curly braces, where M and N are integers.
[0237] The third number P of the left square brackets and the fourth number Q of the right square brackets are obtained in the first log after the truncation process, where P and Q are integers;
[0238] If M is greater than N, then MN right curly braces are added to the first log after truncation; and if P is greater than Q, then PQ right square brackets are added to the first log after truncation.
[0239] In one possible implementation, the first generation module 14 is specifically used for:
[0240] In the first log after the truncation process, determine the positions of M left curly braces, N right curly braces, P left square brackets, and Q right square brackets.
[0241] Based on the positions of the M left curly braces, the N right curly braces, the P left square brackets, and the Q right square brackets, add the M N right curly braces and the PQ right square brackets to the first log after truncation, so that the M left curly braces, M right curly braces, P left square brackets, and P right square brackets are symmetrically distributed in the updated first log.
[0242] In one possible implementation, the display module 15 is specifically used for:
[0243] Identify outlier values among the field values corresponding to the multiple fields;
[0244] The abnormal value is displayed in a first format, and other information in the target information other than the abnormal value is displayed in a second format; the abnormal value is used to indicate the fault location result.
[0245] In one possible implementation, the second acquisition module 13 is specifically used for:
[0246] Obtain the log identifier of the first log;
[0247] Based on the log identifier, the semantic information corresponding to the first log is obtained from the preset database.
[0248] The fault location device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0249] Figure 11 A schematic diagram of another fault location device provided as an exemplary embodiment of this application. Figure 11 Based on the illustrated embodiments, please refer to Figure 11 The fault location device 10 also includes a second determining module 16, a third determining module 17, and a second generating module 18.
[0250] The second determining module 16 is used to determine the query conditions corresponding to the fault location system and the log set;
[0251] The third determining module 17 is used to determine the correspondence between logs and semantic information;
[0252] The second generation module 18 is used to generate the fault location system based on the query conditions, the log set, and the correspondence.
[0253] The fault location device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0254] An exemplary embodiment of this application provides a structural schematic diagram of an electronic device. Please refer to [link / reference]. Figure 12 The electronic device 20 may include a processor 21 and a memory 22. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.
[0255] The memory 22 stores computer-executed instructions;
[0256] The processor 21 executes the computer execution instructions stored in the memory 22, causing the processor 21 to perform the fault location method as shown in the above method embodiment.
[0257] Accordingly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the fault location method described in the above method embodiments.
[0258] Accordingly, embodiments of this application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the fault location method shown in the above method embodiments.
[0259] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0260] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0261] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0262] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0263] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0264] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0265] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0266] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0267] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A fault location method, characterized in that, include: Identify the system where the application malfunctioned, determine the corresponding fault location system for the malfunctioning system, and obtain query parameters through the fault location system. Based on the query parameters, determine the first log in the log set corresponding to the fault location system; obtain the semantic information corresponding to the first log, the semantic information including multiple fields; Replace the escape characters in the first log with the first preset character; When it is determined that the first log is an incomplete log, the first log is truncated, and a first ending character is added to the truncated first log to obtain an updated first log, which is a complete log. Target information is generated based on the first log and the semantic information, and the target information is displayed. The target information includes the plurality of fields and the field values corresponding to the fields. The target information is used to indicate the fault location results.
2. The method according to claim 1, characterized in that, Generate target information based on the first log and the semantic information, including: The first log is parsed to obtain a structured second log; Extract the field values corresponding to the multiple fields from the second log; The target information is generated based on the plurality of fields and their corresponding field values.
3. The method according to claim 2, characterized in that, The first log is parsed to obtain a structured second log, including: Identify multi-level logs in the first log; Based on the log format of each level of log, the first log is parsed and processed to obtain the second log.
4. The method according to claim 1, characterized in that, When it is determined that the first log is an incomplete log, the first log is truncated, including: Determine whether the last character of the first log is a second preset character; If not, the first log is determined to be an incomplete log, and the last second preset character is determined in the first log. At the last second preset character, the first log is truncated. The truncated first log includes the characters between the first character and the last second preset character in the first log.
5. The method according to claim 1 or 4, characterized in that, The first ending character includes a right curly brace and / or a right square bracket; the first ending character is added to the truncated first log to obtain the updated first log, including: The first log after truncation is obtained, which includes a first number M of left curly braces and a second number N of right curly braces, where M and N are integers. The third number P of the left square brackets and the fourth number Q of the right square brackets are obtained in the first log after the truncation process, where P and Q are integers; If M is greater than N, then MN right curly braces are added to the first log after truncation; and if P is greater than Q, then PQ right square brackets are added to the first log after truncation.
6. The method according to claim 5, characterized in that, M is greater than N, and P is greater than Q; MN right curly braces are added to the first log after truncation, and PQ right square brackets are added to the first log after truncation, including: In the first log after the truncation process, determine the positions of M left curly braces, N right curly braces, P left square brackets, and Q right square brackets. Based on the positions of the M left curly braces, the N right curly braces, the P left square brackets, and the Q right square brackets, add the M N right curly braces and the PQ right square brackets to the first log after truncation, so that the M left curly braces, M right curly braces, P left square brackets, and P right square brackets are symmetrically distributed in the updated first log.
7. The method according to any one of claims 1-4, 6, characterized in that, Displaying the target information includes: Identify outlier values among the field values corresponding to the multiple fields; The abnormal value is displayed in a first format, and other information in the target information other than the abnormal value is displayed in a second format; the abnormal value is used to indicate the fault location result.
8. The method according to any one of claims 1-4, 6, characterized in that, Obtain the semantic information corresponding to the first log, including: Obtain the log identifier of the first log; Based on the log identifier, the semantic information corresponding to the first log is obtained from the preset database.
9. The method according to any one of claims 1-4, 6, characterized in that, Before obtaining the query parameters through the fault location system, the following steps are also included: Determine the query conditions and the log set corresponding to the fault location system; Determine the correspondence between logs and semantic information; The fault location system is generated based on the query conditions, the log set, and the corresponding relationship.
10. A fault location device, characterized in that, include: The system comprises a first acquisition module, a first determination module, a second acquisition module, a first generation module, and a display module, wherein, The first acquisition module is used to determine the system in which the application malfunctions, determine the fault location system corresponding to the malfunctioning system, and obtain query parameters through the fault location system. The first determining module is used to determine the first log in the log set corresponding to the fault location system according to the query parameters; The second acquisition module is used to acquire semantic information corresponding to the first log, the semantic information including multiple fields; The first generation module is used to replace escape characters in the first log with a first preset character; When the first log is determined to be an incomplete log, the first log is truncated, and a first ending character is added to the truncated first log to obtain an updated first log, which is a complete log; target information is generated based on the first log and the semantic information; the target information includes the plurality of fields and the field values corresponding to the fields; the target information is used to indicate the fault location result; The display module is used to display the target information.
11. An electronic device, characterized in that, include: Memory and processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the fault location method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the fault location method according to any one of claims 1 to 9.
13. A computer program product comprising a computer program that, when executed by a processor, implements the fault location method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Log analysis method and device, log recording method and device, electronic equipment and storage medium
CN111368144A
Dispatch link fault determination method and device, equipment and storage medium
CN113806360A