Investigation report generation method, electronic device, storage medium and program product
By using pre-defined task planning templates and multi-database searches, this method generates efficient, accurate, and secure HTML webpage-formatted survey reports, solving the problems of high cost, long processing time, and inaccurate content in existing technologies, and achieving rapid response and standardized survey report generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies are costly and time-consuming in generating survey reports, failing to meet users' needs for rapid response. Furthermore, the generated reports are not accurate enough and suffer from stability and format compatibility issues.
The task of generating the investigation report is broken down into multiple sub-tasks using a preset task planning template. Concurrent searches are performed using a local database and multiple network databases. The report is generated in HTML web page format using modular decomposition and parallel rendering. A security mechanism for sensitive information filtering and dynamic key authorization is introduced.
It reduces generation costs and time, improves the accuracy and stability of reports, ensures the consistency and security of report formats, and meets users' needs for rapid response.
Smart Images

Figure CN121743580A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, in particular to a survey report generation method, an electronic device, a storage medium and a program product. BACKGROUND
[0002] A survey report refers to a detailed report generated by investigating and studying an object, a problem or an event. The survey report is not only a carrier of information, but also a bridge connecting problems and solutions, which can help users better understand the reality and thus provide a reference for decision-making.
[0003] With the development of artificial intelligence technology, a survey report can be generated with the help of a large language model. For example, based on the reasoning and action mechanism of the ReAct (Reasoning + Acting) architecture, after receiving a survey report generation task, the large language model is called to decompose the survey report generation task into multiple subtasks (thinking), and then corresponding tools are called to execute the multiple subtasks (action), and the large language model is used to summarize the execution results to obtain the first round of survey report content (feedback). The large language model is continuously called to perform multiple rounds of “thinking-action-feedback” processes until the task is completed, and finally a Markdown format text file with relatively accurate content can be obtained. Then the Markdown format text file is processed to obtain a survey report in the form of an HTML (Hyper Text Markup Language) web page.
[0004] However, under the ReAct framework, each execution of a round of “thinking-action-feedback” process requires calling the large language model twice, and calling the large language model consumes tokens and the reasoning time of the large language model is long. The more times the large language model is called, the more tokens are consumed, and the longer the reasoning time is, resulting in high generation cost of the survey report, long generation time of the survey report, and inability to meet the user's rapid response demand for the survey report. SUMMARY
[0005] The embodiments of the present application provide a survey report generation method, an electronic device, a storage medium and a program product, which can reduce the generation cost of the survey report, shorten the generation time of the survey report, and meet the user's rapid response demand for the survey report. The technical solution is as follows: In a first aspect, a survey report generation method is provided, and the method comprises: In response to a target survey report generation task for a target object, based on the target object and a preset task planning template, the target survey report generation task is decomposed into a first subtask, a second subtask and a third subtask; perform the first subtask to search in a local database based on the target object to obtain a first text file corresponding to the first subtask, the local database storing basic data of each object; perform the second subtask to search in a plurality of network databases based on the target object and a plurality of preset dimensions to obtain a second text file corresponding to the second subtask, the plurality of preset dimensions being dimensions related to activities engaged in by the target object, the plurality of network databases storing data of each object in the plurality of preset dimensions; perform the third subtask to summarize the first text file and the second text file to obtain a target text file in a text format; generate a target investigation report based on the target text file in the text format, the target investigation report being an investigation report in a renderable web page format.
[0006] In a second aspect, an investigation report generation apparatus is provided, and the apparatus comprises: a disassembling module configured to, in response to a target investigation report generation task for a target object, disassemble the target investigation report generation task into a first subtask, a second subtask and a third subtask based on the target object and a preset task planning template; a first execution module configured to perform the first subtask to search in a local database based on the target object to obtain a first text file corresponding to the first subtask, the local database storing basic data of each object; a second execution module configured to perform the second subtask to search in a plurality of network databases based on the target object and a plurality of preset dimensions to obtain a second text file corresponding to the second subtask, the plurality of preset dimensions being dimensions related to activities engaged in by the target object, the plurality of network databases storing data of each object in the plurality of preset dimensions; a third execution module configured to perform the third subtask to summarize the first text file and the second text file to obtain a target text file in a text format; a generation module configured to generate a target investigation report based on the target text file in the text format, the target investigation report being an investigation report in a renderable web page format.
[0007] In a third aspect, an electronic device is provided, comprising a processor and a memory; the memory stores at least one piece of program code; the at least one piece of program code is used to be invoked and executed by the processor to implement the investigation report generation method of the first aspect.
[0008] In a fourth aspect, a computer readable storage medium is provided, and at least one computer program is stored in the computer readable storage medium, and the at least one computer program can realize the investigation report generation method in the first aspect when executed by a processor.
[0009] In a fifth aspect, a computer program product is provided, and the computer program product comprises a computer program, and the computer program can realize the investigation report generation method in the first aspect when executed by a processor.
[0010] The technical scheme provided by the embodiments of the present application has the beneficial effects that: This application provides a survey report generation service. Based on this service, a survey report with accurate content and a renderable webpage format can be generated quickly and cost-effectively, thus meeting users' needs for rapid response to survey reports. This application analyzes the task decomposition and execution process of calling a large language model. It finds that when calling the large language model to execute the decomposed subtasks, because user input often only contains the target object, the data dimensions retrieved by the large language model for multiple rounds of decomposition are relatively fixed and basically consistent. Therefore, this application sets a preset task planning template based on expert experience and examples from real-world scenarios. Upon receiving a target survey report generation task for a target object, the task is decomposed into a first subtask, a second subtask, and a third subtask based on the target object and the preset task planning template. The first subtask searches the local database for basic data of the target object, thereby generating a first text file corresponding to the first subtask. The second subtask involves searching for data on the target object under each preset dimension from multiple online databases corresponding to those preset dimensions, based on the target object and multiple preset dimensions, thereby generating a second text file corresponding to the second subtask. The third subtask involves summarizing the first and second text files to obtain a target text file in text format. Then, based on this text-formatted target text file, a renderable webpage-style target survey report is generated. Since the multiple preset dimensions are largely consistent with the dimensions determined when using the large language model for task decomposition, the data on the target object under multiple dimensions searched from multiple online databases is largely consistent with the data obtained from the network by the large language model. Furthermore, since the basic data of the target object is fixed, the generated first text file is consistent with the basic data of the target object obtained by the large language model. Therefore, the survey report generated using the method provided in this application embodiment has the same accuracy in content as the survey report generated by the large language model. In other words, the survey report generated using the method provided in this application embodiment, while ensuring the accuracy of the generated content, not only reduces the cost of generating the survey report but also shortens the generation time, meeting users' needs for rapid response to survey reports. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, 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 this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1This is a schematic diagram of the implementation environment involved in a survey report generation method provided in this application embodiment; Figure 2 This is an overall system architecture diagram of a survey report generation method provided in an embodiment of this application; Figure 3 This is a flowchart of a survey report generation method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the service interface of a survey report generation service provided in an embodiment of this application; Figure 5 This is a schematic diagram of the service interface of another survey report generation service provided in this application embodiment; Figure 6 This is a schematic diagram of a task planning and execution process provided in an embodiment of this application; Figure 7 This is a flowchart of another survey report generation method provided in this application embodiment; Figure 8 This is a schematic diagram of the service interface of another survey report generation service provided in this application embodiment; Figure 9 This is a schematic diagram illustrating the process of generating a webpage-format survey report according to an embodiment of this application; Figure 10 This is a flowchart of a security control mechanism provided in an embodiment of this application; Figure 11 This is a schematic diagram of the structure of a survey report generation device provided in an embodiment of this application; Figure 12 A structural block diagram of an electronic device provided in an exemplary embodiment of this application is shown. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0014] It is understood that the terms "each," "multiple," and "any" used in the embodiments of this application, etc., mean that "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the corresponding multiples. For example, multiple words include 10 words, and "each word" refers to each of the 10 words, while "any word" refers to any one of the 10 words.
[0015] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0016] Before implementing the embodiments of this application, the terms involved in the embodiments of this application will be explained first.
[0017] A Large Language Model (LLM) is a computer model capable of understanding and generating natural language. Through deep learning techniques, LLMs are trained on large amounts of text data to acquire syntactic, semantic, and contextual information, thereby generating coherent and accurate text. With the development of deep learning technology, the performance and application areas of LLMs have continuously expanded, and they are being used in tasks such as machine translation, question answering systems, and automatic summarization.
[0018] ReAct, a closed-loop "reasoning-execution" mechanism for AI agents, is not merely a technical module, but a core paradigm for endowing large language models with autonomous task-solving capabilities. Unlike the "black box" model of traditional large language models that directly output answers, ReAct combines chained reasoning with action to construct an intelligent agent capable of proactively thinking, making decisions, and executing complex tasks. Reasoning refers to analyzing gaps and planning the next steps based on the current task objective and existing information. Action refers to using external tools (such as search engines) to acquire new data or perform specific operations based on the reasoning conclusions. ReAct breaks the limitations of large language models relying on pre-trained knowledge, enabling AI to adopt a human-like problem-solving approach of "analyzing the problem → verifying the results → adjusting the strategy."
[0019] An agent is an intelligent program that can perceive its environment, generate actions through autonomous decision-making, and interact with external systems to achieve specific goals. Its core is driven by a large language model and it has reasoning, planning, and execution capabilities.
[0020] HTML5 refers to the current web page content coding standard (5th generation). The corresponding code can directly determine the content displayed on the web page, supporting multimedia, cross-platform and offline access, and a unified browser parsing and rendering standard.
[0021] Cross-Site Scripting (XSS) attacks refer to attackers injecting malicious scripts into web pages, causing the victim's browser to execute unauthorized code in a trusted context, resulting in information leakage or session hijacking.
[0022] In scenarios such as strategic decision-making, investment analysis, and risk assessment, users need to quickly generate accurate and renderable web-format survey reports for specific companies. Traditional methods rely on manual methods (including human surveys and third-party consulting) or static templates from enterprise information platforms to generate these reports. However, manually generated reports are time-consuming, costly, and slow to update, failing to meet users' demands for rapid response. Reports generated from static templates are monotonous in format and lack specific focus and logical reasoning across different companies. Furthermore, regardless of whether the method is manual or based on static templates, the generated reports contain a large amount of complex content, requiring users to expend considerable effort to determine the relevance of this content and potentially incurring additional costs for further analysis. Because traditional methods have high barriers to entry and struggle to generate well-structured, tightly packed, and reportable professional survey reports in one go, there is an urgent need for new methods to generate survey reports.
[0023] With the development of artificial intelligence technology, methods for generating survey reports using AI have been proposed. When generating survey reports using large language models, the process can be divided into two parts: generating text files of the survey report and generating HTML web pages based on those text files.
[0024] For the text file generation process, AI search solutions and ReAct-based free-form deep research solutions can be used.
[0025] AI search solutions typically employ a single-search model based on prompts. This involves generating keywords using a large language model, then calling a search engine to perform a search, summarizing the search results, and generating a text file of the survey report.
[0026] Compared to traditional methods, while this approach can shorten the report generation cycle and reduce costs, the resulting reports are not accurate enough. Specifically: information coverage is limited, failing to cover all information in complex enterprise research scenarios; the retrieved information is redundant and susceptible to noise interference, leading to inaccurate data or even misleading conclusions; information retrieval and summarization are completed in a one-off process, lacking the ability to continuously reflect on and dynamically adjust the task objectives, making it difficult to support the generation of in-depth, coherent, and logically evolving investigation reports.
[0027] Among them, the ReAct-based free-form deep research solution utilizes a collaborative mechanism of reasoning and action. Upon receiving the target task for generating a survey report, the large language model generates a thought chain, selects executable actions (Acts) based on this chain, and applies them to the external environment, obtaining observational feedback (Obs). Through iterative iteration, it gradually approaches the target until the task is completed. The ReAct framework simulates the human "thought-action integration" decision-making process, supports the decomposition and dynamic adjustment of complex tasks, and is widely applicable to research scenarios requiring multi-step interactions. By explicitly distinguishing between reasoning and operational steps, the ReAct framework achieves interpretability and controllability of the behavioral path. The overall process drives task execution in a closed-loop control manner, relying on external tool interfaces to complete key operations such as information retrieval, calculation, or verification.
[0028] Compared to AI search solutions, while this approach can guarantee the accuracy of the survey report to a certain extent, it still has some problems: Poor stability: Due to the autonomous decision-making of large language models, there are certain fluctuations in the analysis of complex problems, resulting in unstable output content that is difficult to control and predict.
[0029] High cost: Based on the ReAct architecture, after the task is submitted to the large language model, the large language model’s task decomposition, the length of the context returned by the tool search, and the number of loops are all uncontrollable, resulting in a high cost per task.
[0030] Slow response time: Based on the ReAct architecture, each round of thinking -> action -> feedback requires calling the large language model twice. The reasoning time of the large language model is relatively long, especially for complex problems that require multiple rounds of thinking. It is impossible to determine how many steps need to be broken down or how many times the large language model needs to be accessed, resulting in a long generation time for the survey report and failing to meet users' needs for a fast response to the survey report.
[0031] For the generation process of survey reports in the form of HTML web pages based on text files, the current methods include a multi-level page iterative assembly scheme and a scheme that assembles multiple files into a website at once.
[0032] The multi-level page iterative assembly scheme's overall process includes three stages: planning and retrieval, partial generation, and merging and generation. The planning and retrieval stage primarily involves breaking down the user's questions for detailed knowledge retrieval to ensure comprehensive knowledge acquisition. The partial generation stage converts the knowledge acquired from each level into HTML web pages or Python code, then calls the generation model to generate embeddable and mergeable functions or charts. The merging and generation stage mainly involves summarizing the text reports and table data generated from each level through report compilation, layout enhancement, and embedding tables and images to obtain the HTML web page survey report.
[0033] While this method can generate survey reports in HTML format, it has the following problems: Severe data illusion: Due to the illusion effect of the large language model, multi-level calls to the generation model can lead to the superposition of illusion problems, and there are discrepancies in understanding between layers, resulting in low credibility of the final data.
[0034] Format compatibility and style issues: Due to the use of multiple tools to generate intermediate results, the final report needs to consider the boundary issues of each component and subsequent update issues, resulting in inconsistent overall format and style of the final survey report, and even layout and page errors.
[0035] Timeliness issues: Due to the complexity of the hierarchical system, there is a significant time delay from the time a problem is raised to the time when the final report is presented.
[0036] One approach, which assembles multiple files into a website at once, uses a large language model to plan the solution, generate files, and run them, ultimately producing an HTML webpage survey report. While this approach can generate HTML webpage survey reports, it suffers from the following problems: Report success rate issues: The survey report can only be displayed successfully if the entire process is normal, which requires a high level of capability from the large language model. Furthermore, if the generation of key documents fails, the survey report cannot be displayed at all, resulting in a low success rate.
[0037] Time-consuming issue: Because each file needs to be generated accurately, the process takes a long time.
[0038] To address the problems existing in the above-mentioned solutions, this application provides a method for generating investigation reports. This method employs a proactive data retrieval architecture centered on predefined planning, concurrent search, and two-level filtering, and uses ReAct as a switchable fallback extension scheme to achieve targeted search and aggregation of information. A unique segmented HTML code control generation scheme is used to generate in-depth investigation reports with clear structure and rich graphics in real time. A security mechanism involving sensitive information filtering and dynamic key authorization is introduced to prevent potential security issues such as XSS attacks. Ultimately, this ensures the output of a professional, concise, and secure investigation report. This application innovates in system architecture, algorithm application, and security design, as detailed below: In terms of system architecture, based on ReAct and keyword coverage analysis, a preset task planning template is set. Based on this template, multi-path concurrent searches are performed, and the searched data is filtered, thereby improving the efficiency of generating investigation reports. This preset task planning template can not only be applied to enterprise background checks but also extended to other scenarios to generate investigation reports for different situations.
[0039] In terms of algorithm application, a large-scale HTML report generation mechanism based on modular splitting and parallel rendering was designed. The Markdown text files summarizing multiple rounds of research were split according to thematic levels and generated into HTML fragments with embedded charts, realizing efficient assembly of survey reports and dynamic front-end presentation.
[0040] In terms of security design, a front-end code security mechanism based on sensitive information judgment and dynamic key authorization identifies potential XSS risk scripts, assigns executable keys to secure JavaScript code snippets, prevents malicious user searches from triggering cross-site attacks, and ensures the display security of the system in enterprise-level applications.
[0041] The method provided in this application can solve the problems existing in the current investigation report generation process, specifically: To address the issues of content quality and depth in AI search solutions, this application's embodiment employs large-scale concurrent multi-dimensional search combined with a phased, one-step summary, which significantly acquires more data than AI search solutions, and the content summary solution is more hierarchical.
[0042] To address the issue of poor report stability in ReAct-based free-form deep research solutions, this application's embodiments have made improvements at both the engineering and data source levels. At the engineering architecture level, the React deep search framework is abandoned. Instead, a pre-defined task planning template is used to fix the task breakdown and execution process, eliminating the black-box element of multi-round autonomous decision-making in large language models and ensuring the stability of the entire system. At the data source level, a local knowledge base is built based on a deep understanding of objects in the application scenario. This local knowledge base stores basic data on various objects within the application scenario. For example, in a business survey report generation scenario, the local knowledge base stores fundamental information, operational status, risk information, and public opinion information for multiple companies. By building an accurate local knowledge base, the comprehensiveness and accuracy of the survey report are ensured. Furthermore, leveraging internet data search capabilities, data is searched through multiple channels, and correlation analysis is performed on the searched data to filter out irrelevant data, improving the accuracy of search results.
[0043] To address the high cost of ReAct-based free-form deep research solutions, this application isolates the local knowledge base from internet search. After task decomposition, searches are performed directly based on preset dimensions without inference, reducing the cost of calling large language models for inference. During web searches, pre-summarized webpage content is directly retrieved, significantly reducing both token consumption and search time.
[0044] To address the issue of time-consuming free-form deep research schemes based on ReAct, this application's embodiments have implemented several optimizations and upgrades: The task architecture is upgraded from the ReAct-based dynamic agent path -> domain model-driven parallel pipeline task architecture to a task architecture based on multiple preset dimensions for concurrent retrieval → relevance determination → key information extraction → report generation. The application implementation significantly reduces the number of calls to the large language model and reduces the inference time of the model.
[0045] The task reasoning process is optimized by transforming the planning process of calling a large language model into a template matching process. Analysis reveals that the planning approaches for tasks are largely similar, and the search dimensions are fixed. Therefore, it is unnecessary to call a large language model during task planning; task decomposition based on a preset task planning template can achieve the same effect as calling a large language model. This embodiment reduces the call to the large language model in the task reasoning stage, thus lowering the time consumption of model reasoning.
[0046] The tool invocation has been optimized. Under the ReAct architecture, the large language model needs to generate invocation parameters each time it calls the search tool. This embodiment of the application quickly determines the search parameters by constructing a correspondence between multiple preset dimensions and multiple online databases, and then invokes the tool to perform the search. This embodiment avoids invoking the large language model for search tool adaptation, reduces the number of times the large language model is invoked, and lowers the overall time consumption.
[0047] To address the illusion problem that occurs during HTML webpage generation, this application simplifies the system architecture, reduces tool calls, and leverages the understanding capabilities of a large language model to produce Markdown-formatted text files. This reduces task complexity, mitigates the impact of illusions, and improves the accuracy of the survey report. Furthermore, segmenting the text file reduces the burden on the large language model, ensuring that each paragraph is accurately understood by the model, further enhancing the accuracy of the survey report.
[0048] To address the low success rate in HTML webpage generation, this application employs a direct end-to-end webpage generation method, reducing the generation of multiple intermediate files and ensuring a high success rate. Furthermore, by adding constraint validation logic through segmentation, even if some webpages contain errors, it does not affect the final report output.
[0049] To address style issues in the HTML webpage generation process, this application embodiment implements unified style constraints and performs style verification and repair to ensure that all HTML code blocks are parallel and avoid style conflicts that are prone to occur in nested relationships.
[0050] To address the time-consuming issue in HTML webpage generation, this application embodiment limits the length of paragraphs after text file segmentation, ensuring that the length between segmented paragraphs does not exceed a preset length, thus avoiding performance issues caused by excessively long paragraphs and reducing time consumption.
[0051] Please refer to Figure 1 It illustrates the implementation environment involved in the investigation report method provided in the embodiments of this application, which includes: terminal 101 and server 102.
[0052] The terminal 101 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal 101 has a target application installed, which provides a survey report generation service. This target application includes application clients, web clients, and mini-programs. To facilitate user interaction, the target application provides a service interface for the survey report generation service, which can be a graphical user interface or a language user interface. To improve the smoothness of interaction, the service interface of the target application's survey report generation service can display an input box. The user can enter the target question statement in the input box. When the user enters the target question statement, the terminal can intelligently recommend the most relevant target object name for the user through an object name matching service (such as a company name matching service). After the terminal detects that the user has selected the target object name or entered it directly, it generates a target survey report generation request for that target object and sends the target survey report generation request to the server 102. Upon receiving the target survey report generation request, the server 102 executes the target survey report generation task, thereby generating a web-format survey report for the user targeting the target object.
[0053] Server 102 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 stores preset task planning templates. In response to a target survey report generation task for a target object, based on the target object and the preset task planning template, the target survey report generation task is broken down into a first subtask, a second subtask, and a third subtask. The first subtask is executed to search the local database based on the target object, obtaining a first text file corresponding to the first subtask. The second subtask is executed to search multiple network databases based on the target object and multiple preset dimensions, obtaining a second text file corresponding to the second subtask. The third subtask is executed to summarize the first and second text files, obtaining a target text file in text format. Then, based on the target text file in text format, a target survey report is generated. This target survey report is a renderable webpage format survey report.
[0054] The terminal 101 and server 102 described above can be directly or indirectly connected via network 103, and this embodiment of the application does not impose any limitations on this connection. The network 103 described above can be a wired network or a wireless network. Wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0055] Figure 2 The system architecture diagram of the investigation report generation method provided in this application embodiment is shown below. See also: Figure 2 The system is divided into a data layer, a task execution layer, and a front-end rendering layer.
[0056] The underlying data layer provides the data used to generate the survey report. In the scenario of generating a corporate survey report, the data provided by the underlying data layer includes corporate data, operational data, internet search data, and internet community data.
[0057] The task execution layer comprises several functional modules, including a task planning module, an agent execution module, and an HTML webpage generation module. The task planning module is used for task planning, specifically including two processes: task decomposition and task distribution. The task decomposition process yields a first subtask, a second subtask, and a third subtask. The task distribution process assigns the first subtask to a local data search agent, the second subtask to a network data search agent, and the third subtask to a summarizing agent. The agent execution module is used to invoke different agents to execute tasks based on the distributed tasks. Specifically, based on the distributed first subtask, the local data search agent is invoked to perform a search, obtaining the corresponding text file. Based on the distributed second subtask, the network data search agent is invoked to perform a search, and relevance analysis is performed on the search results to filter out data with low relevance. Then, based on the filtered data, the text file corresponding to the second subtask is generated. Based on the distributed third subtask, the summarizing agent is invoked to summarize the text files corresponding to the first and second subtasks, obtaining the target text file. The HTML webpage generation module is used to generate HTML webpages, such as survey reports, based on the target text file. Specifically, the content of the target text file can be broken down into multiple text paragraphs, and matching images can be inserted into the relevant text paragraphs to obtain multiple processed text paragraphs. Then, the code and style of these processed text paragraphs are processed to obtain an HTML webpage-formatted survey report. During the generation of the HTML webpage-formatted survey report, security controls are implemented on the report content based on an executable key.
[0058] The front-end rendering layer includes front-end rendering modules, etc. It is used to display data from the task execution layer, specifically showing progress summaries of investigation reports, snapshots of retrieved data, reviewable processes with progress bars, stage files, and final reports.
[0059] This application provides a method for generating survey reports. Figure 1 Taking the server executing the embodiments of this application as an example, see [link to example]. Figure 3 The method flow provided in this application embodiment includes: 301. In response to the task of generating a target investigation report for the target object, based on the target object and the preset task planning template, the task of generating the target investigation report is broken down into a first subtask, a second subtask and a third subtask.
[0060] The survey report generation method provided in this application can be applied to multiple scenarios, such as survey report generation for enterprises, medical institutions, financial products, and policy interpretation. The target object is the main body of the survey report. Depending on the scenario applied in this application, the target object can be an enterprise, a medical institution, a financial product, a policy, etc. The preset task planning template is a template generated based on domain expert knowledge and survey report examples in the application scenario. Using the preset task planning template can provide the decomposed subtasks at the millisecond level, and the results obtained from executing the decomposed tasks are largely consistent with those obtained from executing the tasks decomposed by calling the large language model, ensuring the quality and completeness of the searched knowledge. The preset task planning template can include multiple task steps, and based on these multiple task steps, the survey report generation task can be decomposed into a first subtask, a second subtask, a third subtask, etc. In the scenario of generating a corporate investigation report, the preset task planning template includes three task steps: "1. Select a website to query data sources and retrieve basic information about a company," "2. Collect relevant information about the company from the internet and conduct in-depth analysis," and "3. Based on the problem: help generate a background investigation report for the company and generate the final report." Each subtask corresponds to a different routing rule, which can be used to distribute different subtasks to different agents. Specifically, the first subtask corresponds to a local data search agent, used to search for local data of the target object and generate a first text file based on the searched local data. The second subtask corresponds to a network data search agent, used to search for network data of the target object and generate a second text file based on the searched network data. The third subtask corresponds to a summarizing agent, used to summarize the first and second text files.
[0061] In this embodiment, when a user wants to generate a survey report for a target object, the user can input a target question statement for the target object on the service interface of the survey report generation service. After the terminal detects the user's input, it generates a target survey report generation request for the target object and sends the request to the server. Upon receiving the target survey report generation request, the server generates a target survey report generation task for the target object. In response to the target survey report generation task, the server obtains a preset task planning template and, based on the target object and the preset task planning template, decomposes the target survey report generation task into a first subtask, a second subtask, and a third subtask. When decomposing the target survey report generation task based on the target object and the preset task planning template, the target object can be filled into each task step included in the preset task planning template, thereby obtaining the first subtask, the second subtask, and the third subtask. In the scenario of generating a background investigation report for a company, taking Company A as the target, the first sub-task is: 1. Select a website to query the data source and retrieve the basic information of Company A; the second sub-task is: 2. Collect relevant information about the company on the Internet and conduct in-depth analysis; the third sub-task is: 3. Address the problem: help generate a background investigation report for the company and generate the final report.
[0062] In this embodiment, after the target survey report generation task is broken down into a first subtask, a third subtask, and so on, these subtasks are sent to the terminal. The terminal displays the first subtask, the third subtask, and a task start control on the service interface. When a user touches the task start control, the terminal generates a task start command and sends it to the server. Upon receiving the task start command from the terminal, the server asynchronously executes each subtask. In the scenario of generating a survey report for an enterprise, where the target is Company A, the specific form of the service interface can be found in [reference needed]. Figure 4 See also Figure 4 The service interface displays three sub-tasks: "1. Select a website to query the data source and query the basic information of a company", "2. Collect relevant information about the company on the Internet and analyze it in depth", "3. For the problem: help generate a background check report for the company and generate the final report", and "Start the task control".
[0063] 302. Execute the first subtask to search the local database based on the target object and obtain the first text file corresponding to the first subtask.
[0064] The local database stores basic data for each object, providing reliable data for the generation of investigation reports. In the scenario of generating investigation reports for enterprises, the local database stores basic data for each enterprise, including the enterprise's social credit code, business registration information, shareholder information, enterprise background, court notices, penalties, etc.
[0065] The first subtask specifies the search interface for the local database. When the server executes the first subtask to search the local database based on the target object and obtains the first text file corresponding to the first subtask, it can call the search interface to retrieve the local data of the target object from the local database. Then, it summarizes the local data of the target object to obtain the first text file, which is in text format.
[0066] 303. Execute the second subtask, which searches multiple network databases based on the target object and multiple preset dimensions to obtain the second text file corresponding to the second subtask.
[0067] The second subtask specifies multiple pre-defined dimensions and their corresponding web databases, and also instructs for real-time retrieval using these dimensions in a web search engine. The correspondence between these pre-defined dimensions and the web databases can be determined based on the content of the data stored in each database within the actual scenario. For example, if a web database primarily stores data related to legal disputes involving a company, a correspondence can be established between this database and the pre-defined dimension "legal disputes." These pre-defined dimensions are related to the activities of the target entity. In the scenario of generating a corporate investigation report, these pre-defined dimensions include legal disputes, scale and compensation, products and services, major customers, market share, etc. These pre-defined dimensions are search keywords determined based on a deep understanding of the target entity's background investigation domain. By comparing the information retrieved based on these pre-defined dimensions with search information based on the ReAct framework and the actual execution framework, it is found that the search results based on these pre-defined dimensions are largely consistent with the search results obtained by calling the large language model, ensuring the comprehensiveness and accuracy of the search results. Multiple web databases store data for each object under multiple pre-defined dimensions. For real-time retrieval results using the web search engine, relevant search results are further filtered using methods such as the large language model, similarly ensuring the comprehensiveness and accuracy of the search results.
[0068] When the server executes the second subtask, which involves searching multiple web databases based on the target object and multiple preset dimensions to obtain the second text file corresponding to the second subtask, it may include the following steps: The first step is to detect whether there are similar objects that have a different representation than the target object.
[0069] Considering that the target entity's name may have different forms, such as "aa company" and "bb," but both refer to the same company, it's necessary to detect whether similar objects with different forms exist to ensure comprehensive and reliable search results. During this detection, a large language model can be used for semantic recognition to identify similar objects.
[0070] The second step is to obtain similar objects when there are similar objects with different representations than the target object.
[0071] The third step is to search for the network data of the target object under each preset dimension from the network database corresponding to each preset dimension, based on the target object and each preset dimension.
[0072] In this embodiment of the application, each preset dimension corresponds to a network database. When executing the second subtask, multiple preset dimensions can be used to perform real-time retrieval in the network search engine based on the target object and each preset dimension, so as to search from the network database corresponding to each preset dimension and obtain the network data of the target object under each preset dimension. For example, you can use "AA Company" and "legal disputes" to perform a real-time search on a web search engine to retrieve online data for "AA Company" under "legal disputes" from the corresponding online database; you can use "AA Company" and "scale and benefits" to perform a real-time search on a web search engine to retrieve online data for "AA Company" under "scale and benefits" from the corresponding online database; you can use "AA Company" and "products and services" to perform a real-time search on a web search engine to retrieve online data for "AA Company" under "products and services" from the corresponding online database; you can use "AA Company" and "major customers" to perform a real-time search on a web search engine to retrieve online data for "AA Company" under "major customers" from the corresponding online database; and you can use "AA Company" and "market share" to perform a real-time search on a web search engine to retrieve online data for "AA Company" under "market share" from the corresponding online database.
[0073] The fourth step is to search for network data of similar objects under each preset dimension from the network database corresponding to each preset dimension, based on similar objects and each preset dimension.
[0074] In this embodiment of the application, each preset dimension corresponds to a network database. When executing the second sub-task, multiple preset dimensions can be used to perform real-time retrieval in the network search engine based on similar objects and each preset dimension, so as to search from the network database corresponding to each preset dimension and obtain the network data of similar objects under each preset dimension. For example, you can use "bb" and "legal disputes" to perform a real-time search on a web search engine to retrieve web data for "bb" under "legal disputes" from the corresponding web database; you can use "bb" and "scale and benefits" to perform a real-time search on a web search engine to retrieve web data for "bb" under "scale and benefits" from the corresponding web database; you can use "bb" and "products and services" to perform a real-time search on a web search engine to retrieve web data for "bb" under "products and services" from the corresponding web database; you can use "bb" and "major customers" to perform a real-time search on a web search engine to retrieve web data for "bb" under "major customers" from the corresponding web database; and you can use "bb" and "market share" to perform a real-time search on a web search engine to retrieve web data for "bb" under "market share" from the corresponding web database.
[0075] It should be noted that the search processes in steps four and five no longer rely on large language models for step-by-step inference and tool calls. Instead, they are based on the correspondence between multiple preset dimensions and multiple online databases, reducing the cost of calling large language models. Furthermore, the search processes in steps four and five are executed concurrently, and the search processes based on different preset dimensions within steps four and five are also executed concurrently. By changing the traditional "serial chained calls" to "parallel broadcast calls," the input and output waiting time is significantly reduced, ensuring search efficiency and shortening report generation time.
[0076] The fifth step is to summarize the network data of the target object in each preset dimension and the network data of similar objects in each preset dimension to obtain the second text file.
[0077] The server can call the large language model to summarize the network data of the target object in each preset dimension and the network data of similar objects in each preset dimension, and obtain a second text file.
[0078] Furthermore, considering the large volume of network data retrieved from the network database in parallel, and the potential presence of noise, this embodiment of the application will also invoke a large language model to filter and clean the network data of the target object and similar objects in each preset dimension to improve the quality of the network data. Specifically, the correlation between the network data of the target object in each preset dimension and the corresponding preset dimension is calculated. Based on the correlation calculation results, network data of the target object in each preset dimension whose correlation with each preset dimension does not meet the correlation requirements is removed, resulting in relevant network data of the target object in each preset dimension. Simultaneously, the correlation between the network data of similar objects in each preset dimension and the corresponding preset dimension is calculated. Based on the correlation calculation results, network data of similar objects in each preset dimension whose correlation with each preset dimension does not meet the correlation requirements is removed, resulting in relevant network data of similar objects in each preset dimension. After filtering and cleaning the network data, the relevant network data of the target object and similar objects in each preset dimension can be summarized to obtain a second text file.
[0079] In another embodiment of this application, when there is no similar object with a different representation of the target object, the server performs real-time retrieval in a web search engine based on the target object and each preset dimension, using multiple preset dimensions to search for the web data of the target object under each preset dimension from the web database corresponding to each preset dimension, and then summarizes the web data of the target object under each preset dimension to obtain a second text file.
[0080] Furthermore, before summarizing the network data of the target object in each preset dimension, the server will invoke a large language model to filter and clean the network data of the target object in each preset dimension. Specifically, the correlation between the network data of the target object in each preset dimension and the corresponding preset dimension is calculated. Based on the correlation calculation results, network data in the network data of the target object in each preset dimension that does not meet the correlation requirements is removed, resulting in the relevant network data of the target object in each preset dimension. After filtering and cleaning the network data, the relevant network data of the target object in each preset dimension can be summarized to obtain the second text file.
[0081] 304. Execute the third subtask to summarize the first and second text files and obtain the target text file in text format.
[0082] The server executes a third subtask to invoke the summarizing agent to summarize the first and second text files, thereby obtaining the target text file in text format.
[0083] In this embodiment of the application, during the execution of the first subtask, the second subtask, and the third subtask, the execution status of the first subtask, the second subtask, and the third subtask is sent to the terminal for display, so that the user can perceive the specific progress of the task execution. Figure 5 The demonstration shows the execution process of the first, second, and third subtasks in the scenario of generating an enterprise survey report.
[0084] Figure 6 The task planning and execution process of an embodiment of this application is illustrated. See also: Figure 6 Upon receiving the user's query (i.e., the target question) for the target object, a target survey report generation task is generated. This task is then broken down into three subtasks: a first subtask, a second subtask, and a third subtask. The first subtask searches the local database to obtain a corresponding interim summary (a first text file). The second subtask concurrently searches multiple online databases to obtain a corresponding interim summary (a second text file). The third subtask summarizes the interim summaries of the first and second subtasks to generate the survey report. Specifically, the server calls the search interface corresponding to the first subtask, searching the local database based on the target object to obtain the interim summary. The server optimizes the subject of the target object to obtain similar objects. Then, based on the target object, similar objects, and multiple preset dimensions, it searches in parallel from multiple online databases corresponding to those preset dimensions. Finally, based on these preset dimensions, it performs relevance filtering on the searched online data and summarizes the filtered data to obtain the interim summary for the second subtask. The server calls the summary agent to summarize the phase summaries corresponding to the first subtask and the second subtask. During the summary process, the summary agent calls the large language model for processing, which may generate multiple drafts, and finally obtains the target text file of the target survey report.
[0085] This completes the generation of the target text file for the target investigation report. The innovative points of this section are as follows: The preset task planning template provided in this application is highly versatile. It can be applied not only to enterprise research, but also to fields such as healthcare, financial products, and policy interpretation by changing task steps and routing rules. The preset task planning template also supports flexible switching between "drill down" (focusing on a few key points) and "breadth scan" (comprehensive understanding of the situation).
[0086] In addition, the embodiments of this application adopt a "one-time planning, multi-path concurrency" strategy, which can complete more effective searches in the same amount of time, improve retrieval efficiency, and make the search results more comprehensive and complete.
[0087] Furthermore, this application's embodiments ensure the completeness of information in the actual execution system by comparing actual search keywords throughout the entire lifecycle and comparing search information based on the ReAct framework and the actual execution framework. This approach can help the system quickly expand to in-depth research scenarios of other problems and rapidly decide on trade-offs in system architecture.
[0088] Furthermore, this application's embodiments introduce a queue scheduling mechanism for data search and data result summarization, enabling concurrent and asynchronous execution of multiple tasks. This design overcomes the performance bottleneck of traditional serial processing modes, significantly reducing overall response time and improving report generation efficiency. By decoupling search and summarization and incorporating them into an independent scheduling queue, the system can initiate preliminary summarization after acquiring partial data, supporting phased and gradual information integration and avoiding context overload caused by loading massive amounts of data at once. This mechanism effectively alleviates the problems of information omission and inductive bias in long text scenarios using large language models, enhancing the comprehensiveness and accuracy of summaries. Simultaneously, the asynchronous concurrent architecture improves system resource utilization and scalability, adapting to the complex and ever-changing needs of enterprise information research.
[0089] 305. Generate a target survey report based on the target text file in text format. The target survey report is a renderable web page format survey report.
[0090] To facilitate user viewing, after obtaining the target text file in text format, this application embodiment will also generate a target survey report based on the target text file in text format. The target survey report is a survey report in a renderable web page format. Figure 7 The illustrated embodiment demonstrates the process of generating a target survey report, which includes the following steps: 701. Obtain multiple target images related to the content of the target text file.
[0091] In this embodiment, during the execution of the first and second subtasks to search for data, the server may acquire multiple images. Some of these images are related to the content of the target text file, while others are not. After acquiring these images, the server can calculate the relevance of each image to the content of the text file, and then, based on the relevance calculation results, acquire multiple target images that are related to the content of the target text file.
[0092] 702. The target text file is segmented according to the heading level to obtain multiple text paragraphs.
[0093] Each text paragraph must not exceed a preset length. When the server segments the target text file according to heading levels, it can call a large language model for segmentation. The specific segmentation process includes: segmenting the target text file using first-level headings as the segmentation unit, resulting in multiple first text paragraphs corresponding to multiple first-level headings; if the length of any first text paragraph corresponding to a first-level heading exceeds the preset length, segmenting the first text paragraph using each second-level heading included in the first-level heading as the segmentation unit, resulting in multiple second text paragraphs corresponding to multiple second-level headings; if the length of any second text paragraph corresponding to a second-level heading exceeds the preset length, segmenting the second text paragraph using each third-level heading included in the second-level heading as the segmentation unit, resulting in multiple third text paragraphs corresponding to multiple third-level headings. This process continues, with the server segmenting according to heading levels from highest to lowest, until the length of each resulting text paragraph does not exceed the preset length.
[0094] This application embodiment ensures that the length of each text segment does not exceed a preset length by segmenting the target text file, reducing the processing burden of the subsequent large language model, accelerating the generation speed of the survey report, and ensuring that the performance of the large language model will not degrade due to excessively long input. This achieves control over the illusion of the large language model, ensuring the accuracy of the survey report and the richness of the webpage style.
[0095] Furthermore, before segmenting the target text file according to heading levels, this embodiment can summarize the key content of the target text file to obtain multi-level headings. This summary of key content can be performed using a large language model. By summarizing the key content of the target text file, this embodiment provides a foundation for subsequent segmentation, ensuring that each segmented text paragraph is within a preset length range and reducing the impact of model illusion. In addition, by summarizing the key content of the target text file, when generating a webpage-formatted survey report using a large language model, it does not rely on data with other structures or multimodal data, ensuring the structure of the input data, guaranteeing the controllability of the webpage-formatted survey report generation process, and ensuring the authenticity of the data.
[0096] 703. Insert multiple target images into relevant text paragraphs to obtain multiple processed text paragraphs.
[0097] After obtaining multiple text paragraphs, the target images are inserted into the relevant text paragraphs based on their relevance to the text, resulting in multiple processed text paragraphs. This insertion of multiple target images into the text paragraphs provides a data foundation for the subsequent generation of a visually appealing target survey report.
[0098] 704. Process the format and style of multiple text paragraphs to obtain multiple target text paragraphs with web page format and preset style.
[0099] In this step, the server can invoke a large language model to process the format and style of multiple text paragraphs, resulting in multiple target text paragraphs in a webpage format with a preset style. This webpage format can be HTML, meaning each target paragraph consists of HTML code. The preset style defines the line spacing and paragraph spacing of each target text paragraph, as well as the font and size of the code within each target text paragraph.
[0100] This application embodiment ensures that the final code can be merged by restricting the format and style of each text paragraph. For target text files with complex chapter structures, restricting the format and style of each text paragraph facilitates subsequent detection, ensuring overall style consistency and displayability. Even if there are local errors using this method, it will not affect the final presentation of the investigation report.
[0101] 705. Merge multiple target text paragraphs according to their order in the target text file to obtain the target investigation report.
[0102] In this step, the server can merge the code of multiple target text paragraphs according to their order in the target text file. This embodiment of the application concatenates multiple target text paragraphs sequentially according to the original document order, ensuring the consistency and continuity of the presentation of each chapter.
[0103] Furthermore, during the merging process, conflict detection can be performed on the code styles of multiple target text paragraphs. For target text paragraphs that differ from the preset style, they can be restored to the preset style, thereby ensuring the consistency of the overall style of the target survey report content.
[0104] Figure 8 The image shows the style of a target survey report generated using an embodiment of this application when displayed on a terminal. Figure 8 As can be seen, the end-to-end direct generation of displayable web pages combined with modular parallel processing, as described in this application embodiment, not only generates visually appealing, well-structured, and logically presented survey reports at a faster pace, but also reduces the occurrence of illusions, thereby improving the accuracy and success rate of the survey reports. This approach also offers high flexibility, supporting subsequent page style expansion and iterative updates.
[0105] Figure 9 The process of generating the target investigation report is shown below. Figure 9After obtaining the target text file (usually in Markdown format), the key content is summarized to obtain different levels of headings. The target text file is then segmented according to these heading levels, resulting in paragraphs 1, 2, 3, etc. Based on the content of the target text file, the relevance between each image retrieved during the search and the content of the target text file is calculated. Then, based on the relevance calculation results, multiple target images related to the content of the target text file are obtained. These target images are inserted into the relevant text paragraphs, and the format and style of these paragraphs are constrained in parallel, resulting in multiple target paragraphs. Style conflicts are detected and restored in these target paragraphs. Finally, the conflict-detected and restored target paragraphs are sequentially concatenated to obtain a target survey report, which can be displayed on the front end.
[0106] This application's embodiments use a large language model to generate most of the front-end HTML code ultimately used for actual webpage rendering. This HTML code includes automatically generated JavaScript code, which is crucial for image display and enhancing interactivity. Since report content is controlled by user input, and the user's input method is completely free, without strict control, attackers could construct malicious searches to induce the model to generate malicious JavaScript scripts, a vulnerability known as Cross-Site Scripting (XSS). Therefore, implementing reliable security controls is essential.
[0107] Currently, in the scenario of generating investigation reports, achieving reliable security controls to defend against XSS attacks presents the following challenges: 1. User input is completely free and unpredictable, making it difficult to achieve the goal simply by processing user input. Neither rules nor large models can guarantee the security of user input. Considering the scalability of the scenario, directly rejecting survey report generation may result in false rejections, damaging the product's image. Furthermore, since the generated HTML code itself contains unpredictable, variable-format, normal and necessary JavaScript code, directly disabling JavaScript or applying fixed-format JavaScript filtering could have incalculable negative impacts on the normal report. Therefore, rule-based filtering of the code alone is insufficient to achieve the goal. In addition, users have high time requirements for survey reports, so over-reliance on complex post-processing is not advisable. In particular, an in-depth research survey report often includes at least tens of thousands of characters, while the proportion of user input with security issues is relatively small. If a large language model is sequentially called to perform security post-processing on the code in the survey report after generation, it will place a huge burden on the system.
[0108] To address this, this application provides a security control mechanism. Based on this mechanism, upon receiving a target investigation report generation task, an executable key can be assigned to the target question statement. This executable key is used multiple times throughout the webpage-formatted investigation report generation process. This application ensures security through the unpredictability of this executable key. Specifically, based on this executable key, prompt information can be generated through prompt word engineering. This prompt information instructs the large language model to assign an executable key to text paragraphs with a preset header when processing the format of multiple text paragraphs. This preset header can be set based on expert experience. Based on this executable key, a webpage rendering template is generated through HTML's CSP (Content-Security-Policy) mechanism. This webpage rendering template instructs the large language model to set the text paragraphs configured with the executable key as executable text paragraphs when processing the format of multiple text paragraphs.
[0109] Based on the generated prompts and webpage rendering templates, when processing the format of multiple text paragraphs, the invoked large language model, following the instructions of the prompts, assigns executable keys to text paragraphs with preset headers in the webpage format. Then, following the instructions of the webpage rendering template, it sets the text paragraphs configured with executable keys as executable text paragraphs. Thus, text paragraphs in the target investigation report with preset headers in the webpage format are set as executable text paragraphs, while text paragraphs without preset headers in the webpage format are automatically identified as non-executable text paragraphs. For executable text paragraphs, the terminal can execute and display them during front-end rendering; for non-executable text paragraphs, the terminal will neither execute nor display them during front-end rendering.
[0110] Furthermore, the code blocks included in the target text paragraphs generated in this application embodiment are all labeled. Based on the labels labeled on each code block in each target text paragraph, when processing the format of multiple target text paragraphs, code blocks corresponding to preset labels can be deleted from the corresponding target text paragraphs. These preset labels are non-compliant labels and can be set based on expert experience. This application embodiment ensures data security and reduces the risk of malicious attacks by filtering at the label level.
[0111] The embodiments of this application can ensure the security of the generated HTML code with minimal additional time consumption during the HTML code generation process. It has almost no impact on content quality; valid JavaScript code, such as JavaScript code for drawing charts, can still be executed, perfectly meeting the professional and efficient requirements of in-depth research report scenarios. It also possesses good scalability, allowing for rapid expansion to most user input scenarios.
[0112] Figure 10 The security control flow of an embodiment of this application is illustrated. See also: Figure 10 In response to the task of generating a target investigation report for the target object, an executable key is set for the target question statements included in the target investigation report. Based on this executable key and the prompt process (Prompt processing), a prompt message is generated (injecting the executable key). Based on this executable key, a web page rendering template is generated. After obtaining the Markdown format file through the preliminary steps, during the HTML code block generation process, the large language model invoked, according to the instructions of the prompt message, assigns an executable key to the text paragraphs with a preset header in the web page format. Then, according to the instructions of the web page rendering template, the text paragraphs configured with the executable key are set as executable text paragraphs, thereby generating multiple HTML code blocks. For each code block obtained, code marked with non-compliant tags is deleted from the corresponding code block, thereby ensuring the security of the generated web page.
[0113] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0114] Please refer to Figure 11 The illustration shows a schematic diagram of a survey report generation device provided in an embodiment of this application. This device can be implemented through software, hardware, or a combination of both, and can be all or part of an electronic device. The device includes: The decomposition module 1101 is used to respond to the target investigation report generation task for the target object, and decompose the target investigation report generation task into a first sub-task, a second sub-task and a third sub-task based on the target object and a preset task planning template. The first execution module 1102 is used to execute the first subtask to search the local database based on the target object and obtain the first text file corresponding to the first subtask. The local database stores the basic data of each object. The second execution module 1103 is used to execute the second subtask to search in multiple network databases based on the target object and multiple preset dimensions to obtain the second text file corresponding to the second subtask. The multiple preset dimensions are dimensions related to the activities performed by the target object, and the multiple network databases store data of each object under the multiple preset dimensions. The third execution module 1104 is used to execute the third subtask to summarize the first text file and the second text file to obtain a target text file in text format; The first generation module 1105 is used to generate a target survey report based on the target text file in the text format, wherein the target survey report is a survey report in a renderable web page format.
[0115] In another embodiment of this application, the first subtask indicates the search interface of the local database. The first execution module 1102 is used to call the search interface to search for the local data of the target object from the local database; and to summarize the local data of the target object to obtain the first text file.
[0116] In another embodiment of this application, the second subtask indicates the network databases corresponding to the plurality of preset dimensions respectively. The second execution module 1103 is used to detect whether there are similar objects with different representations from the target object; when there are similar objects with different representations from the target object, the similar objects are obtained; based on the target object and each preset dimension, the network data of the target object under each preset dimension is searched from the network database corresponding to each preset dimension; based on the similar objects and each preset dimension, the network data of the similar objects under each preset dimension is searched from the network database corresponding to each preset dimension; the network data of the target object under each preset dimension and the network data of the similar objects under each preset dimension are summarized to obtain the second text file.
[0117] In another embodiment of this application, the device further includes: The first calculation module is used to calculate the correlation between the network data of the target object and the corresponding preset dimension in each preset dimension; The first removal module is used to remove network data in the network data of the target object in each preset dimension whose correlation with each preset dimension does not meet the correlation requirements, so as to obtain the relevant network data of the target object in each preset dimension. The second calculation module is used to calculate the correlation between the network data of the similar objects in each preset dimension and the corresponding preset dimension; The second removal module is used to remove network data in the network data of the similar object in each preset dimension that does not meet the correlation requirements with each preset dimension, so as to obtain the relevant network data of the similar object in each preset dimension. The second execution module 1103 is used to summarize the relevant network data of the target object under each preset dimension and the relevant network data of the similar objects under each preset dimension to obtain the second text file. In another embodiment of this application, the device further includes: The search module is used to search for the network data of the target object under each preset dimension from the network database corresponding to each preset dimension, based on the target object and each preset dimension, when there is no similar object with a different expression form from the target object. The summary module is used to summarize the network data of the target object under each preset dimension to obtain the second text file.
[0118] In another embodiment of this application, the generation module 1105 is used to acquire multiple target images related to the content of the target text file; segment the target text file according to the title level to obtain multiple text paragraphs, the length of each text paragraph not exceeding a preset length; insert the multiple target images into the relevant text paragraphs to obtain multiple processed text paragraphs; process the format and style of the multiple processed text paragraphs to obtain multiple target text paragraphs in web page format with a preset style; and merge the multiple target text paragraphs according to their order in the target text file to obtain the target survey report.
[0119] In another embodiment of this application, the generation module 1105 is used to segment the target text file using first-level headings as the segmentation unit to obtain multiple first text paragraphs corresponding to multiple first-level headings; when the length of any first text paragraph corresponding to a first-level heading exceeds the preset length, the first text paragraph is segmented using each second-level heading included in the first-level heading as the segmentation unit to obtain multiple second text paragraphs corresponding to multiple second-level headings; the segmentation is performed in descending order of heading level until the length of each obtained text paragraph does not exceed the preset length.
[0120] In another embodiment of this application, the target survey report generation task includes a target question statement entered by a user account on the service interface of the survey report generation service, and the device further includes: The first allocation module is used to allocate an executable key to the target question statement after receiving the target investigation report generation task; The second generation module is used to generate prompt information and web page rendering template based on the executable key; The second allocation module is used to allocate the executable key to a text paragraph with a preset header in accordance with the prompt information when processing the format of the multiple text paragraphs. The settings module is used to set the text paragraph configured with the executable key as an executable text paragraph according to the instructions of the web page rendering template.
[0121] In another embodiment of this application, each target text paragraph includes multiple code blocks labeled with multiple tags, and the device further includes: The deletion module is used to delete the code blocks marked with preset tags from the corresponding target text paragraphs when processing the format of the multiple text paragraphs, based on the tags marked on each code block in each target text paragraph.
[0122] In another embodiment of this application, the device further includes: The first sending module is used to send the first subtask, the first subtask and the third subtask to the terminal, so that the terminal displays the first subtask, the first subtask, the third subtask and the task start control, and generates a task start command and returns after detecting a touch operation on the task start control; The first execution module 1102 is used to execute the first subtask when it receives a task start instruction sent by the terminal.
[0123] In another embodiment of this application, the device further includes: The second sending module is used to send the execution status of the first subtask, the second subtask, and the third subtask to the terminal for display during the execution of the first subtask, the second subtask, and the third subtask.
[0124] Figure 12 This diagram illustrates a structural block diagram of an electronic device 1200 provided in an exemplary embodiment of this application. Typically, the electronic device 1200 includes a processor 1201 and a memory 1202.
[0125] The processor 1201 can be implemented in at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1201 may also include a main processor and a coprocessor; the main processor is a processor for processing data in the wake-up state, and the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 1201 may also include an artificial intelligence processor for handling computational operations related to machine learning.
[0126] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory computer-readable storage media, such as CD-ROM (Compact Disc Read-Only Memory), ROM, RAM (Random Access Memory), magnetic tape, floppy disk, and optical data storage devices. The computer-readable storage media stores at least one computer program, which, when executed, can implement the aforementioned survey report generation method.
[0127] Of course, the aforementioned electronic device may also include other components, such as input / output interfaces and communication components. Input / output interfaces provide an interface between the processor and peripheral interface modules, which can be output devices, input devices, etc. Communication components are configured to facilitate wired or wireless communication between the electronic device and other devices.
[0128] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on the electronic device 1200, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0129] This application provides a computer-readable storage medium storing at least one computer program, which, when executed by a processor, can implement the above-described survey report generation method.
[0130] This application provides a computer program product, which includes a computer program that, when executed by a processor, can implement the above-described survey report generation method.
[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0132] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating a survey report, characterized in that, The method includes: In response to the task of generating a target investigation report for a target object, the task of generating the target investigation report is broken down into a first subtask, a second subtask, and a third subtask based on the target object and a preset task planning template. The first subtask is executed to search the local database based on the target object to obtain the first text file corresponding to the first subtask, wherein the local database stores the basic data of each object; The second subtask is executed to search multiple network databases based on the target object and multiple preset dimensions to obtain a second text file corresponding to the second subtask. The multiple preset dimensions are dimensions related to the activities performed by the target object, and the multiple network databases store data of each object under the multiple preset dimensions. The third subtask is performed to summarize the first text file and the second text file to obtain a target text file in text format; Based on the target text file in the aforementioned text format, a target survey report is generated, wherein the target survey report is a renderable web page format survey report.
2. The method according to claim 1, characterized in that, The first subtask indicates the search interface of the local database. Executing the first subtask to search the local database based on the target object and obtain the first text file corresponding to the first subtask includes: Call the search interface to retrieve local data of the target object from the local database; The local data of the target object is summarized to obtain the first text file.
3. The method according to claim 1, characterized in that, The second subtask indicates the network databases corresponding to the multiple preset dimensions. Executing the second subtask involves searching the multiple network databases based on the target object and the multiple preset dimensions to obtain the second text file corresponding to the second subtask, including: Detect whether there are similar objects that have a different representation than the target object; When a similar object with a different representation than the target object exists, the similar object is obtained; Based on the target object and each preset dimension, search the network data of the target object under each preset dimension from the network database corresponding to each preset dimension; Based on the similar objects and each preset dimension, search the network data of the similar objects under each preset dimension from the network database corresponding to each preset dimension; The network data of the target object under each preset dimension and the network data of the similar objects under each preset dimension are summarized to obtain the second text file.
4. The method according to claim 3, characterized in that, Before summarizing the network data of the target object and the network data of similar objects in each preset dimension to obtain the second text file, the method further includes: Calculate the correlation between the network data of the target object and the corresponding preset dimension in each preset dimension; Remove network data in the network data of the target object in each preset dimension that does not meet the correlation requirements, and obtain the relevant network data of the target object in each preset dimension; Calculate the correlation between the network data of the similar objects and the corresponding preset dimensions in each preset dimension; Remove network data in the network data of the similar objects in each preset dimension that do not meet the correlation requirements, and obtain the relevant network data of the similar objects in each preset dimension; The process of summarizing the network data of the target object and the network data of similar objects under each preset dimension to obtain the second text file includes: The relevant network data of the target object under each preset dimension and the relevant network data of the similar objects under each preset dimension are summarized to obtain the second text file.
5. The method according to claim 3, characterized in that, The method further includes: When there is no similar object with a different representation of the target object, based on the target object and each preset dimension, search the network data of the target object under each preset dimension from the network database corresponding to each preset dimension; The network data of the target object under each preset dimension is summarized to obtain the second text file.
6. The method according to claim 1, characterized in that, The target text file based on the aforementioned text format is used to generate a target survey report, including: Obtain multiple target images related to the content of the target text file; The target text file is segmented according to the heading level to obtain multiple text paragraphs, and the length of each text paragraph does not exceed a preset length; The multiple target images are inserted into relevant text paragraphs to obtain multiple processed text paragraphs; The format and style of the multiple processed text paragraphs are processed to obtain multiple target text paragraphs with web page format and preset style; The multiple target text paragraphs are merged in the order they appear in the target text file to obtain the target investigation report.
7. The method according to claim 6, characterized in that, The target text file is segmented according to heading level to obtain multiple text paragraphs, including: The target text file is divided into multiple first text paragraphs corresponding to multiple first-level headings, using the first-level heading as the dividing unit. When the length of the first text paragraph corresponding to any first-level heading exceeds the preset length, the first text paragraph is divided into multiple second text paragraphs corresponding to multiple second-level headings, using each second-level heading included in the first-level heading as the dividing unit. The text is segmented according to the heading level from highest to lowest until the length of each resulting text paragraph does not exceed the preset length.
8. The method according to claim 6, characterized in that, The target survey report generation task includes the target question statement entered by the user account on the service interface of the survey report generation service, and the method further includes: Upon receiving the target investigation report generation task, an executable key is assigned to the target question statement; Based on the executable key, generate prompt information and webpage rendering template; When processing the format of the multiple text paragraphs, the executable key is assigned to the text paragraph with the preset header in accordance with the prompt information, and the text paragraph configured with the executable key is set as an executable text paragraph in accordance with the instructions of the web page rendering template.
9. The method according to claim 8, characterized in that, Each target text paragraph includes multiple code blocks labeled with multiple tags, and the method further includes: When processing the format of the multiple text paragraphs, based on the tags marked on each code block in each target text paragraph, the code blocks marked with preset tags are deleted from the corresponding target text paragraphs.
10. The method according to any one of claims 1 to 9, characterized in that, Before executing the first subtask, the process also includes: The first subtask, the first subtask and the third subtask are sent to the terminal so that the terminal displays the first subtask, the first subtask, the third subtask and the task start control, and generates a task start command and returns after detecting a touch operation on the task start control; When a task start command is received from the terminal, the first sub-task is executed.
11. The method according to any one of claims 1 to 9, characterized in that, The method further includes: During the execution of the first, second, and third subtasks, the execution status of the first, second, and third subtasks is sent to the terminal for display.
12. An electronic device, characterized in that, It includes a processor and a memory; the memory stores at least one piece of program code; the at least one piece of program code is called and executed by the processor to implement the survey report generation method as described in any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which, when executed by a processor, is capable of implementing the survey report generation method as described in any one of claims 1 to 11.
14. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, can implement the survey report generation method as described in any one of claims 1 to 11.