A method, system, electronic device and storage medium for automatic report generation
Through the natural language processing model and document processing interface technology, the report content is automatically processed, which solves the problem of cumbersome syntax and semantic checking in the report generation process in the existing technology, improves the quality and efficiency of the report, and achieves fast and accurate report generation. and efficient.
Patent Information
- Application Number
- CN202410804251.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-21
AI Technical Summary
Existing report generation technology lacks typo recognition and semantic understanding in the fields of artificial intelligence and machine learning, resulting in cumbersome and time-consuming syntax and semantic checks during the report generation process, reducing report quality and readability, and relying on manual participation to increase the possibility of errors. nature, limiting the speed and scale of report generation.
The natural language processing model is used to identify the language information and grammatical information in the text file, and the target report is generated by combining the document processing interface technology with the preset format template to automatically process the report content and reduce manual participation.
It improves the accuracy and writing efficiency of reports, reduces manual errors, improves the standardization and consistency of reports, and manages the reporting process quickly and accurately.
Smart Images

Figure CN118394888B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of report generation, and in particular to a method, system, electronic device and storage medium for automatic report generation. Background Art
[0002] At present, the application of artificial intelligence and machine learning in reporting systems is still insufficient, especially in terms of typo recognition and semantic understanding. This allows the grammar and semantics to be checked based on natural language processing technology during the report generation process, and to check for possible content errors, unclear expressions and other problems, which reduces the quality and readability of the report. Combining existing tools with manually written reports, there are often inconsistencies in the format and quality of titles, etc., which makes it difficult to ensure the accuracy and clarity of the generated reports. In addition, the existing report generation process often relies on manual participation for format checking and correction, and grammar and semantic verification takes a lot of time, which not only increases the possibility of manual errors, but also reduces the efficiency of report writing. The process of manual inspection and correction is cumbersome and time-consuming, and it is easy to introduce inconsistencies and errors, which also limits the speed and scale of report generation. Summary of the invention
[0003] In this embodiment, a method, system, electronic device and storage medium for automatic report generation are provided to solve the problem in the related art that the process of manually checking grammar and typos during report generation is cumbersome and time-consuming.
[0004] In a first aspect, the present invention provides a method for automatically generating a report, the method comprising:
[0005] Get project information and corresponding text files;
[0006] Extracting text data from the text file; using a natural language processing model to identify language information and grammatical information in the text file, and modifying the text data according to the identification result;
[0007] The corrected text data is combined with a preset format template through document processing interface technology to generate a target report.
[0008] In an optional embodiment, project information and a corresponding text file are obtained; wherein the project information includes basic project information, test sample information, equipment information, schedule information, risk information, and use case information;
[0009] Upload a corresponding text file according to the basic information, the test sample information, the equipment information, the schedule information, the risk information and the use case information.
[0010] In an optional embodiment, before extracting the text data of the text file, the process includes:
[0011] Preset project environment;
[0012] Collect data on the project's configuration environment, test environment, test characteristics, test equipment, test basis, test cases, and problem list, and store the collected data in the cloud server.
[0013] In an optional embodiment, before extracting the text data of the text file, the process further includes:
[0014] Upload the project information and corresponding text files to the cloud server;
[0015] Read the file stream information of the text file, and calculate it through the multiplication HASH algorithm to obtain the unique hash value of the text file;
[0016] The unique hash value is stored in the cloud server database.
[0017] In an optional embodiment, extracting text data of the text file, identifying language information and grammar information in the text file using a natural language processing model, and correcting the text data according to the identification result includes:
[0018] Extract text data from corresponding text files;
[0019] Using a natural language processing model and according to a preset vocabulary library and grammar rules, extract keywords and identify typos from the text file;
[0020] The text file is modified according to the recognition result.
[0021] In an optional embodiment, combining the modified text data with a preset format template to generate a target report through a document processing interface technology includes:
[0022] Reading the revised text file;
[0023] Using the modified text data of the text file as a variable to replace the variable replacement part in the corresponding format template;
[0024] Output the format template after replacing the text data as the target report;
[0025] Get target report.
[0026] In an optional embodiment, after obtaining the target report, the following steps are further included:
[0027] Manually review the target report and summarize and compile statistics on the review results;
[0028] If the review result fails, the corresponding data will be corrected and the report generation process will be repeated.
[0029] Compared with the prior art, the report automatic generation method of the present invention has the following beneficial effects:
[0030] This solution uses a natural language processing model to intelligently analyze and identify semantic syntax of reports, and uses a document processing interface to replace and output document content, tables, titles, pictures, etc., ensuring the uniform format of the content. It can effectively reduce the time testers spend writing reports, improve the fault tolerance rate, improve the efficiency of report writing, and manage the report process quickly, accurately, and efficiently.
[0031] In a second aspect, the present invention further provides a report automatic generation system, comprising:
[0032] Input module, used to obtain project information and corresponding text files;
[0033] A natural language processing module, used to extract text data from the text file, identify language information and grammatical information in the text file using a natural language processing model, and modify the text data according to the identification result;
[0034] The automatic generation module combines the corrected text data with a preset format template to generate a target report through document processing interface technology.
[0035] In a third aspect, the present invention further proposes an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the automatic report generation method described in the first aspect.
[0036] In a fourth aspect, the present invention further proposes a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for automatically generating a report as described in the first aspect.
[0037] Compared with the prior art, the beneficial effects of the automatic report generation system, electronic device and storage medium of the present invention are the same as those of the automatic report generation method described in the first aspect, so they will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a method for automatically generating a report in an embodiment of the present invention;
[0039] Figure 2 It is a structural block diagram of the report automatic generation system in an embodiment of the present invention;
[0040] Figure 3 A flowchart of a system for automatically generating reports according to an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a report automatic generation system according to an embodiment of the present invention;
[0042] Figure 5 1 is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0044] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0045] In an embodiment of the present invention, a method for automatically generating a report is provided. Figure 1 It is a flow chart of the method for automatically generating reports of the present invention, such as Figure 1 As shown, the generation method includes:
[0046] S100, obtaining project information and corresponding text files;
[0047] It should be noted that project information includes basic project information, test sample information, equipment information, schedule information, risk information and use case information; among which basic project information includes project name, commissioning unit, project manager, approver and other information; test sample information is for samples that need to be tested or analyzed, including sample number, name, specification model, supplier, receipt date, storage conditions, test status and other information; equipment information is the details of the equipment used for testing or production, such as equipment name, model, serial number, calibration date, accuracy level, maintenance records, etc. Schedule information includes project schedule, key milestones, meeting time, test plan, report submission date, etc. Risk information is to identify the risks that may be encountered during the project execution and their impact, including risk name, possibility, impact degree, and mitigation measures taken or recommended. Use case information refers to the detailed information of test cases in software development or system testing, including use case number, title, test steps, expected results, actual results, test environment, etc.
[0048] Upload the corresponding text file according to the basic information, test sample information, equipment information, schedule information, risk information and use case information. The corresponding text file is a text file that records the corresponding project information, such as a sample file corresponding to the test sample information. The above are all existing concepts, so they will not be repeated here.
[0049] S200, extracting text data from a text file; using a natural language processing model to identify language information and grammatical information in the text file, and modifying the text data according to the identification result;
[0050] The natural language recognition model is used to recognize the language information and grammatical information in the text file to obtain the recognition result. The text data is corrected according to the recognition result to obtain a corrected text file, thereby avoiding errors in the text file content and further improving the quality of the text.
[0051] It should be noted that before extracting the text data of the text file, the following steps are included:
[0052] Preset project environment;
[0053] Collect data on the project's configuration environment, test environment, test characteristics, test equipment, test basis, test cases, and problem list, and store the collected data in the cloud server.
[0054] In order for automated report generation to run smoothly, the project environment needs to be pre-configured before this, including the collection of test environment, test characteristics, test equipment, test basis, test cases, and problem list data, and the collected data is stored in the cloud server for easy access by project personnel.
[0055] It should be further explained that before extracting the text data of the text file, the following steps are also included:
[0056] Upload the project information and corresponding text files to the cloud server;
[0057] Read the file stream information of the text file, calculate it through the multiplication HASH algorithm, and get the unique hash value of the text file;
[0058] Store the unique hash value in the cloud server database.
[0059] Exemplarily, after the sample file corresponding to the test sample information is uploaded, the sample file is stored in the cloud server. By reading the file stream information of the sample file and calculating through multiplication HASH, a unique hash value of the file is obtained, and the result is stored in the cloud server database to ensure that the test sample information cannot be tampered with.
[0060] In this embodiment, extracting text data from a text file, using a natural language processing model to identify language information and grammatical information in the text file, and correcting the text data according to the identification result include:
[0061] Extracting text data from a corresponding text file; it should be noted that the text data refers to text information or digital information in the text file;
[0062] A natural language processing model is used to extract keywords and identify typos in a text file according to a preset vocabulary library and grammatical rules; wherein the natural language processing model is a model that has been trained and can perform recognition tasks. The natural language processing model can be used to compare text data in a text file with the preset vocabulary library and grammatical rules to obtain a recognition result. In this embodiment, there are two types of recognition results. When the text data conforms to the preset vocabulary library and grammatical rules, the recognition result is displayed as correct, indicating that the text data conforms to the corresponding specifications. When the text data does not conform to the preset vocabulary library and grammatical rules, the recognition result is displayed as incorrect, indicating that the text data does not conform to the corresponding specifications.
[0063] Modify the text file based on the recognition results.
[0064] When the recognition result is correct, there is no need to correct the text data. When the recognition result is wrong, the text data is corrected based on the preset vocabulary library and grammar rules to avoid grammatical errors, typos, etc. in the text file, thereby improving the quality of the file.
[0065] S300, combining the corrected text data with a preset format template through document processing interface technology to generate a target report.
[0066] Exemplarily, the document processing interface technology can use Apache POI to process text files, combine text data with a preset format template, and obtain a target report. It should be noted that Apache POI is mainly used to process Microsoft Office documents, including Excel, Word, PowerPoint, etc. It is divided into two core modules: poi is used to process .xls files, and poi-ooxml is used to process xlsx, docx, pptx and other files based on OpenXML; at the same time, POI provides a rich API that allows developers to create, read, modify and write files in these formats in Java programs.
[0067] Specifically, the target report is generated by combining the corrected text data with a preset format template through the file processing interface technology, including:
[0068] Read the corrected text file; the corrected text file is the above-mentioned text file after grammar correction or typos correction.
[0069] The text data of the revised text file is used as a variable to replace the variable replacement part in the corresponding format template; it should be noted that the preset format template is stored in the cloud server, and there are multiple format templates, and the content thereof varies according to the project information. Exemplarily, the format template includes a project acceptance report template, a project abnormality report template, a test report template, a test plan review form, a use case information report, etc., wherein the use case information report corresponds to the use case information, and is selected according to the report required to be issued for the project. Specifically, the modified text data is filled in the corresponding format template so that the format template has the corresponding text data. Furthermore, through the document processing interface technology, tables, pictures, titles, etc. can be automatically generated, and various test reports can be generated according to the preset format template.
[0070] Output the format template after replacing the text data as the target report;
[0071] Get target report.
[0072] Furthermore, after obtaining the target report, the following steps are also included:
[0073] Manually review the target report and summarize and compile statistics on the review results;
[0074] After the target report is generated, it will be reviewed manually. If the review is passed, the generated report can be delivered for use; if the review result is not passed, the corresponding data will be corrected and the report generation process will be repeated.
[0075] The present invention introduces a natural language processing model and document processing interface technology, thereby improving the accuracy and writing efficiency of reports, reducing manual participation, and improving the standardization and consistency of reports; greatly improving the efficiency of report generation and reducing the occurrence of errors.
[0076] like Figure 2 As shown, the embodiment of the present invention also provides a report automatic generation system, including:
[0077] An input module 101 is used to obtain project information and corresponding text files;
[0078] A natural language processing module 103, for extracting text data from a text file, identifying language information and grammatical information in the text file using a natural language processing model, and modifying the text data according to the identification result;
[0079] The automatic generation module 104 combines the corrected text data with a preset format template through document processing interface technology to generate a target report.
[0080] It should be noted that it also includes a cloud processing module 103, an audit module 105 and an output module 106. The cloud processing module 103 is used to read the file stream information of the text file, calculate through the multiplication HASH algorithm, and obtain the unique hash value of the text file; the unique hash value is stored in the database; the audit module 105 is used to manually review the target report; the output module 106 is used to output the target report after the audit is qualified. It should be further explained that the output module 106 and the input module 106 are on the device side, and the cloud processing module 102, the natural language processing module 103, the automatic generation module 104 and the audit module 105 are on the server side.
[0081] Specifically, the project information and the corresponding text file are inputted through the input module 101, the file stream information of the text file is read through the cloud processing module 103, and the unique hash value of the text file is calculated through the multiplication HASH algorithm; the unique hash value is stored in the database; the language information and grammatical information in the text file corresponding to the project information are identified through the natural language processing module 103, and it is determined whether there are errors in the language information and grammatical information in the text file, and corrections are made, and the corrected text data is combined with the preset template through the automatic generation module 104 to obtain the target report; the target report can be manually audited through the review module 105, and the module output after the audit is used for delivery through the output module 106.
[0082] Combination Figure 3 As shown, Figure 3The flowchart of the report automatic generation system is schematically shown; first, the project information is obtained, then the information is entered into the system and confirmed, the system generates the required materials (various reports), the generated materials are reviewed, the review results are obtained, and the form attachments (i.e., various reports) are output according to the review results. It should be noted that the format of the form attachments is such as Word, etc.
[0083] For a more convenient understanding of this solution, please refer to Figure 4 , Figure 4 The schematic diagram of the report automatic generation system is shown as an example. Figure 4 The operation of the automatic report generation system of the present invention is described.
[0084] like Figure 4 As shown, first, the user fills in the project information through the input module 101 of the report automatic generation system, such as the project name, the commissioning unit, the project manager, the approver, etc.; specifically, the sample information, equipment information, schedule information, risk information and use case information are entered (in this process, the corresponding file text is uploaded), and then the filled-in project information is confirmed. The above is the device-side operation, and after confirmation, it is transferred to the server side; the file stream information of the text file is read through the cloud processing module 102, and the multiplication HASH algorithm is used to calculate to obtain the unique hash value of the text file; the unique hash value is stored in the database; the natural language processing module 103 identifies the language information and grammatical information in the text file corresponding to the project information, determines whether there are errors in the language information and grammatical information in the text file, and corrects them, and reads and writes the file through the document processing interface technology. The system can automatically generate tables, pictures, titles, etc., and generate various reports according to the preset format template. Specifically, the corrected text data is combined with a preset template through the automatic generation module 104 to obtain a target report; further, the target report includes a test plan, a test plan review form, a test case, a test case review form, a case execution report, a test report, a test report review form, an abnormal situation report, a project acceptance report, and an inspection environment confirmation form. The target report can be manually reviewed through the review module 105. Specifically, the imported text file related data is displayed through a graphical interface. Since it is on the server side, data can be shared between users, allowing users to intuitively check and verify the authenticity and correctness of the data. At the same time, data operations such as adding, editing, and deleting can be performed on the interface, thereby realizing rapid online processing and review of data, realizing the review flow between multiple people, and facilitating the summary and statistics of review results. Finally, the target output after the review is passed is used for delivery through the output module 106; if it fails, the data is corrected again, and the same process is repeated. Figure 4 The report generation process that failed.
[0085] This solution uses a natural language processing model to intelligently analyze and identify semantic syntax of reports, and uses a document processing interface to replace and output document content, tables, titles, pictures, etc., ensuring the uniform format of the content. It can effectively reduce the time testers spend writing reports, improve the fault tolerance rate, improve the efficiency of report writing, and manage the report process quickly, accurately, and efficiently.
[0086] like Figure 5 As shown, an embodiment of the present invention further provides an electronic device, which includes a memory 630 and a processor 610, wherein the memory 630 stores at least one computer executable instruction, and the processor 610 is configured to run the computer executable instruction, and when the computer executable instruction is run by the processor 610, the above method embodiment is implemented.
[0087] In this embodiment, the electronic device includes a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the computer executable instructions in the memory 630 to execute the following method:
[0088] Get project information and corresponding text files;
[0089] Extract text data from text files; use natural language processing models to identify language information and grammatical information in text files, and modify text data based on the identification results;
[0090] The corrected text data is combined with the preset format template through document processing interface technology to generate the target report.
[0091] The computer executable instructions in the above-mentioned memory 630 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention 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, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0092] An embodiment of the present invention further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided in each of the above embodiments is implemented, for example, including:
[0093] Get project information and corresponding text files;
[0094] Extract text data from text files; use natural language processing models to identify language information and grammatical information in text files, and modify text data based on the identification results;
[0095] The corrected text data is combined with the preset format template through document processing interface technology to generate the target report.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatically generating a report, characterized in that: The generation method comprises: Get project information and corresponding text files; Extracting text data from the text file; using a natural language processing model to identify language information and grammatical information in the text file, and modifying the text data according to the identification result; Combining the corrected text data with a preset format template through Apache document processing interface technology to generate a target report; Combining the corrected text data with a preset format template through the Apache document processing interface technology to generate a target report includes: Reading the revised text file; Using the modified text data of the text file as a variable to replace the variable replacement part in the corresponding format template; Output the format template after replacing the text data as the target report; Get target report; After getting the target report, it also includes: Manually review the target report and summarize and compile statistics on the review results; If the review result fails, the corresponding data will be corrected and the report generation process will be repeated.
2. The method for automatically generating a report according to claim 1, characterized in that: Obtain project information and corresponding text files; wherein the project information includes basic project information, test sample information, equipment information, schedule information, risk information and use case information; Upload a corresponding text file according to the basic information, the test sample information, the equipment information, the schedule information, the risk information and the use case information.
3. The method for automatically generating a report according to claim 1, characterized in that: Before extracting the text data of the text file, the method includes: Preset project environment; Collect data on the project's configuration environment, test environment, test characteristics, test equipment, test basis, test cases, and problem list, and store the collected data in the cloud server.
4. The method for automatically generating a report according to claim 1, characterized in that: Before extracting the text data of the text file, the method further includes: Upload the project information and corresponding text files to the cloud server; Read the file stream information of the text file, and calculate it through the multiplication HASH algorithm to obtain the unique hash value of the text file; The unique hash value is stored in the cloud server database.
5. The method for automatically generating a report according to claim 4, characterized in that: Extracting text data from the text file, using a natural language processing model to identify language information and grammatical information in the text file, and correcting the text data according to the identification result includes: Extract text data from corresponding text files; Using a natural language processing model and according to a preset vocabulary library and grammar rules, extract keywords and identify typos from the text file; The text file is modified according to the recognition result.
6. A report automatic generation system, characterized in that: include: Input module, used to obtain project information and corresponding text files; A natural language processing module, used to extract text data from the text file, identify language information and grammatical information in the text file using a natural language processing model, and modify the text data according to the identification result; An automatic generation module combines the corrected text data with a preset format template to generate a target report through Apache document processing interface technology; Combining the corrected text data with a preset format template through the Apache document processing interface technology to generate a target report includes: Read the modified text file; Using the modified text data of the text file as a variable to replace the variable replacement part in the corresponding format template; Output the format template after replacing the text data as the target report; Get target report; After getting the target report, it also includes: Manually review the target report and summarize and compile statistics on the review results; If the review result fails, the corresponding data will be corrected and the report generation process will be repeated.
7. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the method for automatically generating a report according to any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for automatically generating a report according to any one of claims 1 to 5 is implemented.
