Search

CN-121979783-A - Interface use case data processing method and device, electronic equipment and readable storage medium

CN121979783ACN 121979783 ACN121979783 ACN 121979783ACN-121979783-A

Abstract

The disclosure relates to the technical field of data processing, and provides an interface use case data processing method, an interface use case data processing device, electronic equipment and a readable storage medium. The method comprises the steps of carrying out clustering processing on flow data to be processed based on preset ordering conditions to obtain an ordered interface call chain, carrying out full field value matching processing on the response data and the request data to obtain a data dependency graph, carrying out parameterization processing on the request data based on the ordered interface call chain and the data dependency graph to obtain target interface case data, and verifying the target interface based on the target interface case data, so that the automation degree of interface testing is improved, the fitting degree of the case data and a real service scene is improved, the accuracy, the consistency and the maintainability of verification are improved, the accuracy and the efficiency of interface verification are improved, the interface case implementation efficiency is improved, the maintenance difficulty is reduced, and the reusability of the interface case data is enhanced.

Inventors

  • LI RAN

Assignees

  • 北京集智数字科技有限公司

Dates

Publication Date
20260505
Application Date
20251224

Claims (10)

  1. 1. An interface use case data processing method is characterized by comprising the following steps: clustering the flow data to be processed based on a preset ordering condition to obtain an ordered interface call chain, wherein the ordered interface call chain comprises response data and request data; performing full field value matching processing on the response data and the request data to obtain a data dependency graph; parameterizing the request data based on the ordered interface call chain and the data dependency graph to obtain target interface use case data; and verifying the target interface based on the target interface use case data.
  2. 2. The method for processing interface use case data according to claim 1, wherein the performing full field value matching processing on the response data and the request data to obtain a data dependency graph includes: Extracting the full field value of the response data to obtain an upstream value set; extracting all field parameters of the request data to obtain a downstream parameter set; performing accurate value matching processing on the upstream value set and the downstream parameter set to obtain a field blood edge mapping table; And constructing the data dependency graph based on the field blood margin mapping table.
  3. 3. The method for processing interface use case data according to claim 1, wherein the parameterizing the request data based on the ordered interface call chain and the data dependency graph to obtain target interface use case data includes: performing variable path marking processing on the data dependency graph to obtain a variable expression; Performing matching replacement processing on the request data and the variable expression to obtain parameterized request data; and carrying out sequential encapsulation processing on the parameterized request data based on the ordered interface call chain to obtain the target interface case data.
  4. 4. The interface use case data processing method according to claim 1, wherein the traffic data to be processed includes a time stamp field, a uniform resource identifier field, and a service identification field; Clustering is carried out on the flow data to be processed based on a preset ordering condition to obtain an ordered interface call chain, and the method comprises the following steps: performing ascending sort processing on the flow data to be processed based on the timestamp field to obtain a time sequence request response set; performing homologous aggregation processing on the time sequence request response set according to the uniform resource identifier field to obtain an interface call group; And clustering the interface call group based on the service identification field to obtain the ordered interface call chain.
  5. 5. The interface use case data processing method according to claim 1, wherein the verifying the target interface based on the target interface use case data includes: Performing assertion characteristic extraction processing on the target interface case data to obtain a reference check condition; performing environment variable injection processing on the target interface use case data to obtain environment adaptation request data; Performing replay processing on the environment adaptation request data to obtain real-time response data; And carrying out consistency check processing on the reference check condition and the real-time response data to obtain an interface verification result.
  6. 6. The method for processing interface use case data according to claim 5, wherein said performing a consistency check process on the reference check condition and the real-time response data to obtain an interface verification result includes: Performing state code extraction processing on the real-time response data to obtain a real-time state result; carrying out expected state extraction processing on the reference verification condition to obtain an expected state result; and carrying out equivalent judgment processing on the real-time state result and the expected state result to obtain the interface verification result.
  7. 7. The interface use case data processing method according to claim 1, further comprising, after the verifying the target interface based on the target interface use case data: acquiring a historical test execution result; performing regression test processing on the target interface case data to obtain a real-time test execution result; performing difference comparison processing on the historical test execution result and the real-time test execution result to obtain change influence data; and performing incremental updating processing on the data dependency graph based on the change influence data to obtain target interface use case updating data.
  8. 8. An interface use case data processing apparatus, comprising: The first processing module is used for carrying out clustering processing on flow data to be processed based on a preset ordering condition to obtain an ordered interface call chain, wherein the ordered interface call chain comprises response data and request data; The second processing module is used for carrying out full-field value matching processing on the response data and the request data to obtain a data dependency graph; The third processing module is used for carrying out parameterization processing on the request data based on the ordered interface call chain and the data dependency graph to obtain target interface use case data; and the fourth processing module is used for verifying the target interface based on the target interface case data.
  9. 9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 7 when the computer program is executed.
  10. 10. A readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the method according to any one of claims 1 to 7.

Description

Interface use case data processing method and device, electronic equipment and readable storage medium Technical Field The disclosure relates to the technical field of data processing, and in particular relates to an interface use case data processing method, an interface use case data processing device, electronic equipment and a readable storage medium. Background In the field of software testing, in order to verify interface functions, a tester is mainly relied on to manually analyze interface documents and service flows, write requests of each interface one by one and manually set parameter transfer relations, but the method is low in efficiency, script maintenance is required to be carried out again when interface definition or service logic is changed, the robustness of test cases is insufficient due to strong coupling with specific data, and interface request sequences can be automatically generated by recording network flows. Therefore, in the prior art, the problem that the interface automatic test case technology is low in implementation efficiency, difficult to maintain and poor in reusability is caused by low test case generation and maintenance efficiency and incapability of implementing case parameterization. Disclosure of Invention In view of the above, the embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a readable storage medium for processing interface use case data, so as to solve the problems in the prior art that the efficiency of implementing an interface automation test use case technology is low, the maintenance is difficult, and the reusability is poor due to the low efficiency of generating and maintaining test use cases and the incapability of implementing use case parameterization. The first aspect of the disclosed embodiments provides an interface use case data processing method, which comprises the steps of carrying out clustering processing on flow data to be processed based on preset ordering conditions to obtain an ordered interface call chain, carrying out full-field value matching processing on the response data and the request data to obtain a data dependency graph, carrying out parameterization processing on the request data based on the ordered interface call chain and the data dependency graph to obtain target interface use case data, and verifying a target interface based on the target interface use case data. In some embodiments, full field value matching processing is performed on response data and request data to obtain a data dependency graph, and the method comprises the steps of performing full field value extraction processing on the response data to obtain an upstream value set, performing full field parameter extraction processing on the request data to obtain a downstream parameter set, performing accurate value matching processing on the upstream value set and the downstream parameter set to obtain a field blood edge mapping table, and constructing the data dependency graph based on the field blood edge mapping table. In some embodiments, parameterizing request data based on an ordered interface call chain and a data dependency graph to obtain target interface use case data, wherein the parameterizing request data comprises the steps of performing variable path marking processing on the data dependency graph to obtain a variable expression, performing matching replacement processing on the request data and the variable expression to obtain parameterized request data, and performing sequential packaging processing on the parameterized request data based on the ordered interface call chain to obtain the target interface use case data. In some embodiments, the flow data to be processed comprises a time stamp field, a uniform resource identifier field and a service identification field, clustering is carried out on the flow data to be processed based on a preset ordering condition to obtain an ordered interface call chain, the method comprises the steps of carrying out ascending order ordering on the flow data to be processed based on the time stamp field to obtain a time sequence request response set, carrying out homologous aggregation on the time sequence request response set according to the uniform resource identifier field to obtain an interface call group, and carrying out clustering on the interface call group based on the service identification field to obtain the ordered interface call chain. In some embodiments, verifying the target interface based on the target interface use case data comprises performing assertion feature extraction processing on the target interface use case data to obtain a reference verification condition, performing environment variable injection processing on the target interface use case data to obtain environment adaptation request data, performing replay processing on the environment adaptation request data to obtain real-time response data, and performing consistency verificat