Prediction Method and Device for Server Log Error Messages
By building a test model, using log information without error conditions and error conditions, the problem of high complexity of server log analysis is solved, and the error information output is achieved quickly and accurately.
Patent Information
- Application Number
- CN202210170399.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-02-23
AI Technical Summary
The serial port type log in the server log is not traceable, and if it is not saved during output, it will be lost. On-site maintenance personnel need to frequently switch the log viewing method, which has high analysis complexity and low efficiency, and is prone to errors.
Establish a test model, use log information without error conditions and error conditions, and quickly analyze the log information to be analyzed and output error information through the construction of perfect sets and defect sets.
It improves the efficiency and accuracy of server log error information analysis, simplifies the process of log information processing, and reduces human errors.
Smart Images

Figure CN114528143B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of server testing, and particularly to a method and device for predicting server log error information. Background Art
[0002] With the rapid development of big data and cloud computing, the demand for servers is increasing continuously, and at the same time, the requirements for the reliability, availability, and maintainability of servers are also getting higher and higher.
[0003] Generally, server logs include various types of logs, such as OS logs, BMC logs, BMC serial port logs, BIOS serial port logs, etc. In particular, serial port type logs do not have traceability and will be lost if not saved when output. Moreover, currently, the debug serial port of the server can only display one form of log at the same time. On-site maintenance personnel need to frequently switch the log viewing method to obtain different types of logs, and then they need to manually find out the logical relationship and timeline of the error occurrence. The complexity of analysis is relatively high, the efficiency is low, and it is also easy to make mistakes. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, electronic device, and computer-readable storage medium for predicting server log error information to solve at least part of the above technical problems, which can establish a test model using log information and test the loaded log information using the test model to improve efficiency and increase test accuracy.
[0005] To achieve the above purpose, this application discloses a method for predicting server log error information, which includes:
[0006] Loading at least one type of log information, where the log information includes log information in a error-free condition and log information in an error condition;
[0007] Establishing a test model according to the log information in the error-free condition and the log information in the error condition;
[0008] Obtaining the log information to be analyzed;
[0009] Analyzing and comparing the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed.
[0010] Optionally, the establishing a test model according to the log information in the error-free condition and the log information in the error condition includes:
[0011] Obtaining a perfect set according to the log information in the error-free condition;
[0012] Obtaining a defect set according to the log information in the error condition;
[0013] The perfect set and the defect set are combined to form the test model.
[0014] Optionally, obtaining the perfect set according to the log information of the error-free situation includes:
[0015] Archiving the log information of each error-free situation to form the perfect set;
[0016] Obtaining the defect set according to the log information of the error situation includes:
[0017] Extracting corresponding error feature information from the log information of each error situation;
[0018] Forming the defect set according to each error feature information.
[0019] Optionally, analyzing and comparing the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed includes:
[0020] Comparing the log information to be analyzed with the perfect set to obtain difference information;
[0021] Then comparing the difference information with the defect set to determine the error information corresponding to the log information to be analyzed.
[0022] Optionally, the error information includes error events, associated events, severity levels, and component information.
[0023] Optionally, the method further includes:
[0024] Loading verification log information, where the verification log information records corresponding reference error information;
[0025] Analyzing and comparing the verification log information with the test model to obtain the comparison error information of the verification log information;
[0026] Adjusting the parameters of the test model according to the comparison error information and the reference error information.
[0027] Optionally, the method further includes:
[0028] The log information is divided into different types;
[0029] Establishing corresponding test models for each type of log information respectively.
[0030] To achieve the above object, the present application also discloses a prediction device for server log error information, which includes:
[0031] A loading module, which is used to load at least one type of log information, and the log information includes log information in a non-error condition and log information in an error condition;
[0032] A building module, which is used to build a test model according to the log information in the non-error condition and the log information in the error condition;
[0033] An obtaining module, which is used to obtain log information to be analyzed;
[0034] An analyzing module, which is used to analyze and compare the log information to be analyzed with the test model respectively to obtain error information corresponding to the log information to be analyzed.
[0035] To achieve the above object, the present application also discloses an electronic device, which includes:
[0036] A processor;
[0037] A memory, in which executable instructions of the processor are stored;
[0038] Wherein, the processor is configured to execute the prediction method of server log error information as described above by executing the executable instructions.
[0039] To achieve the above object, the present application also discloses a computer-readable storage medium, on which a computer program is stored, and the computer program includes that when the computer program is executed by a processor, the prediction method of server log error information as described above is realized.
[0040] To achieve the above object, the present application also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the prediction method of server log error information as described above.
[0041] The present application first loads at least one type of log information, and the log information includes log information in a non-error condition and log information in an error condition. Then, a test model is built by using the log information in the non-error condition and the log information in the error condition. When in use, only the log information to be analyzed needs to be obtained, and the log information to be analyzed is analyzed and compared with the test model respectively to obtain error information corresponding to the log information to be analyzed. The present application can build a test model according to the log information in the non-error condition and the log information in the error condition, and analyze and compare the log information to be analyzed with the built test model, so as to quickly analyze and output error information corresponding to the log information to be analyzed, improve efficiency and increase test accuracy. Brief Description of the Drawings
[0042] Figure 1 This is a flowchart of the method for predicting server log error information in an embodiment of the present application.
[0043] Figure 2 This is a schematic block diagram of the device for predicting server log error information in an embodiment of the present application.
[0044] Figure 3 This is a schematic block diagram of an electronic device in an embodiment of the present application. Detailed Description of the Embodiments
[0045] To describe in detail the technical content, structural features, implementation principles, achieved objectives and effects of the present application, the following will be described in detail in conjunction with the embodiments and with reference to the accompanying drawings.
[0046] Please refer to Figure 1 , the present application discloses a method for predicting server log error information, which includes:
[0047] 101. Load at least one type of log information, where the log information includes log information in a non-error situation and log information in an error situation.
[0048] Generally speaking, the server generates log information during operation, such as OS logs, BMC logs, etc., and the log information is used to record the operating status of the server. When an abnormal situation occurs during the operation of the server, the log information will record the corresponding error situation.
[0049] Specifically, the log information in a non-error situation includes a startup log in a non-error situation and a running log in a non-error situation. Among them, the startup log in a non-error situation refers to the log recorded when the system starts up normally (without an error situation), and the running log in a non-error situation refers to the log recorded when the system is running normally (the system has been running for a specified time and no error situation has occurred, such as no error situation has occurred in 72 hours).
[0050] Specifically, the log information in an error situation includes a startup log in an error situation and a running log in an error situation. Among them, the startup log in an error situation refers to the log recorded when the system starts up (an error situation occurs, which can be one error situation or multiple error situations), and the running log in an error situation refers to the log recorded when the system is running (the system has been running for a specified time and an error situation has occurred, such as one error situation or multiple error situations have occurred in 72 hours).
[0051] 102. Establish a test model based on the log information in a non-error situation and the log information in an error situation.
[0052] In some embodiments, establishing a test model based on the log information of error-free situations and the log information of error situations includes:
[0053] Obtaining a perfect set according to the log information of error-free situations;
[0054] Obtaining a defect set according to the log information of error situations;
[0055] Combining the perfect set and the defect set into a test model.
[0056] By respectively using the log information of error-free situations and the log information of error situations to obtain a perfect set and a defect set, and combining the perfect set and the defect set to obtain a test model, it is beneficial for the test model to record the data of error-free situations and error situations, facilitating subsequent analysis and improving efficiency and accuracy.
[0057] Generally speaking, combining several pieces of log information of error-free situations into a perfect set and combining several pieces of log information of error situations into a defect set. It should be noted that the specific number of log information can be set by oneself and is not limited here.
[0058] Further, obtaining a perfect set according to the log information of error-free situations includes:
[0059] Archiving the log information of each error-free situation to form a perfect set;
[0060] Obtaining a defect set according to the log information of error situations includes:
[0061] Extracting the corresponding error feature information from the log information of each error situation;
[0062] Forming a defect set according to each error feature information.
[0063] By archiving the log information of each error-free situation to form a perfect set, it is beneficial for the perfect set to collect more log data of error-free situations, facilitating subsequent comprehensive comparison and analysis. At the same time, extracting the error feature information corresponding to the log information of each error situation and forming a defect set is beneficial for extracting the corresponding error data from the log information of each error situation and can quickly collect data of various error situations.
[0064] Specifically, the log information of error situations records the error content corresponding to the abnormal situation that occurs during the operation of the server. Therefore, extracting the corresponding error content from the log information of each error situation and using the error content as the error feature information, such as using error contents such as abnormal hard disk temperature and abnormal fan speed as the error feature information, and combining each error feature information into a defect set.
[0065] In some embodiments, the above method further includes:
[0066] Log information is divided into different types;
[0067] Corresponding test models are established for each type of log information respectively.
[0068] By establishing corresponding test models for different types of log information respectively, different types of test models can be utilized to quickly predict error information for different types of log information to be analyzed, improving efficiency and being applicable to different types of log information to be analyzed, thus enhancing stability.
[0069] Generally speaking, there are various types of log information generated when the server is running, such as OS logs, BMC logs, BMC serial port logs, BIOS serial port logs, etc. When establishing the corresponding test models, first, a number of log information of the corresponding types are respectively loaded. Each type of log information includes log information in a non-error situation and log information in an error situation of the corresponding type (for example, when establishing a test model for OS logs, a number of OS-type log information need to be loaded), and then the test models of the types are established according to the log information in the non-error situation and the log information in the error situation of the corresponding type.
[0070] In some embodiments, the above method further includes:
[0071] Load verification log information, and the verification log information records corresponding reference error information;
[0072] Analyze and compare the verification log information with the test model to obtain the comparison error information of the verification log information;
[0073] Adjust the parameters of the test model according to the comparison error information and the reference error information.
[0074] By introducing verification log information that records corresponding reference error information, and using the test model to predict error information for the verification log information, and adjusting the parameters of the test model according to the difference between the predicted comparison error information and the reference error information, it is beneficial to evaluate and adjust the capabilities of the test model, improving the prediction accuracy and efficiency.
[0075] Specifically, adjusting the parameters of the test model according to the difference between the comparison error information and the reference error information can be to adjust the content of the defect set, such as adding or reducing some error feature information, etc. Of course, it can also be other ways, which are not limited herein as long as the parameters of the test model can be adjusted to change the prediction accuracy of the test model.
[0076] 103. Obtain the log information to be analyzed.
[0077] Generally speaking, the way to obtain the log information to be analyzed can be to collect the log information of the faulty machine. For example, export the OS log, BMC log, BMC serial port log, BIOS serial port log, etc. from the faulty machine through the out-of-band management system. Of course, it can also be obtained through other methods, which are not limited here.
[0078] 104. Analyze and compare the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed.
[0079] In some embodiments, analyzing and comparing the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed includes:
[0080] Compare the log information to be analyzed with the perfect set to obtain the difference information;
[0081] Then compare the difference information with the defect set to determine the error information corresponding to the log information to be analyzed.
[0082] By first comparing the log information to be analyzed with the perfect set, the difference information between the two can be quickly compared. Then, by using the difference information to compare with the defect set, the relationship between the difference information and the defect set can be quickly determined, which is beneficial to quickly determining the error information corresponding to the log information to be analyzed, reducing the amount of data processing, improving the prediction efficiency. In addition, performing two comparisons can improve the accuracy of the prediction.
[0083] Specifically, first compare the log information to be analyzed with the perfect set, automatically identify the different parts between the two and use them as the difference information (such as comparing with the log information in the perfect set without errors respectively). Then compare the difference information with the error feature information of the defect set and output the error information corresponding to the log information to be analyzed (such as outputting the content in the difference information that conforms to the error feature information of the defect set and using it as the corresponding error information).
[0084] Specifically, the error information includes error events, associated events, severity, and component information. It can clearly and quickly obtain the key content in the error information, which is convenient for the operation and maintenance personnel to view or maintain.
[0085] Specifically, an error event refers to the specific error content that actually occurs (such as hard disk over-temperature alarm, abnormal fan speed, etc.). An associated event refers to other error content associated with the error event. For example, for the hard disk over-temperature alarm event, its associated events include increased fan speed, etc. And for the abnormal fan speed event, its associated events include the temperature sensor detecting a rapid increase in temperature, etc. The severity refers to the degree of association between the error event and the system failure, which can be judged by comparing the occurrence time point of the error event with the occurrence time point of the system failure. When the two time points are the same or relatively close, the possibility that the error event causes the system to fail is greater, indicating that the severity of the error event is greater. Among them, the system failure mainly refers to system crash, and of course, it can also include system restart. Component information refers to the component where the error occurs, such as hard disk, fan, CPU, etc.
[0086] Furthermore, each log information to be analyzed is respectively analyzed and compared with the corresponding test model to obtain the error information corresponding to the log information to be analyzed, and the error information corresponding to each log information to be analyzed is integrated and a report information in a custom format is output. The key content in each error information can be clearly and quickly obtained, which is convenient for the operation and maintenance personnel to view or maintain.
[0087] Specifically, the corresponding error events, associated events, severity, and component information in the error information corresponding to the log information to be analyzed can be respectively integrated. It can be integrating and numbering each error event, or integrating the related events together, or integrating the events with similar severity together, or integrating according to the component information. Of course, it can also be integrated and output in other forms, which is not limited here.
[0088] This application first loads at least one type of log information. The log information includes log information without error conditions and log information with error conditions. Then, a test model is established using the log information without error conditions and the log information with error conditions. When in use, only the log information to be analyzed needs to be obtained, and the log information to be analyzed is respectively analyzed and compared with the test model to obtain the error information corresponding to the log information to be analyzed. This application can establish a test model based on the log information without error conditions and the log information with error conditions, and analyze and compare the log information to be analyzed with the established test model, so as to quickly analyze and output the error information corresponding to the log information to be analyzed, improve efficiency, and increase test accuracy.
[0089] Please refer to Figure 2 , this embodiment of the application also discloses a prediction device for server log error information, which includes:
[0090] A loading module 10, where the loading module 10 is used to load at least one type of log information. The log information includes log information without error conditions and log information with error conditions;
[0091] A building module 11 is configured to build a test model based on log information of an error-free situation and log information of an error situation.
[0092] An obtaining module 12 is configured to obtain log information to be analyzed.
[0093] An analysis module 13 is configured to separately analyze and compare the log information to be analyzed with the test model to obtain error information corresponding to the log information to be analyzed.
[0094] For a specific description of the prediction device for server log error information, refer to the above-mentioned prediction method for server log error information, which will not be elaborated here.
[0095] Please refer to Figure 3 , this embodiment of the present application also discloses an electronic device, which includes:
[0096] A processor 21;
[0097] A memory 20, which stores executable instructions of the processor 21;
[0098] Wherein, the processor 21 is configured to execute the above-mentioned prediction method for server log error information by executing the executable instructions.
[0099] This embodiment of the present application also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned prediction method for server log error information is implemented.
[0100] This embodiment of the present application also discloses a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the above-mentioned prediction method for server log error information.
[0101] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned method embodiments can be completed by hardware related to computer program instructions. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0102] The above-disclosed are only the preferred examples of the present application and cannot be used to limit the scope of rights of the present application. Therefore, all equivalent changes made according to the claims of the present application fall within the scope covered by the present application.
Claims
1. A method for predicting server log error messages, characterized in that, Including: Loading at least one type of log information, where the log information includes log information of error-free situations and log information of error situations; Establishing a test model based on the log information of error-free situations and the log information of error situations; Obtaining the log information to be analyzed; Analyzing and comparing the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed; The establishing a test model based on the log information of error-free situations and the log information of error situations includes: Obtaining a perfect set based on the log information of error-free situations; Obtaining a defect set based on the log information of error situations; Combining the perfect set and the defect set to form the test model; The method further includes: Loading verification log information, where the verification log information records corresponding reference error information; Analyzing and comparing the verification log information with the test model to obtain the comparison error information of the verification log information; Adjusting the parameters of the test model according to the comparison error information and the reference error information; the error information includes error events, associated events, severity levels, and component information; The associated event refers to other error contents associated with the error event, and the severity level refers to the degree of association between the error event and system failures, which is judged by comparing the occurrence time point of the error event with the occurrence time point of the system failure; The system failures include system crashes and system restarts.
2. The method for predicting server log error information according to claim 1, wherein The obtaining a perfect set based on the log information of error-free situations includes: Archiving each piece of log information of error-free situations to form the perfect set; The obtaining a defect set based on the log information of error situations includes: Extracting corresponding error feature information from each piece of log information of error situations; Forming the defect set according to each piece of error feature information.
3. The method for predicting server log error information according to claim 1 or 2, wherein The analyzing and comparing the log information to be analyzed with the test model respectively to obtain the error information corresponding to the log information to be analyzed includes: Comparing the log information to be analyzed with the perfect set to obtain difference information; Then comparing the difference information with the defect set to determine the error information corresponding to the log information to be analyzed.
4. The prediction method of server log error information according to claim 1, wherein Further including: The log information is divided into different types; Establishing corresponding test models for each type of log information respectively.
5. A prediction device for server log error messages, characterized in that, Including: A loading module, which is used to load at least one type of log information, where the log information includes log information of error-free situations and log information of error situations; A establishing module, which is used to establish a test model based on the log information of error-free situations and the log information of error situations; An obtaining module, which is used to obtain the log information to be analyzed; A parsing module for analyzing and comparing the log information to be analyzed with the test model respectively to obtain error information corresponding to the log information to be analyzed; The establishment of the test model according to the log information in the error-free situation and the log information in the error situation includes: Obtaining a perfect set according to the log information in the error-free situation; Obtaining a defect set according to the log information in the error situation; Combining the perfect set and the defect set to form the test model; The device further includes a module for performing the following operations: Loading verification log information, where the verification log information records corresponding reference error information; Analyzing and comparing the verification log information with the test model to obtain comparison error information of the verification log information; Adjusting parameters of the test model according to the comparison error information and the reference error information; The error information includes error events, associated events, severity levels, and component information; The associated event refers to other error contents associated with the error event, and the severity level refers to the degree of association between the error event and the system failure, which is judged by comparing the time point when the error event occurs with the time point when the system failure occurs; The system failure includes system crashes and system restarts.
6. An electronic device, characterized in that, Comprising: A processor; A memory storing executable instructions of the processor; Wherein, the processor is configured to execute the prediction method of server log error information according to any one of claims 1-4 by executing the executable instructions.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the prediction method of server log error information according to any one of claims 1-4.
Citation Information
Patent Citations
Log content display method and apparatus
CN106980627A
Equipment failure detection method, system and related components
CN109388623A