Search

CN-121997910-A - Method, system, equipment and medium for automatically generating test report

CN121997910ACN 121997910 ACN121997910 ACN 121997910ACN-121997910-A

Abstract

The invention discloses a method, a system, equipment and a medium for automatically generating a test report, which belong to the technical field of intelligent report generation. The system comprises a source data analysis module, a mapping model construction module, a structured data stream generation module, an adaptive rendering control module and a target report generation module. According to the invention, automatic and accurate filling of test data is realized through a dual-model architecture of dynamic data mapping and self-adaptive layout rendering. The system can analyze the adaptation degree of the content entity and the container space in real time, intelligently execute the page cut-off or nondestructive fine adjustment compression of the form, and thoroughly solve the problem of page collapse caused by dynamic variable-length data. The generated report format is uniform and accords with the standard, and the intelligent level and the production efficiency of document processing are remarkably improved.

Inventors

  • ZHONG DANDONG
  • REN XIAOXUE

Assignees

  • 江苏保旺达软件技术有限公司

Dates

Publication Date
20260508
Application Date
20260119

Claims (10)

  1. 1. A method of automated generation of test reports, comprising: acquiring multidimensional test source data and a standardized document format template, and analyzing a metadata structure of the multidimensional test source data; Identifying feature placeholders in the standardized document format template, constructing a mapping index between the feature placeholders and the multidimensional test source data based on field attributes and a context logic relationship, and constructing a dynamic data mapping configuration model; cleaning and type conversion of the multidimensional test source data are implemented through the dynamic data mapping configuration model, and dependency relations among data items are identified to generate a structured data stream for content filling; Analyzing the adaptation degree of the content entity and the container space by combining the layout constraint conditions of the structured data stream and the standardized document layout template, and constructing a self-adaptive layout rendering control model for dynamic typesetting of a table area and a text area; And based on the self-adaptive layout rendering control model, the structured data stream is cooperatively injected into the standardized document layout template, and style unification processing is executed to generate a target test report.
  2. 2. A method of automated generation of test reports according to claim 1, wherein: The constructing a mapping index between the feature placeholder and the multidimensional test source data based on the field attribute and the context logic relationship, and the constructing a dynamic data mapping configuration model comprises the following steps: extracting field semantic features and type constraint features of the multi-dimensional test source data, and simultaneously analyzing tag description information and format limiting conditions of the feature placeholders; Calculating the association matching degree between the field semantic features and the tag description information, and screening out a primary candidate mapping set which accords with a preset similarity standard; Aiming at the ambiguous conflict item in the primary candidate mapping set, analyzing the topological positioning of the characteristic placeholder in the document layout level, comparing the logic attribution structure of the multidimensional test source data, and locking a unique mapping target through structural context verification; In response to locking the unique mapping target, it is serialized into an index instruction set, generating the dynamic data mapping configuration model.
  3. 3. A method of automated generation of test reports according to claim 1, wherein: the step of performing the cleaning and type conversion of the multidimensional test source data through the dynamic data mapping configuration model and identifying the dependency relationship between data items, and the step of generating the structured data stream for content filling comprises the following steps: Invoking preset check logic in the dynamic data mapping configuration model, traversing the multi-dimensional test source data to identify abnormal empty values and non-standard format items, and executing data management operation comprising invalid data elimination and default value complementation; According to the target display specification of the standardized document format template, the numerical accuracy of the checked data is regulated, the measurement units are normalized, and the data expression paradigm is unified; analyzing logic association attributes among data items, identifying discrete data items belonging to the same test object and the same test batch, and constructing a multi-layer data aggregation group; And in response to constructing the multi-layer data aggregation packet, distributing a time sequence index and a position label to the data packet according to document reading logic, and packaging to generate the structured data stream with a logic level.
  4. 4. A method of automated generation of test reports according to claim 1, wherein: The step of analyzing the fit degree of the content entity and the container space by combining the layout constraint conditions of the structured data stream and the standardized document layout template, and the step of constructing the self-adaptive layout rendering control model comprises the following steps: Analyzing the geometric dimensions of the table cells in the standardized document format template and the boundary coordinates of the text field, and determining the effective accommodation space of the target container; Calculating the estimated visual height required by the complete rendering of the content according to the total character amount, the font size and the line spacing attribute of the content to be filled in the structured data stream; Responding to the estimated visual height, comparing the estimated visual height with an available height threshold value of the effective accommodating space, and generating a space adaptation evaluation result comprising three layers of safety filling, critical warning and overflow cutoff; And responding to the generated space adaptation evaluation result, mapping the space adaptation evaluation result to a preset layout adaptation rule base, establishing trigger logic between different adaptation levels and layout adjustment actions, and constructing the adaptive layout rendering control model.
  5. 5. A method of automated generation of test reports according to claim 4, wherein: Mapping the space adaptation evaluation result to a preset layout self-adaptation rule base, and establishing trigger logic between different adaptation levels and layout adjustment actions comprises the following steps: responding to the space adaptation evaluation result to judge that overflow is truncated, identifying the indivisible attribute of the table row in the structured data stream, and locking the last complete data row which is allowed to be accommodated by the current page; Positioning a paging breakpoint based on the last complete data line, generating a paging control instruction to forcedly end the rendering flow of the current page, and transferring the rest data to be filled to a next page container; Responding to data migration to the next page container, calling a header definition structure of a table area in the standardized document format template, and reproducing the header definition structure at the starting position of the next page container; establishing a visual connection index between cross-page tables, and maintaining semantic integrity of the structured data stream on continuous pages.
  6. 6. A method of automated generation of test reports according to claim 4, wherein: mapping the space adaptation evaluation result to a preset layout self-adaptation rule base, and establishing trigger logic between different adaptation levels and layout adjustment actions, wherein the trigger logic comprises the following steps: Responding to the space adaptation evaluation result to judge as a critical warning, and calculating a geometric deviation value of the content to be filled beyond the effective accommodation space; calling a non-destructive layout compression algorithm based on the geometric deviation value, and iteratively calculating a line space compression ratio or a word space tightening step length until the estimated visual height is converged within the available height threshold range; Generating a layout fine adjustment instruction, and forcibly adapting the content to be filled to the effective accommodating space on the premise of maintaining the whole layout structure of the standardized document layout template unchanged.
  7. 7. A method of automated generation of test reports according to claim 1, wherein: The step of collaborative injection of the structured data stream into the standardized document layout template based on the adaptive layout rendering control model, and the step of executing style unification processing, the step of generating a target test report comprises the following steps: in response to the structured data stream being injected into the standardized document layout template, traversing document global nodes to identify style pollution items caused by data source format carrying; Forcing the application of a global font family attribute and paragraph alignment rule defined by the standardized document format template to cover the style pollution item; aiming at the table area, detecting and repairing cell frame fracture or background color discontinuous abnormality caused by data dynamic filling; And responding to the completion of all style correction operations, solidifying the rendering state of the document, and generating the target test report.
  8. 8. A system for automated generation of test reports employing a method for automated generation of test reports according to any of claims 1 to 7, comprising: the source data analysis module is used for acquiring multidimensional test source data and a standardized document format template and analyzing a metadata structure of the multidimensional test source data; the mapping model construction module is used for identifying feature placeholders in the standardized document layout template, constructing mapping indexes between the feature placeholders and the multidimensional test source data based on field attributes and context logic relations, and constructing a dynamic data mapping configuration model; The structured data stream generating module is used for implementing cleaning and type conversion of the multidimensional test source data through the dynamic data mapping configuration model, identifying the dependency relationship among data items and generating a structured data stream for content filling; The self-adaptive rendering control module is used for combining the layout constraint conditions of the structured data stream and the standardized document layout template, analyzing the adaptation degree of the content entity and the container space, constructing a self-adaptive layout rendering control model and dynamically typesetting a table area and a text area; And the target report generation module is used for cooperatively injecting the structured data stream into the standardized document format template based on the self-adaptive layout rendering control model, and executing style unification processing to generate a target test report.
  9. 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, carries out the steps of a method of automated test report generation according to any one of claims 1 to 7.
  10. 10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of a method of automated test report generation according to any of claims 1 to 7.

Description

Method, system, equipment and medium for automatically generating test report Technical Field The invention relates to the technical field of intelligent report generation, in particular to a method, a system, equipment and a medium for automatically generating a test report. Background With the deep advancement of digital transformation, massive multidimensional test data are generated in various industrial detection, software testing and laboratory analysis scenes. To meet the requirements of industry compliance review and final business delivery, these structured or semi-structured raw data needs to be consolidated and assembled into test reports with standardized formats. At present, the mainstream report generation mode is gradually changed from purely manual input to a semi-automatic tool, and the efficiency of data filling is improved to a certain extent by utilizing a script language or a batch processing program, so that the method becomes a conventional means for current enterprise-level document processing. However, existing semi-automated generation techniques still face many challenges in the face of complex and varied practical applications. First, the data mapping mechanism lacks flexibility, and conventional schemes often establish associations based on fixed cell coordinates or hard-coded rules, which often result in map misalignments or even program crashes once the metadata structure of the source data is fine-tuned, e.g., adding columns of data or changing field order. A more critical issue is the stiffness of the layout, which is often lacking in the prior art in terms of a visual high pre-judgment mechanism for document container space and content entities, and simple sequential filling logic cannot perceive the geometric constraints of page boundaries. When facing dynamic tables or large text with uncertain length, abnormal typesetting such as hard cutting of table rows, loss of table header information during page crossing, critical data in critical areas at the bottom of pages and the like often occurs, and the readability of documents is seriously affected. If a forced paging strategy with one cutter is adopted, a large amount of pages are easily left white, and the overall attractiveness is destroyed. In addition, the non-standard format code carried in the source data often pollutes the global style of the target document, so that the generated report fonts are disordered or frames are broken, a large amount of manpower is still required to be consumed for secondary correction and manual trimming in the later period, and full-flow automatic delivery in the true sense is difficult to realize. Disclosure of Invention In view of the foregoing, the present invention provides a method, system, apparatus, and medium for automated generation of test reports. Therefore, the invention solves the technical problems that the existing test report has low manual filling efficiency and data mapping is easy to make mistakes, and especially, the page-crossing typesetting confusion, the abnormal cutting and the non-uniform document style of the form caused by the variable-length data dynamic filling are solved. The technical scheme includes that the method comprises the steps of obtaining multidimensional test source data and a standardized document format template, analyzing metadata structures of the multidimensional test source data, identifying feature placeholders in the standardized document format template, constructing mapping indexes between the feature placeholders and the multidimensional test source data based on field attributes and context logic relations, constructing a dynamic data mapping configuration model, conducting cleaning and type conversion of the multidimensional test source data through the dynamic data mapping configuration model, identifying dependency relations between data items, generating a structured data stream for content filling, analyzing the fit degree of a content entity and a container space by combining the structured data stream and the layout conditions of the standardized document format template, constructing an adaptive layout rendering control model for dynamic typesetting of a table area and a text area, conducting collaborative injection of the structured data stream into the standardized document format template based on the adaptive layout rendering control model, and executing unified test report processing. The method for automatically generating the test report comprises the steps of constructing a mapping index between the feature placeholder and the multi-dimensional test source data based on field attributes and context logic relations, constructing a dynamic data mapping configuration model, extracting field semantic features and type constraint features of the multi-dimensional test source data, analyzing tag description information and format limiting conditions of the feature placeholder, calculating association matching degree between