A data processing method, device, equipment and storage medium

By obtaining the function feature information and input data of the function to be tested, generating input features and using the neural network classification model, the problem of difficulty in identifying invalid input data in the existing technology is solved, and efficient and accurate data classification and code testing efficiency are improved. .

CN113688036BActive Publication Date: 2024-09-24LYNXI TECH CO LTD
View PDF 15 Cites 0 Cited by

Patent Information

Application Number
CN202110932881.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-13
Publication Date
2024-09-24
Estimated Expiration
2041-08-13

AI Technical Summary

Technical Problem

The existing technology is difficult to efficiently identify and remove invalid input data, resulting in low code testing efficiency, and the rules for invalid input data are difficult to exhaust, affecting the work efficiency of testers.

Method used

By obtaining the function feature information and input data of the function to be tested, the input features are generated, and the neural network classification model is used to classify the data and determine the validity of the input data, thereby reducing the amount of invalid input data and improving testing efficiency.

Benefits of technology

It achieves efficient and accurate data classification, reduces the amount of invalid input data, simplifies the work process of testers, and improves code testing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113688036B
    Figure CN113688036B
Patent Text Reader

Abstract

The present application proposes a data processing method, apparatus, device and storage medium. The method may include: obtaining function feature information of a function to be tested and input data corresponding to the function to be tested; generating input features corresponding to the input data based on the function feature information and the input data; inputting the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on multiple data samples annotated with data type information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, device and storage medium. Background Art

[0002] Code testing refers to the process of generating test cases based on the input data of the functions included in the code, and then performing code testing based on the test cases.

[0003] The input data refers to the data obtained by combining the multiple parameters included in the function in the code, taking values ​​in their respective parameter ranges. It is not difficult to find that since the multiple parameters have multiple possible values, there will be multiple parameter value combinations, that is, the function has multiple input data.

[0004] In actual testing, some input data may not have the meaning of code testing (in this application, input data that has no meaning for code testing is referred to as invalid input data). Removing such invalid input data can reduce the number of generated test cases and improve code testing efficiency.

[0005] Currently, input data that hits the invalid data rule can be determined as invalid input data. This method is difficult to develop, it is difficult to exhaust invalid data rules, it is not friendly to testers, and the determination effect of invalid input data is poor. Summary of the invention

[0006] In view of this, the present application discloses a data processing method. The method may include: obtaining function feature information of a function to be tested and input data corresponding to the function to be tested; generating input features corresponding to the input data based on the function feature information and the input data; inputting the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on a plurality of data samples annotated with data type information.

[0007] In some embodiments, the function feature information includes the source code corresponding to the function to be tested, and / or the attribute information corresponding to the function to be tested; the attribute information includes at least one of the following: function name; function path; function parameters; function parameter type; function return value; function branch expression; function call chain information; function flow information.

[0008] In some embodiments, the method further includes: obtaining function change information; the function change information indicates a changed function among functions included in the code to be tested; and determining the changed function indicated in the function change information as the function to be tested.

[0009] In some embodiments, the method further includes: determining an associated function in the code to be tested corresponding to the changed function based on an association relationship between functions in the code to be tested; and determining the associated function as the function to be tested.

[0010] In some embodiments, the function feature information includes source code corresponding to the function to be tested; generating input features corresponding to the input data based on the function feature information and the input data includes: converting the source code and the input data into a first string sequence and a second string sequence, respectively; deleting invalid strings in the first string sequence; vectorizing the first string sequence and the second string sequence from which the invalid strings have been deleted, respectively, and obtaining the input features based on the vectorization processing results.

[0011] In some embodiments, the input data includes data in an input data set corresponding to the function to be tested; the method further includes: determining valid data in the input data set based on data classification results corresponding to each input data in the input data set.

[0012] In some embodiments, the method further includes: filtering the valid data using pre-maintained filtering rules to obtain final input data corresponding to the function to be tested.

[0013] The present application also proposes a data processing device, including: an acquisition module, used to obtain function feature information of a function to be tested and input data corresponding to the function to be tested; a generation module, used to generate input features corresponding to the input data based on the function feature information and the input data; an input module, used to input the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on multiple data samples labeled with data type information.

[0014] In some embodiments, the function feature information includes the source code corresponding to the function to be tested, and / or the attribute information corresponding to the function to be tested; the attribute information includes at least one of the following: function name; function path; function parameters; function parameter type; function return value; function branch expression; function call chain information; function flow information.

[0015] In some embodiments, the device further includes: a first determination module, configured to obtain function change information; the function change information indicates a changed function in the function included in the code to be tested; and the changed function indicated in the function change information is determined as the function to be tested.

[0016] In some embodiments, the device further includes: a second determination module, configured to determine, based on the association relationship between functions in the code to be tested, an associated function in the code to be tested corresponding to the changed function; and determine the associated function as the function to be tested.

[0017] In some embodiments, the function feature information includes source code corresponding to the function to be tested; the generation module is specifically used to: convert the source code and the input data into a first string sequence and a second string sequence, respectively; delete invalid strings in the first string sequence; vectorize the first string sequence and the second string sequence with invalid strings deleted, respectively, and obtain the input feature based on the vectorization processing result.

[0018] In some embodiments, the input data includes data in an input data set corresponding to the function to be tested; the device also includes: a third determination module, used to determine the valid data in the input data set based on the data classification results corresponding to each input data in the input data set.

[0019] In some embodiments, the device further includes: a filtering module, configured to filter the valid data using pre-maintained filtering rules to obtain final input data corresponding to the function to be tested.

[0020] The present application also proposes an electronic device, comprising: a processor; and a memory for storing processor executable instructions; wherein the processor implements the data processing method as described in any of the aforementioned embodiments by running the executable instructions.

[0021] The present application also proposes a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to enable a processor to execute the data processing method as described in any of the aforementioned embodiments.

[0022] In the aforementioned technical scheme, input features can be generated based on the function feature information of the function to be tested and the input data, and input into the neural network classification model for calculation to obtain data classification results, so that the neural network model can be used to learn the characteristics of the mapping relationship between different types of input data and their corresponding function feature information, and the input data can be classified according to the function feature information, thereby achieving efficient and accurate data classification. Compared with the method of setting invalid input data rules, there is no need to exhaustively enumerate invalid data rules, which is friendly to testers and has a better effect in determining invalid input data.

[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in one or more embodiments of the present application or related technologies, the drawings required for use in the embodiments or related technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 A method flow chart of a data processing method shown in this application;

[0026] Figure 2 A schematic diagram of a flow chart of an input data generating method shown in the present application;

[0027] Figure 3 A flow chart of a method for determining a function to be tested shown in the present application;

[0028] Figure 4 A flow chart of a method for determining a function to be tested shown in the present application;

[0029] Figure 5 A schematic diagram of a flow chart of an input data generating method shown in the present application;

[0030] Figure 6 A schematic diagram of a code testing process shown in this application;

[0031] Figure 7 A structural schematic diagram of a data processing device shown in the present application;

[0032] Figure 8 A schematic diagram of the hardware structure of an electronic device shown in this application. DETAILED DESCRIPTION

[0033] The exemplary embodiments will be described in detail below, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0034] The terms used in this application are only for the purpose of describing specific embodiments, and are not intended to limit the application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items. It should also be understood that the word "if" used in this article, depending on the context, can be interpreted as "at the time of" or "when" or "in response to determining".

[0035] The present application proposes a data processing method. The method can generate input features based on the function feature information of the function to be tested and the input data, and input the input features into the neural network classification model for calculation to obtain the data classification result, so that the neural network model can be used to learn the characteristics of the mapping relationship between different types of input data and their corresponding function feature information, and the input data can be classified according to the function feature information, so as to achieve efficient and accurate data classification. Compared with the method of setting invalid input data rules, there is no need to exhaustively enumerate invalid data rules, which is friendly to testers and has a better effect of determining invalid input data.

[0036] The method can be applied to an electronic device. The electronic device can execute the method by carrying a software device corresponding to the data processing method. The type of the electronic device can be a laptop, a computer, a server, a mobile phone, a PAD terminal, etc. This application does not specifically limit the specific type of the electronic device. The electronic device can be a device on the client or server side. The server can be a server or cloud provided by a server, a server cluster or a distributed server cluster.

[0037] See also Figure 1 , Figure 1 This is a flow chart of a data processing method shown in this application. Figure 1 As shown, the method may include S102-S106.

[0038] Wherein, S102, obtain function characteristic information of the function to be tested and input data corresponding to the function to be tested.

[0039] The function to be tested may refer to a function that needs to be tested in code testing.

[0040] The function characteristic information corresponds to the function to be tested, and can represent any type of characteristics possessed by the function to be tested, for example, a function expression of the function to be tested.

[0041] In some embodiments, the function feature information may include: source code corresponding to the function to be tested, and / or attribute information corresponding to the function to be tested; the attribute information includes at least one of the following: function name; function path; function parameter; function parameter type; function return value; function branch expression; function call chain information; function flow information. The function branch expression refers to a statement with branch semantics such as if else.

[0042] The function call chain information refers to the link information consisting of the call corresponding to the function and the called function.

[0043] The function flow information refers to information for expressing the function calculation flow based on multiple function branch expressions.

[0044] Therefore, by using the source code and / or attribute information corresponding to the function to be tested to represent the function feature information of the function to be tested, the function features can be better distinguished, so that the input features constructed based on the function feature information can contain information that is beneficial to the neural network data classification, thereby improving the data classification effect.

[0045] The input data may be the data obtained by combining multiple parameters of the function to be tested within their respective value ranges. The value range may be arbitrarily specified by code development. For example, the function to be tested includes three parameters A, B, and C. A, B, and C have three values ​​respectively. A, B, and C take values ​​from their respective value ranges and combine them to obtain 3 to the power of 3, i.e., 27 data combinations, i.e., 27 input data.

[0046] S104: Generate input features corresponding to the input data based on the function feature information and the input data.

[0047] The input features are used to input into a data classification model for data classification. The data classification model can extract high-order and low-order features from the input features for data classification.

[0048] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for generating input data shown in this application. Figure 2 As shown, when S104 is executed, S1042 - S1046 may be executed.

[0049] Among them, S1042, converting the function feature information and the input data into character string sequences respectively.

[0050] In some embodiments, the function feature information and the input data may be parsed into character string sequences respectively by a parser.

[0051] S1044: vectorization processing may be performed on the character string sequences corresponding to the function feature information and the input data respectively to obtain a first vector and a second vector.

[0052] In some embodiments, the word2Vec (word vector) unit can be used to vectorize the string sequences corresponding to the function feature information and the input data to obtain the first vector and the second vector. In some embodiments, the first vector and the second vector can also be normalized to reduce the classification model calculation overhead and improve data classification efficiency.

[0053] S1046: Generate the input feature based on the first vector and the second vector.

[0054] In some embodiments, the first vector and the second vector may be fused by using a fusion method such as vector superposition or splicing to obtain the input feature.

[0055] S106, inputting the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on a plurality of data samples annotated with data type information.

[0056] The data classification model may be a classification model constructed based on a neural network (eg, a convolutional neural network). This application does not limit the specific structure of the data classification model.

[0057] When training the data classification model, a data sample may be obtained. The data sample includes a sample input feature generated based on function feature information of a sample function and input data of the sample function, and data type information annotated for the sample input feature. The data type information indicates whether the input data of the sample function is valid data or invalid data.

[0058] Then, the data samples may be used to perform supervised training on the data classification model until the data classification model converges.

[0059] The trained data classification model can learn the function feature information corresponding to different types of input data. The data classification model can then be used to determine the classification result of the input data based on the function feature information of the function to be tested.

[0060] In the aforementioned technical solution, input features can be generated based on the function feature information of the function to be tested and the input data, and input into the neural network classification model for calculation to obtain data classification results, so that the neural network model can learn the mapping relationship between different types of input data and their corresponding function feature information, and classify the input data according to the function feature information, thereby achieving efficient and accurate data classification. Compared with the method of setting invalid input data rules, there is no need to enumerate invalid data rules, which is friendly to testers and has a better effect in determining invalid input data.

[0061] In some embodiments, the data classification result of the input data obtained in S106 can be used to eliminate invalid data in the input data set, filter out valid data in the input data set of the function to be tested, reduce the parameter range of the function to be tested, and improve test efficiency.

[0062] The input data set is a set consisting of various input data corresponding to the function to be tested in the code, which includes various parameter value combinations.

[0063] In this example, S108 may be executed to determine valid data in the input data set based on the data classification results corresponding to each input data in the input data set.

[0064] When executing 108 , steps S102 - S106 may be executed for each input data in the input data set to obtain a data classification result corresponding to each input data.

[0065] The data classification result can indicate whether the input data is valid data or invalid data. Then, the data classification result can be used to remove invalid data from the input data set, filter out valid data in the input data set of the function to be tested, reduce the parameter range of the function to be tested, and improve the test efficiency.

[0066] In some embodiments, after obtaining valid data, filtering rules can be used to perform secondary precision filtering on the data to further reduce the number of test cases and improve code testing efficiency.

[0067] In this example, S110 may be executed to filter the valid data using pre-maintained filtering rules to obtain final input data corresponding to the function to be tested.

[0068] The filtering rules can be set according to business needs. In some embodiments, the filtering rules can include static rules and dynamic rules. Among them, the static rules can include rules for invalid input data maintained based on historical test experience. Dynamic rules can include rules for invalid input data mined from data sources such as module logs and traffic generated during the test process.

[0069] When executing S110, the valid data filtered out by S108 can be matched with the maintained filtering rules, and the valid data matching the filtering rules can be filtered out, and the remaining valid data can be used as the final input data corresponding to the function to be tested. In this way, the filtering rules can be used to perform secondary accurate filtering on the data, further reducing the number of test cases and improving the efficiency of code testing.

[0070] In some embodiments, the function to be tested can be located at the function whose code has been changed, thereby reducing the number of functions to be tested and improving the efficiency of program code testing.

[0071] In some test scenarios, some of the multiple functions included in the code to be tested are changed functions, and some are unchanged functions. The unchanged functions may have been tested in other code tests, so the test of the code to be tested does not need to test the unchanged functions, but only tests the changed functions.

[0072] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of a method for determining a function to be tested shown in this application. Figure 3 As shown, the method shown may include S31 - S32 .

[0073] Among them, S31, obtains function change information.

[0074] The function change information indicates the function that has changed in the function included in the code to be tested. In some embodiments, the code to be tested can usually be maintained in a code library. The code library may include logic for generating function change information. The user calls the logic through an interface, so that the code library can provide function change information in the code to be tested.

[0075] S32: Determine the changed function indicated in the function change information as the function to be tested.

[0076] In this way, the functions that have been changed in the code to be tested can be determined as the functions to be tested that are actually tested, thereby reducing the number of functions to be tested and improving the efficiency of program code testing.

[0077] In some embodiments, functions associated with the changed function may also be determined as functions to be tested, thereby improving code testing effects.

[0078] The changed function will affect the associated functions associated with it. Therefore, in addition to testing the changed function, the associated functions also need to be tested.

[0079] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of a method for determining a function to be tested shown in this application. Figure 4 As shown, the method shown may include S41 - S42 .

[0080] Wherein, S41, based on the association relationship between the functions in the code to be tested, determining the associated function in the code to be tested that corresponds to the changed function.

[0081] The association relationship may include a calling relationship between functions. In some embodiments, the association relationship may be maintained by maintaining function link information or branch information in a code library. When executing S41, the association function may be determined based on the function link information or branch information maintained in the code library.

[0082] S42, determining the associated function as the function to be tested. Thus, the function associated with the changed function can also be determined as the function to be tested, that is, in addition to testing the changed function, the associated functions associated with it also need to be tested, thereby improving the code testing effect.

[0083] In some embodiments, in a scheme of constructing input features using source code and input data, invalid character strings in the source code may be deleted to reduce the length of input features, reduce the amount of model computation, and improve data classification efficiency.

[0084] See also Figure 5 , Figure 5 FIG. 1 is a flow chart of a method for generating input data shown in this application. Figure 5 As shown, when S104 is executed, S51-S53 may be executed.

[0085] Wherein, S51, converting the source code and the input data into a first string sequence and a second string sequence respectively.

[0086] In some embodiments, the function feature information and the input data may be parsed into character string sequences respectively by a parser.

[0087] S52: Delete invalid character strings in the first character string sequence.

[0088] The invalid character string may refer to a character string that is meaningless to the function characteristics of the function to be tested. In some embodiments, the invalid character string may include at least one of the following: characters corresponding to other functions in the source code except the function to be tested; line break characters; spaces. Thus, characters other than the function to be tested, spaces, line break characters, and other character strings that are meaningless to the function characteristics of the function to be tested can be deleted from the first character string sequence, thereby reducing input features and reducing model transportation volume.

[0089] S53: performing vectorization processing on the first character string sequence and the second character string sequence from which invalid characters are deleted, respectively, and obtaining the input feature based on the vectorization processing result.

[0090] It should be noted that the description of step S53 can refer to the aforementioned S1044-S1046 and will not be described in detail here.

[0091] Therefore, the input features can only include useful features, remove unobjectionable features, reduce model traffic, and improve data classification effects.

[0092] The following is an example description in conjunction with a specific code test scenario. This test uses source code as the function feature information of the function to be tested. The scheme of using function attribute information as the function feature information, and using function attribute information and source code together as the function feature information is not described in detail here.

[0093] The code is maintained in a code library, which maintains function change information of the code and function link information of the code.

[0094] See also Figure 6 , Figure 6 This is a schematic diagram of a code testing process shown in this application. Figure 6 As shown, the method may include S601-S611.

[0095] In S601, function change information can be obtained from the code base to determine the changed functions in the code, thereby testing the changed functions and improving code testing efficiency.

[0096] S602, obtaining function link information from the code library, and determining the associated functions that have a call relationship with the changed function, and then determining the changed function and the associated functions as the tested functions that need to be actually tested in this example. In addition to testing the changed function, the associated functions associated with it need to be tested, thereby improving the code testing effect.

[0097] S603: Obtain an input data set and source code corresponding to the function to be tested.

[0098] The input data set and source code can be specified by code developers and maintained in a code library. The input data set and source code can be obtained by calling a code library interface.

[0099] S604, serialize the source code using a parser to obtain a first string sequence. In the serialization process, characters corresponding to functions other than the function to be tested, invalid strings such as line break characters and spaces in the source code can be removed. This can reduce the amount of input feature data, reduce model overhead, and improve data classification efficiency.

[0100] S605: Perform vectorization processing on the first character string to obtain a first vector.

[0101] S606: Normalize the first vector.

[0102] S607: Perform vectorization processing on the input data in the input data set to obtain a second vector.

[0103] S608: Generate the input feature based on the first vector and the second vector, and input it into the trained data classification model for calculation to obtain the classification result of the input data, that is, whether the input data is valid data or invalid data.

[0104] The data classification model can be constructed based on a convolutional neural network. The trained data classification model can learn the function feature information corresponding to the valid and invalid input data, and then use the data classification model to determine whether the input data is valid data or invalid data according to the function feature information of the function to be tested.

[0105] S609: Filter out valid data in the input data set.

[0106] S610, performing secondary filtering on the valid data according to the pre-maintained filtering rules to obtain final input data, thereby further reducing the parameter range of the function to be tested and improving the test efficiency.

[0107] S611, generating a test case based on the final input data and the attribute information of the function to be tested, and testing the function to be tested to complete the code test.

[0108] In the aforementioned scenario, first, the changed functions can be tested to improve the code testing efficiency; second, in addition to testing the changed functions, the associated functions associated with them need to be tested to improve the code testing effect; third, the neural network model can be used to learn the characteristics of the mapping relationship between different types of input data and their corresponding function feature information, and classify the input data according to the function feature information, thereby achieving efficient and accurate data classification. Compared with the method of setting invalid input data rules, there is no need to exhaustively enumerate invalid data rules, which is friendly to testers and has a better effect in determining invalid input data.

[0109] Corresponding to the above-mentioned embodiment, the present application proposes a data processing device 70 .

[0110] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of a data processing device shown in this application.

[0111] like Figure 7 As shown, the device 70 may include:

[0112] An acquisition module 71 is used to acquire function characteristic information of a function to be tested and input data corresponding to the function to be tested;

[0113] A generating module 72, configured to generate an input feature corresponding to the input data based on the function feature information and the input data;

[0114] The input module 73 is used to input the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on multiple data samples labeled with data type information.

[0115] In some embodiments, the function feature information includes source code corresponding to the function to be tested, and / or attribute information corresponding to the function to be tested; the attribute information includes at least one of the following:

[0116] Function name; function path; function parameters; function parameter type; function return value; function branch expression; function call chain information; function process information.

[0117] In some embodiments, the device 70 further comprises:

[0118] A first determining module is used to obtain function change information; the function change information indicates the function that has changed among the functions included in the code to be tested;

[0119] The changed function indicated in the function change information is determined as the function to be tested.

[0120] In some embodiments, the device 70 further comprises:

[0121] A second determination module is used to determine the associated function corresponding to the changed function in the code to be tested based on the association relationship between the functions in the code to be tested;

[0122] The correlation function is determined as the function to be tested.

[0123] In some embodiments, the function feature information includes source code corresponding to the function to be tested; the generating module 72 is specifically used to:

[0124] Convert the source code and the input data into a first string sequence and a second string sequence respectively;

[0125] Deleting invalid character strings in the first character string sequence;

[0126] Vectorization processing is performed on the first character string sequence and the second character string sequence from which invalid characters are deleted, respectively, and the input feature is obtained based on the vectorization processing result.

[0127] In some embodiments, the input data includes data in an input data set corresponding to the function to be tested;

[0128] The device 70 further comprises:

[0129] The third determination module is used to determine the valid data in the input data set based on the data classification results respectively corresponding to each input data in the input data set.

[0130] In some embodiments, the device 70 further comprises:

[0131] The filtering module is used to filter the valid data using pre-maintained filtering rules to obtain final input data corresponding to the function to be tested.

[0132] The embodiments of the data processing device shown in the present application can be applied to electronic devices. Accordingly, the present application discloses an electronic device, which may include: a processor.

[0133] Memory used to store processor-executable instructions.

[0134] The processor is configured to call the executable instructions stored in the memory to implement the data processing method shown in any of the aforementioned embodiments.

[0135] See also Figure 8 , Figure 8 A schematic diagram of the hardware structure of an electronic device shown in this application.

[0136] like Figure 8 As shown, the electronic device may include a processor for executing instructions, a network interface for network connection, a memory for storing operating data for the processor, and a non-volatile memory for storing instructions corresponding to the state switching device.

[0137] The embodiments of the device can be implemented by software, hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of the electronic device in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, in addition to Figure 8 In addition to the processor, memory, network interface, and non-volatile memory shown, the electronic device in which the device in the embodiment is located may also include other hardware according to the actual function of the electronic device, which will not be described in detail.

[0138] It is understandable that, in order to increase the processing speed, the corresponding instructions of the data processing device may also be directly stored in the memory, which is not limited here.

[0139] The present application proposes a computer-readable storage medium, which stores a computer program. The computer program can be used to enable a processor to execute the data processing method shown in any of the aforementioned embodiments.

[0140] Those skilled in the art will appreciate that one or more embodiments of the present application may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program code.

[0141] The term “and / or” used in the present application indicates at least one of the two. For example, “A and / or B” includes three options: A, B, and “A and B”.

[0142] Each embodiment in the present application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the data processing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0143] The specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0144] The embodiments of the subject matter and functional operations described in this application can be implemented in the following: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this application and their structural equivalents, or a combination of one or more of them. The embodiments of the subject matter described in this application can be implemented as one or more computer programs, i.e., one or more modules in computer program instructions encoded on a tangible non-temporary program carrier to be executed by a data processing device or to control the operation of the data processing device. Alternatively or additionally, the program instructions can be encoded on an artificially generated propagation signal, such as a machine-generated electrical, optical or electromagnetic signal, which is generated to encode information and transmit it to a suitable receiver device for execution by a data processing device. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.

[0145] The processes and logic flows described in this application can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuits, such as FPGAs (field programmable gate arrays) or ASICs (application specific integrated circuits), and the apparatus can also be implemented as special purpose logic circuits.

[0146] Computers suitable for executing computer programs include, for example, general and / or special microprocessors, or any other type of central processing system. Typically, the central processing system will receive instructions and data from a read-only memory and / or a random access memory. The basic components of a computer include a central processing system for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, the computer will also include one or more large-capacity storage devices for storing data, such as magnetic disks, magneto-optical disks, or optical disks, or the computer will be operably coupled to this large-capacity storage device to receive data from it or to transmit data to it, or both. However, the computer does not necessarily have such a device. In addition, the computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, just to name a few.

[0147] Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including, for example, semiconductor memory devices (e.g., EPROM, EEPROM and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and 0xCD-00ROM and DVD-ROM disks. The processor and memory may be supplemented by or incorporated in special purpose logic circuitry.

[0148] Although the application includes many specific implementation details, these should not be interpreted as limiting any disclosed scope or the scope of protection claimed, but are mainly used to describe the features of specific disclosed specific embodiments. Certain features described in multiple embodiments in the application can also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment can also be implemented separately in multiple embodiments or implemented with any suitable sub-combination. In addition, although the feature can work in some combinations as described above and even initially claim protection, one or more features from the claimed combination can be removed from the combination in some cases, and the claimed combination can point to a variation of a sub-combination or a sub-combination.

[0149] Similarly, although operations are depicted in a particular order in the accompanying drawings, this should not be understood as requiring that these operations be performed in the particular order shown or performed sequentially, or requiring that all illustrated operations be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. In addition, the separation of various system modules and components in the described embodiments should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product, or packaged into multiple software products.

[0150] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired results. In some implementations, multitasking and parallel processing may be advantageous.

[0151] The above description is merely a preferred embodiment of one or more embodiments of the present application and is not intended to limit one or more embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present application shall be included in the scope of protection of one or more embodiments of the present application.

Claims

1. A data processing method, comprising: Obtaining function feature information of a function to be tested and input data corresponding to the function to be tested, wherein the function to be tested refers to a function that needs to be tested in code testing, the function feature information corresponds to the function to be tested and is used to characterize any type of features possessed by the function to be tested, and the input data is data obtained by combining multiple parameters of the function to be tested within their respective value ranges; Based on the function feature information and the input data, generating input features corresponding to the input data, wherein the input features are used to input a data classification model to perform data classification; The input features are input into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on multiple data samples labeled with data type information, wherein the data classification result includes valid input data and invalid input data.

2. According to the method of claim 1, the function feature information includes source code corresponding to the function to be tested, and / or attribute information corresponding to the function to be tested; the attribute The information includes at least one of the following: Function name; function path; function parameters; function parameter type; function return value; function branch expression; function call chain information; function process information.

3. The method according to claim 1, further comprising: Get function change information; The function change information indicates the function that has been changed among the functions included in the code to be tested; The changed function indicated in the function change information is determined as the function to be tested.

4. The method according to claim 3, further comprising: Determine, based on the association relationship between the functions in the code to be tested, an associated function in the code to be tested corresponding to the changed function; The correlation function is determined as the function to be tested.

5. The method according to claim 1, wherein the function feature information includes source code corresponding to the function to be tested; The step of generating input features corresponding to the input data based on the function feature information and the input data includes: Convert the source code and the input data into a first string sequence and a second string sequence respectively; Deleting invalid character strings in the first character string sequence; Vectorization processing is performed on the first character string sequence and the second character string sequence from which invalid characters are deleted, respectively, and the input feature is obtained based on the vectorization processing result.

6. The method according to any one of claims 1 to 5, wherein the input data comprises data in an input data set corresponding to the function to be tested; The method further comprises: Based on the data classification results respectively corresponding to each input data in the input data set, valid data in the input data set is determined.

7. The method according to claim 6, further comprising: The valid data is filtered using the pre-maintained filtering rules to obtain the final input data corresponding to the function to be tested.

8. A data processing device, comprising: An acquisition module, used for acquiring function characteristic information of a function to be tested and input data corresponding to the function to be tested, wherein the function to be tested refers to a function that needs to be tested in code testing, the function characteristic information corresponds to the function to be tested, and is used to characterize any type of characteristics possessed by the function to be tested, and the input data is data obtained by combining multiple parameters of the function to be tested within their respective value ranges; A generating module, configured to generate input features corresponding to the input data based on the function feature information and the input data, wherein the input features are used to input a data classification model to perform data classification; An input module is used to input the input features into a data classification model to obtain a data classification result corresponding to the input data; wherein the data classification model includes a neural network model trained based on multiple data samples labeled with data type information, wherein the data classification result includes valid input data and invalid input data.

9. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the data processing method according to any one of claims 1 to 7 by running the executable instructions.

10. A computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program is used to enable a processor to execute the data processing method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Screening method and device of test data

    CN103218297A

  • Single classifier anomaly detection method based on multilayer random neural network

    CN109858509A

  • A software fuzzy test method and device based on path record truncation

    CN109885479A

  • Data processing method and device

    CN110490244A

  • Sequence labeling method and system, computer equipment and computer readable storage medium

    CN110866115A