Test report generation method and device, electronic equipment and storage medium
By extracting key information in Excel files and generating content documents, and combining asynchronous log documents to generate test reports, the problem of complex and inflexible processing of multiple Excel files in the existing technology is solved, and more intuitive and accurate report generation is achieved, improving user experience.
Patent Information
- Application Number
- CN202411753080.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-21
AI Technical Summary
When generating test reports, the process of multiple Excel files is complex and inflexible, resulting in poor unified documents, split content, easy data loss, lack of support for charts, and poor user interaction experience.
By obtaining the user's table data, extracting key information, generating content documents based on the key information, and generating test reports in combination with asynchronous log documents. This method includes classification according to the attributes of key information, selecting preset templates, updating tables and paragraph patterns, adjusting content documents, and supporting exception capture and asynchronous log generation.
It has realized the unification of multiple documents into a single document report, which has improved the intuitiveness and accuracy of the report, enhanced the data expression ability, supported multiple data interaction methods, and improved the user experience.
Smart Images

Figure CN119669079A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of test report generation, and in particular to a test report generation method, device, electronic device and storage medium. Background Art
[0002] The automatic generation method of the test report is usually to convert a single or multiple Excel files into documents, read the data in the Excel files, and format it into a unified document. However, there are many problems in the document conversion or document generation process in the prior art.
[0003] For example, when multiple files need to be converted into one document, the processing complexity is high. When processing multiple Excel files, the implementation of the existing technology is complex and not flexible enough, and it is difficult to meet the specific needs of different users, resulting in poor uniformity of the generated documents, fragmented content, and frequent data loss. In addition, the data presentation method is single and lacks support for charts, making the report not intuitive and easy to understand. The user interaction is complex and the user interaction experience is poor. It is necessary to manually edit the script or operate in the command line, which is time-consuming and labor-intensive. Summary of the invention
[0004] The purpose of this application is to provide a test report generation method, device, electronic device and storage medium, which can convert multiple files into a document report, unify multiple files according to user needs, have higher flexibility, make the report more intuitive and accurate, improve the ability to express data, support multiple modes of data interaction, and improve user experience.
[0005] In a first aspect, an embodiment of the present application provides a test report generating method, the method comprising:
[0006] Get the user's form data;
[0007] Extracting key information from the table data;
[0008] Generate a content document according to the key information;
[0009] Obtaining an asynchronous log document in the process of generating the content document;
[0010] The test report is generated according to the content document and the asynchronous log document.
[0011] In the above implementation process, a content document is generated according to the key information in the table data obtained in advance, and then a test report is generated in combination with the asynchronous log document. Multiple files can be converted into one document report, so that multiple files can be unified according to user needs. This has higher flexibility, makes the report more intuitive and accurate, improves the ability to express data, supports various methods of data interaction, and improves user experience.
[0012] Furthermore, the step of generating a content document according to the key information includes:
[0013] Classify the key information according to the attributes of the key information to obtain table information, paragraph information and picture information;
[0014] Selecting a preset basic template according to the table information, the paragraph information and the picture information;
[0015] Adding the table information, the paragraph information and the picture information to the basic template to obtain a first document;
[0016] The content document is generated according to the first document.
[0017] In the above implementation process, the key information is divided into different categories according to its attributes, which facilitates the unified management of the contents in the table data, improves the conversion efficiency of multiple files, and meets the different needs of different users, thereby realizing unified management of data.
[0018] Furthermore, the step of generating the content document according to the first document includes:
[0019] Update the table model in the first document according to the first function to obtain a new table model;
[0020] updating the paragraph pattern in the first document according to the second function to obtain a new paragraph pattern;
[0021] The new table mode and the new paragraph mode are adjusted according to the third function to obtain the content document.
[0022] In the above implementation process, after the table mode and paragraph mode in the first document are updated according to different methods, the new table mode and the new paragraph mode are uniformly planned, so that different content data can be unified in the content document while retaining the diversity of the data and improving the flexibility of multi-data conversion.
[0023] Furthermore, the step of updating the table model in the first document according to the first function to obtain a new table model includes:
[0024] Get the parameters of the table information;
[0025] According to the first function, the parameters of the table information are updated into the XML structure corresponding to the first document to obtain the new table model.
[0026] In the above implementation process, the parameters of the table information are updated to the first document according to the first function, and the table mode is updated and adjusted in time according to user needs, which can improve the flexibility of the table information.
[0027] Furthermore, the step of updating the paragraph pattern in the first document according to the second function to obtain a new paragraph pattern includes:
[0028] Parameters for obtaining paragraph information;
[0029] According to the second function, the parameters of the paragraph information are updated into the XML structure corresponding to the first document to obtain the new paragraph pattern.
[0030] In the above implementation process, the parameters of the paragraph information are updated to the first document according to the second function, so that the paragraph format and paragraph mode can be adjusted in time according to user needs. Different data can be unified, and special customization can be performed according to user needs, which is more flexible and can enhance the user experience.
[0031] Furthermore, the step of adjusting the new table mode and the new paragraph mode according to the third function to obtain the content document includes:
[0032] Determine whether there is paging in the new table mode and the new paragraph mode;
[0033] If so, repeatedly display and adjust the new table mode and the new paragraph mode according to the third function to obtain the content document;
[0034] If not, the content document is generated according to the new table mode and the new paragraph mode.
[0035] In the above implementation process, when the new table mode and the new paragraph mode have paging conditions, the table information and the paragraph information can be displayed in the previous page and the next page of the paging respectively, which is convenient for searching and improves the flexibility of page switching.
[0036] Furthermore, the step of obtaining the asynchronous log document in the process of generating the content document includes:
[0037] Add an exception catching function in the XML structure corresponding to the content document;
[0038] Get multiple log information during the running process of the content document after adding the exception capture function;
[0039] The asynchronous log document is generated according to the multiple log information.
[0040] In the above implementation process, the exceptions in the log information are captured in time according to the exception capture function, and an asynchronous log document is generated, which can accurately record the exceptions in the process of generating the content document, and repair them in time to ensure the integrity of the document content.
[0041] In a second aspect, an embodiment of the present application further provides a test report generating device, the device comprising:
[0042] The acquisition module is used to obtain the user's table data;
[0043] An extraction module, used for extracting key information from the table data;
[0044] A generating module, used to generate a content document according to the key information; and also used to generate the test report according to the content document and the asynchronous log document;
[0045] The data acquisition module is used to obtain the asynchronous log document in the process of generating the content document.
[0046] In the above implementation process, a content document is generated according to the key information in the table data obtained in advance, and then a test report is generated in combination with the asynchronous log document. Multiple files can be converted into one document report, so that multiple files can be unified according to user needs. This has higher flexibility, makes the report more intuitive and accurate, improves the ability to express data, supports various methods of data interaction, and improves user experience.
[0047] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first aspects when executing the computer program.
[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method as described in any one of the first aspects.
[0049] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method as described in any one of the first aspects.
[0050] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0051] And it can be implemented according to the contents of the specification. The following is a detailed description of the preferred embodiments of the present application with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the range values. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0053] Figure 1 A flow chart of a test report generation method provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of the structure of a test report generating device provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of the structural composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0057] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0058] The specific implementation methods of the present application are further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present application, but are not used to limit the scope of the present application.
[0059] Embodiment 1
[0060] Figure 1 is a flow chart of a test report generation method provided in an embodiment of the present application, such as Figure 1 As shown, the method includes:
[0061] S1, obtain the user's table data;
[0062] S2, extract key information from the tabular data;
[0063] S3, generating content documents based on key information;
[0064] S4, obtaining an asynchronous log document in the process of generating a content document;
[0065] S5, generating a test report according to the content document and the asynchronous log document.
[0066] In the above implementation process, a content document is generated according to the key information in the table data obtained in advance, and then a test report is generated in combination with the asynchronous log document. Multiple files can be converted into one document report, so that multiple files can be unified according to user needs. This has higher flexibility, makes the report more intuitive and accurate, improves the ability to express data, supports various methods of data interaction, and improves user experience.
[0067] The embodiment of the present application realizes the automatic generation of report documents through the python-docx library, can dynamically generate structured report documents according to user needs, extract relevant information from Excel data source, and insert data into specific locations in the document according to predefined templates, which greatly improves the efficiency of document generation and reduces the possibility of errors in manual operations. It realizes flexible customization of report content and supports dynamic insertion of paragraphs, titles, tables, pictures and other content in various formats to meet the needs of different scenarios.
[0068] In S1 and S2, this application dynamically generates reports based on changes in Excel data (table data). By reading the contents of the Excel file, key information related to the test is extracted, including test time, test location, test information, test results, etc., and these data are inserted into the corresponding positions in the document. For example, by calling the add_paragraph() and add_table() functions, customized paragraphs and tables can be generated in the document to ensure the consistency and flexibility of the document format.
[0069] Furthermore, S3 includes:
[0070] Classify the key information according to its attributes to obtain table information, paragraph information and picture information;
[0071] Select a preset basic template based on table information, paragraph information and image information;
[0072] Add table information, paragraph information and picture information to the basic template to obtain a first document;
[0073] A content document is generated according to the first document.
[0074] In the above implementation process, the key information is divided into different categories according to its attributes, which facilitates the unified management of the contents in the table data, improves the conversion efficiency of multiple files, and meets the different needs of different users, thereby realizing unified management of data.
[0075] The present application embodiment presets a variety of basic templates, and users can select a suitable template to generate reports as needed. The basic template contains different paragraph structures, table styles, and picture layouts. According to the structure of the basic template, key information is classified and inserted in sequence, which can be achieved through the add_run() function and the add_picture() function. In addition, the paragraph style in the template can be customized according to different needs, such as changing the format parameters such as font, font size, and color.
[0076] The embodiment of the present application supports dynamically generating a table based on Excel data and filling the data into the specified cells of the table. In order to improve the readability of the document, you can set a custom row height, column width and font style during the table generation process. The system provides a high degree of flexibility and can dynamically adjust the number of rows and columns of the table according to the size of the Excel data to ensure that all data can be displayed correctly.
[0077] Furthermore, the step of generating a content document according to the first document includes:
[0078] Update the table model in the first document according to the first function to obtain a new table model;
[0079] The paragraph mode in the first document is updated according to the second function to obtain a new paragraph mode;
[0080] The new table mode and the new paragraph mode are adjusted according to the third function to obtain the content document.
[0081] In the above implementation process, after the table mode and paragraph mode in the first document are updated according to different methods, the new table mode and the new paragraph mode are uniformly planned, so that different content data can be unified in the content document while retaining the diversity of the data and improving the flexibility of multi-data conversion.
[0082] Furthermore, the step of updating the table model in the first document according to the first function to obtain a new table model includes:
[0083] Get the parameters of the table information;
[0084] According to the first function, the parameters of the table information are updated into the XML structure corresponding to the first document to obtain a new table model.
[0085] In the above implementation process, the parameters of the table information are updated to the first document according to the first function, and the table mode is updated and adjusted in time according to user needs, which can improve the flexibility of the table information.
[0086] The embodiment of the present application sets the border, thickness, color and other parameters in the table information through the first function (set_table_border() function) to keep the appearance of each table consistent. By directly modifying the XML structure, the borders around the table and the internal grid lines can be precisely controlled and set. This refined control ensures that each table in the document has a unified border style, enhancing the professional appearance of the document.
[0087] Furthermore, the step of updating the paragraph pattern in the first document according to the second function to obtain a new paragraph pattern includes:
[0088] Parameters for obtaining paragraph information;
[0089] According to the second function, the parameters of the paragraph information are updated into the XML structure corresponding to the first document to obtain a new paragraph mode.
[0090] In the above implementation process, the parameters of the paragraph information are updated to the first document according to the second function, so that the paragraph format and paragraph mode can be adjusted in time according to user needs. Different data can be unified, and special customization can be performed according to user needs, which is more flexible and can enhance the user experience.
[0091] This application can format the paragraph mode through the second function (set_font() function) to ensure that the font, font size, color and other information in the report meet the user's needs. Through the operation of the XML structure, more rich format settings can be achieved, such as line spacing, indentation, alignment, etc. of different paragraphs. The title, body, table content, etc. of the document can be defined separately.
[0092] Furthermore, the step of adjusting the new table mode and the new paragraph mode according to the third function to obtain the content document includes:
[0093] Determine whether there is paging in the new table mode and the new paragraph mode;
[0094] If so, repeatedly display and adjust the new table mode and the new paragraph mode according to the third function to obtain the content document;
[0095] If not, generate the content document according to the new table mode and the new paragraph mode.
[0096] In the above implementation process, when the new table mode and the new paragraph mode have paging conditions, the table information and the paragraph information can be displayed in the previous page and the next page of the paging respectively, which is convenient for searching and improves the flexibility of page switching.
[0097] The system implements the paging of table mode and paragraph mode, as well as repeated display of table headers through the third function (set_repeat_table_header() function). When the table or paragraph content crosses pages, it can be automatically repeated at the top of the new page to ensure that users can easily identify the table content when reading multi-page reports. This application supports automatic adjustment of tables, so that the table automatically scales according to the content to avoid confusion in layout caused by too much cell content.
[0098] This application can be applied to Word, PDF, HTML and other formats, and supports report documents that can be viewed on different platforms and distributed through email, cloud sharing, etc.
[0099] Furthermore, S4 includes:
[0100] Add an exception catching function to the XML structure corresponding to the content document;
[0101] Get multiple log information during the running process of the content document after adding the exception capture function;
[0102] Generates asynchronous log documents based on multiple log messages.
[0103] In the above implementation process, the exceptions in the log information are captured in time according to the exception capture function, and an asynchronous log document is generated, which can accurately record the exceptions in the process of generating the content document, and repair them in time to ensure the integrity of the document content.
[0104] The report document of the embodiment of the present application provides real-time log output and progress bar update functions, which can intuitively view each step of report generation and ensure the transparency of the report generation process.
[0105] In each process of document generation, a log message is generated by the background thread and sent to the main thread through the signal mechanism. The log information will be displayed in the log output box of the user interface, and the user can clearly see the detailed execution status of each step, ensuring the transparency of the task execution process and facilitating user tracking.
[0106] In order to improve the stability of the system, the embodiment of the present application adds an error handling mechanism to the document generation task to ensure that it can run normally and provide appropriate error prompts even when encountering exceptions.
[0107] Specifically, an exception capture mechanism is added to each key step. If an exception such as file reading error or format mismatch occurs, the system can capture it in time and provide a clear error prompt to the user without causing the program to crash. When an error occurs, detailed exception information will be recorded in the log information, and the asynchronous log document generated later can be used for subsequent troubleshooting by the user, and help users or developers quickly locate the source of the problem and fix it.
[0108] The embodiment of the present application is implemented through a multi-threaded asynchronous processing method, which effectively avoids the problem of interface freezing or unresponsiveness.
[0109] The document generation task is executed in a separate thread, and the main thread is responsible for handling user interface operations. The background thread will gradually perform operations such as parsing Excel data and generating documents, and after the task is completed, it will notify the main thread to update the interface status through the signal slot mechanism, ensuring that the user interface can remain smooth when generating large files or processing complex documents.
[0110] The embodiment of the present application realizes the communication between the background thread and the main thread through pyqtSignal. When the background thread processes the document generation, it will pass the progress and log information to the main thread through the signal, and the main thread will update the progress bar and log output box of the interface in real time according to the signal content. This avoids the thread insecurity problem caused by the multi-threaded interface update in the traditional method.
[0111] The progress of the document generation process is sent to the main thread through the progress signal of the background thread. After receiving the signal, the main thread updates the progress in the interface. After the task is completed, the background thread will notify the main thread through a signal, prompting the user that the task has been completed and providing the document save path, which can improve the user experience and ensure that the user can obtain the generated report in time.
[0112] Embodiment 2
[0113] In order to execute the method corresponding to the above embodiment 1 to achieve the corresponding functions and technical effects, a test report generating device is provided below, such as Figure 2 As shown, the device comprises:
[0114] Acquisition module 1, used to obtain user's table data;
[0115] Extraction module 2, used to extract key information from table data;
[0116] A generating module 3 is used to generate a content document according to key information; and is also used to generate a test report according to the content document and the asynchronous log document;
[0117] The data acquisition module 4 is used to obtain the asynchronous log document in the process of generating the content document.
[0118] In the above implementation process, a content document is generated according to the key information in the table data obtained in advance, and then a test report is generated in combination with the asynchronous log document. Multiple files can be converted into one document report, so that multiple files can be unified according to user needs. This has higher flexibility, makes the report more intuitive and accurate, improves the ability to express data, supports various methods of data interaction, and improves user experience.
[0119] Furthermore, the generating module 3 is also used for:
[0120] Classify the key information according to its attributes to obtain table information, paragraph information and picture information;
[0121] Select a preset basic template based on table information, paragraph information and image information;
[0122] Add table information, paragraph information and picture information to the basic template to obtain a first document;
[0123] A content document is generated according to the first document.
[0124] In the above implementation process, the key information is divided into different categories according to its attributes, which facilitates the unified management of the contents in the table data, improves the conversion efficiency of multiple files, and meets the different needs of different users, thereby realizing unified management of data.
[0125] Furthermore, the generating module 3 is also used for:
[0126] Update the table model in the first document according to the first function to obtain a new table model;
[0127] The paragraph mode in the first document is updated according to the second function to obtain a new paragraph mode;
[0128] The new table mode and the new paragraph mode are adjusted according to the third function to obtain the content document.
[0129] In the above implementation process, after the table mode and paragraph mode in the first document are updated according to different methods, the new table mode and the new paragraph mode are uniformly planned, so that different content data can be unified in the content document while retaining the diversity of the data and improving the flexibility of multi-data conversion.
[0130] Furthermore, the generating module 3 is also used for:
[0131] Get the parameters of the table information;
[0132] According to the first function, the parameters of the table information are updated into the XML structure corresponding to the first document to obtain a new table model.
[0133] In the above implementation process, the parameters of the table information are updated to the first document according to the first function, and the table mode is updated and adjusted in time according to user needs, which can improve the flexibility of the table information.
[0134] Furthermore, the generating module 3 is also used for:
[0135] Parameters for obtaining paragraph information;
[0136] According to the second function, the parameters of the paragraph information are updated into the XML structure corresponding to the first document to obtain a new paragraph mode.
[0137] In the above implementation process, the parameters of the paragraph information are updated to the first document according to the second function, so that the paragraph format and paragraph mode can be adjusted in time according to user needs. Different data can be unified, and special customization can be performed according to user needs, which is more flexible and can enhance the user experience.
[0138] Furthermore, the generating module 3 is also used for:
[0139] Determine whether there is paging in the new table mode and the new paragraph mode;
[0140] If so, repeatedly display and adjust the new table mode and the new paragraph mode according to the third function to obtain the content document;
[0141] If not, generate the content document according to the new table mode and the new paragraph mode.
[0142] In the above implementation process, when the new table mode and the new paragraph mode have paging conditions, the table information and the paragraph information can be displayed in the previous page and the next page of the paging respectively, which is convenient for searching and improves the flexibility of page switching.
[0143] Furthermore, the data acquisition module 4 is also used for:
[0144] Add an exception catching function to the XML structure corresponding to the content document;
[0145] Get multiple log information during the running process of the content document after adding the exception capture function;
[0146] Generates asynchronous log documents based on multiple log messages.
[0147] In the above implementation process, the exceptions in the log information are captured in time according to the exception capture function, and an asynchronous log document is generated, which can accurately record the exceptions in the process of generating the content document, and repair them in time to ensure the integrity of the document content.
[0148] The test report generating device described above can implement the method described in the first embodiment described above. The options described in the first embodiment described above are also applicable to this embodiment and will not be described in detail here.
[0149] The rest of the contents of the embodiments of the present application can refer to the contents of the above-mentioned embodiment 1, and will not be repeated in this embodiment.
[0150] Embodiment 3
[0151] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the test report generating method of the first embodiment.
[0152] Optionally, the above-mentioned electronic device may be a server.
[0153] See also Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 31, a communication interface 32, a memory 33 and at least one communication bus 34. The communication bus 34 is used to realize direct connection and communication between these components. The communication interface 32 of the device in the embodiment of the present application is used to communicate signaling or data with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.
[0154] The processor 31 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor 31 can also be any conventional processor, etc.
[0155] The memory 33 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 33 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 31, the device can execute the above-mentioned Figure 1 The method embodiment involves various steps.
[0156] Optionally, the electronic device may further include a storage controller and an input / output unit. The memory 33, the storage controller, the processor 31, the peripheral interface, and the input / output unit are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components may be electrically connected to each other via a communication bus 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the device.
[0157] The input and output unit is used to provide users with the task creation and to create an optional time period or preset execution time for the task to enable interaction between the user and the server. The input and output unit can be, but is not limited to, a mouse and a keyboard.
[0158] Understandably, Figure 3 The structure shown is for illustration only. The electronic device may also include Figure 3 More or fewer components as shown, or with Figure 3 Different configurations shown. Figure 3 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0159] In addition, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which implements the test report generating method of the first embodiment when the computer program is executed by a processor.
[0160] The embodiment of the present application also provides a computer program product, which, when running on a computer, enables the computer to execute the method described in the method embodiment.
[0161] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based device that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0162] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0163] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0164] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application. It should be noted that similar numbers and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0165] The above is only a specific implementation of the present application, but the protection range of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical range disclosed in the present application, which should be included in the protection range of the present application. Therefore, the protection range of the present application should be based on the protection range of the claims.
[0166] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A test report generation method, characterized in that: The method comprises: Get the user's form data; Extracting key information from the table data; Generate a content document according to the key information; Obtaining an asynchronous log document in the process of generating the content document; The test report is generated according to the content document and the asynchronous log document.
2. The test report generation method according to claim 1, characterized in that: The step of generating a content document according to the key information comprises: Classify the key information according to the attributes of the key information to obtain table information, paragraph information and picture information; Selecting a preset basic template according to the table information, the paragraph information and the picture information; Adding the table information, the paragraph information and the picture information to the basic template to obtain a first document; The content document is generated according to the first document.
3. The test report generating method according to claim 2, characterized in that: The step of generating the content document according to the first document comprises: Update the table model in the first document according to the first function to obtain a new table model; updating the paragraph pattern in the first document according to the second function to obtain a new paragraph pattern; The new table mode and the new paragraph mode are adjusted according to the third function to obtain the content document.
4. The test report generation method according to claim 3, characterized in that: The step of updating the table model in the first document according to the first function to obtain a new table model includes: Get the parameters of the table information; According to the first function, the parameters of the table information are updated into the XML structure corresponding to the first document to obtain the new table model.
5. The test report generating method according to claim 3, characterized in that: The step of updating the paragraph pattern in the first document according to the second function to obtain a new paragraph pattern includes: Parameters for obtaining paragraph information; According to the second function, the parameters of the paragraph information are updated into the XML structure corresponding to the first document to obtain the new paragraph pattern.
6. The test report generating method according to claim 3, characterized in that: The step of adjusting the new table mode and the new paragraph mode according to the third function to obtain the content document includes: Determine whether there is paging in the new table mode and the new paragraph mode; If so, repeatedly display and adjust the new table mode and the new paragraph mode according to the third function to obtain the content document; If not, the content document is generated according to the new table mode and the new paragraph mode.
7. The test report generating method according to claim 1, characterized in that: The step of obtaining the asynchronous log document in the process of generating the content document includes: Add an exception catching function in the XML structure corresponding to the content document; Get multiple log information during the running process of the content document after adding the exception capture function; The asynchronous log document is generated according to the multiple log information.
8. A test report generating device, characterized in that: The device comprises: The acquisition module is used to obtain the user's table data; An extraction module, used for extracting key information from the table data; A generating module, used to generate a content document according to the key information; and also used to generate the test report according to the content document and the asynchronous log document; The data acquisition module is used to obtain the asynchronous log document in the process of generating the content document.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the test report generating method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: A computer program is stored therein, and when the computer program is executed by a processor, the test report generating method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for automatically generating data analysis report
CN106326202A
Test report automatic generation method based on general template
CN109857670A
Test report generation method and device, electronic equipment and storage medium
CN116450499A
Report generation method, device and equipment
CN117669509A