Traffic playback comparison test method, apparatus, equipment and readable storage medium
By acquiring and cleaning traffic replay data, and using filtering conditions to screen and compare data, the problem of low online verification efficiency in existing technologies has been solved, and efficient and accurate program evaluation has been achieved.
Patent Information
- Application Number
- CN202411741713.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-29
AI Technical Summary
Existing technologies have low efficiency in online verification when performing traffic replay comparisons, especially when the pre-release program is only the original program with some function updates. Existing technologies still use the method of comparing all traffic replays, resulting in low efficiency.
By obtaining the target interfaces of the program to be released and the comparison program, recording and cleaning traffic replay data, obtaining the filtering conditions for the difference generation, using the filtering conditions to filter and compare data from the cleaned data, and performing traffic replay comparison to evaluate the merits of the program.
This improves the efficiency of traffic replay comparison testing and the accuracy of evaluation results, reduces the impact of interference factors and redundant data, and ensures the relevance of comparison data and the reliability of evaluation results.
Smart Images

Figure CN119557228B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and more specifically, to a traffic playback comparison test method, apparatus, device, and readable storage medium. Background Technology
[0002] During product iteration, before a pre-release version is deployed to replace the original version, online verification is typically required. This involves comparing the pre-release version with the original version to ensure that the pre-release version functions correctly and that its functionality is superior to the original. There are various methods for online verification, with traffic replay comparison being one of the most common.
[0003] However, existing technologies typically require comparing all traffic replays of the pre-release program with all traffic replays of the original program during the traffic replay comparison process. Even if the pre-release program may be the original program with some updated features, existing technologies still use the method of comparing all traffic replays for online verification, resulting in low online verification efficiency. Summary of the Invention
[0004] In view of this, this application provides a traffic replay comparison test method, apparatus, device and readable storage medium to solve the shortcomings of low online verification efficiency in the prior art.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] A traffic replay comparison test method includes:
[0007] Obtain a first program to be released, and a second program for comparative testing with the first program;
[0008] Determine the target interfaces for calling the first program and the second program;
[0009] Using the target interface, the first program is triggered, and the first traffic playback data corresponding to the first program is recorded, and the first traffic playback data is cleaned.
[0010] Using the target interface, the second program is triggered, and the second traffic playback data corresponding to the second program is recorded, and the second traffic playback data is cleaned.
[0011] Obtain the filtering criteria generated based on the differences between the first program and the second program;
[0012] Using the aforementioned filtering criteria, the first flow playback comparison data is obtained by filtering from the cleaned first flow playback data;
[0013] Using the aforementioned filtering criteria, second flow playback comparison data is obtained by filtering from the cleaned second flow playback data;
[0014] The first traffic playback comparison data and the second traffic playback comparison data are compared to evaluate the merits of the first program.
[0015] Optionally, obtaining the filtering conditions generated based on the differences between the first program and the second program includes:
[0016] By comparing the first program and the second program, determine the difference function that distinguishes the first program from the second program;
[0017] Based on the difference function, filter conditions are constructed.
[0018] Optionally, constructing the filtering conditions based on the difference function includes:
[0019] Based on the functional type of the difference function, determine all parameter types that need to be compared;
[0020] Filtering criteria are constructed based on each parameter type.
[0021] Optionally, the process of constructing filtering conditions based on various parameter types includes:
[0022] Construct a parameter setting window for each parameter type, and each parameter setting window is used to input the filter dependencies for the corresponding parameter type;
[0023] Filtering criteria are constructed based on various parameter types and filtering dependencies.
[0024] Optionally, the step of comparing the first traffic replay comparison data and the second traffic replay comparison data to evaluate the merits of the first program includes:
[0025] By comparing the first data volume of the first traffic replay comparison data with the second data volume of the second traffic replay comparison data, the data volume score of the first program is determined;
[0026] By comparing the first generation time of the first traffic replay comparison data with the second generation time of the second traffic replay comparison data, the duration score of the first program is determined.
[0027] By comparing the first coverage rate of the first traffic replay comparison data with the second coverage rate of the second traffic replay comparison data, the coverage score of the first program is determined.
[0028] The total score of the first program is calculated by combining the data volume score, the coverage score, and the duration score.
[0029] The merits of the first program are evaluated based on the total score.
[0030] Optionally, the calculation of the total score for the first program by combining the data volume score, the coverage score, and the duration score includes:
[0031] Based on the ability of traffic replay data volume to characterize the merits of the first program, the weight of data volume is determined.
[0032] The product of the data volume score and the data volume weight is taken as the data volume product;
[0033] Based on the ability of program processing time to characterize the merits of the first program, the time weight is determined.
[0034] The product of the duration score and the duration weight is taken as the duration product;
[0035] Based on the ability of traffic coverage to characterize the merits of the first program, the coverage weight is determined.
[0036] The product of the coverage score and the coverage weight is taken as the coverage product;
[0037] The sum of the product of the data volume, the product of the coverage rate, and the product of the duration is used as the total score of the first program.
[0038] Optionally, evaluating the merits of the first procedure based on the total score includes:
[0039] The total score is compared with a preset score threshold to evaluate the merits of the first program.
[0040] A flow playback comparison test device, comprising:
[0041] The acquisition module is used to acquire a first program to be released, and a second program to conduct comparative tests with the first program;
[0042] The determination module is used to determine the target interfaces for calling the first program and the second program;
[0043] The recording module is used to trigger the first program using the target interface and record the first traffic playback data corresponding to the first program, clean the first traffic playback data, and trigger the second program using the target interface and record the second traffic playback data corresponding to the second program, and clean the second traffic playback data.
[0044] The generation module is used to obtain the filtering conditions generated based on the differences between the first program and the second program;
[0045] The filtering module is used to filter first flow playback comparison data from the cleaned first flow playback data using the filtering conditions; and to filter second flow playback comparison data from the cleaned second flow playback data using the filtering conditions.
[0046] The evaluation module is used to compare the first traffic replay comparison data and the second traffic replay comparison data to evaluate the merits of the first program.
[0047] A traffic playback comparison test device, including a memory and a processor;
[0048] The memory is used to store programs;
[0049] The processor is used to execute the program to implement each step of the above-described traffic replay comparison test method.
[0050] A readable storage medium having a computer program stored thereon, characterized in that, when the computer program is executed by a processor, it implements each step of the above-described traffic replay comparison test method.
[0051] As can be seen from the above technical solution, the traffic replay testing method provided in this application can obtain a first program to be released and a second program for comparison testing with the first program; determine the target interface for calling the first program and the second program; use the target interface to trigger the first program and record the first traffic replay data corresponding to the first program, and clean the first traffic replay data; use the target interface to trigger the second program and record the second traffic replay data corresponding to the second program, and clean the second traffic replay data; based on this, this application uses the same interface to obtain the first traffic replay data and the second traffic replay data. In this application, the method of obtaining the first traffic replay data corresponding to the first program is the same as the method of obtaining the second traffic replay data corresponding to the second program, so as to minimize interference factors; at the same time, this application cleans the two types of traffic replay data to avoid redundant data in the two types of traffic replay data from affecting the first program. The evaluation results have an impact; subsequently, this application can obtain screening conditions generated based on the differences between the first program and the second program; based on this, the screening conditions are set based on the first program and the second program that need to be compared and tested, ensuring the matching of the screening conditions with the comparison test and the coverage of traffic replay during the comparison test; using the screening conditions, first traffic replay comparison data is obtained from the cleaned first traffic replay data; using the screening conditions, second traffic replay comparison data is obtained from the cleaned second traffic replay data; the first traffic replay comparison data and the second traffic replay comparison data are compared and evaluated to assess the merits of the first program and the second program; on this basis, this application uses the same screening conditions to screen the two types of traffic replay data, and evaluates the merits of the programs based on the screening results, ensuring the relevance of the comparison data, reducing redundant data in the subsequent comparison process, and improving the accuracy of the evaluation results while achieving efficient testing. As can be seen, this application can reduce interference factors, improve the relevance of comparison data, and remove redundant data during traffic replay comparison testing, thereby improving testing efficiency while enhancing the reliability and accuracy of evaluation results. Furthermore, it improves the efficiency of online verification. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0053] Figure 1This is a flowchart of a traffic replay comparison test method disclosed in an embodiment of this application;
[0054] Figure 2 This is a structural block diagram of a traffic playback comparison test device disclosed in an embodiment of this application;
[0055] Figure 3 This is a hardware structure block diagram of a traffic replay comparison test device disclosed in an embodiment of this application. Detailed Implementation
[0056] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0057] The traffic replay comparison test method of this application can be used in a wide range of general-purpose or special-purpose computing device environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.
[0058] The traffic replay comparison test method of this application can be applied to traffic replay platforms.
[0059] Next, combine Figure 1 The traffic replay comparison test method of this application is described in detail, including the following steps:
[0060] Step S1: Obtain the first program to be released, and the second program for comparative testing with the first program.
[0061] Specifically, the first program can be a program to be released or a newly coded program, and the second program can be a program used to compare and test with the first program to verify the superiority or inferiority of the first program.
[0062] The first program can be an updated second program.
[0063] The first and second programs may have the same or different functions.
[0064] Step S2: Determine the target interface for calling the first program and the second program.
[0065] Specifically, the target interface can be an interface that can call both the first program and the second program simultaneously.
[0066] Step S3: Using the target interface, trigger the first program and record the first traffic playback data corresponding to the first program, and clean the first traffic playback data.
[0067] Specifically, the first program can be triggered by the call request generated by the target interface, and the traffic playback of the first program's response to the call request can be recorded to form the first traffic playback data.
[0068] Subsequently, the first playback data can be cleaned to remove duplicate data and reduce redundant data.
[0069] Step S4: Using the target interface, trigger the second program and record the second traffic playback data corresponding to the second program, and clean the second traffic playback data.
[0070] Specifically, a second program can be triggered by a call request generated by the target interface, and the traffic playback of the second program's response to the call request can be recorded to form second traffic playback data.
[0071] Subsequently, the second stream playback data can be cleaned to remove duplicate data and reduce redundant data.
[0072] Step S5: Obtain the filtering conditions generated based on the differences between the first program and the second program.
[0073] Specifically, it can identify the first procedure and the second procedure, determine the differences between the first procedure and the second procedure, and construct screening conditions based on the differences between the first procedure and the second procedure.
[0074] The filtering criteria can consist of one or more of the following: interface type, platform type, version type, input parameter value type, output parameter return value type, and product type.
[0075] Step S6: Using the filtering conditions, filter the first flow playback comparison data from the cleaned first flow playback data.
[0076] Specifically, data that matches the filtering criteria can be selected from the first traffic playback data as the first traffic playback comparison data.
[0077] Step S7: Using the filtering conditions, filter the second flow playback comparison data from the cleaned second flow playback data.
[0078] Specifically, data that matches the filtering criteria can be selected from the second traffic playback data as the second traffic playback comparison data.
[0079] Step S8: Compare the first traffic playback comparison data and the second traffic playback comparison data to evaluate the merits of the first program.
[0080] Specifically, the differences between the first and second traffic playback comparison data can be analyzed in multiple dimensions to evaluate the merits of the first program.
[0081] As can be seen from the above technical solutions, the traffic replay testing method provided in this application can obtain a first program to be released and a second program for comparison testing with the first program; determine the target interface for calling the first program and the second program; use the target interface to trigger the first program and record the first traffic replay data corresponding to the first program, and clean the first traffic replay data; use the target interface to trigger the second program and record the second traffic replay data corresponding to the second program, and clean the second traffic replay data; based on this, this application uses the same interface to obtain the first traffic replay data and the second traffic replay data. In this application, the method of obtaining the first traffic replay data corresponding to the first program is the same as the method of obtaining the second traffic replay data corresponding to the second program, so as to minimize interference factors; at the same time, this application cleans the two types of traffic replay data to avoid two types of traffic Redundant data in the replay data affects the evaluation results. Subsequently, this application can obtain filtering conditions generated based on the differences between the first and second programs. Based on this, the filtering conditions are set according to the first and second programs that need to be compared, ensuring the matching between the filtering conditions and the comparison test, as well as the coverage of traffic replay during the comparison test. Using the filtering conditions, first traffic replay comparison data is obtained from the cleaned first traffic replay data. Using the filtering conditions, second traffic replay comparison data is obtained from the cleaned second traffic replay data. The first and second traffic replay comparison data are compared to evaluate the merits of the first and second programs. Based on this, this application uses the same filtering conditions to filter both types of traffic replay data, and evaluates the merits of the programs based on the filtered results, ensuring the relevance of the comparison data, removing redundant data, and improving the accuracy of the evaluation results. Therefore, this application can reduce interference factors, improve the relevance of the comparison data, and remove redundant data during the traffic replay comparison test, thereby improving testing efficiency while increasing the reliability and accuracy of the evaluation results.
[0082] Furthermore, traffic replay comparison testing is one type of online verification method, thus this application also improves the efficiency of online verification.
[0083] In some embodiments of this application, the process of obtaining the filtering conditions based on the differences between the first program and the second program is described in detail, and the steps are as follows:
[0084] S50. Compare the first program and the second program to determine the difference function between the first program and the second program.
[0085] Specifically, various program comparison tools can be used to compare the first program and the second program, and mark the difference functions between the first program and the second program.
[0086] S51. Based on the difference function, construct the filtering conditions.
[0087] Specifically, we can analyze the function of the difference function and construct filtering conditions based on the function of the difference function.
[0088] As can be seen from the above technical solution, this embodiment provides an optional way to construct filtering conditions. The above method can further make better use of the differences between the first program and the second program to construct filtering conditions and improve the targeting of the filtering conditions.
[0089] In some embodiments of this application, the process of constructing screening conditions based on the difference function is described in detail, and the steps are as follows:
[0090] S510. Based on the functional type of the difference function, determine all parameter types that need to be compared.
[0091] Specifically, the functional type of the difference function can be determined.
[0092] Obtain a table containing the correspondence between each function category and each parameter category.
[0093] Select all parameter categories corresponding to the function type from the table as the parameter types to be compared.
[0094] S511. Based on each parameter type, construct the filtering conditions.
[0095] Specifically, filtering conditions can be formed by combining the conditions corresponding to each parameter type.
[0096] As can be seen from the above technical solution, this embodiment provides an optional method for constructing filtering conditions based on the difference function. By using the above method, the function of the difference function can be used to construct matching filtering conditions, thereby better completing the construction of filtering conditions.
[0097] In some embodiments of this application, the process of constructing filtering conditions based on various parameter types in step S511 is described in detail, and the steps are as follows:
[0098] S5110. Construct a parameter setting window for each parameter type. Each parameter setting window is used to input the filter dependencies for the corresponding parameter type.
[0099] Specifically, parameter setting window templates for each parameter category can be pre-set.
[0100] Determine the parameter setting window template corresponding to each parameter type, and construct the parameter setting window for each parameter type.
[0101] The parameter settings window can contain fixed parameter items as well as a window for inputting filter dependencies.
[0102] S5111. Based on each parameter type and filtering dependency, construct filtering conditions.
[0103] Specifically, based on the fixed parameter items and filter dependencies in each parameter setting window, conditions corresponding to each parameter type can be constructed, and the various conditions can be combined to form filter conditions.
[0104] As can be seen from the above technical solution, this embodiment provides an optional way to construct filtering conditions based on various parameter types. Through the above method, the filtering conditions can be customized in a personalized way through the parameter setting window, thereby improving the targeting of the filtering conditions.
[0105] In some embodiments of this application, the process of comparing the first traffic playback comparison data and the second traffic playback comparison data to evaluate the merits of the first program is described in detail, and the steps are as follows:
[0106] S80. Compare the first data volume of the first traffic playback comparison data with the second data volume of the second traffic playback comparison data to determine the data volume score of the first program.
[0107] Specifically, the amount of data contained in the first traffic playback comparison data can be determined as the first data amount;
[0108] The amount of data contained in the second traffic replay comparison data can be determined as the second data volume;
[0109] Calculate the difference in data volume between the first data volume and the second data volume;
[0110] The percentage of the difference in data volume relative to the second data volume is used as the data volume percentage.
[0111] The data volume score for the first program is determined based on the percentage of data volume.
[0112] S81. Compare the first generation time of the first traffic playback comparison data with the second generation time of the second traffic playback comparison data to determine the duration score of the first program.
[0113] Specifically, the generation time of the first traffic replay comparison data can be determined as the first generation time, which is used to represent the duration of the first program's response to the target interface;
[0114] The generation duration contained in the second traffic replay comparison data can be determined as the second generation duration, which is used to represent the duration of the second program's response to the target interface.
[0115] Calculate the duration difference between the first generation duration and the second generation duration;
[0116] The percentage of the duration difference relative to the second generation duration is used as the duration percentage.
[0117] The duration score of the first program is determined based on the percentage of duration.
[0118] S82. Compare the first coverage rate of the first traffic playback comparison data with the second coverage rate of the second traffic playback comparison data to determine the coverage score of the first program.
[0119] Specifically, the coverage of the first traffic replay comparison data can be determined as the first coverage, which is used to represent the information richness of the first traffic replay comparison data;
[0120] The coverage of the second traffic replay comparison data can be determined as the second coverage rate, which is used to represent the information richness of the second traffic replay comparison data.
[0121] Calculate the coverage difference between the first coverage rate and the second coverage rate;
[0122] The percentage of the coverage difference relative to the second coverage level is used as the coverage percentage.
[0123] The coverage score for the first procedure is determined based on the coverage percentage.
[0124] S83. Calculate the total score of the first program by combining the data volume score, the coverage score, and the duration score.
[0125] Specifically, the total score of the first program can be calculated by combining the data volume score, the coverage score, and the duration score in various ways. For example, the sum of the data volume score, the coverage score, and the duration score can be used as the total score of the first program.
[0126] Alternatively, the data volume score, the coverage score, and the duration score can be weighted and calculated to obtain the total score of the first program.
[0127] S84. Based on the total score, evaluate the merits of the first procedure.
[0128] Specifically, the quality of the first procedure can be evaluated based on the total score in various ways. For example, multiple quality levels can be preset, and the quality level of the first procedure can be determined based on the total score; alternatively, a threshold can be set, and the total score can be compared with the threshold to evaluate the quality of the first procedure.
[0129] As can be seen from the above technical solution, this embodiment provides an optional method for evaluating the merits of the first program. Through the above method, the merits of the first program can be evaluated from multiple perspectives, thereby improving the reliability of the evaluation results.
[0130] In some embodiments of this application, the process of calculating the total score of the first program by combining the data volume score, the coverage score, and the duration score is described in detail, and the steps are as follows:
[0131] S830. Determine the data volume weight based on the ability of the traffic playback data volume to characterize the merits of the first program.
[0132] Specifically, the weight of the data volume indicating the performance of the first program can be determined.
[0133] S831. The product of the data quantity score and the data quantity weight is taken as the data quantity product.
[0134] Specifically, the product of the data volume score and the data volume weight can be calculated, and this product can be used as the data volume product.
[0135] S832. Determine the time weight based on the ability of the program processing time to represent the merits of the first program.
[0136] Specifically, the duration weight of the processing time of a program can be determined in relation to the ability of the first program to represent its merits.
[0137] S833. The product of the duration score and the duration weight is taken as the duration product.
[0138] Specifically, the product of the duration score and the duration weight can be calculated, and this product can be used as the duration product.
[0139] S834. Determine the coverage weight based on the ability of traffic coverage to characterize the merits of the first program.
[0140] Specifically, the coverage weight, which indicates the ability of traffic coverage to characterize the merits of the first procedure, can be determined.
[0141] S835. The product of the coverage score and the coverage weight is taken as the coverage product.
[0142] Specifically, the product of the coverage score and the coverage weight can be calculated and used as the coverage product.
[0143] S836. The sum of the product of the data volume, the product of the coverage rate, and the product of the duration is used as the total score of the first program.
[0144] Specifically, the product of data volume, coverage rate, and duration can be added together to obtain the total score of the first program.
[0145] As can be seen from the above technical solution, this embodiment provides an optional method for calculating the total score of the first program by comprehensively considering the data volume score, the coverage score, and the duration score. The total score can be obtained by weighting the data volume score, which improves the ability of the total score to represent the merits of the first program and further improves the accuracy of this application.
[0146] In some embodiments of this application, the process of evaluating the merits of the first procedure based on the total score in step S84 is described in detail, and the steps are as follows:
[0147] S840. Compare the total score with a preset score threshold to evaluate the merits of the first program.
[0148] Specifically, one or more score thresholds can be preset, score ranges can be set based on each score threshold, and the evaluation result corresponding to each score range can be determined.
[0149] The total score is compared with each score threshold to determine the target score range corresponding to the total score.
[0150] The evaluation results corresponding to the target score range are used as the target evaluation results to characterize the merits of the first procedure.
[0151] As can be seen from the above technical solution, this embodiment provides an optional method for evaluating the merits of the first program based on the total score. The first program can be further evaluated through the above method, thereby improving the accuracy of online verification.
[0152] Next, we will combine Figure 2 The flow playback comparison test device provided in this application is described in detail. The flow playback comparison test device described below can be compared with the flow playback comparison test method described above.
[0153] See Figure 2 It can be observed that the traffic playback comparison test device may include:
[0154] The acquisition module 10 is used to acquire a first program to be released, and a second program to conduct comparative tests with the first program;
[0155] Module 20 is used to determine the target interface for calling the first program and the second program;
[0156] The recording module 30 is used to trigger the first program using the target interface, record the first traffic playback data corresponding to the first program, clean the first traffic playback data, and trigger the second program using the target interface, record the second traffic playback data corresponding to the second program, and clean the second traffic playback data.
[0157] The generation module 40 is used to obtain the filtering conditions generated based on the differences between the first program and the second program;
[0158] The filtering module 50 is used to filter first flow playback comparison data from the cleaned first flow playback data using the filtering conditions; and to filter second flow playback comparison data from the cleaned second flow playback data using the filtering conditions.
[0159] Evaluation module 60 is used to compare the first traffic replay comparison data and the second traffic replay comparison data to evaluate the merits of the first program.
[0160] The generated module may include:
[0161] The difference function acquisition unit is used to compare the first program and the second program to determine the difference function that distinguishes the first program from the second program.
[0162] The filtering condition construction unit is used to construct filtering conditions based on the difference function.
[0163] The filter criteria building block can include:
[0164] The parameter type determination subunit is used to determine all parameter types that need to be compared based on the functional type of the difference function;
[0165] The parameter type utilizes sub-units to construct filtering conditions based on each parameter type.
[0166] Parameter types can be used in sub-units, including:
[0167] The parameter setting window building component is used to build the parameter setting window corresponding to each parameter type. Each parameter setting window is used to input the filter dependencies for the corresponding parameter type.
[0168] The component for filtering dependencies is used to construct filtering conditions based on various parameter types and filtering dependencies.
[0169] The evaluation module may include:
[0170] The data volume score determination unit is used to compare the first data volume of the first traffic playback comparison data with the second data volume of the second traffic playback comparison data to determine the data volume score of the first program.
[0171] The duration score determination unit is used to compare the first generation duration of the first traffic playback comparison data with the second generation duration of the second traffic playback comparison data to determine the duration score of the first program;
[0172] The coverage score determination unit is used to compare the first coverage of the first traffic playback comparison data with the second coverage of the second traffic playback comparison data to determine the coverage score of the first program.
[0173] The total score calculation unit is used to calculate the total score of the first program by combining the data volume score, the coverage score, and the duration score.
[0174] The program evaluation unit is used to evaluate the merits of the first program based on the total score.
[0175] The total score calculation unit may include:
[0176] The data volume weight determination subunit is used to determine the data volume weight based on the ability of the traffic playback data volume to characterize the merits of the first program.
[0177] The data quantity product calculation subunit is used to take the product of the data quantity score and the data quantity weight as the data quantity product;
[0178] The duration weight determination subunit is used to determine the duration weight based on the ability of the program to characterize the merits of the first program based on the program processing time.
[0179] The duration product calculation subunit is used to take the product of the duration score and the duration weight as the duration product;
[0180] The coverage weight determination subunit is used to determine the coverage weight based on the ability of traffic coverage to characterize the merits of the first program.
[0181] The coverage product calculation subunit is used to take the product of the coverage score and the coverage weight as the coverage product;
[0182] The product addition subunit is used to sum the product of the data volume, the product of the coverage rate, and the product of the duration as the total score of the first program.
[0183] The program evaluation unit may include:
[0184] The total score comparison subunit is used to compare the total score with a preset score threshold to evaluate the merits of the first program.
[0185] The traffic replay comparison testing device provided in this application embodiment can be applied to traffic replay comparison testing equipment, such as PC terminals, cloud platforms, servers, and server clusters. Optionally, Figure 3 The hardware structure block diagram of the traffic playback comparison test equipment is shown below. Figure 3 The hardware structure of the traffic replay comparison test equipment may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4.
[0186] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0187] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0188] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0189] The memory stores a program, which the processor can call. The program is used for:
[0190] Obtain a first program to be released, and a second program for comparative testing with the first program;
[0191] Determine the target interfaces for calling the first program and the second program;
[0192] Using the target interface, the first program is triggered, and the first traffic playback data corresponding to the first program is recorded, and the first traffic playback data is cleaned.
[0193] Using the target interface, the second program is triggered, and the second traffic playback data corresponding to the second program is recorded, and the second traffic playback data is cleaned.
[0194] Obtain the filtering criteria generated based on the differences between the first program and the second program;
[0195] Using the aforementioned filtering criteria, the first flow playback comparison data is obtained by filtering from the cleaned first flow playback data;
[0196] Using the aforementioned filtering criteria, second flow playback comparison data is obtained by filtering from the cleaned second flow playback data;
[0197] The first traffic playback comparison data and the second traffic playback comparison data are compared to evaluate the merits of the first program.
[0198] Optionally, the refined and extended functions of the program can be referred to the above description.
[0199] This application embodiment also provides a readable storage medium that can store a program suitable for execution by a processor, the program being used for:
[0200] Obtain a first program to be released, and a second program for comparative testing with the first program;
[0201] Determine the target interfaces for calling the first program and the second program;
[0202] Using the target interface, the first program is triggered, and the first traffic playback data corresponding to the first program is recorded, and the first traffic playback data is cleaned.
[0203] Using the target interface, the second program is triggered, and the second traffic playback data corresponding to the second program is recorded, and the second traffic playback data is cleaned.
[0204] Obtain the filtering criteria generated based on the differences between the first program and the second program;
[0205] Using the aforementioned filtering criteria, the first flow playback comparison data is obtained by filtering from the cleaned first flow playback data;
[0206] Using the aforementioned filtering criteria, second flow playback comparison data is obtained by filtering from the cleaned second flow playback data;
[0207] The first traffic playback comparison data and the second traffic playback comparison data are compared to evaluate the merits of the first program.
[0208] Optionally, the refined and extended functions of the program can be referred to the above description.
[0209] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0210] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0211] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily 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 this application. The various embodiments of this application can be combined with each other. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for comparing and testing traffic playback, characterized in that, include: Obtain a first program to be released, and a second program for comparative testing with the first program; Determine the target interfaces for calling the first program and the second program; Using the target interface, the first program is triggered, and the first traffic playback data corresponding to the first program is recorded, and the first traffic playback data is cleaned. Using the target interface, the second program is triggered, and the second traffic playback data corresponding to the second program is recorded, and the second traffic playback data is cleaned. By comparing the first program and the second program, determine the difference function that distinguishes the first program from the second program; Based on the difference function, construct the filtering conditions; Using the aforementioned filtering criteria, first flow playback comparison data is obtained from the cleaned first flow playback data; Using the aforementioned filtering criteria, second flow playback comparison data is obtained by filtering from the cleaned second flow playback data; By comparing the first data volume of the first traffic replay comparison data with the second data volume of the second traffic replay comparison data, the data volume score of the first program is determined; By comparing the first generation time of the first traffic replay comparison data with the second generation time of the second traffic replay comparison data, the duration score of the first program is determined. By comparing the first coverage rate of the first traffic replay comparison data with the second coverage rate of the second traffic replay comparison data, the coverage score of the first program is determined. The total score of the first program is calculated by combining the data volume score, the coverage score, and the duration score. The merits of the first program are evaluated based on the total score.
2. The traffic playback comparison test method according to claim 1, characterized in that, The process of constructing screening conditions based on the difference function includes: Based on the functional type of the difference function, determine all parameter types that need to be compared; Filtering criteria are constructed based on each parameter type.
3. The traffic playback comparison test method according to claim 2, characterized in that, The process of constructing filtering conditions based on various parameter types includes: Construct a parameter setting window for each parameter type, and each parameter setting window is used to input the filter dependencies for the corresponding parameter type; Filtering criteria are constructed based on various parameter types and filtering dependencies.
4. The traffic playback comparison test method according to claim 1, characterized in that, The overall score of the first program is calculated by combining the data volume score, the coverage score, and the duration score, including: Based on the ability of traffic replay data volume to characterize the merits of the first program, the weight of data volume is determined. The product of the data volume score and the data volume weight is taken as the data volume product; Based on the ability of program processing time to characterize the merits of the first program, the time weight is determined. The product of the duration score and the duration weight is taken as the duration product; Based on the ability of traffic coverage to characterize the merits of the first program, the coverage weight is determined. The product of the coverage score and the coverage weight is taken as the coverage product; The sum of the product of the data volume, the product of the coverage rate, and the product of the duration is used as the total score of the first program.
5. The traffic playback comparison test method according to claim 1, characterized in that, The evaluation of the merits of the first program based on the total score includes: The total score is compared with a preset score threshold to evaluate the merits of the first program.
6. A flow rate playback comparison and testing device, characterized in that, include: The acquisition module is used to acquire a first program to be released, and a second program to conduct comparative tests with the first program; The determination module is used to determine the target interfaces for calling the first program and the second program; The recording module is used to trigger the first program using the target interface and record the first traffic playback data corresponding to the first program, clean the first traffic playback data, and trigger the second program using the target interface and record the second traffic playback data corresponding to the second program, and clean the second traffic playback data. A generation module is used to compare the first program and the second program to determine the difference function that distinguishes the first program from the second program. Based on the difference function, construct the filtering conditions; The filtering module is used to filter the first flow playback comparison data from the cleaned first flow playback data using the filtering conditions. Using the aforementioned filtering criteria, second flow playback comparison data is obtained by filtering from the cleaned second flow playback data; The evaluation module is used to compare the first data volume of the first traffic replay comparison data with the second data volume of the second traffic replay comparison data to determine the data volume score of the first program. By comparing the first generation time of the first traffic replay comparison data with the second generation time of the second traffic replay comparison data, the duration score of the first program is determined; by comparing the first coverage rate of the first traffic replay comparison data with the second coverage rate of the second traffic replay comparison data, the coverage score of the first program is determined; by combining the data volume score, the coverage score, and the duration score, the total score of the first program is calculated. The merits of the first program are evaluated based on the total score.
7. A flow playback comparison test device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the traffic replay comparison test method as described in any one of claims 1-5.
8. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the traffic playback comparison test method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method and system for improving flow playback coverage, and storage medium
CN112631921A
Regression testing method and device, equipment and storage medium
CN115495332A