Fault processing method, device and equipment
By acquiring key fault information and screenshots, and using mapping relationships or prediction models to determine the fault type and solution, this technology solves the problems of time-consuming and laborious manual analysis and the tendency to miss key information in existing technologies, thus achieving efficient and accurate fault handling.
Patent Information
- Application Number
- CN202511156650.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-11
AI Technical Summary
In existing technologies, analyzing error messages in test results by manually checking logs one by one and comparing them with test cases is time-consuming, labor-intensive, and prone to missing key information, resulting in inaccurate system fault location and inability to accurately handle system faults.
By acquiring key fault information and screenshots from fault handling requests, the fault type is determined using a preset mapping relationship. Fault solutions are then selected from the error data knowledge base or obtained through a fault solution prediction model, and processing is performed on known or unknown fault types.
It improves the accuracy and efficiency of fault handling, ensuring that matching solutions can be obtained for both known and unknown fault types, and reducing the time and error of manual intervention.
Smart Images

Figure CN120929294A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing, and more particularly to a fault handling method, apparatus, and device. Background Technology
[0002] By using test cases to test the system, corresponding test results can be obtained. When abnormal test results occur, the system fault can be located by analyzing the error information of the test results, thereby generating a solution for the system fault.
[0003] Currently, related technologies mainly rely on manual methods to check logs one by one and compare them with test cases to analyze error information in test results. However, manual methods are time-consuming and laborious, and key information is easily missed, which can lead to inaccurate problem localization and thus fail to obtain accurate solutions, and consequently fail to accurately handle system failures. Summary of the Invention
[0004] This application provides a fault handling method, apparatus, and device that can improve the testing accuracy of test cases.
[0005] In a first aspect, embodiments of this application provide a fault handling method applied to a server, comprising:
[0006] Obtain a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault to be handled.
[0007] Based on the preset mapping relationship between key fault information and fault type, the target fault type corresponding to the target key fault information is determined;
[0008] If the target fault type is a known fault type, then the historical error data stored in the preset error data knowledge base is filtered according to the target fault type and the target fault screenshot to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution;
[0009] The historical fault solutions corresponding to the target historical error data are determined as the target fault solutions;
[0010] If the target fault type is an unknown fault type, then the target fault solution is determined based on the key information of the target fault and the screenshot of the target fault.
[0011] The target fault solution is used to handle the faults to be processed in the target system.
[0012] In one possible implementation, the historical error data also includes the corresponding historical fault types and historical fault screenshots;
[0013] Accordingly, the step of filtering historical error data stored in a preset error data knowledge base based on the target fault type and the target fault screenshot to determine at least one target historical error data includes:
[0014] Each historical error data stored in the preset error data knowledge base is filtered using the target fault type as the filtering condition to obtain the first historical error data whose corresponding historical fault type is the target fault type;
[0015] Determine the first matching degree between the target fault screenshot and the corresponding historical fault screenshot in each first historical error data;
[0016] The first historical error data whose first matching degree meets the first preset condition is determined as the target historical error data.
[0017] In one possible implementation, the historical error data also includes corresponding key information about historical faults;
[0018] Accordingly, if the target fault type is an unknown fault type, then determining the target fault solution based on the key information of the target fault and the target fault screenshot includes:
[0019] Determine the second degree of matching between the target fault key information and the corresponding historical fault key information in each historical error data stored in the preset error data knowledge base;
[0020] Determine the third matching degree between the target fault screenshot and the corresponding historical fault screenshot in each historical error data stored in the preset error data knowledge base;
[0021] Determine the first weight corresponding to the second matching degree, and the second weight of the third matching degree;
[0022] The second matching degree and the third matching degree are weighted by the first weight and the second weight to obtain the result matching degree between the fault to be processed and each historical error data.
[0023] The historical error data whose result matching degree meets the second preset condition is determined as the target historical error data;
[0024] The historical fault solutions corresponding to the target historical error data are determined as the target fault solutions.
[0025] In one possible implementation, if the target fault type is an unknown fault type, determining the target fault solution based on the key information of the target fault and the target fault screenshot includes:
[0026] The target fault key information and target fault screenshot are input into the trained fault solution prediction model, so that the fault solution prediction model can make intelligent predictions based on the target fault key information and target fault screenshot to obtain the target fault solution. The trained fault solution prediction model is trained based on each historical error data stored in the error data knowledge base.
[0027] In one possible implementation, processing the unresolved fault of the target system using the target fault solution includes:
[0028] If the fault to be processed is an environmental fault, then an alarm message is sent to the preset operation and maintenance system so that the operation and maintenance system can process the fault to be processed.
[0029] If the fault to be processed is a script-based fault, then the fault script and the fault code field in the fault script are determined, and the fault code field in the fault script is corrected.
[0030] In one possible implementation, the correction of the fault code field in the fault script includes:
[0031] Based on the target fault solution, extract the target template corresponding to the target fault solution from the preset repair template library, and automatically generate code patch using the target template;
[0032] The fault code field in the fault script is corrected by the code patch.
[0033] In one possible implementation, the correction of the fault code field in the fault script includes:
[0034] Determine the expected logical information corresponding to the fault code field;
[0035] The target fault key information, fault code field and expected logic information are input into the trained code generation model so that the code generation model generates and outputs at least one code correction scheme. The trained code generation model is obtained by acquiring historical script repair cases and training with the historical script repair cases.
[0036] The at least one code correction scheme is sent to the client so that staff can select or modify the at least one code correction scheme to generate a target code correction scheme;
[0037] Receive the target code correction scheme sent by the client;
[0038] The fault code field in the fault script is corrected using the target code correction scheme.
[0039] In one possible implementation, after processing the unresolved fault of the target system using the target fault solution, the method further includes:
[0040] Determine whether the target fault solution has successfully repaired the fault to be processed;
[0041] If the target fault solution has successfully repaired the fault to be processed, then the target fault type, key information of the target fault, screenshot of the target fault, and the target fault solution are constructed as the error data corresponding to the fault to be processed.
[0042] If the target fault solution fails to fix the fault to be processed, the key information of the target fault and the target fault screenshot of the fault to be processed will be sent to the client so that the staff can generate a manual fault solution corresponding to the fault to be processed based on the key information of the target fault and the target fault screenshot of the fault to be processed.
[0043] Obtain the manual fault solution corresponding to the fault to be processed sent by the client;
[0044] The target fault type, key information of the target fault, screenshot of the target fault, and the manual fault solution are used to construct the error data corresponding to the fault to be processed.
[0045] The error data corresponding to the fault to be processed is stored in the error data knowledge base.
[0046] Secondly, this application provides a fault handling device applied to a server, comprising:
[0047] The acquisition module is used to acquire a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault to be handled.
[0048] The processing module is used to determine the target fault type corresponding to the target fault key information based on a preset mapping relationship between the fault key information and the fault type.
[0049] The processing module is further configured to, if the target fault type is a known fault type, filter the historical error data stored in the preset error data knowledge base according to the target fault type and the target fault screenshot, so as to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution;
[0050] The processing module is also used to determine the historical fault solutions corresponding to the target historical error data as the target fault solutions;
[0051] The processing module is also used to determine a target fault solution based on the key information of the target fault and the screenshot of the target fault if the target fault type is an unknown fault type;
[0052] The processing module is also used to process the unprocessed faults of the target system through the target fault solution.
[0053] Thirdly, this application provides a computer device, including: a memory and a processor;
[0054] The memory stores computer-executed instructions;
[0055] The processor executes computer execution instructions stored in the memory, causing the processor to perform the method described above.
[0056] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described above.
[0057] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described above.
[0058] The fault handling method, apparatus, and device provided in this application embodiment, for a fault of known fault type, filters at least one target historical error data from an error data knowledge base by using the known fault type and the target fault screenshot corresponding to the fault to be handled. Then, the historical fault solution corresponding to the target historical error data is determined as the target fault solution. For a fault of unknown fault type, the target fault solution is determined by the target fault key information and the target fault screenshot corresponding to the fault to be handled. Then, the fault to be handled is processed using the target fault solution. Based on the method provided in this application embodiment, a target fault solution for the fault to be handled can be obtained by using the fault type, target fault screenshot, or target fault key information of the fault to be handled. A target fault solution matching the fault to be handled can be obtained. Using the target fault solution matching the fault to be handled can improve the accuracy of the fault handling. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0060] Figure 1 This application provides a schematic diagram of the scenario.
[0061] Figure 2 Flowchart of the fault handling method provided in this application Figure 1 ;
[0062] Figure 3 Flowchart of the fault handling method provided in this application Figure 2 ;
[0063] Figure 4 Flowchart of the fault handling method provided in this application Figure 3 ;
[0064] Figure 5 A schematic diagram illustrating the process of determining a target fault solution;
[0065] Figure 6 Flowchart of the fault handling method provided in this application Figure 4 ;
[0066] Figure 7 Flowchart of the fault handling method provided in this application Figure 5 ;
[0067] Figure 8 Flowchart of the fault handling method provided in this application Figure 6 ;
[0068] Figure 9 Flowchart of the fault handling method provided in this application Figure 7 ;
[0069] Figure 10 This is a schematic diagram illustrating the processing flow of a fault to be processed, as an example.
[0070] Figure 11 A schematic diagram of the fault handling device provided in this application;
[0071] Figure 12 A schematic diagram of the structure of the electronic device provided in this application.
[0072] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0073] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0074] By using test cases to test the system, corresponding test results can be obtained. When abnormal test results occur, the system fault can be located by analyzing the error information of the test results, thereby generating a solution for the system fault.
[0075] Currently, related technologies mainly rely on manual methods to check logs one by one and compare them with test cases to analyze error information in test results. However, manual methods are time-consuming and laborious, and key information is easily missed, which can lead to inaccurate problem localization and thus fail to obtain accurate solutions, and consequently fail to accurately handle system failures.
[0076] Figure 1 The scenario diagram provided for this application is as follows: Figure 1 As shown in the embodiment of this application, in the fault handling method, the server can obtain a fault handling request for the target system from the terminal. For a fault of known type to be handled, the server filters at least one target historical error data from the error data knowledge base by using the known fault type and the target fault screenshot corresponding to the fault to be handled. Then, the historical fault solution corresponding to the target historical error data is determined as the target fault solution. For a fault of unknown type to be handled, the server determines the target fault solution by using the target fault key information and the target fault screenshot corresponding to the fault to be handled. Then, the fault to be handled is handled using the target fault solution. Based on the fault handling method provided in this embodiment of the application, the server can obtain a target fault solution for the fault to be handled by using the fault type, target fault screenshot, or target fault key information. A target fault solution matching the fault to be handled can be obtained. Using the target fault solution matching the fault to be handled can improve the accuracy of handling the fault.
[0077] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0078] Figure 2 Flowchart of the fault handling method provided in this application Figure 1 The method is applied to the server, such as Figure 2 As shown, it includes:
[0079] S201. Obtain a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault.
[0080] Combined with scenario examples, Figure 1 The executing entity of this application can be a server. Fault handling requests can be generated by staff through client operations, and the server receives the fault handling request for the target system through communication with the client. Key fault information can include the fault name, error code, error label, or error time, etc. Therefore, the key fault information for the fault to be handled mainly includes the corresponding target error name, target error code, target error label, or target error time. Fault screenshots can be screenshots of the content displayed on the terminal display interface; therefore, the target fault screenshot is a screenshot of the content displayed on the terminal display interface for the fault to be handled.
[0081] S202: Determine the target fault type corresponding to the target fault key information based on the preset mapping relationship between the fault key information and the fault type.
[0082] By analyzing scenario examples, the fault type can be determined by examining information such as the fault name, error code, error label, or error time in the critical fault information. For instance, if the target critical fault information is "No Such ElementException," and "No Such Element Exception" is a common exception in automated testing, usually triggered by a missing page element or an incorrect location method, then the corresponding target fault type can be determined to be a display error.
[0083] S203: If the target fault type is a known fault type, then the historical error data stored in the preset error data knowledge base is filtered according to the target fault type and the target fault screenshot to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution.
[0084] Based on a scenario example, the error data knowledge base includes historical error data about various faults that have occurred in the target system. This historical error data is annotated manually with error types, causes, and solutions. The server then stores this historical error data in the error data knowledge base, constructing it into a pre-defined data structure. Optionally, the structure of the historical error data is: Historical Fault Type - Historical Fault Screenshot - Historical Fault Cause - Historical Fault Solution - Historical Fault Key Information. For example, if the historical fault key information is "No Such Element Exception" as mentioned above, and the historical fault type is determined to be "Display Error," the server, by analyzing the manually annotated error causes and solutions, obtains the corresponding historical fault cause as "The page has not fully loaded or the element was dynamically generated by JavaScript, but the element has not finished rendering when the code is executed," and the historical fault solution as "Use Web Driver Wait to wait for the element to load and for the page to load." The resulting historical error data structure would be: Display Error - Historical Fault Screenshot - Page Not Fully Loaded or Element Dynamically Generated by JavaScript, but Element Has Not Finished Rendering When the Code is Executed - Use Web Driver Wait to Wait for the Element to Load and for the Page to Load - No Such Element Exception.
[0085] The known fault types are historical fault types that already exist in the historical fault data stored in the fault data knowledge base. Therefore, for faults with known fault types to be processed, the historical fault data stored in the fault data knowledge base can be fully filtered by the target fault type and target fault screenshot corresponding to the fault to be processed, so as to obtain the target historical fault data corresponding to the historical fault type and historical fault screenshot, and the target fault type and target fault screenshot.
[0086] S204: Determine the historical fault solutions corresponding to the target historical error data as the target fault solutions.
[0087] Based on the scenario example, since the target historical error data includes the corresponding historical fault solutions, the historical fault solutions in the target historical error data can be identified as the target fault solutions for the fault to be processed.
[0088] S205: If the target fault type is an unknown fault type, then determine the target fault solution based on the key information of the target fault and the screenshot of the target fault.
[0089] Based on the scenario example, the unknown fault type is a historical fault type that does not exist in the error data knowledge base. For the location fault type of pending fault, the server can determine the target fault solution for the pending fault through the target fault key information and the target fault screenshot.
[0090] S206: The unresolved faults of the target system are handled using the target fault solution.
[0091] Based on the scenario example, after the server obtains the target solution for the pending fault, it can process the pending fault according to the method in the target solution to resolve the pending fault in the target system.
[0092] Based on the fault handling method provided in this example, the server can obtain a target fault solution for the fault to be handled by the fault type, target fault screenshot, or target fault key information. A target fault solution that matches the fault to be handled can be obtained. Using the target fault solution that matches the fault to be handled can improve the accuracy of the fault handling.
[0093] Optionally, the historical error data may also include the corresponding historical fault types and historical fault screenshots;
[0094] Accordingly, Figure 3 Flowchart of the fault handling method provided in this application Figure 2 ,like Figure 3 As shown, in S203, historical error data stored in a preset error data knowledge base is filtered according to the target fault type and the target fault screenshot to determine at least one target historical error data, including:
[0095] S301: Filter each historical error data stored in the preset error data knowledge base using the target fault type as the filtering condition to obtain the first historical error data whose corresponding historical fault type is the target fault type.
[0096] Based on the scenario example, as can be seen from the above content, the structure of the historical error data stored in the error data knowledge base is as follows: historical fault type - historical fault screenshot - historical fault cause - historical fault solution - historical fault key information. For a fault to be processed with a known fault type, the historical error data stored in the error data knowledge base is comprehensively filtered using the target fault type of the fault to be processed as the filtering condition, so as to obtain the first historical error data with the same historical fault type and target fault type.
[0097] S302: Determine the first matching degree between the target fault screenshot and the corresponding historical fault screenshot in each first historical error data.
[0098] Based on the scenario example, after obtaining the first historical error data through filtering conditions, the first matching degree between the target fault screenshot and the historical fault screenshot in each first historical error data can be analyzed by image and text recognition technology. The image and text recognition technology can be selected as Optical Character Recognition (OCR).
[0099] S303: The first historical error data whose first matching degree meets the first preset condition is determined as the target historical error data.
[0100] Based on scenario examples, the first matching degree between the obtained target fault screenshot and the historical fault screenshots in each first historical error data set can be sorted from largest to smallest. The first preset condition can be set to determine the first historical error data corresponding to the first matching degree that satisfies the preset order as the target historical error data. For example, the first historical error data corresponding to the top five first matching degrees can be determined as the target historical error data.
[0101] Based on the method provided in this example, for faults of known fault types to be processed, a secondary filtering can be performed using the target fault type and the target fault screenshot to ensure the accuracy of the obtained target historical error data, thereby ensuring the accuracy of the obtained target fault solution.
[0102] Optionally, the historical error data may also include corresponding key information about historical faults;
[0103] Accordingly, Figure 4 Flowchart of the fault handling method provided in this application Figure 3 ,like Figure 4 As shown, S205 includes:
[0104] S401: Determine the second matching degree between the target fault key information and the corresponding historical fault key information in each historical error data stored in the preset error data knowledge base.
[0105] Based on the scenario example, as can be seen from the above content, the structure of the historical error data stored in the error data knowledge base includes historical fault key data. Therefore, for the unprocessed fault of unknown fault type, on the one hand, the second matching degree between the target fault key information and the corresponding historical fault key information in each historical error data can be obtained by comparing the similarity between the target fault key information of the unprocessed fault and the historical fault key information in each historical error data in the error data knowledge base.
[0106] S402: Determine the third matching degree between the target fault screenshot and the corresponding historical fault screenshot in each historical error data stored in the preset error data knowledge base.
[0107] In conjunction with scenario examples, on the other hand, a third degree of matching is obtained through OCR between the target fault screenshot and the corresponding historical fault screenshots in each historical error data.
[0108] S403: Determine the first weight corresponding to the second matching degree and the second weight of the third matching degree.
[0109] Based on the scenario examples, the first and second weights can be determined according to the actual situation.
[0110] S404: The second matching degree and the third matching degree are weighted by the first weight and the second weight to obtain the result matching degree between the fault to be processed and each historical error data.
[0111] Based on the scenario example, for each historical error data, the first weight and the corresponding second matching degree are multiplied to obtain the corresponding first product, and the second weight and the corresponding third matching degree are multiplied to obtain the corresponding second product. The first product and the second product corresponding to each historical error data are added together to obtain the final result matching degree between each historical error data and the fault to be processed.
[0112] S405: The historical error data whose result matching degree meets the second preset condition is determined as the target historical error data.
[0113] Similarly, using a scenario example, the matching degree of each historical error data point can be sorted from largest to smallest. The second preset condition can be set as identifying the historical error data points whose matching degrees satisfy a preset order as the target historical error data. For example, the historical error data points corresponding to the top five matching degrees can be identified as the target historical error data.
[0114] S406: Determine the historical fault solutions corresponding to the target historical error data as the target fault solutions.
[0115] Based on scenario examples, after obtaining the target historical error data, the corresponding historical fault solutions in the target historical error data are identified as the target fault solutions for resolving the fault to be processed.
[0116] Based on the method provided in this example, for unprocessed faults of unknown target fault types, historical error data is filtered according to the target fault screenshot and key information of the target fault, and the target historical error data with the highest matching degree is obtained by weighted calculation. This can ensure the accuracy of the obtained target historical error data, and thus ensure the accuracy of the obtained target fault solution.
[0117] Optionally, S205 includes:
[0118] The target fault key information and target fault screenshot are input into the trained fault solution prediction model, so that the fault solution prediction model can make intelligent predictions based on the target fault key information and target fault screenshot to obtain the target fault solution. The trained fault solution prediction model is trained based on each historical error data stored in the error data knowledge base.
[0119] Combined with scenario examples, Figure 5 The diagram illustrates the process of determining a target fault solution. After receiving a fault handling request for a fault to be handled, if the target fault type is known, the historical error data stored in the error data knowledge base is filtered by the target fault type to obtain the first historical error data. Then, the target historical error data is obtained by matching the target fault screenshot with the historical fault screenshot of each first historical error data, thus obtaining the target fault solution for resolving the fault to be handled.
[0120] If the target fault type is unknown, one approach is to perform a global match between the target fault key information and the target fault screenshot and the historical error data in the error data knowledge base to obtain the result matching degree corresponding to each historical error data. This will help determine the target historical error data and thus obtain the target fault solution for resolving the fault to be processed.
[0121] Another approach is to use a trained fault solution prediction model for prediction. The key information of the target fault and the screenshot of the target fault can be input into the trained fault solution prediction model. The fault solution prediction model makes intelligent predictions based on the key information of the target fault and the screenshot of the target fault, and then outputs the target fault solution for the fault.
[0122] Based on the method provided in this example, for unprocessed faults of unknown target fault types, a fault solution prediction model is used to make intelligent predictions based on the key information of the target fault and the target fault screenshot. This can ensure the accuracy of the obtained target historical error data, and thus ensure the accuracy of the obtained target fault solution.
[0123] Optional, Figure 6 Flowchart of the fault handling method provided in this application Figure 4 ,like Figure 6 As shown, S206 includes:
[0124] S601: If the fault to be processed is an environmental fault, then send an alarm message to the preset operation and maintenance system so that the operation and maintenance system can process the fault to be processed.
[0125] Based on scenario examples, environmental faults include network timeouts, server response delays, database connection failures, etc. By parsing the target fault solution corresponding to the fault to be processed, if the target fault solution includes keywords such as "adjust environment configuration" or "restart service", the fault to be processed can be determined to be an environmental fault. For this type of fault to be processed, which does not involve script defects, an environmental alarm can be directly triggered, such as sending an alarm message to a preset operation and maintenance system so that the operation and maintenance system can handle the fault to be processed.
[0126] S602: If the fault to be processed is a script-type fault, then determine the fault script and the fault code field in the fault script, and correct the fault code field in the fault script.
[0127] Based on scenario examples, if the target fault solution is directly related to script code modifications—for instance, if the target fault solution includes "replace the location expression," the fault to be addressed is element location failure; if the target fault solution includes "correct branch judgment," the fault to be addressed is a logical error; if the target fault solution includes "adjust input data format," the fault to be addressed is parameter anomaly—then, for script-related faults, a combination of static analysis and dynamic tracing is used to locate the script file path, specific line number, and associated test cases corresponding to the faulty script. This determines the code segment that needs to be modified. Static analysis can be performed using commonly used static code analysis tools. Based on the script file path and specific line number, the functions, variables, or statement blocks associated with the error are located. Combined with the dynamic logs during automated test execution, the direct correlation between the code segment to be modified and the fault to be addressed is confirmed, irrelevant code interference is eliminated, and the fault code fields in the faulty script are corrected.
[0128] Based on the method provided in this example, it is possible to resolve different types of faults by using different target fault solutions.
[0129] Optional, Figure 7 Flowchart of the fault handling method provided in this application Figure 5 ,like Figure 7 As shown, in S602, the fault code field in the fault script is corrected, including:
[0130] S701: Based on the target fault solution, extract the target template corresponding to the target fault solution from the preset repair template library, and automatically generate a code patch using the target template.
[0131] Table 1
[0132]
[0133] Based on the scenario examples, Table 1 shows the repair templates corresponding to the faults to be processed in the examples. As shown in Table 1, for script faults where element location fails, the corresponding target template is to automatically generate new location expressions. For example, the invalid XPath can be replaced with a more stable selector, or a new locator can be generated based on the element attributes recognized by screenshot OCR. For script faults where the wait times out, the corresponding target template is to insert explicit wait code. For parameter format errors, the data formatting tool is called to correct the input parameter format to adapt to the requirements of the target system.
[0134] S702: Correct the fault code field in the fault script using the code patch.
[0135] By combining scenario examples and obtaining code patches from the target templates corresponding to different script faults, the fault code fields are corrected to achieve the purpose of handling script faults.
[0136] Optional, Figure 8 Flowchart of the fault handling method provided in this application Figure 6 ,like Figure 8 As shown, in S602, the fault code field in the fault script is corrected, including:
[0137] S801: Determine the expected logical information corresponding to the fault code field.
[0138] In conjunction with scenario examples, for fault scripts dealing with complex issues such as multi-step process errors, the expected logical information corresponding to the fault code field can be determined in advance.
[0139] S802: Input the target fault key information, fault code field and expected logic information into the trained code generation model so that the code generation model generates and outputs at least one code correction scheme, wherein the trained code generation model is obtained by acquiring historical script repair cases and training with the historical script repair cases.
[0140] With specific examples, the code generation model can serve as a code completion tool for artificial intelligence, such as the Generative Pre-training Transformer-4 (GPT-4). The number of output code correction schemes can be determined based on the actual situation; for example, three code correction schemes can be output.
[0141] S803: Send the at least one code correction scheme to the client so that staff can select or modify the at least one code correction scheme to generate a target code correction scheme.
[0142] Using scenario examples, the code correction plan is sent to the client and displayed to staff through a visual interface. Staff can choose the most suitable one from three code correction plans and mark the modification points on the selected code correction plan, such as highlighting the added or deleted lines of code and explaining the correction logic, thus obtaining the target code correction plan after manual modification.
[0143] S804: Receive the target code correction scheme sent by the client.
[0144] With a scenario example, the server receives the target code correction plan sent by the client through the communication connection between the server and the client.
[0145] S805: Correct the fault code field in the fault script using the target code correction scheme.
[0146] Based on the scenario example, the server finally corrects the fault code field in the fault script according to the target code correction scheme.
[0147] Based on the method provided in this example, the accuracy of the obtained target code correction scheme can be improved by combining it with human intervention, thereby improving the accuracy of the fault correction script.
[0148] Optional, Figure 9 Flowchart of the fault handling method provided in this application Figure 7 ,like Figure 9 As shown, following S206, it also includes:
[0149] S901: Determine whether the target fault solution has successfully repaired the fault to be processed.
[0150] Combined with scenario examples, Figure 10 This is a schematic diagram illustrating the processing flow of a fault to be processed, as shown in the example. Figure 10As shown, the corresponding target fault solutions are used to process the fault in descending order of matching degree. After all the target fault solutions have been used to process the fault, it is determined whether the fault has been successfully resolved.
[0151] S902: If the target fault solution has successfully repaired the fault to be processed, then the target fault type, target fault key information, target fault screenshot and the target fault solution are constructed as the error data corresponding to the fault to be processed.
[0152] Combined with scenario examples, Figure 10 If the pending fault has been successfully resolved, the target fault type, key information of the target fault, screenshot of the target fault, and target fault solution used to resolve the pending fault are constructed as the error data corresponding to the pending fault.
[0153] S903: If the target fault solution fails to repair the fault to be processed, the key information of the target fault and the target fault screenshot of the fault to be processed are sent to the client so that the staff can generate a manual fault solution corresponding to the fault to be processed based on the key information of the target fault and the target fault screenshot of the fault to be processed.
[0154] Combined with scenario examples, Figure 10 If the fault to be processed is not successfully resolved, the key information of the target fault and the screenshot of the target fault will be sent to the client and displayed to the staff through a visual interface. The staff can then manually process the fault based on the key information of the target fault and the screenshot of the target fault to obtain the corresponding manual fault solution.
[0155] S904: Obtain the manual fault solution corresponding to the fault to be processed sent by the client.
[0156] With a scenario example, the server receives manual troubleshooting solutions sent by the client through a communication connection with the client.
[0157] S905: Construct the target fault type, key information of the target fault, screenshot of the target fault, and the manual fault solution into the error reporting data corresponding to the fault to be processed.
[0158] Combined with scenario examples, Figure 10 If the fault to be processed is successfully resolved through manual fault solution, the target fault type, key information of the target fault, screenshot of the target fault, and manual fault solution corresponding to the fault to be processed are constructed into the error data corresponding to the fault to be processed.
[0159] S906: Store the error data corresponding to the fault to be processed in the error data knowledge base.
[0160] Based on scenario examples, the error data corresponding to the fault to be processed is updated to the error data knowledge base to supplement the historical error data in the error data knowledge base, thereby improving the comprehensiveness of the historical error data in the error data knowledge base and improving the correctness of the target fault solution obtained through the error data knowledge base in the future.
[0161] Based on the method provided in the embodiments of this application, a target fault solution for the fault to be processed can be obtained by using the fault type, target fault screenshot or target fault key information of the fault to be processed. A target fault solution matching the fault to be processed can be obtained. Using the target fault solution matching the fault to be processed to process the fault can improve the accuracy of processing the fault to be processed.
[0162] Figure 11 A schematic diagram of the fault handling device provided in this application is shown below. Figure 11 As shown, it is applied to the server and includes:
[0163] The acquisition module 111 is used to acquire a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault.
[0164] Processing module 112 is used to determine the target fault type corresponding to the target fault key information based on a preset mapping relationship between the fault key information and the fault type;
[0165] The processing module 112 is further configured to, if the target fault type is a known fault type, filter the historical error data stored in the preset error data knowledge base according to the target fault type and the target fault screenshot, so as to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution;
[0166] The processing module 112 is further configured to determine the historical fault solutions corresponding to the target historical error data as the target fault solutions;
[0167] The processing module 112 is further configured to determine a target fault solution based on the key information of the target fault and the screenshot of the target fault if the target fault type is an unknown fault type;
[0168] The processing module 112 is also used to process the unprocessed fault of the target system through the target fault solution.
[0169] The fault handling device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0170] Figure 12 A schematic diagram of the structure of the electronic device provided in this application. Figure 12 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the electronic device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus.
[0171] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0172] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0173] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0174] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0175] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0176] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0177] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0178] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0179] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0180] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0181] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0182] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0183] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0184] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0185] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A fault handling method, characterized in that, Applied to servers, including: Obtain a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault to be handled. Based on the preset mapping relationship between key fault information and fault type, the target fault type corresponding to the target key fault information is determined; If the target fault type is a known fault type, then the historical error data stored in the preset error data knowledge base is filtered according to the target fault type and the target fault screenshot to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution; The historical fault solutions corresponding to the target historical error data are determined as the target fault solutions; If the target fault type is an unknown fault type, then the target fault solution is determined based on the key information of the target fault and the screenshot of the target fault. The target fault solution is used to handle the faults to be processed in the target system.
2. The method according to claim 1, characterized in that, The historical error data also includes the corresponding historical fault types and screenshots of historical faults. Accordingly, the step of filtering historical error data stored in a preset error data knowledge base based on the target fault type and the target fault screenshot to determine at least one target historical error data includes: Each historical error data stored in the preset error data knowledge base is filtered using the target fault type as the filtering condition to obtain the first historical error data whose corresponding historical fault type is the target fault type; Determine the first matching degree between the target fault screenshot and the corresponding historical fault screenshot in each first historical error data; The first historical error data whose first matching degree meets the first preset condition is determined as the target historical error data.
3. The method according to claim 1, characterized in that, The historical error data also includes corresponding key information about historical faults; Accordingly, if the target fault type is an unknown fault type, then determining the target fault solution based on the key information of the target fault and the target fault screenshot includes: Determine the second degree of matching between the target fault key information and the corresponding historical fault key information in each historical error data stored in the preset error data knowledge base; Determine the third matching degree between the target fault screenshot and the corresponding historical fault screenshot in each historical error data stored in the preset error data knowledge base; Determine the first weight corresponding to the second matching degree, and the second weight of the third matching degree; The second matching degree and the third matching degree are weighted by the first weight and the second weight to obtain the result matching degree between the fault to be processed and each historical error data. The historical error data whose result matching degree meets the second preset condition is determined as the target historical error data; The historical fault solutions corresponding to the target historical error data are determined as the target fault solutions.
4. The method according to claim 1, characterized in that, If the target fault type is an unknown fault type, then the target fault solution is determined based on the key information of the target fault and the target fault screenshot, including: The target fault key information and target fault screenshot are input into the trained fault solution prediction model, so that the fault solution prediction model can make intelligent predictions based on the target fault key information and target fault screenshot to obtain the target fault solution. The trained fault solution prediction model is trained based on each historical error data stored in the error data knowledge base.
5. The method according to claim 1, characterized in that, The process of handling the unresolved faults of the target system using the target fault solution includes: If the fault to be processed is an environmental fault, then an alarm message is sent to the preset operation and maintenance system so that the operation and maintenance system can process the fault to be processed. If the fault to be processed is a script-based fault, then the fault script and the fault code field in the fault script are determined, and the fault code field in the fault script is corrected.
6. The method according to claim 5, characterized in that, The correction of the fault code field in the fault script includes: Based on the target fault solution, extract the target template corresponding to the target fault solution from the preset repair template library, and automatically generate code patch using the target template; The fault code field in the fault script is corrected by the code patch.
7. The method according to claim 5, characterized in that, The correction of the fault code field in the fault script includes: Determine the expected logical information corresponding to the fault code field; The target fault key information, fault code field and expected logic information are input into the trained code generation model so that the code generation model generates and outputs at least one code correction scheme. The trained code generation model is obtained by acquiring historical script repair cases and training with the historical script repair cases. The at least one code correction scheme is sent to the client so that staff can select or modify the at least one code correction scheme to generate a target code correction scheme; Receive the target code correction scheme sent by the client; The fault code field in the fault script is corrected using the target code correction scheme.
8. The method according to claim 1, characterized in that, After processing the unresolved fault of the target system using the target fault solution, the method further includes: Determine whether the target fault solution has successfully repaired the fault to be processed; If the target fault solution has successfully repaired the fault to be processed, then the target fault type, key information of the target fault, screenshot of the target fault, and the target fault solution are constructed as the error data corresponding to the fault to be processed. If the target fault solution fails to fix the fault to be processed, the key information of the target fault and the target fault screenshot of the fault to be processed will be sent to the client so that the staff can generate a manual fault solution corresponding to the fault to be processed based on the key information of the target fault and the target fault screenshot of the fault to be processed. Obtain the manual fault solution corresponding to the fault to be processed sent by the client; The target fault type, key information of the target fault, screenshot of the target fault, and the manual fault solution are used to construct the error data corresponding to the fault to be processed. The error data corresponding to the fault to be processed is stored in the error data knowledge base.
9. A fault handling device, characterized in that, Applied to servers, including: The acquisition module is used to acquire a fault handling request for the target system, wherein the fault handling request includes key information of the target fault and a screenshot of the target fault. The processing module is used to determine the target fault type corresponding to the target fault key information based on a preset mapping relationship between the fault key information and the fault type. The processing module is further configured to, if the target fault type is a known fault type, filter the historical error data stored in the preset error data knowledge base according to the target fault type and the target fault screenshot, so as to determine at least one target historical error data, wherein the historical error data includes the corresponding historical fault solution; The processing module is also used to determine the historical fault solutions corresponding to the target historical error data as the target fault solution; The processing module is also used to determine a target fault solution based on the key information of the target fault and the screenshot of the target fault if the target fault type is an unknown fault type; The processing module is also used to process the unprocessed fault of the target system through the target fault solution.
10. A computer device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.