Diagnostic methods, apparatuses, electronic devices, and storage media
Patent Information
- Application Number
- CN202611433214.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]面对来源多样、格式不统一且包含大量正常运行信息的长日志时,往往难以精准剥离出具有核心诊断价值的异常特征,导致在同一类关键报错对应不同机型、平台版本或操作系统环境等复杂场景下,容易出现诊断结论不稳定或归因不准确的现象
[0020]本公开的诊断方法,首先利用正常模板库与异常模板库对目标日志(即原始日志)进行预处理和异常筛选,从目标日志中保留具有诊断价值的异常日志片段,对目标日志进行分层处理,为关键报错短语提取和目标知识单元提供输入,避免后续知识检索和推理分析直接依赖整份目标日志,从而提高异常信息利用效率;随后从异常日志片段、问题描述及环境信息中提取关键报错短语和约束条件信息;在此基础上,先基于关键报错短语进行候选召回,区分同一关键报错短语在不同场景下对应的不同原因与处理方案,避免仅依赖相似日志文本进行粗略匹配,从而提高问题定位的稳定性和针对性。再结合约束条件信息对故障原因进行进一步定位,并基于命中证据生成诊断结果;实现在检索结果、异常日志片段、关键报错表达、约束条件信息和原因方案候选的范围内完成分析和输出,能够将检索得到的知识内容转化为问题现象、关键报错、可能原因、建议步骤、严重程度和诊断依据等结构化结果,从而增强诊断结果的可解释性和可追溯性。
Smart Images

Figure CN122963853A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of server operation and maintenance technology, and in particular to a diagnostic method, apparatus, electronic device and storage medium. Background Technology
[0002] Server testing, maintenance, and fault analysis generate a large amount of log information, including operating system logs, BMC logs, component operation logs, and related logs generated during automated testing. These logs record the server's state changes during stages such as startup, self-test, configuration loading, component initialization, operation monitoring, and anomaly reporting, serving as crucial evidence for locating problem causes and conducting fault analysis.
[0003] When faced with long logs from diverse sources, with inconsistent formats, and containing a large amount of normal operation information, it is often difficult to accurately extract abnormal features with core diagnostic value. This can lead to unstable diagnostic conclusions or inaccurate attribution in complex scenarios where the same type of critical error corresponds to different machine models, platform versions, or operating system environments. Summary of the Invention
[0004] This disclosure provides a diagnostic method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.
[0005] According to a first aspect of this disclosure, a diagnostic method is provided, comprising: Determine the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library; Based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and the environmental information, the key error phrases and constraint information are determined. Based on the key error phrases and the constraint information, the target knowledge unit is obtained by matching in the historical database. The diagnostic result of the target log is determined based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The key error phrases include abnormal keywords in the target log; the constraint information includes environmental information and / or electronic device configuration information that generated the target log; and the target knowledge unit includes key error phrases, constraint information, abnormal causes, and handling solutions for historical abnormal logs.
[0006] The normal template library includes log fragments corresponding to normal logs; The exception template library includes log fragments corresponding to exception logs; Each log segment corresponds to at least one keyword, which is used for matching.
[0007] In the above scheme, determining the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library includes: Based on at least one keyword corresponding to the target log, match it in the anomaly template library to obtain at least one known anomaly log fragment; Based on at least one keyword that was not matched in the target log, a match is made in the normal template library to obtain at least one unknown abnormal log fragment; The at least one known abnormal log segment and the at least one unknown abnormal log segment are identified as the abnormal log segments corresponding to the target log.
[0008] In the above scheme, determining key error phrases and constraint information based on the anomaly log fragments, the problem description corresponding to the target log, and environmental information includes: Obtain at least one keyword from the exception log fragment and / or problem description, and determine that the at least one keyword is a key error phrase; Constraint information is determined based on environmental information and anomaly log fragments; The constraint information includes at least one of the following: model, project information, basic input / output system information, baseboard management controller information, operating system information, and environment information in the log context.
[0009] In the above scheme, the step of matching the target knowledge unit in the historical database based on the key error phrase and the constraint information includes: Based on the key error phrases and the historical database, at least one candidate knowledge unit is obtained; The constraint information is matched with the at least one candidate knowledge unit, and the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
[0010] In the above scheme, the historical database includes a vector database and a relational database; the elements in the vector database are vector representations of the elements in the relational database in the feature space; the matching based on the key error phrase and the constraint information in the historical database to obtain the target knowledge unit includes: Based on the vector corresponding to the key error phrase, match it with the vector database to obtain at least one candidate knowledge unit vector; The vector corresponding to the constraint information is matched with the at least one candidate knowledge unit vector, and the candidate knowledge unit vector with the highest matching degree is determined as the target knowledge unit vector. Based on the target knowledge unit vector, the corresponding target knowledge unit is obtained from the relational database.
[0011] In the above scheme, the step of matching the target knowledge unit in the historical database based on the key error phrase and the constraint information further includes: Based on the key error phrases and the historical database, at least one candidate knowledge unit is obtained; Determine whether there exists a candidate knowledge unit among the at least one candidate knowledge unit whose similarity to the key error phrase is greater than or equal to a first similarity threshold; In response to the existence of at least one candidate knowledge unit with a similarity greater than or equal to a first similarity threshold, the constraint information is matched with the at least one candidate knowledge unit with a similarity greater than or equal to the first similarity threshold. Determine whether the similarity between the candidate knowledge unit with the highest matching degree among the at least one candidate knowledge unit and the constraint information is greater than or equal to a second similarity threshold; If the similarity between the candidate knowledge unit with the highest matching degree and the constraint information is greater than or equal to a second similarity threshold, then the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
[0012] The method in the above scheme further includes: If there are no candidate knowledge units with a similarity greater than or equal to the first similarity threshold, then the candidate knowledge unit with the highest similarity is determined as the target knowledge unit.
[0013] In the above scheme, determining the diagnostic result of the target log based on at least one of the following: confidence level of the target knowledge unit, target knowledge unit, problem description, anomaly log fragment, key error phrase, and constraint information, includes: Determine the confidence level of the target knowledge unit; In response to the confidence level of the target knowledge unit satisfying a first preset condition, a first prompt word is generated based on at least one of the first instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the first prompt word. Alternatively, in response to the fact that the confidence level of the target knowledge unit does not meet the first preset condition, a second prompt word is generated based on at least one of the second instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the second prompt word. Wherein, the first instruction or the second instruction is used to instruct the target model to determine the diagnostic result of the target log based on at least one of the target knowledge unit, problem description, abnormal log fragment, key error phrase and constraint information.
[0014] In the above scheme, determining the confidence level of the target knowledge unit includes: The confidence level of the target knowledge unit is determined based on the similarity between the target knowledge unit and the problem description, the exception log fragment, the key error phrase, and the constraint information. The higher the similarity, the higher the confidence level of the target knowledge unit; the lower the similarity, the lower the confidence level of the target knowledge unit.
[0015] In the above scheme, the diagnostic results of the target log determined based on the first prompt word include the anomaly cause and the handling scheme corresponding to the target log; The diagnostic results for the target log determined by the second prompt word include the reference anomaly cause and reference handling solution for the target log.
[0016] The method in the above scheme further includes: If the target knowledge unit corresponding to the target log satisfies the second preset condition, then the target knowledge unit is stored in the relational database; Determine the target knowledge unit vector corresponding to the target knowledge unit, and store the target knowledge unit vector in a vector database; The second preset condition includes the key error phrases, constraint information, problem causes, and solutions corresponding to the target knowledge unit, which can provide a reference for other logs in the future.
[0017] According to a second aspect of this disclosure, a diagnostic device is provided, comprising: The first matching unit is used to determine the abnormal log fragments in the target log based on the normal template library and the abnormal template library; The determination unit is used to determine key error phrases and constraint information based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and environmental information. The second matching unit is used to perform matching in the historical database based on the key error phrase and the constraint information to obtain the target knowledge unit; The processing unit is used to determine the diagnostic result of the target log based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The key error phrases include abnormal keywords in the target log; the constraint information includes environmental information and / or electronic device configuration information that generated the target log; and the target knowledge unit includes key error phrases, constraint information, abnormal causes, and handling solutions for historical abnormal logs.
[0018] According to a third aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods of this disclosure.
[0019] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this disclosure.
[0020] The diagnostic method disclosed herein first preprocesses and filters the target log (i.e., the original log) using a normal template library and an abnormal template library, retaining abnormal log fragments with diagnostic value from the target log. The target log is then processed hierarchically to provide input for key error phrase extraction and target knowledge units, avoiding direct reliance on the entire target log for subsequent knowledge retrieval and reasoning analysis, thereby improving the efficiency of abnormal information utilization. Subsequently, key error phrases and constraint information are extracted from the abnormal log fragments, problem descriptions, and environmental information. Based on this, candidate recall is performed based on the key error phrases, distinguishing different causes and solutions corresponding to the same key error phrase in different scenarios, avoiding reliance solely on coarse matching of similar log text, thereby improving the stability and specificity of problem localization. By combining constraint information, the cause of the fault can be further located, and a diagnostic result can be generated based on the hit evidence. The analysis and output can be completed within the scope of search results, abnormal log fragments, key error expressions, constraint information and cause solution candidates. It can transform the retrieved knowledge into structured results such as problem phenomena, key errors, possible causes, suggested steps, severity and diagnostic basis, thereby enhancing the interpretability and traceability of the diagnostic results.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0022] The above and other objects, features, and advantages of this disclosure will become readily apparent from the following detailed description of exemplary embodiments, taken in conjunction with the accompanying drawings. Several embodiments of this disclosure are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
[0023] Figure 1 A schematic diagram of a first optional process of the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 2A schematic diagram of a second optional structure of the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 3 A schematic diagram of a third optional process for the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 4 A schematic diagram of a fourth optional process for the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 5 A schematic diagram of a fifth optional process for the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 6 A schematic diagram of a sixth optional process for the diagnostic method provided in this embodiment of the present disclosure is shown; Figure 7 A schematic diagram of an optional structure of the diagnostic device provided in an embodiment of this disclosure is shown; Figure 8 A schematic diagram of the composition structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0024] To make the objectives, features, and advantages of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.
[0025] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0026] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this disclosure described herein can be implemented in an order other than that illustrated or described herein.
[0027] Unless otherwise defined, all technical and scientific terms used in this disclosure have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used in this disclosure is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0028] It should be understood that in the various embodiments of this disclosure, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure.
[0029] Before providing a further detailed description of the embodiments of this disclosure, the nouns and terms involved in the embodiments of this disclosure will be explained, and the nouns and terms involved in the embodiments of this disclosure shall be interpreted as follows.
[0030] The Basic Input / Output System (BIOS) is used to complete the hardware initialization and basic configuration loading during the server startup phase.
[0031] The Baseboard Management Controller (BMC) is used for out-of-band management, status monitoring, and log reporting of the server.
[0032] Key error phrases refer to error expressions extracted from abnormal log fragments, key clues, or problem descriptions that represent the core abnormal characteristics of the current problem and are used as abnormal entry points for subsequent knowledge retrieval.
[0033] Constraint information refers to information used to describe the environment, platform configuration, and characteristics of the problem, including but not limited to machine information, platform type, BIOS or firmware version, operating system environment, component information, and description of the problem phenomenon. It is used to distinguish the different causes and solutions corresponding to the same key error phrase in different scenarios.
[0034] A knowledge unit refers to the core object used to organize diagnostic knowledge in this disclosure, which consists of key error phrases, constraint information, problem causes, and solutions.
[0035] Anomaly log fragments refer to log content that has diagnostic value and has been retained after preprocessing and anomaly filtering. They may include anomaly log lines and their necessary context.
[0036] Retrieval-Augmented Generation (RAG) is a technique that first retrieves relevant knowledge content and then combines it with the output of a generative model.
[0037] Large Language Models (LLMs) are used to understand, summarize, and generate input text.
[0038] Prompt words or prompts refer to the prompt text or prompt structure input into the large language model. They are used to organize information such as problem descriptions, log fragments, search results, and related evidence to guide the model in completing diagnostic analysis and result generation.
[0039] When using related technologies to diagnose logs, since the original long logs usually contain a lot of normal operation information, repetitive background logs and low-value noise information, directly using the entire log for subsequent retrieval and reasoning analysis can easily weaken the expression intensity of key abnormal information and affect the targeting of problem localization.
[0040] Secondly, the same type of critical error may correspond to different causes and solutions depending on the machine model, platform, BIOS or firmware version, operating system environment, and problem symptoms. Existing solutions that rely solely on similar log text or historical records for rough matching are prone to unstable localization or inaccurate attribution.
[0041] Furthermore, the correspondence between diagnostic results and specific log evidence, environmental conditions, and knowledge sources is often unclear, resulting in insufficient interpretability and traceability of the output, which is not conducive to manual review and subsequent processing by testers.
[0042] Finally, the lack of a controlled mechanism for supplementing, reviewing, and updating new problem information, new constraint information, or new processing experience generated during the diagnostic process makes it difficult to reuse them in subsequent problem handling and is also detrimental to the long-term evolution of the knowledge base.
[0043] To address the deficiencies in related technologies, this disclosure provides a diagnostic method. First, target logs are preprocessed and anomaly-screened using a normal template library and an anomaly template library, retaining diagnostically valuable anomaly log segments from long logs. Then, key error phrases and constraint information are extracted from the anomaly log segments, problem descriptions, and environmental information. These key error phrases, constraint information, problem causes, and solutions constitute target knowledge units corresponding to the target logs. Based on this, a first-level candidate recall is performed using the key error phrases included in the target knowledge units corresponding to the target logs, followed by a second-level recall combining constraint information to further pinpoint the causes and solutions. A diagnostic result is generated based on the hit evidence. For problems that existing knowledge cannot fully cover, candidate knowledge entries are formed, reviewed, and written into a historical database, thereby achieving a closed loop of diagnostic result generation and continuous knowledge evolution.
[0044] Figure 1 A schematic diagram of a first alternative flowchart of the diagnostic method provided in this disclosure embodiment is shown, and the steps will be described accordingly.
[0045] Step S101: Determine the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library.
[0046] In some embodiments, the normal template library includes log fragments generated by the server during normal operation, while the abnormal template library stores log fragments of historically confirmed abnormal errors. The target log can refer to the raw log data of the server to be diagnosed, and its source can be the operating system, baseboard management controller, or basic input / output system, etc. Logs are composed of log fragments; log fragments can include log content with diagnostic value that has been preprocessed and filtered for abnormalities, and can include abnormal log lines and their necessary context.
[0047] In some embodiments, the carrier implementing the diagnostic method (hereinafter referred to as the carrier) can match the target log with the abnormal template library and the normal template library respectively based on similarity matching, and obtain the abnormal log fragment corresponding to the target log based on the matching result.
[0048] The carrier can be computer programs, electronic circuits, databases, mobile applications, electronic devices, cloud computing platforms, distributed systems, artificial intelligence frameworks, mathematical models, automation tools, and microcontrollers, etc., which are software or hardware capable of implementing algorithms and methods.
[0049] Step S102: Based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and the environmental information, determine the key error phrases and constraint information.
[0050] In some embodiments, the key error phrase can refer to an error expression extracted from anomaly log fragments, key clues, or problem descriptions that can represent the core anomaly characteristics of the current problem. It includes anomaly keywords in the target log and is used as an anomaly entry point for subsequent knowledge retrieval. The constraint information can refer to information used to describe the environment, platform configuration, and phenomenon characteristics of the problem. It includes the environment information and / or electronic device configuration information that generated the target log, specifically covering model information, project information, BIOS version information, BMC version information, operating system information, and environment information in the log context.
[0051] In practice, a key error phrase can refer to a phrase or combination of words extracted from unstructured text data that can characterize the core features of the current fault. Its source can be a pre-processed and filtered fragment of anomaly logs, a natural language problem description input by the user, or a combination of both. The function of this key error phrase is to serve as an anomaly entry point for subsequent knowledge retrieval, used to quickly recall relevant candidate knowledge units in the historical database. For example, when an anomaly log fragment contains "BMC reported sensor CPU_TEMP critical threshold exceeded," the system extracts "CPU_TEMP critical threshold exceeded" as the key error phrase.
[0052] In practice, constraint information refers to a set of parameters used to limit the problem's occurrence scenario, platform configuration, and operating environment. Its function is to work in conjunction with key error phrases to distinguish different causes and solutions for the same error in different environments. The constraint information is determined by parsing the metadata corresponding to the target log and the environment fields in the log context. For example, the machine type information could be NF5280M6, the project information could be a certain financial cloud phase II project, the BIOS information could include the version number V1.2.3 and compilation date, the BMC information could include firmware version 4.50, and the operating system information could include CentOS 7.9 or Ubuntu 20.04. The environment information in the log context can also include the load status at the time of the fault (such as during high-load stress testing) or temperature and voltage readings.
[0053] In some embodiments, the carrier extracts abnormal keywords from abnormal log fragments and performs normalization processing. The normalization processing includes standardizing the format of the abnormal keywords (e.g., standardizing them to uppercase or lowercase).
[0054] In some embodiments, the constraint information may include at least one of the following: server model information, project information, BIOS information, BMC information, operating system version information, problem phenomenon (i.e. problem description), and environmental information in the log context.
[0055] Step S103: Based on the key error phrase and the constraint information, match them in the historical database to obtain the target knowledge unit.
[0056] In some embodiments, the historical database stores diagnostic knowledge accumulated from historical anomaly logs. The target knowledge unit is the core object that organizes the diagnostic knowledge, which includes key error phrases, constraint information, anomaly causes, and handling solutions for historical anomaly logs.
[0057] In some embodiments, the carrier can determine the target knowledge unit based on the key error phrases and constraint information corresponding to the target log, and then match the target knowledge unit with the historical database to obtain the target knowledge unit. The target knowledge unit is a knowledge unit stored in the historical database that represents a server historical anomaly that has been diagnosed and processed.
[0058] In some embodiments, the carrier can perform matching in a historical database based on the key error phrase and the constraint information respectively, and determine the knowledge unit with the highest matching degree as the target knowledge unit.
[0059] Step S104: Determine the diagnostic result of the target log based on at least one of the following: confidence level of the target knowledge unit, target knowledge unit, problem description, abnormal log fragment, key error phrase, and constraint information.
[0060] In some embodiments, the diagnostic result is the final analysis report output by the system, which may include structured information such as problem symptoms, key errors, possible causes, suggested handling steps, severity, and diagnostic basis. The process of determining the diagnostic result may involve comprehensively evaluating the credibility of the retrieved target knowledge units and combining this with the specific characteristics of the current log to generate a final conclusion.
[0061] Thus, by combining a normal template library with an abnormal template library in a preprocessing mechanism, noise in the original logs is effectively filtered out, while abnormal log fragments with diagnostic value are retained. Furthermore, using key error phrases as anomaly entry points and combining them with multi-dimensional constraint information to construct target knowledge units, the system can distinguish different causes and solutions for the same key error in different scenarios. The synergistic effect of these technical features not only improves the targeting of anomaly identification and the reliability of diagnostic results, but also, by decoupling the anomaly entry points from the constraint information, enables intelligent and differentiated diagnosis of complex faults in multi-source heterogeneous log environments, effectively avoiding misjudgments caused by information mixing or scenario confusion in traditional methods.
[0062] Figure 2 A second alternative structural diagram of the diagnostic method provided in this disclosure is shown, and will be described according to each step.
[0063] Figure 2 The following is a detailed flowchart of step S101, which is the detailed flowchart of determining the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library.
[0064] Step S201: Match at least one keyword corresponding to the target log in the exception template library to obtain at least one known exception log fragment.
[0065] In some embodiments, the exception template library includes log fragments corresponding to exception logs. These log fragments can refer to a collection of log content with clear diagnostic value generated by the server in a fault, error, or warning state. These log fragments originate from error reports, crash stacks, and hardware alarm records from historical faults where the cause has been identified. Each log fragment in the exception template library corresponds to at least one keyword. The keywords can be extracted from the log fragments and replaced with conventional symbols while preserving their structural form. Each keyword corresponds to a different conventional symbol; using conventional symbols to replace keywords in log fragments can reduce the computational load of the matching process and also reduce storage space.
[0066] In some embodiments, the carrier first preprocesses the target log to obtain multiple log segments, and obtains at least one keyword for each log segment. The at least one keyword for each log segment is then compared with the keywords corresponding to each log segment in the anomaly template library. If the keyword of any log segment in the target log is the same as the keyword corresponding to any log segment in the anomaly template library, then that log segment in the anomaly template library is marked as a known anomaly log segment corresponding to the target log.
[0067] Step S202: Based on at least one keyword that was not matched in the target log, perform a match in the normal template library to obtain at least one unknown abnormal log fragment.
[0068] In some embodiments, the normal template library includes a collection of log content generated by the server under standard operating conditions that does not contain fault characteristics. These log fragments originate from historical operation and maintenance data, and are verified manually or automatically as normal startup, self-test, configuration loading, and operation monitoring records. Each log fragment in the normal template library corresponds to at least one keyword.
[0069] In some embodiments, at least one keyword that is not matched in the target log includes keywords corresponding to log segments in the target log that fail to match the abnormal template library. The at least one keyword that is not matched is matched with the normal template library. If any keyword in any log segment in the target log is the same as the keyword corresponding to any log segment in the normal template library, then the log segment in the target log is determined to be a normal log segment. Log segments in the target log that do not match the abnormal template library and do not match the normal template library are unknown abnormal log segments.
[0070] For example, the target log includes log fragment 1, log fragment 2, ..., log fragment n. If the keywords corresponding to log fragment 1, log fragment k, and log fragment k+1 successfully match the keywords of multiple log fragments in the abnormal template library, then log fragment 1, log fragment k, and log fragment k+1 are determined to be abnormal log fragments. If the keywords corresponding to log fragment 3, log fragment m, and log fragment m+2 successfully match the keywords of multiple log fragments in the normal template library, then log fragment 3, log fragment m, and log fragment m+2 are determined to be normal log fragments. All other log fragments in the target log besides log fragment 1, log fragment k, log fragment k+1, log fragment 3, log fragment m, and log fragment m+2 are unknown abnormal log fragments. Here, m, k, and n are all positive integers, m and k are both less than or equal to n, and m and k are not equal.
[0071] Log fragments in the matched normal template library are identified as normal log fragments, while unknown abnormal log fragments are formed based on at least one keyword in the target log that fails to match either the abnormal template library or the normal template library.
[0072] Step S203: Determine at least one known abnormal log segment and at least one unknown abnormal log segment as the abnormal log segments corresponding to the target log.
[0073] In some embodiments, at least one known abnormal log segment and at least one unknown abnormal log segment are identified as abnormal log segments corresponding to the target log.
[0074] In this way, the target log can be compressed from a long log into a set of abnormal logs that can be used for subsequent analysis, providing input for the extraction of key error phrases and the location of target knowledge units.
[0075] Figure 3 A third alternative flowchart of the diagnostic method provided in this disclosure embodiment is shown, and will be described according to each step.
[0076] Figure 3 The diagram shows the specific steps of step S103, which involves matching the key error phrase and the constraint information in the historical database to obtain the target knowledge unit.
[0077] Step S301: Based on the key error phrase, match it with the historical database to obtain at least one candidate knowledge unit.
[0078] In some embodiments, the carrier uses the key error phrase corresponding to the target log as a retrieval entry point to initially recall at least one candidate knowledge entry related to the current anomaly characteristics from the stored historical database. The historical database pre-stores multiple knowledge units, each containing the key error phrase, constraint information, anomaly cause, and handling solution.
[0079] In practice, the extracted key error phrases are used as query indexes to traverse the key error phrase fields in the historical database.
[0080] For example, when the key error phrase is "CPU Overheat," the historical database is searched for all historical records containing this string or with a semantic similarity greater than or equal to the first similarity threshold. If the historical database contains multiple knowledge units with the key error phrase "CPU Overheat," but these records correspond to different machine types (such as rack servers and blade servers) or different BIOS versions, all knowledge units are identified as candidate knowledge units.
[0081] Step S302: Match the constraint information with the at least one candidate knowledge unit, and determine the candidate knowledge unit with the highest matching degree as the target knowledge unit.
[0082] In some embodiments, step S302 aims to address the problem that the same key error phrase may correspond to different reasons in different scenarios. By introducing constraint information for secondary filtering, it achieves accurate positioning from the candidate set to the unique target.
[0083] In some embodiments, the carrier compares the constraint information corresponding to the current target log with the constraint information stored in each of the candidate knowledge units acquired above, item by item. The matching degree can be calculated based on the weighted score of multi-dimensional features. For example, if the model information of a candidate knowledge unit is completely consistent with the current log, it is given a higher weight; if the BIOS version number is only the same in major version but different in minor version, it is given a lower weight. The carrier calculates the comprehensive matching degree between each candidate knowledge unit and the current scene, and determines the candidate knowledge unit with the highest matching degree value as the target knowledge unit.
[0084] For example, in step S301, two candidate knowledge units, A and B, are obtained, both with the key error phrase "FanSpeed Low". The constraint information for candidate knowledge unit A is labeled as machine type X and BIOS version V1.0, while the constraint information for candidate knowledge unit B is labeled as machine type Y and BIOS version V2.0. If the target log's environment information indicates that it is running on machine type X, then in step S302, the matching degree of candidate knowledge unit A will be significantly higher than that of candidate knowledge unit B, and the system will ultimately determine candidate knowledge unit A as the target knowledge unit. This hierarchical matching mechanism effectively avoids misdiagnosis caused by the same error phrase but different operating environments, ensuring the scenario adaptability of the localization results.
[0085] Thus, a hierarchical retrieval mechanism was constructed, proceeding from coarse to fine. First, key error phrases were used to quickly pinpoint relevant domains, solving the retrieval efficiency problem under massive data. Then, constraint information was used for refined identification, resolving the inaccurate location issues caused by homonyms or paraphrased errors. The combination of these two approaches allows for more than just relying on surface-level text similarity when facing complex server maintenance scenarios; it also delves deeper into contextual information such as hardware configuration and operating environment. This significantly improves the accuracy and robustness of fault location, ensuring that the output target knowledge units truly reflect the root cause of the current problem and provide effective solutions.
[0086] Figure 4 A fourth optional flowchart of the diagnostic method provided in this disclosure embodiment is shown, and will be described according to each step.
[0087] Figure 4 The following is a further explanation of step S103, namely, matching the target knowledge unit in the historical database based on the key error phrase and the constraint information.
[0088] Step S401: Match the vector corresponding to the key error phrase with the vector database to obtain at least one candidate knowledge unit vector.
[0089] In some embodiments, the historical database includes a vector database and a relational database; the elements in the vector database are vector representations of the elements in the relational database in the feature space.
[0090] In some embodiments, the vector corresponding to the key error phrase can be a numerical vector representation obtained by mapping the key error phrase text extracted in the steps to the feature space through a pre-trained semantic coding model.
[0091] In some embodiments, the similarity between the vector corresponding to the key error phrase and each knowledge unit vector in the vector database can be calculated, and the vectors can be sorted in descending order of similarity to obtain the knowledge unit vectors with a similarity greater than or equal to the first similarity threshold as candidate knowledge unit vectors.
[0092] In some optional embodiments, if there is no knowledge unit vector in the vector database whose similarity to the vector corresponding to the key error phrase is greater than or equal to the first similarity threshold, that is, the similarity between all knowledge unit vectors in the vector database and the vector corresponding to the key error phrase is less than the first similarity threshold, then the knowledge unit vector with the highest similarity to the vector corresponding to the key error phrase is determined as the target knowledge unit vector, and step S403 is executed.
[0093] Step S402: Match the vector corresponding to the constraint information with the at least one candidate knowledge unit vector, and determine the candidate knowledge unit vector with the highest matching degree as the target knowledge unit vector.
[0094] In some embodiments, the carrier determines whether the similarity between the candidate knowledge unit vector with the highest matching degree among the at least one candidate knowledge unit vectors and the key error phrase is greater than or equal to a second similarity threshold based on the matching of the vector corresponding to the constraint information and the at least one candidate knowledge unit vector. If the similarity between the candidate knowledge unit vector with the highest matching degree and the vector corresponding to the constraint information is greater than or equal to a second similarity threshold, then the candidate knowledge unit vector with the highest matching degree is determined as the target knowledge unit vector.
[0095] In some alternative embodiments, the carrier can also determine whether the target knowledge unit vector can locate the cause of the problem in the target log. If it cannot locate the cause of the problem in the target log, it is a reference knowledge unit vector, and other information is needed to assist in determining the cause of the problem.
[0096] In some optional embodiments, if the similarity between the candidate knowledge unit vector with the highest matching degree and the key error phrase is less than a second similarity threshold, then the candidate knowledge unit vector with the highest matching degree is determined as the target knowledge unit. However, this target knowledge unit vector cannot accurately locate the cause of the problem in the target log; it is a reference knowledge unit vector, and other information is needed to assist in determining the cause of the problem.
[0097] Step S403: Obtain the corresponding target knowledge unit from the relational database based on the target knowledge unit vector.
[0098] In some embodiments, regardless of whether the target knowledge unit vector can locate the cause of the problem in the target log, the corresponding target knowledge unit is obtained from the relational database based on the target knowledge unit vector. The target knowledge unit vector is a mapping of the target knowledge unit in the feature space.
[0099] Thus, by utilizing the vectors corresponding to key error phrases for broad semantic-level recall in a vector database, the problem of traditional keyword matching's inability to handle expression differences is effectively solved. Furthermore, vectors corresponding to constraint information are introduced to finely filter candidate results, ensuring a high degree of fit between the retrieval results and the current operating environment. Finally, using the target knowledge unit vector as a bridge, the target knowledge unit containing complete reasons and solutions is retrieved from the relational database. This hierarchical matching strategy not only leverages the semantic understanding advantages of the vector space model, improving the recognition rate across expression problems, but also retains the reliability of relational databases in storing structured detailed information. This enables the system to efficiently and accurately locate target knowledge units applicable to specific scenarios, significantly enhancing the intelligence and robustness of the log diagnostic system.
[0100] Figure 5 A fifth alternative flowchart of the diagnostic method provided in this disclosure is shown, and the steps will be described accordingly.
[0101] Figure 5 The following is a further explanation of step S104, namely, a further explanation of determining the diagnostic result of the target log based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information.
[0102] Step S501: Determine the confidence level of the target knowledge unit.
[0103] In some embodiments, the carrier determines the confidence level of the target knowledge unit based on the similarity between the target knowledge unit and the problem description, the exception log fragment, the key error phrase, and the constraint information; wherein, the higher the similarity, the higher the confidence level of the target knowledge unit; and the lower the similarity, the lower the confidence level of the target knowledge unit.
[0104] In specific implementation, the target knowledge unit includes a problem description, abnormal log fragments, key error phrases, and constraint information for historical logs; the problem description, abnormal log fragments, key error phrases, and constraint information corresponding to the target log are used as features to be compared; the similarity between the features to be compared and the corresponding parameters of the target knowledge unit is calculated respectively; based on the similarity results of each parameter, the overall similarity between the features to be compared and the target knowledge unit is determined; and the confidence level of the target knowledge unit is determined based on the overall similarity.
[0105] Specifically, the similarity between the problem description in the target knowledge unit and the corresponding problem description in the target log is calculated; the similarity between the abnormal log fragment in the target knowledge unit and the corresponding abnormal log fragment in the target log is calculated; the similarity between the key error phrase in the target knowledge unit and the corresponding key error phrase in the target log is calculated; and the similarity between the constraint information in the target knowledge unit and the corresponding constraint information in the target log is calculated. Based on the similarity of the above parameters, the overall similarity between the target knowledge unit and the target log is determined, and the confidence level of the target knowledge unit is determined based on the overall similarity.
[0106] Step S502: Determine whether the confidence level of the target knowledge unit meets the first preset condition.
[0107] In some embodiments, the carrier determines whether the confidence level of the target knowledge unit meets a first preset condition, which may include the confidence level of the target knowledge unit being greater than or equal to a confidence level threshold.
[0108] In some embodiments, if the confidence level of the target knowledge unit meets the first preset condition, then step S503 is executed; if the confidence level of the target knowledge unit does not meet the first preset condition, then step S504 is executed.
[0109] Step S503: Based on at least one of the first instruction, target knowledge unit, problem description, abnormal log fragment, key error phrase and constraint information, generate a first prompt word, and determine the diagnostic result of the target log based on the first prompt word.
[0110] In some embodiments, the first instruction is used to instruct the target model (such as a large language model) to output a diagnostic conclusion in a deterministic tone. Its input integrates high-confidence target knowledge units, the original problem description, extracted abnormal log fragments, extracted key error phrases, and specific constraint information. The diagnostic result generated by the target model based on the first prompt explicitly includes the specific cause of the current log anomaly and a directly executable solution. For example, when the system determines that the confidence level of a certain BMC error log meets a first preset condition, the generated first prompt will require the model to directly output: the cause of the fault is poor contact of the memory module, and the solution is to reseat the memory module and clean the gold fingers, thus providing the user with clear repair guidance.
[0111] Step S504: Based on at least one of the second instruction, target knowledge unit, problem description, abnormal log fragment, key error phrase and constraint information, generate a second prompt word, and determine the diagnostic result of the target log based on the second prompt word.
[0112] In some embodiments, the second instruction is used to instruct the target model to output a diagnostic conclusion in a referential or suggestive tone. Its input also includes the target knowledge unit (as reference evidence), problem description, and contextual information such as anomaly log fragments, but focuses on allowing the model to analyze the differences between similar cases. The diagnostic result determined based on the second prompt includes a reference anomaly cause and a reference handling solution, and may include information requiring further user input or suggestions for manual verification. For example, for an unknown error generated by a new server model, although the system cannot find a completely matching knowledge unit, it can generate a second prompt based on historical cases with high similarity, causing the model to output: "The reference cause is voltage fluctuation in the power module; it is recommended to first check the power backplane connection. If the problem persists, please collect more voltage waveform data." This provides valuable troubleshooting directions under uncertain conditions rather than a definitive erroneous conclusion.
[0113] The first and second instructions are essentially differentiated prompting templates designed for scenarios with varying levels of confidence. They define the logical framework, tone, and output structure of the target model when generating text. The first instruction emphasizes confirmation and execution, guiding the model to directly map the standard answer using knowledge units with high matching degrees. The second instruction emphasizes inference and verification, guiding the model to reason by combining reference knowledge with low matching degrees and the current context, and outputting a probabilistic reference opinion.
[0114] Thus, the process of calculating the similarity between the target knowledge unit and the current log features to determine the confidence level quantifies the applicability of historical experience to the current problem. Based on this, if the confidence level meets the first preset condition, a strongly guiding first prompt word is constructed using the first instruction, driving the target model to output a diagnostic result containing the exact cause of the anomaly and the solution, achieving an efficient closed-loop solution to known problems. Conversely, if the confidence level does not meet the condition, a weakly guiding second prompt word is constructed based on the second instruction, prompting the target model to output a reference cause of the anomaly and a reference solution, avoiding the risk of misdiagnosis caused by forced matching. This not only enhances the interpretability and credibility grading capability of the diagnostic results but also ensures, through structured prompt word design, that the large model can output standardized or advisory reports that meet operational needs in different scenarios, significantly improving the robustness and practicality of the server log intelligent diagnostic system.
[0115] In some embodiments, after determining the diagnostic result, the carrier further determines whether the target knowledge unit corresponding to the target log meets the second preset condition; if it meets the condition, the target knowledge unit is stored in a relational database; if it does not meet the condition, the target knowledge unit vector corresponding to the target knowledge unit is determined and the target knowledge unit vector is stored in a vector database; the second preset condition includes that the key error phrase, constraint information, problem cause and processing solution corresponding to the target knowledge unit can provide a reference for other logs in the future.
[0116] In specific implementation, the second preset condition can refer to the criteria for evaluating the value of the target knowledge units generated during the current diagnostic process, used to select knowledge items with subsequent reuse value. For example, if the carrier detects that in a target knowledge unit generated during a certain diagnosis, the key error phrase is "PCIe Link Training Failed," the constraint information is clearly limited to a specific model A with BIOS version V2.0, and the corresponding problem cause is confirmed as insufficient signal integrity and the solution is to adjust the equalizer parameters, and this combination of information is verified to effectively solve similar faults, then the second preset condition is determined to be met.
[0117] Figure 6 A sixth alternative flowchart of the diagnostic method provided in this disclosure embodiment is shown, and the steps will be described accordingly.
[0118] Step S601: Obtain exception log fragments based on the dual template library.
[0119] In some embodiments, the carrier first preprocesses and filters the target logs for anomalies. The dual template library includes a normal template library and an anomaly template library. The anomaly template library is used to identify confirmed anomaly error templates in historical logs, while the normal template library is used to identify background log templates generated during normal operation. After the carrier performs basic cleaning of the target logs, it prioritizes matching using the anomaly template library. Log segments that match are retained as known anomaly log segments. For log segments that do not match any anomaly templates, the normal template library is used for matching. Matches are determined to be normal background logs and filtered. Log segments that do not match either template library are retained as unknown anomaly log segments. Known and unknown anomaly log segments together constitute the anomaly log segments of the target log. Through the above processing, the carrier compresses the original long logs into a set of anomaly logs that can be used for subsequent analysis, providing input for key error phrase extraction and target knowledge unit localization.
[0120] Step S602: Determine the target knowledge unit based on key error-reporting phrases and constraint information.
[0121] In some embodiments, after completing log preprocessing and anomaly filtering, the carrier extracts key error phrases and constraint information from the anomaly log fragments, problem descriptions, and environmental information, and uses this information to locate the cause and solution corresponding to the problem in the current log. Since the same key error phrase may correspond to different causes in different machine models, platform versions, operating system environments, or problem phenomena, this disclosure does not directly use the key error phrase to uniquely determine the diagnostic conclusion, but instead introduces constraint information for further differentiation.
[0122] This disclosure employs target knowledge units to organize diagnostic knowledge. Each target knowledge unit consists of key error phrases, constraint information, problem causes, and solutions. Key error phrases characterize the anomaly entry point, constraint information defines the problem's occurrence scenario, and the problem causes and solutions carry the corresponding diagnostic conclusions. For the same key error phrase, different problem causes and solutions can correspond to different constraint information. During knowledge storage, key error phrases are extracted from anomaly log fragments and problem descriptions and normalized (e.g., case-consistent). Constraint information consists of machine model, project, BIOS, BMC, operating system version, problem symptoms, and environmental information in the log context. Problem causes and solutions are formed from historical diagnostic conclusions or manual review confirmation results and are collectively written into the relevant storage structure of the target knowledge unit. By storing the anomaly entry point, scenario constraints, and cause / solution separately, the carrier can reuse the same anomaly entry point and attach different causes and solutions under different constraint information.
[0123] During the localization process, the carrier first performs a first-level retrieval based on key error phrases to recall candidate knowledge entries related to the abnormal entry point. Then, based on the candidate results and constraint information, a second-level localization is performed to filter out the problem causes and solutions that match the current scenario, thereby determining the corresponding target knowledge unit. Thus, the carrier can gradually converge from the abnormal entry point to the specific cause and solution, providing knowledge input for subsequent structured diagnostic generation.
[0124] Step S603: Determine the diagnostic result based on the target knowledge unit, problem description, abnormal log fragments, key error phrases, and constraint information.
[0125] In some embodiments, after locating the target knowledge unit, the carrier further generates a structured diagnostic result based on the location result. The diagnostic result is not generated freely from the target log, but is formed under the constraints of associated evidence, with inputs including problem description, abnormal log fragments, key error phrases, constraint information, located target knowledge units, or candidate reference evidence.
[0126] During the generation process, the carrier first jointly judges the key error phrase retrieval results and the constraint information location results to determine whether the current problem enters the main diagnosis generation path or the reference diagnosis generation path. When the key error phrase retrieval results meet the first preset condition, and the constraint information is sufficient to limit the cause solution to a single candidate, the carrier generates the main diagnosis result based on the located target knowledge unit and its associated evidence; when the above conditions are not met, the carrier switches to generating a reference diagnosis result based on highly similar reference evidence and outputs the information to be supplemented.
[0127] In this embodiment of the disclosure, the main diagnostic result is used to output the main cause of the current problem and suggested handling steps; the reference diagnostic result is used to provide auxiliary judgment when knowledge coverage is insufficient, constraint information is incomplete, or the cause and solution cannot be uniquely determined. Regardless of whether the main diagnostic result or the reference diagnostic result is used, the generation process is bounded by the abnormal log fragments, key error phrases, constraint information, and hit evidence, and does not directly give a definitive conclusion on content outside the scope of evidence.
[0128] The structured diagnostic results include key error phrases, constraint information, severity, evidence of hits, problem location information, problem symptoms, possible causes, suggested handling steps, additional information needed, and diagnostic basis. After generation, the carrier outputs a structured diagnostic report and saves the diagnostic record for users to view, review, and use for subsequent knowledge updates.
[0129] Step S604: Store the target knowledge unit.
[0130] In one embodiment of this disclosure, after outputting structured diagnostic results, the carrier determines whether to store the target knowledge unit corresponding to the target log as a candidate knowledge unit based on the current matching situation. For problems that can be accurately located using existing knowledge, the carrier retains the current diagnostic record for subsequent querying and verification; for problems that can only output reference results or still require supplementary information, the carrier allows users to supplement key error phrases, constraint information, problem causes, handling solutions, severity, and related abnormal log fragments based on actual investigation conclusions to form candidate knowledge units.
[0131] Candidate knowledge units are not directly written to the historical database, but instead enter a manual review process. Reviewers verify, supplement, and correct the key error phrases, constraint information, problem causes, and solutions in the candidate knowledge units, and determine their reusability. For candidate knowledge units that pass the review, the carrier writes them to the relational database and simultaneously updates the key error entry index, the relevant storage structure of the knowledge unit, and the knowledge base vector space; for candidate knowledge units that fail the review, they are retained as information to be supplemented or are not added to the database.
[0132] In this way, the carrier incorporates new problem information, new constraint information, and new processing experience generated during the online diagnosis process into a controlled update process, so that the newly added knowledge can be reused in subsequent diagnoses and the accuracy and maintainability of the knowledge base content can be maintained.
[0133] Thus, this disclosure relies on a dual template library of normal and abnormal data to perform layered preprocessing and filtering of the original long logs (target logs), eliminating invalid noise and providing simplified input for key error phrase extraction and target knowledge unit matching. This eliminates the need for retrieval and reasoning based on complete original logs, significantly improving the efficiency of abnormal information utilization. Using key error phrases as the retrieval entry point, and combining constraints such as device model, firmware version, and fault symptoms to build target knowledge units, it can distinguish the causes and solutions for the same error in different scenarios, solving the problem of inaccurate localization in traditional coarse log matching and improving fault location accuracy. Simultaneously, it generates structured diagnostic reports based on log fragments and retrieval evidence (i.e., the confidence level of target knowledge units) to define the reasoning boundaries. The output includes standardized content such as fault symptoms, causes, handling steps, and diagnostic basis, enhancing the interpretability and traceability of diagnostic results. Furthermore, it supports user feedback to generate candidate knowledge entries, which are then manually reviewed and the database and vector index are updated synchronously, enabling iterative evolution of the knowledge base and continuously improving the system's ability to adapt to and diagnose new and variant server faults.
[0134] Figure 7 A schematic diagram of an optional structure of a diagnostic device provided in an embodiment of this disclosure is shown, and the details will be described in terms of each part.
[0135] In some embodiments, the diagnostic device includes a first matching unit, a determination unit, a second matching unit, and a processing unit.
[0136] The first matching unit is used to determine the abnormal log fragments in the target log based on the normal template library and the abnormal template library; The determining unit is used to determine key error phrases and constraint information based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and environmental information. The second matching unit is used to perform matching in the historical database based on the key error phrase and the constraint information to obtain the target knowledge unit; The processing unit is used to determine the diagnostic result of the target log based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The key error phrases include abnormal keywords in the target log; the constraint information includes environmental information and / or electronic device configuration information that generated the target log; and the target knowledge unit includes key error phrases, constraint information, abnormal causes, and handling solutions for historical abnormal logs.
[0137] The normal template library includes log segments corresponding to normal logs; The exception template library includes log fragments corresponding to exception logs; Each log segment corresponds to at least one keyword, which is used for matching.
[0138] The first matching unit is specifically used to perform matching in the anomaly template library based on at least one keyword corresponding to the target log to obtain at least one known anomaly log fragment; Based on at least one keyword that was not matched in the target log, a match is made in the normal template library to obtain at least one unknown abnormal log fragment; The at least one known abnormal log segment and the at least one unknown abnormal log segment are identified as the abnormal log segments corresponding to the target log.
[0139] The determining unit is specifically used to obtain at least one keyword from the abnormal log fragment and / or problem description, and determine the at least one keyword as a key error phrase; Constraint information is determined based on environmental information and anomaly log fragments; The constraint information includes at least one of the following: model, project information, basic input / output system information, baseboard management controller information, operating system information, and environment information in the log context.
[0140] The second matching unit is specifically used to match the key error phrase with the historical database to obtain at least one candidate knowledge unit; The constraint information is matched with the at least one candidate knowledge unit, and the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
[0141] In some embodiments, the historical database includes a vector database and a relational database; the elements in the vector database are vector representations of the elements in the relational database in the feature space; the second matching unit is specifically used to match the vector corresponding to the key error phrase with the vector database to obtain at least one candidate knowledge unit vector. The vector corresponding to the constraint information is matched with the at least one candidate knowledge unit vector, and the candidate knowledge unit vector with the highest matching degree is determined as the target knowledge unit vector. Based on the target knowledge unit vector, the corresponding target knowledge unit is obtained from the relational database.
[0142] The second matching unit is specifically used to match the key error phrase with the historical database to obtain at least one candidate knowledge unit; Determine whether there exists a candidate knowledge unit among the at least one candidate knowledge unit whose similarity to the key error phrase is greater than or equal to a first similarity threshold; In response to the existence of at least one candidate knowledge unit with a similarity greater than or equal to a first similarity threshold, the constraint information is matched with the at least one candidate knowledge unit with a similarity greater than or equal to the first similarity threshold. Determine whether the similarity between the candidate knowledge unit with the highest matching degree among the at least one candidate knowledge unit and the constraint information is greater than or equal to a second similarity threshold; If the similarity between the candidate knowledge unit with the highest matching degree and the constraint information is greater than or equal to a second similarity threshold, then the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
[0143] The second matching unit is specifically used to determine the candidate knowledge unit with the highest similarity as the target knowledge unit in response to the absence of a candidate knowledge unit with a similarity greater than or equal to the first similarity threshold.
[0144] The processing unit is specifically used to determine the confidence level of the target knowledge unit; In response to the confidence level of the target knowledge unit satisfying a first preset condition, a first prompt word is generated based on at least one of the first instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the first prompt word. Alternatively, in response to the fact that the confidence level of the target knowledge unit does not meet the first preset condition, a second prompt word is generated based on at least one of the second instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the second prompt word. Wherein, the first instruction or the second instruction is used to instruct the target model to determine the diagnostic result of the target log based on at least one of the target knowledge unit, problem description, abnormal log fragment, key error phrase and constraint information.
[0145] The processing unit is specifically used to determine the confidence level of the target knowledge unit based on the similarity between the target knowledge unit and the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The higher the similarity, the higher the confidence level of the target knowledge unit; the lower the similarity, the lower the confidence level of the target knowledge unit.
[0146] The diagnostic results of the target log determined based on the first prompt word include the cause of the anomaly and the handling solution corresponding to the target log. The diagnostic results of the target log determined based on the second prompt word include the reference anomaly cause and reference handling scheme corresponding to the target log.
[0147] The processing unit is further configured to store the target knowledge unit in a relational database in response to the target knowledge unit corresponding to the target log satisfying the second preset condition; Determine the target knowledge unit vector corresponding to the target knowledge unit, and store the target knowledge unit vector in a vector database; The second preset condition includes the key error phrases, constraint information, problem causes, and solutions corresponding to the target knowledge unit, which can provide a reference for other logs in the future.
[0148] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.
[0149] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0150] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0151] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0152] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as diagnostic methods. For example, in some embodiments, the diagnostic method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the diagnostic method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform diagnostic methods by any other suitable means (e.g., by means of firmware).
[0153] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0154] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0155] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0157] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0158] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0159] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0160] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means two or more, unless otherwise explicitly specified.
[0161] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. A diagnostic method, characterized in that, The method includes: Determine the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library; Based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and the environmental information, the key error phrases and constraint information are determined. Based on the key error phrases and the constraint information, the target knowledge unit is obtained by matching in the historical database. The diagnostic result of the target log is determined based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The key error phrases include abnormal keywords in the target log; the constraint information includes environmental information and / or electronic device configuration information that generated the target log; and the target knowledge unit includes key error phrases, constraint information, abnormal causes, and handling solutions for historical abnormal logs.
2. The method according to claim 1, characterized in that, The normal template library includes log fragments corresponding to normal logs; The exception template library includes log fragments corresponding to exception logs; Each log segment corresponds to at least one keyword, which is used for matching.
3. The method according to claim 1 or 2, characterized in that, The process of determining the abnormal log segment corresponding to the target log based on the normal template library and the abnormal template library includes: Based on at least one keyword corresponding to the target log, match it in the anomaly template library to obtain at least one known anomaly log fragment; Based on at least one keyword that was not matched in the target log, a match is made in the normal template library to obtain at least one unknown abnormal log fragment; The at least one known abnormal log segment and the at least one unknown abnormal log segment are identified as the abnormal log segments corresponding to the target log.
4. The method according to claim 1, characterized in that, The process of determining key error phrases and constraint information based on anomaly log fragments, problem descriptions corresponding to target logs, and environmental information includes: Obtain at least one keyword from the exception log fragment and / or problem description, and determine that the at least one keyword is a key error phrase; Constraint information is determined based on environmental information and anomaly log fragments; The constraint information includes at least one of the following: model, project information, basic input / output system information, baseboard management controller information, operating system information, and environment information in the log context.
5. The method according to claim 1 or 4, characterized in that, The step of matching the target knowledge unit in the historical database based on the key error phrase and the constraint information includes: Based on the key error phrases and the historical database, at least one candidate knowledge unit is obtained; The constraint information is matched with the at least one candidate knowledge unit, and the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
6. The method according to claim 5, characterized in that, The historical database includes a vector database and a relational database; the elements in the vector database are vector representations of the elements in the relational database in the feature space; the matching process based on the key error phrases and the constraint information in the historical database to obtain the target knowledge unit includes: Based on the vector corresponding to the key error phrase, match it with the vector database to obtain at least one candidate knowledge unit vector; The vector corresponding to the constraint information is matched with the at least one candidate knowledge unit vector, and the candidate knowledge unit vector with the highest matching degree is determined as the target knowledge unit vector. Based on the target knowledge unit vector, the corresponding target knowledge unit is obtained from the relational database.
7. The method according to claim 5, characterized in that, The step of matching the target knowledge unit in the historical database based on the key error phrase and the constraint information also includes: Based on the key error phrases and the historical database, at least one candidate knowledge unit is obtained; Determine whether there exists a candidate knowledge unit among the at least one candidate knowledge unit whose similarity to the key error phrase is greater than or equal to a first similarity threshold; In response to the existence of at least one candidate knowledge unit with a similarity greater than or equal to a first similarity threshold, the constraint information is matched with at least one candidate knowledge unit with a similarity greater than or equal to the first similarity threshold. Determine whether the similarity between the candidate knowledge unit with the highest matching degree among the at least one candidate knowledge unit and the constraint information is greater than or equal to a second similarity threshold; If the similarity between the candidate knowledge unit with the highest matching degree and the constraint information is greater than or equal to a second similarity threshold, then the candidate knowledge unit with the highest matching degree is determined as the target knowledge unit.
8. The method according to claim 7, characterized in that, The method further includes: If there are no candidate knowledge units with a similarity greater than or equal to the first similarity threshold, then the candidate knowledge unit with the highest similarity is determined as the target knowledge unit.
9. The method according to claim 1, characterized in that, The diagnostic result of the target log is determined based on at least one of the following: confidence level of the target knowledge unit, target knowledge unit, problem description, abnormal log fragment, key error phrase, and constraint information. This includes: Determine the confidence level of the target knowledge unit; In response to the confidence level of the target knowledge unit satisfying a first preset condition, a first prompt word is generated based on at least one of the first instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the first prompt word. Alternatively, in response to the fact that the confidence level of the target knowledge unit does not meet the first preset condition, a second prompt word is generated based on at least one of the second instruction, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information, and the diagnostic result of the target log is determined based on the second prompt word. Wherein, the first instruction or the second instruction is used to instruct the target model to determine the diagnostic result of the target log based on at least one of the target knowledge unit, problem description, abnormal log fragment, key error phrase and constraint information.
10. The method according to claim 9, characterized in that, Determining the confidence level of the target knowledge unit includes: The confidence level of the target knowledge unit is determined based on the similarity between the target knowledge unit and the problem description, the exception log fragment, the key error phrase, and the constraint information. The higher the similarity, the higher the confidence level of the target knowledge unit; the lower the similarity, the lower the confidence level of the target knowledge unit.
11. The method according to claim 9, characterized in that, The diagnostic results for the target log determined by the first prompt word include the cause of the anomaly and the handling solution for the target log; The diagnostic results for the target log determined by the second prompt word include the reference anomaly cause and reference handling solution for the target log.
12. The method according to claim 1, characterized in that, The method further includes: If the target knowledge unit corresponding to the target log satisfies the second preset condition, then the target knowledge unit is stored in the relational database; Determine the target knowledge unit vector corresponding to the target knowledge unit, and store the target knowledge unit vector in a vector database; The second preset condition includes the key error phrases, constraint information, problem causes, and solutions corresponding to the target knowledge unit, which can provide a reference for other logs in the future.
13. A diagnostic device, characterized in that, The device includes: The first matching unit is used to determine the abnormal log fragments in the target log based on the normal template library and the abnormal template library; The determination unit is used to determine key error phrases and constraint information based on the abnormal log fragments, the problem descriptions corresponding to the target logs, and environmental information. The second matching unit is used to perform matching in the historical database based on the key error phrase and the constraint information to obtain the target knowledge unit; The processing unit is used to determine the diagnostic result of the target log based on at least one of the following: the confidence level of the target knowledge unit, the target knowledge unit, the problem description, the abnormal log fragment, the key error phrase, and the constraint information. The key error phrases include abnormal keywords in the target log; the constraint information includes environmental information and / or electronic device configuration information that generated the target log; and the target knowledge unit includes key error phrases, constraint information, abnormal causes, and handling solutions for historical abnormal logs.
14. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-12.
15. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-12.