A staggered log analysis method for building IoT workflows
By setting windows and calculating dependency values in the log files of the IoT system, combined with the weighted greedy algorithm and the micro-iteration adjustment algorithm, the context loss and noise problems in the interleaved logs are solved, and the real-time update and accuracy of the workflow model are achieved. Adapt to system complexity and variability and avoid model aging.
Patent Information
- Application Number
- CN202110464020.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-27
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-04-27
AI Technical Summary
It is difficult to effectively construct a staggered log workflow model for the Internet of Things system with existing technology, especially the context loss and noise issues caused by the complexity and variability of the system, as well as the problem of model aging.
By setting a window of length N in the log file, calculating dependency values and filtering noise successor entries, using weighted greedy algorithm and micro-iteration adjustment algorithm to update the model, avoiding the use of log identification information, solving the problem of context loss and noise, and The model aging problem is solved through micro-iterative update algorithm.
It achieves the construction of accurate workflow models in interleaved logs, reduces resource consumption, can update the model in real time, adapt to system changes, and improves the accuracy and reliability of the workflow model.
Smart Images

Figure CN113176977B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of computers, and in particular relates to an interleaved log analysis method for building an Internet of Things workflow. Background Art
[0002] At present, the architecture of intelligent IoT systems is becoming more and more complex, including thousands of device components and providing services to multiple users at the same time. For administrators, obtaining system operation information from logs and understanding the system operation status is an important way to perform system maintenance. However, with the increase in the scale and complexity of IoT systems, the number of logs generated per day has reached TB level, and it will become impossible to process these logs manually. The workflow model mined from the system log can be used for system maintenance, helping administrators understand the system operation status and monitor the correct operation of the system. However, due to the imperfection of system files and specifications, it is usually impossible to obtain the complete workflow of the system. In addition, due to the changeable characteristics of the operation mechanism of the IoT system, it is difficult to establish an effective, complete and adaptive workflow model.
[0003] Current systems will write system runtime information into logs, which can help administrators understand system operation status and analyze system failure causes. The following example shows a typical raw log entry, including timestamp, level, and raw log content.
[0004] 2020-02-10 20:38:31, 5186INFO dfs.DataNode$DataXceiver: Receiving blockblk_-6853481264720481267 src: / 10.210.11.53:48251dest: / 10.210.11.53:50754
[0005] The original log content can be parsed into log templates and parameters. For this example, the template is "Receiving block*Src:*dest:*", and the parameters are marked with "*". Since the template can represent a specific state when the system is running, it is used as a point in the workflow model. The edge connecting the points in the workflow model represents the state transition, such as Figure 1 An example of a workflow model in .
[0006] The concurrent and asynchronous characteristics of the system lead to log interleaving. In simple terms, the log sequence in the system log file is disordered. Log interleaving will cause problems of context loss and noise, which makes it difficult to distinguish logs belonging to different tasks. However, in principle, to build a correct workflow model, it is necessary to first separate the logs belonging to different tasks, and then further extract the program execution path to form a workflow model. We use Figure 1 Take 10000 as an example to illustrate the difficulty of separating interleaved logs and building corresponding workflow models. There are two log sequences with interleaved execution paths, namely 1→3→5→8→9→11 and 2→4→6→7→10→12. Some existing methods assume that each log entry has an identifier that uniquely identifies the execution to which it belongs. Other methods assume that even if system logs do not have unique identifiers, they can be collaboratively identified through the information in the logs. However, some systems, such as OpenStack, have more than one-third of their logs without any identifiers. Therefore, this information cannot be relied upon to separate logs and build workflow models. For these systems, it is ineffective to distinguish logs belonging to different tasks by the identification information in the logs.
[0007] In addition, the variability and polymorphism of the system bring about the problem of model aging, so the workflow model established offline will quickly lose its effectiveness as the system runs. Model aging is usually irreversible, and hot updates (application restarts) have little effect on its recovery or mitigation. Therefore, due to the model aging problem, the static workflow model established offline will lose its effectiveness if it is not adjusted and updated over time. Reconstructing the workflow model consumes a lot of resources, and real-time reconstruction is not an effective solution. Therefore, how to update the workflow model established offline online is also a problem that needs to be solved urgently. Summary of the invention
[0008] The present invention aims at the technical problems existing in the prior art and provides an interleaved log analysis method for building an Internet of Things workflow. When building a workflow model in the interleaved log, the use of identification information in the log is avoided, and the method has wide applicability. At the same time, the context loss and noise problems caused by log interleaving are solved. In addition, the problem of model aging is solved by updating the model through a micro-iterative update algorithm.
[0009] The technical solution adopted by the present invention is: a staggered log analysis method for building an Internet of Things workflow, comprising the following steps:
[0010] Step 1: In the log file, a window of length N is set after each log entry. The window covers the N subsequent log entries adjacent to the log entry. The value of N in the window is determined manually.
[0011] Step 2: Calculate the dependency value between the previous log entry and each subsequent log entry in the subsequent window;
[0012] Step 3: Set the filtering threshold. If the joint dependency value is greater than the filtering threshold, the corresponding subsequent log entry is the true successor entry of the previous log entry. The rest are noise successor entries.
[0013] Preferably, the dependency value is the probability of occurrence of the subsequent log entry in all windows of the same previous log entry.
[0014] As a preferred method, in order to cope with the situation where the previous log entry has multiple real successor entries, a weighted greedy algorithm is used to filter the noise, specifically: in step 3, the values of the dependency values of the successor log entries are arranged from large to small, and the sum of the first m dependency values is continuously calculated until the sum of the dependency values is greater than the filtering threshold, then the corresponding successor log entries are all real successor entries of the previous log entry; wherein, m is a natural number, and its value starts from 1 and increases by 1 each time. The remaining log entries are all noise successor entries, and the corresponding dependency values are set to zero. The value of m starts from 1, which can cover the situation of one or more real successor entries.
[0015] Preferably, the previous log entry and its subsequent log entry constitute a log entry dependency pair; there is a dependency relationship between the previous log entry and its true subsequent entry; and there is no dependency relationship between the previous log entry and its noise subsequent entry.
[0016] Preferably, the setting value of the dependency value corresponding to the noise log entry is zero, and the dependency value corresponding to the real subsequent log entry maintains the original value.
[0017] As a preferred method, micro-iteration adjustment: continuously obtain a log file segment of length L from the log file. If there is a log entry dependency pair in the real-time log file segment, the dependency value is increased by μ, and if not, the dependency value is decreased by μ.
[0018] If the dependency value exceeds the upper limit, the log entry dependency pair adds a dependency relationship. If the dependency value is lower than the lower limit, the log entry dependency pair deletes the dependency relationship.
[0019] As a preference, rebuild: Rebuild a workflow model based on staggered logs over a period of time to avoid a large number of micro-iteration adjustments when the system operation mode changes on a large scale.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] 1. The present invention designs a window to cover the true successor of a log entry in an interleaved log, and the window size is adjustable; a variable window-based method is used to perform dependency calculation to combat the context loss problem; and the use of identification information in the log is avoided, which has wide applicability.
[0022] 2. The present invention designs a weighted greedy algorithm to filter noise. The algorithm can select the true successor from the candidate objects in the window and then delete the noise branch.
[0023] 3. The present invention proposes a micro-iterative adjustment algorithm to fine-tune the dependency value and then change the dependency relationship to adapt to system changes. This algorithm can not only generate a real-time workflow model, but also avoid the large amount of resource consumption when reconstructing the workflow multiple times. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 Interleaved log sequence and workflow model for OpenStack VM startup;
[0025] Figure 2 A schematic diagram of a flow chart of an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of the probability density of the interleaved logs in an embodiment of the present invention;
[0027] Figure 4 This is a comparison chart of Precision / Recall between the embodiment of the present invention and Logsed;
[0028] Figure 5 Result diagram of Precision / Recall for different window lengths and filter thresholds according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] The embodiment of the present invention provides a staggered log analysis method for constructing an Internet of Things workflow, such as Figure 2 As shown, it includes the following steps:
[0031] Step 1: In the log file, a window of length N=3 is set after each log entry, and the window covers the three subsequent log entries adjacent to the log entry.
[0032] When using a window to find the true successor entry of the current template, the remaining entries in the window are irrelevant to the current template. The remaining log entries are just noise to the previous log entries, although they may be other execution paths.
[0033] Figure 3 The probability density of true successor item dependency values and noisy successor item dependency values for a window in the interleaved log is shown.
[0034] exist Figure 3 In (a), as the window increases, the true dependency value becomes smaller and the distribution becomes more concentrated. Figure 3In (b), as the window increases, the noise dependency value becomes larger and the distribution becomes more dispersed. Therefore, the larger the window setting, the greater the improvement in the true successor discovery capability, but the more noise is introduced. An appropriate window length can ensure the successor discovery capability and minimize the introduced noise. The calculation of the optimal window length is an NP-hard problem, so it is necessary to set a better window length. In practical applications, the better window length setting can start from the number of executions until the length of the shortest task.
[0035] Step 2: Calculate the dependency value between the previous log entry and each subsequent log entry in its subsequent window;
[0036] The dependency value is used to measure the connection between log templates. Figure 2 As shown in the dependency calculation section, we first need to calculate the count vector (C_V), whose value is the template occurrence count within the window after the current template in the log sequence. Here, we introduce the C_V calculation of T2. If we check the next 3 entries of T2, we can get an occurrence count dictionary {T0: 1, T3: 4, T4: 1, T5: 3, T6: 2, T8: 1}, which is naturally converted to C_V according to the subscript of the template. Intuitively, T3 is the successor of T2 because T3 has the largest count in the C_V of T2. But whether T5 is also the successor of T2 is uncertain. In addition, the value of C_V may be greatly affected by the number of occurrences of the reference log entry. Although the system log is interleaved, the true neighbors of the template entry will appear nearby. The true successor of this log entry must appear after a period of time, while the noise log entry will appear randomly. Therefore, the true successor entry of the reference template will have a higher probability of appearing in the window, and this probability can represent the dependency of the two templates. The dependency vector (D_V) can be calculated by Formula 1.
[0037] D_Vi[j]=C_Vi[j] / sum(C_Vi) (1)
[0038] Where D_Vi and C_Vi represent the dependency vector and count vector of Ti respectively. D_Vi[j] is the dependency value between Tj and Ti.
[0039] Step 3: Noise filtering uses a weighted greedy algorithm to filter noise, combining multiple dependencies to form a new feature and filtering noise together. Specifically, the log entries are arranged in descending order according to their dependency values, and the sum of the first m dependency values is calculated continuously. Try 1 combination, 2 combination, 3 combination, ... m combination, until the joint enhanced feature can meet the dependency requirements (the sum of the dependency values is greater than the filtering threshold Θ), then all the corresponding log entries are true successors of the previous log entries; the remaining log entries are all noise successors, and the dependency values are set to zero.
[0040] Over time, the state migration of system mechanisms will change, or even completely transform into a new operating mode that has never appeared before. The workflow model established offline can be updated by capturing changes in the system log to adapt to changes in the system mechanism. There are two cases of workflow updates, namely real-time workflow model fine-tuning and periodic model reconstruction. Workflow fine-tuning uses real-time log streams to adjust the weights of edges in the offline workflow model and dynamically add or remove state transition edges based on their changes. Since the system mechanism may be completely transformed into a new operating model, periodic inspection and reconstruction are also used to avoid a lot of fine-tuning.
[0041] The offline workflow model is constructed by D_V after noise filtering. The non-zero dependency value in D_V indicates that there is a transfer edge between two templates. During the online fine-tuning phase, the micro-iteration adjustment algorithm will continuously adjust the dependency value (edge weight) in the workflow model. If the dependency value reaches the upper or lower limit, the online update method needs to add or delete the transfer edge. The specific steps are:
[0042] The online model is initialized as a static offline workflow model, and all dependency values are obtained at the same time. Log file segments of length L are continuously obtained from the log file. If there is a log entry dependency pair, the dependency value is increased by μ, and if there is no dependency value, the dependency value is reduced by μ. If the dependency value exceeds the upper limit, the log entry dependency pair adds a dependency relationship. If the dependency value is lower than the lower limit, the log entry dependency pair deletes the dependency relationship.
[0043] Micro-iterative adjustment algorithms work well for situations where the changes are continuous and slight, and they handle complete shifts in system mechanisms well with periodic inspection and refactoring.
[0044] Periodic model reconstruction: Reset the dependency relationships, dependency values, upper and lower limits of log entry dependency pairs. By periodically checking and rebuilding the model, a large number of fine-tuning iterations can be avoided when huge mutations occur in the system.
[0045] A combination of iterative fine-tuning and periodic refactoring can be applied in most cases.
[0046] This example uses the Nova computing service in OpenStack as the data source for the interleaving experiment. The degree of interleaving can be controlled by the number of concurrent executions of virtual machines (VMs). In order to understand the actual situation of the OpenStack VM operation cycle, we manually check the source code and submit a single request to the system to obtain the real workflow.
[0047] We collected five experimental data sets to evaluate the workflow building performance of Sysnif (this embodiment). These experiments tested potential factors that affect the accuracy and efficiency results: the number of tasks executed simultaneously. The more tasks running concurrently, the higher the log interleaving complexity. The number of concurrent tasks was set to 2 to 6. Each task represents an execution that can automatically perform virtual machine management. The virtual machine cycle starts from the start of the instance and ends when the instance is stopped. Each task in our experiment executes 20 cycles in sequence.
[0048] In this section, we choose the clustering-based Logsed (T. Jia, L. Yang, P. Chen, Y. Li, F. Meng, and J. Xu, "Logsed: Anomaly diagnosis through mining time-weighted control flowgraph in logs," in 2017 IEEE 10th International Conference on Cloud Computing (CLOUD). IEEE, 2017, pp. 447-455.) as the benchmark, and the comparison indicator is the standard Precision / Recall. Precision is the proportion of the edges in the mined workflow model that are true, and Recall is the proportion of the edges in the true workflow model that are mined.
[0049] The experimental results of Precision and Recall comparison are as follows Figure 4 As shown. The precision of Logsed is very high, but the recall is not satisfactory as the number of concurrency increases. The branches in the OpenStackVM lifecycle model will cause the dependencies to be scattered, and Logsed filters out some real dependencies (such as noise). Sysnif uses a weighted greedy algorithm to filter noise to make up for this deficiency and has better performance. As the degree of interleaving increases, the precision results will decrease slightly, but the precision and recall of Sysnif can reach at least 92.2% and 93.1% respectively.
[0050] The window size in the dependency calculation and the filtering threshold in the weight greedy noise filter have a great impact on the accuracy. Figure 5 The precision and recall of the workflow model constructed by Sysnif with a data set of 5 concurrent tasks are shown. It can be concluded that for this data set, the window size needs to be set to 5 and the filter threshold needs to be set to 0.3, and Sysnif can achieve better performance. This also verifies that the larger the window, the greater the noise introduced, and the more difficult it is to distinguish the true predecessor and successor from the noise item.
[0051] We also conducted comparative experiments on direct construction of 3k log workflows and construction of 2k log workflows + fine-tuning of 1k log workflows, and the Precision / Recall results were 0.948 / 0.935 and 0.953 / 0.929 respectively. In this experiment, the window length was set to 5, and the micro-iteration step size μ was set to 0.008. The upper and lower limits were relatively set to 0.1 and 0.9. It can be concluded that construction + micro-iteration can achieve the accuracy level of direct construction. Micro-iteration can work online and output a real-time workflow model while the system is running, thus avoiding a lot of resource consumption of workflow reconstruction.
[0052] The main time consumption of Sysnif can be divided into two parts: raw log preprocessing and structured sequence workflow construction. Preprocessing is to parse the unstructured raw log data into a structured log template sequence. Our tool adopts the latest log parsing algorithm Drain (P. He, J. Zhu, Z. Zheng, and MRL Yu, "Drain: An online log parsing approach with fixed depth tree," in 2017 IEEE International Conference on Web Services (ICWS). IEEE, 2017, pp. 33-40.). In the workflow construction phase, Sysnif is based on statistical calculations with few iterations. The time complexity of D_V calculation and sorting process in the weighted greedy noise filtering algorithm is O(n) and O(Nlog(N)), respectively, where n is the number of logs and N is the number of templates much smaller than n. In the hardware environment of i5-8300H CPU and 8GB memory, Sysnif takes 3.95s to process 10k logs. It can be concluded that Sysnif can reach a level of seconds per 10k log processing level.
[0053] The present invention has been described in detail above through embodiments, but the contents described are only exemplary embodiments of the present invention and cannot be considered to limit the scope of implementation of the present invention. The protection scope of the present invention is defined by the claims. Anyone who utilizes the technical solution described in the present invention, or a technician in the field, inspired by the technical solution of the present invention, designs a similar technical solution within the essence and protection scope of the present invention to achieve the above technical effects, or makes equal changes and improvements to the scope of application, etc., shall still fall within the scope of protection covered by the patent of the present invention.
Claims
1. A staggered log analysis method for building an Internet of Things workflow, characterized by: The following steps are involved: Step 1: In the log file, a window of length N is set after each log entry. The window covers the N subsequent log entries adjacent to the log entry. The value of N in the window is determined manually. Step 2: Calculate the dependency value between the previous log entry and each subsequent log entry in its subsequent window; Step 3: Set the filtering threshold, arrange the dependency values of the successor log entries from large to small, and continuously calculate the sum of the first m dependency values until the sum of the dependency values is greater than the filtering threshold. The corresponding successor log entries are all true successor entries of the previous log entry; the remaining log entries are all noise successor entries, and the dependency values are set to zero, where m is a natural number, and its value starts from 1 and increases by 1 each time.
2. The interleaved log analysis method for constructing an Internet of Things workflow according to claim 1, characterized in that: The dependency value is the probability of a subsequent log entry appearing in all windows of the same previous log entry.
3. The staggered log analysis method for constructing an Internet of Things workflow according to claim 1, characterized in that: The previous log entry and its subsequent log entry constitute a log entry dependency pair; there is a dependency relationship between the previous log entry and its true subsequent entry; there is no dependency relationship between the previous log entry and its noise subsequent entry.
4. The interleaved log analysis method for constructing an Internet of Things workflow according to claim 1, characterized in that: The dependent values corresponding to the noise log entries are set to zero, and the dependent values corresponding to the true subsequent log entries remain the original values.
5. The interleaved log analysis method for constructing an Internet of Things workflow according to claim 1, characterized in that: Micro-iteration adjustment: continuously obtain log file segments of length L from the log file. If there is a log entry dependency pair in the real-time log file segment, the dependency value is increased. μ , there is no dependency value reduction μ , If the dependency value exceeds the upper limit, the log entry dependency pair adds a dependency relationship. If the dependency value is lower than the lower limit, the log entry dependency pair deletes the dependency relationship.
6. The staggered log analysis method for constructing an Internet of Things workflow as claimed in claim 5, characterized in that: Reconstruction: Rebuild a workflow model based on staggered logs over time.
Citation Information
Patent Citations
Log analysis method and device for data warehouse
CN104036034A
System-log classification method
CN108427720A
System and method for analyzing and responding to errors within a log file
CN110018948A
Double-granularity noise log filtering method based on incidence relation
CN110032494A
Identifying malware-suspect end points through entropy changes in consolidated logs
US20180288074A1
