A log template determination method, device and computer readable storage medium

CN116362217BActive Publication Date: 2026-08-18CHINA MOBILE COMM LTD RES INST +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111630185.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2026-08-18
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

[0003]为解决上述技术问题,本申请实施例期望提供一种日志模板确定方法、设备及计算机可读存储介质,解决了确定的目标模板不准确的问题,提高了确定的目标模板的准确率

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116362217B_ABST
    Figure CN116362217B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a log template determination method, which comprises: obtaining a to-be-processed log, grouping word sequences in the to-be-processed log to obtain a plurality of groups of word sequences; determining a target frequency of a word in each group of word sequences and position information of each word sequence in each group of word sequences; determining the relevance between words in each group of word sequences based on the target frequency, the position information and each group of word sequences; wherein the target frequency represents the number of word sequences corresponding to the word in each group of word sequences; analyzing the words in each group of word sequences based on the relevance to obtain a word set corresponding to each group of word sequences; for each group of word sequences, determining a target word set from the word set corresponding to the word sequence, and determining a target template based on the target word set and the word sequence. Embodiments of the present application also disclose a log template determination device and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to log template determination technology in the field of log template determination, and more particularly to a log template determination method, device and computer-readable storage medium. Background Technology

[0002] Network logs record the operation and status information of network devices. Typically, target templates can be extracted from network logs to diagnose network device faults. In related technologies, target template extraction involves clustering the word sequences within each group of word sequences based on the similarity between multiple strings corresponding to each group in the network log, and then determining the target template for each group of word sequences. However, clustering the word sequences within each group based on string similarity is inaccurate, resulting in low accuracy of the determined target templates. Summary of the Invention

[0003] To address the aforementioned technical problems, this application aims to provide a log template determination method, device, and computer-readable storage medium, thereby resolving the issue of inaccurate target template determination and improving the accuracy of the determined target template.

[0004] The technical solution of this application is implemented as follows:

[0005] A method for determining a log template, the method comprising:

[0006] Obtain the log to be processed, and group the word sequences in the log to be processed to obtain multiple groups of word sequences;

[0007] Determine the target frequency of words in each word sequence and the positional information of each word in each word sequence;

[0008] Based on the target frequency, the location information, and each word sequence, the correlation between words in each word sequence is determined; wherein, the target frequency represents the number of word sequences corresponding to the words in each word sequence;

[0009] Based on the aforementioned correlation, the words in each word sequence are analyzed to obtain the word set corresponding to each word sequence;

[0010] For each word sequence, a target word set is determined from the word set corresponding to the word sequence, and a target template is determined based on the target word set and the word sequence.

[0011] In the above scheme, obtaining the logs to be processed includes:

[0012] Obtain the initial logs generated during the runtime of the device to be processed;

[0013] Filter the first type of characters in the initial log to obtain the filtered log;

[0014] Based on the second type of characters in the filtered logs, word extraction is performed on each log in the filtered logs to obtain a word sequence corresponding to each log in the filtered logs; wherein, the first type of characters and the second type of characters are different; the log to be processed includes multiple word sequences.

[0015] In the above scheme, the step of grouping the word sequences in the log to be processed to obtain the multiple groups of word sequences includes:

[0016] The multiple word sequences are classified based on the characters at the target positions of each word sequence to obtain multiple categories of word sequences;

[0017] For each type of word sequence, the word sequences are grouped based on the length information of each word sequence to obtain the multiple groups of word sequences; wherein, the length information is used to represent the number of words in the word sequence.

[0018] In the above scheme, determining the target frequency of words in each word sequence includes:

[0019] The words in each word sequence are deduplicated to obtain the first word;

[0020] Obtain the number of word sequences corresponding to each first word, and get the target frequency of words in each group of word sequences.

[0021] In the above scheme, determining the correlation between words in each word sequence based on the target frequency, the location information, and each word group sequence includes:

[0022] Analyze each group of word sequences to determine the number of word sequences in each group of word sequences;

[0023] Based on the target frequency and target frequency threshold of words in each word sequence, the multiple first words are filtered to obtain the second words;

[0024] Determine the number of the second word, and based on the number of the word sequence and the number of the second word, determine the initial matrix;

[0025] Based on the initial matrix, the location information, each word sequence, and the target frequency of the second word, an association matrix is ​​determined for each word sequence; wherein the association matrix characterizes the association between words in each word sequence.

[0026] In the above scheme, determining the association matrix of each word sequence based on the initial matrix, the positional information, each word sequence, and the target frequency of the second word includes:

[0027] Based on location information, multiple word sequences in each group of word sequences are sorted to obtain sorted word sequences;

[0028] Based on the target frequency of the second word, multiple second words are sorted to obtain the sorted second words;

[0029] According to the sorting of the sorted word sequence and the sorting of the second word, if the word in the sorted word sequence matches the second word, the value of the element in the initial matrix corresponding to the sorted word sequence is set to the first value.

[0030] Based on the sorting of the sorted word sequence and the sorting of the second word, if the words in the sorted word sequence and the second word do not match, the value of the element corresponding to the sorting in the initial matrix is ​​set to a second value to obtain the association matrix.

[0031] In the above scheme, the step of analyzing the words in each word sequence based on the correlation to obtain the word set corresponding to each word sequence includes:

[0032] The value of the element in the i-th column of the association matrix is ​​determined to be the first target row corresponding to the target value; where i is a positive integer less than n; n is the number of columns in the association matrix, and n is a positive integer;

[0033] From the elements of the first target row of the correlation matrix, obtain the number of elements in each column from column i+1 to column n whose value is the target value, and obtain the second number; where n is equal to the number of columns of the correlation matrix;

[0034] Determine the target column containing the elements that satisfy the target quantity in the second quantity, and determine the word set corresponding to the elements in the i-th column based on the second word corresponding to the elements in the i-th column and the second word corresponding to the elements in the target column;

[0035] Based on the word set corresponding to the element in the i-th column and the word set corresponding to each element in each of the (i+1)-n-th columns, the word set corresponding to each group of word sequences is obtained.

[0036] In the above scheme, the step of determining a target word set from the word set corresponding to each word sequence, and determining a target template based on the target word set and the word sequence, includes:

[0037] For each word sequence, the order among multiple word sets is determined based on the second word after sorting.

[0038] The target word set is determined from multiple word sets based on the order among the word sets;

[0039] The target word set and each word sequence are matched to obtain a matching result, and an initial template is determined based on the matching result and each word sequence;

[0040] The similarity between the initial templates is determined, and the initial templates are merged based on the similarity to determine the target template.

[0041] In the above scheme, determining the initial template based on the matching result and the word sequence includes:

[0042] If the matching result indicates that the target word set and the word sequence match, the word sequence that matches the target word set is determined as the initial template;

[0043] If the matching result indicates that the target word set and the word sequence do not match, the word sequence is modified to obtain the initial template;

[0044] If the matching result indicates that there is a first word sequence that does not match the target word set, but there is a second word sequence that matches the target word set, the first word sequence is modified to obtain a modified first word sequence, and the initial template is obtained based on the modified first word sequence and the second word sequence.

[0045] A log template determination device, the device comprising: a processor, a memory, and a communication bus;

[0046] The communication bus is used to realize the communication connection between the processor and the memory;

[0047] The processor is used to execute the log template determination program stored in the memory to implement the steps of the log template determination method described above.

[0048] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the log template determination method described above.

[0049] The log template determination method, device, and computer-readable storage medium provided in the embodiments of this application acquire a log to be processed and group the word sequences in the log to be processed into multiple groups of word sequences; determine the target frequency of words in each group of word sequences and the position information of each word sequence in each group of word sequences; determine the correlation between words in each group of word sequences based on the target frequency, position information, and each group of word sequences; wherein, the target frequency represents the number of word sequences corresponding to words in each group of word sequences; analyze the words in each group of word sequences based on the correlation to obtain the word set corresponding to each group of word sequences; and for each group of word sequences... The method involves determining the target word set from the word set corresponding to the word sequence, and then determining the target template based on the target word set and the word sequence. This approach considers the correlation between words in each word sequence, analyzes the words in each word sequence to obtain the word set corresponding to each word sequence, and determines the target template based on the target word set and word sequence obtained from the word set. This eliminates the need to cluster the word sequences in each word sequence based on the similarity between multiple strings corresponding to each word sequence to determine the target template, thus avoiding the problem of low accuracy of the determined target template due to inaccurate clustering and improving the accuracy of the determined target template. Attached Figure Description

[0050] Figure 1 A flowchart illustrating a log template determination method provided in an embodiment of this application;

[0051] Figure 2 A flowchart illustrating another log template determination method provided in this application embodiment;

[0052] Figure 3a A schematic diagram of a word sequence in a log template determination method provided in an embodiment of this application;

[0053] Figure 3b A flowchart illustrating the determination of the correlation matrix in a log template determination method provided in this application embodiment;

[0054] Figure 4 A flowchart illustrating the extraction of a word set in a log template determination method provided in this application embodiment;

[0055] Figure 5 A flowchart illustrating another log template determination method provided in this application embodiment;

[0056] Figure 6 This is a schematic diagram of the structure of a log template determination device provided in an embodiment of this application. Detailed Implementation

[0057] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0058] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0059] Embodiments of this application provide a log template determination method, which can be applied to a log template determination device, such as... Figure 1 As shown, the method may include the following steps:

[0060] Step 101: Obtain the log to be processed and group the word sequences in the log to obtain multiple groups of word sequences.

[0061] The log to be processed includes multiple word sequences; the log to be processed is determined based on the network logs of the device to be processed during operation; the device to be processed can be a running network device.

[0062] In this embodiment, the log template determining device can send a retrieval command to the device to be processed to obtain the log to be processed, so that the device to be processed can send the log to be processed to the log template determining device based on the retrieval command; wherein, the log to be processed can be obtained by the device to be processed after processing the network logs generated by itself during operation. The log template determining device can also obtain the network logs corresponding to the operation of the device to be processed from the device to be processed, and process the network logs to obtain the log to be processed.

[0063] It should be noted that multiple word sequences in the log to be processed can be divided multiple times to obtain multiple sets of word sequences.

[0064] In one feasible implementation, multiple word sequences can be categorized to obtain multiple word sequence classes. Each word sequence class can include multiple word sequences. For each word sequence class, based on the attribute information of each word sequence in that class, the multiple word sequences corresponding to that class can be further divided to obtain multiple sets of word sequences corresponding to that class. The quantity information of each word sequence includes, but is not limited to, the length and size of the word sequence.

[0065] Step 102: Determine the target frequency of words in each word sequence and the position information of each word sequence in each word sequence.

[0066] The target frequency represents the number of word sequences corresponding to each word in each word sequence;

[0067] In the embodiments of this application, the words in each word sequence can be analyzed to determine the number of words in the word sequence to obtain the target frequency of words in each word sequence.

[0068] In one feasible implementation, taking a set of word sequences as an example, the words in the set of word sequences may include words A, B, C, D, and E. Words A, B, C, D, and E in the set of word sequences can be analyzed separately to determine the number of word sequences containing words A, B, C, D, and E in the set of word sequences, so as to obtain the target frequency of words in the set of word sequences.

[0069] In this embodiment, the location information of the log corresponding to each word sequence in each group of word sequences in the network log can be obtained to obtain the location information of each word sequence. The network log contains multiple logs, and each log corresponds to one word sequence.

[0070] Step 103: Based on the target frequency, location information, and each word sequence, determine the correlation between words in each word sequence.

[0071] In this embodiment of the application, for a set of word sequences, the set of word sequences can be analyzed based on the position information of each word sequence in the set of word sequences, and the set of word sequences can be analyzed based on the target frequency of the words in the set of word sequences, so as to determine the correlation between the words in each set of word sequences.

[0072] Step 104: Analyze the words in each word sequence based on their correlation to obtain the word set corresponding to each word sequence.

[0073] In this embodiment of the application, for any word in any word sequence, the distribution of other words in the word sequence can be determined, and based on the distribution of other words, the word set corresponding to the word can be determined. Each word in the word sequence is processed in the aforementioned manner, and finally at least one word set corresponding to the word sequence can be obtained.

[0074] In one feasible implementation, taking a set of word sequences as an example, the words in the set of word sequences include words a, b, c, d, and e. The final determined word set can be the word set corresponding to word a, word set corresponding to word c, and word set corresponding to word d. That is to say, not every word in a set of word sequences will have a corresponding word set. When determining the word set corresponding to each set of word sequences, the words in each set of word sequences will be screened to filter out words that appear less frequently in each set of word sequences, so as to improve the accuracy of the determined word set.

[0075] Step 105: For each word sequence, determine the target word set from the word set corresponding to the word sequence, and determine the target template based on the target word set and the word sequence.

[0076] In this embodiment of the application, for each group of word sequences, the word set corresponding to the group of word sequences can be filtered to determine the target word set, and each word sequence in the group of word sequences can be matched with the target word set to determine the target template. That is, each group of word sequences corresponds to a target template; wherein, the number of target templates corresponding to each group of word sequences can be at least one; and the number of target word sets corresponding to each group of word sequences can be at least one.

[0077] In one feasible implementation, taking a set of word sequences as an example, the number of words contained in each word set in the word set corresponding to the set of word sequences can be determined. From multiple word sets, the word set containing the most words is selected as the target word set corresponding to the set of word sequences. When there are multiple word sets containing the most words, all of them can be used as the target word set.

[0078] The log template determination method provided in the embodiments of this application obtains a log to be processed and groups the word sequences in the log to obtain multiple groups of word sequences; determines the target frequency of words in each group of word sequences and the position information of each word sequence in each group of word sequences; determines the correlation between words in each group of word sequences based on the target frequency, position information, and each group of word sequences; wherein, the target frequency represents the number of word sequences corresponding to words in each group of word sequences; analyzes the words in each group of word sequences based on the correlation to obtain the word set corresponding to each group of word sequences; for each group of word sequences, determines the target word set from the word set corresponding to the word sequence, and determines the target template based on the target word set and word sequence; thus, it considers the correlation between words in each group of word sequences, analyzes the words in each group of word sequences to obtain the word set corresponding to each group of word sequences, and determines the target template based on the target word set and word sequence obtained from the word set, without needing to cluster the word sequences in each group of word sequences based on the similarity between multiple strings corresponding to each group of word sequences to determine the target template, avoiding the problem of low accuracy of the determined target template due to inaccurate clustering, and improving the accuracy of the determined target template.

[0079] Based on the foregoing embodiments, the log template determination method provided in the embodiments of this application refers to... Figure 2 As shown, the method includes the following steps:

[0080] Step 201: Determine the log template and obtain the initial logs generated by the device under test during operation.

[0081] In this embodiment, the device to be processed can periodically and proactively send its own runtime network logs to the log template determining device, and the log template determining device can use the network logs as initial logs; alternatively, the log template determining device can proactively send a retrieval instruction to the device to be processed to obtain the runtime network logs of the device to be processed, so that after receiving the retrieval instruction, the device to be processed sends the network logs to the log template determining device according to the retrieval instruction, and after receiving the network logs, the log template determining device can use the network logs as initial logs.

[0082] In one feasible implementation, the device to be processed can be a server, and the network log can specifically be a server log. The server log is a log file that is automatically created and maintained by the server, and the log file contains a list of activities performed by the server.

[0083] Step 202: The log template determination device filters the first type of characters in the initial log to obtain the filtered log.

[0084] The first type of characters includes numbers that can be converted to floating-point numbers and characters in the target format; the target format includes the format of Internet Protocol (IP) addresses and the format of hostnames, where the hostname can be the name of the server.

[0085] In this embodiment, regular expressions are used to match the initial log, identifying and deleting numbers that can be converted to floating-point numbers and characters in the target format from the initial log to obtain a filtered log. That is, the filtered log not only lacks characters in the target format but also lacks numbers that can be converted to floating-point numbers. Compared to logs containing floating-point numbers in related technologies, this reduces the computational complexity of subsequently determining the target template. Furthermore, it reduces the impact of numbers that can be converted to floating-point numbers and characters in the target format on the accuracy of generating the target template, further improving the accuracy of the subsequently determined target template.

[0086] Step 203: The log template determination device extracts words from each log entry based on the second type of characters in the filtered logs, and obtains the word sequence corresponding to each log entry in the filtered logs.

[0087] The characters of the first type are different from those of the second type; the log to be processed includes multiple word sequences; the characters of the second type may include punctuation marks.

[0088] In this embodiment, the filtered logs can be analyzed to determine the second type of characters in the filtered logs. These second-type characters are then used as delimiters to extract the words between each pair of delimiters in each log entry to be processed, resulting in a word sequence for each log entry. Each log entry in the log to be processed corresponds to one word sequence.

[0089] It should be noted that in related technologies, spaces are used as delimiters when extracting word sequences. This results in a large number of punctuation marks (such as parentheses) in the determined word sequence, leading to inaccurate extraction of the string based on the first character of each word in the determined word sequence. This further leads to inaccurate determination of the target template. However, in the embodiments of this application, the word sequence corresponding to each log is extracted based on punctuation marks, which eliminates punctuation marks in the extracted word sequence, improves the accuracy of the determined word sequence, avoids interference from punctuation marks when analyzing each word in the word sequence, and further improves the accuracy of determining the target template.

[0090] Step 204: The log template determination device classifies multiple word sequences based on the characters at the target position of each word sequence to obtain multiple categories of word sequences.

[0091] In this embodiment, the character at the target position in each word sequence can be obtained, and word sequences with the same character at the target position can be grouped into one category to obtain word sequences of each category. Here, the target position is the position of the first character in the word sequence, and the character at the target position is the first character in the word sequence.

[0092] In one feasible implementation, the character at the target position in each word sequence can be the first letter of the first word in each word sequence. Word sequences with the same first letter of the first word in each word sequence can be grouped into one category to obtain the word sequence of each category.

[0093] It should be noted that when classifying multiple word sequences based on the first letter of the first word in the sequence, since there are a total of 26 possible first letters for a word, the number of categories of the resulting word sequences is greater than 1 and less than or equal to 26. In related technologies, dividing a word sequence into multiple groups based on its length results in an uncontrollable number of groups. However, dividing multiple word sequences by the first letter of the first word makes the number of categories controllable, which can improve search efficiency, reduce space overhead, and lower the computational complexity of subsequently determining the target template.

[0094] Step 205: Log template determination device groups each type of word sequence based on the length information of each word sequence to obtain multiple groups of word sequences.

[0095] The length information is used to represent the number of words in the word sequence.

[0096] In the embodiments of this application, for each type of word sequence, word sequences with the same length information can be divided into the same group based on the length information of each word sequence in each type of word sequence, so as to obtain at least one group of word sequences corresponding to each type of word sequence.

[0097] It should be noted that the length information of the word sequence can be the number of words in the word sequence.

[0098] In one feasible implementation, word sequences of the same type can be grouped based on the number of words in each word sequence. Taking the word sequence of type M as an example, the word sequence of type M includes word sequences with 3 words, word sequences with 4 words, and word sequences with 5 words. Then, the word sequences with 3 words can be grouped as group 1, the word sequences with 4 words as group 2, and the word sequences with 5 words as group 3.

[0099] It should be noted that the method first classifies multiple word sequences according to the characters at the target position to obtain word sequences of each category. Then, based on the length information of the word sequences, the word sequences of each category are grouped to obtain at least one set of word sequences corresponding to each category. This reduces the adverse effects of classifying only by length in related technologies, making the category of each word sequence controllable and more regular.

[0100] Step 206: The log template determination device performs deduplication on the words in each word sequence to obtain the first word.

[0101] In this embodiment of the application, the words of each word sequence in each group of word sequences can be obtained, and the words in the multiple obtained word sequences can be deduplicated, which can also be understood as deleting repeated words in multiple word sequences to obtain the first word.

[0102] In one feasible implementation, taking a set of word sequences as an example, if the words in the first word sequence of the set of word sequences are words A, B, C and D, and the words in the second word sequence are words A, B, D and E, then the words in the two word sequences can be grouped together, and the duplicate words of the grouped words can be removed to obtain the first word; where the first word is words A, B, C, D and E.

[0103] Step 207: The log template determines the number of word sequences corresponding to each first word obtained by the device, and obtains the target frequency of words in each group of word sequences.

[0104] In this embodiment of the application, for any first word in any group of word sequences, the first word can be matched with multiple word sequences in the group of word sequences to determine the word sequences containing the first word, and the number of word sequences containing the first word is counted to obtain the target frequency of the first word. The target frequency of each first word in the group of word sequences is determined in turn to obtain the target frequency of the words in the group of word sequences. Each group of word sequences includes multiple word sequences, and each group of word sequences corresponds to multiple first words.

[0105] Step 208: The log template determination device determines the position information of each word sequence in each group of word sequences.

[0106] Step 209: Log template determination device analyzes each group of word sequences to determine the number of word sequences in each group of word sequences.

[0107] In this embodiment of the application, the number of word sequences in each group of word sequences can be counted to obtain the number of word sequences in each group of word sequences; the number of logs corresponding to the word sequences in each group of word sequences can also be counted to obtain the number of word sequences in each group of word sequences.

[0108] Step 210: The log template determination device filters multiple first words to obtain second words based on the target frequency and target frequency threshold of words in each word sequence.

[0109] In this embodiment of the application, based on the target frequency of the first word, the word whose frequency satisfies the target frequency threshold is determined from multiple first words to obtain the second word.

[0110] In one feasible implementation, based on the target frequency of the first word, words whose target frequency is greater than the target frequency threshold are determined from multiple first words to obtain the second word.

[0111] Step 211: The log template determination device determines the number of second words and, based on the number of word sequences and the number of second words, determines the initial matrix.

[0112] In this embodiment of the application, the log determination device can count the number of the second word, determine the number of the second word, use the number of word sequences in each group of word sequences as the number of rows in the matrix, and use the number of the second word corresponding to each group of word sequences as the number of columns in the matrix, and construct an initial matrix based on the number of rows and columns.

[0113] In one feasible implementation, if the number of word sequences in any given word sequence is 5 and the number of the second word corresponding to that word sequence is 4, then an initial matrix of 5 rows and 4 columns can be constructed. Each element in the initial matrix can be set to empty.

[0114] Step 212: The log template determination device determines the association matrix of each word sequence based on the initial matrix, location information, the target frequency of each word sequence and the second word.

[0115] The association matrix represents the association between words in each word sequence.

[0116] In this embodiment of the application, for any set of word sequences, each word sequence in the set of word sequences can be analyzed based on the position information of each word sequence in the set of word sequences, and the words in each word sequence in the set of word sequences can be analyzed based on the target frequency of the second word corresponding to the set of word sequences, so as to determine the value of each element in the initial matrix and obtain the association matrix corresponding to the set of word sequences.

[0117] It should be noted that step 212 can be achieved through steps a1-a4:

[0118] Step a1: The log template determination device sorts multiple word sequences in each group of word sequences based on location information to obtain the sorted word sequences.

[0119] In this embodiment of the application, the positional relationship between word sequences in each group of word sequences can be determined based on positional information, and the multiple word sequences in each group of word sequences can be sorted based on the positional relationship to obtain the sorted word sequences.

[0120] Step a2: The log template determination device sorts multiple second words based on the target frequency of the second word to obtain the sorted second words.

[0121] In this embodiment of the application, multiple second words can be sorted from largest to smallest based on the target frequency of the second word to obtain the sorted second words. That is to say, among the sorted second words, the second word at the top of the sort has the highest target frequency.

[0122] Step a3: The log template determines the device according to the sorting of the sorted word sequence and the sorting of the second word. If the word in the sorted word sequence matches the second word, the value of the element corresponding to the sorted word in the initial matrix is ​​set to the first value.

[0123] In this embodiment, the row corresponding to each word sequence in the initial matrix is ​​determined according to the sorted word sequence, and the column corresponding to each second word in the initial matrix is ​​determined according to the sorted second word. When it is determined that a word in the sorted word sequence matches the second word, the value of the element corresponding to the word in the sorted word sequence that matches the second word in the initial matrix can be set to a first value. The first value can be 1.

[0124] Step a4: The log template determines the device according to the sorted word sequence and the sorted second word. If the words in the sorted word sequence and the second word do not match, the value of the element corresponding to the sorting in the initial matrix is ​​set to the second value to obtain the association matrix.

[0125] In this embodiment, the row corresponding to each word sequence in the initial matrix is ​​determined according to the sorted word sequence, and the column corresponding to each second word in the initial matrix is ​​determined according to the sorted second word. When it is determined that a word in the sorted word sequence does not match the second word, the value of the element corresponding to the word in the sorted word sequence that does not match the second word in the initial matrix can be set to a second value. The second value can be 0.

[0126] In one feasible implementation, such as Figure 3a As shown, Figure 3a A word sequence is formed by numbering words from 1 to 5, where the numbering is determined by the position of each word sequence, with word sequence number 1 being the first. The first words corresponding to word sequences numbered 1 to 5 are VM, Started Lifecycle, event, Resumed, and Paused, respectively. After filtering the first words, the second words are VM, Started, Lifecycle, event, and Paused. There are 5 word sequences and 5 second words, meaning the initial matrix constructed based on word sequences numbered 1 to 5 is a 5x5 matrix. The second words are sorted according to their target frequency, resulting in the sorted second words: VM, Lifecycle, event, Started, and Paused. Based on the sorted second words, the word corresponding to the element in the first column of the initial matrix is ​​VM, and the word corresponding to the element in the second column is Li. The word sequence is defined as follows: the element in column 3 corresponds to the word "Event", the element in column 4 corresponds to the word "Started", and the element in column 5 corresponds to the word "Paused". The word sequence numbered 1 corresponds to the element in row 1 of the initial matrix, the word sequence numbered 2 corresponds to the element in row 2, the word sequence numbered 3 corresponds to the element in row 3, the word sequence numbered 4 corresponds to the element in row 4, and the word sequence numbered 5 corresponds to the element in row 5. Each word in each word sequence is matched with the word corresponding to each column element in the matrix. If a match is found, the corresponding element in the initial matrix is ​​set to 1; otherwise, the value of the corresponding element in the matrix is ​​set to 0.

[0127] like Figure 3bAs shown, the words in the first word sequence can be matched with the corresponding second word of each column element in the initial matrix. If VM, Started, Lifecycle, and event are matched in the second word, then the values ​​of the elements corresponding to VM, Started, Lifecycle, and event in the first row of the first word sequence can be set to 1. If Paused is not present in the first word sequence, then the value of the element corresponding to Paused in the first word sequence can be set to 0. In this way, by matching the words in each word sequence numbered 1 to 5 with the second word, the value of each element in the initial matrix is ​​determined, and the association matrix is ​​obtained.

[0128] Step 213: The log template determines the value of the element in the i-th column of the device determination association matrix as the first target row corresponding to the target value.

[0129] Where i is a positive integer less than n; n is the number of columns in the correlation matrix, and n is a positive integer.

[0130] In this embodiment of the application, the elements in the i-th column of the correlation matrix can be filtered to determine the elements in the i-th column whose values ​​are the target values, and the row containing the elements whose values ​​are the target values ​​can be determined as the first target row.

[0131] In one feasible implementation, such as Figure 3b As shown, the target value is 1. When i is 1, it can be determined that the rows with the element value of 1 in the first column are rows 1 to 5, and rows 1 to 5 are taken as the first target rows.

[0132] It should be noted that the target value setting is related to the first value setting, and the target value and the first value are the same.

[0133] Step 214: The log template determines the number of elements whose values ​​are the target values ​​in each column from the (i+1)th to the nth column of the first target row of the correlation matrix, thus obtaining the second number.

[0134] In this embodiment of the application, the elements from column i+1 to column n can be obtained from the elements of the first target row in the correlation matrix, and the number of elements in each column from column i+1 to column n whose value is the target value can be determined to obtain the second quantity.

[0135] In one feasible implementation, such as Figure 3bAs shown, taking i=2 and the target value as 1 as an example, the number of elements with a value of 1 in the second column is 5. We can obtain the elements from the 3rd to 5th columns from the elements in rows 1-5 of the association matrix, and determine that the number of elements with a value of 1 in the 3rd column is 5, the number of elements with a value of 1 in the 4th column is 2, and the number of elements with a value of 1 in the 5th column is 2. The second quantity includes the number of elements with a value of 1 in the 3rd, 4th, and 5th columns.

[0136] Step 215: The log template determination device determines the target column containing the elements that meet the target quantity in the second quantity, and determines the word set corresponding to the element in the i-th column based on the second word corresponding to the element in the i-th column and the second word corresponding to the element in the target column.

[0137] In this embodiment of the application, the column corresponding to the second quantity can be filtered based on the target quantity to determine the target column, and the second word corresponding to the element of the i-th column and the second word corresponding to the element of the target column are combined to form a word set as the word set corresponding to the element of the i-th column, that is, the word set of the second word corresponding to the element of the i-th column.

[0138] In one feasible implementation, such as Figure 3b As shown, when i is 2, the column corresponding to the second quantity can be columns 3-5. The number of elements with a value of 1 in each of columns 3-5 can be compared with the target quantity to determine the column where the number of elements with a value of 1 in columns 3-5 is greater than the target quantity. When the target quantity is 1, then columns 3-5 are all target columns. The word set of the second word corresponding to the element in column 2 is composed of the word corresponding to the element in column 2 and the word corresponding to the element in columns 3-5.

[0139] Step 216: The log template determination device obtains the word set corresponding to each word sequence based on the word set corresponding to the element in column i and the word set corresponding to each element in column i+1 to column n.

[0140] In this embodiment of the application, the word sets corresponding to multiple column elements in the association matrix can be determined, and the determined multiple word sets can be used as the word sets corresponding to the word sequence.

[0141] In one feasible implementation, the target value is 1, such as... Figure 4As shown, the number of elements in each column of the association matrix with the target value can be determined. The number of elements with a value of 1 in column 1 is 5. Then, the number of elements with a value of 1 in each column from row 1 to row 5 in the association matrix can be obtained: 5 in column 2, 5 in column 3, 2 in column 4, and 2 in column 5. That is, the number of elements with a value of 1 in each column from column 2 to column 4 is 5, 5, 2, and 2 respectively. If the target number is 1, then the number of elements with a value of 1 in each column from column 2 to column 4 satisfies the target number. Therefore, the vocabulary set corresponding to the element VM in column 1 is determined to be [VMLifecycle Event Started Paused]. The vocabulary sets corresponding to the elements in other columns are determined in the same way. The vocabulary set corresponding to Lifecycle is [Lifecycle Event Started Paused], and the vocabulary set corresponding to Event is [Event Started]. [Paused], the vocabulary set corresponding to Started is [Started].

[0142] It should be noted that the words corresponding to the elements in the last column of the association matrix do not have a word set.

[0143] Step 217: Log template determination device determines the order of multiple word sets based on the second word after sorting for each word sequence.

[0144] In this embodiment of the application, for each group of word sequences, the sorting of the word sets corresponding to the sorted second word is obtained based on the sorting of the second word.

[0145] In one feasible implementation, such as Figure 4 As shown, the second word after sorting is VM, Lifecycle, Event Started, and Paused. Therefore, the order of the sorted word sets is VM, Lifecycle, Event, and Started.

[0146] Step 218: The log template determination device determines the target word set from multiple word sets based on the sorting between word sets.

[0147] In this embodiment of the application, the target word set can be determined from multiple sorted word sets based on the target order value.

[0148] In one feasible implementation, if the target order is P, then the first P words in the sorted word set can be taken as the target word set; for example... Figure 4As shown, multiple word sets are sorted according to the target frequency of the second word to obtain the sorted word set. When p=1, the target word set obtained by filtering is the word set of VM, specifically [VM Lifecycle Event StartedPaused].

[0149] Step 219: The log template determination device matches the target word set and each word sequence to obtain the matching result, and determines the initial template based on the matching result and each word sequence.

[0150] In this embodiment of the application, if the matching result indicates that the target word set and the word sequence match, then no modification to the word sequence is required to determine the initial template. If the matching result indicates that the target word set and the word sequence do not match, then it is determined that the word sequence needs to be modified to determine the initial template.

[0151] It should be noted that step 219 can be achieved through steps b1-b3:

[0152] Step b1: If the matching result indicates that the target word set and the word sequence match, the log template determination device determines the word sequence that matches the target word set as the initial template.

[0153] In this embodiment of the application, for any group of word sequences, if the target word set of the group matches every word sequence in the group of word sequences, then the word sequences in the group of word sequences are determined to be initial templates. Matching the target word set and word sequences can be understood as meaning that every word in the group of word sequences appears in the target word set.

[0154] It should be noted that the word sequences in this group of words can be deduplicated to obtain an initial template, so as to avoid duplicate templates in the obtained initial template.

[0155] Step b2: If the matching result indicates that the target word set and the word sequence do not match, the log template determination device modifies the word sequence to obtain the initial template.

[0156] In this embodiment of the application, for any group of word sequences, if the target word set of the group does not match any word sequence in the group, the word sequences in the group can be modified to obtain an initial template. The fact that the target word set of the group does not match any word sequence in the group can be understood as meaning that there are words in each word sequence that do not appear in the target word set.

[0157] It should be noted that when modifying this word sequence, you can modify the words in each word sequence that do not match the target word set to obtain the initial template.

[0158] In one feasible implementation, words in each word sequence that do not match the target word set can be modified with "*" to obtain the initial template.

[0159] Step b3: If the matching result indicates that the first word sequence does not match the target word set, but the second word sequence matches the target word set, the log template determination device modifies the first word sequence to obtain the modified first word sequence, and obtains the initial template based on the modified first word sequence and the second word sequence.

[0160] In this embodiment of the application, when the matching result indicates that there is a first word sequence that does not match the target word set, and there is a second word sequence that matches the target word set, that is, in a certain group of word sequences, there are words in the first word sequence that match the target word set, and there are words in the second word sequence that do not match the target word set, then the words in the first word sequence that do not match the target word set can be modified to obtain a modified first word sequence, and both the modified first word sequence and the second word sequence are used as initial templates.

[0161] In one feasible implementation, words in the first word sequence that do not match the target word set can be modified to "*", such as... Figure 4 As shown, word sequences numbered 1-4 match the target word set, while word sequence numbered 5 does not match the target word set. Therefore, the word "Resumed" in word sequence numbered 5 that does not match the target word set can be modified to "*", resulting in the modified word sequence "VM*Lifecycle Event". The modified word sequence and word sequences numbered 1-4 are then deduplicated, and the resulting word sequences "VM Started Lifecycle Event", "VM PausedLifecycle Event", and "VM*Lifecycle Event" are used as initial templates.

[0162] Step 220: Log Template Determination. The device determines the similarity between initial templates and merges the initial templates based on the similarity to determine the target template.

[0163] In the embodiments of this application, the similarity between every two templates in the initial template corresponding to each group of word sequences can be determined, and the initial templates whose similarity meets the similarity threshold can be merged to obtain the merged template. The merged template and the templates whose similarity does not meet the similarity threshold are used as the target template.

[0164] When merging, content that is the same at the same position is retained, and content that is different is treated as a variable and represented by "*". When calculating the similarity between any two initial templates, if the lengths of the two initial templates are different, the excess part can be replaced with an empty string.

[0165] It should be noted that generating an initial template first and then performing a similarity comparison is more targeted than performing a similarity comparison first and then generating a template in related technologies. It also reduces the comparison scale and increases the secondary merging of redundant templates, which greatly improves the accuracy and efficiency of template extraction.

[0166] In one feasible implementation, the similarity between initial templates can be determined by referring to formula (1).

[0167]

[0168] Where l1 represents a template in the initial template, l2 is a template in the initial template that is different from l1, |l1| represents the number of words in l1, |l2| represents the number of words in l2; m is a positive integer.

[0169]

[0170] In one feasible implementation, such as Figure 4 As shown, the similarity between the three generated initial templates is 0.75. When the similarity threshold is 0.6, that is, the three initial templates can be merged, the final extracted result of the template is VM*Lifecycle Event.

[0171] The following combination Figure 5 The log template determination method provided in the embodiments of this application will be explained in detail.

[0172] like Figure 5As shown, the log template determines that the device acquires initial logs and processes them to obtain logs to be processed. These logs contain multiple word sequences, which can be categorized alphabetically by their first letter. For example, the first category might be denoted as W1, the second as W2, and the c-th as Wc. Each category can then be further divided into multiple groups based on its length, and an association matrix is ​​constructed for each group. The words in each group are analyzed using this association matrix to obtain the corresponding word set. This word set is then filtered to obtain the target word set. Finally, the target word set is matched with each word sequence in the target word set. Initial templates are generated based on the matching results and word sequences, and the similarity between the initial templates is calculated. When the similarity between any two templates in the initial template is greater than the similarity threshold, multiple templates in the initial template can be merged into one template to obtain the target template. If the similarity between any two templates in the initial template is not greater than the similarity threshold, all initial templates can be used as target templates. If there are two templates in the initial template whose similarity meets the similarity threshold and two templates whose similarity does not meet the similarity threshold, the templates whose similarity meets the similarity threshold can be merged to obtain the merged template, and the merged template and the templates whose similarity does not meet the threshold can be used as target templates.

[0173] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.

[0174] The log template determination method provided in this application considers the correlation between words in each word sequence, analyzes the words in each word sequence to obtain the word set corresponding to each word sequence, and determines the target template based on the target word set and word sequence obtained from the word set. It does not require clustering the word sequences in each word sequence to determine the target template based on the similarity between multiple strings corresponding to each word sequence, thus avoiding the problem of low accuracy of the determined target template due to inaccurate clustering and improving the accuracy of the determined target template.

[0175] Based on the foregoing embodiments, embodiments of this application provide a log template determination device, which can be applied to... Figures 1-2 In the log template determination method provided in the corresponding embodiment, refer to Figure 6 As shown, the log template indicates that device 3 may include: a processor 31, a memory 32, and a communication bus 33; wherein:

[0176] Communication bus 33 is used to realize the communication connection between processor 31 and memory 32;

[0177] The processor 31 is used to execute the log template determination program stored in the memory 32 to perform the following steps:

[0178] Obtain the log to be processed, and group the word sequences in the log to obtain multiple groups of word sequences;

[0179] Determine the target frequency of words in each word sequence and the positional information of each word in each word sequence;

[0180] Based on target frequency, location information, and each word sequence, the correlation between words in each word sequence is determined; where target frequency represents the number of word sequences corresponding to the words in each word sequence.

[0181] Based on the correlation, the words in each word sequence are analyzed to obtain the word set corresponding to each word sequence;

[0182] For each word sequence, a target word set is determined from the word set corresponding to the word sequence, and a target template is determined based on the target word set and the word sequence.

[0183] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to obtain the log to be processed, in order to implement the following steps:

[0184] Obtain the initial logs generated during the runtime of the device to be processed;

[0185] Filter the first type of characters in the initial log to obtain the filtered log;

[0186] Based on the second type of characters in the filtered logs, word extraction is performed on each log entry in the filtered logs to obtain the word sequence corresponding to each log entry in the filtered logs; wherein, the first type of characters and the second type of characters are different; the logs to be processed include multiple word sequences.

[0187] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to group the word sequences in the log to be processed into multiple groups of word sequences, in order to implement the following steps:

[0188] Multiple word sequences are classified based on the characters at the target position of each word sequence to obtain multi-class word sequences;

[0189] For each type of word sequence, the word sequences are grouped based on the length information of each word sequence to obtain multiple groups of word sequences; the length information is used to represent the number of words in the word sequence.

[0190] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to determine the target frequency of words in each word sequence, in order to implement the following steps:

[0191] The words in each word sequence are deduplicated to obtain the first word;

[0192] Obtain the number of word sequences corresponding to each first word, and get the target frequency of words in each word sequence.

[0193] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to determine the correlation between words in each word sequence based on target frequency, position information, and each word sequence, in order to achieve the following steps:

[0194] Analyze each group of word sequences to determine the number of word sequences in each group;

[0195] Based on the target frequency and target frequency threshold of words in each word sequence, multiple first words are filtered to obtain second words;

[0196] Determine the number of the second word, and based on the number of word sequences and the number of the second word, determine the initial matrix;

[0197] Based on the initial matrix, positional information, the target frequency of each word sequence and the second word, the association matrix of each word sequence is determined; whereby the association matrix represents the association between words in each word sequence.

[0198] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to determine the association matrix of each word sequence based on the initial matrix, position information, the target frequency of each word sequence and the second word, in order to implement the following steps:

[0199] Based on positional information, multiple word sequences in each group of word sequences are sorted to obtain the sorted word sequences;

[0200] The second words are sorted based on their target frequency to obtain the sorted second words;

[0201] Based on the sorting of the sorted word sequence and the sorting of the second word, if the words in the sorted word sequence match the second word, set the value of the element in the initial matrix corresponding to the sorted word sequence as the first value.

[0202] Based on the sorting of the word sequence and the sorting of the second word, if the words in the sorted word sequence and the second word do not match, the value of the element corresponding to the sorting in the initial matrix is ​​set to the second value, thus obtaining the association matrix.

[0203] In other embodiments of this application, the processor 31 is used to execute the information determination program in the memory 32 to analyze the words in each group of word sequences based on correlation, and obtain the word set corresponding to each group of word sequences, so as to implement the following steps:

[0204] The value of the element in the i-th column of the association matrix is ​​determined to be the first target row corresponding to the target value; where i is a positive integer less than n; n is the number of columns in the association matrix, and n is a positive integer;

[0205] From the elements of the first target row of the correlation matrix, obtain the number of elements in each column from column i+1 to column n whose value is the target value, and obtain the second number;

[0206] Determine the target column containing the elements that satisfy the target quantity in the second quantity, and determine the word set corresponding to the elements in the i-th column based on the second word corresponding to the element in the i-th column and the second word corresponding to the element in the target column;

[0207] Based on the word set corresponding to the element in column i and the word set corresponding to each element in columns i+1 to n, the word set corresponding to each word sequence is obtained.

[0208] In other embodiments of this application, the processor 31 is configured to execute the information determination program in the memory 32 to determine a target word set from the word set corresponding to each word sequence, and to determine a target template based on the target word set and the word sequence, in order to implement the following steps:

[0209] For each word sequence, the order among multiple word sets is determined based on the second word after sorting.

[0210] Determine the target word set from multiple word sets based on the ordering among them;

[0211] The target word set and each word sequence are matched to obtain the matching results, and the initial template is determined based on the matching results and each word sequence.

[0212] Determine the similarity between initial templates, and merge the initial templates based on the similarity to determine the target template.

[0213] In other embodiments of this application, processor 31 is used to execute the information determination program in memory 32 to determine an initial template based on the matching results and each word sequence, in order to implement the following steps:

[0214] When the matching result indicates that the target word set and word sequence match, the word sequence that matches the target word set is determined as the initial template;

[0215] When the matching result indicates that the target word set and the word sequence do not match, the word sequence is modified to obtain the initial template;

[0216] If the matching results indicate that the first word sequence does not match the target word set, but the second word sequence matches the target word set, the first word sequence is modified to obtain the modified first word sequence, and the initial template is obtained based on the modified first word sequence and the second word sequence.

[0217] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can be referred to Figures 1-2 The implementation process of the log template determination method provided in the corresponding embodiment will not be described in detail here.

[0218] The log template determination device provided in the embodiments of this application considers the correlation between words in each word sequence, analyzes the words in each word sequence to obtain the word set corresponding to each word sequence, and determines the target template based on the target word set and word sequence obtained from the word set. It does not need to cluster the word sequences in each word sequence to determine the target template based on the similarity between multiple strings corresponding to each word sequence, thus avoiding the problem of low accuracy of the determined target template due to inaccurate clustering and improving the accuracy of the determined target template.

[0219] Based on the foregoing embodiments, embodiments of this application provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement... Figures 1-2 The steps of the log template determination method provided in the corresponding embodiment.

[0220] It should be noted that the aforementioned computer-readable storage media can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it can be various electronic devices that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0221] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0222] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0223] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0224] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0225] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0226] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0227] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for determining a log template, characterized in that, The method includes: Obtain the log to be processed, and group the word sequences in the log to be processed to obtain multiple groups of word sequences; Determine the target frequency of words in each word sequence and the positional information of each word in each word sequence; Based on the target frequency, the location information, and each word sequence, the correlation between words in each word sequence is determined; wherein, the target frequency represents the number of word sequences corresponding to the words in each word sequence; Based on the aforementioned correlation, the words in each word sequence are analyzed to obtain the word set corresponding to each word sequence; For each word sequence, a target word set is determined from the word set corresponding to the word sequence, and a target template is determined based on the target word set and the word sequence; The determination of the target frequency of words in each word sequence includes: The words in each word sequence are deduplicated to obtain the first word; Obtain the number of word sequences corresponding to each first word, and get the target frequency of words in each group of word sequences; The step of determining the correlation between words in each word sequence based on the target frequency, the location information, and each word sequence includes: Analyze each group of word sequences to determine the number of word sequences in each group of word sequences; Based on the target frequency and target frequency threshold of words in each word sequence, multiple first words are filtered to obtain second words; Determine the number of the second word, and based on the number of the word sequence and the number of the second word, determine the initial matrix; Based on the initial matrix, the location information, each word sequence, and the target frequency of the second word, an association matrix is ​​determined for each word sequence; wherein the association matrix characterizes the association between words in each word sequence.

2. The method according to claim 1, characterized in that, The process of obtaining logs to be processed includes: Obtain the initial logs generated during the runtime of the device to be processed; Filter the first type of characters in the initial log to obtain the filtered log; Based on the second type of characters in the filtered logs, word extraction is performed on each log in the filtered logs to obtain a word sequence corresponding to each log in the filtered logs; wherein, the first type of characters and the second type of characters are different; the log to be processed includes multiple word sequences.

3. The method according to claim 2, characterized in that, The process of grouping the word sequences in the log to be processed to obtain the multiple groups of word sequences includes: The multiple word sequences are classified based on the characters at the target positions of each word sequence to obtain multiple categories of word sequences; For each type of word sequence, the word sequences are grouped based on the length information of each word sequence to obtain the multiple groups of word sequences; wherein, the length information is used to represent the number of words in the word sequence.

4. The method according to claim 1, characterized in that, The step of determining the association matrix of each word sequence based on the initial matrix, the positional information, each word sequence, and the target frequency of the second word includes: Based on location information, multiple word sequences in each group of word sequences are sorted to obtain sorted word sequences; Based on the target frequency of the second word, multiple second words are sorted to obtain the sorted second words; According to the sorting of the sorted word sequence and the sorting of the second word, if the word in the sorted word sequence matches the second word, the value of the element in the initial matrix corresponding to the sorted word sequence is set to the first value. Based on the sorting of the sorted word sequence and the sorting of the second word, if the words in the sorted word sequence and the second word do not match, the value of the element corresponding to the sorting in the initial matrix is ​​set to a second value to obtain the association matrix.

5. The method according to claim 4, characterized in that, The step of analyzing the words in each word sequence based on the correlation to obtain the word set corresponding to each word sequence includes: The value of the element in the i-th column of the association matrix is ​​determined to be the first target row corresponding to the target value; where i is a positive integer less than n; n is the number of columns in the association matrix, and n is a positive integer; From the elements of the first target row of the correlation matrix, obtain the number of elements in each column from column i+1 to column n whose value is the target value, and obtain the second number; Determine the target column containing the elements that satisfy the target quantity in the second quantity, and determine the word set corresponding to the elements in the i-th column based on the second word corresponding to the elements in the i-th column and the second word corresponding to the elements in the target column; Based on the word set corresponding to the element in the i-th column and the word set corresponding to each element in each of the (i+1)-n-th columns, the word set corresponding to each group of word sequences is obtained.

6. The method according to claim 4, characterized in that, For each word sequence, determining a target word set from the word set corresponding to the word sequence, and determining a target template based on the target word set and the word sequence, includes: For each word sequence, the order among multiple word sets is determined based on the second word after sorting. The target word set is determined from the multiple word sets based on the order among them. The target word set and each word sequence are matched to obtain a matching result, and an initial template is determined based on the matching result and each word sequence; The similarity between the initial templates is determined, and the initial templates are merged based on the similarity to determine the target template.

7. The method according to claim 6, characterized in that, Determining an initial template based on the matching results and the sequence of each word includes: If the matching result indicates that the target word set and the word sequence match, the word sequence that matches the target word set is determined as the initial template; If the matching result indicates that the target word set and the word sequence do not match, the word sequence is modified to obtain the initial template; If the matching result indicates that there is a first word sequence that does not match the target word set, but there is a second word sequence that matches the target word set, the first word sequence is modified to obtain a modified first word sequence, and the initial template is obtained based on the modified first word sequence and the second word sequence.

8. A log template determination device, characterized in that, The device includes: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the log template determination program stored in the memory to implement the steps of the log template determination method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that can be executed by one or more processors to implement the steps of the log template determination method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method and device for creating log template and log analysis method

    CN110377576A

  • General log analysis method, terminal equipment and storage medium

    CN111581057A