A problem diagnosis method, device, electronic device and readable storage medium

By parsing error information from the virtual machine log file and matching with historical error cases, the target error case is determined, and the problem that virtualization problems in different resource pools cannot be quickly located and fixed is solved, improving the efficiency of problem location and repair.

CN119782015APending Publication Date: 2025-04-08CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411773025.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In different resource pools of public cloud vendors, due to the large differences in system software version and environment configuration, the same virtualization problems cannot be quickly located and fixed, affecting user business.

Method used

By parsing error information from the virtual machine's log file and converting it to the error information in historical error cases to structured data to match it, the target error case is determined, thereby improving the efficiency of problem location and repair.

Benefits of technology

This method can quickly locate and repair problems in virtual machines, improve the efficiency of operation and maintenance personnel, and reduce the impact on user business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782015A_ABST
    Figure CN119782015A_ABST
Patent Text Reader

Abstract

The present application provides a problem diagnosis method, device, electronic device and readable storage medium, the method comprising: parsing at least one first error message from a log file corresponding to a virtual machine; converting the first error message and the second error message contained in each historical error case into structured data having the same format, to obtain first structured data and second structured data; for each second structured data, matching the second structured data with each first structured data respectively, to obtain a first matching result corresponding to each second structured data; for each historical error case, summarizing the first matching results of each second structured data corresponding to the historical error case, to obtain a second matching result corresponding to the historical error case; determining a target error case according to the second matching results corresponding to each historical error case, thereby improving the efficiency of locating and repairing virtual machine problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a problem diagnosis method, device, electronic device and readable storage medium. Background Art

[0002] To meet the diverse cloud needs of different customers, public cloud vendors usually deploy resource pools in different regions, and optimize product functions and version iterations for different resource pools to provide more secure, stable and efficient cloud host services.

[0003] In the above scenario, due to the large differences in system software versions and environment configurations used in different resource pools, the same virtualization problems will occur in different resource pools. Different resource pools often have different personnel responsible for operation and maintenance, and the skill levels of operation and maintenance personnel vary. As a result, it is impossible to quickly locate and repair common virtualization problems, causing varying degrees of impact on user services. Summary of the invention

[0004] The embodiments of the present application provide a problem diagnosis method, device, electronic device and readable storage medium, which can improve the efficiency of locating and repairing virtual machine problems.

[0005] In a first aspect, an embodiment of the present application discloses a problem diagnosis method, the method comprising:

[0006] Parsing at least one first error message from a log file corresponding to the virtual machine;

[0007] Converting the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information; each historical error case includes at least one second error information;

[0008] For each second structured data, the second structured data is matched with each first structured data respectively to obtain a first matching result corresponding to each second structured data;

[0009] For each historical error case, first matching results of each second structured data corresponding to the historical error case are summarized to obtain a second matching result corresponding to the historical error case;

[0010] A target error case is determined according to the second matching results corresponding to each of the historical error cases.

[0011] Optionally, for each second structured data, matching the second structured data with each first structured data respectively to obtain a first matching result corresponding to each second structured data includes:

[0012] According to the matching mode corresponding to each second structured data, the second structured data is matched with each first structured data respectively to obtain the similarity between the second structured data and the first structured data;

[0013] A first matching result corresponding to the second structured data is determined according to the similarity.

[0014] Optionally, determining a target error case according to the second matching results corresponding to each of the historical error cases includes:

[0015] When the second matching result corresponding to the historical error case meets the first preset condition, determining the historical error case as a first candidate error case;

[0016] In a case where there is only one first candidate error case, taking the first candidate error case as a target error case;

[0017] In the case that there are at least two first candidate error cases, a first candidate error case that meets the second preset condition is used as a target error case.

[0018] Optionally, the second matching result includes a matching score; and determining a target error case according to the second matching results corresponding to each of the historical error cases includes:

[0019] The historical error case whose second matching score is greater than or equal to the first score threshold is determined as a target error case.

[0020] Optionally, for each historical error case, aggregating first matching results of each second structured data corresponding to the historical error case to obtain a second matching result corresponding to the historical error case includes:

[0021] According to the first matching result, determining whether the second structured data matches the first structured data successfully;

[0022] Determine the second structured data that successfully matches the first structured data as the target structured data;

[0023] For each historical error case, counting the number of target structured data included in the historical error case;

[0024] According to the number of the target structured data, a second matching result corresponding to the historical error case is determined.

[0025] Optionally, the method further comprises:

[0026] When the log file does not contain a target error case that meets the first preset condition, a snapshot of the log file, status information and environment configuration corresponding to the virtual machine is saved; the environment configuration includes the first detection result, the second detection result, and the third detection result.

[0027] When the log file does not contain a target error case that meets the first preset condition, the log file, state information, and environment configuration corresponding to the virtual machine are snapshot-saved, including:

[0028] Detecting a virtualization configuration of a host machine where the virtual machine is located, and generating a first detection result;

[0029] Detecting whether there is a conflict between the virtual machine configuration and the host machine configuration, and generating a second detection result;

[0030] Detecting the connectivity of the network during the operation of the virtual machine and generating a third detection result;

[0031] The environment configuration status is obtained according to the first detection result, the second detection result, and the third detection result.

[0032] In a second aspect, an embodiment of the present application discloses a problem diagnosis device, the device comprising:

[0033] A parsing module, used for parsing at least one first error message from a log file corresponding to the virtual machine;

[0034] a conversion module, configured to convert the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information; each historical error case includes at least one second error information;

[0035] A matching module, configured to match each second structured data with each first structured data respectively, to obtain a first matching result corresponding to each second structured data;

[0036] A summarizing module, configured to summarize, for each historical error case, first matching results of each second structured data corresponding to the historical error case to obtain a second matching result corresponding to the historical error case;

[0037] A determination module is used to determine a target error case according to the second matching results corresponding to each of the historical error cases.

[0038] In a third aspect, an embodiment of the present application discloses an electronic device, the electronic device comprising a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, the executable instructions enable the processor to execute the aforementioned problem diagnosis method

[0039] In a fourth aspect, an embodiment of the present application discloses a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the aforementioned problem diagnosis method is implemented.

[0040] The embodiments of the present application include the following advantages:

[0041] The present application provides a problem diagnosis method, device, electronic device and readable storage medium, the method comprising: parsing at least one first error message from a log file corresponding to a virtual machine; converting the first error message and the second error message contained in each historical error case into structured data having the same format, obtaining the first structured data corresponding to the first error message, and the second structured data corresponding to the second error message, so as to improve the efficiency of matching the first structured data with the second structured data. For each second structured data, the second structured data is matched with each first structured data respectively, so as to obtain the first matching result corresponding to each second structured data; for each historical error case, the first matching results corresponding to each second structured data of the historical error case are summarized, so as to obtain the second matching result corresponding to the historical error case; according to the second matching results corresponding to each historical error case, the target error case is determined, so as to improve the efficiency of locating and repairing the virtual machine problem. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0043] Figure 1 is a flowchart of steps of an embodiment of a problem diagnosis method of the present invention;

[0044] Figure 2 is a schematic diagram of a problem diagnosis tool of the present invention;

[0045] Figure 3 is a structural block diagram of a problem diagnosis device of the present invention;

[0046] Figure 4 It is a structural block diagram of an electronic device provided by an example of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0049] Method Embodiment

[0050] Reference Figure 1 , shows a flowchart of a problem diagnosis method embodiment provided by the present application, the method comprising:

[0051] Step S101: parse at least one first error message from a log file corresponding to the virtual machine.

[0052] The problem diagnosis method provided in the present application can be applied to fields that use virtualization technology. Specifically, virtualization technology is one of the core technologies of infrastructure in cloud computing scenarios. Virtualization components are deployed on computing nodes in a resource pool. The operation of virtual machines depends on the services provided by virtualization components. Virtualization problems are common problems of computing nodes in resource pools in cloud computing scenarios. The problem diagnosis method provided in the present application is applied in the field of cloud computing to locate virtualization problems that occur in computing nodes in a resource pool so as to provide corresponding problem solutions. In a test and development environment, virtualization technology can be used to create a test and development environment, providing an isolated and controllable environment. Developers can create multiple virtual machines on the same host machine, each running a different operating system or configuration to meet the needs of different projects. The problem diagnosis method provided in the present application is applied in a test and development environment to locate faults that occur in each virtual machine so as to provide corresponding problem solutions.

[0053] The log files refer to the log files in the process of running the virtual machine, which can include: system logs, virtual machine management logs, application logs, virtualization platform logs, security logs, performance logs, etc. For example: qemu logs, libvirt logs, dmesg logs, var logs, log logs, messages logs, etc.

[0054] It should be noted that when parsing the log files corresponding to the virtual machines, first use a text editor or command line tool to view the log files, and find the log entries related to the problem in each log file; according to the log format, analyze the meaning of each log entry separately, for example, an error message may indicate that a service failed to start normally, and a warning message may indicate a potential resource conflict. In the process of parsing the log files, you can use specialized log analysis tools, such as Splunk, Logstash, ELK Stack, etc. These tools usually provide powerful search, filtering and visualization functions; you can also use custom log parsing and analysis scripts.

[0055] Error information refers to log entries generated by the system or application during the operation of a virtual machine that indicate an abnormality. The content may include: error type, error description, error code, occurrence time, context information, stack trace, and resource usage. The error type can indicate the severity of the error, for example, "Error" represents an error, "Warning" represents a warning, and "Critical" represents a critical error. The error description usually provides basic information about the nature of the error, indicating what went wrong, which helps to initially determine the cause of the error. The error code is a unique identifier. Different error codes correspond to different error types and causes, which can be used to quickly locate the root cause of the problem. The timestamp of the error can associate the operation at the time of the error with the specific operation of the system or application; the log file may contain context information when the error occurred, such as the running status of the virtual machine, the operation being performed, and related system or application logs, which helps to gain a deeper understanding of the background and conditions of the error. The log file will contain the stack trace information of the error. The stack trace is a detailed list of the application execution path, indicating the exact location where the error occurred. The log file may also contain the resource usage of the virtual machine when the error occurred, such as CPU usage, memory usage, disk I / O, etc. This information helps determine whether the error is related to insufficient or overloaded resources.

[0056] It should be noted that the log file may contain multiple error messages, each of which corresponds to a specific exception that occurs during the operation of the virtual machine. For example, the error message is [warning][vmusr:vmusr]Error inthe RPC receive loop:RpcIn:Unable to send, indicating that an error occurred in the remote procedure call (RPC) receive loop, specifically, the RPC message cannot be sent.

[0057] Step S102: convert the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information.

[0058] Each historical error case includes at least one second error message.

[0059] Historical error cases refer to various problems, failures or errors that occurred in the past during the application and deployment of virtualization technology. These problems are caused by configuration errors, performance bottlenecks, security issues, compatibility challenges and other aspects. The historical error cases are saved in the case library, and the case library is expanded by adding, deleting and modifying. The historical error cases in the case library are read in sequence, and the historical error case information is parsed to obtain the error information corresponding to each historical error case. The information corresponding to each historical error case includes not only the error information, but also the solution to the error information corresponding to the historical error case.

[0060] It should be noted that the first error information and the second error information are converted into structured data of the same format so as to match the information at the corresponding positions of the first error information and the second error information. The error information exists in the log file in text form. After the error information is extracted from the log file, the first error information and the second error information can be converted into the following data structures: string, key-value pair, list, object. Exemplarily, the error information can be converted into a key-value pair, where the key represents the attribute of the error information and the value corresponds to the specific content of the attribute, for example: {"error_code":"E0001","error_type":"Fatal","description":"Virtual machine failed to startdue to insufficient memory."}, where the attribute can be an error code, an error type, an error description, etc. The error information can also be converted into a list format, where each element in the list contains an error message, for example: ["E0001:Fatal-Virtual machine failed to start due to insufficient memory.","E0002:Warning-Disk space is running low."].

[0061] Step S103: For each second structured data, match the second structured data with each first structured data respectively to obtain a first matching result corresponding to each second structured data.

[0062] It should be noted that the error information is usually in the form of a string, and the first error information and the second error information may be matched directly, or the first error information and the second error information may be converted into structured data of the same format for matching.

[0063] Each historical error case corresponds to at least one second structured data, and each second structured data is matched in turn with the elements at the corresponding position in all the first structured data corresponding to the virtual machine to obtain the first matching result corresponding to the second structured data. For example, when the structured data is a list, the elements at the corresponding index positions in the two lists are matched; when the structured data is a string, the elements at the corresponding positions of the two strings are matched.

[0064] The first matching result is used to illustrate the matching degree between the first structured data and the second structured data. A higher matching degree indicates that the first structured data and the second structured data are close to each other, and a lower matching degree indicates that the difference between the first structured data and the second structured data is greater.

[0065] Exemplarily, the first structured data corresponding to the virtual machine are: msg1 = "This is a classic message", msg2 = "This is an error message in regular expression", and the second structured data corresponding to the error case A are: msg3 = "This is a classic message", msg4 = "unable tomap backing store for guest RAM: Cannot allocate memory", and msg3 in the error case A is matched with msg1 and msg2 corresponding to the virtual machine in turn, and the first matching result corresponding to msg3 is obtained. The first matching result corresponding to msg3 is completely matched with msg1 and the characters in 7 positions are consistent with those in msg2. The msg4 in the error case A is matched with msg1 and msg2 corresponding to the virtual machine in turn, and the first matching result corresponding to msg4 is obtained. The first matching result corresponding to msg4 does not match msg1 or msg2 at all.

[0066] Step S104: for each historical error case, first matching results of each second structured data corresponding to the historical error case are summarized to obtain a second matching result corresponding to the historical error case.

[0067] A comprehensive analysis is performed on all first matching results corresponding to each historical error case to obtain a second matching result between the abnormal situation corresponding to the historical error case and the abnormal situation corresponding to the virtual machine. The first matching result indicates the matching degree between the second structured data and the first structured data, and the second matching result is used to indicate the matching degree between the abnormal situation occurring in the historical error case and the abnormal situation occurring in the virtual machine as a whole. The higher the matching degree between the second structured data and each first structured data, the more similar the abnormal situation occurring in the historical error case and the abnormal situation corresponding to the virtual machine are.

[0068] Step S105: Determine a target error case according to the second matching results corresponding to each of the historical error cases.

[0069] It should be noted that the abnormal situation corresponding to each historical error case is different, and the degree of similarity between the abnormal situations corresponding to different historical error cases and the abnormal situations corresponding to the virtual machines is also different.

[0070] The historical error case with the highest degree of similarity to the abnormal situation corresponding to the virtual machine is selected from each historical error case and determined as the target error case.

[0071] After determining the target error case, the problem existing in the virtual machine is repaired according to the repair method and solution corresponding to the target error case.

[0072] In an embodiment of the present application, the present application provides a problem diagnosis method, device, electronic device and readable storage medium, the method comprising: parsing at least one first error message from a log file corresponding to a virtual machine; converting the first error message and the second error message contained in each historical error case into structured data having the same format, obtaining the first structured data corresponding to the first error message, and the second structured data corresponding to the second error message, thereby improving the efficiency of matching the first structured data with the second structured data. For each second structured data, the second structured data is matched with each first structured data respectively, and the first matching result corresponding to each second structured data is obtained; for each historical error case, the first matching results corresponding to each second structured data of the historical error case are summarized to obtain the second matching result corresponding to the historical error case; according to the second matching results corresponding to each historical error case, the target error case is determined, thereby improving the efficiency of locating and repairing virtual machine problems.

[0073] Optionally, for each second structured data, matching the second structured data with each first structured data respectively to obtain a first matching result corresponding to each second structured data includes:

[0074] Step 11: Match the second structured data with each first structured data respectively according to the matching mode corresponding to each second structured data, and obtain the similarity between the second structured data and the first structured data;

[0075] Step 12: Determine a first matching result corresponding to the second structured data according to the similarity.

[0076] It should be noted that each second structured data may correspond to the same matching method or a different matching method, and the matching method may include: complete string matching, partial matching, fuzzy matching, hash matching, regular expression matching or a custom matching method.

[0077] Different matching methods correspond to different methods of calculating similarity. The similarity can be quantified by a custom numerical range. For example, the similarity range is 0 to 10. The larger the value, the higher the similarity. 10 means that the second structured data is completely consistent with the first structured data.

[0078] The first matching results include: complete match, partial match, and complete mismatch. In the case where the second structured data and one of the first structured data corresponding to the virtual machine completely match, the first matching result corresponding to the second structured data is determined to be a complete match; in other cases, the similarity is divided into three intervals, and the first matching result corresponding to the second structured data is determined based on the relationship between the similarity and each interval.

[0079] Exemplarily, the first structured data corresponding to the virtual machine are: msg1 = "This is a classic message", msg2 = "This is an error message in regular expression", and the second structured data corresponding to error case A are: msg3 = "This is a classic message", msg4 = "unable tomap backing store for guest RAM: Cannot allocate memory", wherein the matching method corresponding to msg3 is to match the elements at the corresponding positions of the string, count the number of identical characters, and determine the similarity according to the ratio of the number of identical characters to the second structured data. The matching method corresponding to msg4 is partial matching, that is, judging whether msg4 contains msg1 and msg2. If msg4 contains the first structured data, the similarity is 10; if msg4 does not contain the first structured data, the similarity is 0. According to the matching method corresponding to msg3, msg3 in error case A is matched with msg1 and msg2 corresponding to the virtual machine in turn. msg3 is completely consistent with msg1, with a similarity of 10, and has the same characters in 7 positions in msg2, with a similarity of 3; the similarity corresponding to msg3 is 13, and the first matching result corresponding to msg3 is a complete match. According to the partial matching method, msg4 in error case A is matched with msg1 and msg2 corresponding to the virtual machine in turn. msg4 does not contain msg1 and msg2, and the similarity corresponding to msg4 is 0, and the first matching result corresponding to msg4 is a complete mismatch.

[0080] In an embodiment of the present application, the second structured data is matched with each first structured data respectively according to the matching method corresponding to each second structured data to obtain the similarity between the second structured data and the first structured data; based on the similarity, the first matching result corresponding to the second structured data is determined to improve the efficiency of matching the first structured data and the second structured data.

[0081] Optionally, determining a target error case according to the second matching results corresponding to each of the historical error cases includes:

[0082] Step 21: If the second matching result corresponding to the historical error case meets the first preset condition, determine the historical error case as the first candidate error case;

[0083] Step 22: When there is only one first candidate error case, use the first candidate error case as a target error case;

[0084] Step 23: When there are at least two first candidate error cases, a first candidate error case that meets the second preset condition is used as a target error case.

[0085] It should be noted that when there are at least two first candidate error cases, a user selection page is designed, and the target error case is determined by detecting the user's behavior on the page.

[0086] Before designing the user selection page, the following may also be included: classifying the first candidate error cases, and adding keyword tags to each first candidate case. For example, the first candidate cases are classified according to factors such as error type, impact range, and solution difficulty, and the first candidate error cases are divided into major categories such as "network problem", "storage problem", and "performance problem". Keyword tags are added to each first candidate case, such as "virtual machine cannot start", "disk IO is high", "network connection is interrupted", etc., so that users can obtain the corresponding first candidate error case by entering the keyword tag in the input box.

[0087] The user selection page may specifically include the following modules: a preview module, in which when the user moves the mouse over each first candidate error case name, a brief summary is provided next to each case, outlining the problem symptoms, possible causes, and a summary of solutions; and the user clicks on the case title or summary to view more detailed case content, including a complete error description, solution steps, etc.

[0088] The intelligent recommendation module can also include an input box in the user selection page to intelligently recommend the most relevant cases based on the keywords or problem descriptions entered by the user in the search box. The intelligent recommendation algorithm can analyze the cases previously viewed or selected by the user based on user behavior and recommend similar or related first candidate error cases; it can also recommend popular or effective first candidate error cases based on the number of evaluations, likes or comments on the case by other users.

[0089] In the sorting module, the user can also click a filter button in the selection page, which includes multiple filter conditions such as sorting the first error cases by relevance, time, and evaluation level. After the user sets the filter conditions, click the filter button to sort the first candidate error cases.

[0090] Feedback and rating module, receiving feedback from users on the cases they have viewed, such as whether the problem has been solved, the effectiveness of the solution, etc. Rating module: allows users to rate cases to help other users understand the quality and practicality of the cases.

[0091] Visual Comparison Module: Use charts or visualization tools to compare the similarities and differences between different cases, such as error code distribution diagrams, solution step comparison tables, etc. In case preview or detailed view, key differences between different cases are highlighted to help users quickly identify them.

[0092] Help module: add clear guidance text on the interactive page to explain how to use the filtering, sorting and recommendation functions to find the most suitable case. Provide detailed help documents or FAQs to answer questions that users may encounter when using the case library. Online customer service: If possible, provide online customer service support so that users can get help in time when they encounter difficulties.

[0093] Update modules, monitor user usage behavior, and analyze which functions are most popular and which functions need improvement; based on user feedback and monitoring data, continuously optimize the design and functions of interactive pages to improve user experience and satisfaction.

[0094] In an embodiment of the present application, when the second matching result corresponding to the historical error case meets the first preset condition, the historical error case is determined as the first candidate error case; when there is only one first candidate error case, the first candidate error case is used as the target error case; when there are at least two first candidate error cases, the first candidate error case that meets the second preset condition is used as the target error case; by designing an interactive page to allow the user to further select the target error case, the accuracy of determining the target error case is improved.

[0095] Optionally, the second matching result includes a matching score; and determining a target error case according to the second matching results corresponding to each of the historical error cases includes:

[0096] The historical error cases whose matching scores are greater than or equal to the first score threshold are determined as target error cases.

[0097] In the embodiment of the present application, after each second structured data in the historical error case is matched with the first structured data, a corresponding score is obtained; the sum of the scores after each second structured data is matched is determined as the matching score corresponding to the historical error case. The score calculation rules and the score allocation rules corresponding to each second structured data are pre-set by the user. Among them, it is determined based on the degree of influence of the error information corresponding to each second structured data in the error case.

[0098] It should be noted that the full score of the matching score corresponding to each historical error case is the same, and the scores obtained when the same second structured data is completely matched with the first structured data in different historical error cases are different. The matching score is used to describe the similarity between the abnormal situation corresponding to the historical error case and the abnormal situation corresponding to the virtual machine.

[0099] The user pre-sets the first score threshold according to actual needs. The matching scores corresponding to each historical error case are traversed, and each matching score is sorted. The relationship between each matching score and the first score threshold is judged in turn, and the historical error case with a matching score greater than or equal to the first score threshold is determined as the target error case. In the case that there is no historical error case with a matching score greater than or equal to the first score threshold, the log file, status information, and environment configuration corresponding to the virtual machine are snapshotted and saved for analysis by technical personnel.

[0100] Exemplarily, the first score threshold is set to 80, and the second structured data corresponding to error case A are: msg1 = "This is a classic message", msg2 = "unable to map backing store forguest RAM: Cannot allocate memory"; wherein, the corresponding score when msg1 and the first structured data completely match is 20, and the corresponding score when msg2 first structured data completely matches is 80; the second structured data corresponding to error case B are: msg3 = "This is a classic message", msg4 = "qemu-kvm: kvm_init_vcpufailed: Invalid argument"; wherein, the corresponding score when msg3 first structured data completely matches is 30, and the corresponding score when msg4 first structured data completely matches is 70. The first structured data corresponding to the virtual machine are: msg5 = "unable to map backing store for guest RAM: Cannot allocate memory", msg6 = "qemu-kvm: kvm_init_vcpu failed: Invalid argument". After matching the first structured data and the second structured data, the matching score of error case A is 80, and the matching score corresponding to error case B is 70; since the matching score corresponding to error case A is equal to the first score threshold, error case A is determined as the target error case.

[0101] In the embodiment of the present application, historical error cases whose matching scores are greater than or equal to the first score threshold are determined as target error cases, thereby improving the convenience of determining the target error cases.

[0102] Optionally, for each historical error case, aggregating first matching results of each second structured data corresponding to the historical error case to obtain a second matching result corresponding to the historical error case includes:

[0103] Step 31: judging whether the second structured data and the first structured data are matched successfully according to the first matching result;

[0104] Step 32: Determine the second structured data that successfully matches the first structured data as the target structured data;

[0105] Step 33: for each historical error case, count the number of target structured data included in the historical error case;

[0106] Step 34: Determine a second matching result corresponding to the historical error case according to the number of the target structured data.

[0107] It should be noted that the first matching result includes two states, success and failure. The number is pre-divided into three intervals, and the second matching results corresponding to different intervals are respectively high match, general match, and mismatch.

[0108] Exemplarily, the second matching result corresponding to a number greater than or equal to 3 is a high match, the second matching result corresponding to a number greater than or equal to 1 and less than 3 is a general match, and the second matching result corresponding to a number less than 0 is a mismatch. The first structured data corresponding to the virtual machine are: msg1: "This is a classic message", msg2 = "unable to map backing store for guest RAM: Cannot allocate memory", msg3 = "This is an error message in regular expression", msg4 = "qemu-kvm: kvm_init_vcpu failed: Invalid argument". The second structured data included in error case A are: msg5: "This is a classic message", msg6 = "unable to map backing store for guest RAM: Cannot allocate memory", msg7 = "This is an error message in regular expression"; the second structured data included in error case B are: msg8: "This is a classic message", msg9 = "unable to map backing store for guest RAM: Cannot allocate memory", msg10 = "Failed to connect to the API endpoint.". Among them, msg5, msg6, msg7 included in error case A successfully match msg1, msg2, msg3 in the first structured data corresponding to the virtual machine, and the number of target structured data included in error case A is 3. In error case B, msg8, msg9 successfully match msg1, msg2 in the first structured data corresponding to the virtual machine, and the number of target structured data included in error case B is 2. Therefore, the second matching result corresponding to error case A is a high match, and the second matching result corresponding to error case B is a general match.

[0109] In an embodiment of the present application, based on the first matching result, it is determined whether the second structured data and the first structured data are successfully matched; the second structured data that successfully matches the first structured data is determined as the target structured data; for each historical error case, the number of target structured data contained in the historical error case is counted; based on the number of target structured data, the second matching result corresponding to the historical error case is determined, thereby improving the efficiency of determining the matching result corresponding to the historical error case.

[0110] Optionally, the method further comprises:

[0111] When the log file does not contain a target error case that meets the first preset condition, a snapshot of the log file, state information, and environment configuration corresponding to the virtual machine is saved.

[0112] The status information includes memory information, register information, and the current call stack information of the virtual machine process. The current call stack information of the virtual machine process refers to the stack frame sequence and its status of the method call in the current active thread during the execution of the virtual machine. By analyzing the call stack, you can understand how the method is called and executed during the program execution, and in which method the current execution point is located.

[0113] Snapshot preservation refers to the process of making a fully available copy of a specified data set at a specific point in time and saving this copy. The copy includes the image of the data at that point in time and can be regarded as a historical version or state of the data. Snapshot preservation is mainly divided into two types: storage snapshot and search engine snapshot. Storage snapshot refers to the snapshot preservation of data on storage devices, such as hard disks and disk arrays. It allows users to quickly restore to the state when the snapshot is created when the data is damaged or lost. Search engine snapshot refers to the search engine caching web pages and saving them as snapshots in order to improve user experience. The implementation method of snapshot preservation depends on the underlying mechanism of the storage system or file system. Common implementation methods include: Copy-On-Write (COW), when the data is first written to a storage location, the original content is first read out and written to another location, which is the storage space reserved for the snapshot, and then the data is written to the storage device. This method is suitable for scenarios with fewer write operations. Redirect-On-Write (ROW): All new data write operations are directly written to the new location, while the data at the original location remains unchanged. This method is suitable for scenarios with frequent write operations.

[0114] In an embodiment of the present application, when the log file does not contain a target error case that meets the first preset condition, a snapshot of the log file, status information, and environmental configuration corresponding to the virtual machine is saved so that technical personnel can analyze the relevant information and determine the cause of the problem and the repair method.

[0115] Optionally, when the log file does not contain a target error case that meets the first preset condition, the log file, state information, and environment configuration corresponding to the virtual machine are snapshot-saved, including:

[0116] Step 41: Detect the virtualization configuration of the host machine where the virtual machine is located, and generate a first detection result;

[0117] Step 42: Detect whether there is a conflict between the virtual machine configuration and the host machine configuration, and generate a second detection result;

[0118] Step 43: Detect the connectivity of the network during the operation of the virtual machine and generate a third detection result;

[0119] Step 44: Obtain the environment configuration status according to the first detection result, the second detection result, and the third detection result.

[0120] Among them, the host virtualization configuration refers to a series of parameters for setting and running virtualization technology on the host, which may include the following: detecting hardware information, detecting operating system information, detecting network configuration, and detecting virtualization software. Virtual machines usually run on host machines, and the host hardware information may display relevant information about virtualization technology. Use system commands or tools to view the host's CPU model, memory size, hard disk capacity and other hardware information. For example, in the Linux system, you can use the lscpu command to view CPU information, including whether virtualization technology (such as Intel's VT-x or AMD's AMD-V) is supported. Different virtualization platforms have their own operating system versions and features. By checking the operating system version and configuration files of the host, you can determine whether it is running in a virtualized environment. Virtual machines are usually implemented through virtualization software. Check whether virtualization software is installed on the host, such as VMware ESXi, Hyper-V, KVM, etc. In a virtual machine environment, the network configuration may be different from that of a physical machine. Check the host's network interface information, including MAC address, IP address, subnet mask, etc., to determine whether it is running in a virtualized environment. For example, the network traffic of a virtual machine usually passes through a virtual switch or a virtual network adapter.

[0121] Usually, specific detection tools can be used to detect the virtualization configuration of virtual machines and their host machines, such as VMware's vSphere Client and Hyper-V Manager. These detection tools provide a graphical interface for easy viewing and management of the virtualization environment.

[0122] It should be noted that detecting whether there is a conflict between the virtual machine configuration and the host configuration refers to detecting whether there is incompatibility or mutual interference between the virtual machine's operating environment and resource allocation on the host, which specifically includes the following aspects: Checking hardware compatibility. Detecting hardware compatibility includes: detecting the host's CPU, storage space, and hardware driver. Detecting whether the host's CPU supports and enables virtualization technology, detecting whether the host's memory and storage space are sufficient to support the number and configuration of virtual machines planned to run, and detecting the versions of all hardware drivers of the host to avoid problems caused by driver incompatibility. Checking operating system compatibility, detecting whether the host's operating system version is within the range supported by the virtualization software. Different virtualization software has different support ranges for operating systems. Detecting whether the host's operating system and hardware support the virtualization software planned to be used. Checking network configuration, detecting whether the host's network adapter supports the virtualization software, and detecting the consistency of network configuration between the host and virtual machine.

[0123] Testing network connectivity refers to testing the ability of a virtual machine in its operating environment to communicate with the host machine, other virtual machines, devices in the local area network, or the external Internet through the network. In network connectivity, the network includes: management network, computing network, and storage network.

[0124] Detecting network connectivity may include: checking the internal network configuration of the virtual machine, the connectivity between the virtual machine and the host machine, the connectivity between the virtual machine and other devices in the local area network, the connectivity between the virtual machine and the external Internet, network delay and bandwidth testing, and network security testing.

[0125] like Figure 2 As shown, a virtualization problem diagnostic tool is shown, and the diagnostic tool is used to implement the diagnostic method provided by the present application. The diagnostic tool includes: a configuration detection tool, a problem diagnostic tool, and a problem site snapshot tool. The configuration detection tool is used to detect various configurations of the virtual machine and the host machine. The problem diagnostic tool is used to match the error information corresponding to the virtual machine with the error information corresponding to the historical error case. The problem site snapshot tool is used to save the log file, virtual machine status information, environment configuration information and other information of the problem site in a snapshot in the absence of a target error case that meets the first preset condition, for analysis by technical personnel.

[0126] In an embodiment of the present application, the virtualization configuration of the host machine where the virtual machine is located is detected to generate a first detection result; whether there is a conflict between the virtual machine configuration and the host machine configuration is detected to generate a second detection result; the connectivity of the network during the operation of the virtual machine is detected to generate a third detection result; based on the first detection result, the second detection result, and the third detection result, the environmental configuration status is obtained to make the detection of virtual machine problems more comprehensive and improve the accuracy of locating and repairing virtual machine problems.

[0127] Device Embodiment

[0128] Reference Figure 3 , shows a structural block diagram of a problem diagnosis device of the present invention, the device comprising:

[0129] The parsing module 310 is used to parse at least one first error message from the log file corresponding to the virtual machine;

[0130] A conversion module 320, configured to convert the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information; each historical error case includes at least one second error information;

[0131] A matching module 330 is used to match each second structured data with each first structured data respectively, to obtain a first matching result corresponding to each second structured data;

[0132] A summarizing module 340 is used to summarize, for each historical error case, first matching results of each second structured data corresponding to the historical error case to obtain a second matching result corresponding to the historical error case;

[0133] The determination module 350 is configured to determine a target error case according to the second matching results corresponding to each of the historical error cases.

[0134] Optionally, the matching module includes:

[0135] a matching submodule, configured to match the second structured data with each first structured data respectively according to a matching mode corresponding to each second structured data, so as to obtain a similarity between the second structured data and the first structured data;

[0136] The first determination submodule is used to determine a first matching result corresponding to the second structured data according to the similarity.

[0137] Optionally, the determining module includes:

[0138] A second determination submodule, configured to determine the historical error case as a first candidate error case when a second matching result corresponding to the historical error case meets a first preset condition;

[0139] A third determination submodule is used to use the first candidate error case as a target error case when there is only one first candidate error case;

[0140] The fourth determining submodule is configured to, when there are at least two first candidate error cases, use a first candidate error case that meets a second preset condition as a target error case.

[0141] Optionally, the determining module includes:

[0142] The fifth determination submodule is configured to determine a historical error case whose second matching score is greater than or equal to a first score threshold as a target error case.

[0143] Optionally, the summarizing module includes:

[0144] A judging module, configured to judge whether the second structured data matches the first structured data successfully according to the first matching result;

[0145] a target structured data determination module, configured to determine the second structured data successfully matched with the first structured data as the target structured data;

[0146] A statistical module, used for counting the number of target structured data included in each historical error case;

[0147] The sixth determination submodule is used to determine the second matching result corresponding to the historical error case according to the number of the target structured data.

[0148] Optionally, the device further comprises:

[0149] A saving module is used to save a snapshot of the log file, status information and environment configuration status corresponding to the virtual machine when there is no target error case that meets the first preset condition in the log file; the environment configuration status includes the first detection result, the second detection result, and the third detection result.

[0150] Optionally, the storage module includes:

[0151] A first detection module, used to detect the virtualization configuration of the host machine where the virtual machine is located, and generate a first detection result;

[0152] A second detection module, used to detect whether there is a conflict between the virtual machine configuration and the host machine configuration, and generate a second detection result;

[0153] A third detection module, used to detect the connectivity of the network during the operation of the virtual machine and generate a third detection result;

[0154] The seventh determination submodule is used to obtain the environmental configuration status according to the first detection result, the second detection result, and the third detection result.

[0155] In summary, the present application provides a problem diagnosis device that can parse at least one first error message from the log file corresponding to the virtual machine; convert the first error message and the second error message contained in each historical error case into structured data with the same format, obtain the first structured data corresponding to the first error message, and the second structured data corresponding to the second error message, thereby improving the efficiency of matching the first structured data with the second structured data. For each second structured data, the second structured data is matched with each first structured data respectively to obtain the first matching result corresponding to each second structured data; for each historical error case, the first matching results corresponding to each second structured data of the historical error case are summarized to obtain the second matching result corresponding to the historical error case; according to the second matching results corresponding to each historical error case, the target error case is determined, thereby improving the efficiency of locating and repairing virtual machine problems.

[0156] The problem diagnosis device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a GPU BOX, a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0157] The problem diagnosis device provided in the embodiment of the present application can achieve Figure 1To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0158] Alternatively, if Figure 4 As shown, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the various steps of the above-mentioned problem diagnosis method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not repeated here.

[0159] In an embodiment of the present application, the memory may be used to store software programs and various data. The memory may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory may include a volatile memory or a non-volatile memory, or the memory may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0160] The processor may include one or more processing units; optionally, the processor integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor.

[0161] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned problem diagnosis method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0162] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0163] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned problem diagnosis method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0164] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises one..." does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0166] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A problem diagnosis method, characterized in that: The method comprises: Parsing at least one first error message from a log file corresponding to the virtual machine; Converting the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information; each historical error case includes at least one second error information; For each second structured data, the second structured data is matched with each first structured data respectively to obtain a first matching result corresponding to each second structured data; For each historical error case, first matching results of each second structured data corresponding to the historical error case are summarized to obtain a second matching result corresponding to the historical error case; A target error case is determined according to the second matching results corresponding to each of the historical error cases.

2. The method according to claim 1, characterized in that For each second structured data, matching the second structured data with each first structured data respectively to obtain a first matching result corresponding to each second structured data includes: According to the matching mode corresponding to each second structured data, the second structured data is matched with each first structured data respectively to obtain the similarity between the second structured data and the first structured data; A first matching result corresponding to the second structured data is determined according to the similarity.

3. The method according to claim 1, characterized in that The determining the target error case according to the second matching results corresponding to each of the historical error cases includes: When the second matching result corresponding to the historical error case meets the first preset condition, determining the historical error case as a first candidate error case; In a case where there is only one first candidate error case, taking the first candidate error case as a target error case; In the case that there are at least two first candidate error cases, a first candidate error case that meets the second preset condition is used as a target error case.

4. The method according to claim 1, characterized in that: The second matching result includes a matching score; and determining a target error case according to the second matching results corresponding to each of the historical error cases includes: The historical error case whose second matching score is greater than or equal to the first score threshold is determined as a target error case.

5. The method according to claim 1, characterized in that: For each historical error case, the first matching results of each second structured data corresponding to the historical error case are summarized to obtain the second matching result corresponding to the historical error case, including: According to the first matching result, determining whether the second structured data matches the first structured data successfully; Determine the second structured data that successfully matches the first structured data as the target structured data; For each historical error case, counting the number of target structured data included in the historical error case; According to the number of the target structured data, a second matching result corresponding to the historical error case is determined.

6. The method according to claim 3, characterized in that The method further comprises: When the log file does not contain a target error case that meets the first preset condition, a snapshot of the log file, status information and environment configuration corresponding to the virtual machine is saved; the environment configuration includes the first detection result, the second detection result, and the third detection result.

7. The method according to claim 6, characterized in that When the log file does not contain a target error case that meets the first preset condition, the log file, state information, and environment configuration corresponding to the virtual machine are snapshot-saved, including: Detecting a virtualization configuration of a host machine where the virtual machine is located, and generating a first detection result; Detecting whether there is a conflict between the virtual machine configuration and the host machine configuration, and generating a second detection result; Detecting the connectivity of the network during the operation of the virtual machine, and generating a third detection result; The environment configuration status is obtained according to the first detection result, the second detection result, and the third detection result.

8. A problem diagnosis device, characterized in that: The device comprises: A parsing module, used for parsing at least one first error message from a log file corresponding to the virtual machine; a conversion module, configured to convert the first error information and the second error information included in each historical error case into structured data having the same format, to obtain first structured data corresponding to the first error information and second structured data corresponding to the second error information; each historical error case includes at least one second error information; A matching module, configured to match each second structured data with each first structured data respectively, to obtain a first matching result corresponding to each second structured data; A summarizing module, configured to summarize, for each historical error case, first matching results of each second structured data corresponding to the historical error case to obtain a second matching result corresponding to the historical error case; The determination module is used to determine the target error case according to the second matching results corresponding to each of the historical error cases.

9. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the problem diagnosis method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the problem diagnosis method according to any one of claims 1 to 7 is implemented.