Search

CN-122021600-A - Test data processing method and device, electronic equipment and storage medium

CN122021600ACN 122021600 ACN122021600 ACN 122021600ACN-122021600-A

Abstract

The application provides a test data processing method, a device, an electronic device and a storage medium, wherein the method comprises the steps of obtaining a test entity name list and performing feature analysis to determine entity grouping; and inquiring test data in a database layer according to the multi-task comparison template, carrying out aggregation processing on the inquired test data in the database layer, backfilling the result data into the template and generating a test report. The application can realize intelligent grouping of entities, automatic adaptation of templates and efficient data processing, and is suitable for various scenes in which a single-task test report needs to be generated and scenes in which a multi-task comparison test report needs to be generated in batches.

Inventors

  • WANG YEJIE

Assignees

  • 网易(上海)网络有限公司

Dates

Publication Date
20260512
Application Date
20260211

Claims (14)

  1. 1. A method of testing data processing, the method comprising: acquiring a test related entity name list, performing feature analysis on the entity name list, and determining entity groups according to feature analysis results; carrying out grammar analysis on a preset single-task report template based on a grammar analyzer, and converting the single-task report template into a multi-task comparison template adapting to the entity grouping according to a grammar analysis result; Inquiring test data in a database layer according to the multi-task comparison template, carrying out aggregation treatment on the inquired test data in the database layer to obtain aggregated result data conforming to aggregation configuration, backfilling the result data into the multi-task comparison template, and generating a test report based on the multi-task comparison template.
  2. 2. The method of claim 1, wherein the performing feature analysis on the list of entity names comprises: and constructing a feature statistical matrix of the entity names, and carrying out feature analysis on the entity name list based on the feature statistical matrix.
  3. 3. The method of claim 2, wherein the feature statistical matrix is constructed by: acquiring entity names in the same cluster, and dividing each entity name into character string arrays according to preset special symbols; and constructing a feature statistical matrix based on the character string array, wherein the feature statistical matrix comprises the total number of field occurrence times, the number of times of judging the field as a random character string and the number of unique words after the field is subjected to digits removal.
  4. 4. The method of claim 3, wherein the rows of the feature statistics matrix respectively correspond to a total number of occurrences of the field, a number of occurrences of the field determined to be a random string, a number of unique words of the field after the digits are removed, and a number of columns matches a maximum length of the string array and respectively corresponds to each position of the segmented string array; If a certain column field is judged that the proportion of the number of times of the random character strings to the total number of times of occurrence of the column exceeds a preset threshold value, or the number of unique words after the column field is subjected to number removal meets a preset low diversity condition, marking the column as an neglected column.
  5. 5. The method of claim 4, wherein the performing feature analysis on the list of entity names, determining the entity group from the feature analysis result, comprises: Traversing columns of the feature statistical matrix; And selecting the character string segment with the highest frequency from the non-neglected column as a feature name, and dividing the entity into different groups according to the feature name.
  6. 6. The method of claim 1, wherein the syntax parser comprises a lexical parser for defining identifiers, placeholders, and plain text in the single-task report template, and a syntax parser for constructing an abstract syntax tree identifying data query nodes and layout nodes in the single-task report template.
  7. 7. The method of claim 6, wherein the parsing, based on the parser, the pre-set single-task report template, converting the single-task report template into a multi-task comparison template adapted to the entity group according to the parsing result, comprises: Performing first preprocessing on the abstract syntax tree of the single task report template, extracting and removing the duplicate data placeholders, and replacing the original data nodes with intermediate nodes with contrast marks; And performing second preprocessing on the abstract syntax tree subjected to the first preprocessing, positioning contrast mark nodes, expanding the contrast mark nodes into template fragments containing contrast display structures, and forming the multi-task contrast template.
  8. 8. The method of claim 7, wherein the expanding the contrast marker node into a template fragment comprising a contrast display structure comprises: and (5) injecting a table structure label and a chart structure label, adding task identification parameters and a difference calculation function, and completing the expansion of the comparison template.
  9. 9. The method of claim 1, wherein the test data is stored in a wide table structure of the column database, each column of the wide table structure corresponds to a test index, and invalid values in the table are filled with preset values and are stored in a sequence according to entity types.
  10. 10. The method of claim 1, wherein aggregating test data at a database layer to obtain aggregated result data conforming to an aggregation configuration, and backfilling the result data into the multi-task comparison template comprises: Generating a query statement based on entity feature configuration in the multi-task comparison template, and performing aggregation dimension reduction on the test data in a database based on the query statement; Adding filtering conditions in the query statement to filter invalid data at the database layer; And backfilling the final aggregation result data returned by the database to the corresponding position in the multi-task comparison template.
  11. 11. The method of claim 1, wherein the test data comprises dotting data representing discretized index data collected at a preset time interval or trigger condition, the method further comprising: and in the test process, dynamically aggregating the dotting data based on the preset time granularity.
  12. 12. A test data processing apparatus, the apparatus comprising: The determining module is used for acquiring a test-related entity name list, carrying out feature analysis on the entity name list, and determining entity groups according to a feature analysis result; The conversion module is used for carrying out grammar analysis on a preset single-task report template based on a grammar analyzer, and converting the single-task report template into a multi-task comparison template which is adaptive to the entity grouping according to a grammar analysis result; And the aggregation module is used for inquiring the test data in the database layer according to the multi-task comparison template, carrying out aggregation treatment on the inquired test data in the database layer to obtain aggregated result data conforming to aggregation configuration, backfilling the result data into the multi-task comparison template, and generating a test report based on the multi-task comparison template.
  13. 13. An electronic device comprising a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor in communication with the storage medium via the bus when the electronic device is in operation, the processor executing the machine-readable instructions to perform the test data processing method of any one of claims 1 to 11.
  14. 14. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, performs the test data processing method according to any one of claims 1 to 11.

Description

Test data processing method and device, electronic equipment and storage medium Technical Field The present application relates to the field of data processing technologies, and in particular, to a test data processing method, a test data processing device, an electronic device, and a storage medium. Background In various test scenarios such as software, hardware and the like, a test report needs to be generated based on test data after the test is completed so as to intuitively present a test result. The existing test report generation method has the defects that firstly, when the number of entities (such as test nodes, service examples and the like) involved in the test is numerous, the entities are grouped by manpower, so that time and labor are consumed, the grouping is unreasonable due to artificial judgment deviation, the pertinence of the report is influenced, secondly, the existing report template is designed in a single task mode, if the test results of a plurality of entities are required to be compared, the template is required to be manually modified to adapt to grouping requirements, the adaptation efficiency is low, the format disorder is easy to occur, thirdly, the test data processing is finished in an application layer, a large amount of original data is required to be firstly exported from a database, and then aggregation analysis is carried out, so that a large amount of transmission bandwidth is occupied, the data processing efficiency is low, and the problem is more prominent especially when the massive test hit data is faced. In order to solve the above technical problems, a test data processing method capable of realizing intelligent grouping of entities, automatic adaptation of templates and efficient data processing is needed. Disclosure of Invention In view of the above, embodiments of the present application provide a test data processing method, apparatus, electronic device, and storage medium, which can solve the technical problems of the existing test data processing method that entity grouping depends on manual work, single task template adaptation is poor, and data processing efficiency is low. The technical scheme of the embodiment of the application is realized as follows: In a first aspect, an embodiment of the present application provides a test data processing method, where the method includes: acquiring a test related entity name list, performing feature analysis on the entity name list, and determining entity groups according to feature analysis results; carrying out grammar analysis on a preset single-task report template based on a grammar analyzer, and converting the single-task report template into a multi-task comparison template adapting to the entity grouping according to a grammar analysis result; Inquiring test data in a database layer according to the multi-task comparison template, carrying out aggregation treatment on the inquired test data in the database layer to obtain aggregated result data conforming to aggregation configuration, backfilling the result data into the multi-task comparison template, and generating a test report based on the multi-task comparison template. In a second aspect, an embodiment of the present application further provides a test data processing apparatus, including: The determining module is used for acquiring a test-related entity name list, carrying out feature analysis on the entity name list, and determining entity groups according to a feature analysis result; The conversion module is used for carrying out grammar analysis on a preset single-task report template based on a grammar analyzer, and converting the single-task report template into a multi-task comparison template which is adaptive to the entity grouping according to a grammar analysis result; And the aggregation module is used for inquiring the test data in the database layer according to the multi-task comparison template, carrying out aggregation treatment on the inquired test data in the database layer to obtain aggregated result data conforming to aggregation configuration, backfilling the result data into the multi-task comparison template, and generating a test report based on the multi-task comparison template. In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a storage medium, and a bus, where the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the test data processing method according to any one of the first aspect. In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the test data processing method of any of the first aspects. The