Report generation method and device, electronic equipment and storage medium
By combining natural language processing technology and large language models, we can acquire and label network data, query similar documents to generate high-quality reports, and solve the problems of lengthy and unfocused reports in existing technologies, thus achieving high-quality and highly available report generation.
Patent Information
- Application Number
- CN202511481369.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-02-06
AI Technical Summary
Existing large language models tend to focus on non-critical information when generating network reports, resulting in lengthy reports that lack focus and are difficult to generate high-quality, highly usable reports.
Natural language processing technology is used to identify sub-tasks to be performed, acquire and label data, query similar documents and generate target prompts, select the report template with the highest similarity to fill in, and generate a high-quality report.
This avoids the large language model focusing on non-critical information during the report generation process, resulting in high-quality, highly usable reports.
Smart Images

Figure CN121480469A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a report generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] Existing network report generation technologies are mainly used to help network operators keep abreast of the network's health status, performance, and potential problems through the generated network reports.
[0003] Traditional methods rely on human experience, generating reports based on fixed rules and simple judgment conditions. This results in reports with limited content and a lack of in-depth analysis, making it difficult to meet the operational needs of complex network environments. While artificial intelligence (AI) technologies have enabled large language models to automatically generate report text based on acquired network status data such as traffic, packet loss, and latency, existing large language models tend to focus on non-critical information when processing large amounts of network data. This leads to lengthy reports that lack focus and fail to produce high-quality, highly available reports. Summary of the Invention
[0004] This invention provides a report generation method, apparatus, electronic device, and storage medium to solve the problems of lengthy and unfocused reports generated by existing large language models.
[0005] In a first aspect, an embodiment of this application provides a report generation method, the method comprising: In response to the request information, at least one subtask to be executed in the request information is determined using natural language processing technology; For each subtask to be executed, the data to be processed is obtained through the API interface corresponding to the subtask; The data to be processed and the preset prompt words corresponding to the API interface are input into the large language model to obtain summary information; and the target data in the summary information is labeled to obtain target information. The system queries similar documents to the target information in a preset document set and then concatenates the similar documents and the target information to generate target prompt words. The target prompt words are input into the large language model to obtain preprocessing results; Based on the similarity value between the first relevant content of the preprocessing conclusion and the second relevant content of each preset report template in the preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusion to obtain a report outline; The report outline and the target information are input into the large language model to obtain the report.
[0006] In some optional implementations, after obtaining the data to be processed through the API interface corresponding to the subtask to be executed, the method further includes: Remove duplicate data from the data to be processed, and fill in missing values in the data to be processed using interpolation. Replace the target character in the data to be processed based on a preset regular expression; The data to be processed is filtered based on preset scene information.
[0007] In some optional implementations, the step of annotating the target data in the summary information to obtain target information includes: The target structured data in the summary information is determined based on the first preset keyword used to characterize network performance. The target structured data that is greater than the preset judgment threshold is labeled based on the preset information to obtain the first labeling information. The target unstructured data in the summary information is determined based on the second preset keyword used to characterize the degree of network anomaly, and the target unstructured data is input into a lightweight AI model to obtain the second annotation information; The first annotation information and the second annotation information are used as target information.
[0008] In some optional implementations, the step of querying target similar documents for the target information in a preset document set includes: The first similar document of the target information is queried in a preset document set based on the approximate nearest neighbor search method, and the second similar document of the target information is queried in the preset document set based on the inverted index method; The first and second similar documents are fused using the inverse rank fusion algorithm to obtain the target similar document.
[0009] In some optional implementations, the step of querying a first similar document for the target information in a preset document set based on the approximate nearest neighbor search method includes: The target information is input into the large language model to obtain the query statement for the target information; The query statement is converted into a first query vector, and the first similar document is determined from the preset document set based on the first query vector and the approximate nearest neighbor search method.
[0010] In some optional implementations, the step of querying a second similar document for the target information in a preset document set based on the inverted index method includes: The target word groups used to characterize network performance in the target information are determined based on natural language processing technology. The target phrase is converted into a second query vector, and the second similar document is determined from the preset document set based on the second query vector and the inverted index method.
[0011] In some optional implementations, selecting a target template from the preset report template set based on the similarity value between the first relevant content based on the preprocessing conclusion and the second relevant content of each preset report template in the preset report template set includes: Determine the similarity value between the first vector and each of the second vectors; wherein the first vector is obtained by conversion through the first related content, and the second vector is obtained by conversion through the second related content; Use the preset report template corresponding to the maximum similarity value as the target template.
[0012] Secondly, embodiments of this application provide a report generation apparatus, the apparatus comprising: The data acquisition module is used to respond to request information, determine at least one subtask to be executed based on the request information using natural language processing technology, and acquire data to be processed for each subtask through the API interface corresponding to the subtask. The data annotation module is used to input the data to be processed and the preset prompt words corresponding to the API interface into the large language model to obtain summary information; and to annotate the target data in the summary information to obtain target information. The prompt word generation module is used to query similar documents of the target information in a preset document set, and concatenate the similar documents of the target information with the target information to generate target prompt words; The report outline generation module is used to input the target prompt words into the large language model to obtain preprocessing conclusions; based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain a report outline; The report generation module is used to input the report outline and the target information into the large language model to obtain the report.
[0013] Thirdly, embodiments of this application provide an electronic device, including: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute any one of the above-described report generation methods according to the obtained program instructions.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any one of the above-described methods for generating reports with prompt statements.
[0015] The beneficial effects of this invention are as follows: This application provides a report generation method, apparatus, electronic device, and storage medium. Responding to a request, the method determines at least one subtask to be executed using natural language processing (NLP) technology. For each subtask, it obtains data to be processed through an API interface corresponding to that subtask. The data to be processed and preset prompts corresponding to the API interface are input into a large language model to obtain summary information. Target data in the summary information is labeled to obtain target information. Similar documents to the target information are queried from a preset document set, and the similar documents and the target information are concatenated to generate target prompts. The target prompts are input into the large language model to obtain preprocessing conclusions. Based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in a preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain a report outline. The report outline and target information are input into the large language model to obtain a report. This avoids the large language model focusing on non-critical information during report generation, thereby generating a high-quality and highly usable report. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram illustrating an application scenario of the report generation method provided in the embodiments of this application; Figure 2 A flowchart illustrating a report generation method provided in an embodiment of this application; Figure 3 A flowchart illustrating a method for determining target information provided in an embodiment of this application; Figure 4 A flowchart illustrating a query for similar documents to a target document is provided in this embodiment of the application. Figure 5 A schematic diagram illustrating another process for querying similar documents to a target, provided as an embodiment of this application; Figure 6A schematic diagram illustrating another process for querying similar documents to a target, provided as an embodiment of this application; Figure 7 A flowchart illustrating a method for determining a target template provided in an embodiment of this application; Figure 8 This is a schematic flowchart of a report generation device provided in an embodiment of this application; Figure 9 This application also provides a schematic diagram of the structure of an electronic device. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0019] It should be noted that the terms "first" and "second" used in the embodiments of this application are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance or order.
[0020] It should be noted that the application scenarios described in the following embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0021] First, let me explain some of the technical terms used in this application.
[0022] (1) Large language model: refers to a machine learning model trained with a large amount of text data, usually based on deep learning methods, especially neural network models.
[0023] (2) API (Application Programming Interface): It is a standardized way for different software systems to interact and communicate. Through the specified methods and data formats, the API allows software systems to exchange information and call functions between different platforms and environments.
[0024] (3) Lightweight AI models: These are machine learning models with relatively simple structures, low computational overhead, and suitable for resource-constrained environments. These models can usually process data with less computational resources and are suitable for tasks requiring fast response and efficient inference.
[0025] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of this application are applicable. It should be noted that the application scenarios described below are only for illustrating the embodiments of this application and are not intended to limit the scope. In specific implementation, the technical solutions provided by the embodiments of this application can be flexibly applied according to actual needs.
[0026] Existing network report generation technologies primarily aim to help network operators promptly understand network health, performance, and potential problems through generated network reports. Traditional methods rely on human experience, generating reports based on fixed rules and simple judgment conditions. This results in reports with limited content and a lack of in-depth analysis, failing to meet the operational needs of complex network environments. With the development of artificial intelligence technology, large language models can automatically generate report text based on acquired network status data, such as traffic, packet loss, and latency. However, existing large language models tend to focus on non-critical information when processing large amounts of network data, leading to lengthy and unfocused reports that are difficult to generate high-quality, highly available reports.
[0027] To address the aforementioned issues, this application provides a report generation method, apparatus, electronic device, and storage medium. Responding to a request, the method uses natural language processing (NLP) to determine at least one subtask to be executed. For each subtask, it acquires data to be processed via an API interface corresponding to that subtask. The data to be processed and preset prompts corresponding to the API interface are input into a large language model to obtain summary information. Target data in the summary information is annotated to obtain target information. Similar documents to the target information are queried from a preset document set, and the similar documents and the target information are concatenated to generate target prompts. The target prompts are input into the large language model to obtain preprocessing conclusions. Based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in a preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain a report outline. The report outline and target information are input into the large language model to obtain a report. This avoids the large language model focusing on non-critical information during report generation, thereby generating a high-quality and highly usable report.
[0028] like Figure 1 The diagram illustrates an application scenario of the report generation method provided in this embodiment. The application scenario diagram includes a terminal device 110 and a server 120.
[0029] It should be noted that the report generation method in this application embodiment can be executed by an electronic device, which can be a server 120 or a terminal device 110. That is, the method can be executed by the server 120 or the terminal device 110 alone, or by the server 120 and the terminal device 110 together. For example, when executed jointly by server 120 and terminal device 110, terminal device 110 obtains request information, which can be user input, such as: "Please analyze the network situation of community A last week." Terminal device 110 sends the request information to server 120. Server 120 uses natural language processing technology to determine at least one sub-task to be executed for the request information. For each sub-task to be executed, it obtains the data to be processed through the API interface corresponding to the sub-task. It extracts key information and labels the data to be processed to obtain target information, then queries similar documents based on the target information to determine target similar documents, and concatenates the target similar documents and target information to obtain target prompt words. It inputs the target prompt words into the large language model to obtain preprocessing conclusions. Based on the preprocessing conclusions, it selects a target template from a preset report template set and fills in the target template based on the preprocessing conclusions to obtain a report outline. It inputs the report outline and target information into the large language model to obtain the report, thereby avoiding the large language model from focusing on non-critical information during the report generation process, and thus generating a high-quality and highly available report.
[0030] In one alternative implementation, the terminal device 110 and the server 120 can communicate via a communication network.
[0031] In one alternative implementation, the communication network is a wired network or a wireless network.
[0032] It should be noted that, Figure 1 The examples shown are merely illustrative; in reality, the number of terminal devices and servers is unlimited and is not specifically limited in the embodiments of this application.
[0033] like Figure 2 The diagram shown is a flowchart illustrating a report generation method provided in an embodiment of this application. The specific steps are as follows: S201. Responding to the request information, determine at least one subtask to be executed from the request information using natural language processing technology; In a specific embodiment, the request information can be unstructured data sent by the user. For example, the following example is "Please analyze the network situation of cell A last week".
[0034] First, entity recognition can be performed on the request information. For example, time and location can be identified, that is, "A Community" can be identified as the location entity and "last week" as the time entity. Then, based on natural language processing technology, the high-level intent of the request information can be determined as "the user wants to know the network situation of A Community last week".
[0035] Secondly, based on the text classification model, the request information with the high-level intent of "the user wants to know the network situation of cell A last week" is classified as "query network status". It should be noted that the text classification model is pre-trained and the classification information is pre-set, which can include multiple categories such as "query network status" and "query network coverage".
[0036] Finally, based on natural language processing technology, the high-level intent is broken down into multiple executable subtasks. For example, these could be: 1. Obtaining the network coverage of cell A; 2. Obtaining the network performance indicators of cell A; 3. Analyzing the network usage of cell A last week.
[0037] S202. For each subtask to be executed, obtain the data to be processed through the API interface corresponding to the subtask to be executed. After obtaining the data to be processed, it is also necessary to clean and preprocess the data to avoid noise interference caused by directly inputting the data into the large model, which would affect the quality of the generated report.
[0038] In one possible embodiment, the acquired data to be processed is converted into a preset format; For example, the default format can be JSON format. Data from the API interface is obtained through HTTP or WebSocket requests, and the obtained XML format data is parsed into JSON format.
[0039] Remove duplicate data from the data to be processed, and fill in missing values based on interpolation. For example, query the data to be processed for duplicate data and missing values, delete the duplicate data, and fill the missing data using interpolation methods, such as linear interpolation or polynomial interpolation.
[0040] Replace target characters in the data to be processed based on preset regular expressions; For example, the target character can be a user's name or address, which can be replaced using a preset regular expression.
[0041] The data to be processed is filtered based on preset scenario information.
[0042] For example, if the scene information is a specific time period, then the data to be processed within that specific time period is retained, and the data to be processed outside that specific time period is deleted.
[0043] It's understandable that the mapping between the subtasks to be executed and the API interfaces is pre-defined. For example, the API interface can retrieve data from wireless network management systems, performance management systems, fault management systems, etc. Obtaining data through the API interface avoids the performance burden on the system caused by performing large-scale queries directly on the database.
[0044] S203. Input the data to be processed and the preset prompt words corresponding to the API interface into the large language model to obtain summary information; and annotate the target data in the summary information to obtain target information; In a specific embodiment, the preset prompt words are pre-set according to the scope dimension and the business dimension. The scope dimension includes cell, scene, region, address, user, etc., and the business dimension includes network problem, performance query, usage perception, etc.
[0045] For example, taking the cell as the scope dimension and network issues as the service dimension, the preset prompt words could be: Please extract the overall situation of network issues at the cell level from the returned API data, including statistical summary information such as the mean, maximum, minimum, standard deviation, and count of indicators. This type of API focuses on indicators such as the number of high-load cases, the number of cases with weak coverage, and the average utilization rate of downlink PRBs. Output the summary information in JSON format.
[0046] In one possible implementation, such as Figure 3 As shown, the target information is obtained through the following steps: S301. Based on the first preset keywords used to characterize network performance, determine the target structured data in the summary information, and annotate the target structured data that is greater than the preset judgment threshold based on the preset information to obtain the first annotation information; In a specific embodiment, the first preset keyword can be a phrase that characterizes network performance, such as average latency or packet loss rate, and the preset information used for annotation can be "high latency" or "high packet loss".
[0047] By querying the structured data in the abstract information using a pre-defined first keyword, the retrieved structured data is used as the target structured data and compared with a preset judgment threshold to annotate the target structured data and obtain the first annotation information.
[0048] Specifically, the preset threshold for average latency can be 100ms. If the retrieved target structured data representing average latency is greater than 100ms, the target structured data will be marked as "high latency". The preset threshold for packet loss rate can be 1%. If the retrieved target structured data representing packet loss rate is greater than 1%, the target structured data will be marked as "high packet loss".
[0049] S302. Based on the second preset keywords used to characterize the degree of network anomaly, determine the target unstructured data in the summary information, and input the target unstructured data into the lightweight AI model to obtain the second annotation information; Lightweight AI models are used to annotate unstructured data, such as text and images. For example, based on text content, lightweight AI models can add sentiment labels, such as positive or negative, to text. In images, lightweight AI models can identify and label specific objects, such as face recognition and vehicle recognition.
[0050] In a specific embodiment, taking the lightweight AI model as an example, the lightweight BERT classification model is used for sentiment analysis. The second preset keyword can be a phrase such as "lag", "disconnection", "slow" to characterize the degree of network anomaly, and the second annotation information used for annotation can be sentiment judgment information such as "negative" and "positive".
[0051] By querying unstructured data in the summary information using pre-defined second keywords, the queried unstructured data is used as target structured data. For example, after querying multiple target structured data such as "lag", "disconnection", and "slow", a "negative" second labeling information can be obtained through a lightweight AI model.
[0052] S303. Use the first annotation information and the second annotation information as target information.
[0053] This application combines a large language model with a lightweight AI model. The large model is used to extract overall information, and then the lightweight AI model is used to extract key information, identify and structure the core business of the data to be processed, thereby obtaining the target information. This avoids information overload during the subsequent report generation process of the large language model, and thus makes the generated report high-quality and highly available.
[0054] S204. Query similar documents of the target information in the preset document set, and concatenate the similar documents and the target information to generate target prompt words; In one possible implementation, such as Figure 4 As shown, the steps to find similar documents to the target are as follows: S401. Query the first similar document of the target information in the preset document set based on the approximate nearest neighbor search method, and query the second similar document of the target information in the preset document set based on the inverted index method; In a specific embodiment, such as Figure 5 As shown, another method for determining target similar documents provided in this application embodiment includes the following steps: S501. Input the target information into the large language model to obtain the query statement for the target information; For example, a query statement is constructed based on the first and second annotation information of the target information. For instance, if the target information is "high latency cell A", then "high latency cell A" is input into the large language model, and the resulting query statement is "analysis of high latency problem in cell A".
[0055] S502. Convert the query statement into a first query vector, and determine the first similar document from the preset document set based on the first query vector and the approximate nearest neighbor search method.
[0056] For example, the query statement can be converted into a 768-dimensional first query vector using the BERT model. The similarity value between the first query vector and the content of each preset document in the preset document set can be compared using the Approximate Nearest Neighbor (ANN) search method, thereby filtering out the first similar document from the preset document set based on the similarity value.
[0057] Specifically, it can be done by comparing the similarity values of the content of each preset document and taking the preset document corresponding to the N largest similarity values as the first similar document, or by setting a preset value and taking the preset document with a similarity value greater than the preset value as the first similar document.
[0058] In a specific embodiment, such as Figure 6 The image shows another method for determining target similar documents provided in an embodiment of this application. S601. Based on natural language processing technology, determine the target word groups in the target information used to characterize network performance; For example, the target phrases used to characterize network performance in the target information determined based on natural language processing technology can be preset phrases such as "latency" and "high".
[0059] S602. Convert the target phrase into a second query vector, and determine the second similar document from the preset document set based on the second query vector and the inverted index method.
[0060] For example, the target phrase can be converted into a 768-dimensional second query vector using the BERT model. The similarity value between the second query vector and the content of each preset document in the preset document set can be compared using the inverted index method, thereby filtering out the second similar documents from the preset document set based on the similarity value.
[0061] Specifically, it can be done by comparing the similarity values of the content of each preset document and taking the preset document corresponding to the N largest similarity values as the second similar document, or by setting a preset value and taking the preset document with a similarity value greater than the preset value as the second similar document.
[0062] S402. The first and second similar documents are fused based on the inverse rank fusion algorithm to obtain the target similar document.
[0063] This application obtains the first and second similar documents by using an approximate nearest neighbor search method and an inverted index method, respectively. Then, it merges the first and second similar documents based on the inverse rank fusion algorithm to obtain the target similar document, thereby increasing the comprehensiveness of similar document queries and making the target prompts generated based on similar documents more reliable.
[0064] In this embodiment of the application, the target prompt words generated by concatenating similar target documents and target information can explicitly include role settings, such as "You are a wireless network optimization expert", task instructions, such as "Please analyze the possible root causes of the current problem by combining similar target documents", and output format, such as "Output in JSON format, including the fields of 'root cause of the problem' and 'optimization suggestions'".
[0065] S205. Input the target prompt words into the large language model to obtain the preprocessing results; S206. Based on the similarity value between the first relevant content of the preprocessing conclusion and the second relevant content of each preset report template in the preset report template set, select the target template from the preset report template set, and fill in the target template based on the preprocessing conclusion to obtain the report outline; In this application, the set of preset report templates includes multiple preset report templates, each corresponding to a specific fault type, such as "high latency," "high packet loss," and "concentrated user complaints." The large language model extracts keywords, such as "PRB congestion" and "neighbor cell interference," from the "root cause of the problem" in the target prompt words, thereby obtaining preprocessing conclusions.
[0066] In one possible implementation, such as Figure 7 The image shows a method for determining a target template provided in an embodiment of this application. The steps are as follows: S701. Determine the similarity value between the first vector and each of the second vectors; wherein the first vector is obtained by conversion through the first related content, and the second vector is obtained by conversion through the second related content; S702. Use the preset report template corresponding to the maximum similarity value as the target template.
[0067] It should be noted that the first relevant content can be keywords determined by natural language processing technology in the preprocessing conclusions, and the second relevant content can be keywords pre-set based on the content of the preset report template.
[0068] S207. Input the report outline and target information into the large language model to obtain the report.
[0069] After obtaining the report, charts can be generated based on the report, and the charts and report can be integrated into an HTML report. The HTML report can then be rendered into a PDF file and sent to the operations team, and recorded in the log. This automates the entire process from data collection to report generation, reduces manual intervention, and improves operations efficiency.
[0070] This application provides a report generation method that uses natural language processing (NLP) technology to determine at least one subtask to be executed for a request. For each subtask, data to be processed is obtained through an API interface corresponding to the subtask. The data to be processed and preset prompt words corresponding to the API interface are input into a large language model to obtain summary information. The target data in the summary information is labeled to obtain target information. Target similar documents of the target information are queried in a preset document set, and the target similar documents and target information are concatenated to generate target prompt words. The target prompt words are input into the large language model to obtain preprocessing conclusions. Based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain a report outline. The report outline and target information are input into the large language model to obtain a report. This method avoids the large language model focusing on non-critical information during the report generation process, thereby generating a high-quality and highly usable report.
[0071] Based on the same inventive concept, this application also provides a report generation apparatus, which is similar in principle to the above-described report generation method, and the repeated parts will not be described again. Figure 8 As shown, it includes: The data acquisition module 801 is used to respond to request information, determine at least one subtask to be executed for the request information through natural language processing technology, and acquire data to be processed through the API interface corresponding to each subtask to be executed. The data annotation module 802 is used to input the data to be processed and the preset prompt words corresponding to the API interface into the large language model to obtain summary information; and to annotate the target data in the summary information to obtain target information. The prompt word generation module 803 is used to query similar documents of target information in a preset document set, and concatenate the similar documents of target information and target information to generate target prompt words; The report outline generation module 804 is used to input target prompt words into the large language model to obtain preprocessing conclusions; based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, the target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain the report outline; The report generation module 805 is used to input the report outline and target information into the large language model to obtain the report.
[0072] This application provides a report generation method and apparatus, comprising: responding to request information and determining at least one subtask to be executed for the request information using natural language processing technology; for each subtask to be executed, obtaining data to be processed through an API interface corresponding to the subtask; inputting the data to be processed and preset prompt words corresponding to the API interface into a large language model to obtain summary information; annotating target data in the summary information to obtain target information; querying target similar documents of the target information in a preset document set, and concatenating the target similar documents and the target information to generate target prompt words; inputting the target prompt words into the large language model to obtain preprocessing conclusions; selecting a target template from the preset report template set based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, and filling in the target template based on the preprocessing conclusions to obtain a report outline; and inputting the report outline and target information into the large language model to obtain a report, thereby avoiding the large language model from focusing on non-critical information during the report generation process, and thus generating a high-quality and highly usable report.
[0073] In some optional implementations, a preprocessing module 806 is also included, for: Remove duplicate data from the data to be processed, and fill in missing values based on interpolation. Replace target characters in the data to be processed based on preset regular expressions; The data to be processed is filtered based on preset scenario information.
[0074] In some optional implementations, the data annotation module 802 is specifically used for: The target structured data in the summary information is determined based on the first preset keywords used to characterize network performance. The target structured data that exceeds the preset judgment threshold is labeled based on the preset information to obtain the first labeling information. The target unstructured data in the summary information is determined based on the second preset keywords used to characterize the degree of network anomaly, and the target unstructured data is input into a lightweight AI model to obtain the second annotation information; Use the first and second annotation information as target information.
[0075] In some optional implementations, the prompt word generation module 803 is specifically used for: The first similar document for querying target information in a preset document set based on the approximate nearest neighbor search method, and the second similar document for querying target information in a preset document set based on the inverted index method; The first and second similar documents are merged based on the inverse rank fusion algorithm to obtain the target similar document.
[0076] In some optional implementations, the prompt word generation module 803 is specifically used for: The target information is input into the large language model to obtain the query statement for the target information; The query statement is converted into a first query vector, and the first similar document is determined from the preset document set based on the first query vector and the approximate nearest neighbor search method.
[0077] In some optional implementations, the prompt word generation module 803 is specifically used for: Identify target word groups in target information that characterize network performance based on natural language processing techniques; The target phrase is converted into a second query vector, and the second similar document is determined from the preset document set based on the second query vector and the inverted index method.
[0078] In some optional implementations, the report outline generation module 804 is specifically used for: Determine the similarity value between the first vector and each of the second vectors; wherein the first vector is obtained by conversion through the first relevant content, and the second vector is obtained by conversion through the second relevant content; Use the preset report template corresponding to the maximum similarity value as the target template.
[0079] Based on the same inventive concept, this application also provides an electronic device, which is similar in principle to the above-mentioned method for generating prompt statements, and the repeated parts will not be described again.
[0080] In one embodiment, the electronic device may be Figure 1The terminal device 110 is shown. In this embodiment, the electronic device can be structured as follows: Figure 9 As shown, it includes a memory 901, a communication module 903, and one or more processors 902.
[0081] The memory 901 is used to store program instructions executed by the processor 902. The memory 901 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.
[0082] Memory 901 may be volatile memory, such as random-access memory (RAM); memory 901 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 901 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 901 may be a combination of the above-mentioned memories.
[0083] Processor 902 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 902 is used to implement the above-described report generation method when it calls program instructions stored in memory 901.
[0084] The communication module 903 is used to communicate with terminal devices and other servers.
[0085] This application embodiment does not limit the specific connection medium between the memory 901, communication module 903, and processor 902 described above. This application embodiment... Figure 9 The memory 901 and the processor 902 are connected via a bus 904, which is in... Figure 9 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The 904 bus can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 9 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.
[0086] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program. When the computer program code is run on a computer, it causes the computer to execute any of the report generation methods discussed above. Since the principle by which the computer-readable storage medium solves the problem is similar to that of the report generation method, the implementation of the computer-readable storage medium can be referred to the implementation of the method, and repeated details will not be elaborated further.
[0087] This application provides a report generation method, apparatus, electronic device, and storage medium, comprising: responding to request information and determining at least one subtask to be executed for the request information using natural language processing technology; for each subtask to be executed, obtaining data to be processed through an API interface corresponding to the subtask to be executed; inputting the data to be processed and preset prompt words corresponding to the API interface into a large language model to obtain summary information; and annotating the target data in the summary information to obtain target information; querying target similar documents of the target information in a preset document set, and concatenating the target similar documents and the target information to generate target prompt words; inputting the target prompt words into the large language model to obtain preprocessing conclusions; selecting a target template from the preset report template set based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, and filling in the target template based on the preprocessing conclusions to obtain a report outline; and inputting the report outline and target information into the large language model to obtain a report, thereby avoiding the large language model from focusing on non-critical information during the report generation process, and thus generating a high-quality and highly usable report.
[0088] The present application has been described above with reference to block diagrams and / or flowcharts illustrating methods, apparatus (systems), and / or computer program products according to embodiments of the present application. It should be understood that a block of a block diagram and / or flowchart, as well as combinations of blocks of block diagrams and / or flowcharts, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, and / or other programmable data processing means to produce a machine such that the instructions, executable via the computer processor and / or other programmable data processing means, create methods for implementing the functions / actions specified in the blocks of the block diagrams and / or flowcharts.
[0089] Accordingly, this application can also be implemented using hardware and / or software (including firmware, resident software, microcode, etc.). Furthermore, this application can take the form of a computer program product on a computer-usable or computer-readable storage medium, having computer-usable or computer-readable program code implemented in the medium for use by or in conjunction with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium can be any medium that can contain, store, communicate, transmit, or deliver a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0090] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A report generation method, characterized in that, The method includes: In response to the request information, at least one subtask to be executed in the request information is determined using natural language processing technology; For each subtask to be executed, the data to be processed is obtained through the API interface corresponding to the subtask; The data to be processed and the preset prompt words corresponding to the API interface are input into the large language model to obtain summary information; and the target data in the summary information is labeled to obtain target information. The system queries similar documents to the target information in a preset document set and then concatenates the similar documents and the target information to generate target prompt words. The target prompt words are input into the large language model to obtain preprocessing results; Based on the similarity value between the first relevant content of the preprocessing conclusion and the second relevant content of each preset report template in the preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusion to obtain a report outline; The report outline and the target information are input into the large language model to obtain the report.
2. The method as described in claim 1, characterized in that, After obtaining the data to be processed through the API interface corresponding to the subtask to be executed, the process further includes: Remove duplicate data from the data to be processed, and fill in missing values in the data to be processed using interpolation. Replace the target character in the data to be processed based on a preset regular expression; The data to be processed is filtered based on preset scene information.
3. The method as described in claim 1, characterized in that, The step of annotating the target data in the summary information to obtain target information includes: The target structured data in the summary information is determined based on the first preset keyword used to characterize network performance. The target structured data that is greater than the preset judgment threshold is labeled based on the preset information to obtain the first labeling information. The target unstructured data in the summary information is determined based on the second preset keyword used to characterize the degree of network anomaly, and the target unstructured data is input into a lightweight AI model to obtain the second annotation information; The first annotation information and the second annotation information are used as target information.
4. The method as described in claim 1, characterized in that, The step of querying similar documents for the target information in a preset document set includes: The first similar document of the target information is queried in a preset document set based on the approximate nearest neighbor search method, and the second similar document of the target information is queried in the preset document set based on the inverted index method; The first and second similar documents are fused using the inverse rank fusion algorithm to obtain the target similar document.
5. The method as described in claim 4, characterized in that, The method of querying the first similar document of the target information in a preset document set based on the approximate nearest neighbor search method includes: The target information is input into the large language model to obtain the query statement for the target information; The query statement is converted into a first query vector, and the first similar document is determined from the preset document set based on the first query vector and the approximate nearest neighbor search method.
6. The method as described in claim 4, characterized in that, The method of querying the second similar document of the target information in a preset document set based on the inverted index includes: The target word groups used to characterize network performance in the target information are determined based on natural language processing technology. The target phrase is converted into a second query vector, and the second similar document is determined from the preset document set based on the second query vector and the inverted index method.
7. The method as described in claim 1, characterized in that, The similarity value between the first relevant content based on the preprocessing conclusion and the second relevant content of each preset report template in the preset report template set, and the selection of a target template from the preset report template set, includes: Determine the similarity value between the first vector and each of the second vectors; wherein the first vector is obtained by conversion through the first related content, and the second vector is obtained by conversion through the second related content; Use the preset report template corresponding to the maximum similarity value as the target template.
8. A report generation device, characterized in that, The device includes: The data acquisition module is used to respond to request information, determine at least one subtask to be executed based on the request information using natural language processing technology, and acquire data to be processed for each subtask through the API interface corresponding to the subtask. The data annotation module is used to input the data to be processed and the preset prompt words corresponding to the API interface into the large language model to obtain summary information; and to annotate the target data in the summary information to obtain target information. The prompt word generation module is used to query similar documents of the target information in a preset document set, and concatenate the similar documents of the target information with the target information to generate target prompt words; The report outline generation module is used to input the target prompt words into the large language model to obtain preprocessing conclusions; based on the similarity value between the first relevant content of the preprocessing conclusions and the second relevant content of each preset report template in the preset report template set, a target template is selected from the preset report template set, and the target template is filled in based on the preprocessing conclusions to obtain a report outline; The report generation module is used to input the report outline and the target information into the large language model to obtain the report.
9. An electronic device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program therein, characterized in that: When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.