A method and device for implementing service request testing
By performing feature extraction and clustering on service request data, a request classification model is generated, which solves the problem of high cost of manually constructing test data in the existing technology, enables efficient service request testing, and improves test coverage comprehensiveness.
Patent Information
- Application Number
- CN202010124229.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-27
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2040-02-27
AI Technical Summary
The existing service request testing process requires a large amount of manual construction of test data, resulting in high labor costs and time costs, and incomplete test coverage.
By obtaining service request data, perform feature extraction and clustering, generate training data, train the request classification model, use the model to classify new data, update the test data set, and conduct service request testing.
It reduces the labor cost in service request testing, improves the comprehensiveness of test coverage, and reduces testing costs.
Smart Images

Figure CN113312252B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method and device for implementing a service request test. Background Art
[0002] At present, in some service request testing processes similar to stress testing, a test data set consisting of a large amount of service request data is required. Among them, stress testing refers to sending service requests in parallel to the tested object through a stress tool to obtain relevant indicators of the tested object's response to the service request.
[0003] However, since the service request data in the test data set is usually constructed manually, the service request testing process needs to consume a lot of manpower costs to construct the test data set, thus increasing the service request testing cost. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a method and apparatus for implementing service request testing, which can effectively reduce the manpower cost in the service request testing process and reduce the service request testing cost.
[0005] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:
[0006] A method for implementing a service request test, the method comprising:
[0007] Obtaining first service request data;
[0008] Performing feature extraction on the first service request data to generate first training data;
[0009] Clustering the first training data to obtain categories corresponding to each of the first service request data;
[0010] Using the first service request data and the category corresponding to the first service request data as second training data, training and generating a request classification model;
[0011] When the first preset time is reached, classifying the second service request data using the request classification model to obtain a category corresponding to the second service request data;
[0012] Updating the test data set with second service request data of different categories;
[0013] A service request test is performed using the test data set.
[0014] In a possible implementation manner, after clustering the first training data to obtain a category corresponding to each of the first service request data, the method further includes:
[0015] Extracting a first amount of service request data from the first service request data of each category to obtain first target service request data;
[0016] Verifying the validity of the clustering result according to the first service request data and the first target service request data;
[0017] If the clustering result validity verification fails, re-execute the obtaining of the first service request data and subsequent steps;
[0018] The step of using the first service request data and the category corresponding to the first service request data as second training data to train and generate a request classification model includes:
[0019] If the clustering result passes the validity verification, the first service request data and the category corresponding to the first service request data are used as second training data to train and generate a request classification model.
[0020] In a possible implementation manner, verifying the validity of the clustering result according to the first service request data and the first target service request data includes:
[0021] Calculate a first code coverage rate according to the first service request data;
[0022] Calculate a second code coverage rate according to the first target service request data;
[0023] If the difference between the first code coverage and the second code coverage is less than a first threshold, the clustering result validity verification passes;
[0024] If the difference between the first code coverage and the second code coverage is greater than or equal to a first threshold, the clustering result validity verification fails.
[0025] In a possible implementation manner, after clustering the first training data to obtain a category corresponding to each of the first service request data, the method further includes:
[0026] Using different categories of first service request data to train and generate a test data generation model;
[0027] The test data generation model is used to generate third service request data of different categories, and the third service request data of different categories are added to the test data set.
[0028] In a possible implementation, extracting features from the first service request data to generate first training data includes:
[0029] Obtaining a characteristic value of a request parameter in each piece of the first service request data;
[0030] Calculating characteristic data of the first service request data according to the characteristic value of the request parameter and the weight value corresponding to the request parameter;
[0031] The feature data of each of the first service request data are combined into first training data.
[0032] In a possible implementation manner, clustering the first training data to obtain a category corresponding to each of the first service request data includes:
[0033] Clustering the first training data to obtain at least one category of first training data and outlier first training data;
[0034] The first service request data corresponding to the first training data of each category are respectively classified into the same category, and the first service request data corresponding to the outlier first training data are classified into one category, so as to obtain the category corresponding to each of the first service request data.
[0035] In a possible implementation, the method further includes:
[0036] When a second preset time is reached, extracting a second amount of service request data from the second service request data of each category to obtain second target service request data;
[0037] Performing validity verification of the classification result according to the second service request data and the second target service request data;
[0038] If the validity verification of the classification result is passed, continue to perform the service request test using the test data set;
[0039] If the validity verification of the classification result fails, the step of obtaining the first service request data and subsequent steps are re-executed.
[0040] In a possible implementation, the verifying the validity of the classification result according to the second service request data and the second target service request data includes:
[0041] Calculate a third code coverage rate according to the second service request data;
[0042] Calculate a fourth code coverage rate according to the second target service request data;
[0043] If the difference between the third code coverage and the fourth code coverage is less than the second threshold, the validity verification of the classification result is passed;
[0044] If the difference between the third code coverage and the fourth code coverage is greater than or equal to the second threshold, the classification result validity verification fails.
[0045] A device for implementing a service request test, the device comprising:
[0046] A request data acquisition unit, configured to acquire first service request data;
[0047] A training data generating unit, configured to extract features from the first service request data to generate first training data;
[0048] a request category determination unit, configured to cluster the first training data to obtain a category corresponding to each of the first service request data;
[0049] a classification model training unit, configured to train and generate a request classification model by using the first service request data and the category corresponding to the first service request data as second training data;
[0050] a request category generating unit, configured to classify the second service request data using the request classification model to obtain a category corresponding to the second service request data when a first preset time is reached;
[0051] A test data updating unit, used for updating second service request data of different categories into the test data set;
[0052] The service request testing unit is used to perform a service request test using the test data set.
[0053] In a possible implementation manner, the device further includes:
[0054] A first data extraction unit is configured to, after clustering the first training data to obtain categories corresponding to each of the first service request data, extract a first number of service request data from the first service request data of each category to obtain first target service request data;
[0055] A clustering result verification unit, used to verify the validity of the clustering result according to the first service request data and the first target service request data;
[0056] A first processing loop unit, configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the clustering result validity verification fails;
[0057] The classification model training unit is specifically used to: if the clustering result validity verification is passed, use the first service request data and the category corresponding to the first service request data as second training data to train and generate a request classification model.
[0058] In a possible implementation, the clustering result verification unit includes:
[0059] A first coverage calculation subunit, configured to calculate a first code coverage according to the first service request data;
[0060] A second coverage calculation subunit, configured to calculate a second code coverage according to the first target service request data;
[0061] A first clustering verification determination subunit, configured to verify that the clustering result validity passes if the difference between the first code coverage and the second code coverage is less than a first threshold;
[0062] The second clustering verification determination subunit is used to determine that if the difference between the first code coverage and the second code coverage is greater than or equal to a first threshold, the clustering result validity verification fails.
[0063] In a possible implementation manner, the device further includes:
[0064] A generation model training unit, configured to, after clustering the first training data to obtain the category corresponding to each of the first service request data, train and generate a test data generation model using the first service request data of different categories;
[0065] The test data adding unit is used to generate third service request data of different categories by using the test data generation model, and add the third service request data of different categories to the test data set.
[0066] In a possible implementation, the training data generating unit includes:
[0067] A parameter characteristic acquisition subunit, used to acquire a characteristic value of a request parameter in each piece of the first service request data;
[0068] A request feature calculation subunit, configured to calculate feature data of the first service request data according to feature values of the request parameters and weight values corresponding to the request parameters;
[0069] The training data generating subunit is used to combine the feature data of each of the first service request data into first training data.
[0070] In a possible implementation, the request category determination unit includes:
[0071] a training data clustering subunit, configured to cluster the first training data to obtain at least one category of first training data and outlier first training data;
[0072] The request category determination subunit is used to classify the first service request data corresponding to the first training data of each category into the same category, classify the first service request data corresponding to the outlier first training data into one category, and obtain the category corresponding to each of the first service request data.
[0073] In a possible implementation manner, the device further includes:
[0074] A second data extraction unit, configured to extract a second amount of service request data from the second service request data of each category to obtain second target service request data when a second preset time is reached;
[0075] A classification result verification unit, used to verify the validity of the classification result according to the second service request data and the second target service request data;
[0076] The service request testing unit is specifically used to: if the validity verification of the classification result is passed, use the test data set to perform a service request test;
[0077] The second processing loop unit is configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the classification result validity verification fails.
[0078] In a possible implementation, the classification result verification unit includes:
[0079] A third coverage calculation subunit, configured to calculate a third code coverage according to the second service request data;
[0080] a fourth coverage calculation subunit, configured to calculate a fourth code coverage according to the second target service request data;
[0081] A first classification verification determination subunit, configured to verify that the classification result validity passes if the difference between the third code coverage and the fourth code coverage is less than a second threshold;
[0082] The second classification verification determination subunit is used to determine that if the difference between the third code coverage and the fourth code coverage is greater than or equal to a second threshold, the classification result validity verification fails.
[0083] A device for implementing a service request test includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:
[0084] Obtaining first service request data;
[0085] Performing feature extraction on the first service request data to generate first training data;
[0086] Clustering the first training data to obtain categories corresponding to each of the first service request data;
[0087] Using the first service request data and the category corresponding to the first service request data as second training data, training and generating a request classification model;
[0088] When the first preset time is reached, classifying the second service request data using the request classification model to obtain a category corresponding to the second service request data;
[0089] Updating the test data set with second service request data of different categories;
[0090] A service request test is performed using the test data set.
[0091] A computer-readable medium stores instructions which, when executed by one or more processors, enable a device to execute the method for implementing a service request test.
[0092] It can be seen that the embodiments of the present application have the following beneficial effects:
[0093] In the method for implementing service request testing provided by the embodiment of the present application, after obtaining the first service request data, the first service request data is firstly feature extracted to generate the first training data, and the first training data is clustered to obtain the categories corresponding to each first service request data; the first service request data and the categories corresponding to the first service request data are then used as the second training data to train and generate a request classification model, so that when the first preset time is reached, the second service request data is first classified using the request classification model to obtain the categories corresponding to the second service request data; then the second service request data of different categories are updated to the test data set, and the service request test is performed using the updated test data set. Among them, because the test data set is generated based on the second service request data, there is no need to consume labor costs to construct the test data set in the service request test, so that the labor cost of the service request test process can be effectively reduced, thereby reducing the service request test cost. In addition, the test data set is composed of multiple categories of second service request data, so that a large number of service request data are used in the service request test process, which is conducive to improving the comprehensiveness of the test coverage of the service request test. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 A schematic diagram of a framework of an exemplary application scenario of a method for implementing a service request test provided in an embodiment of the present application;
[0095] Figure 2 A flow chart of a method for implementing a service request test provided in an embodiment of the present application;
[0096] Figure 3 An example diagram of a portion of the process of implementing a service request test provided in an embodiment of the present application;
[0097] Figure 4 A schematic diagram of the structure of a device for implementing a service request test provided in an embodiment of the present application;
[0098] Figure 5 A schematic diagram of the structure of a device for implementing a service request test provided in an embodiment of the present application;
[0099] Figure 6 A schematic diagram of the structure of a server device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0100] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0101] In order to facilitate the understanding and explanation of the technical solutions provided by the embodiments of the present application, the background technology of the present application will be described below.
[0102] The inventor discovered in his research on traditional service request testing that the service request data used in the service request testing process is manually constructed. However, since a large amount of service request data is required in the service request testing process, a large amount of manpower and time are required to construct these service request data in the service request testing process, which results in relatively high manpower and time costs in the service request testing process, and increases the cost of service request testing. In addition, since the similarity of manually constructed service requests is relatively high, the types of manually constructed service requests are single, resulting in the use of less types of service request data in the service request testing process, which makes the test coverage of the service request testing process incomplete.
[0103] Based on this, an embodiment of the present application provides a method for implementing a service request test, the method comprising: obtaining first service request data; performing feature extraction on the first service request data to generate first training data; clustering the first training data to obtain categories corresponding to each first service request data; using the first service request data and the categories corresponding to the first service request data as second training data, and training to generate a request classification model; when a first preset time is reached, using the request classification model to classify the second service request data to obtain the categories corresponding to the second service request data; updating second service request data of different categories into a test data set; and performing a service request test using the test data set.
[0104] Among them, because the test data set includes the service request data used in the service request test process, and the test data set is generated based on the existing second service request data, the service request data used in the service request test process are all generated based on the existing service request data, without the need for manual construction, which can effectively reduce the labor cost and time cost of the service request test process, and is conducive to reducing the service request test cost. In addition, because the test data set is composed of multiple categories of second service request data, a large variety of service request data are used in the service request test process, which is conducive to improving the comprehensiveness of the test coverage of the service request test.
[0105] In order to facilitate understanding of the method for implementing a service request test provided in the embodiment of the present application, Figure 1 The application scenario of the method for implementing the service request test provided in the embodiment of the present application is described. Figure 1 The schematic diagram of the framework of an exemplary application scenario of the method for implementing the service request test provided in the embodiment of the present application is shown in FIG.
[0106] In actual applications, after the server 101 obtains the first service request data, the server 101 first extracts features from the first service request data to generate first training data, and clusters the first training data to obtain categories corresponding to each first service request data; the server 101 then uses the first service request data and the categories corresponding to the first service request data as second training data, trains and generates a request classification model, so that when the first preset time is reached, the server 101 first uses the request classification model to classify the second service request data to obtain the category corresponding to the second service request data; the server 101 then updates the second service request data of different categories into the test data set, and uses the updated test data set to perform a service request test, so that the server 101 can send the test results of the service request test to the terminal 102 for display.
[0107] Those skilled in the art will understand that Figure 1 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.
[0108] It should be noted that the terminal 102 can be carried on a terminal, which can be any user device that is currently in development, under development, or developed in the future, and can interact with each other through any form of wired and / or wireless connection (e.g., Wi-Fi, LAN, cellular, coaxial cable, etc.), including but not limited to: smart wearable devices, smart phones, non-smart phones, tablet computers, laptop personal computers, desktop personal computers, minicomputers, mid-size computers, mainframe computers, etc. that are currently in development, under development, or developed in the future. The implementation of the present application is not limited in this regard. It should also be noted that the server 101 in the embodiment of the present application can be an example of a device that is currently in development, under development, or developed in the future, and can provide a service request test to the terminal 102. The implementation of the present application is not limited in this regard.
[0109] To facilitate understanding of the technical solution provided in the embodiment of the present application, the method for implementing the service request test provided in the embodiment of the present application will be described below in conjunction with the accompanying drawings.
[0110] See also Figure 2 , which is a flow chart of the method for implementing service request testing provided in an embodiment of the present application.
[0111] The method for implementing a service request test provided in an embodiment of the present application includes S201-S207:
[0112] S201: Acquire first service request data.
[0113] The first service request data can be used for clustering, and the clustering result and the first service request data can also be used to train the data of the request classification model. The relevant content of clustering can be found in S202-S203 below, and the relevant content of the request classification model can be found in S204 below.
[0114] The first service request data may be historical online service request data. The online service request data refers to service request data obtained during the actual application process of the tested object. The embodiment of the present application does not limit the tested object, for example, the tested object may be a software or hardware device.
[0115] In the embodiment of the present application, in order to implement the service request test, the first service request data can be first obtained from the historical service request data obtained in the actual application process of the tested object, so that the first service request data can be used to cluster and train the generated request classification model. Figure 3 As shown, S201 may specifically be: obtaining 300,000 pieces of first service request data from historical service request data obtained during the actual application of the tested object. The 300,000 pieces of first service request data can basically cover all types of service request data, so that the request classification model generated by training based on the 300,000 pieces of first service request data can accurately classify each newly obtained service request data.
[0116] It should be noted that in order to better utilize the first service request data to train and generate a request classification model, in an embodiment of the present application, a clustering algorithm can be used to cluster the first service request data first, so that a request classification model can be trained and generated based on the categories corresponding to the clustered first service request data.
[0117] S202: Extract features from the first service request data to generate first training data.
[0118] In an embodiment of the present application, in order to ensure the clustering effect of the first service request data, after the first service request data is acquired, features of the first service request data can be extracted, and first training data can be generated based on the extracted features of the first service request data, so that the first service request data can be clustered subsequently with the help of clustering of the feature data in the first training data.
[0119] For example, assuming that the number of first service request data is 300,000, the i-th first service request data corresponds to the i-th feature data, i being a positive integer. Based on this assumption, S202 may specifically be: firstly extracting features from the i-th first service request data to obtain the i-th feature data, i being a positive integer; and then taking the set of the 1st feature data to the 300,000th feature data as the first training data, so that the clustering of the 1st first service request data to the 300,000th first service request data can be achieved later by clustering the 1st feature data to the 300,000th feature data in the first training data.
[0120] In addition, the embodiment of the present application also provides an implementation method for extracting features from the first service request data. Please refer to the specific implementation method below.
[0121] S203: Clustering the first training data to obtain categories corresponding to each first service request data.
[0122] The embodiment of the present application does not limit the clustering method used when clustering the first training data. For example, a hierarchical density-based spatial clustering of applications with noise (HDBSCAN) algorithm may be used when clustering the first training data.
[0123] The categories corresponding to each first service request data are used to characterize the similarity between different first service request data after clustering, specifically: if the categories corresponding to two first service request data are the same, it means that the two first service request data are highly similar and belong to the same type of service requests; if the categories corresponding to the two first service request data are different, it means that the two first service request data are less similar and belong to different types of service requests.
[0124] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the first training data, the clustering result of the first training data can be used to determine the clustering result of the first service request data. That is, the first training data is clustered first, and then based on the clustering result of the first training data, the first service request data with a high degree of similarity are classified into the same category, and the first service request data with a low degree of similarity are classified into different categories, thereby achieving the purpose of extracting service request type information from a large amount of first service request data.
[0125] It should be noted that in some cases, the clustering results may include some outliers that do not belong to any category (e.g. Figure 3At this time, in order to ensure the integrity of the data, the embodiment of the present application will retain these outliers and classify them into the same category (such as Figure 3 For example, using HDBSCAN to cluster 300,000 feature data in the first training data, 20 categories and 300 outliers are obtained, and the 300 outliers can be used as the 21st category.
[0126] In addition, the embodiment of the present application also provides an implementation method for obtaining the category corresponding to the first service request data. Please refer to the specific implementation method below.
[0127] S204: Using the first service request data and the category corresponding to the first service request data as second training data, and training to generate a request classification model.
[0128] The embodiments of the present application do not limit the request classification model. For example, the request classification model can be any binary classification model.
[0129] In an embodiment of the present application, after obtaining the category corresponding to the first service request data, the category corresponding to the first service request data can be used as a label of the first service request data, and second training data can be constructed based on each first service request data and its label, and then the constructed second training data can be used to train and generate a request classification model, so that the request classification model can be used to classify the newly acquired service request data (that is, the data to be tested in each test cycle) subsequently.
[0130] In addition, the embodiment of the present application also provides an implementation method for training and generating a request classification model. Please refer to the specific implementation method below.
[0131] S205: When the first preset time is reached, the second service request data is classified using the request classification model to obtain a category corresponding to the second service request data.
[0132] The first preset time refers to the time when test data needs to be generated for the current service request test. For example, when the service request test is performed on Mondays every week, the first preset time may refer to a time earlier than a preset time period on Mondays every week. The preset time period may be set according to the application scenario, for example, the preset time period may be 24 hours, that is, the first preset time may refer to Sundays every week.
[0133] The second service request data is historical online service request data that is closer to the current time. For example, assuming that a service request test is performed every week, the second service request data may refer to online service request data during the week before the current service request test occurs.
[0134] Based on the above content, it can be known that in an embodiment of the present application, when the first preset time is reached, the request classification model is used to classify the second service request data to obtain the category corresponding to the second service request data. For example, assume that the service request test is performed every Monday and the first preset time is every Sunday. Based on this assumption, S205 can be specifically: when it is determined that the current time is Sunday, 300,000 service request data are first obtained from the online service request data from Monday to Saturday of the current week as the second service request data; then the trained request classification model is used to classify the 300,000 second service request data, and the category corresponding to each second service request data is obtained, so that the test data set used in the service request test process can be updated based on the category corresponding to each second service request data.
[0135] S206: Update the second service request data of different categories into the test data set.
[0136] In the embodiment of the present application, after determining the category corresponding to the second service request data, the test data set can be updated using the second service request data in each category, which is specifically: the test data set can be updated using all or part of the second service request data in each category. Among them, because the test data set is generated based on the second service request data under each category, the test data set includes a comprehensive range of service request data, thereby improving the comprehensiveness of the test coverage of the service request test based on the test data set.
[0137] S207: Perform service request testing using the test data set.
[0138] In the embodiment of the present application, after obtaining the test data set, the service request test can be performed using the test data set. For example, after obtaining the test data set on Sunday, the service request test can be performed using the test data set on the following Monday to determine the response effect of the tested object to the service request during this week.
[0139] Based on the relevant contents of the above steps S201 to S207, it can be known that after obtaining the first service request data, the first service request data is firstly feature extracted to generate the first training data, and the first training data is clustered to obtain the categories corresponding to each first service request data; then the first service request data and the categories corresponding to the first service request data are used as the second training data to train and generate a request classification model, so that when the first preset time is reached, the second service request data is first classified using the request classification model to obtain the categories corresponding to the second service request data; then the second service request data of different categories are updated to the test data set, and the service request test is performed using the updated test data set. Among them, because the test data set is generated based on the second service request data, there is no need to consume labor costs to construct the test data set in the service request test, which can effectively reduce the labor cost of the service request test process, thereby reducing the service request test cost. In addition, because the test data set is composed of multiple categories of second service request data, a large number of service request data are used in the service request test process, which is conducive to improving the comprehensiveness of the test coverage of the service request test.
[0140] In some cases, not only can the historical online service request data be used to perform the service request test, but also the generated service request data can be used to perform the service request test. Based on this, the embodiment of the present application also provides another implementation of the method for implementing the service request test. In this implementation, the method for implementing the service request test includes the following two steps A1-A2 in addition to the above S201 to S207:
[0141] A1: Use different categories of first service request data to train and generate test data generation models.
[0142] The embodiments of the present application do not limit the test data generation model. For example, the test data generation model may be a Long Short-Term Memory (LSTM) model.
[0143] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the category corresponding to the first service request data, the test data generation model can be trained and generated using the first service request data of different categories, so that the test data generation model can generate service request data under each category. Figure 3 As shown, the test data generation model can be trained using 300,000 first service request data of 21 categories.
[0144] A2: Generate third service request data of different categories using the test data generation model, and add the third service request data of different categories to the test data set.
[0145] In an embodiment of the present application, after obtaining the test data generation model, the test data generation model can be used to generate different categories of third service request data, and the different categories of third service request data can be added to the test data set, so that the test data set can include online service request data and construction service request data, thereby improving the diversity of the test data set and facilitating improving the comprehensiveness of test coverage of service request tests based on the test data set.
[0146] Based on the contents of the above two steps, it can be known that in an embodiment of the present application, after determining the category corresponding to the first service request data, the category corresponding to the first service request data can be used to generate a request classification model and a test data generation model respectively, so that the historical online service request data of each category determined by the request classification model and the constructed service request data of each category generated by the test data generation model can be used simultaneously subsequently, thereby improving the diversity of the test data set, which is conducive to improving the comprehensiveness of the test coverage of the service request test based on the test data set.
[0147] In a possible implementation, in order to further improve the effectiveness of the request classification model and / or the test data generation model, the effectiveness of the clustering process can be judged before training the request classification model and / or the test data generation model. Based on this, the embodiment of the present application also provides another implementation of the method for implementing the service request test. In this implementation, the method for implementing the service request test includes the following four steps B1-B4 in addition to some or all of the above steps:
[0148] B1: extracting a first quantity of service request data from the first service request data of each category to obtain first target service request data.
[0149] The first number may be set according to an application scenario, so that the first number of service request data in each category can represent all service request data in the category.
[0150] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the category corresponding to the first service request data, a first number of service request data can be extracted from the first service request data of each category to obtain the first target service request data. Figure 3 As shown, when the clustering algorithm is used to obtain 20 categories of first service request data and the 21st category of first service request data including 300 discrete points, 100 data are extracted from each of the 1st category of first service request data to the 20th category of first service request data, and all 300 data are extracted from the 21st category of first service request data, so that the extracted 2300 data are used as the first target service request data.
[0151] B2: Verify the validity of the clustering result according to the first service request data and the first target service request data.
[0152] In an embodiment of the present application, after obtaining the category corresponding to the first target service request data, the validity of the clustering result can be verified based on the first service request data and the first target service request data, so that it can be subsequently determined based on the verification result whether to use the clustering result to train and generate a request classification model and / or a test data generation model.
[0153] In addition, the embodiments of the present application do not limit the verification method of the validity of the clustering results. For example, the validity of the clustering results can be verified by means of code coverage, which can be specifically: the first code coverage is calculated based on the first service request data; the second code coverage is calculated based on the first target service request data; if the difference between the first code coverage and the second code coverage is less than the first threshold, the clustering result validity verification is passed; if the difference between the first code coverage and the second code coverage is greater than or equal to the first threshold, the clustering result validity verification fails. Among them, the first threshold can be set according to the application scenario.
[0154] In practical applications, the first code coverage rate is obtained from the first service request data, which can characterize the proportion of codes involved in the first service request data. After clustering, if the clustering result is good, the first target service request data extracted from the first service request data of each category should be able to represent the first service request. That is, the second code coverage rate corresponding to the first target service request data should be close to the first code coverage rate, and the difference between the first code coverage rate and the second code coverage rate is less than the first threshold. If the clustering effect is not good, for example, the first service request data that should be clustered into two categories (category A and category B) is clustered into one category, when the first target service request data is extracted from the first service request data of this category, only the first target service request data of category A may be extracted, and the first target service request data of category B may not be extracted. Then the second code coverage rate corresponding to the first target service request data is far from the first code coverage rate, that is, the difference between the first code coverage rate and the second code coverage rate will be greater than or equal to the first threshold. In this way, by judging whether the difference between the first code coverage rate and the second code coverage rate is less than the first threshold, the effectiveness of the clustering result can be verified.
[0155] B3: If the clustering result validity verification fails, the above-mentioned steps of obtaining the first service request data and subsequent steps (ie, S201 to S203) are re-executed.
[0156] In the embodiment of the present application, when it is determined that the clustering result validity verification fails, it means that the clustering result performance is poor. At this time, if these clustering results with poor performance are used to train and generate request classification models and / or test data generation models, it will cause the request classification model and / or test data generation model to have poor performance, thereby reducing the service request test performance. Based on this, it can be seen that in order to improve the service request test performance, when it is determined that the clustering result validity verification fails, the above S201 to S203 should be re-executed so that a clustering result that can pass the clustering result validity verification can be obtained.
[0157] B4: If the validity verification of the clustering result is passed, the first service request data and the category corresponding to the first service request data are used as the second training data to train and generate a request classification model; and / or, the test data generation model is generated by training using first service request data of different categories.
[0158] In an embodiment of the present application, when it is determined that the clustering result validity verification has passed, it means that the clustering result has good performance. At this time, these clustering results with good performance can be used to train and generate request classification models and / or test data generation models. In this way, a request classification model and / or test data generation model with good performance can be obtained, which is beneficial to improve the service request test performance.
[0159] In addition, in order to facilitate the understanding of the method of implementing service request testing including the above four steps, Figure 3 The method for implementing service request testing shown is used as an example to illustrate.
[0160] like Figure 3 As shown, the method for implementing the service request test may include the following steps:
[0161] (1): Obtain 300,000 first service request data from the historical service request data obtained during the actual application process of the test object.
[0162] (2): Feature extraction is performed on 300,000 pieces of first service request data to generate first training data, and the first training data is clustered to obtain first training data of 20 categories and clustering results consisting of 300 discrete first training data. The first service request data corresponding to the first training data of the first category are then classified into the same category (for example, category 1), and the first service request data corresponding to the first training data of the second category are classified into the same category (for example, category 2), and so on, to obtain a total of 20 categories of data, and each category of the 20 categories of data includes at least one piece of first service request data. Finally, the first service request data corresponding to the 300 outlier first training data are classified into one category (for example, category 21) to obtain category 21 data.
[0163] (3): 100 first service request data are extracted from the 1st to 20th categories of data respectively, and all 300 first service request data are extracted from the 21st category of data, and all are used as the first target service request data.
[0164] (4): Use 300,000 first service request data and 2,300 first target service request data to verify the effectiveness of the clustering results.
[0165] (5): When it is determined that the validity of the clustering result has been verified, 300,000 pieces of first service request data and the categories corresponding to each piece of first service request data are used as the second training data to train and generate a request classification model and a test data generation model, so that when the first preset time is reached, the request classification model is used to classify the second service request data to obtain the category corresponding to the second service request data, and the second service request data of different categories are updated into the test data set, and the service request test is performed using the test data set.
[0166] Based on the relevant content of the above five steps, it can be known that in an embodiment of the present application, after obtaining the clustering result of the first service request data, the clustering result validity can be verified first, so that the clustering result that has passed the clustering result validity verification can be used to train and generate a request classification model and / or a test data generation model. This can effectively avoid the adverse effects of clustering results with poor performance on the performance of the request classification model and / or the test data generation model, thereby improving the performance of the request classification model and / or the test data generation model, and further helping to improve the service request test performance.
[0167] In some cases, the first service request data may carry both meaningless fields with low analysis value and meaningful fields with high analysis value. In this case, in order to improve the accuracy of the analysis of the first service request data, the weight value can be used to reduce the impact of the meaningless fields on the analysis of the first service request data, and increase the impact of the meaningful fields on the analysis of the first service request data. Based on this, the embodiment of the present application also provides an implementation method for feature extraction (that is, S202) of the first service request data, which can specifically include the following steps C1-C3:
[0168] C1: Obtain characteristic values of request parameters in each piece of first service request data.
[0169] The request parameter is used to characterize the request information in the first service request data.
[0170] In addition, the embodiment of the present application does not limit the request parameters. For example, when the first service request data is http: / / www.sogou.com / ?a=4&test=oc&type=web&loc=beijing, the request parameters in the first service request data may be: a=4, test=oc, type=web, loc=beijing.
[0171] The characteristic value of the request parameter is used to characterize the characteristic information of the request parameter; moreover, the embodiment of the present application does not limit the method for obtaining the characteristic value of the request parameter. For example, the characteristic value of the request parameter can be obtained by means of the mapping relationship between the request parameter and the characteristic value. It should be noted that the mapping relationship between the request parameter and the characteristic value can be preset.
[0172] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the first service request data, the characteristic values of the request parameters in each first service request data can be obtained respectively, so that the characteristic data of each first service request data can be generated respectively based on the characteristic values of the request parameters in each first service request data. Among them, the process of obtaining the characteristic values of the request parameters in the first service request data can be: firstly parse the first service request data to obtain the request parameters in the first service request data; and then use the mapping relationship between the request parameters and the characteristic values to determine the characteristic values of the request parameters in the first service request data.
[0173] C2: Calculate and obtain characteristic data of the first service request data according to the characteristic value of the request parameter and the weight value corresponding to the request parameter.
[0174] The weight value corresponding to the request parameter is used to characterize the influence of the request parameter on the analysis of the first service request data, and the larger the weight value corresponding to the request parameter, the greater the influence of the request parameter on the analysis of the first service request data. It should be noted that the weight value corresponding to the request parameter can be preset.
[0175] Based on the above content, it can be known that in the embodiment of the present application, for each first service request data, after obtaining the characteristic value of the request parameter in the first service request data, the characteristic value of each request parameter can be multiplied by the weight value corresponding to the request parameter to obtain the characteristic data of the first service request data. Among them, because the weight value corresponding to the request parameter can accurately characterize the influence of the request parameter on the analysis of the first service request data, the characteristic data of the first service request data calculated based on the weight value corresponding to the request parameter can reduce the influence of meaningless fields on the analysis of the first service request data, and increase the influence of meaningful fields on the analysis of the first service request data, so that the characteristic data of the first service request data can more accurately characterize the characteristic information of the first service request data.
[0176] C3: The feature data of each first service request data is combined into first training data.
[0177] In the embodiment of the present application, after the feature data of each first service request data is acquired, the feature data of each first service request data may be aggregated to obtain first training data, so that clustering can be performed subsequently using the first training data.
[0178] Based on the relevant content of the above three steps, it can be known that in an embodiment of the present application, after obtaining the first service request data, the characteristic value of the request parameter in the first service request data can be obtained first, and then the characteristic value of the request parameter in the first service request data can be weighted based on the weight value corresponding to the request parameter to obtain the characteristic data of the first service request data. In this way, the characteristic data of the first service request data can effectively reduce the influence of meaningless fields on the analysis of the first service request data, and increase the influence of meaningful fields on the analysis of the first service request data, so that the characteristic data of the first service request data can more accurately characterize the characteristic information of the first service request data, which is beneficial to improve the clustering performance of the first service request data.
[0179] In the embodiment of the present application, since there is a one-to-one correspondence between the service request data and the feature data, the clustering result of the feature data can accurately represent the clustering result of the service request data. Therefore, in the embodiment of the present application, the clustering result of the service request data can be determined by means of the clustering process of the feature data.
[0180] Based on this, the embodiment of the present application also provides an implementation method for obtaining the category corresponding to the first service request data (that is, S203), which can be specifically: first clustering the first training data to obtain at least one category of first training data and outlier first training data; then classifying the first service request data corresponding to the first training data of each category into the same category, and classifying the first service request data corresponding to the outlier first training data into one category, and obtaining the category corresponding to each first service request data. For ease of understanding and explanation, the following is an explanation with examples.
[0181] As an example, assume that the first service request data of the first item corresponds to the first feature data,..., the sixth feature request data corresponds to the sixth feature data; and, in the clustering process, the first feature data and the fifth feature data are classified into the first category, the third feature data, the fourth feature data and the sixth feature data are classified into the second category, and the second feature data is an outlier. Based on this assumption, it can be known that the first first service request data corresponding to the first characteristic data and the fifth first service request data corresponding to the fifth characteristic data can be classified into the same category (for example, Category 1), the third first service request data corresponding to the third characteristic data, the fourth first service request data corresponding to the fourth characteristic data, and the sixth first service request data corresponding to the sixth characteristic data can be classified into the same category (for example, Category 2), and the second first service request data corresponding to the second characteristic data can be classified into a category different from other characteristic data (for example, Category 3), so that the category corresponding to each first service request data can be determined subsequently according to the category label to which each first service request data belongs.
[0182] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the first training data including the characteristic data of each first service request data, the clustering result of each first service request data can be determined by means of the clustering process of the characteristic data in the first training data. Among them, because the characteristic data of the first service request data can accurately represent the characteristic information of the first service request data, the clustering process based on the characteristic data can accurately represent the clustering process of the first service request data, so that the clustering result based on the characteristic data can accurately represent the clustering result of the first service request data, so that the clustering performance of the first service request data can be improved.
[0183] In addition, the service request test needs to be performed once every certain period of time (for example, one week), that is, the above S205 and S207 need to be performed once every certain period of time. At this time, in order to ensure that the request classification model can continue to maintain good performance, it is necessary to retrain and generate a new request classification model when it is determined that the performance of the request classification model has declined. Based on this, the embodiment of the present application also provides another implementation method of the method for implementing the service request test. In this implementation method, in addition to including some or all of the above steps, the method for implementing the service request test may also include the following four steps D1-D4:
[0184] D1: When a second preset time is reached, extract a second amount of service request data from the second service request data of each category to obtain second target service request data.
[0185] The second preset time is a preset time, and the second preset time is greater than the first preset time. For example, the second preset time may be 1 month, and the first preset time may be 1 week.
[0186] Based on the above content, it can be known that in the embodiment of the present application, after obtaining the category corresponding to the second service request data, a second number of service request data can be extracted from the second service request data of each category to obtain the second target service request data. For example, when 21 categories of second service request data are obtained using the request classification model, 100 pieces of data are extracted from the second service request data of the first category to the second service request data of the 21st category, so that the extracted 2100 pieces of data are used as the second target service request data.
[0187] D2: Verify the validity of the classification result according to the second service request data and the second target service request data.
[0188] In an embodiment of the present application, after the category corresponding to the second service request data is obtained, the validity of the classification result can be verified based on the second service request data and the second target service request data to determine whether the performance of the request classification model has decreased.
[0189] In addition, the embodiments of the present application do not limit the verification method of the validity of the classification result. For example, the validity of the classification result can be verified by means of code coverage, which can be specifically: the third code coverage is calculated according to the second service request data; the fourth code coverage is calculated according to the second target service request data; if the difference between the third code coverage and the fourth code coverage is less than the second threshold, the validity verification of the classification result is passed; if the difference between the third code coverage and the fourth code coverage is greater than or equal to the second threshold, the validity verification of the classification result is not passed. Among them, the second threshold can be set according to the application scenario.
[0190] D3: If the validity verification of the classification result is passed, continue to perform the service request test using the test data set (ie, S207).
[0191] In an embodiment of the present application, when it is determined that the validity verification of the classification result has passed, it means that the performance of the request classification model is good. At this time, these classification results with good performance can continue to be used to generate a test data set, which can improve the performance of the test data set, thereby helping to improve the service request test performance.
[0192] D4: If the validity verification of the classification result fails, re-execute the acquisition of the first service request data and subsequent steps (ie, S201 to S205).
[0193] In the embodiment of the present application, when it is determined that the validity verification of the classification result fails, it means that the performance of the request classification model is poor. At this time, if the request classification model with poor performance continues to be used to determine the category corresponding to the second service request data, it will cause the test data set determined based on the category corresponding to the second service request data to have poor performance, thereby reducing the service request test performance. Based on this, it can be seen that in order to improve the service request test performance, when it is determined that the validity verification of the classification result fails, the above S201 to S205 should be re-executed so that a classification result that can pass the validity verification of the classification result can be obtained.
[0194] Based on the above four steps, it can be known that in an embodiment of the present application, after the request classification model has been used for a period of time, the performance of the request classification model can be evaluated so that when it is determined that the performance of the request classification model is poor, a new request classification model can be retrained and generated. This can ensure that the request classification model continues to maintain a high performance, which is beneficial to improving the service request test performance.
[0195] Based on the method for implementing service request testing provided by the above method embodiment, the embodiment of the present application also provides a device for implementing service request testing, which is explained and illustrated below in conjunction with the accompanying drawings.
[0196] See also Figure 4 , which is a schematic diagram of the structure of a device for implementing a service request test provided in an embodiment of the present application. The device for implementing a service request test provided in an embodiment of the present application includes:
[0197] The request data acquisition unit 401 is used to acquire first service request data;
[0198] A training data generating unit 402, configured to extract features from the first service request data to generate first training data;
[0199] A request category determination unit 403, configured to cluster the first training data to obtain a category corresponding to each of the first service request data;
[0200] A classification model training unit 404 is used to train and generate a request classification model by using the first service request data and the category corresponding to the first service request data as second training data;
[0201] A request category generating unit 405, configured to classify the second service request data using the request classification model to obtain a category corresponding to the second service request data when the first preset time is reached;
[0202] A test data updating unit 406, configured to update the second service request data of different categories into the test data set;
[0203] The service request testing unit 407 is configured to perform a service request test using the test data set.
[0204] In a possible implementation manner, the device further includes:
[0205] A first data extraction unit is configured to, after clustering the first training data to obtain categories corresponding to each of the first service request data, extract a first number of service request data from the first service request data of each category to obtain first target service request data;
[0206] A clustering result verification unit, used to verify the validity of the clustering result according to the first service request data and the first target service request data;
[0207] A first processing loop unit, configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the clustering result validity verification fails;
[0208] The classification model training unit is specifically used to: if the clustering result validity verification is passed, use the first service request data and the category corresponding to the first service request data as second training data to train and generate a request classification model.
[0209] In a possible implementation, the clustering result verification unit includes:
[0210] A first coverage calculation subunit, configured to calculate a first code coverage according to the first service request data;
[0211] A second coverage calculation subunit, configured to calculate a second code coverage according to the first target service request data;
[0212] A first clustering verification determination subunit, configured to verify that the clustering result validity passes if the difference between the first code coverage and the second code coverage is less than a first threshold;
[0213] The second clustering verification determination subunit is used to determine that if the difference between the first code coverage and the second code coverage is greater than or equal to a first threshold, the clustering result validity verification fails.
[0214] In a possible implementation manner, the device further includes:
[0215] A generation model training unit, configured to, after clustering the first training data to obtain the category corresponding to each of the first service request data, train and generate a test data generation model using the first service request data of different categories;
[0216] The test data adding unit is used to generate third service request data of different categories by using the test data generation model, and add the third service request data of different categories to the test data set.
[0217] In a possible implementation, the training data generating unit 402 includes:
[0218] A parameter characteristic acquisition subunit, used to acquire a characteristic value of a request parameter in each piece of the first service request data;
[0219] A request feature calculation subunit, configured to calculate feature data of the first service request data according to feature values of the request parameters and weight values corresponding to the request parameters;
[0220] The training data generating subunit is used to combine the feature data of each of the first service request data into first training data.
[0221] In a possible implementation, the request category determination unit 403 includes:
[0222] a training data clustering subunit, configured to cluster the first training data to obtain at least one category of first training data and outlier first training data;
[0223] The request category determination subunit is used to classify the first service request data corresponding to the first training data of each category into the same category, classify the first service request data corresponding to the outlier first training data into one category, and obtain the category corresponding to each of the first service request data.
[0224] In a possible implementation manner, the device further includes:
[0225] A second data extraction unit, configured to extract a second amount of service request data from the second service request data of each category to obtain second target service request data when a second preset time is reached;
[0226] A classification result verification unit, used to verify the validity of the classification result according to the second service request data and the second target service request data;
[0227] The service request testing unit is specifically used to: if the validity verification of the classification result is passed, use the test data set to perform a service request test;
[0228] The second processing loop unit is configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the classification result validity verification fails.
[0229] In a possible implementation, the classification result verification unit includes:
[0230] A third coverage calculation subunit, configured to calculate a third code coverage according to the second service request data;
[0231] a fourth coverage calculation subunit, configured to calculate a fourth code coverage according to the second target service request data;
[0232] A first classification verification determination subunit, configured to verify that the classification result validity passes if the difference between the third code coverage and the fourth code coverage is less than a second threshold;
[0233] The second classification verification determination subunit is used to determine that if the difference between the third code coverage and the fourth code coverage is greater than or equal to a second threshold, the classification result validity verification fails.
[0234] Figure 5 A block diagram of an apparatus 1200 for implementing a service request test is shown. For example, the apparatus 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0235] Reference Figure 5 , the device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0236] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1202 may include one or more modules to facilitate interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
[0237] The memory 1204 is configured to store various types of data to support operations on the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0238] The power supply component 1206 provides power to the various components of the device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1200.
[0239] The multimedia component 1208 includes a screen that provides an output interface between the device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0240] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0241] The I / O interface provides an interface between the processing component 1202 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0242] The sensor assembly 1214 includes one or more sensors for providing various aspects of the status assessment of the device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the device 1200, the relative positioning of components, such as the display and keypad of the device 1200, the sensor assembly 1214 can also detect the position change of the device 1200 or a component of the device 1200, the presence or absence of user contact with the device 1200, the orientation or acceleration / deceleration of the device 1200, and the temperature change of the device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0243] The communication component 1216 is configured to facilitate wired or wireless communication between the device 1200 and other devices. The device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0244] In an exemplary embodiment, the apparatus 1200 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the following methods:
[0245] Obtaining first service request data;
[0246] Performing feature extraction on the first service request data to generate first training data;
[0247] Clustering the first training data to obtain categories corresponding to each of the first service request data;
[0248] Using the first service request data and the category corresponding to the first service request data as second training data, training and generating a request classification model;
[0249] When the first preset time is reached, classifying the second service request data using the request classification model to obtain a category corresponding to the second service request data;
[0250] Updating the test data set with second service request data of different categories;
[0251] A service request test is performed using the test data set.
[0252] Optionally, after clustering the first training data to obtain the category corresponding to each of the first service request data, the method further includes:
[0253] Extracting a first amount of service request data from the first service request data of each category to obtain first target service request data;
[0254] Verifying the validity of the clustering result according to the first service request data and the first target service request data;
[0255] If the clustering result validity verification fails, re-execute the obtaining of the first service request data and subsequent steps;
[0256] The step of using the first service request data and the category corresponding to the first service request data as second training data to train and generate a request classification model includes:
[0257] If the clustering result passes the validity verification, the first service request data and the category corresponding to the first service request data are used as second training data to train and generate a request classification model.
[0258] Optionally, verifying the validity of the clustering result according to the first service request data and the first target service request data includes:
[0259] Calculate a first code coverage rate according to the first service request data;
[0260] Calculate a second code coverage rate according to the first target service request data;
[0261] If the difference between the first code coverage and the second code coverage is less than a first threshold, the clustering result validity verification passes;
[0262] If the difference between the first code coverage and the second code coverage is greater than or equal to a first threshold, the clustering result validity verification fails.
[0263] Optionally, after clustering the first training data to obtain the category corresponding to each of the first service request data, the method further includes:
[0264] Using different categories of first service request data to train and generate a test data generation model;
[0265] The test data generation model is used to generate third service request data of different categories, and the third service request data of different categories are added to the test data set.
[0266] Optionally, the extracting features from the first service request data to generate first training data includes:
[0267] Obtaining a characteristic value of a request parameter in each piece of the first service request data;
[0268] Calculating characteristic data of the first service request data according to the characteristic value of the request parameter and the weight value corresponding to the request parameter;
[0269] The feature data of each of the first service request data are combined into first training data.
[0270] Optionally, clustering the first training data to obtain categories corresponding to each of the first service request data includes:
[0271] Clustering the first training data to obtain at least one category of first training data and outlier first training data;
[0272] The first service request data corresponding to the first training data of each category are respectively classified into the same category, and the first service request data corresponding to the outlier first training data are classified into one category, so as to obtain the category corresponding to each of the first service request data.
[0273] Optionally, also include:
[0274] When a second preset time is reached, extracting a second amount of service request data from the second service request data of each category to obtain second target service request data;
[0275] Performing validity verification of the classification result according to the second service request data and the second target service request data;
[0276] If the validity verification of the classification result is passed, continue to perform the service request test using the test data set;
[0277] If the validity verification of the classification result fails, the step of obtaining the first service request data and subsequent steps are re-executed.
[0278] Optionally, the verifying the validity of the classification result according to the second service request data and the second target service request data includes:
[0279] Calculate a third code coverage rate according to the second service request data;
[0280] Calculate a fourth code coverage rate according to the second target service request data;
[0281] If the difference between the third code coverage and the fourth code coverage is less than the second threshold, the validity verification of the classification result is passed;
[0282] If the difference between the third code coverage and the fourth code coverage is greater than or equal to the second threshold, the classification result validity verification fails.
[0283] Figure 6 1 is a schematic diagram of the structure of the server in an embodiment of the present invention. The server 1300 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1322 (for example, one or more processors) and memory 1332, and one or more storage media 1330 (for example, one or more mass storage devices) storing application programs 1342 or data 1344. Among them, the memory 1332 and the storage medium 1330 may be temporary storage or permanent storage. The program stored in the storage medium 1330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1322 may be configured to communicate with the storage medium 1330, and execute a series of instruction operations in the storage medium 1330 on the server 1300 for executing the above-mentioned method for implementing the service request test.
[0284] The terminal 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input and output interfaces 1356, one or more keyboards 1356, and / or one or more operating systems 1341, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0285] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0286] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0287] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0288] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0289] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for implementing a service request test, characterized in that: The method comprises: Obtaining first service request data; Performing feature extraction on the first service request data to generate first training data; Clustering the first training data to obtain categories corresponding to each of the first service request data; Extracting a first amount of service request data from the first service request data of each category to obtain first target service request data; Performing clustering result validity verification according to the first service request data and the first target service request data, including: calculating a first code coverage rate according to the first service request data; calculating a second code coverage rate according to the first target service request data; if the difference between the first code coverage rate and the second code coverage rate is less than a first threshold, the clustering result validity verification passes; if the difference between the first code coverage rate and the second code coverage rate is greater than or equal to the first threshold, the clustering result validity verification fails; If the clustering result validity verification fails, re-execute the obtaining of the first service request data and subsequent steps; If the clustering result passes the validity verification, the first service request data and the category corresponding to the first service request data are used as second training data to train and generate a request classification model; When the first preset time is reached, classifying the second service request data using the request classification model to obtain a category corresponding to the second service request data; Updating the test data set with second service request data of different categories; A service request test is performed using the test data set.
2. The method according to claim 1, characterized in that: After clustering the first training data to obtain the category corresponding to each of the first service request data, the method further includes: Using different categories of first service request data to train and generate a test data generation model; The test data generation model is used to generate third service request data of different categories, and the third service request data of different categories are added to the test data set.
3. The method according to claim 1, characterized in that The extracting features of the first service request data to generate first training data includes: Obtaining a characteristic value of a request parameter in each piece of the first service request data; Calculating characteristic data of the first service request data according to the characteristic value of the request parameter and the weight value corresponding to the request parameter; The feature data of each of the first service request data are combined into first training data.
4. The method according to claim 1, characterized in that The clustering of the first training data to obtain a category corresponding to each of the first service request data includes: Clustering the first training data to obtain at least one category of first training data and outlier first training data; The first service request data corresponding to the first training data of each category are respectively classified into the same category, and the first service request data corresponding to the outlier first training data are classified into one category, so as to obtain the category corresponding to each of the first service request data.
5. The method according to claim 1, characterized in that The method further comprises: When a second preset time is reached, extracting a second amount of service request data from the second service request data of each category to obtain second target service request data; Performing validity verification of the classification result according to the second service request data and the second target service request data; If the validity verification of the classification result is passed, continue to perform the service request test using the test data set; If the validity verification of the classification result fails, the step of obtaining the first service request data and subsequent steps are re-executed.
6. The method according to claim 5, characterized in that The validating the classification result according to the second service request data and the second target service request data includes: Calculate a third code coverage rate according to the second service request data; Calculate a fourth code coverage rate according to the second target service request data; If the difference between the third code coverage and the fourth code coverage is less than the second threshold, the validity verification of the classification result is passed; If the difference between the third code coverage and the fourth code coverage is greater than or equal to the second threshold, the classification result validity verification fails.
7. A device for implementing a service request test, characterized in that: The device comprises: A request data acquisition unit, configured to acquire first service request data; A training data generating unit, configured to extract features from the first service request data to generate first training data; a request category determination unit, configured to cluster the first training data to obtain a category corresponding to each of the first service request data; A first data extraction unit is configured to, after clustering the first training data to obtain categories corresponding to each of the first service request data, extract a first number of service request data from the first service request data of each category to obtain first target service request data; A clustering result verification unit, used to verify the validity of the clustering result according to the first service request data and the first target service request data, including: calculating a first code coverage rate according to the first service request data; calculating a second code coverage rate according to the first target service request data; if the difference between the first code coverage rate and the second code coverage rate is less than a first threshold, the clustering result validity verification is passed; if the difference between the first code coverage rate and the second code coverage rate is greater than or equal to the first threshold, the clustering result validity verification is not passed; A first processing loop unit, configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the clustering result validity verification fails; A classification model training unit, configured to train and generate a request classification model by using the first service request data and the category corresponding to the first service request data as second training data if the clustering result validity verification is passed; a request category generating unit, configured to classify the second service request data using the request classification model to obtain a category corresponding to the second service request data when a first preset time is reached; A test data updating unit, used for updating second service request data of different categories into the test data set; The service request testing unit is used to perform a service request test using the test data set.
8. The device according to claim 7, characterized in that The device also includes: A generation model training unit, configured to, after clustering the first training data to obtain the category corresponding to each of the first service request data, train and generate a test data generation model using the first service request data of different categories; The test data adding unit is used to generate third service request data of different categories by using the test data generation model, and add the third service request data of different categories to the test data set.
9. The device according to claim 7, characterized in that The training data generating unit comprises: A parameter characteristic acquisition subunit, used to acquire a characteristic value of a request parameter in each piece of the first service request data; A request feature calculation subunit, configured to calculate feature data of the first service request data according to feature values of the request parameters and weight values corresponding to the request parameters; The training data generating subunit is used to combine the feature data of each of the first service request data into first training data.
10. The device according to claim 7, characterized in that The request category determination unit includes: a training data clustering subunit, configured to cluster the first training data to obtain at least one category of first training data and outlier first training data; The request category determination subunit is used to classify the first service request data corresponding to the first training data of each category into the same category, classify the first service request data corresponding to the outlier first training data into one category, and obtain the category corresponding to each of the first service request data.
11. The device according to claim 7, characterized in that The device also includes: A second data extraction unit, configured to extract a second amount of service request data from the second service request data of each category to obtain second target service request data when a second preset time is reached; A classification result verification unit, used to verify the validity of the classification result according to the second service request data and the second target service request data; The service request testing unit is specifically used to: if the validity verification of the classification result is passed, use the test data set to perform a service request test; The second processing loop unit is configured to return to the request data acquisition unit to execute the acquisition of the first service request data if the classification result validity verification fails.
12. The device according to claim 11, characterized in that The classification result verification unit comprises: A third coverage calculation subunit, configured to calculate a third code coverage according to the second service request data; a fourth coverage calculation subunit, configured to calculate a fourth code coverage according to the second target service request data; A first classification verification determination subunit, configured to verify that the classification result validity passes if the difference between the third code coverage and the fourth code coverage is less than a second threshold; The second classification verification determination subunit is used to determine that if the difference between the third code coverage and the fourth code coverage is greater than or equal to a second threshold, the classification result validity verification fails.
13. A device for implementing a service request test, characterized in that: The system comprises a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors, wherein the one or more programs include instructions for performing the following operations: Obtaining first service request data; Performing feature extraction on the first service request data to generate first training data; Clustering the first training data to obtain categories corresponding to each of the first service request data; Extracting a first amount of service request data from the first service request data of each category to obtain first target service request data; Performing clustering result validity verification according to the first service request data and the first target service request data, including: calculating a first code coverage rate according to the first service request data; calculating a second code coverage rate according to the first target service request data; if the difference between the first code coverage rate and the second code coverage rate is less than a first threshold, the clustering result validity verification passes; if the difference between the first code coverage rate and the second code coverage rate is greater than or equal to the first threshold, the clustering result validity verification fails; If the clustering result validity verification fails, re-execute the obtaining of the first service request data and subsequent steps; If the clustering result passes the validity verification, the first service request data and the category corresponding to the first service request data are used as second training data to train and generate a request classification model; When the first preset time is reached, classifying the second service request data using the request classification model to obtain a category corresponding to the second service request data; Updating the test data set with second service request data of different categories; A service request test is performed using the test data set.
14. A computer-readable medium having instructions stored thereon, which, when executed by one or more processors, cause an apparatus to perform the method for implementing a service request test as claimed in one or more of claims 1 to 6.
