A fault cause determination method, device and equipment

By using a text classification convolutional neural network to automatically classify error messages, the problem of high manpower consumption in manual fault diagnosis in existing technologies is solved, and the cause of faults is automatically determined.

CN115080375BActive Publication Date: 2026-02-06BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110266166.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-11
Publication Date
2026-02-06
Estimated Expiration
2041-03-11

AI Technical Summary

Technical Problem

In existing technologies, the process of determining the cause of a fault relies on manual investigation, which results in excessive consumption of human resources.

Method used

A pre-trained text classification convolutional neural network is used to classify the error information of the test cases, determine the error cause classification label, and find the cause of the failure from the pre-established correspondence.

Benefits of technology

It enables the automated determination of fault causes, reduces the consumption of human resources, and simplifies the complex manual fault diagnosis process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080375B_ABST
    Figure CN115080375B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a fault reason determination method, device and equipment, which can be applied to the technical field of testing, wherein the fault reason determination method can comprise: obtaining error information corresponding to an error test case, wherein the error information is text information; inputting the error information into a pre-trained text classification convolutional neural network, and determining an error reason classification label corresponding to the error information according to output information of the text classification convolutional neural network; searching for a fault reason corresponding to the error reason classification label from a pre-established corresponding relationship, and taking the fault reason corresponding to the error reason classification label as a fault reason corresponding to the error test case. In this way, the fault reason is automatically determined, and the consumption of human resources in the fault reason process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of testing, in particular to a fault cause determination method, device and equipment. BACKGROUND

[0002] Software testing is a process of running or measuring a software system using artificial or automatic means, which aims to verify whether the software system meets the specified requirements or to find out the difference between the expected result and the actual result. Each test case is an automatic code implementation of a test scenario. If the test result obtained by testing the software system under test through the test case does not meet the expected result, it indicates that the software system has a problem, and the test case can be understood as an error reporting test case. The test case is an automatic test case.

[0003] In the prior art, a tester periodically (e.g., daily) checks a test report. If there is an error reporting test case in the test report, the tester informs a developer and an operator. The developer and the operator manually analyze the cause of the error of the error reporting test case, i.e., the fault cause, and then repairs based on the fault cause. As can be seen, in the prior art, the tester, the developer and the operator jointly manually troubleshoot the fault, which consumes a large amount of human resources in determining the fault cause. SUMMARY

[0004] Embodiments of the present application aim to provide a fault cause determination method, device and equipment to automatically determine the fault cause and reduce the consumption of human resources in determining the fault cause. The specific technical solutions are as follows:

[0005] In a first aspect, the embodiments of the present application provide a fault cause determination method, comprising:

[0006] obtaining error information corresponding to an error reporting test case, wherein the error reporting test case is a test case when a test result obtained by testing a software system under test through a test case does not meet an expected result; and the error information is text information;

[0007] inputting the error information into a pre-trained text classification convolutional neural network, and determining an error cause classification label corresponding to the error information according to output information of the text classification convolutional neural network; wherein the text classification convolutional neural network is trained based on error information and error cause classification labels corresponding to a plurality of historical error reporting test cases, and the error cause classification label corresponding to each historical error reporting test case is determined based on a fault cause corresponding to the historical error reporting test case;

[0008] From the pre-established correspondence, find the fault cause corresponding to the error cause category label, and use the fault cause corresponding to the error cause category label as the fault cause corresponding to the error test case. The correspondence includes the correspondence between error cause category labels and fault causes.

[0009] Optionally, the step of obtaining the text classification convolutional neural network includes:

[0010] Obtain the error information and fault causes corresponding to multiple historical error test cases;

[0011] For each historical error test case, determine the error cause classification label corresponding to the fault cause of the historical error test case;

[0012] The text classification convolutional neural network is trained based on the error information and error reason classification labels corresponding to each historical error test case.

[0013] Optionally, the error reporting test cases are test cases with preset identification information in the test report;

[0014] The step of obtaining the error information corresponding to the error test case includes:

[0015] Obtain the test logs corresponding to the test cases with preset identification information;

[0016] Obtain text information from the test log that includes preset fields, and use the text information from the test log that includes preset fields as the error message.

[0017] Optionally, after searching for the fault cause corresponding to the error cause classification label from the pre-established correspondence and using the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case, the method further includes:

[0018] The error test cases and the corresponding fault reasons are sent to the testers and / or maintenance personnel.

[0019] Secondly, embodiments of the present invention provide a fault cause determination device, comprising:

[0020] The first acquisition module is used to acquire the error information corresponding to the error test case, wherein the error test case is the test case when the test result obtained by testing the software system under test through the test case does not meet the expected result; the error information is text information.

[0021] The first determining module is configured to input the error information into a pre-trained text classification convolutional neural network, and determine an error cause classification label corresponding to the error information according to output information of the text classification convolutional neural network; wherein the text classification convolutional neural network is trained based on error information and error cause classification labels corresponding to a plurality of historical error test cases respectively, and the error cause classification label corresponding to each historical error test case is determined based on a fault cause corresponding to the historical error test case.

[0022] The searching module is configured to search for a fault cause corresponding to the error cause classification label from a pre-established corresponding relationship, and take the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case, wherein the corresponding relationship includes a corresponding relationship between error cause classification labels and fault causes.

[0023] Optionally, the apparatus further includes:

[0024] The second obtaining module is configured to obtain error information and fault causes corresponding to a plurality of historical error test cases respectively.

[0025] The second determining module is configured to determine, for each historical error test case, an error cause classification label corresponding to a fault cause corresponding to the historical error test case.

[0026] The training module is configured to train the text classification convolutional neural network based on error information and error cause classification labels corresponding to each historical error test case respectively.

[0027] Optionally, the error test case is a test case with preset identification information in a test report.

[0028] The first obtaining module is specifically configured to obtain test logs corresponding to the test case with preset identification information, and obtain text information including a preset field in the test logs, and take the text information including the preset field in the test logs as the error information.

[0029] Optionally, the apparatus further includes:

[0030] The sending module is configured to, after searching for a fault cause corresponding to the error cause classification label from the pre-established corresponding relationship, and taking the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case, send the error test case and the fault cause corresponding to the error test case to a test personnel and / or an operation and maintenance personnel.

[0031] In a third aspect, an embodiment of the present application provides a fault cause determining device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;

[0032] The memory is configured to store a computer program.

[0033] The processor is configured to execute the program stored in the memory to implement the method steps of the first aspect.

[0034] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method steps of the first aspect.

[0035] The embodiment of the present application has the following beneficial effects:

[0036] The fault cause determining method, device and equipment provided by the embodiment of the present application can obtain error information corresponding to an error test case, wherein the error test case is a test case when a test result obtained by testing a software system under test through a test case does not meet an expected result; the error information is text information; the error information is input into a pre-trained text classification convolutional neural network, and an error cause classification label corresponding to the error information is determined according to output information of the text classification convolutional neural network; wherein the text classification convolutional neural network is trained based on error information and error cause classification labels corresponding to a plurality of historical error test cases, and the error cause classification label corresponding to each historical error test case is determined based on a fault cause corresponding to the historical error test case; a fault cause corresponding to the error cause classification label is searched from a pre-established corresponding relationship, and the fault cause corresponding to the error cause classification label is taken as the fault cause corresponding to the error test case, wherein the corresponding relationship includes a corresponding relationship between the error cause classification label and the fault cause.

[0037] In the embodiment of the present application, a complex manual fault troubleshooting process is simplified into a text classification process, the error information corresponding to the error test case is classified through the text classification convolutional neural network, that is, the error information is input into the pre-trained text classification convolutional neural network, and the error cause classification label corresponding to the error information is determined according to the output information of the text classification convolutional neural network. The fault cause corresponding to the error cause classification label is searched from the pre-established corresponding relationship, and the fault cause corresponding to the error cause classification label is taken as the fault cause corresponding to the error test case, so that the fault cause can be automatically determined, and the consumption of human resources in the fault cause process is reduced.

[0038] Of course, implementing any product or method of the present application does not necessarily need to achieve all the advantages above at the same time. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0040] Figure 1 A flowchart of a method for determining the cause of a fault provided in an embodiment of the present invention;

[0041] Figure 2 This is a flowchart illustrating the process of obtaining error information corresponding to error test cases in an embodiment of the present invention;

[0042] Figure 3 This is a schematic diagram illustrating how TextCNN processes error information in an embodiment of the present invention;

[0043] Figure 4 This is a flowchart illustrating the sending of test cases and corresponding fault causes in an embodiment of the present invention;

[0044] Figure 5 This is a flowchart of the TextCNN obtained in an embodiment of the present invention;

[0045] Figure 6A This is a schematic diagram of an automated test report in an embodiment of the present invention;

[0046] Figure 6B This is another schematic diagram of an automated test report in an embodiment of the present invention;

[0047] Figure 7 This is a schematic diagram of a fault cause determination device in an embodiment of the present invention;

[0048] Figure 8 This is another structural schematic diagram of the fault cause determination device in an embodiment of the present invention;

[0049] Figure 9 This is another structural schematic diagram of the fault cause determination device in an embodiment of the present invention;

[0050] Figure 10 This is a schematic diagram of the fault cause determination device in an embodiment of the present invention. Detailed Implementation

[0051] With reference to the accompanying drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below, obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work belong to the protection scope of the present application.

[0052] The fault reason determination method provided in the embodiments of the present application can comprise:

[0053] Obtaining error information corresponding to the error test case, wherein the error test case is a test case when a test result obtained by testing a software system under test through a test case does not satisfy an expected result; and the error information is text information;

[0054] Inputting the error information into a pre-trained text classification convolutional neural network, and determining an error reason classification label corresponding to the error information according to output information of the text classification convolutional neural network; wherein the text classification convolutional neural network is trained based on error information and error reason classification labels corresponding to a plurality of historical error test cases respectively, and the error reason classification label corresponding to each historical error test case is determined based on a fault reason corresponding to the historical error test case;

[0055] Finding a fault reason corresponding to the error reason classification label from a pre-established corresponding relationship, and taking the fault reason corresponding to the error reason classification label as the fault reason corresponding to the error test case, wherein the corresponding relationship comprises a corresponding relationship between the error reason classification label and the fault reason.

[0056] In the embodiments of the present application, a complex manual troubleshooting process is simplified into a text classification process, the error information corresponding to the error test case is classified through the text classification convolutional neural network, that is, the error information is input into the pre-trained text classification convolutional neural network, and the error reason classification label corresponding to the error information is determined according to the output information of the text classification convolutional neural network. The fault reason corresponding to the error reason classification label is found from the pre-established corresponding relationship, and the fault reason corresponding to the error reason classification label is taken as the fault reason corresponding to the error test case. In this way, the fault reason can be determined automatically, and the consumption of human resources in the fault reason process is reduced.

[0057] The fault reason determination method provided in the embodiments of the present application can be applied to an electronic device, specifically, the electronic device can comprise a terminal, a server and the like.

[0058] Figure 1 The flowchart of the fault reason determination method provided in the embodiments of the present application is described with reference to Figure 1The fault cause determination method provided by the embodiment of the application can include the following steps.

[0059] S101, obtaining error information corresponding to an error test case.

[0060] The error test case is a test case when a test result obtained by testing a software system under test by using a test case does not meet an expected result.

[0061] The error information is text information.

[0062] In an implementable manner, the error test case is a test case with preset identification information in a test report.

[0063] As shown in FIG. 1, Figure 2 S101 can include the following steps.

[0064] S1011, obtaining a test log corresponding to a test case with preset identification information.

[0065] In an implementable manner, the test log corresponding to the test case with preset identification information can be obtained from a test report. The test report can be, for example, an Allure report, etc.

[0066] The test report can include test logs corresponding to a plurality of test cases. The test cases in the test report can have identification information. For example, the identification information can include identification information “√” indicating that a test passes, identification information “×” indicating that a test fails, etc. The test case corresponding to the test that fails is an error test case.

[0067] The preset identification information can be identification information used to indicate that a test case fails in the test report. For example, the identification information “×”, etc.

[0068] S1012, obtaining text content including a preset field in the test log, and taking the text content including the preset field in the test log as the error information.

[0069] The preset field can include a field in the test log indicating that a test case fails, which can be obtained by analyzing historical test logs. For example, the preset field can be a “failure”, “error”, “not passed” field, etc.

[0070] The test log corresponding to the test case with preset identification information and the text content including the preset field in the test log can be obtained by using a crawler. In an implementable manner, a Beautifulsoop crawler can be used.

[0071] S102, input the error report information into the pre-trained text classification convolutional neural network, and determine the error reason classification label corresponding to the error report information according to the output information of the text classification convolutional neural network.

[0072] The text classification convolutional neural network (TextCNN) is trained based on a plurality of historical error test cases respectively corresponding to error report information and error reason classification labels.

[0073] The network model of the TextCNN can include a one-hot encoding layer (word2vec), a convolutional layer, a pooling layer, a full connection layer, and an activation function, wherein the activation function is a softmax function. Since the reasons for the failure of the automated test cases are limited, there are limited scenarios during classification. One-hot encoding, also known as one-bit effective encoding, uses an N-bit state register to encode N states, each state has its own register bit, and at any time, only one bit is effective.

[0074] The one-hot encoding layer is a network layer for encoding the input Chinese text (i.e., error report information) into a matrix. For example, the text content is "today the weather is good", which can be encoded as:

[0075] Today—>[1, 0, 0,...0], weather—>[0, 0, 1...0], very good—>[0, 1, 0...0], so "today the weather is good" after the one-hot encoding layer is:

[0076] Convolutional layer: taking the output of the one-hot encoding layer as input, used to extract features (represented as a matrix).

[0077] Pooling layer: taking the output of the convolutional layer as input, used to compress data and extract features again.

[0078] Full connection layer: taking the output of the pooling layer as input, integrating features, and reducing the influence of feature position on classification.

[0079] Activation function: the activation function takes the output of the full connection layer as input, uses the softmax function to classify the input data, and outputs the classification label, i.e., the error reason classification label.

[0080] Figure 3 The figure is a schematic diagram of the TextCNN processing error report information in the embodiment of the present application, referring to Figure 3, the error information obtained is "host migration fails", the error information is input into the TextCNN, the one-hot encoding layer performs one-hot encoding on the error information to obtain an encoding matrix. The encoding matrix passes through the convolution layer, and the convolution layer extracts features of the encoding matrix. The extracted features pass through the pooling layer to obtain re-extracted features. The re-extracted features pass through the full connection layer for feature integration, and the integrated features pass through an activation function, that is, a softmax function. The softmax function is used for classifying the error information "host migration fails", and outputs an error cause classification label corresponding to the error information.

[0081] The steps of obtaining the TextCNN will be described in detail below, which will not be described here.

[0082] S103, from the pre-established corresponding relationship, find the fault cause corresponding to the error cause classification label, and take the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case.

[0083] The corresponding relationship includes the corresponding relationship between the error cause classification label and the fault cause.

[0084] For example, Table 1 shows the corresponding relationship between the error cause classification label and the fault cause.

[0085] Table 1

[0086] Error cause classification label Fault cause Error cause classification label 1 Fault cause 1 Error cause classification label 2 Fault cause 2 Error cause classification label 3 Fault cause 3 …… ……

[0087] Therefore, when the error cause classification label corresponding to the error information is determined, the pre-established corresponding relationship can be found to obtain the fault cause corresponding to the error cause classification label.

[0088] In the embodiment of the application, the text classification process is performed by the TextCNN, that is, the error information corresponding to the error test case is classified by the TextCNN. Specifically, the error information is input into the pre-trained text classification convolutional neural network, and the error cause classification label corresponding to the error information is determined according to the output information of the text classification convolutional neural network. Then, the fault cause corresponding to the error cause classification label is found from the pre-established corresponding relationship, and the fault cause corresponding to the error cause classification label is taken as the fault cause corresponding to the error test case. In this way, the fault cause can be automatically determined, and the consumption of human resources in the fault cause process is reduced.

[0089] In order to enable the test personnel and / or operation personnel to repair the problems based on the fault cause, as shown in Table 2, in an optional embodiment of the application, after S103, the method can further include: Figure 4

[0090] ​S104, send the error reporting test case and the fault reason corresponding to the error reporting test case to the tester and / or the operation and maintenance personnel.

[0091] Specifically, a notification message can be sent to the tester and / or the operation and maintenance personnel, and the error reporting test case and the fault reason corresponding to the error reporting test case are carried in the notification message.

[0092] In this way, the tester and / or the operation and maintenance personnel can repair the problem based on the fault reason and the like.

[0093] In the embodiment of the application, the text classification process is performed by TextCNN, that is, the error information corresponding to the error reporting test case is classified by TextCNN. Specifically, the error information is input into the pre-trained text classification convolutional neural network, and the error reason classification label corresponding to the error information is determined according to the output information of the text classification convolutional neural network. The process of obtaining TextCNN is an important process of the embodiment of the application, and the process of obtaining TextCNN used for classifying error information in the embodiment of the application will be described in detail below.

[0094] Figure 5 The flowchart for obtaining TextCNN in the embodiment of the application is shown in Figure 5 The step of obtaining TextCNN can include:

[0095] S501, obtaining error information and fault reasons corresponding to a plurality of historical error reporting test cases respectively.

[0096] S502, for each historical error reporting test case, determining an error reason classification label corresponding to the fault reason corresponding to the historical error reporting test case.

[0097] The error information in the historical automated test report can be sorted, and the fault reason corresponding to each error information can be obtained to generate a training data set. The historical error reporting test case is specifically a historical error reporting test case in which the test in the historical automated test report fails (which can also be understood as an error), that is, the test result obtained by testing the software system to be tested by the historical error reporting test case does not meet the expected result.

[0098] The historical automated test report can include test results of a plurality of test cases, for example, the Allure report (automated test report) includes test results of a plurality of automated jobs (test tasks), and each automated job includes a plurality of test cases. The error information corresponding to the historical error reporting test case can be obtained from the historical automated test report.

[0099] The automation test task job can run on Jenkins. Jenkins is an open source software project, which is a continuous integration tool developed based on Java, used to monitor continuous and repetitive work, and aims to provide an open and easy-to-use software platform to make continuous integration of software possible. The functions of Jenkins include continuous software version release / test project; monitoring of work performed by external calls.

[0100] Each automation job contains multiple test cases, each of which is an automated code implementation of a test scenario. If the test result does not meet the expectation after testing the software system with a test case, it indicates that the software system under test has a problem.

[0101] Specifically, each suite in the Allure report represents the test result of a test case. The test result can include test pass and test fail. In the embodiment of the application, the test result of the test case corresponding to the test fail is marked with preset identification information, for example, the test log corresponding to the error information marked with the identification information "×".

[0102] The test case in the automation job fails, and the error information corresponding to the failed test case is the error information corresponding to the historical test case to be obtained. For example, the test case "online migration of virtual machine" in the automation job "online migration operation set" fails, and the log shows "host1 (host1) is the same as host2 (host2)". The log "host1 is the same as host2" can be understood as the error information corresponding to the test case. Figure 6A Fig. 1 is a schematic diagram of an automation test report, Figure 6A The test case "online migration of virtual machine" corresponding to the identification information 601 fails, and the test log 602 "host1 is the same as host2" can be understood as the error information corresponding to the test case.

[0103] For example, the test case "verify whether the internal IPv4 (Internet Protocol, IP) address of the virtual machine is automatically obtained" in the automation job "elastic network card related test set" fails, and the log shows "verify that the internal IPv4 address of the virtual machine does not pass". The log "verify that the internal IPv4 address of the virtual machine does not pass" can be understood as the error information corresponding to the test case. Figure 6B Fig. 2 is another schematic diagram of an automation test report, Figure 6A The test case "verify whether the internal IPv4 address of the virtual machine is automatically obtained" corresponding to the identification information 603 fails, and the test log 604 "verify that the internal IPv4 address of the virtual machine does not pass" can be understood as the error information corresponding to the test case.

[0104] The error information corresponding to the historical error test case is obtained, and the fault information corresponding to each historical error test case is obtained. Specifically, the fault reason corresponding to the error information can be obtained from the historical analysis result.

[0105] For example, the log shows that "host1 is the same as host2", because the migration fails to be scheduled to an available node during migration, and the common reasons are: (1) the host resource of the cluster is not enough, and the scheduling algorithm cannot find an available host; (2) the project_uuid (host number) of the successfully scheduled host is the same as the original host, resulting in migration failure. The log shows that the "verify virtual machine internal IPv4 address not passed" error reason is: (1) the image used by the virtual machine does not support hot mounting of the elastic network card, and automatically obtains the IP of the elastic network card; (2) the IP address of the elastic network card obtained by the virtual machine does not match the expected value.

[0106] The error reason classification label corresponding to the fault reason corresponding to the historical error test case is determined, that is, the fault reason is labeled. For example, the labels of the fault reasons corresponding to different error information are shown in Table 2.

[0107] Table 2

[0108]

[0109] Wherein, the error case corresponds to the error information corresponding to the historical error test case, the error reason is the fault reason, and the label is the error reason classification label determined for the fault reason.

[0110] S503, based on the error information and the error reason classification label corresponding to each historical error test case respectively, a text classification convolutional neural network, that is, TextCNN, is trained.

[0111] After obtaining the training data set, specifically, the error information and the error reason classification label corresponding to each historical error test case are obtained, and based on the error information and the error reason classification label corresponding to each historical error test case, the initial TextCNN is trained to obtain the TextCNN used for classifying error information in the embodiment of the application.

[0112] Wherein, the network model of the initial TextCNN also includes a one-hot encoding layer, a convolution layer, a pooling layer, a full connection layer and an activation function.

[0113] The error information and error cause classification label corresponding to each historical error test case can be understood as a training sample. The error information and error cause classification label corresponding to each historical error test case are respectively input into the initial TextCNN. The label output by the initial TextCNN is compared with the input error cause classification label. The network parameters of the initial TextCNN are adjusted continuously. When the difference between the label output by the initial TextCNN and the input error cause classification label converges, or the number of iterations reaches a preset number, the training is ended. In this way, the initial TextCNN including the adjusted network parameters, that is, the trained TextCNN, can be obtained.

[0114] In this way, the trained TextCNN can be used to classify the error information corresponding to the error test case. Specifically, the error information is input into the pre-trained text classification convolutional neural network. The error cause classification label corresponding to the error information is determined according to the output information of the text classification convolutional neural network. Then, the fault cause corresponding to the error cause classification label is found from the pre-established corresponding relationship. The fault cause corresponding to the error cause classification label is taken as the fault cause corresponding to the error test case. In this way, the fault cause can be determined automatically, and the consumption of human resources in the fault cause process is reduced.

[0115] Corresponding to the fault cause determination method provided in the above embodiment, the embodiment of the present application further provides a fault cause determination apparatus, as shown in Figure 7 may include:

[0116] The first acquisition module 701 is configured to acquire error information corresponding to an error test case. The error test case is a test case in which a test result obtained by testing a software system under test through a test case does not meet an expected result. The error information is text information.

[0117] The first determination module 702 is configured to input the error information into a pre-trained text classification convolutional neural network, and determine an error cause classification label corresponding to the error information according to output information of the text classification convolutional neural network. The text classification convolutional neural network is trained based on error information and error cause classification labels corresponding to a plurality of historical error test cases. The error cause classification label corresponding to each historical error test case is determined based on a fault cause corresponding to the historical error test case.

[0118] The finding module 703 is configured to find a fault cause corresponding to the error cause classification label from a pre-established corresponding relationship, and take the fault cause corresponding to the error cause classification label as a fault cause corresponding to the error test case. The corresponding relationship includes a corresponding relationship between the error cause classification label and the fault cause.

[0119] Optionally, as shown in Figure 8 The device further comprises:

[0120] The second acquisition module 801 is configured to acquire error information and fault reasons corresponding to a plurality of historical error reporting test cases respectively.

[0121] The second determination module 802 is configured to determine, for each historical error reporting test case, an error cause classification label corresponding to a fault reason corresponding to the historical error reporting test case.

[0122] The training module 803 is configured to train a text classification convolutional neural network based on the error information and the error cause classification label corresponding to each historical error reporting test case respectively.

[0123] Optionally, the error reporting test case is a test case with preset identification information in a test report.

[0124] The first acquisition module 701 is specifically configured to acquire a test log corresponding to a test case with preset identification information; acquire text information including a preset field in the test log; and take the text information including the preset field in the test log as error information.

[0125] Optionally, as shown in Figure 9 The device further comprises:

[0126] The sending module 704 is configured to find a fault reason corresponding to the error cause classification label from a pre-established corresponding relationship; and after taking the fault reason corresponding to the error cause classification label as a fault reason corresponding to the error reporting test case, send the error reporting test case and the fault reason corresponding to the error reporting test case to a test personnel and / or an operation and maintenance personnel.

[0127] The fault reason determination device provided by the embodiment of the present application is a device applying the fault reason determination method, and all the embodiments of the fault reason determination method are applicable to the device and can achieve the same or similar beneficial effects.

[0128] Corresponding to the fault reason determination method provided by the above embodiment, the embodiment of the present application further provides a fault reason determination device, as shown in Figure 10 The device comprises a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete mutual communication through the communication bus 1004.

[0129] The memory 1003 is configured to store a computer program.

[0130] The processor 1001 is configured to implement the steps of the method of determining the fault cause when executing the program stored in the memory 1003.

[0131] The communication bus mentioned in the fault cause determining device can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, and the like. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0132] The communication interface is configured to communicate between the fault cause determining device and other devices.

[0133] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0134] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0135] In another embodiment provided by the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of the method of determining the fault cause.

[0136] In another embodiment provided by the present application, a computer program product containing instructions is also provided, and when the computer program product is executed on a computer, the computer is caused to perform the steps of the method of determining the fault cause.

[0137] In the embodiments described above, all or some of the steps can be implemented by software, hardware or firmware, or any combination thereof. When implemented by software, all or some of the steps can be implemented in the form of one or more computer programs. The computer program can be stored in any computer readable medium, and loaded into the computer system for execution. The computer readable medium includes: a computer storage medium and a computer communication medium. The computer storage medium includes: volatile media (such as random access memory (RAM) and others) and non-volatile media (such as read-only memory (ROM), floppy disks, CD-ROMs, optical disks, hard disks, etc.). The computer communication medium includes: computer networks and other media.

[0138] It should be noted that, in this document, the terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. In addition, the terms "comprise", "comprise" 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 inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.

[0139] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments. In particular, for the device, equipment, computer readable storage medium and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0140] The above merely describes the preferred embodiments of the present application, but is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining the cause of a fault, characterized in that, include: Obtaining error information corresponding to error test cases includes: obtaining test logs corresponding to test cases with preset identification information; obtaining text information including preset fields in the test logs, and using the text information including preset fields in the test logs as the error information, wherein the preset fields include fields in the test logs indicating that the test case failed; wherein the error test case is a test case when the test result obtained by testing the software system under test through the test case does not meet the expected result; the error information is text information; the error test case is a test case with preset identification information in the test report, wherein the preset identification information is identification information used in the test report to indicate that the test case failed; The error message is input into a pre-trained text classification convolutional neural network, and the error cause classification label corresponding to the error message is determined based on the output information of the text classification convolutional neural network. The text classification convolutional neural network is trained based on the error messages and error cause classification labels corresponding to multiple historical error test cases. The error cause classification label corresponding to each historical error test case is determined based on the fault cause corresponding to the historical error test case. The text classification convolutional neural network includes a one-hot encoding layer (word2vec), convolutional layers, pooling layers, fully connected layers, and an activation function. The one-hot encoding layer encodes the error message into a matrix. The convolutional layers use the output of the one-hot encoding layer as input to extract features in matrix form. The pooling layers use the output of the convolutional layers as input to compress data and extract features again. The fully connected layers use the output of the pooling layers as input to integrate features. The activation function uses the output of the fully connected layers as input to output the error cause classification label. From the pre-established correspondence, find the fault cause corresponding to the error cause category label, and use the fault cause corresponding to the error cause category label as the fault cause corresponding to the error test case. The correspondence includes the correspondence between error cause category labels and fault causes.

2. The method according to claim 1, characterized in that, The steps to obtain the text classification convolutional neural network include: Obtain the error information and fault causes corresponding to multiple historical error test cases; For each historical error test case, determine the error cause classification label corresponding to the fault cause of the historical error test case; The text classification convolutional neural network is trained based on the error information and error reason classification labels corresponding to each historical error test case.

3. The method according to claim 1 or 2, characterized in that, After finding the fault cause corresponding to the error cause classification label from the pre-established correspondence and using the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case, the method further includes: The error test cases and the corresponding fault reasons are sent to the testers and / or maintenance personnel.

4. A device for determining the cause of a fault, characterized in that, include: The first acquisition module is used to acquire error information corresponding to the test cases that fail, including: acquiring test logs corresponding to test cases with preset identification information; acquiring text information including preset fields in the test logs, and using the text information including preset fields in the test logs as the error information, wherein the preset fields include fields in the test logs indicating that the test case failed; wherein the test case that fails is a test case when the test result obtained by testing the software system under test through the test case does not meet the expected result; the error information is text information; the test case that fails is a test case with preset identification information in the test report, wherein the preset identification information is identification information used in the test report to indicate that the test case failed; The first determining module is used to input the error information into a pre-trained text classification convolutional neural network, and determine the error cause classification label corresponding to the error information based on the output information of the text classification convolutional neural network; wherein, the text classification convolutional neural network is trained based on the error information and error cause classification labels corresponding to multiple historical error test cases, and the error cause classification label corresponding to each historical error test case is determined based on the fault cause corresponding to the historical error test case. The text classification convolutional neural network includes a one-hot encoding layer word2vec, a convolutional layer, a pooling layer, a fully connected layer, and an activation function. The one-hot encoding layer is used to encode the error information into a matrix. The convolutional layer is used to extract matrix-form features using the output of the one-hot encoding layer as input. The pooling layer is used to compress data and extract features again using the output of the convolutional layer as input. The fully connected layer is used to integrate features using the output of the pooling layer as input. The activation function is used to output the error cause classification label using the output of the fully connected layer as input. The lookup module is used to find the fault cause corresponding to the error cause category label from the pre-established correspondence, and use the fault cause corresponding to the error cause category label as the fault cause corresponding to the error test case, wherein the correspondence includes the correspondence between error cause category label and fault cause.

5. The apparatus according to claim 4, characterized in that, The device further includes: The second acquisition module is used to acquire the error information and fault causes corresponding to multiple historical error test cases; The second determining module is used to determine the error cause classification label corresponding to the fault cause of each historical error test case for each historical error test case. The training module is used to train the text classification convolutional neural network based on the error information and error reason classification labels corresponding to each historical error test case.

6. The apparatus according to claim 4 or 5, characterized in that, The device further includes: The sending module is used to find the fault cause corresponding to the error cause classification label in the pre-established correspondence, and after using the fault cause corresponding to the error cause classification label as the fault cause corresponding to the error test case, send the error test case and the fault cause corresponding to the error test case to the test personnel and / or maintenance personnel.

7. A fault cause determination device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and system for automatic analysis of error reporting logs of automatic software testing

    CN107145445A

  • Test case failure reason analysis method and device and electronic equipment

    CN110990575A

  • Training method and classification method for fault classification model of power information system

    CN111651601A