CN-116546278-B - Data processing method, device, electronic equipment and storage medium
Abstract
The method comprises the steps of obtaining a preset interface case, obtaining noise data corresponding to the interface case, obtaining actual response data and expected response data corresponding to the interface case, analyzing each first field in the actual response data to obtain a first analysis result, analyzing each second field in the expected response data to obtain a second analysis result, and determining a data processing result based on the first analysis result, the second analysis result and the noise data, wherein the data processing result is obtained by comparing all field information of the actual response data with all field information of the expected response data and automatically reducing noise, and is high in accuracy and high in data processing efficiency.
Inventors
- WU CHEN
- LI ZHIPENG
- HE SHAN
- ZHANG SHUTING
- DING MENGJIE
Assignees
- 北京达佳互联信息技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20230426
Claims (9)
- 1. A method of data processing, comprising: Acquiring a preset interface use case; Acquiring noise data corresponding to the interface use case; Acquiring actual response data and expected response data corresponding to the interface use case; Analyzing each first field in the actual response data to obtain a first analysis result; analyzing each second field in the expected response data to obtain a second analysis result; determining a data processing result based on the first analysis result, the second analysis result and the noise data; based on the request parameters carried by the interface use cases, initiating a request to a normal interface which passes the investigation, and acquiring first response data and second response data returned by the normal interface; the noise data is determined based on the first response data and the second response data.
- 2. The method of claim 1, wherein parsing each first field in the actual response data to obtain a first parsing result comprises: Determining a field value corresponding to the first field when the field type of the first field is a first preset type; the method comprises the steps of carrying out sorting processing on first elements corresponding to a first field under the condition that the field type of the first field is a second preset type, and determining the sorted first elements; analyzing each second field in the expected response data to obtain a second analysis result, wherein the second analysis result comprises: Determining a field value corresponding to each second field in the expected response data when the field type of the second field is the first preset type; when the field type of the second field is the second preset type, sorting the second elements corresponding to the second field, and determining the sorted second elements; obtaining the second analysis result based on the field value corresponding to the second field and the ordered second element; The first preset type comprises at least one of an integer type, a floating point type, a logic type and a character type, and the second preset type comprises at least one of a dictionary type and an array type.
- 3. The method of claim 2, wherein the determining the noise data based on the first response data and the second response data comprises: analyzing each third field in the first response data to obtain a third analysis result; analyzing each fourth field in the second response data to obtain a fourth analysis result; and comparing the third analysis result with the fourth analysis result to determine the noise data.
- 4. A method according to claim 3, wherein parsing each third field in the first response data to determine a third parsing result comprises: determining a field value corresponding to each third field in the first response data when the field type of the third field is a first preset type; when the field type of the third field is a second preset type, sorting the third elements corresponding to the third field, and determining the sorted third elements; obtaining the third analysis result based on the field value corresponding to the third field and the ordered third element; Analyzing each fourth field in the second response data to determine a fourth analysis result, including: Determining a field value corresponding to each fourth field in the second response data when the field type of the fourth field is the first preset type; when the field type of the fourth field is the second preset type, sorting the fourth elements corresponding to the fourth field, and determining the sorted fourth elements; obtaining a fourth analysis result based on the field value corresponding to the fourth field and the ordered fourth element; The first preset type comprises at least one of an integer type, a floating point type, a logic type and a character type, and the second preset type comprises at least one of a dictionary type and an array type.
- 5. The method of claim 1, wherein the obtaining actual response data and expected response data corresponding to the interface use case comprises: Based on the request parameters carried by the interface use cases, initiating a request to an interface to be checked, and acquiring the actual response data returned by the interface to be checked; and initiating a request to a normal interface which passes the investigation based on the request parameters, and acquiring the expected response data returned by the normal interface or acquiring the expected response data carried by the interface use case.
- 6. The method of claim 1, wherein the determining a data processing result based on the first analysis result, the second analysis result, and the noise data comprises: Comparing the first analysis result with the second analysis result to determine a comparison result; And determining the data processing result based on the noise data and the comparison result.
- 7. A data processing apparatus, comprising: the test case acquisition module is configured to acquire a preset interface case; The noise data determining module is configured to acquire noise data corresponding to the interface use case; The response data determining module is configured to acquire actual response data and expected response data corresponding to the interface use case; The analysis result determining module is configured to analyze each first field in the actual response data to obtain a first analysis result; analyzing each second field in the expected response data to obtain a second analysis result; A test result determination module configured to determine a data processing result based on the first analysis result, the second analysis result, and the noise data; The noise data determination module includes: The first data acquisition unit is configured to initiate a request to a normal interface which passes the investigation based on the request parameters carried by the interface use case, and acquire first response data and second response data returned by the normal interface; And a noise data determination unit configured to determine the noise data based on the first response data and the second response data.
- 8. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the data processing method of any one of claims 1 to 6.
- 9. A computer readable storage medium, characterized in that instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the data processing method of any one of claims 1 to 6.
Description
Data processing method, device, electronic equipment and storage medium Technical Field The present disclosure relates to data processing technology, and in particular, to a data processing method, apparatus, electronic device, and storage medium. Background With the development of internet technology, the application scale of software is wider and the development period is shorter and shorter, and the interfaces involved in the software are more and more, so that the management of the interfaces in the software is more and more important. The interfaces include interfaces between the software system and other systems external to the system, as well as interfaces between various sub-modules within the system. At present, when an interface is managed, data analysis is often required to be performed on the call condition of the interface manually, namely, related staff analyze check fields in the call result of the interface, and then compare and check the analyzed check fields to judge whether the expected condition is met, so that the data processing efficiency is lower. Disclosure of Invention The disclosure provides a data processing method, a data processing device, an electronic device and a storage medium, so as to at least solve the problem of low data processing efficiency in the related art. The technical scheme of the present disclosure is as follows: According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including: Acquiring a preset interface use case; acquiring noise data corresponding to the interface use cases; acquiring actual response data and expected response data corresponding to the interface use cases; Analyzing each first field in the actual response data to obtain a first analysis result, and analyzing each second field in the expected response data to obtain a second analysis result; And determining a data processing result based on the first analysis result, the second analysis result and the noise data. Optionally, parsing each first field in the actual response data to obtain a first parsing result, including: Determining a field value corresponding to the first field when the field type of the first field is a first preset type, sorting the first elements corresponding to the first field when the field type of the first field is a second preset type, and determining the sorted first elements; analyzing each second field in the expected response data to obtain a second analysis result, wherein the second analysis result comprises the following steps: Determining a field value corresponding to the second field when the field type of the second field is the first preset type, sorting the second elements corresponding to the second field when the field type of the second field is the second preset type, and determining the sorted second elements; The first preset type comprises at least one of an integer type, a floating point type, a logic type and a character type, and the second preset type comprises at least one of a dictionary type and an array type. Optionally, obtaining noise data corresponding to the interface use case includes: Based on request parameters carried by the interface use cases, initiating a request to a normal interface which passes the investigation, and acquiring first response data and second response data returned by the normal interface; noise data is determined based on the first response data and the second response data. Optionally, determining noise data based on the first response data and the second response data includes: Analyzing each third field in the first response data to obtain a third analysis result; analyzing each fourth field in the second response data to obtain a fourth analysis result; and comparing the third analysis result with the fourth analysis result to determine noise data. Optionally, parsing each third field in the first response data to determine a third parsing result includes: Determining a field value corresponding to the third field when the field type of the third field is a first preset type, sorting the third element corresponding to the third field when the field type of the third field is a second preset type, and determining a sorted third element; analyzing each fourth field in the second response data to determine a fourth analysis result, including: Determining a field value corresponding to the fourth field when the field type of the fourth field is the first preset type, sorting the fourth elements corresponding to the fourth field when the field type of the fourth field is the second preset type, and determining the sorted fourth elements; The first preset type comprises at least one of an integer type, a floating point type, a logic type and a character type, and the second preset type comprises at least one of a dictionary type and an array type. Optionally, acquiring actual response data and expected response data corresponding to the interface use