Log level determination method, electronic device, storage medium, and program product
By generating semantic vector data and performing contextual analysis, the problem of inaccurate log level determination was solved, achieving efficient and accurate determination of log levels and ensuring the integrity of important information.
Patent Information
- Application Number
- CN202311558082.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-21
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-11-21
AI Technical Summary
In existing technologies, the accurate determination of log levels is insufficient, which may lead to the omission of important ERROR information, affecting the location and resolution of online issues.
By generating semantic vector data and performing contextual analysis, combined with contextual association, event clustering, and time series analysis, the target log level is determined. Large language models such as BERT or GPT are used for pattern recognition and vector processing to improve the accuracy of log levels.
It improves the accuracy and efficiency of log level determination, ensures that important information is not missed, and enhances the effectiveness of problem localization and resolution.
Smart Images

Figure CN117574914B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more particularly to a method for determining log levels, an electronic device, a storage medium, and a program product. Background Technology
[0002] As business complexity increases, service log volume grows exponentially. The most common log levels in production environments include the following three: INFO, WARN, and ERROR.
[0003] When developers are troubleshooting online issues, they often focus on ERROR level logs to quickly locate and resolve problems. Therefore, log levels play a crucial role in the process of technical personnel investigating issues and conducting integration testing. Incorrect log level printing can lead to the omission of important ERROR information, potentially causing serious online problems. Therefore, accurately determining the log level is extremely important. Summary of the Invention
[0004] This disclosure provides a method for determining log levels, an electronic device, a storage medium, and a program product.
[0005] The first aspect of this disclosure provides a method for determining log levels, comprising: generating semantic vector data based on log entry data; performing contextual analysis on the semantic vector data to obtain contextual analysis results; and determining the target log level of the corresponding log entry based on the contextual analysis results.
[0006] In some implementations, generating semantic vector data based on log entry data includes: performing semantic vectorization processing on the log entry data to obtain multiple semantic vectors; and generating the semantic vector data based on the multiple semantic vectors.
[0007] In some implementations, performing contextual analysis on the semantic vector data to obtain contextual analysis results includes: performing pattern recognition processing on the semantic vector data to obtain pattern recognition results; and determining the contextual analysis results based on the log entry data, the semantic vector data, and the pattern recognition results.
[0008] In some implementations, determining the context analysis result based on the log entry data, the semantic vector data, and the pattern recognition result includes: determining context association data based on the log entry data, the semantic vector data, and the pattern recognition result; determining event clustering data based on the log entry data, the semantic vector data, and the pattern recognition result; determining time series analysis results based on the log entry data, the semantic vector data, and the pattern recognition result; and using one or more of the context association data, the event clustering data, and the time series analysis result as the context analysis result.
[0009] In some implementations, the contextual analysis results include the contextual association data, the event clustering data, and the time series analysis results. Determining the target log level for the corresponding log entry based on the contextual analysis results includes: determining a first log level for the corresponding log entry based on the contextual association data; determining a second log level for the corresponding log entry based on the event clustering data; determining a third log level for the corresponding log entry based on the time series analysis results; and determining the target log level for the corresponding log entry based on the first log level, the second log level, and the third log level.
[0010] In some implementations, determining the target log level of the corresponding log entry based on the first log level, the second log level, and the third log level includes: in response to the first log level, the second log level, and the third log level being different, determining a first log level score, a second log level score, and a third log level score, and taking the log level with the highest score as the target log level of the corresponding log entry; and in response to the first log level, the second log level, and the third log level being the same, taking the first log level as the target log level of the corresponding log entry.
[0011] In some implementations, before generating semantic vector data based on log entry data, the method further includes preprocessing pre-stored log data to obtain the log entry data.
[0012] A second aspect of this disclosure provides an electronic device, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform the log level determination method according to any embodiment of this disclosure.
[0013] A third aspect of this disclosure provides a readable storage medium storing executable instructions, which, when executed by a processor, are used to implement the log level determination method according to any embodiment of this disclosure.
[0014] This disclosure provides a fourth aspect of a computer program product, including a computer program / instructions that, when executed by a processor, implement the log level determination method described in any embodiment of this disclosure. Attached Figure Description
[0015] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0016] Figure 1 This is a flowchart illustrating a method for determining log levels according to some embodiments of this disclosure.
[0017] Figure 2 This is a schematic diagram illustrating the process of generating semantic vector data according to some embodiments of this disclosure.
[0018] Figure 3 This is a schematic diagram illustrating the process of determining the context analysis results for some embodiments of this disclosure.
[0019] Figure 4 This is another schematic diagram illustrating the process of determining the contextual analysis results for some embodiments of this disclosure.
[0020] Figure 5 This is a schematic diagram illustrating the process of determining the target log level in some embodiments of this disclosure.
[0021] Figure 6 This is another schematic diagram illustrating the process of determining the target log level in some embodiments of this disclosure.
[0022] Figure 7 This is another flowchart illustrating the log level determination method according to some embodiments of this disclosure.
[0023] Figure 8 This is a schematic block diagram of a log level determination device implemented using a processor, according to one embodiment of the present disclosure. Detailed Implementation
[0024] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0025] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.
[0027] The use of crosshairs and / or shading in the accompanying drawings is generally used to clarify the boundaries between adjacent components. Thus, unless otherwise stated, the presence or absence of crosshairs or shading does not convey or indicate any preference or requirement for the specific material, material properties, dimensions, proportions, commonalities between the illustrated components, or any other characteristics, properties, etc., of the components. Furthermore, in the accompanying drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.
[0028] When a component is referred to as being "on" or "above" another component, "connected to," or "joined to" another component, the component may be directly on, directly connected to, or directly joined to the other component, or there may be intermediate components. However, when a component is referred to as being "directly on" another component, "directly connected to," or "directly joined to" another component, there are no intermediate components. Therefore, the term "connection" can refer to a physical connection, an electrical connection, etc., and may or may not have intermediate components.
[0029] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values that would be recognized by one of ordinary skill in the art.
[0030] The log level determination method disclosed herein can be applied to the log level determination apparatus disclosed herein, which can be configured on an electronic device. The electronic device can be a server or a terminal device, and the terminal device can be a mobile terminal, such as a mobile phone, tablet computer, personal digital assistant, or other hardware device with various operating systems.
[0031] The following text combines Figures 1 to 8 The log level determination method and log level determination device disclosed herein are described in detail.
[0032] Figure 1 This is a flowchart illustrating some embodiments of the log level determination method disclosed herein. Please refer to... Figure 1 The log level determination method S100 provided in this disclosure may include steps S110, S120 and S130.
[0033] S110: Generate semantic vector data based on log entry data.
[0034] S120: Perform contextual analysis on semantic vector data to obtain contextual analysis results.
[0035] S130: Determine the target log level for the corresponding log entry based on the context analysis results.
[0036] The log level determination method provided in this disclosure generates semantic vector data based on log entry data, performs contextual analysis on the semantic vector data to obtain contextual analysis results, and then determines the target log level of the corresponding log entry based on the contextual analysis results. Thus, by performing semantic understanding and contextual analysis on log entries, the accuracy, effectiveness, and interpretability of the determined target log level are improved.
[0037] Optionally, log entry data can be multiple log records stored in the log, or data obtained after pre-processing multiple log records stored in the log; no limitation is made here. Semantic vector data is associated with log entry data.
[0038] Optionally, contextual analysis may include one or more of the following: contextual relevance analysis, event clustering analysis, and time series analysis. This facilitates the determination of the target log level for log entries from different dimensions, improving the accuracy of the determined target log level.
[0039] Optionally, the target log level may include one or more of the following: INFO, WARN, and ERROR.
[0040] In one example, steps S110, S120, and S130 can be implemented using a pre-trained Large Language Model (LLM). This allows log entry data to be transmitted to the LLM, and based on the LLM, semantic vector data generation and contextual analysis are performed on the log content of the log entry data. Finally, the target log level for the corresponding log entry is output, improving the efficiency and accuracy of log level determination.
[0041] For example, LLM includes, but is not limited to, BERT models, GPT models, or other variants. The training set for an LLM may include multiple log entries labeled with the target log level.
[0042] Please see Figure 2 In some implementations, step S110 includes steps S111 and S112.
[0043] S111: Perform semantic vectorization on log entry data to obtain multiple semantic vectors.
[0044] For example, LLM can be used to convert log entries into semantic vectors of a specific length. LLM is pre-trained on a large amount of text and can generate high-dimensional vectors that reflect the semantic content of the original text.
[0045] S112: Generate semantic vector data based on multiple semantic vectors.
[0046] For example, a preset dimension reduction algorithm is first used to reduce the dimensionality of multiple semantic vectors, thereby reducing the vector dimensions of multiple semantic vectors while preserving as much original information as possible; then, the multiple semantic vectors after dimensionality reduction are normalized or standardized to eliminate the differences in scale between different dimensions and generate semantic vector data, thereby ensuring that they are within a uniform numerical range, which is helpful for subsequent calculations and comparisons.
[0047] Optionally, the preset dimensionality reduction algorithm includes one or more of Principal Component Analysis (PCA) and t-Distributed Stochastic Neighbor Embedding (T-SNE). It is understood that, depending on the application requirements, different lengths of semantic vectors may need to be selected. For example, the BERT model may produce semantic vectors of 768 dimensions or higher.
[0048] The log level determination method described above performs semantic vectorization processing on log entry data to obtain multiple semantic vectors, and then generates semantic vector data based on the multiple semantic vectors. This effectively obtains the semantic vector data corresponding to the log entry data, which helps to improve the accuracy of the determined target log level.
[0049] Please see Figure 3 In some embodiments, step S120 includes steps S121 and S122.
[0050] S121: Perform pattern recognition processing on the semantic vector data to obtain the pattern recognition result.
[0051] For example, a pre-trained LLM can be used to perform pattern recognition processing on semantic vector data to obtain pattern recognition results.
[0052] Optionally, the pattern recognition result includes preset patterns extracted from each semantic vector. These preset patterns include one or more of the following: log code stack, service name, operation type that triggered the log, service IP address, log timestamp, and Uniform Resource Locator (URL) of the interface involved in the log. The operation type that triggered the log may include one or more of the following: interface call, message queue consumption. The service IP address can be used to uniquely identify the current service and also to determine the upstream and downstream services of the current service.
[0053] S122: Determine the context analysis results based on log entry data, semantic vector data, and pattern recognition results.
[0054] Please see Figure 4 In some implementations, step S122 includes steps S1221, S1222, S1223, and S1224.
[0055] S1221: Determine contextual data based on log entry data, semantic vector data, and pattern recognition results.
[0056] For example, a pre-trained LLM can be used to perform contextual analysis on log entry data, semantic vector data, and pattern recognition results to determine whether each log entry is related to the log entries before and after it, thereby identifying contextually related data.
[0057] In one example, if a log entry indicates "database connection failed" and another log entry indicates "transaction rollback", it is assumed that there is a likely correlation between these two log entries. Therefore, the correlation between these two log entries is established, generating contextual association data.
[0058] S1222: Determine event clustering data based on log entry data, semantic vector data, and pattern recognition results.
[0059] For example, a pre-trained LLM can be used to determine event clustering data based on log entry data, semantic vector data, and pattern recognition results.
[0060] In one example, based on preset patterns extracted from the semantic vectors in the pattern recognition results, log entries that meet preset conditions are clustered together to form an event. For example, log entries with the error type "null pointer" are clustered into one event, or log entries with the error type "timeout" are clustered into one event, or log entries with the error type "resource pool full" are clustered into one event.
[0061] S1223: Determine the time series analysis results based on log entry data, semantic vector data, and pattern recognition results.
[0062] For example, a pre-trained LLM can be used to determine the time series analysis results based on log entry data, semantic vector data, and pattern recognition results.
[0063] In one example, log timestamps are used to identify different levels of anomaly patterns or periodic events. For instance, if there are a large number of "database connection timeout" log entries every day between 1 AM and 2 AM, this is likely a periodic event, and the corresponding log entries can be set to the first level of anomaly pattern. If there are a large number of "database connection timeout" log entries every day between 1 AM and 8 AM, the corresponding log entries can be set to the second level of anomaly pattern, which is higher than the first level.
[0064] S1224: Use one or more of the following as contextual analysis results: contextual association data, event clustering data, and time series analysis results.
[0065] For example, contextual data, event clustering data, and time series analysis results are all used as contextual analysis results, which facilitates the subsequent determination of the target log level of the corresponding log entry from three dimensions, thus improving the accuracy of the target log level.
[0066] The log level determination method described above performs pattern recognition processing on semantic vector data to obtain pattern recognition results, and determines more accurate contextual analysis results based on log entry data, semantic vector data, and pattern recognition results, thereby improving the accuracy of the target log level determined based on the contextual analysis results.
[0067] In some implementations, contextual analysis results include contextual association data, event clustering data, and time series analysis results. See accordingly. Figure 5 Step S130 includes steps S131, S132, S133 and S134.
[0068] S131: Determine the first log level of the corresponding log entry based on the contextual data.
[0069] For example, a first correspondence between different context-related data and the first log level can be predefined, and then after the current context-related data is determined, the first log level of the corresponding log entry can be determined by looking up the first correspondence.
[0070] S132: Determine the second log level of the corresponding log entry based on the event clustering data.
[0071] For example, a second correspondence between different event cluster data and the second log level can be predefined, and then after the current event cluster data is determined, the second log level of the corresponding log entry can be determined by looking up the second correspondence.
[0072] S133: Determine the third log level of the corresponding log entry based on the time series analysis results.
[0073] For example, a third correspondence between different time series analysis results and the third log level can be predefined, and then after determining the current time series analysis result, the third log level of the corresponding log entry can be determined by looking up the third correspondence.
[0074] S134: Determine the target log level for the corresponding log entry based on the first log level, the second log level, and the third log level.
[0075] Please see Figure 6 In some implementations, step S134 includes steps S1341 and S1342.
[0076] S1341: In response to the difference between the first log level, the second log level, and the third log level, determine the score of the first log level, the score of the second log level, and the score of the third log level, and take the log level with the highest score as the target log level for the corresponding log entry.
[0077] Optionally, when the first log level, the second log level, and the third log level are different, the first log level, the second log level, and the third log level are output so that the user can score the first log level, the second log level, and the third log level. Then, the scores of the first log level, the second log level, and the third log level can be determined based on the user's input score data.
[0078] In some implementations, when outputting the first log level, the reason for determining the first log level is also output, for example, "determined based on contextual association"; when outputting the second log level, the reason for determining the second log level is also output, for example, "determined based on event clustering"; and when outputting the third log level, the reason for determining the third log level is also output, for example, "determined based on time series". This makes it easier for users to understand the reasons for determining each log level, and also allows users to more accurately score the first, second, and third log levels based on the reasons.
[0079] Furthermore, if the first log level score is the highest, then the first log level is used as the target log level for the corresponding log entry; if the second log level score is the highest, then the second log level is used as the target log level for the corresponding log entry; if the third log level score is the highest, then the third log level is used as the target log level for the corresponding log entry.
[0080] In one example, after determining the first, second, and third log level scores, the LLM is retrained based on the highest-scoring log level. This ensures that the LLM directly outputs the target log level the next time the same situation occurs. In this way, combined with a user scoring mechanism, the model can be repeatedly updated and trained to improve the accuracy of the determined target log level.
[0081] S1342: In response to the first log level, second log level and third log level being the same, the first log level is used as the target log level for the corresponding log entry.
[0082] Specifically, when the first log level, the second log level, and the third log level are the same, the user no longer needs to score them. Any one of the three log levels can be directly used as the target log level for the corresponding log entry, thus enabling the target log level for the corresponding log entry to be determined quickly.
[0083] The log level determination method described above determines the first log level of a corresponding log entry based on contextual association data, the second log level based on event clustering data, and the third log level based on time series analysis results. Finally, it determines the target log level of the corresponding log entry based on the first, second, and third log levels. This allows for accurate determination of the target log level from three dimensions: contextual association, event clustering, and time series analysis, thus improving the accuracy of the determined target log level.
[0084] Please see Figure 7 In some embodiments, step S140 is included before step S110.
[0085] S140: Preprocess the pre-stored log data to obtain log entry data.
[0086] Optionally, log persistence can be enabled on fast or dayu, thereby storing information in a specified log file on the module as log data for later analysis.
[0087] Optionally, preprocessing includes noise filtering and data standardization. Accordingly, step S140 includes: first, performing noise filtering on the pre-stored log data, and then performing data standardization on the noise-filtered log data to obtain log entry data. Thus, based on the acquired log data, through noise filtering and data standardization, log data collected from different data sources is cleaned to output log entry data with a uniform structure, facilitating model understanding.
[0088] For example, noise filtering is used to clean or remove invalid log data, such as log data from health checks, heartbeat detection, Eureka connections, etc.
[0089] For example, data standardization is used to transform log data into a preset format. Further, the preset format can be {log id, log timestamp, initial log level, log content}, meaning a log entry includes a log id, log timestamp, initial log level, and log content. The initial log level can be understood as the log level automatically generated when the log data is initially generated; however, the initial log level may be inaccurate.
[0090] In some implementations, after step S130, the log content, target log level, reason for determining the target log level, and whether historical factors interfere with the log entry are output. For example, if the target log level of the current log entry is obtained after retraining based on the user scoring mechanism, then historical factors interfere; if the target log level of the current log entry is not obtained after retraining based on the user scoring mechanism, then historical factors do not interfere. This allows users to accurately and comprehensively understand the target log level of the corresponding log entry based on the output content.
[0091] Figure 8 This is a schematic block diagram of a log level determination device implemented using a processor, according to one embodiment of the present disclosure.
[0092] The log level determination apparatus may include corresponding modules that perform one or more steps in the flowchart above. Therefore, each or more steps in the flowchart above may be performed by a corresponding module, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform the corresponding step, or implemented by a processor configured to perform the corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented through some combination thereof.
[0093] The hardware architecture of the log level determination device disclosed herein can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0094] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.
[0095] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).
[0096] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0097] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.
[0098] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0099] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware. The program can be stored in a readable storage medium, and when executed, the program includes one or a combination of the steps of the method implementation.
[0100] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0101] refer to Figure 8 According to one embodiment of the present disclosure, the log level determination device 1000 of the present disclosure includes a generation module 1002, a context analysis module 1004, and a determination module 1006.
[0102] The generation module 1002 is used to generate semantic vector data based on log entry data. The context analysis module 1004 is used to perform context analysis on the semantic vector data to obtain context analysis results. The determination module 1006 is used to determine the target log level for the corresponding log entry based on the context analysis results.
[0103] This disclosure also provides an electronic device, including: a memory storing execution instructions; and a processor or other hardware module executing the execution instructions stored in the memory, causing the processor or other hardware module to perform the above-described method.
[0104] This disclosure also provides a readable storage medium storing executable instructions, which, when executed by a processor, are used to implement the methods described above.
[0105] This disclosure also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the methods described above.
[0106] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0107] 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 application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0108] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A method for determining log levels, characterized in that, include: Generate semantic vector data based on log entry data; Contextual analysis is performed on the semantic vector data to obtain contextual analysis results; as well as The target log level for the corresponding log entry is determined based on the context analysis results. The step of performing contextual analysis on the semantic vector data to obtain contextual analysis results includes: performing pattern recognition processing on the semantic vector data to obtain pattern recognition results; and determining the contextual analysis results based on the log entry data, the semantic vector data, and the pattern recognition results. The step of determining the context analysis result based on the log entry data, the semantic vector data, and the pattern recognition result includes: determining context association data based on the log entry data, the semantic vector data, and the pattern recognition result; determining event clustering data based on the log entry data, the semantic vector data, and the pattern recognition result; determining time series analysis results based on the log entry data, the semantic vector data, and the pattern recognition result; and using one or more of the context association data, the event clustering data, and the time series analysis result as the context analysis result. The context analysis results include the context association data, the event clustering data, and the time series analysis results. Determining the target log level of the corresponding log entry based on the context analysis results includes: determining a first log level of the corresponding log entry based on the context association data; determining a second log level of the corresponding log entry based on the event clustering data; determining a third log level of the corresponding log entry based on the time series analysis results; and determining the target log level of the corresponding log entry based on the first log level, the second log level, and the third log level.
2. The log level determination method according to claim 1, characterized in that, The step of generating semantic vector data based on log entry data includes: The log entry data is semantically vectorized to obtain multiple semantic vectors; and The semantic vector data is generated based on multiple semantic vectors.
3. The log level determination method according to claim 1, characterized in that, Determining the target log level for the corresponding log entry based on the first log level, the second log level, and the third log level includes: In response to differences in the first log level, the second log level, and the third log level, a first log level score, a second log level score, and a third log level score are determined, and the log level with the highest score is used as the target log level for the corresponding log entry; and In response to the first log level, the second log level, and the third log level being the same, the first log level is used as the target log level for the corresponding log entry.
4. The log level determination method according to any one of claims 1 to 3, characterized in that, Before generating semantic vector data based on log entry data, the method further includes: The pre-stored log data is preprocessed to obtain the log entry data.
5. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes the execution instructions stored in the memory, causing the processor to perform the log level determination method according to any one of claims 1 to 4.
6. A readable storage medium, characterized in that, The readable storage medium stores execution instructions, which, when executed by a processor, are used to implement the log level determination method according to any one of claims 1 to 4.
7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the log level determination method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Log analysis method and related device
CN116126807A
Applying consistent log levels to application log messages
US20180060211A1
