A log analysis method, device, computer program product and storage medium

By identifying error codes and using semantic adaptation technology, the accuracy of log parsing is improved, solving the problem of insufficient log parsing accuracy and ensuring the timeliness and effectiveness of network device anomaly monitoring.

CN123159309APending Publication Date: 2026-11-24CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510685158.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

The accuracy of log parsing in existing technologies is insufficient, which limits the timeliness and effectiveness of network device anomaly monitoring.

Method used

By identifying the error code in the log to be parsed, historical logs containing that error code are searched as candidate logs. Semantic adaptation is used to match the target candidate log from the candidate log set, and the log events in the log to be parsed are determined by referring to the log events of the target candidate log.

Benefits of technology

It improves the accuracy of log parsing, ensuring more accurate identification of log events, helping network operations and maintenance personnel to promptly detect and handle device anomalies, and avoid performance impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159309A_ABST
    Figure CN123159309A_ABST
Patent Text Reader

Abstract

This application provides a log parsing method, device, computer program product, and storage medium. For a log to be parsed, its error codes can be identified, and historical logs containing those error codes can be searched as candidate logs. This allows for precise location of the log matching range for the log to be parsed, providing a more accurate foundation for subsequent log matching and eliminating interference from irrelevant historical logs. Furthermore, it proposes that target candidate logs can be matched from a set of candidate logs through semantic adaptation. This effectively improves the log distinguishability of the matching criteria, thereby matching target candidate logs that are more similar in content to the log to be parsed, and increasing the probability that the matched target candidate logs record the same log events as the log to be parsed. Accordingly, the accuracy of log parsing can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a log parsing method, device, computer program product, and storage medium. Background Technology

[0002] In cloud computing and other technology scenarios, a large number of network devices, such as routers and switches, are deployed in the infrastructure network. Monitoring these network devices for anomalies helps network operations and maintenance personnel to detect abnormalities in a timely manner.

[0003] Log parsing is a crucial step in the anomaly monitoring process. By parsing the device logs of network devices, log events can be identified. These log events serve as a basis for network operations and maintenance personnel to assess the status of network devices, helping them to promptly identify anomalies or potential risks and take timely and effective measures to prevent device malfunctions from impacting network performance.

[0004] Therefore, improving the accuracy of log parsing has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application provides a log parsing method, device, computer program product, and storage medium to improve the accuracy of log parsing.

[0006] This application provides a log parsing method, including:

[0007] In response to log parsing commands, identify the error codes contained in the log to be parsed;

[0008] Search for historical logs containing the error codes to obtain a candidate log set;

[0009] From the candidate log set, find the target candidate log that matches the semantics of the log to be parsed;

[0010] The log events recorded in the log to be parsed are determined by referring to the log events marked on the target candidate log.

[0011] This application also provides a computing device, including a memory, a processor, and a communication component;

[0012] The memory is used to store one or more computer instructions;

[0013] The processor is coupled to the memory and the communication component and is used to execute one or more computer instructions for performing the aforementioned log parsing method.

[0014] This application also provides a computer-readable storage medium for storing a computer program, which, when executed by one or more processors, causes the one or more processors to perform the aforementioned log parsing method.

[0015] This application also provides a computer program product, including a computer program that, when executed by one or more processors, causes the one or more processors to execute the aforementioned log parsing method.

[0016] This application proposes a log parsing scheme. For the log to be parsed, its error codes can be identified, and historical logs containing those error codes can be searched as candidate logs. By using error codes as the search basis, the matching range of the log to be parsed can be accurately located, providing a more accurate foundation for the subsequent log matching process and eliminating interference from irrelevant historical logs. Furthermore, a semantic adaptation operation is proposed to match target candidate logs from the candidate log set. This can match target candidate logs that are more similar to the log content of the log to be parsed, thereby increasing the probability that the matched target candidate logs and the log to be parsed contain the same log events. Based on this, the log events marked on the target candidate logs can be referenced to determine the log events recorded in the log to be parsed. Therefore, in this application embodiment, by improving the matching accuracy of target candidate logs, the accuracy of the log events determined for the log to be parsed can be effectively improved, thus effectively improving the accuracy of log parsing. Attached Figure Description

[0017] 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:

[0018] Figure 1 A flowchart illustrating a log parsing method provided for an exemplary embodiment of this application;

[0019] Figure 2 A logical schematic diagram of a log parsing method provided for an exemplary embodiment of this application;

[0020] Figure 3 A schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the structure of a computing device provided for another exemplary embodiment of this application. Detailed Implementation

[0022] 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.

[0023] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.

[0024] Before proceeding with a detailed description of the technical solutions provided in the various embodiments of this application, the following is a brief explanation of several technical concepts involved in this application.

[0025] Device logs: Devices (such as network devices like routers, switches, and firewalls, and various physical servers) record various events and operational information during operation; this information is called device logs. Logs contain a wealth of information, such as device startup and shutdown records, user login and logout information, network traffic changes, configuration change records, error messages, and various system events.

[0026] Anomaly monitoring is a technical means of detecting abnormal situations that occur during the operation of a device by analyzing the device logs generated on the device.

[0027] Log parsing refers to the process of analyzing and understanding device logs generated on the equipment. Its purpose is to extract valuable information from massive and complex device logs to help staff understand the equipment's operating status, identify potential problems, diagnose faults, and ensure safety.

[0028] Log events: These are typical log parsing results. They can be specific events that indicate anomalies, malfunctions, or potential security threats in the operating system, network components, or applications within a device, such as alarm events, permission change events, or shutdown events.

[0029] Log events can serve as a basis for staff to judge the status of equipment, helping them to promptly identify abnormal problems or potential risks, and thus take effective measures to handle them in a timely manner, preventing equipment malfunctions from affecting system performance in application scenarios. Therefore, improving the accuracy of log parsing to more accurately identify log events can help improve system performance in application scenarios.

[0030] Therefore, this application provides a solution. The basic idea is to more accurately match the referenced historical logs to the log to be parsed, and use the log events marked on the matched historical logs as the log parsing result to improve the accuracy of log parsing.

[0031] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0032] Figure 1 A flowchart illustrating a log parsing method provided as an exemplary embodiment of this application. Figure 2 This is a logical schematic diagram of a log parsing method provided for an exemplary embodiment of this application. The method can be executed by a log parsing device, which can be implemented as software, hardware, or a combination of both, and can be integrated into a computing device. Furthermore, this embodiment does not limit the specific division of functional modules in the log parsing device; the functional modules can be flexibly designed according to actual needs, as long as they can support the log parsing device in executing the log parsing method proposed in this embodiment. No limitations are imposed here, nor are specific examples provided.

[0033] refer to Figure 1 The log parsing method proposed in this embodiment may include:

[0034] Step 100: In response to the log parsing instruction, identify the error codes contained in the log to be parsed;

[0035] Step 101: Search for historical logs containing error codes as candidate logs to obtain a candidate log set;

[0036] Step 102: From the candidate log set, find the target candidate log that matches the semantics of the log to be parsed;

[0037] Step 103: Refer to the log events marked on the target candidate log to determine the log events recorded in the log to be parsed.

[0038] The log parsing method provided in this embodiment is applicable to various application scenarios and can parse logs for various types of devices. The anomaly monitoring of network devices mentioned in the background technology is a typical application scenario. In this scenario, the log to be parsed in this embodiment can be any device log generated by any network device in the network system. Furthermore, the network system here can be a local area network system, or a cloud computing network system, etc., without limitation. Of course, besides this typical application scenario, the log parsing method provided in this embodiment can also be applied to other application scenarios with log parsing requirements, without further examples. Correspondingly, in addition to parsing logs for network devices, this embodiment can also parse logs for other types of devices, such as physical servers in data centers, physical servers in enterprise computer rooms, personal computers, etc. Without limitation on the supported device types, and without further examples.

[0039] refer to Figure 1 In this embodiment, the log parsing process for the log to be parsed can be triggered by a log parsing command. This embodiment can flexibly support multiple ways to initiate log parsing commands, such as manual initiation or periodic automatic initiation. There is no limitation on the timing of initiating log parsing commands, and they can be flexibly designed according to requirements.

[0040] refer to Figure 2 In this embodiment, two stages are proposed in the log parsing process: the initial selection stage and the log matching stage.

[0041] The initial selection stage in this embodiment will be described below.

[0042] refer to Figure 2 In the initial selection stage, this embodiment proposes to introduce error codes as a basis for searching, so as to locate the precise log matching range for the log to be parsed.

[0043] Error codes are a set of specific codes generated when a device encounters an abnormal situation or error during operation. These specific codes are set by the device manufacturer or software developer to facilitate fault diagnosis and troubleshooting. After generating an error code, the device usually records the error code in the device log.

[0044] refer to Figure 1 Step 100 proposes that error codes contained in the log to be parsed can be identified. It's worth noting that a device log typically contains only one error code. From the perspective of error codes and log events, one error code may refer to multiple log events; however, the error code reflected in different device logs for the same log event is usually consistent.

[0045] Based on this, refer to Figure 1In step 101, it is proposed that historical logs containing the error code can be searched as candidate logs to obtain a candidate log set.

[0046] In step 101, the error code identified from the log to be parsed is used as the search criterion to find candidate logs containing that error code from a preset historical log. In this embodiment, the range of historical logs in the initial selection stage is not limited, and the range of historical logs used in the initial selection stage can be set as needed. For example, device logs collected within a preset historical period can be used as searchable historical logs in the initial selection stage, such as device logs collected in the past 30 days. Alternatively, representative device logs pre-selected for various log events can also be used as searchable historical logs in the initial selection stage. Further examples of historical log ranges are not provided here. Furthermore, in this embodiment, the device type corresponding to the historical logs used in the initial selection stage is not limited. Device logs of different device types may use the same error code for the same log event. Therefore, historical logs of various device types with the same error code as the log to be parsed may contain the same log event as the log to be parsed. Thus, mixing historical logs of different device types can effectively improve the comprehensiveness of the candidate log set obtained in step 101.

[0047] In one exemplary scheme, considering that different equipment manufacturers typically define their own error codes, the equipment manufacturer can be used as an optional search criterion when determining the candidate log set for the log to be parsed based on the error codes.

[0048] In response, this exemplary solution proposes:

[0049] The device manufacturer corresponding to the log to be parsed can be determined; from the historical logs generated on each device provided by the device manufacturer, historical logs containing the required error code (i.e., the error code contained in the log to be parsed) are searched as candidate logs.

[0050] In this way, the search scope can be first focused on the historical logs generated on the devices provided by the device manufacturer corresponding to the log to be parsed, and then the historical logs containing the required error codes can be found from these historical logs.

[0051] It is understandable that the candidate logs found in step 101 for the log to be parsed, as well as the log to be parsed, all contain the same error code. As mentioned above, the error code reflected in the logs of different devices is usually consistent for the same log event. Therefore, in this embodiment, it is assumed that when the log event actually recorded in the log to be parsed is a defined event (i.e., not an event that has never occurred before), the candidate log set determined for the log to be parsed will contain one or more candidate logs with log events recorded in them that are the same as the log events actually recorded in the log to be parsed.

[0052] refer to Figure 2 In this embodiment, during the initial selection phase, the log matching range can be determined based on error codes. This initial selection phase effectively excludes historical logs unrelated to the actual log events recorded in the logs to be parsed, thus preventing these irrelevant historical logs from being introduced into subsequent log matching phases. Clearly, this provides a more accurate log matching range for subsequent log matching phases, effectively ensuring the accuracy of matching during these phases.

[0053] Based on the initial selection stage proposed in this embodiment, the problem of log parsing accuracy can be transformed into the problem of log matching precision. That is, in this embodiment, the accuracy of log parsing can be improved by increasing the matching precision in the subsequent log matching stage.

[0054] The log matching stage in this embodiment will be described below.

[0055] refer to Figure 1 In step 102, it is proposed that a target candidate log that matches the semantics of the log to be parsed can be found from the candidate log set.

[0056] In step 102, semantic features can be extracted from the log to be parsed. Semantic features can be understood as features that describe the semantic meaning of the content in the log to be parsed. This embodiment does not limit the data format of the semantic features; it supports multiple implementation methods for extracting semantic features from the log to be parsed. The data format of the extracted semantic features can differ depending on the implementation method, as long as it can describe the semantic meaning of the content in the log to be parsed. The implementation methods that can be used to extract semantic features will be detailed later and will not be elaborated upon here.

[0057] However, it is understandable that in step 102, semantic features can be extracted as a matching criterion. This can fully preserve the key semantic content of the log to be parsed in the matching criterion, which can effectively improve the event distinguishability of the matching criterion in this embodiment. As mentioned earlier, one error code may be used to refer to multiple log events. This one-to-many relationship between error codes and log events is due to the semantic content contained in the device logs. Specifically, the semantic content contained in different device logs with the same error code may differ, and the log events represented by different semantic content may be different. Therefore, the log events recorded in different device logs with the same error code may be different, which leads to one error code being used to refer to multiple log events.

[0058] Based on this, the semantic features extracted from the log to be parsed can be used to find target candidate logs that are semantically compatible with the log to be parsed from the candidate log set.

[0059] As can be seen from the above explanation of semantic features, in step 102, the semantic adaptation operation is used to find target candidate logs for the log to be parsed, which can fully ensure the similarity of the target candidate logs and the log to be parsed in terms of content semantics. This similarity in content semantics can further ensure the consistency of the target candidate logs and the log to be parsed in terms of log events.

[0060] Continue to refer to Figure 1 In step 103, it is proposed that the log events recorded in the log to be parsed can be determined by referring to the log events marked on the target candidate log.

[0061] In this embodiment, the recorded log events can be pre-marked on the historical log. Marking can be done manually. Alternatively, the log parsing method provided in this embodiment can also determine the recorded log events for the log to be parsed. Based on this, the log events determined in this embodiment can be marked on the log to be parsed, and the log to be parsed can be added as a new historical log for reference in subsequent device log parsing. In practical applications, before marking the log to be parsed in this embodiment, manual calibration can be performed to ensure the accuracy of the marking, thereby ensuring the accuracy of subsequent log parsing.

[0062] refer to Figure 2 Through the log matching stage in this embodiment, a target candidate log can be accurately selected for the log to be parsed, which can be used as a reference for determining the log event corresponding to the log to be parsed.

[0063] The above describes the initial selection and log matching stages in this embodiment. Based on these two stages, in this embodiment, the log to be parsed can be segmented into different components from a semantic perspective, at least into error codes and log content. The segmented error codes can serve as the search basis in the initial selection stage, accurately defining a set of candidate logs for the log to be parsed. For the segmented log content, semantic features can be extracted and semantically adapted to accurately match the target candidate logs within the candidate log set. Through the cooperation of the initial selection and log matching stages, the accuracy of log matching in this embodiment can be effectively improved, thereby matching more suitable target candidate logs for the log to be parsed, and thus more accurately determining the recorded log events in the log to be parsed.

[0064] In summary, this embodiment proposes a log parsing scheme. For the log to be parsed, its error codes can be identified, and historical logs containing those error codes can be searched as candidate logs. By using error codes as the search basis, the matching range of the log to be parsed can be accurately located, providing a more accurate foundation for the subsequent log matching process and eliminating interference from irrelevant historical logs. Furthermore, a semantic adaptation operation is proposed to match target candidate logs from the candidate log set. This can match target candidate logs that are more similar to the log content of the log to be parsed, thereby increasing the probability that the matched target candidate logs and the log to be parsed contain the same log events. Based on this, the log events marked on the target candidate logs can be referenced to determine the log events recorded in the log to be parsed. Therefore, in this embodiment, by improving the matching accuracy of target candidate logs, the accuracy of the log events determined for the log to be parsed can be effectively improved, thus effectively improving the accuracy of log parsing.

[0065] In the above or following embodiments, various implementation methods can be used to find semantically compatible target candidate logs for the log to be parsed. One optional implementation method is provided below.

[0066] In this optional implementation, a word sequence corresponding to the log to be parsed can be constructed. Based on this word sequence, target candidate logs that semantically match the log to be parsed are searched from the candidate log set. The order of words in the word sequence conforms to the semantic content of the log content; that is, the words in the word sequence are arranged according to the semantic content of the log content.

[0067] In this optional implementation, word sequences are introduced as semantic features corresponding to the logs to be parsed.

[0068] It is worth emphasizing that the words in the word sequence are not arranged in random order, but rather sequentially according to the semantic content of the log. Therefore, in this optional implementation, the word sequence includes both the words themselves and their order, effectively representing the semantic content of the log.

[0069] One exemplary scheme for constructing a word sequence for a log to be parsed is as follows: Filter out redundant information from the log content contained in the log to be parsed; construct a word sequence corresponding to the log to be parsed based on the remaining information in the log content, as a semantic feature.

[0070] The log content mentioned here can be understood as the remaining content in the log to be parsed, excluding the error codes mentioned above. Of course, this is not a limitation; the log content may also contain error codes. Through the redundant information filtering step set in this optional implementation, error codes and other redundant information can usually be filtered out.

[0071] Regarding the redundant information removal process, multiple removal schemes can be supported. One exemplary removal scheme is proposed as follows:

[0072] Pre-built regular expressions can be used to search for text strings that conform to a preset format within the log content to be parsed, thereby filtering out information irrelevant to log parsing. Here, information irrelevant to log parsing can be flexibly defined; for example, it may include, but is not limited to, time information, address information, and device identification information. This information is usually unrelated to log events and therefore can be filtered out as redundant information.

[0073] Regular expressions, also known as regex, regexp, or RE, are text patterns used to describe, match, or manipulate text strings. Regular expressions consist of ordinary characters and special characters (metacharacters). By combining ordinary and special characters, the desired string format can be generated within a regular expression. Therefore, returning to the redundant information filtering step mentioned above, we can define the text string formats to be searched for in the log content by designing regular expressions. These text string formats correspond to the redundant information to be filtered out. Thus, the text strings found in the log content through regular expressions represent the redundant information to be filtered out. This allows for accurate and comprehensive filtering of information irrelevant to log parsing from the log content.

[0074] Of course, in addition to using regular expressions to filter out redundant information, other filtering methods can also be used. For example, machine learning models can be used to discover and filter out redundant information, which will not be elaborated here.

[0075] This exemplary filtering scheme also proposes that information irrelevant to the semantics of the log content, such as numbers and / or preset symbols, can be filtered out. Redundant information in this regard can also be filtered out using regular expressions, which will not be elaborated further here.

[0076] Understandably, by setting up a redundant information filtering step, information that is useless to the semantic adaptation operation in the log to be parsed can be filtered out, thereby avoiding the interference of this redundant information on the semantic adaptation operation, and thus ensuring the accuracy of the target candidate log hit by the semantic adaptation operation.

[0077] Based on this, in this optional implementation, the word sequence corresponding to the log to be parsed can be constructed based on the remaining information in the log content contained in the log to be parsed.

[0078] In response, an exemplary word sequence construction scheme could be as follows: the remaining information is segmented into words to obtain multiple words arranged in sequence. Based on this, a word sequence can be constructed for the log to be parsed according to the multiple words arranged in sequence obtained from the segmentation.

[0079] In a preferred design, it is proposed that if any word among the multiple words obtained from word segmentation is located in a pre-constructed set of filtered words, then that word can be deleted; the remaining words arranged sequentially among the multiple words obtained from word segmentation can form the word sequence corresponding to the log to be parsed.

[0080] In this preferred design, the words obtained from word segmentation are simplified by removing some words. This further improves the accuracy of the remaining word sequence in expressing the semantics of the content in the parsed log. Here, the words to be filtered in the filter word set can be flexibly set. Words that may interfere with the accuracy of the expression of the semantics of the content can be added to the filter word set.

[0081] The following is merely an exemplary illustration of a scheme for constructing a filtered word set. In this exemplary construction scheme, the following is proposed:

[0082] Historical logs can be grouped based on different error codes to obtain historical log sets corresponding to different error codes; word sets corresponding to different historical log sets can be constructed to obtain multiple word sets; if the frequency of any word in multiple word sets exceeds a preset frequency threshold, the word is marked as a word to be filtered to generate a filter word set.

[0083] In this exemplary construction scheme, historical logs can be grouped based on error codes, resulting in all historical logs within the same historical log set having the same error code. This allows different historical log sets to express log events for different error codes. Based on this, by statistically analyzing the frequency of word occurrences in different historical log sets, the distinguishability of words for different error codes can be fully evaluated. A higher frequency indicates that the word commonly appears under different error codes, meaning its distinguishability for error codes is relatively low. Such words typically do not contain semantics related to log events, thus contributing little to the semantic adaptation process and potentially even interfering with it. Therefore, these words can be marked as words to be filtered and added to the filter word set.

[0084] It's worth noting that the scheme for constructing the filter word set can be completed before log parsing. This allows the pre-constructed filter word set to be directly queried during log parsing, while constructing the word sequence for the log to be parsed. This enables more efficient discovery and removal of the words to be filtered from the log. Consequently, the word sequence constructed for the log to be parsed will be more concise and accurately express the semantics of the log content.

[0085] In this optional implementation, the same semantic feature extraction method described above can be used to extract semantic features for each candidate log in the candidate log set. The design concept of this optional implementation is to pre-extract semantic features for different historical logs and store the historical logs and semantic features in association. Based on this, during log parsing, the semantic features associated with the candidate logs can be directly retrieved without real-time extraction, which can effectively improve the efficiency of log parsing.

[0086] refer to Figure 2 As mentioned earlier, the log matching stage includes a semantic feature extraction stage and a semantic adaptation stage. The semantic adaptation stage can take over the representation format of the semantic features generated in the semantic feature extraction stage. Based on this, the following explanation of the semantic adaptation stage will continue, following the representation format used for semantic features in the above optional implementation methods—word sequences.

[0087] In the semantic adaptation stage, after obtaining the word sequence corresponding to each candidate log in the log to be parsed and the candidate log set, the target candidate log for semantic adaptation can be found from the candidate log set by comparing the word sequences.

[0088] Based on word sequences, an exemplary semantic adaptation scheme is proposed:

[0089] The word sequence corresponding to each candidate log in the candidate log set can be obtained; for any candidate log in the candidate log set, the sequence length of the longest common subsequence between the word sequence corresponding to the log to be parsed and the word sequence corresponding to the candidate log can be calculated; based on the above sequence length calculated for each candidate log in the candidate log set, the target candidate log is selected.

[0090] Here, a subsequence refers to the result obtained by removing zero or more elements from a sequence, while the elements of the subsequence retain the order of the original sequence. If a sequence is a subsequence of multiple known sequences, it is called the common subsequence of these known sequences. Based on this, returning to the exemplary semantic adaptation scheme described above in this embodiment, the longest common subsequence between the log to be parsed and each candidate log can be calculated separately.

[0091] In this exemplary semantic adaptation scheme, the length of the longest common subsequence is used to evaluate the semantic fit between the log to be parsed and the candidate log. As mentioned above, in this embodiment, the word sequences corresponding to both the log to be parsed and the candidate log can effectively represent the content semantics of the log content. The longest common subsequence inherits the order of the words contained in the word sequence. Therefore, it can be understood that the longest common subsequence inherits part of the content semantics of the word sequence.

[0092] In this exemplary semantic adaptation scheme, the semantic fit between the log to be parsed and the candidate log can be evaluated more accurately using the longest common subsequence. This is because the content semantics represented by the longest common subsequence are the similar parts of the content semantics in the log to be parsed and the corresponding candidate log. The longer the similar part, the higher the semantic fit between the log to be parsed and the candidate log is.

[0093] Based on this, the target candidate log can be selected according to the semantic compatibility between the log to be parsed and each candidate log in the candidate log set.

[0094] It is worth noting that the semantic adaptation scheme described above is merely exemplary. Based on word sequences, other semantic adaptation schemes can also be employed to evaluate the semantic fit between the log to be parsed and each candidate log. For example, the word sequences corresponding to both the log to be parsed and the candidate logs can be converted into word vectors, and the distance between the word vectors can be calculated to evaluate the semantic fit between the log to be parsed and the candidate logs. Here, no further examples of semantic adaptation schemes based on word sequences will be provided.

[0095] Building upon the semantic adaptation scheme described above, the operation of selecting target candidate logs can be flexibly configured with preset selection requirements as needed. According to the preset selection requirements, target candidate logs can be selected from the candidate log set for the log to be parsed.

[0096] An exemplary preset selection requirement may include: the longest common subsequence has the largest sequence length. Of course, this is merely exemplary, and this embodiment is not limited thereto. For example, the preset selection requirement may include the longest common subsequence having a sequence length exceeding a preset length threshold, etc., but further examples are not provided here.

[0097] Furthermore, in this step, there may be multiple candidate logs in the candidate log set that meet the preset selection criteria. For example, there may be multiple candidate logs whose longest common subsequences have the same sequence length, which is the maximum sequence length. Alternatively, there may be multiple candidate logs whose longest common subsequences exceed a preset length threshold. To address this, a further evaluation mechanism is proposed in this step; that is, the multiple candidate logs that meet the preset selection criteria are further evaluated until a target candidate log is selected.

[0098] In response, an exemplary approach to further evaluation could be:

[0099] If multiple candidate logs in the candidate log set have semantic fit with the log to be parsed that meets the preset selection requirements, then for the longest common subsequence calculated for any candidate log among these multiple candidate logs, the total weight corresponding to the longest common subsequence is calculated based on the word weights of each word contained in the calculated longest common subsequence in the candidate log set; from the multiple candidate logs, the candidate log whose total weight meets the preset weight requirements is selected as the target candidate log.

[0100] In this exemplary continuation evaluation scheme, a comprehensive evaluation of the semantic fit between the log to be parsed and the candidate log is proposed, based on two aspects: the length of the longest common subsequence and the word weights of the words in the longest common subsequence.

[0101] In this further evaluation scheme, word weights are introduced as a supplementary evaluation criterion. The word weight characterizes the importance of a word in the semantic adaptation process. A higher word weight indicates a greater impact on semantic adaptation. In other words, if there is a common word in the word sequences corresponding to the log to be parsed and any candidate log, and this word has a high word weight, the semantic adaptation between the log to be parsed and the candidate log can be significantly improved due to the word weight of this common word; conversely, if the word has a low word weight, the improvement in semantic adaptation between the log to be parsed and the candidate log will be relatively low.

[0102] Here, the method for evaluating word weights is not limited. One exemplary method for evaluating word weights could be:

[0103] For any word appearing in the word sequence corresponding to each candidate log in the aforementioned candidate log set, the frequency of that word in each candidate log in the candidate log set can be counted to determine the word weight corresponding to that word.

[0104] This word weighting evaluation method proposes to evaluate the word weight by referring to the frequency of occurrence of the word in the word sequence set formed by the word sequences corresponding to each candidate log in the candidate log set. The higher the frequency of occurrence, the higher the evaluated word weight.

[0105] There are various statistical schemes for the occurrence frequency. One exemplary scheme proposes that: in the candidate log set, the number of candidate logs containing the corresponding word sequence can be counted as the occurrence number of the word; the ratio between the occurrence number and the number of candidate logs contained in the candidate log set can be calculated as the occurrence frequency of the word.

[0106] In this exemplary statistical scheme, word deduplication can optionally be performed within the word sequence corresponding to the candidate logs; however, word deduplication is not performed between word sequences corresponding to different candidate logs. In this way, the number of times a word appears in the set of word sequences formed by the word sequences corresponding to each candidate log included in the candidate log set can be counted as the aforementioned occurrence count of that word. Further examples of how to count occurrences are presented here.

[0107] In this way, the frequency of occurrence of a word can better reflect the word frequency in the candidate log set. Therefore, when semantically adapting, we can focus on the high-frequency words in the longest common subsequence and the combination relationship between high-frequency words. This can more accurately distinguish the differences in content semantics between the log to be parsed and the candidate log, and thus effectively improve the accuracy of the selected target candidate log.

[0108] Of course, other word weight evaluation methods can also be used. For example, the evaluation logic of word weight can be automatically learned based on machine learning algorithms, thus allowing machine learning models to evaluate the word weight. Further examples of word weight evaluation methods will not be provided here.

[0109] Furthermore, preferably, the word weights corresponding to the words appearing in the candidate log set can be pre-calculated and stored in a preset storage space for later use. Based on this, during the log parsing process, the word weights associated with the relevant words can be directly retrieved without real-time extraction, which can effectively improve the efficiency of log parsing.

[0110] Returning to the aforementioned evaluation scheme, for multiple candidate logs that meet the preset selection criteria, the total weight of the longest common subsequence corresponding to these candidate logs (i.e., the sum of the word weights of each word contained therein) can be evaluated. The target candidate log is then selected based on this total weight.

[0111] An exemplary selection mechanism could be to sort multiple candidate logs in descending order of total weight, and select the candidate log at the top of the list as the target candidate log.

[0112] In this way, the candidate log that best matches the semantics of the log to be parsed can be selected from the candidate log set and used as the target candidate log.

[0113] In summary, this embodiment provides optional implementation methods for the semantic feature extraction and semantic adaptation stages in the log matching phase. In the semantic feature extraction stage, it is proposed that word sequences be used as semantic features. This effectively preserves the key semantic content of both the log to be parsed and the candidate logs, thus providing a precise basis for the semantic adaptation stage. Based on this, in the semantic adaptation stage, it is proposed that the length of the longest common subsequence be introduced as an evaluation criterion for assessing the semantic fit between the log to be parsed and the candidate logs. This fully understands the common semantic content between the log to be parsed and the candidate logs, thereby more accurately assessing the semantic fit between them. Furthermore, the word weights of each word in the longest common subsequence are introduced as another evaluation criterion for assessing semantic fit. This fully evaluates the similarity between the log to be parsed and the candidate logs in terms of high-frequency words and high-frequency word combinations. High-frequency words and high-frequency word combinations can more accurately distinguish log events, thereby further improving the accuracy of semantic adaptation, further improving the consistency of log events between the selected target candidate logs and the log to be parsed, and ultimately improving the accuracy of log parsing.

[0114] Figure 3 This is a schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application. Figure 3 The diagram illustrates the implementation logic of the log parsing solution provided in this embodiment in this application scenario.

[0115] refer to Figure 3 The implementation logic of this solution in this application scenario can be roughly divided into three stages: log preprocessing, semantic feature construction, and log matching. The following provides an illustrative description of each of these three stages.

[0116] (1) Log preprocessing

[0117] This solution processes device logs generated by network devices (i.e., the logs to be parsed in this log parsing process). These logs may contain a large amount of information unrelated to event identification, such as:

[0118] (i) Time point: The time point when the log was generated, usually including year, month, day and accurate to the second.

[0119] (ii) Address: The device's corresponding IP address or MAC address, and memory address, etc.

[0120] (iii) Device identification: Name and ID of the board, network interface or device.

[0121] The goal of log preprocessing is to accurately remove information from logs that is irrelevant to event identification and retain as much valid text as possible.

[0122] This solution designs a set of matching rules based on experience and templates to address the aforementioned irrelevant information, and implements them using regular expressions. The matched text is then directly removed from the logs, thus achieving efficient cleaning of irrelevant information in the logs.

[0123] (2) Semantic feature construction

[0124] (2.1) Error Code Extraction

[0125] Error codes in network device logs are summary summaries of key information, enabling network administrators to quickly understand the important information contained in the logs and serving as crucial clues for log event identification. Different network device manufacturers provide different styles of log error codes, but they generally include three parts:

[0126] (i) System modules that generate logs (e.g., drivers, command-line CLI, etc.)

[0127] (ii) Event severity level; the meaning of the numbers may differ between manufacturers.

[0128] (iii) Abbreviations or abbreviations for log events

[0129] Different parts are usually connected by specific symbols. For example, in the log “DRIVER / 4 / WBoardStsChanged(l): Slot2LPU power on.”, DRIVER / 4 / WBoardStsChanged(l) is the error code (in the following text, the error code identified in the log to be parsed will be described as error code c), which means that the driver has encountered an event of level 4.

[0130] This solution utilizes regular expressions to quickly match error codes in logs, leveraging the aforementioned characteristics of error codes for subsequent event identification processes. If the log does not contain any error codes, a uniform default value can be set for each error code.

[0131] (2.2) Log content extraction

[0132] (2.2.1) Word sequence

[0133] After the first two steps, irrelevant information and error codes have been extracted from the log, leaving only the actual log content. The remaining log content also contains certain symbols and numbers. This solution uses regular expressions to define a filtering template to remove these numbers and symbols from the remaining log content, then segments it into word sequences. Continuing with the log example in (2.1), after removing error codes, symbols, and numbers, the resulting word sequence is: [Slot, LPU, power, on].

[0134] (2.2.2) Word weight calculation

[0135] This is a sub-step that can be completed before this log parsing.

[0136] Let S be the set of logs from device manufacturer v with error code c. v,c Let L be the sequence of words corresponding to the log entries. Then S... v,c Corresponding vocabulary D v,c Defined as S v,c The complete set of all words that appear in the text, namely:

[0137]

[0138] The word weight under a given word sequence represents how frequently a word appears in the same error code log. The specific calculation process is as follows:

[0139] (i) Word frequency statistics: Calculate D v,c Each word x i The number of times a word appears in the log collection. For a word sequence corresponding to a log entry in the collection, word x... i Does it appear in word sequence L? j In the middle, T can be used j To express, that is:

[0140]

[0141] (ii) Word weight calculation: word x i The weight w under the word set corresponding to vendor v and error code c i for:

[0142]

[0143] In this way, during the log parsing process, for each word in the word sequence corresponding to the log to be parsed, the word weights calculated in this sub-step can be directly used.

[0144] (2.2.3) Determine the words to be filtered

[0145] In industrial-grade log data environments, there may be recurring terms that do not carry any fault information, such as "UserID". Therefore, frequently occurring terms are not necessarily representative log features, and it is necessary to filter these high-frequency but low-information terms.

[0146] Assume the total set of logs produced by equipment manufacturer v is S. v It can be divided into several non-repeating sets, namely S, based on the different error codes produced. v ={S v,c1 ,S v,c2 ...}, and if word x appears in the logs corresponding to multiple error codes, it indicates that it is likely a word with low distinguishability. Under device manufacturer v, the prevalence f of word x is defined as...

[0147]

[0148] The larger the value of f, the higher the distinguishability of word x in the logs generated by device manufacturer v. If the f value of a word is less than a certain threshold, it is considered a word to be filtered. This can be pre-formed into a set of filtered words.

[0149] In this way, during the log parsing process, for each word in the word sequence corresponding to the log to be parsed, the word attributes (i.e., whether it is a word to be filtered) determined in this sub-step can be directly used. If a word to be filtered exists in the word sequence, it can be removed to avoid introducing the word to be filtered into the subsequent log matching steps.

[0150] After the above processing, the semantic features corresponding to the log to be parsed can be obtained: including the filtered word sequence [x1,x2,…] and the word weight sequence [w1,w2,…] corresponding to each word in the word sequence.

[0151] (3) Log matching

[0152] For the logs to be parsed, this solution uses an innovative matching algorithm to find the most similar historical logs. The algorithm process is as follows:

[0153] (i) Initial screening: For the logs to be parsed, search for historical logs where the device manufacturer and error code match. Assuming the corresponding device manufacturer is v, and the error code extracted in step 2.1 is c, then the set of historical logs to be matched is S. v,c The elements within this sequence are the word sequences corresponding to the log entries, denoted as L. v,c The corresponding vocabulary is D. v,c .

[0154] (ii) Matching: A subsequence is the result obtained by removing zero or more elements from a word sequence, while maintaining the original order of the elements in the word sequence. If a word sequence is a subsequence of multiple known word sequences, it is called the common subsequence of these known word sequences. Assuming the word sequence of the log to be identified is l, then for each word sequence L in the set... i , l and L i The matching degree is the length of the longest common subsequence (LCS) of the two word sequences. The following example illustrates the meaning of the longest common subsequence, assuming the two sequences L1 and L2 are:

[0155] L1=[Device, Slot, LPU, CPU, power, on], L2=[Slot, MPU, power, on],

[0156] Therefore, the length of the longest common subsequence of the two sequences is 3, that is:

[0157] LCS(L1, L2)=[Slot, power, on].

[0158] Thus, S v,c The logs in the database can be sorted from high to low based on their matching degree with the log to be parsed, and the historical log corresponding to the highest value is taken to proceed to the next stage.

[0159] (iii) Selection: If there are multiple historical logs corresponding to the highest value, then calculate the final weight score R of these historical logs. If the longest common subsequence of two logs is C, and the i-th word contained therein is in D... v,c The word weight below is w i The final weighted score R C for:

[0160]

[0161] For example, the longest common subsequences C1 and C2 of two historical logs and the log to be parsed are C1 = [A, B, C, D] and C2 = [A, B, C, E], respectively. The matching degree (length of the longest common subsequence) for both historical logs is 4. However, the word weight corresponding to word D is 0.65, while the word weight corresponding to word E is 0.73. The higher word weight of word E means that word E has higher event discrimination and is more representative. Therefore, historical log C2 is more likely to be selected as the matching template.

[0162] (4) Event output

[0163] The R calculated in step (iii) can be used CAs a basis for further evaluation, R can also be calculated. C Corresponding average word weight This will also serve as a basis for further evaluation.

[0164] Whether log events marked on the matching template can be reused depends on the set threshold θ. R and θ w ,Right now:

[0165]

[0166] If R is satisfied at the same time C ≥θ R and If two conditions are met, it is considered that a matching template has indeed been found (that is, the target candidate log described above), and the event marked on the historical log can be used as the event of the log to be parsed; otherwise, it is considered that the log is newly appeared, and we should consider introducing a manual annotation method to determine the corresponding event for the log to be parsed.

[0167] It is worth noting that the error code extraction proposed in this scheme is an implementation under a specific scenario, and can be defined and extracted according to the actual content contained in the error code. The word to be filtered calculation proposed in this scheme can also be obtained using other formulas (such as the statistical formula for calculating discrimination), or by representing words as word vectors and then performing unsupervised clustering (such as the DBScan algorithm).

[0168] As can be seen from the description of the exemplary implementation logic of the log parsing scheme provided in this embodiment in the above application scenario, this scheme can realize an efficient and accurate log event recognition algorithm, which can "segment" logs into different components from the perspective of text semantics, automatically extract semantic features based on text semantics, and use these semantic features to identify the log events recorded behind the device logs.

[0169] Regarding the semantic feature construction process mentioned above, the proposed solution includes three parts: error code extraction, word weight calculation, and word prevalence calculation. This process fully preserves the semantic content of the logs. Furthermore, by ignoring high-frequency invalid words, more distinctive semantic features can be extracted, which can effectively improve the accuracy of log parsing.

[0170] Regarding the log matching process mentioned above, this solution proposes a new matching mode based on the longest common word sequence, which can accurately capture the sequential relationship between words, rather than treating the log text as a set of words. This avoids the problem of semantic feature loss during the matching process, effectively saves computing resources, and makes the matching process transparent and traceable, facilitating the location and repair of log parsing failures.

[0171] In summary, the log parsing scheme provided in this embodiment can produce at least the following technical effects:

[0172] 1. In application scenarios with massive log output (such as large data centers), it can clean and preprocess device logs more efficiently and comprehensively, thus providing a more accurate basis for log matching.

[0173] 2. It can construct more reasonable log features and fully retain the highly distinguishable features (semantic features) in the original logs, thereby effectively improving the accuracy of log parsing.

[0174] It should be noted that some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.

[0175] Figure 4 This is a schematic diagram of the structure of a computing device provided for another exemplary embodiment of this application. For example... Figure 4 As shown, the computing device may include: memory 40 and processor 41.

[0176] The memory 40 is used to store the computer program corresponding to the above-mentioned model performance optimization device.

[0177] Processor 41, coupled to memory 40, is used to execute computer programs in memory 40 for:

[0178] In response to log parsing commands, identify the error codes contained in the log to be parsed;

[0179] Search for historical logs containing the error codes to obtain a candidate log set;

[0180] From the candidate log set, find the target candidate log that matches the semantics of the log to be parsed;

[0181] The log events recorded in the log to be parsed are determined by referring to the log events marked on the target candidate log.

[0182] In an optional embodiment, when the processor 41 searches for a target candidate log that matches the semantics of the log to be parsed from the candidate log set, it may specifically be used to:

[0183] Construct the word sequence corresponding to the log to be parsed;

[0184] Based on the word sequence, target candidate logs that are semantically compatible with the log to be parsed are searched from the candidate log set; wherein, the words in the word sequence are arranged according to the semantic content of the log content.

[0185] In an optional embodiment, when constructing the word sequence corresponding to the log to be parsed, the processor 41 may specifically be used to:

[0186] Redundant information is filtered out from the log content contained in the log to be parsed;

[0187] Based on the remaining information in the log content, construct the word sequence corresponding to the log to be parsed.

[0188] In an optional embodiment, when the processor 41 searches for a target candidate log that semantically matches the log to be parsed from the candidate log set based on the word sequence, it may specifically be used to:

[0189] Obtain the word sequence corresponding to each candidate log in the candidate log set;

[0190] For any candidate log in the candidate log set, calculate the sequence length of the longest common subsequence between the word sequence corresponding to the log to be parsed and the word sequence corresponding to the candidate log;

[0191] The target candidate log is selected based on the sequence length calculated for each candidate log in the candidate log set.

[0192] In an alternative embodiment, when the processor 41 selects the target candidate log based on the sequence length calculated for each candidate log in the candidate log set, it may specifically be used to:

[0193] If, in the candidate log set, there are multiple candidate logs whose sequence lengths meet the preset selection requirements, then for the longest common subsequence calculated for any candidate log among the multiple candidate logs, the total weight corresponding to the longest common subsequence is calculated based on the word weights of each word contained in the calculated longest common subsequence in the candidate log set.

[0194] From the plurality of candidate logs, select one candidate log whose total weight meets the preset weight requirement as the target candidate log;

[0195] The word weights are used to characterize the importance of words in distinguishing log events.

[0196] In an optional embodiment, when the processor 41 selects a candidate log whose total weight meets a preset weight requirement from the plurality of candidate logs as the target candidate log, it may specifically be used to:

[0197] The candidate logs are sorted in descending order of total weight;

[0198] The candidate log at the top of the list is selected as the target candidate log.

[0199] In an optional embodiment, before calculating the total weight corresponding to the longest common subsequence, the processor 41 may also be used to:

[0200] For any word appearing in the word sequence corresponding to each candidate log in the candidate log set, the frequency of occurrence of the word in each candidate log in the candidate log set is counted to determine the word weight corresponding to the word.

[0201] The word weights for each word in the candidate log set will be pre-calculated and stored in a preset storage space for later use.

[0202] In an optional embodiment, when the processor 41 counts the frequency of occurrence of the word in each candidate log contained in the candidate log set, it may specifically be used to:

[0203] In the candidate log set, the number of candidate logs containing the word in the corresponding word sequence is counted, which is taken as the occurrence count of the word.

[0204] The ratio between the number of occurrences and the number of candidate logs contained in the candidate log set is calculated as the occurrence frequency of the word.

[0205] In an optional embodiment, when the processor 41 filters out redundant information from the log content contained in the log to be parsed, it may specifically be used to:

[0206] Using pre-built regular expressions, text strings conforming to a preset format are searched within the log content to be parsed, in order to filter out information irrelevant to log parsing; and / or,

[0207] Numbers and / or preset symbols are filtered out from the log content.

[0208] In an optional embodiment, when the processor 41 constructs the word sequence corresponding to the log to be parsed based on the remaining information in the log content, it may specifically be used to:

[0209] The remaining information is segmented into words to obtain the initial word sequence corresponding to the log to be parsed;

[0210] Remove words from the initial word sequence that are located in the pre-built filter word set to obtain the word sequence corresponding to the iAnalysis log.

[0211] In an alternative embodiment, the processor 41 may specifically be used in the process of pre-constructing the set of filtered words to:

[0212] Based on different error codes, historical logs are grouped to obtain the historical log sets corresponding to each error code;

[0213] Construct separate word sets for different historical log sets to obtain multiple word sets;

[0214] If the frequency of any word in the multiple word sets exceeds a preset frequency threshold, then the word is added to the filtered word set.

[0215] Here, the historical logs can be the historical logs generated on various devices provided by the device manufacturer corresponding to the logs to be parsed.

[0216] In an optional embodiment, when the processor 41 searches for historical logs containing the error code as candidate logs, it may specifically be used to:

[0217] Determine the device manufacturer corresponding to the log to be parsed;

[0218] From the historical logs generated on each device provided by the device manufacturer, search for historical logs containing the error code, and use them as candidate logs.

[0219] Furthermore, such as Figure 4 As shown, the computing device also includes other components such as a communication component 42 and a power supply component 43. Figure 4 The diagram only shows some components and does not mean that the computing device includes only these components. Figure 4 The components shown.

[0220] It is worth noting that the technical details of the above embodiments of the computer device can be referred to the relevant descriptions in the foregoing method embodiments. To save space, they will not be repeated here, but this should not cause any loss to the scope of protection of this application.

[0221] The aforementioned memory can 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 storage, flash memory, magnetic disk, or optical disk.

[0222] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.

[0223] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0224] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium may be volatile, non-volatile, or a combination thereof, and may be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access 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), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium.

[0225] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.

[0226] 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 process, method, article, or apparatus. Unless otherwise specified, 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 that element.

[0227] The above are merely embodiments of this application and are 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 log parsing method characterized by, include: In response to log parsing commands, identify the error codes contained in the log to be parsed; Search for historical logs containing the error codes to obtain a candidate log set; From the candidate log set, find the target candidate log that matches the semantics of the log to be parsed; The log events recorded in the log to be parsed are determined by referring to the log events marked on the target candidate log.

2. The method of claim 1, wherein, From the candidate log set, find the target candidate log that matches the semantics of the log to be parsed, including: Construct the word sequence corresponding to the log to be parsed; Based on the word sequence, target candidate logs that are semantically compatible with the log to be parsed are searched from the candidate log set; wherein, the words in the word sequence are arranged according to the semantic content of the log content.

3. The method of claim 2, wherein, In addition to containing the error code, the log to be parsed also contains log content. Constructing the word sequence corresponding to the log to be parsed includes: filtering out redundant information from the log content contained in the log to be parsed. Based on the remaining information in the log content, construct the word sequence corresponding to the log to be parsed.

4. The method according to claim 2, characterized in that, Based on the word sequence, target candidate logs that semantically match the log to be parsed are searched from the candidate log set, including: Obtain the word sequence corresponding to each candidate log in the candidate log set; For any candidate log in the candidate log set, calculate the sequence length of the longest common subsequence between the word sequence corresponding to the log to be parsed and the word sequence corresponding to the candidate log; The target candidate log is selected based on the sequence length calculated for each candidate log in the candidate log set.

5. The method according to claim 4, characterized in that, The target candidate log is selected based on the sequence length calculated for each candidate log in the candidate log set, including: If, in the candidate log set, there are multiple candidate logs whose sequence lengths meet the preset selection requirements, then for the longest common subsequence calculated for any candidate log among the multiple candidate logs, the total weight corresponding to the longest common subsequence is calculated based on the word weights of each word contained in the calculated longest common subsequence in the candidate log set. From the plurality of candidate logs, select one candidate log whose total weight meets the preset weight requirement as the target candidate log; The word weights are used to characterize the importance of words in distinguishing log events.

6. The method according to claim 5, characterized in that, From the plurality of candidate logs, one candidate log whose total weight meets the preset weight requirement is selected as the target candidate log, including: The candidate logs are sorted in descending order of total weight; The candidate log at the top of the list is selected as the target candidate log.

7. The method according to claim 5, characterized in that, Before calculating the total weight corresponding to the longest common subsequence, the method further includes: For any word appearing in the word sequence corresponding to each candidate log in the candidate log set, the frequency of occurrence of the word in each candidate log in the candidate log set is counted to determine the word weight corresponding to the word. Among them, the frequency of occurrence is directly proportional to the word weight.

8. The method according to claim 7, characterized in that, Also includes: The word weights for each word in the candidate log set will be pre-calculated and stored in a preset storage space for later use.

9. The method according to claim 7, characterized in that, The frequency of occurrence of the word in each candidate log file included in the candidate log set is counted, including: In the candidate log set, the number of candidate logs containing the word in the corresponding word sequence is counted, which is taken as the occurrence count of the word. The ratio between the number of occurrences and the number of candidate logs contained in the candidate log set is calculated as the occurrence frequency of the word.

10. The method according to claim 3, characterized in that, From the log content contained in the log to be parsed, redundant information is filtered out, including: Using pre-built regular expressions, text strings conforming to a preset format are searched within the log content to be parsed, in order to filter out information irrelevant to log parsing; and / or, Numbers and / or preset symbols are filtered out from the log content.

11. The method according to claim 2, characterized in that, Based on the remaining information in the log content, construct the word sequence corresponding to the log to be parsed, including: The remaining information is segmented into words to obtain the initial word sequence corresponding to the log to be parsed; Remove words from the initial word sequence that are in the filtered word set to obtain the word sequence corresponding to the log to be parsed.

12. The method according to claim 11, characterized in that, The process of pre-constructing the set of filtered words includes: Determine the device manufacturer corresponding to the log to be parsed; Based on different error codes, the historical logs generated on each device provided by the device manufacturer are grouped to obtain the historical log sets corresponding to each error code. Construct separate word sets for different historical log sets to obtain multiple word sets; If the frequency of any word in the multiple word sets exceeds a preset frequency threshold, then the word is added to the filtered word set.

13. The method according to claim 1, characterized in that, Search historical logs containing the aforementioned error codes as candidate logs, including: Determine the device manufacturer corresponding to the log to be parsed; From the historical logs generated on each device provided by the device manufacturer, search for historical logs containing the error code, and use them as candidate logs.

14. A computing device, characterized in that, Includes memory, processor, and communication components; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is used to execute one or more computer instructions for performing the log parsing method according to any one of claims 1-13.

15. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by one or more processors, it causes the one or more processors to perform the log parsing method according to any one of claims 1-13.

16. A computer program product, characterized in that, Includes a computer program that, when executed by one or more processors, causes the one or more processors to perform the log parsing method according to any one of claims 1-13.