Automatic report generation method and system, terminal and medium
By building and training table relationship models, combining natural language interaction and multimodal data processing, the problem of inefficiency in traditional reporting tools when processing multiple data types is solved, and efficient and flexible report automatic generation and multimodal data report presentation are achieved.
Patent Information
- Application Number
- CN202411439067.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-03-18
AI Technical Summary
Traditional reporting tools are limited to structured data types when processing data, resulting in low efficiency in data processing, unable to effectively utilize unstructured and semi-structured data, and lack of natural language interaction capabilities, which limits the flexibility and real-time nature of report generation.
By building database graph and table relation models, the table relation model is trained to process structured, semi-structured and unstructured data, and automatic report generation is achieved. The system includes a graph construction module, a model training module, a report generation module and a report verification module, which supports natural language interaction and multimodal data processing.
It realizes automated processing of structured, semi-structured and unstructured data, reduces manual intervention, improves the efficiency and flexibility of report generation, supports real-time dynamic reports generation, and enhances the readability and comprehensibility of data.
Smart Images

Figure CN119646231A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of report generation, and in particular to a method, system, terminal and medium for automatically generating a report. Background Art
[0002] At present, data has become the core driving force for business innovation and decision optimization. With the explosive growth of data volume and the diversification of data types, enterprises have increasingly urgent and diversified demands for data reports. Traditional report generation methods are limited by their static nature, low efficiency, and insufficient multimodal data processing capabilities, and are no longer able to meet the needs of modern enterprises for rapid response, flexible customization, and deep insights.
[0003] Specifically, traditional reporting tools are often limited to structured data types when processing data, and have limited support for unstructured data (such as text, images, audio, etc.) and semi-structured data (such as JSON object notation, XML extensible markup language, etc.), resulting in a large amount of valuable information being ignored or difficult to effectively use. In addition, these tools usually lack natural language interaction capabilities, and users need to use complex interfaces or scripting languages to define report content, which not only increases the threshold for use, but also limits the flexibility and real-time nature of report generation.
[0004] More importantly, modern enterprises are facing complex and ever-changing business environments and market challenges, and decision makers need to formulate strategies based on multi-dimensional and multi-perspective data analysis. Traditional reports, due to their fixed formats and limited data integration capabilities, often fail to provide a comprehensive, in-depth and intuitive data view, thus affecting the effectiveness and accuracy of decision-making.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] The main purpose of the present application is to provide a method, system, terminal and medium for automatic report generation, aiming to solve the problem in the prior art that traditional report tools are limited to structured data types when processing data, resulting in low data processing efficiency.
[0007] A first aspect of an embodiment of the present application provides a method for automatically generating reports, which includes the following steps: constructing a database graph; constructing a table relationship model, and training the table relationship model according to the database graph to obtain a trained table relationship model; obtaining report requirements, and inputting the report requirements into the trained table relationship model to obtain an analysis report; wherein the report requirements include any one of structured data, semi-structured data and unstructured data; and verifying the analysis report to generate a verification result.
[0008] Optionally, in one embodiment of the present application, constructing a database graph specifically includes: acquiring a distributed database; performing a database traversal on the distributed database to obtain a library table traversal result; obtaining a relationship chain between library tables based on the library table traversal result, and constructing a database graph based on the relationship chain.
[0009] Optionally, in one embodiment of the present application, the training of the table relationship model according to the database graph to obtain a trained table relationship model specifically includes: obtaining historical report generation statements and data reports; training the table relationship model according to the database graph, the historical report generation statements and the data reports to obtain a preliminarily trained table relationship model; obtaining training statements, and training the preliminarily trained table relationship model according to the training statements and the database graph to obtain a trained table relationship model.
[0010] Optionally, in one embodiment of the present application, the step of obtaining training statements, training the preliminarily trained table relationship model according to the training statements and the database graph to obtain a trained table relationship model, and then further comprising: generating a library-table relationship query statement according to the database graph; predicting the library-table relationship query statement according to the trained table relationship model to generate a prediction result; and comparing the prediction result with the expected correct result to obtain an evaluation result.
[0011] Optionally, in one embodiment of the present application, the report requirement is input into the trained table relationship model to obtain an analysis report, which specifically includes: performing semantic analysis on the report requirement to obtain a parsing requirement; inputting the parsing requirement into the trained table relationship model to output a data wide table; collecting wide table data of fields corresponding to the data wide table, and generating an analysis report based on the wide table data.
[0012] Optionally, in one embodiment of the present application, generating an analysis report based on the wide table data specifically includes: performing a matching check on the wide table data to obtain a checked data wide table; and performing report result calculation on the checked data wide table to obtain an analysis report.
[0013] Optionally, in one embodiment of the present application, the verification of the analysis report to generate a verification result specifically includes: performing field matching verification on the analysis report to obtain a first result; performing data magnitude comparison on the analysis report to obtain a second result; if both the first result and the second result meet the requirements, performing data quality verification on the analysis report to generate a verification result.
[0014] The second aspect of the embodiment of the present application further provides a report automatic generation system, wherein the report automatic generation system comprises:
[0015] Graph construction module, used to build database graph;
[0016] A model training module, used to construct a table relationship model, and train the table relationship model according to the database graph to obtain a trained table relationship model;
[0017] A report generation module, used to obtain report requirements and input the report requirements into the trained table relationship model to obtain an analysis report; wherein the report requirements include any one of structured data, semi-structured data and unstructured data;
[0018] The report verification module is used to verify the analysis report and generate a verification result.
[0019] The third aspect of an embodiment of the present application also provides a terminal, wherein the terminal includes: a memory, a processor, and an automatic report generation program stored in the memory and executable on the processor, wherein the automatic report generation program implements the steps of the automatic report generation method as described above when executed by the processor.
[0020] A fourth aspect of an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an automatic report generation program, and when the automatic report generation program is executed by a processor, the steps of the automatic report generation method as described above are implemented.
[0021] Beneficial effects: The present application provides a method, system, terminal and medium for automatic report generation. In the method, any one or more data including structured data, semi-structured data and unstructured data can be automatically generated into required reports according to user needs, thereby reducing manual intervention and supporting dynamic generation of reports according to real-time user needs, thereby improving the efficiency of report generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0023] Figure 1 It is a structural block diagram of the device for automatically generating multimodal reports in this application;
[0024] Figure 2 It is a flow chart of a preferred embodiment of the method for automatically generating application reports;
[0025] Figure 3 It is a flowchart of specific implementation steps of the entire execution process in a preferred embodiment of the automatic generation method of application reports;
[0026] Figure 4 It is a structural diagram of a preferred embodiment of the automatic generation system of application reports;
[0027] Figure 5 This is a structural diagram of a preferred embodiment of the terminal of this application.
[0028] Description of reference numerals:
[0029] 100. Graph construction module; 200. Model training module; 300. Report generation module; 400. Report verification module. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and effect of the present application clearer and more specific, the technical scheme in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. The described embodiments are only possible technical implementations of the present application, not all possible implementations. Based on the embodiments in the present application, those skilled in the art can completely combine the embodiments of the present application to obtain other embodiments without creative work, and these embodiments are also within the scope of protection of the present application.
[0031] In related technologies, in traditional report generation, inflexible data processing, limited flexibility in demand response, and lack of natural language interaction capabilities make it impossible to provide a comprehensive, in-depth, and intuitive data view, thus affecting the effectiveness and accuracy of decision-making.
[0032] First, the following will be combined with the attached Figure 1 , the system architecture of the embodiments of the present application is introduced.
[0033] The present application is a device for automatically generating multimodal reports based on large model technology for implementing a method for automatically generating reports, wherein the device includes an interface module, a cache module, a script execution module, a data verification module, a drawing module and a client component.
[0034] like Figure 1 As shown, the various parts of the device are described:
[0035] Interface module: manages all external interfaces, including: large model API, used to interact with the large model, obtain task scripts and data analysis results; computing resource API, used to dynamically allocate and manage computing resources; data call interface, used to obtain data from databases or other data sources); file call interface, supporting file upload, download and management; result output interface, used to return generated reports, analysis conclusions and charts to users or clients. Data storage module: mainly includes basic data storage and dynamic data cache; including database map storage, algorithm and model storage, historical report data storage, etc., these data are stored in the server's storage device for a long time; mainly caches the status of report generation tasks, temporary cache of raw data collected for reports, etc., uses server memory to create dedicated cache space, and improves the efficiency of data processing and report generation. Task manager: responsible for receiving report generation requests from clients or automated triggers, parsing request content, scheduling corresponding script execution modules, data verification modules and drawing modules, and monitoring the progress and status of the entire report generation process to ensure the smooth completion of tasks. Script execution module: executes various scripts defined by the big model or users, including data collection scripts (grabbing data from various data sources), data format conversion scripts (converting data into the format required for report generation), report generation scripts (generating report templates and logic based on data), etc. Data verification module: after the report generation is completed, automatically execute the data verification process, verify the consistency of the output report with the original data by comparing the data magnitude and auditing the sampled data, and ensure the accuracy of the report. Drawing module: receives the drawing script or chart data returned by the big model, performs customized depiction or further beautification processing, generates high-quality charts, and integrates them with the report content, and finally outputs multimodal reports. Client component: provides a user interaction interface, supports natural language input (such as inputting report requirements through voice or text), requirement document upload (such as Excel templates, JSON configuration files, etc.), result output viewing (displaying the generated multimodal reports and charts), and other functions to enhance the user experience.
[0036] The following describes the automatic report generation method, system, terminal and medium of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the traditional report tools in the above-mentioned related technologies are limited to structured data types when processing data, resulting in low data processing efficiency, the present application provides a method for automatic report generation, in which the required reports can be automatically generated according to user needs for any one or more data including structured data, semi-structured data and unstructured data, thereby reducing manual intervention, supporting dynamic generation of reports according to real-time user needs, and improving the efficiency of report generation. As a result, the technical problem that the traditional report tools in the related technologies are limited to structured data types when processing data, resulting in low data processing efficiency, is solved.
[0037] The automatic report generation method of this application has powerful natural language processing capabilities and complex data reasoning capabilities, and realizes the automatic generation of data fusion reports and multi-modal, multi-channel data report presentation. By embedding large models into the report generation system, it can not only meet the user's needs to dynamically generate reports through natural language input, but also automatically integrate and process multimodal data to generate multi-dimensional, multi-perspective reports including text, images, charts and other forms of expression. This new report generation method not only improves the efficiency and flexibility of report generation, but also greatly enhances the readability and comprehensibility of data, providing more comprehensive, in-depth and real-time data support for corporate decision-making.
[0038] Specific solutions include: natural language interaction, through the interactive capabilities of the big model, allowing users to directly input report requirements through natural language instructions, and the back-end customizes and generates reports based on the requirements, greatly reducing the usage threshold for non-technical users and improving the convenience and efficiency of data analysis; automated report generation, based on the needs input by the user, the big model can automatically generate data wide tables, collect the required data, and output data analysis reports without human intervention, thereby improving the flexibility and timeliness of report generation; multimodal report presentation, the big model supports a variety of data analysis result presentation methods such as charts and texts according to the user's presentation requirements, providing rich, intuitive and easy-to-understand data views to help decision makers deeply understand data from multiple dimensions.
[0039] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0040] The automatic report generation method described in the preferred embodiment of the present application is as follows: Figure 1 As shown, the report automatic generation method includes the following steps:
[0041] In step S101, a database graph is constructed.
[0042] In a possible implementation, a distributed database is obtained; a database traversal is performed on the distributed database to obtain a library table traversal result; a relationship chain between library tables is obtained based on the library table traversal result, and a database graph is constructed based on the relationship chain.
[0043] Specifically, the data source is determined, and the database that needs to be connected is determined through the configured interface parameters; the task manager calls the database traversal script to obtain the full database table name and header information, and caches them to the data storage module. This step is the basis for building a database map; using the reasoning ability of the large model, the relationship chain between the library tables is output according to the traversal results, and a database map is constructed; the map structure is optimized; the drawing module draws the map according to the map script; the optimized map is supplemented with entity type, description, relationship and other information.
[0044] In step S102, a table relationship model is constructed, and the table relationship model is trained according to the database graph to obtain a trained table relationship model.
[0045] In one possible implementation, historical report generation statements and data reports are obtained; the table relationship model is trained according to the database map, the historical report generation statements and the data reports to obtain a preliminarily trained table relationship model; a training statement is obtained, and the preliminarily trained table relationship model is trained according to the training statement and the database map to obtain a trained table relationship model.
[0046] In a possible implementation, a library-table relationship query statement is generated according to the database graph; the library-table relationship query statement is predicted according to the trained table relationship model to generate a prediction result; the prediction result is compared with the expected correct result to obtain an evaluation result.
[0047] Specifically, preliminary preparation includes building a database map, collecting historical report generation statements and data reports, setting up a computing environment, etc.; automated training triggering, automatically starting the training process according to a preset schedule or trigger conditions; manual training and adjustment, experts or users manually compile training samples and push them to the model training tool for training; model evaluation and verification, using the trained model to predict test statements and calculate evaluation indicators; retraining and evaluation, optimizing the model based on the evaluation results, and evaluating it again.
[0048] In step S103, a report requirement is obtained, and the report requirement is input into the trained table relationship model to obtain an analysis report; wherein the report requirement includes any one of structured data, semi-structured data and unstructured data.
[0049] In a possible implementation, semantic analysis is performed on the report requirements to obtain parsing requirements; the parsing requirements are input into the trained table relationship model to output a data wide table; wide table data of fields corresponding to the data wide table are collected, and an analysis report is generated based on the wide table data.
[0050] In a possible implementation, the wide table data is checked for matching to obtain a checked wide table of data; and report result calculation is performed on the checked wide table of data to obtain an analysis report.
[0051] Specifically, the user inputs the report requirements; the task manager performs semantic analysis and splits the requirements; builds an execution plan; obtains the data report wide table generation script fed back by the large model and generates a wide table; collects data from the corresponding fields of the wide table; performs a requirement matching check on the generated data wide table; performs data wide table analysis and report result calculation, and performs multi-modal output according to requirements; outputs the results to the client component or visualization interface, and clears the data cache.
[0052] It should be noted that a wide table is generated in the above steps, but this is only a preliminary wide table structure that may not contain actual data. Then the data is collected and filled into this wide table, making it a complete wide table containing actual data. "Data wide table" refers to a wide table that has been filled with actual data, because this is the only way to perform demand matching verification. Since the step is to verify whether the wide table meets user requirements, the wide table here must be a wide table that already contains actual data.
[0053] In step S104, the analysis report is verified to generate a verification result.
[0054] In one possible implementation, field matching verification is performed on the analysis report to obtain a first result; data magnitude comparison is performed on the analysis report to obtain a second result; if both the first result and the second result meet the requirements, data quality verification is performed on the analysis report to generate a verification result.
[0055] Specifically, field matching verification: extract the report requirement fields and match them with the fields of the wide table generation script. Data magnitude comparison: obtain the total amount of data in the original data table and the wide table, and compare the data magnitude. Data quality verification: perform sampling verification to check the matching degree and data consistency of data fields. Verification result processing: decide whether to continue to execute the subsequent steps of the report data or regenerate the wide table based on the verification results.
[0056] This application can automate the process and reduce manual intervention, significantly improving the efficiency of report generation. This application can enhance flexibility and dynamism: it supports dynamic generation of reports based on real-time user needs to meet data requirements in different scenarios. This application can support multimodal output: the generated reports contain data elements in multiple modalities, improving the readability and comprehensibility of the data. This application can optimize the user experience: through the natural language interactive interface, it lowers the user's usage threshold and improves the user experience.
[0057] It should be noted that visual report preparation and data analysis can be done by operators through visual programming, and wide tables and multi-dimensional reports can be prepared by operators, which can realize dynamic report generation. Its advantage is that operators can dynamically generate reports according to the needs of enterprise supervision, operation report production, etc. The key point is that it supports visual preparation and can be prepared dynamically by humans.
[0058] This application can automatically obtain the model training materials required for report generation and perform model training through a cyclic task mechanism; this application can automatically generate required reports and even reports at any time according to user needs through client components and task managers, without manual intervention in the process; this application's task manager can automatically create report generation tasks according to needs, including sequence execution tasks (report generation steps), cyclic execution tasks (data verification tasks), etc. This application uses the reasoning and generation capabilities of large models to achieve multi-modal description of reports and generation of analysis report files.
[0059] See also Figure 3 , the device execution process is as follows:
[0060] Deploy this device in the operation management system, configure interface parameters, realize the connection between this device and necessary supporting systems or platforms such as large model platform, cloud computing platform, distributed database, etc., and deploy client components on the interactive interface or mobile terminal. After the device is deployed, the task manager starts spontaneously, uses the database traversal script to scan the distributed database, obtains the parameters of each database table, forms a database map, and caches it in the data storage module. The task manager or the user manually uses the large model training tool to perform large model special training on the database map and database table relationship. The system normalization analysis needs to be started regularly or the user submits a data analysis request through the client component. The task manager receives the request and parses it, matches the corresponding prompt through the prompt model, and sends an inference request for the report generation script to the large model. The large model returns the report generation script through the API and pushes it to the script execution module. The script execution module executes the data wide table generation according to the report generation script and caches it in the data storage module. The task manager applies the database map according to the generated wide table, and extracts the report data from the corresponding distributed database data table according to the analysis time parameter of the report generation request, and caches it in the data storage module. The data verification module is started, and the total amount of report request data analyzed by the task manager is compared with the total amount of original data in the data wide table cached in the data module for magnitude comparison; if the data amount is equal, the data verification algorithm is called to perform simple field verification on the cached report data, including: XOR verification, CRC verification, LRC verification, complement code difference verification, to determine whether the sampled single data is consistent with the original collected data. If there is a difference in the data amount, it is re-executed to ensure that the data report generation meets the requirements. After the verification is completed, the task manager performs data analysis on the collected data wide table according to the report generation requirements, generates a report, stores it in the data storage module, and forms a generation log, recording including generation time, demand keywords, report name, etc. The task manager obtains the prompt for report generation according to the report requirements, pushes the requirements and analysis reports to the big model, and the big model performs reasoning and conclusion generation, and returns the report analysis conclusion and multi-modal (charts, portraits, etc.) generation script. The drawing module generates a script based on the multi-modal returned by the big model, executes chart drawing or beautifies the chart returned by the big model. The task manager outputs the final generated data analysis conclusion, chart and analysis report through the client. When the user exits the current build, the task manager will clear the cached data to ensure that there are enough idle resources for the next build.
[0061] The specific implementation of this application is described below in conjunction with a specific application scenario.
[0062] Step K1, database graph construction.
[0063] This application needs to be implemented on the basis of the constructed database graph, and the graph of the target database needs to be clarified, including the covered data range, recognized entity types, database table relationships, etc.
[0064] K11, data source determination: Determine the distributed database to be connected through the configured interface parameters, which may include internal databases of the enterprise, external data providers, public data sets, etc.
[0065] K12, the task manager calls the database traversal script:
[0066] K121, including the use of traversal scripts, adopting a loop traversal method to obtain the full table names of the database, refer to the script: "declare@TablenameList table", and cache the traversal results to the data storage module;
[0067] K122, read the full header, including the body and fields, through loop traversal, refer to the script:
[0068] sql = "Select * From *** (traversal label name)"
[0069] cursor.execute(sql)
[0070] headers=[i[0]forI in cursor.description]
[0071] print(headers)
[0072] K123, forms the library table traversal result through the identified header fields, primary key information, field attributes, etc., and caches it in the data storage module;
[0073] K13, the task manager calls up the relational reasoning prompt and pushes the traversal results to the big model; uses the big model's reasoning ability to identify the subject information, output the relationship chain between the library tables and return the relationship information; creates nodes and relationship chains in the graph based on the identified entities, builds a database graph, and returns the graph script.
[0074] K14, the task manager pushes the library table recognition results and the initially drawn graph to the big model, optimizes the structure of the graph, including the layout of nodes and edges, library table relationships, etc., and outputs the optimized graph script.
[0075] K15, the drawing module draws the map according to the map script and stores it in the data storage module.
[0076] K15, the task manager adds the type, description, relationship and other information of the entity to the optimized graph based on the traversal results of the database table header, and the results are saved in the data storage module.
[0077] K2, large model training.
[0078] According to the system operation requirements, the recurrent neural network (RNN) method is used to take the database map, database table traversal results, database table header list, etc. as training samples to conduct targeted training on the large model selected for docking:
[0079] K21, preliminary preparation.
[0080] K211, extract entity, relationship and attribute information from the database and build a database map. Collect historical report generation statements and their corresponding data reports.
[0081] K212, build the computing environment required for model training, including installing necessary software and libraries (such as TensorFlow, PyTorch, etc.);
[0082] K213, configure the task manager to set the schedule and trigger conditions for regular training tasks;
[0083] K214 integrates model training tools (such as Firefly, InternLM, etc.) and client components.
[0084] K22, automated training trigger.
[0085] K221, the task manager automatically starts the training process according to a preset schedule or trigger conditions;
[0086] K222, loads database graphs, historical report generation statements and data reports from the storage system;
[0087] K223, model training execution.
[0088] K23, manual training and adjustment.
[0089] K231, prepare training statements, experts or users manually prepare complex query statements or specific data patterns as training samples in the client component.
[0090] K232, push and train, pushes manually drawn database maps, table relationships and compiled query statements to the model training tool, executes these additional training data, and further refines the model's reasoning capabilities.
[0091] K233, model adjustment, adjusts the model structure or parameter settings based on the results of manual training to optimize the model's responsiveness to specific queries.
[0092] K24, model evaluation and validation.
[0093] K241, the task manager uses the database graph to randomly generate a series of test database table relationship query statements;
[0094] K242, use the trained RNN model to predict the test sentence and generate the prediction result.
[0095] K243, compares the predicted results with the expected correct results, calculates evaluation indicators such as accuracy, recall, F1 score, etc., analyzes the evaluation results, and identifies which query types the model performs poorly on.
[0096] K25, retraining and evaluation
[0097] K251, diagnose model problems and bottlenecks based on evaluation results and model performance.
[0098] K252, when the model evaluation performance is poor, re-execute steps 1 to 4, retrain the model using the adjusted training strategy, perform the test again and evaluate the model performance to ensure that the optimization measures are effective.
[0099] K3, outputs analysis reports based on natural language.
[0100] K31, users import or input report requirements through the client component;
[0101] K32, after receiving the report requirements input by the user, the task manager performs semantic analysis and splits the input requirements into: report requirements, analysis conclusion requirements, chart requirements, and display method requirements, etc.;
[0102] K33, based on the parsed requirements, the task manager builds a detailed execution plan, including the generation of data query statements, the selection of data analysis algorithms, the drawing of charts and the assembly of reports, which are stored in the data storage module.
[0103] K34, the task manager pushes the report requirements and the call report prompt to the large model, and obtains the data report wide table generation script fed back by the large model; the script execution module generates the script according to the wide table, and generates the wide table in the data storage module;
[0104] K35, the task manager calls the data acquisition script based on the report generation requirements and database map to collect data from the corresponding fields of the wide table;
[0105] K36, after data collection is completed, the data verification module verifies the generated data wide table for demand matching; the verification includes data magnitude verification and sample data field content verification.
[0106] K37, after completing data verification, the task management module calls computing resources to perform data wide table analysis and report result calculation, and caches the results in the data storage module; and performs multi-modal output according to subsequent tasks;
[0107] K371, only the need to output the analysis results is required. The task manager pushes the analysis report to the big model for report conclusion reasoning and outputs the analysis results.
[0108] K372, analysis results and database graph table, the task manager calls the required prompts according to the graph generation requirements, pushes the report to the big model, and the big model feeds back the analysis results and graph generation script; the drawing module draws the graph according to the graph generation script;
[0109] K373, analysis report, the task manager calls the required prompts according to the chart generation requirements, pushes the report to the big model, and the big model feeds back the analysis results and the chart generation script; the drawing module draws the chart according to the chart generation script; the task manager calls the report generation prompts, pushes the report template, report and chart to the big model, and outputs the analysis report.
[0110] K38, the task management module outputs the results of the large model feedback through the client component or visual interface for users to view and download files. Clear the data cache.
[0111] K4, wide table verification and analysis data verification.
[0112] After the wide table is generated, it needs to be verified, including the required magnitude verification and data content verification.
[0113] K41, the data verification module performs field matching verification based on report requirements and wide table field scripts fed back by large models;
[0114] K411, extract report requirement fields, including name, subject attributes, field length, etc.;
[0115] K412, identify the fields of the wide table generation script, including parameters such as field name, subject attributes, and field extent;
[0116] K413, performs verification through one-to-one matching and outputs the verification result;
[0117] K42, the data verification module identifies the data analysis time range according to the report requirements; obtains the total data volume from the original data table through the data query statement; queries the total data volume of the wide table data through the same data query statement to compare the data volume; when the total data volume error is ≤5 (when the data volume is large, it can be relaxed to 1%), the data volume verification is considered to have passed;
[0118] K43, after the data volume verification is passed, data quality verification is performed by using Python scripts to perform data verification, including sampling verification of data and field matching (correlation), and whether the data is consistent with the original data;
[0119] K431, through random sampling 1%, the data of each field of the collected data entry is compared with the corresponding header field and subject attribute, such as the product name field, whether the collected field meets the characteristics of the product name, if it meets the characteristics, the feature verification counter record +1;
[0120] K432, through random sampling 1%, with the data unique identifier (subject ID), query in the system original table through SQL query statement, and compare the field query results; if the matching result is a one-to-one comparison, the accuracy check counter record is +1;
[0121] K433, if feature counter result / sampling data volume*100%>99%, and accuracy check counter result / sampling data volume*100%=100%, then the check is judged to be passed; otherwise, the check result ratio is output.
[0122] K44, if the verification passes, the subsequent steps of the report data will continue to be executed. If the verification fails, the report output will be terminated and the verification result will be returned. If it is an automatic report generation, the steps K32-K36 of the report output will be re-executed to re-output the wide table.
[0123] Next, the automatic report generation system proposed in accordance with the embodiment of the present application is described with reference to the accompanying drawings.
[0124] Figure 4 It is a block diagram of the automatic report generation system of an embodiment of the present application.
[0125] like Figure 4 As shown, the automatic report generation system includes: a graph construction module 100, a model training module 200, a report generation module 300 and a report verification module 400.
[0126] Specifically, the graph construction module 100 is used to construct a database graph;
[0127] A model training module 200 is used to construct a table relationship model and train the table relationship model according to the database graph to obtain a trained table relationship model;
[0128] The report generation module 300 is used to obtain report requirements and input the report requirements into the trained table relationship model to obtain an analysis report; wherein the report requirements include any one of structured data, semi-structured data and unstructured data;
[0129] The report verification module 400 is used to verify the analysis report and generate a verification result.
[0130] Figure 5 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. The terminal may include:
[0131] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0132] When the processor 502 executes the program, the report automatic generation method provided in the above embodiment is implemented.
[0133] Furthermore, the terminal further includes:
[0134] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0135] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0136] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0137] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EIS) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0138] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0139] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0140] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for automatically generating a report is implemented.
[0141] One embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the present application Figure 1 The report automatic generation method provided by any embodiment in the corresponding embodiment.
[0142] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0143] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0144] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0145] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or N wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.
[0146] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0147] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0148] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0149] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
[0150] It should be understood that the application of the present application is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to this application.
[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for automatically generating a report, characterized in that: The automatic report generation method comprises: Build a database map; Constructing a table relationship model, and training the table relationship model according to the database graph to obtain a trained table relationship model; Obtaining report requirements, and inputting the report requirements into the trained table relationship model to obtain an analysis report; wherein the report requirements include any one of structured data, semi-structured data and unstructured data; The analysis report is verified to generate a verification result.
2. The method for automatically generating a report according to claim 1, characterized in that: The construction of the database map specifically includes: Get a distributed database; Performing database traversal on the distributed database to obtain database table traversal results; According to the library table traversal result, the relationship chain between the library tables is obtained, and the database map is constructed according to the relationship chain.
3. The method for automatically generating a report according to claim 1, characterized in that: The step of training the table relationship model according to the database graph to obtain a trained table relationship model specifically includes: Get historical report generation statements and data reports; The table relationship model is trained according to the database map, the historical report generation statement and the data report to obtain a preliminarily trained table relationship model; A training statement is obtained, and the preliminarily trained table relationship model is trained according to the training statement and the database graph to obtain a trained table relationship model.
4. The method for automatically generating a report according to claim 3, characterized in that: The step of obtaining a training statement, training the preliminarily trained table relationship model according to the training statement and the database graph to obtain a trained table relationship model, further includes: Generate a database table relationship query statement according to the database graph; Predicting the library-table relationship query statement according to the trained table relationship model to generate a prediction result; The predicted result is compared with the expected correct result to obtain an evaluation result.
5. The method for automatically generating a report according to claim 1, characterized in that: Inputting the report requirement into the trained table relationship model to obtain an analysis report specifically includes: Performing semantic analysis on the report requirements to obtain analytical requirements; Input the analysis requirements into the trained table relationship model and output a data wide table; The wide table data of the corresponding fields of the data wide table are collected, and an analysis report is generated according to the wide table data.
6. The method for automatically generating a report according to claim 5, characterized in that: Generating an analysis report according to the wide table data specifically includes: Performing a matching check on the wide table data to obtain a checked data wide table; The report result calculation is performed on the verified data wide table to obtain an analysis report.
7. The method for automatically generating a report according to any one of claims 1 to 6, characterized in that: The verifying the analysis report and generating a verification result specifically includes: Performing field matching verification on the analysis report to obtain a first result; Performing a data magnitude comparison on the analysis report to obtain a second result; If both the first result and the second result meet the requirements, data quality verification is performed on the analysis report to generate a verification result.
8. A report automatic generation system, characterized in that: The automatic report generation system comprises: Graph construction module, used to build database graph; A model training module, used to construct a table relationship model, and train the table relationship model according to the database graph to obtain a trained table relationship model; A report generation module, used to obtain report requirements and input the report requirements into the trained table relationship model to obtain an analysis report; wherein the report requirements include any one of structured data, semi-structured data and unstructured data; The report verification module is used to verify the analysis report and generate a verification result.
9. A terminal, characterized in that: The terminal comprises: a memory, a processor, and an automatic report generation program stored in the memory and executable on the processor. When the automatic report generation program is executed by the processor, the steps of the automatic report generation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an automatic report generation program, and when the automatic report generation program is executed by a processor, the steps of the automatic report generation method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method and device for acquiring risk control analysis report
CN121073639A