Test report generation method and device, computer equipment and storage medium
By receiving reports to generate instructions and test data, analyzing and generating target test report templates, automatically filling in data and adjusting reports, the problems of data in the existing technology such as inconsistency, inconsistent standards, inconsistent reports, and high cost are solved, and the automation and efficiency of report generation are achieved.
Patent Information
- Application Number
- CN202510146570.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, data inconsistency, inconsistent standards, inability to generalize reports and high costs.
Generate instructions and test data by receiving reports, perform data analysis to obtain target test report templates, automatically fill in data and adjust reports to comply with preset rules.
Automation of report generation reduces manual intervention, improves the accuracy, professionalism and versatility of reports, and reduces costs.
Smart Images

Figure CN120068835A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular to a method, device, equipment and storage medium for generating test reports. Background Art
[0002] In laboratory testing institutions, the efficiency and accuracy of report writing have always been a challenge. Many laboratories still rely on manual writing of test reports, which is not only inefficient but also error-prone. Even if some laboratories have introduced automated reporting systems, these systems often only meet the partial needs of specific laboratories and are difficult to adapt to the diverse reporting needs in the market, especially the templates of different vehicle manufacturers and the changes to existing templates.
[0003] There are many limitations in the process and system of report writing, and these problems are mainly reflected in the following aspects: First, it is difficult to standardize the format, content, and data statistics of manually written reports, which affects the professionalism and standardization of reports and thus damages the professional image of the laboratory. In addition, in manual operations, due to differences in personnel writing habits and format understanding, the report formats are often inconsistent, resulting in inconsistent data presentation. This inconsistency makes it difficult to use the reports for subsequent data analysis and statistics. Second, the detection content and standards in laboratories are often updated, and the maintenance of manual reports requires frequent adjustment of formats and content. Each change requires manual intervention, increasing the maintenance cost and prone to version inconsistencies. Finally, it is very difficult to accurately trace the data source, modification time, and modifying personnel of manually recorded reports. When querying or auditing is required, it is very inconvenient to search and check manual reports, lacking accurate historical trace records. In addition, manual reports cannot be directly used for batch data processing and analysis. When conducting comprehensive analysis in laboratories, it is often necessary to re-enter data, consuming a large amount of manpower and increasing the possibility of errors. The report systems of some laboratories are only applicable to specific reports of the current laboratory and are difficult to adapt to new requirements and changing reports, limiting the generality and flexibility of the reports. Summary of the Invention
[0004] An object of an embodiment of the present invention is to provide a method, device, equipment and storage medium for generating test reports, which are used to solve the technical problems of data inconsistency, non-uniform standards, non-generic reports, and high costs in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a test report, which is applied to a test report generation system. The method includes:
[0006] Receiving a report generation instruction and corresponding test data;
[0007] Performing data analysis on the test data according to the report generation instruction to obtain a target test report template;
[0008] Populate the target report template with the test data to generate a first test report;
[0009] Adjust the first test report to obtain a target test report that conforms to the preset rules.
[0010] In a second aspect, an embodiment of the present invention provides a test report generation device, which is applied to a test report generation system. The device includes:
[0011] A receiving unit, configured to receive a report generation instruction and corresponding test data;
[0012] An analysis unit, configured to perform data analysis on the test data according to the report generation instruction to obtain a target test report template;
[0013] A filling unit, configured to populate the target report template with the test data to generate a first test report;
[0014] An adjustment unit, configured to adjust the first test report to obtain a target test report that conforms to the preset rules.
[0015] In a third aspect, an embodiment of the present invention provides a computer device, including:
[0016] At least one processor; and,
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect.
[0019] In a fourth aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor is caused to execute the method described in the first aspect.
[0020] In the solution implemented by the above test report generation method, device, equipment and storage medium, the method first receives a report generation instruction and corresponding test data. Secondly, according to the report generation instruction, data analysis is performed on the test data to obtain a target test report template. Then, the target report template is filled with data according to the test data to generate a first test report. Finally, the first test report is adjusted to obtain a target test report that meets the preset rules. This method reduces manual intervention by automatically receiving the report generation instruction and test data, speeds up the report generation speed, and can intelligently select or generate a test report template according to different test data and instructions, improving the pertinence and practicality of the report. Further, by receiving clear report generation instructions and relevant test data, the system can ensure that the generated report conforms to the user's needs and expectations. Through the analysis of test data, the system can automatically identify and select the most suitable data model and template, improving the efficiency of report generation, and also ensuring the relevance and accuracy of the structure and content of the report, making the report more targeted and practical. Through automated data filling, the time from test completion to report generation is significantly shortened, and the time of manual operation and possible errors are reduced, making report generation faster and more reliable. By adjusting the report format and content, the professionalism and credibility of the report are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 It is a schematic diagram of a test report generation system in an embodiment of the present invention;
[0023] Figure 2 It is a flowchart of a test report generation method in an embodiment of the present invention;
[0024] Figure 3 It is a schematic diagram of the structure of a test report generation device in an embodiment of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts fall within the protection scope of the present invention.
[0027] It should be noted that if there is no conflict, the various features in the embodiments of the present invention can be combined with each other and are all within the protection scope of the present invention. In addition, although functional module division is carried out in the device schematic diagram and the logical sequence is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the sequence in the flowchart. Furthermore, the terms "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0028] The technical solution of the present application is applicable to various test scenarios.
[0029] In the test report generation method, it is applied to a test report generation system. Refer to Figure 1 , Figure 1 which is a schematic diagram of a test report generation system provided by an embodiment of the present application. The test report generation system 10 includes a user interface module 20, a data processing module 30, a template management module 40, and a report generation module 50.
[0030] Among them, the user interface module 20 provides a user-friendly interface, allowing users to input report generation instructions and upload test data. It supports multiple input formats and instruction types to ensure the usability and flexibility of the system.
[0031] Among them, the data processing module 30 is responsible for receiving and preprocessing the test data provided by the user. It includes data cleaning, format conversion, and preliminary analysis to provide high-quality data input for the subsequent data analysis module. Further, according to the user's report generation instructions, in-depth analysis is performed on the test data. Machine learning or statistical analysis methods are applied to identify key patterns and trends in the data to select a suitable report template.
[0032] Among them, the template management module 40 is used to store and manage various preset test report templates. It supports the creation, update, and deletion of templates to ensure the dynamic update and expansion of the template library.
[0033] Among them, the report generation module 50 is used to fill the analysis results into the selected report template to generate a preliminary test report. It supports automated content filling and format adjustment to improve the efficiency and accuracy of report generation; further provides tools and functions that allow users to fine-tune and optimize the preliminarily generated report. It supports format adjustment, content modification, and addition of additional information to ensure that the final report meets the preset format and quality standards; further is responsible for generating the final target test report and outputting and storing it in multiple formats (such as PDF, DOCX). It supports report version management and history records for easy user access and tracking.
[0034] In summary, through the collaborative work of the above modules, the test report generation system 10 can efficiently generate high-quality test reports to meet the diverse needs of users.
[0035] In view of this, this application proposes a test report generation method to solve the above problems. The following is a specific introduction.
[0036] Please refer to Figure 2 , Figure 2 which is a flowchart of a test report generation method provided by an embodiment of the present invention. The method includes the following steps:
[0037] S10. Receive a report generation instruction and corresponding test data.
[0038] Among them, the report generation instruction can be manually input by the user through the system interface, including graphical user interface, API call, command-line tool, etc. The report generation instruction can also be automatically sent by the test management system to the report generation system after the test execution is completed. The report generation instruction can be passed in by an external system (such as continuous integration / continuous deployment CI / CD tool, project management software, etc.) through an API interface or other service call methods.
[0039] Specifically, the report generation instruction usually contains specific requirements for generating the report, such as report type, format, content scope, etc.
[0040] Among them, the test data includes the execution results (passed, failed, skipped) of test cases, test coverage, performance metrics, etc., test environment information, test tool versions, test scripts, etc., and defect records related to the test results, including defect descriptions, severities, statuses, etc.
[0041] Among them, the test data usually exists in tabular form, such as records in a database, CSV files, or log files, text descriptions, pictures.
[0042] Optionally, before data analysis, the system may need to preprocess the received test data. This includes operations such as data cleaning, duplicate removal, format conversion, etc., to ensure the quality and consistency of the data.
[0043] It can be seen that in this embodiment, the test report generation system can accurately receive the report generation instruction and the corresponding test data, ensuring the accuracy and integrity of the data.
[0044] S20. According to the report generation instruction, perform data analysis on the test data to obtain a target test report template.
[0045] Among them, the main purpose of data analysis is to extract useful information from the original test data and determine how to organize and display this information according to the requirements of the report generation instruction, so as to generate a structured and information-rich test report template.
[0046] Specifically, it is first necessary to parse the report generation instruction input by the user to identify the type, purpose, and specific requirements of the report, such as identifying keywords, analyzing the syntax structure, and understanding the context. Extract specific requirements from the instruction, such as the level of detail of the report, specific metrics or data ranges of concern.
[0047] Among them, according to the requirements in the instruction and the characteristics of the data, the system selects appropriate analysis methods, including statistical analysis, machine learning models, data mining techniques, etc. Execute the data analysis process, calculate the required metrics, generate charts, and identify key trends and anomalies in the data. The system can use automated tools and algorithms to improve the efficiency and accuracy of the analysis.
[0048] Optionally, the system queries the internal report template library to find the template that best matches the analysis results and user needs. The template library may contain various types of templates, such as detailed reports, summary reports, graphical reports, etc. By comparing the analysis results with the template features, the system recommends one or more most suitable templates for the user to choose. The recommendation process may be based on a rule engine, machine learning algorithms, or user historical preferences.
[0049] Among them, according to the specific data analysis results and the personalized needs of the user, the selected template is fine-tuned, involving adjusting the layout of the template, modifying the chapter order of the report, or adding specific explanations and annotations. The template selection process has the ability to be dynamically updated to adapt to data changes and user need adjustments. The system should be able to flexibly add or remove template elements.
[0050] It can be seen that in this embodiment, through the above steps, the test report generation system can effectively convert the user's instructions into specific data analysis actions, select the most appropriate report template, improve the efficiency and accuracy of report generation, ensure the relevance and practicality of the report, and ultimately provide users with high-quality test reports.
[0051] S30. Fill the target report template with the test data to generate a first test report.
[0052] Among them, the purpose of data filling is to accurately insert the previously analyzed and screened test data into the corresponding positions of the target report template, so as to generate a test report with complete content and accurate information.
[0053] In specific implementation, first, the system needs to parse the structure of the selected template and identify each element and placeholder therein. These elements may include titles, chapters, tables, charts, text paragraphs, etc. There are usually multiple placeholders in the template to identify the positions where data needs to be filled. The system needs to identify these placeholders and determine the corresponding data types and formats. Map the analyzed data to the placeholders in the template. This requires the system to have intelligent matching capabilities to ensure that each data point can be accurately filled into the corresponding position and ensure that the data format is consistent with the template requirements. For example, convert numerical data into percentage form or format the timestamp into a readable date. Further, the system automatically fills the test data into the corresponding positions in the template. This process should ensure the accuracy and integrity of the data and avoid any omissions or errors. For some template elements, such as charts and tables, the system may need to dynamically generate content. For example, use the data to generate bar charts or line charts to visually display the test results.
[0054] Optionally, adjust the language and style of the report according to the user's preferences and the purpose of the report. This may involve modifying the wording, adjusting the tone, or adding explanatory text. Ensure that the layout and typesetting of the report are beautiful and easy to read. This includes adjusting visual elements such as font size, paragraph spacing, header and footer.
[0055] Among them, after data filling, the system generates the first version of the test report, that is, the first test report. This version should fully reflect the test data and analysis results and meet the basic needs of users.
[0056] Optionally, the system provides a report preview function, allowing users to view and verify the report content. Users can put forward modification suggestions or confirm the final version of the report.
[0057] It can be seen that in this embodiment, the test data can be effectively filled into the target report template to generate a first test report, which improves the efficiency of report generation and ensures the accuracy and professionalism of the report content.
[0058] S40. Adjust the first test report to obtain a target test report that conforms to preset rules.
[0059] Among them, the purpose of adjusting the first test report is to ensure that the report not only contains all necessary information and data, but also conforms to preset rules. The preset rules may include, but are not limited to, format specifications, content completeness, logical clarity, margins, font sizes, color coding, etc. Therefore, the preset rules ensure that the report meets expectations in terms of visual effects, information accuracy, and compliance.
[0060] Among them, the preset rules may come from industry standards, company policies, customer requirements, or project specifications. The system needs to flexibly support different sources and types of rules.
[0061] Optionally, the system can use an automated tool to review the first test report and identify parts that do not conform to the preset rules. This may involve checking the format of the report, content completeness, data accuracy, etc.
[0062] In a specific implementation, the adjustment process can be to check whether the data in the report is accurate, whether there are omissions or errors; ensure that the format of the report conforms to the preset style guide and industry standards; check whether the report conforms to the preset rules and standards through an automated tool; adjust the format of the report according to the preset rules, including fonts, colors, layouts, etc.; for a too-long report, perform reasonable pagination to ensure that the content of each page is complete; adjust the size and position of the charts to ensure that the charts are clear and correspond to the relevant text content; after the adjustment is completed, conduct a second review to ensure that all modifications have been implemented and are correct; use the automated tool again to verify whether the report conforms to all preset rules.
[0063] It can be seen that in this embodiment, through the adjustment process, the initially generated test report can be effectively adjusted into a target report that conforms to the preset rules, improving the quality and consistency of the report.
[0064] This method reduces manual intervention by automatically receiving report generation instructions and test data, speeds up the report generation speed, and can intelligently select or generate a test report template according to different test data and instructions, improving the pertinence and practicality of the report; further, by receiving clear report generation instructions and relevant test data, the system can ensure that the generated report conforms to the user's needs and expectations; through the analysis of test data, the system can automatically identify and select the most suitable data model and template, improving the efficiency of report generation, and also ensuring the relevance and accuracy of the structure and content of the report, making the report more targeted and practical; through automated data filling, the time from test completion to report generation is significantly shortened, and the time of manual operation and possible errors are reduced, making report generation faster and more reliable; by adjusting the report format and content, the professionalism and credibility of the report are enhanced.
[0065] In one embodiment, the analyzing the test data according to the report generation instruction to obtain a target test report template includes: extracting features from the test data according to the report generation instruction to obtain feature data; obtaining a preset test report template database; using the feature data as a query identifier to perform matching in the preset test report template database to obtain a target test report template, the target test report template including a plurality of target test report sub-templates and a target test report main template; placing the plurality of target test report sub-templates in the target test report main template according to a first preset layout rule to obtain a target test report template.
[0066] Among them, feature extraction is the process of identifying and extracting key information from the original test data, and the feature data can represent the essential features and attributes of the test data. Specifically, the feature data may include data distribution, trend, outliers, statistical indicators, etc.
[0067] In specific implementation, the process of feature extraction is as follows: cleaning the data to remove irrelevant or redundant information; determining which data fields are key features, such as test results, test case numbers, test dates, etc.; extracting these key features from the original data to form a feature data set.
[0068] Among them, according to the feature data, the most suitable report template is found in the template database to ensure that the content and format of the report meet the requirements.
[0069] Specifically, the system uses a matching algorithm (such as rule-based matching, machine learning model, etc.) to search for the template that best matches the query identifier in the preset test report template database.
[0070] Among them, the preset test report template database stores a variety of pre-designed report templates, including sub-templates and main templates.
[0071] Specifically, the target test report sub-template is a template for specific types of data or test results, such as test case details, charts, statistical tables, etc.
[0072] Specifically, the target test report main template defines the overall structure and style of the report, including the header, footer, table of contents, chapter layout, etc.
[0073] Among them, the first preset layout rule refers to a set of predefined rules for guiding how to place the sub-template into the main template to form the final report structure. The first preset layout rule may involve the order of the sub-templates, the layout method, space allocation, etc.
[0074] It can be seen that in this embodiment, the system can efficiently extract features from the test data and use these features to match the most suitable report template in the template database. The finally generated target test report template not only meets the user's requirements but also has good readability and professionalism.
[0075] In one embodiment, placing the multiple target test report sub-templates into the target test report main template according to the preset layout rule to obtain the target test report template includes: obtaining historical template data corresponding to the multiple target test report sub-templates; performing feature extraction on the historical template data to obtain historical feature data; inputting the historical feature data into a preset model to obtain a layout position sequence output by the preset model, where the preset model is used to predict the layout position corresponding to each historical feature data; and placing the multiple target test report sub-templates into the target test report main template according to the layout position sequence to obtain the target test report template.
[0076] Among them, the historical template data includes previously generated report templates, used layout styles, and layout information.
[0077] Among them, the historical feature data may involve the structure of the template, the layout, the types of charts used, the text style, etc.
[0078] Among them, the process of performing feature extraction on the historical template data can be to select relevant fields and determine which template elements (such as titles, charts, paragraphs, etc.) are key features affecting the layout; and convert the selected elements into quantifiable data, such as position coordinates, font sizes, color codes, etc.
[0079] Among them, the preset model is usually a machine learning model that is trained to predict the layout position sequence of a given feature data set. The preset model learns from a large amount of historical data to master the relationship between different feature data and layout positions, so as to accurately predict new feature data.
[0080] Among them, the preset model outputs a typesetting position sequence according to the input historical feature data. This sequence indicates the optimal positions of each sub-template in the main template. Verify the typesetting position sequence output by the model to ensure its rationality and effectiveness. If anomalies are found, it may be necessary to adjust the model or retrain it.
[0081] Among them, the typesetting position sequence is a set of orders or coordinates indicating the placement positions of sub-templates in the main template. The typesetting position sequence output by the model is used to determine the specific positions of each sub-template in the main template.
[0082] Among them, according to the typesetting position sequence output by the model, the system automatically places the sub-templates in the corresponding positions of the main template. During the placement process, the system may dynamically adjust the sizes and positions of the sub-templates according to actual situations (such as page boundaries, content lengths, etc.). By integrating the sub-templates into the main template according to the typesetting position sequence, a complete target test report template is generated.
[0083] It can be seen that in this embodiment, historical template data and a preset model can be used to intelligently predict and optimize the typesetting positions of reports, improving the report generation efficiency and ensuring the quality and consistency of reports.
[0084] In one embodiment, before obtaining the preset test report template database, the method further includes: obtaining an initial test report template; receiving a target instruction for adjusting the section area in the initial test report template; and performing section processing on the initial test report template according to the target instruction to obtain a target test report template, which is stored in the preset test report template database.
[0085] Among them, the initial test report template is a basic report framework that contains the basic structure of the report and some standardized content sections, such as title, abstract, test results, conclusions, etc.
[0086] Among them, the initial test report template may be a standard report template that has been developed and approved for use within the company, or a template purchased externally or formulated according to industry standards.
[0087] Among them, the target instruction is a specific instruction received by the user or the report generation system, and the target instruction details how to adjust the section area in the initial test report template. The target instruction may include: adding or deleting specific content sections; adjusting the order or position of sections; changing the format or style of sections.
[0088] Therefore, the target instruction ensures that the generated report can meet specific requirements, whether for project requirements, customer preferences, or industry standards.
[0089] Among them, section processing refers to the process of modifying and optimizing each content section in the initial test report template according to the target instructions.
[0090] Among them, according to the target instructions, adjusting the section areas in the template may involve rearranging the section order, modifying the section content, adjusting the section size or style, etc.
[0091] Specifically, the process of section processing is as follows: First, identify the sections in the template that need to be adjusted; according to the target instructions, make corresponding adjustments to the identified sections. For example, if the instruction requires deleting a certain section, then remove that section from the template; adjust the format of the section according to the instructions, such as font size, color, margin, etc.; if the instruction involves content update, then analyze and replace the text or data in the section.
[0092] Specifically, storing the target test report template in a preset test report template database can facilitate future retrieval and use, and at the same time provide more flexibility for the report generation process. The stored information may include version information to facilitate tracking the change history of the template. Record relevant information about the template, such as creation date, modification history, usage frequency, etc.
[0093] It can be seen that in this embodiment, the initial test report template can be effectively adjusted to a target template that meets specific requirements and incorporated into the template database, improving the adaptability and flexibility of the template.
[0094] In one embodiment, the target test report template includes multiple target test report sub-templates and a target test report main template. The data filling of the target report template according to the test data to generate a first test report includes: creating a filling task corresponding to each target test report sub-template according to the multiple target test report sub-templates; creating a thread pool according to the test task volume corresponding to the test data; allocating the filling tasks corresponding to each target test report sub-template to the threads in the thread pool, so that each thread performs a filling operation on the test data in parallel to generate a second test report; adjusting the second test report according to the second preset layout rule of the target test report main template to generate a first test report.
[0095] Among them, the filling task refers to the operation of inserting a specific data set (such as test results, statistical data, etc.) into the target test report sub-template. Each sub-template can correspond to different data sets and filling logics. By creating independent filling tasks for each sub-template, fine-grained control of the report generation process can be achieved, improving the flexibility and efficiency of processing.
[0096] Specifically, the process of creating a filling task is to determine which test data is required for each sub-template and establish a data mapping relationship; define specific operation steps for each filling task, such as data verification, format conversion, error handling, etc.
[0097] Among them, a thread pool is a resource pool for managing threads. It allows the reuse of threads, reducing the overhead of thread creation and destruction. Specifically, determine the size of the thread pool according to the amount and complexity of the test data to ensure the effective utilization of system resources, and consider hardware resource limitations such as the number of CPU cores and the size of memory.
[0098] Among them, assign the created filling tasks to the idle threads in the thread pool, and each thread is responsible for executing one or more filling tasks.
[0099] Among them, the threads perform filling operations on the test data in parallel, and each thread independently completes its assigned tasks. During the parallel processing, an exception handling mechanism needs to be considered to ensure that the failure of one task does not affect other tasks.
[0100] Among them, after each thread completes the filling task, it generates a sub-report containing the filled data, and these sub-reports together constitute the second test report.
[0101] Among them, the second preset layout rules may include but are not limited to rearranging content, adjusting formats, optimizing visual effects, etc. After adjustment, a first test report that meets the final requirements is generated. The first test report should be complete, readable, and professional, and can effectively convey the test results.
[0102] It can be seen that in this embodiment, the advantages of multi-thread parallel processing can be efficiently utilized to quickly generate a test report with rich content and standardized format, which not only improves the speed of report generation, but also optimizes the utilization of system resources through the management of the thread pool, making the report generation system more efficient and reliable.
[0103] In one embodiment, adjusting the second test report according to the second preset layout rules of the target test report main template to generate the first test report includes: detecting whether the layout parameters of the second test report are consistent with the layout parameters of the target test report main template; if not, update the layout parameters of the second test report to the layout parameters of the target test report main template to generate the first test report.
[0104] Among them, layout parameters refer to a series of settings that affect the appearance and layout of the report, including but not limited to page margins, font sizes, line spacings, paragraph formats, title styles, chart sizes and positions, etc.
[0105] In specific implementation, the layout parameters of the second test report can be automatically compared with those of the main template through scripts or software tools. The system will check key layout parameters item by item, such as title levels, list formats, table borders, etc.
[0106] Among them, during the detection process, all layout parameter items inconsistent with the main template are identified. These inconsistencies may be caused by incorrect initial settings, format changes during data filling, or other reasons. When it is detected that the layout parameters of the second test report are inconsistent with those of the main template of the target test report, the system needs to record these differences. Using layout software or script tools, the inconsistent layout parameters of the second test report are automatically updated to the standard parameters of the main template. This process needs to ensure the accuracy and comprehensiveness of the update.
[0107] Optionally, after completing the update of the layout parameters, a comprehensive verification of the report is carried out to ensure that the layout parameters of all parts have been correctly updated, and the overall visual effect and readability of the report meet the expectations. Integrate all the updated content to generate the first test report. Ensure that the format of the report is unified, the content is complete, and it meets all design and functional requirements.
[0108] It can be seen that in this embodiment, it is possible to ensure that the layout parameters of the test report are consistent with the main template, improve the professionalism and consistency of the report, and also enhance the visual attractiveness and readability of the report.
[0109] In one embodiment, adjusting the first test report to obtain a target test report that meets the preset rules includes: obtaining the number of levels of the first test report; when the number of levels exceeds the preset number of layers, performing pagination processing on the layout sequence in the first test report to obtain the paginated target test report.
[0110] Among them, the number of levels refers to the depth of the content structure of the test report. For example, the report may include chapters, sub-chapters, paragraphs, etc., and each level of title or content block represents a level. Obtaining the number of levels is to understand the structural complexity of the report in order to perform appropriate layout and pagination processing to ensure the readability and aesthetics of the report.
[0111] Among them, the obtaining process can be to automatically identify the title levels and content blocks in the report through the report generation system, so as to count the number of levels.
[0112] Among them, the preset number of layers is a threshold defined in the system or report standard, used to determine whether the levels of the report are too complex. When the number of levels of the report exceeds the preset number of layers, it may cause the content on a single page to be too dense or chaotic, affecting the reading experience. Therefore, pagination processing is required.
[0113] Among them, the specific process of pagination is to determine at which level or content block to perform pagination to maintain the coherence and logic of the content; according to the pagination points, the system re-typesets the report content to ensure that each page has an appropriate title and content structure; pagination marks are inserted at appropriate positions to indicate pagination at this point during printing or display. During the pagination process, the page layout and design are adjusted to ensure that the amount of information on each page is moderate and the visual effect is good. At the same time, page numbers, tables of contents or navigation links are added to improve the navigability of the report.
[0114] Among them, each page in the target test report after pagination has a clear title and content, which is convenient for reading and understanding; and through pagination processing, the content of the report is evenly distributed among the pages, avoiding the problem that some pages are too blank or crowded.
[0115] It can be seen that in this embodiment, the hierarchical structure and pagination of the test report can be effectively managed, making the report more concise, easy to read, and having a good visual presentation and user experience.
[0116] It should be noted that in the above various embodiments, there is not necessarily a certain order between the above steps. Those of ordinary skill in the art can understand according to the description of the embodiments of the present application that in different embodiments, the above steps can have different execution orders, that is, they can be executed in parallel or exchanged, etc.
[0117] As another aspect of the embodiments of the present application, the embodiments of the present application provide a test report generation device. Among them, the test report generation device can be a software module, and the software module includes several instructions, which are stored in the memory. The processor can access this memory and call the instructions to execute to complete the test report generation method described in the above various embodiments.
[0118] See Figure 3 , Figure 3 is a schematic structural diagram of a test report generation device provided by the embodiments of the present application. As Figure 3 shown, applied to a test report generation system, the test report generation device 300 includes:
[0119] A receiving unit 301, configured to receive a report generation instruction and corresponding test data;
[0120] An analysis unit 302, configured to perform data analysis on the test data according to the report generation instruction to obtain a target test report template;
[0121] A filling unit 303, configured to fill the target report template with the test data to generate a first test report;
[0122] An adjustment unit 304 is configured to adjust the first test report to obtain a target test report that meets a preset rule.
[0123] This method automatically receives a report generation instruction and test data, reducing manual intervention and accelerating the report generation speed. Moreover, according to different test data and instructions, it can intelligently select or generate a test report template, improving the pertinence and practicality of the report. Further, by receiving a clear report generation instruction and relevant test data, the system can ensure that the generated report conforms to the user's needs and expectations. Through the analysis of test data, the system can automatically identify and select the most suitable data model and template, improving the efficiency of report generation and ensuring the relevance and accuracy of the report's structure and content, making the report more targeted and practical. Through automated data filling, the time from test completion to report generation is significantly shortened, and the time and possible errors of manual operations are reduced, making report generation faster and more reliable. By adjusting the report format and content, the professionalism and credibility of the report are enhanced.
[0124] In one embodiment, in the step of performing data analysis on the test data according to the report generation instruction to obtain a target test report template, the analysis unit 302 is further configured to: extract features from the test data according to the report generation instruction to obtain feature data; acquire a preset test report template database; use the feature data as a query identifier to perform matching in the preset test report template database to obtain a target test report template, where the target test report template includes a plurality of target test report sub-templates and a target test report main template; place the plurality of target test report sub-templates in the target test report main template according to a first preset layout rule to obtain a target test report template.
[0125] In one embodiment, in the step of placing the plurality of target test report sub-templates in the target test report main template according to a preset layout rule to obtain a target test report template, the analysis unit 302 is further configured to: acquire historical template data corresponding to the plurality of target test report sub-templates; extract features from the historical template data to obtain historical feature data; input the historical feature data into a preset model to obtain a layout position sequence output by the preset model, where the preset model is used to predict the layout position corresponding to each historical feature data; place the plurality of target test report sub-templates in the target test report main template according to the layout position sequence to obtain a target test report template.
[0126] In one embodiment, before obtaining the preset test report template database, the analysis unit 302 is further configured to: obtain an initial test report template; receive a target instruction for adjusting a section area in the initial test report template; and perform section processing on the initial test report template according to the target instruction to obtain a target test report template, where the target test report template is stored in the preset test report template database.
[0127] In one embodiment, the target test report template includes a plurality of target test report sub-templates and a target test report main template. In the process of filling the target report template with the test data to generate a first test report, the filling unit 303 is further configured to: create a filling task corresponding to each target test report sub-template according to the plurality of target test report sub-templates; create a thread pool according to the test task amount corresponding to the test data; assign the filling task corresponding to each target test report sub-template to a thread in the thread pool, so that each thread performs a filling operation on the test data in parallel to generate a second test report; and adjust the second test report according to a second preset layout rule of the target test report main template to generate a first test report.
[0128] In one embodiment, in the process of adjusting the second test report according to a second preset layout rule of the target test report main template to generate a first test report, the filling unit 303 is further configured to: detect whether the layout parameters of the second test report are consistent with the layout parameters of the target test report main template; if not, update the layout parameters of the second test report to the layout parameters of the target test report main template to generate a first test report.
[0129] In one embodiment, in the process of adjusting the first test report to obtain a target test report that meets the preset rules, the adjustment unit 304 is further configured to: obtain the number of levels of the first test report; when the number of levels exceeds a preset number of levels, perform pagination processing on the layout sequence in the first test report to obtain a paginated target test report.
[0130] It should be noted that the above test report generation device can execute the test report generation method provided in the embodiments of the present application, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the embodiments of the test report generation device, reference may be made to the test report generation method provided in the embodiments of the present application.
[0131] See Figure 4 , Figure 4It is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device includes one or more processors 41 and a memory 42. The memory 42 is connected to one or more processors 41, for example, connected to the processor 41 through a bus.
[0132] The processor 41 is configured to support the computer device to execute the corresponding functions in the methods in the above method embodiments. The processor 41 may be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The above hardware chip may be an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The above PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0133] The memory 42 is used to store program codes, etc. The memory 42 may include a volatile memory (VM), such as a random access memory (RAM); the memory 42 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); the memory 42 may further include a combination of the above types of memories.
[0134] The memory 42 can be used to store non-volatile software programs, non-volatile computer executable programs, and modules, such as the program instructions / modules corresponding to the test report generation method in the embodiments of the present application. The processor 41 executes various functional applications and data processing of the test report generation method and the test report generation device by running the non-volatile software programs, instructions, and modules stored in the memory 42, that is, realizes the functions of each module or unit of the test report generation method and the test report generation device provided in the above method embodiments.
[0135] The memory 42 may include a program storage area and a data storage area. The program storage area may store an operating system and application programs required for at least one function. The data storage area may store data created according to the use of the test report generation device, etc. In some embodiments, the memory 42 may optionally include a memory 42 remotely provided with respect to the processor 41, and these remote memories 42 may be connected to the test report generation device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0136] The one or more modules are stored in the memory 42 and, when executed by the one or more processors 41, execute the test report generation method in any of the above method embodiments. For example, the method steps described in the above method embodiments are executed to implement the functions of the modules described in the above device embodiments.
[0137] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, and the program instructions, when executed by a computer, cause the computer to execute the method as described in the foregoing embodiments.
[0138] Those of ordinary skill in the art can understand that all or part of the processes in the above method embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, it may include the processes of the above method embodiments. Among them, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0139] The foregoing disclosure is only a preferred embodiment of the present application, and of course, it cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A test report generation method, characterized in that: Applied to a test report generation system, the method comprises: Receive report generation instructions and corresponding test data; According to the report generation instruction, the test data is analyzed to obtain a target test report template; Filling the target report template with data according to the test data to generate a first test report; The first test report is adjusted to obtain a target test report that complies with preset rules.
2. The method according to claim 1, characterized in that The step of performing data analysis on the test data according to the report generation instruction to obtain a target test report template includes: According to the report generation instruction, feature extraction is performed on the test data to obtain feature data; Obtain a database of preset test report templates; Using the characteristic data as a query identifier, matching is performed in the preset test report template database to obtain a target test report template, wherein the target test report template includes a plurality of target test report sub-templates and a target test report main template; According to a first preset layout rule, the plurality of target test report sub-templates are placed in the target test report main template to obtain a target test report template.
3. The method according to claim 2, characterized in that The method of placing the plurality of target test report sub-templates in the target test report main template according to the preset typesetting rule to obtain the target test report template includes: Acquire historical template data corresponding to the plurality of target test report sub-templates; Extracting features from the historical template data to obtain historical feature data; Inputting the historical feature data into a preset model to obtain a typesetting position sequence output by the preset model, wherein the preset model is used to predict the typesetting position corresponding to each historical feature data; According to the layout position sequence, the multiple target test report sub-templates are placed in the target test report main template to obtain a target test report template.
4. The method according to claim 2, characterized in that: Before obtaining the preset test report template database, the method further includes: Get the initial test report template; receiving a target instruction, wherein the target instruction is used to adjust a section area in the initial test report template; According to the target instruction, the initial test report template is subjected to plate processing to obtain a target test report template, and the target test report template is stored in the preset test report template database.
5. The method according to claim 1, characterized in that The target test report template includes a plurality of target test report sub-templates and a target test report main template, and the target report template is filled with data according to the test data to generate a first test report, including: According to the multiple target test report sub-templates, create a filling task corresponding to each target test report sub-template; Creating a thread pool according to the test task amount corresponding to the test data; Allocating the filling task corresponding to each target test report sub-template to the threads in the thread pool, so that each thread performs a filling operation on the test data in parallel to generate a second test report; According to the second preset layout rule of the target test report master template, the second test report is adjusted to generate a first test report.
6. The method according to claim 5, characterized in that The step of adjusting the second test report according to the second preset typesetting rule of the target test report master template to generate the first test report includes: Detecting whether the layout parameters of the second test report are consistent with the layout parameters of the target test report master template; If they are inconsistent, the layout parameters of the second test report are updated to the layout parameters of the target test report master template to generate a first test report.
7. The method according to claim 1, characterized in that The adjusting the first test report to obtain a target test report that complies with a preset rule includes: Obtaining the number of levels of the first test report; When the number of levels exceeds a preset number of levels, the layout sequence in the first test report is paged to obtain a paged target test report.
8. A test report generating device, applied to a test report generating system, the method comprising: A receiving unit, used for receiving a report generation instruction and corresponding test data; An analysis unit, configured to perform data analysis on the test data according to the report generation instruction to obtain a target test report template; A filling unit, used to fill the target report template with data according to the test data to generate a first test report; The adjustment unit is used to adjust the first test report to obtain a target test report that complies with preset rules.
9. A computer device, comprising a memory and a processor, wherein the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and when the processor executes the one or more computer programs, the computer device implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program comprises program instructions, and when the program instructions are executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Report generation method, apparatus and device, and computer storage medium
CN114118047A
Test report method and device, electronic equipment and storage medium
CN115358203A
Test report generation method and device, equipment, medium and product
CN117454868A
Test report generation method and device, ultrasonic equipment and storage medium
CN118350360A
Report generation method and device, storage medium and electronic equipment
CN118824455A