Interface calling abnormity positioning method and device, equipment and storage medium

The exception positioning method is called through the interface combining TFIDF algorithm and CNN, which solves the problem of low interface abnormal positioning efficiency in software development, and realizes efficient and accurate interface abnormal positioning, which improves the work efficiency of software testing.

CN120492343APending Publication Date: 2025-08-15AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510611347.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

During the software development process, when the system environment of the related party is fluctuating, it is difficult for the existing technology to efficiently locate the abnormal interface, resulting in cumbersome log query and reduced work efficiency.

Method used

The method of combining word frequency inverse document frequency TFIDF algorithm and convolutional neural network CNN is adopted to call the exception positioning model through the interface overlay information matrix and test result vector, and use virtual test cases to efficiently locate interface exceptions.

Benefits of technology

It improves the efficiency and accuracy of interface abnormal positioning, reduces the complexity and repetition of traditional log viewing, and significantly improves the efficiency of problem detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492343A_ABST
    Figure CN120492343A_ABST
Patent Text Reader

Abstract

The invention discloses an interface calling abnormity positioning method and device, equipment and a storage medium. The method comprises the following steps: converting an interface coverage information matrix by adopting a word frequency inverse document frequency TFIDF algorithm to obtain an interface TFIDF matrix; training a neural network model by taking the TFIDF matrix and the test result vector as samples to obtain an interface calling anomaly positioning model; and inputting the unit matrix of the virtual test case into the interface calling abnormity positioning model, and obtaining an interface with calling abnormity of the virtual test case. According to the method, the TFIDF matrix is obtained through conversion by using the TFIDF algorithm, so that the TFIDF matrix has relatively strong semantic expression information, the influence degree of each interface on different test cases can be remarkably represented, the interface calling abnormity positioning model obtained by training the TFIDF matrix as a sample can accurately position the interface with calling abnormity, and the accuracy of the interface calling abnormity positioning is improved. Compared with a repeated and complex log checking mode for abnormal interface in a traditional development test process, the method is more efficient and convenient, and the troubleshooting and positioning efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a method, device, equipment and storage medium for locating an interface call anomaly. Background Art

[0002] Application Programming Interfaces (APIs) enable resource sharing and efficient interaction between different systems, making software development more efficient and rapid. In the banking sector, peripheral systems often use third-party APIs to perform transactions such as transfers and inquiries. Therefore, APIs have become an indispensable component of modern application development.

[0003] When a system involves numerous third-party interfaces, functional stability is highly susceptible to the intermediary system environment. During routine development and testing, fluctuations in the intermediary environment can lead to transactional bottlenecks within the system. In these cases, log querying is often used to locate the source of the anomaly. However, this log query process is tedious and repetitive, significantly reducing efficiency during system testing. Therefore, when encountering intermediary system anomalies during software debugging and testing, precisely locating the interface information causing the error has become a pressing technical challenge. Summary of the Invention

[0004] The present invention provides an interface call exception positioning method, device, equipment and storage medium to achieve efficient and accurate positioning of the abnormally called interface.

[0005] According to one aspect of the present invention, a method for locating an interface call anomaly is provided, comprising: obtaining an interface coverage information matrix and a test result vector corresponding to a test case after execution, wherein the interface coverage information matrix includes coverage information of each interface in different test cases;

[0006] The interface coverage information matrix is converted into an interface TFIDF matrix using a term frequency inverse document frequency (TFIDF) algorithm, wherein the TFID matrix includes the influence weight of each interface in different test cases;

[0007] Using the TFIDF matrix and the test result vector as samples to train a neural network model to obtain an interface call anomaly location model;

[0008] The identity matrix of the virtual test case is input into the interface call exception location model to obtain the interface of the virtual test case call exception.

[0009] According to another aspect of the present invention, a device for locating an interface call anomaly is provided, comprising:

[0010] A test case execution data acquisition module is used to obtain the interface coverage information matrix and test result vector corresponding to the test case execution, wherein the interface coverage information matrix includes the coverage information of each interface in different test cases;

[0011] A matrix conversion module is used to convert the interface coverage information matrix using a term frequency inverse document frequency (TFIDF) algorithm to obtain an interface TFIDF matrix, wherein the TFID matrix includes the influence weight of each interface in different test cases;

[0012] A model training module is used to train a neural network model using the TFIDF matrix and the test result vector as samples to obtain an interface call abnormality location model;

[0013] The interface call exception locating module is used to input the unit matrix of the virtual test case into the interface call exception locating model to obtain the interface of the virtual test case call exception.

[0014] According to another aspect of the present invention, a terminal device is provided, characterized in that the terminal device includes:

[0015] one or more processors;

[0016] a storage device for storing one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors execute the method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a storage medium of computer-executable instructions is provided, on which a computer program is stored. When the program is executed by a processor, the method according to any one of the embodiments of the present invention is implemented.

[0019] The technical solution of the present invention is based on the interface coverage information matrix after the test case is executed, and uses the TFIDF algorithm to convert it to obtain the TFIDF matrix, so that the TFIDF matrix has strong semantic expression information, and can significantly characterize the degree of influence of each interface on different test cases. The interface call exception location model obtained by using it as a sample for training can accurately locate the interface with abnormal call, which is more efficient and convenient than the repetitive and complicated log viewing method for abnormal interface in the traditional development and testing process, and greatly improves the efficiency of troubleshooting and locating problems.

[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0022] Figure 1 This is a flowchart of a method for locating an interface call exception according to the first embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of the test case execution process provided in Example 1 of the present invention;

[0024] Figure 3 This is a flow chart of a method for locating an interface call exception according to the second embodiment of the present invention.

[0025] Figure 4 This is a structural diagram of a device for locating an interface call anomaly according to a third embodiment of the present invention;

[0026] Figure 5 This is a structural block diagram of a terminal device provided by the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or terminal device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or terminal devices.

[0029] Example 1

[0030] Figure 1 This is a flow chart of a method for locating an interface call anomaly provided by an embodiment of the present invention. This embodiment is applicable to the case of efficiently and accurately locating an interface call anomaly. The method can be executed by an interface call anomaly locating device, which can be implemented in the form of hardware and / or software, and the device can be integrated into a terminal device. Figure 1 As shown, the method includes:

[0031] Step S101: Obtain the interface coverage information matrix and test result vector corresponding to the test case after execution.

[0032] Specifically, the API interface in this embodiment enables resource sharing and efficient interaction between different systems, making software development more efficient and rapid. This is particularly true in the banking sector, where peripheral systems often use third-party interfaces to implement transactions such as transfers and inquiries. However, when a function involves a large number of third-party interfaces, the stability of the associated systems is easily affected. Therefore, this embodiment proposes a method that combines the Term Frequency Inverse Document Frequency (TFIDF) algorithm with a convolutional neural network (CNN) to accurately locate abnormal interface calls. First, it is necessary to sort out all third-party interfaces involved in the tested function and record the interface coverage information and execution results after each test case is executed to form an interface coverage matrix and a result vector. Second, TFIDF is used to calculate the contribution of different interfaces to the test results to form a training dataset. The training data is then enhanced with Gaussian noise to expand the training sample set. Finally, a CNN-based deep learning model is constructed, and the training dataset and result vectors are input into the model in batches for training. Virtual test cases are input into the trained model, and the model outputs the suspiciousness of each interface call anomaly. The exception locating method of this embodiment can provide auxiliary information for testers and developers to troubleshoot abnormal interfaces.

[0033] Optionally, before obtaining the interface coverage information matrix and test result vector corresponding to the test case execution, it also includes: obtaining the interface information involved in the transaction implementation process, wherein the interface information includes the number of interfaces and interface association relationships; and obtaining the number and type of test cases involved in covering all interfaces based on the interface information.

[0034] It is worth mentioning that the third-party interface in this implementation is mainly used in transaction scenarios such as transfer and inquiry, and before locating the interface anomaly, the interface information involved in the transaction implementation process will be obtained first, that is, the specific number of interfaces involved in the complete implementation of the transaction, as well as the relationship between the interfaces. In addition, the number and type of test cases required to be executed are different depending on the number of interfaces and the relationship between them. Figure 2 The following is a schematic diagram of the test case execution process. Figure 2The transaction shown involves the calling of 7 interfaces in total. First, the judgment of condition 1 is executed through the P1 interface. If the scenario is 0, the transaction ends normally; if the scenario is 1, the assignment a operation is performed; if the scenario is 2, the assignment b operation is performed. Next, the judgment of condition 2 is executed using interface P2. If the scenario is 0, the transfer transaction C and the verification transaction are executed; if the scenario is 1, interface 3 is called to execute the judgment of condition 3. If the judgment result is 0, the transfer transaction A is executed; if the judgment result is 1, the transfer transaction B is executed. And in order to cover all the above interfaces, it is necessary to execute 7 different types of test cases, namely Case1: (0), Case2: (1,0), Case3: (1,1,0), Case4: (1,1,1), Case5: (2,0), Case6: (2,1,0) and Case7: (2,1,1). The format of the test cases used in this embodiment is (a, b, c), refer to Figure 2 It can be seen that the values of a, b, and c represent the results of the three conditional judgments respectively.

[0035] In this embodiment, after executing the above-mentioned different types of test cases, coverage information for each interface during the execution process and the test results obtained by calling the interface are obtained. The following Table 1 shows an example of interface coverage information and test results when interface P3 is called abnormally:

[0036] Table 1

[0037] Test Cases P1 P2 P3 P4 P5 P6 P7 R Case 1: (0) 1 0 0 0 0 0 0 0 Case 2: (1, 0) 1 1 0 0 0 1 1 0 Case 3: (1, 1, 0) 1 1 1 0 0 0 0 1 Case 4: (1, 1, 1) 1 1 1 0 0 0 0 1 Case 5: (2, 0) 1 1 0 0 0 1 1 0 Case 6: (2, 1, 0) 1 1 1 0 0 0 0 1 Case 7: (2, 1, 1) 1 1 0 0 0 1 1 0

[0038] The first column shows the test case, and the second through eighth columns show the interface coverage information after the test case is executed. If the interface is covered (i.e., called) after the test case is executed, it is recorded as 1; if the interface is not covered (i.e., not called), it is recorded as 0. The last column shows the test result corresponding to the test case, with a normal transaction completion recorded as 0 and an abnormal transaction recorded as 1. Of course, this embodiment is merely an example and does not limit the number of test cases or the specific content of each interface's coverage information.

[0039] Optionally, the interface coverage information matrix and test result vector corresponding to the test case execution are obtained, including: obtaining coverage information for each interface during the execution of different types of test cases, and generating an interface coverage information matrix based on the coverage information, wherein the coverage information is used to represent the calling status of the interface; obtaining the test results obtained by calling the interface with different types of test cases, and generating a test result vector based on the test results, wherein the test results include test success or test failure.

[0040] Optionally, an interface coverage information matrix is generated based on the coverage information, including: combining the coverage information of the interface after each test case is executed in the order of the interfaces to construct an interface coverage information matrix; and a test result vector is generated based on the test results, including: combining the test results of each test case in order to construct a test result vector.

[0041] Specifically, in this embodiment, an interface coverage information matrix will be generated based on the interface coverage information, that is, the second to seventh columns mentioned above will be displayed in the form of a matrix. In addition, a test result vector will be generated based on the test results, that is, the eighth column mentioned above will be displayed in the form of a one-dimensional vector. Of course, in this embodiment, only seven test cases and seven interfaces are used as an example for explanation. When the number of test cases is M and the number of interfaces is N, the interface coverage information matrix generated based on the interface coverage information is an M×N matrix, and the elements in the interface coverage matrix represent the coverage information of each interface in different test cases. In addition, a test result vector containing M elements will be constructed, and the elements in the test result vector represent the test results of each test. For example, the interface coverage information matrix obtained in this embodiment is specifically The corresponding obtained test result vector is [R1 R2 ....RM]. Of course, this embodiment is only an example and does not limit the specific content of the interface coverage information matrix and the test result vector.

[0042] Step S102: Using a term frequency inverse document frequency (TFIDF) algorithm to transform the interface coverage information matrix to obtain an interface TFIDF matrix.

[0043] Optionally, the interface coverage information matrix is converted using the term frequency inverse document frequency (TFIDF) algorithm to obtain the interface TFIDF matrix, including: using the TFIDF algorithm to calculate the contribution of the interface corresponding to each coverage information in the interface coverage information matrix to the test case, and the frequency state of the interface being called and executed in all test cases; using the product of the contribution degree and the frequency state as the influence weight of the interface corresponding to each coverage information in the test case; replacing the corresponding coverage information in the interface coverage information matrix with the influence weight of each interface in the test case to obtain the interface TFIDF matrix.

[0044] Among them, the TFID matrix includes the influence weights of each interface in different test cases. In this embodiment, the TFIDF algorithm is used to process the interface coverage matrix. Since each element in the interface coverage matrix represents the coverage information of the interface in the test case, and cannot reflect the degree of influence of each interface on different test cases from a global perspective, the TFID idea is used to process the interface coverage matrix in this embodiment. The obtained TFID matrix has strong semantic expression information, so that the degree of influence of the interface on different test cases can be reflected in the form of weights. For example, the obtained TFID matrix is Of course, this embodiment is only an example and does not limit the specific content of the TFID matrix.

[0045] Step S103: Using the TFIDF matrix and the test result vector as samples, the neural network model is trained to obtain an interface call anomaly location model.

[0046] Optionally, the TFIDF matrix and the test result vector are used as samples to train the neural network model to obtain the interface call anomaly location model, including: using the TFIDF matrix and the test result vector as samples, and using a Gaussian noise data enhancement algorithm to expand the samples to obtain expanded samples; using the expanded samples to train the neural network model to obtain the interface call anomaly location model.

[0047] Specifically, in this embodiment, after obtaining the TFID matrix and test result vector, the TFIDF matrix and test result vector are used as samples. However, the amount of sample data obtained based on the test case execution results is limited. To avoid model overfitting caused by insufficient training data, this embodiment uses a Gaussian noise data augmentation method to expand the sample. Gaussian noise, also known as normal distribution noise, has a probability density function that follows a Gaussian distribution, i.e., a normal distribution with a mean of 0 and a constant variance. By adding noise data to the sample data, new samples can be obtained without affecting the overall properties and label information of the original data. The original samples and the newly acquired samples are then used as augmented samples for subsequent model training.

[0048] In a specific implementation, the variance of the initial noise data is set to 0.01 and incremented by 0.01. Gaussian noise data with the same dimension as the original data is generated with this variance and added to the original data to obtain new data until the number of training samples meets the requirement. For example, the TFID matrix obtained after sample expansion is The corresponding test result vector is also expanded, so the test result vector obtained after the sample expansion is updated to [R1R2....RM....RL], that is, the sample is expanded by LR test cases. Of course, this implementation is only an example and does not limit the specific content of the expanded sample.

[0049] It should be noted that the neural network involved in this embodiment can specifically be a convolutional neural network. For example, the convolutional neural network includes an input layer, two convolutional layers, two activation layers, two pooling layers, a fully connected layer and an output layer. Among them, the input layer is the information receiving layer. In this embodiment, the expanded samples will be input into the network in batches; the convolution layer can extract features of the original input according to the region by moving the convolution kernel on the input matrix; the activation layer: because the ReLU function has good performance and prevents the gradient from disappearing, the ReLU function is used as the activation function to perform nonlinear mapping on the output result of the convolution layer; the pooling layer can effectively reduce the size of the matrix, reduce the model parameters, and speed up the calculation speed; the fully connected layer, each neuron is processed by weights and biases; in the output layer, the sigmoid function is used to limit the calculated value between 0 and 1. The calculation formula is as follows. The difference between the output value and the target value is the loss of the model. After different rounds of iterative training, the parameters of the optimization model are continuously adjusted through the back propagation algorithm to minimize the difference between the model output and the target value. Of course, this embodiment is merely illustrative and does not limit the specific structure of the convolutional neural network employed. Furthermore, the interface call anomaly localization model obtained through training can express the complex nonlinear relationship between test cases and execution results. Using the constructed virtual test cases as input to the model, it can predict the interface calls that are causing the anomaly.

[0050] Step S104: input the identity matrix of the virtual test case into the interface call exception location model to obtain the interface of the virtual test case call exception.

[0051] Optionally, the unit matrix input interface of the virtual test case is called to the anomaly location model to obtain the interface where the virtual test case calls the anomaly, including: calling the unit matrix input interface of the virtual test case to the anomaly location model to obtain a prediction result vector, wherein the prediction result vector contains the abnormal suspicious values corresponding to each interface; and using the interface corresponding to the largest abnormal suspicious value as the interface where the virtual test case calls the anomaly.

[0052] Specifically, in this embodiment, after obtaining the call exception location model, a virtual test case set is constructed as a unit matrix with a dimension of N, such as an N×N unit matrix N is the number of program call interfaces, which means that each test case only covers one interface, represented by the value 1. The virtual test case is input into the trained model, and the output value is the suspicious value of the program abnormality, which is between 0 and 1. The larger the value, the more likely the interface is an abnormal interface.

[0053] For example, after the unit matrix is input into the call exception location model, the output result is a one-dimensional vector [0.80.6.....0.4], and the value of the first element in the output vector is the largest, then the first interface call exception is determined. Of course, this implementation is only an example and does not limit the interface of the call exception.

[0054] The technical solution of the embodiment of the present invention is based on the interface coverage information matrix after the test case is executed, and the TFIDF algorithm is used to convert it to obtain the TFIDF matrix, so that the TFIDF matrix has strong semantic expression information and can significantly characterize the degree of influence of each interface on different test cases. The interface call anomaly location model obtained by using it as a sample for training can accurately locate the interface with abnormal call, which is more efficient and convenient than the repetitive and complicated log viewing method in the traditional development and testing process to locate the abnormal interface, and greatly improves the efficiency of troubleshooting and locating problems.

[0055] Example 2

[0056] Figure 3 This is a flow chart of an interface call exception location method provided by an embodiment of the present invention. This embodiment is based on the above embodiment and specifically describes how to convert the interface coverage information matrix using the term frequency inverse document frequency TFIDF algorithm to obtain the interface TFIDF matrix. Figure 3 As shown, the method includes:

[0057] Step S201: Obtain the interface coverage information matrix and test result vector corresponding to the test case after execution.

[0058] Optionally, before obtaining the interface coverage information matrix and test result vector corresponding to the test case execution, it also includes: obtaining the interface information involved in the transaction implementation process, wherein the interface information includes the number of interfaces and interface association relationships; and obtaining the number and type of test cases involved in covering all interfaces based on the interface information.

[0059] Optionally, the interface coverage information matrix and test result vector corresponding to the test case execution are obtained, including: obtaining coverage information for each interface during the execution of different types of test cases, and generating an interface coverage information matrix based on the coverage information, wherein the coverage information is used to represent the calling status of the interface; obtaining the test results obtained by calling the interface with different types of test cases, and generating a test result vector based on the test results, wherein the test results include test success or test failure.

[0060] Optionally, an interface coverage information matrix is generated based on the coverage information, including: combining the coverage information of the interface after each test case is executed in the order of the interfaces to construct an interface coverage information matrix; and a test result vector is generated based on the test results, including: combining the test results of each test case in order to construct a test result vector.

[0061] Step S202 : Using the TFIDF algorithm, the contribution of each interface corresponding to each coverage information in the interface coverage information matrix to the test case and the frequency of the interface being called and executed in all test cases are calculated.

[0062] Specifically, in this embodiment, after obtaining the interface coverage information matrix, the TFIDF algorithm is used to convert the interface coverage matrix, thereby converting the interface coverage information matrix into a TFID matrix with stronger semantic expression information. For example, for the interface coverage information matrix For example, this embodiment converts each element in the interface coverage information matrix, that is, the interface coverage information, into the influence weight of the interface in the test case, thereby forming the interface TFIDF matrix.

[0063]

[0064] In this embodiment, the following formula (1) is used to obtain the contribution degree TF (x ij ), and the frequent state IDF (x ij ), and specifically the following formula (1) is used to calculate TF(x ij ):

[0065]

[0066] Among them, x ij Indicates the coverage information corresponding to the i-th row and j-th column in the interface coverage information matrix, TF(x ij ) represents the contribution of interface j to test case i, N(t i ) represents the test case t i The total number of executions, that is, the interface coverage information TF(xij ) The number of elements in the i-th row of the matrix that are 1, and the more interfaces called by the test case, the smaller the value. Of course, this implementation is only an example and does not limit the specific calculation method of TF.

[0067] In addition, in this embodiment, the following formula (2) is used to calculate IDF (x ij ):

[0068]

[0069] Among them, IDF(x ij ) indicates whether interface j is frequent in all test cases. When interface j is executed by more test cases, the IDF(x ij ) is smaller, M represents the total number of test cases executed, DF(s j )

[0070] The number of test cases that call and execute interface j. Of course, this embodiment is only an example and does not limit the specific calculation method of IDF.

[0071] Step S203: The product of the contribution degree and the frequent state is used as the influence weight of the interface corresponding to each coverage information in the test case.

[0072] In this embodiment, TF(x ij ) and IDF(x ij ) After that, the following formula (3) can be used to calculate the influence weight TFIDF (x ij ):

[0073] TFIDF(x ij )=TF(x ij )*IDF(x ij ) (3)

[0074] Among them, TFIDF(x ij ) relative to x ij With stronger semantic expression information, it is possible to intuitively obtain the degree of influence of each interface on the test case, so that when the test case fails to execute, the exception of the interface with the greatest weight can be determined. Of course, this embodiment is only an example and does not affect TFIDF (x ij ) is limited by the specific calculation method.

[0075] Step S204: Replace the corresponding coverage information in the interface coverage information matrix with the influence weight of each interface in the test case to obtain an interface TFIDF matrix.

[0076] In this embodiment, the influence weight TFIDF(x ij ) can be used to ij ) Replace the corresponding coverage information x in the interface coverage information matrix ij , thereby obtaining the interface TFIDF matrix Since TFIDF has stronger semantic information, it is mainly used as a sample for model training in the subsequent model training process, making the obtained model prediction more accurate.

[0077] Step S205: Using the TFIDF matrix and the test result vector as samples, the neural network model is trained to obtain an interface call anomaly location model.

[0078] Optionally, the TFIDF matrix and the test result vector are used as samples to train the neural network model to obtain the interface call anomaly location model, including: using the TFIDF matrix and the test result vector as samples, and using a Gaussian noise data enhancement algorithm to expand the samples to obtain expanded samples; using the expanded samples to train the neural network model to obtain the interface call anomaly location model.

[0079] Step S206: Input the identity matrix of the virtual test case into the interface call exception location model to obtain the interface of the virtual test case call exception.

[0080] Optionally, the unit matrix input interface of the virtual test case is called to the anomaly location model to obtain the interface where the virtual test case calls the anomaly, including: calling the unit matrix input interface of the virtual test case to the anomaly location model to obtain a prediction result vector, wherein the prediction result vector contains the abnormal suspicious values corresponding to each interface; and using the interface corresponding to the largest abnormal suspicious value as the interface where the virtual test case calls the anomaly.

[0081] The technical solution of the embodiment of the present invention is based on the interface coverage information matrix after the test case is executed, and the TFIDF algorithm is used to convert it to obtain the TFIDF matrix, so that the TFIDF matrix has strong semantic expression information and can significantly characterize the degree of influence of each interface on different test cases. The interface call anomaly location model obtained by using it as a sample for training can accurately locate the interface with abnormal call, which is more efficient and convenient than the repetitive and complicated log viewing method in the traditional development and testing process to locate the abnormal interface, and greatly improves the efficiency of troubleshooting and locating problems.

[0082] Example 3

[0083] Figure 4This is a schematic diagram of the structure of an interface call exception location device provided by an embodiment of the present invention. Figure 4 As shown, the device includes: a test case execution data acquisition module 310, a matrix conversion module 320, a model training module 330 and an interface call exception positioning module 340.

[0084] The test case execution data acquisition module 310 is used to obtain the interface coverage information matrix and test result vector corresponding to the test case execution, wherein the interface coverage information matrix includes the coverage information of each interface in different test cases;

[0085] The matrix conversion module 320 is used to convert the interface coverage information matrix using the term frequency inverse document frequency (TFIDF) algorithm to obtain an interface TFIDF matrix, wherein the TFID matrix includes the influence weight of each interface in different test cases;

[0086] Model training module 330, used to train the neural network model using the TFIDF matrix and the test result vector as samples to obtain an interface to call the abnormality location model;

[0087] The interface call exception locating module 340 is used to input the identity matrix of the virtual test case into the interface call exception locating model to obtain the interface of the virtual test case call exception.

[0088] Optionally, the device further includes a test case determination module, which is used to obtain interface information involved in the transaction implementation process, wherein the interface information includes the number of interfaces and the interface association relationship;

[0089] Get the number and types of test cases involved in covering all interfaces based on interface information.

[0090] Optionally, a test case execution data acquisition module is used to obtain coverage information for each interface during the execution of different types of test cases, and generate an interface coverage information matrix based on the coverage information, wherein the coverage information is used to represent the call status of the interface;

[0091] The test results obtained by calling the interface of different types of test cases are obtained, and a test result vector is generated according to the test results, wherein the test results include test success or test failure.

[0092] Optionally, a test case execution data acquisition module is used to combine the interface coverage information after each test case is executed according to the interface order to construct an interface coverage information matrix;

[0093] Generate a test result vector based on the test results, including:

[0094] Combine the test results of each test case in order to construct a test result vector.

[0095] Optionally, a matrix conversion module is used to calculate the contribution of each interface corresponding to each coverage information in the interface coverage information matrix to the test case, and the frequency of the interface being called and executed in all test cases using the TFIDF algorithm;

[0096] The product of contribution degree and frequent state is used as the influence weight of the interface corresponding to each coverage information in the test case;

[0097] The impact weight of each interface in the test case replaces the corresponding coverage information in the interface coverage information matrix to obtain the interface TFIDF matrix.

[0098] Optionally, a model training module is used to use the TFIDF matrix and the test result vector as samples and use a Gaussian noise data enhancement algorithm to expand the samples to obtain expanded samples;

[0099] The neural network model is trained with expanded samples to obtain an interface to call the anomaly location model.

[0100] Optionally, an interface call anomaly location module is used to input the identity matrix of the virtual test case into the interface call anomaly location model to obtain a prediction result vector, wherein the prediction result vector includes an abnormal suspicious value corresponding to each interface;

[0101] The interface corresponding to the largest abnormal suspicious value is used as the virtual test case to call the abnormal interface.

[0102] An interface call anomaly locating device provided by an embodiment of the present invention can execute an interface call anomaly locating method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method.

[0103] Example 4

[0104] Figure 5 A schematic diagram of a terminal device 10 that can be used to implement an embodiment of the present invention is shown. The terminal device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The terminal device can also represent various forms of mobile devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0105] The components shown herein, their connections and relationships, and their functions, are examples only, and are not meant to limit implementations of the inventions described and / or claimed herein.

[0106] like Figure 5 As shown, terminal device 10 includes at least one processor 11 and memory, such as read-only memory (ROM) 12 and random access memory (RAM) 13, communicatively connected to at least one processor 11. The memory stores computer programs executable by the at least one processor, and processor 11 can perform various appropriate actions and processes based on the computer programs stored in ROM 12 or loaded from storage unit 18 into RAM 13. RAM 13 can also store various programs and data required for the operation of terminal device 10. Processor 11, ROM 12, and RAM 13 are interconnected via bus 14. An input / output (I / O) interface 15 is also connected to bus 14.

[0107] Multiple components in the terminal device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard and mouse; an output unit 17, such as various types of displays and speakers; a storage unit 18, such as a magnetic disk and optical disk; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the terminal device 10 to exchange information / data with other terminal devices via a computer network such as the Internet and / or various telecommunication networks.

[0108] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as locating interface call exceptions.

[0109] In some embodiments, the interface call exception locating method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the terminal device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interface call exception locating method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the interface call exception locating method by any other appropriate means (for example, by means of firmware).

[0110] Various embodiments of the devices and techniques described above herein can be implemented in digital electronic circuit devices, integrated circuit devices, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), devices on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable device that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage device, at least one input device, and at least one output device, and transmit data and instructions to the storage device, the at least one input device, and the at least one output device.

[0111] The computer programs used to implement the interface call anomaly locating method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other non-stop data migration device, so that when executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0112] In the context of the present invention, computer-readable storage medium can be a tangible medium, which can contain or store a computer program for use by an instruction execution device, device or terminal equipment or used in combination with an instruction execution device, device or terminal equipment. Computer-readable storage medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor devices, devices or terminal equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage medium can be a machine-readable signal medium. The more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage terminal equipment, a magnetic storage terminal equipment or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the apparatus and techniques described herein may be implemented on a terminal device having: a display device (e.g., a touch screen) for displaying information to the user; and keys through which the user can provide input to the terminal device. Other types of apparatuses may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0114] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0115] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A method for locating an interface call exception, characterized in that: include: Obtaining an interface coverage information matrix and a test result vector corresponding to the test case execution, wherein the interface coverage information matrix includes coverage information of each interface in different test cases; The interface coverage information matrix is converted into an interface TFIDF matrix using a term frequency inverse document frequency (TFIDF) algorithm, wherein the TFID matrix includes the influence weight of each interface in different test cases; Using the TFIDF matrix and the test result vector as samples to train a neural network model to obtain an interface call anomaly location model; The identity matrix of the virtual test case is input into the interface call exception location model to obtain the interface of the virtual test case call exception.

2. The method according to claim 1, characterized in that Before obtaining the interface coverage information matrix and the test result vector corresponding to the test case execution, the method further includes: Obtaining interface information involved in the transaction implementation process, wherein the interface information includes the number of interfaces and interface association relationships; The number and type of the test cases involved in covering all interfaces are obtained according to the interface information.

3. The method according to claim 2, characterized in that The obtaining of the interface coverage information matrix and the test result vector corresponding to the test case execution includes: Obtaining coverage information for each interface during the execution of different types of test cases, and generating the interface coverage information matrix according to the coverage information, wherein the coverage information is used to represent the calling status of the interface; The test results obtained by calling the interface by using different types of test cases are obtained, and the test result vector is generated according to the test results, wherein the test result includes a test success or a test failure.

4. The method according to claim 3, characterized in that Generating the interface coverage information matrix according to the coverage information includes: Combining the interface coverage information after each test case is executed according to the interface order to construct the interface coverage information matrix; Generating the test result vector according to the test result includes: The test results of each test case are combined in order to construct the test result vector.

5. The method according to claim 1, wherein The method of converting the interface coverage information matrix using a term frequency inverse document frequency (TFIDF) algorithm to obtain an interface TFIDF matrix includes: The TFIDF algorithm is used to calculate the contribution of the interface corresponding to each coverage information in the interface coverage information matrix to the test case, as well as the frequency of the interface being called and executed in all test cases; The product of the contribution degree and the frequent state is used as the influence weight of the interface corresponding to each coverage information in the test case; The corresponding coverage information in the interface coverage information matrix is replaced by the influence weight of each interface in the test case to obtain the interface TFIDF matrix.

6. The method according to claim 1, characterized in that The method of using the TFIDF matrix and the test result vector as samples to train a neural network model to obtain an interface call abnormality location model includes: Taking the TFIDF matrix and the test result vector as samples, and using a Gaussian noise data enhancement algorithm to expand the samples to obtain expanded samples; The neural network model is trained with the expanded samples to obtain the interface call anomaly locating model.

7. The method according to claim 1, characterized in that The step of inputting the identity matrix of the virtual test case into the interface call exception location model to obtain the interface where the virtual test case calls the exception includes: Inputting the identity matrix of the virtual test case into the interface call anomaly location model to obtain a prediction result vector, wherein the prediction result vector includes an abnormal suspicious value corresponding to each interface; The interface corresponding to the largest abnormal suspicious value is used as the interface of the virtual test case calling exception.

8. An interface call exception location device, characterized in that: include: A test case execution data acquisition module is used to obtain the interface coverage information matrix and test result vector corresponding to the test case execution, wherein the interface coverage information matrix includes the coverage information of each interface in different test cases; A matrix conversion module is used to convert the interface coverage information matrix using a term frequency inverse document frequency (TFIDF) algorithm to obtain an interface TFIDF matrix, wherein the TFID matrix includes the influence weight of each interface in different test cases; A model training module is used to train a neural network model using the TFIDF matrix and the test result vector as samples to obtain an interface call abnormality location model; The interface call exception locating module is used to input the unit matrix of the virtual test case into the interface call exception locating model to obtain the interface of the virtual test case call exception.

9. A terminal device, characterized in that: The terminal device includes: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer executable instruction storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.