An intelligent report generation method and system based on template recognition and AI backfilling
Patent Information
- Application Number
- CN202611024953.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-07-10
AI Technical Summary
[0004]针对上述相关技术,人工填写耗时耗力、易录入错误,固定模板自动化方式灵活性不足,难以适配复杂与自定义Excel报表的自动数据填写,尚有改善的空间
1.解决了报表人工填写耗时耗力且易录入错误的问题,达成了适配复杂与自定义报表的自动数据填写功能;
Smart Images

Figure CN122528861B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and in particular to an intelligent report generation method and system based on template recognition and AI backfilling. Background Technology
[0002] In the context of digital management and decision analysis in higher education, universities and education management departments frequently need to compile and submit various statistical, planning, and reporting reports. These reports often use Excel templates, featuring fixed layouts, custom headers, multiple indicators, and specific dimensions such as university and year. In practice, they exhibit diverse formats, rich header levels, flexible cell combinations, and differences in indicator naming.
[0003] Currently, report completion mainly relies on manual line-by-line input, combined with automatic filling by a fixed template program. The manual method requires staff to search, verify, and fill in the corresponding positions in Excel by referring to the data source; the fixed template program fills in data for reports with a fixed structure by pre-setting row, column, and field matching relationships.
[0004] Regarding the aforementioned technologies, manual data entry is time-consuming, labor-intensive, and prone to errors. The fixed template-based automation method lacks flexibility and is difficult to adapt to the automatic data entry of complex and customized Excel reports, leaving room for improvement. Summary of the Invention
[0005] To improve the automatic adaptation capability of reports, this invention provides an intelligent report generation method and system based on template recognition and AI backfilling.
[0006] In a first aspect, the present invention provides an intelligent report generation method based on template recognition and AI backfilling, employing the following technical solution: A method for generating intelligent reports based on template recognition and AI-based backfilling includes: Step 1: Obtain the blank template file uploaded by the user; Step 2: Perform visual layout analysis on the blank template file to identify the table row and column layout; Step 3: Divide the table row and column layout into a header area and the corresponding area to be filled. Step 4: Establish the row and column correspondence between the header area and the corresponding area to be filled; Step 5: Extract the text fields from the blank template file according to the header area; Step 6: Input the text field into the preset natural language understanding model to identify entity information; Step 7: Construct the entity information into query parameters, call the preset data query interface, and query the indicator data that matches the query parameters; Step 8: Based on the row-column correspondence and entity information, locate the cells to be filled in the area to be filled, corresponding to the indicator data; Step 9: Fill the corresponding cells with the indicator data to update the blank template file to the filled file and output it.
[0007] By adopting the above technical solution, a blank template file is obtained, and the table row and column layout is obtained through visual layout analysis. The header area and the area to be filled are divided and the row and column correspondence is established. After extracting the text fields, the natural language understanding model is used to identify entity information, the query parameters are assembled, and the indicator data is obtained through the data query interface. The cells to be filled are located according to the correspondence, the data is filled in, and the filled file is generated and output. This solves the problem that manual filling of reports is time-consuming, labor-intensive, and prone to errors, and achieves the automatic data filling function that adapts to complex and customized reports.
[0008] Optional, also includes: Step 70: If the data query interface returns a preset query failure signal, call the natural language understanding model to perform semantic analysis on the entity information to obtain the indicator category. The indicator category includes statistical category and formula transformation category. Step 71: If the indicator category is a statistical category, call the data query interface to query the individual indicator data that matches the query parameters corresponding to the entity information; Step 72: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the statistical method corresponding to the entity information; Step 73: Analyze the individual indicator data using statistical methods to obtain the overall indicator data; Step 74: Fill the overall indicator data into the corresponding cells to be filled.
[0009] By adopting the above technical solution, when the natural language understanding model determines that the indicator category is a statistical category after a query failure signal is returned, it first queries the individual indicator data, identifies the corresponding statistical method, calculates the overall indicator data, and completes the cell filling, thus solving the problem that the corresponding indicator data cannot be directly retrieved when the entity information is a statistical category.
[0010] Optionally, it also includes a processing method for if the indicator category is a formula transformation category, the method including: Step 700: Call the data query interface to query individual indicator data that match the query parameters corresponding to the entity information; Step 701: Call the natural language understanding model to find the conversion formula corresponding to the entity information; Step 702: Extract the required raw data from the individual indicator data according to the transformation formula; Step 703: Substitute the original data into the conversion formula to calculate and obtain the conversion index data; Step 704: Fill the conversion index data into the corresponding cells to be filled.
[0011] By adopting the above technical solution, when the indicator category is a formula conversion category, the data query interface is called to obtain individual indicator data, the conversion formula is found through the natural language understanding model, the original data is extracted based on the conversion formula, the converted indicator data is calculated and then filled into the cell to be filled, which solves the problem that the corresponding indicator data cannot be directly retrieved when the entity information is a formula conversion category.
[0012] Optionally, it also includes a handling method for situations where the indicator category is neither a statistical category nor a formula transformation category, the method including: Step 7000: Call the natural language understanding model to perform semantic similarity matching between entity information and a preset standard entity library to generate candidate entity information; Step 7001: Output the candidate entity information and the preset user selection signal; Step 7002: When the candidate entity information selected by the user is received, the candidate entity information selected by the user is defined as the target entity information; Step 7003: Construct the target entity information into target query parameters, call the preset data query interface, and query the target indicator data that matches the target query parameters; Step 7004: Fill the target indicator data into the corresponding cells to be filled.
[0013] By adopting the above technical solution, when the indicator is neither a statistical category nor a formula transformation category, candidate entity information is generated by matching the standard entity library through a natural language understanding model, and the candidate entity information and user selection signal are output. The selected content determines the target entity information, the target query parameters are constructed, the target indicator data is retrieved and filled into the cell to be filled, which solves the problem that the entity information can be identified but the data cannot be directly queried, and achieves the effect of correcting the entity information by using semantic matching and user confirmation.
[0014] Optionally, methods for constructing target entity information into target query parameters, calling a preset data query interface, and querying target indicator data that matches the target query parameters include: Step 70030: If the data query interface returns a query failure signal, filter out the error-free entity information that did not return a query failure signal based on the entity information and the target entity information; Step 70031: Check for logical conflicts between the target entity information and the error-free entity information according to the preset verification rules; Step 70032: If no logical conflict exists, output a preset general exception signal; Step 70033: If a logical conflict exists, output the table area corresponding to the logical conflict and the target entity information, as well as the preset information anomaly signal.
[0015] By adopting the above technical solution, after failing to query the target indicator data, the system filters out the error-free entity information and checks for logical conflicts according to the verification rules. If there is no logical conflict, a general abnormal signal is output. If there is a logical conflict, the system outputs the logical conflict, the corresponding table area, and the information abnormal signal. This achieves the effect of detecting logical conflicts between the target entity information and the error-free entity information to determine the cause of failure.
[0016] Optional, also includes: Step 90: Count the number of index data that match the query parameters; Step 91: If the number of data points is greater than 1 and the indicator data is a preset numerical data, define the indicator data with a number of data points greater than 1 as optional data. Step 92: Perform dimensional analysis on the query parameters to determine the statistical dimensions of the query parameters; Step 93: Retrieve the indicator data in the statistical dimensions based on the query parameters through the data query interface to construct a reference dataset; Step 94: Calculate the overall mean by performing a mean calculation on the reference dataset; Step 95: Calculate the data difference between the optional data and the overall mean separately; Step 96: Filter out the optional data with the smallest data difference and query the timestamp of the optional data with the smallest data difference from the data query interface; Step 97: Analyze the query data to obtain the required time range; Step 98: If the timestamp falls within the required time range, fill the corresponding cell with the optional data that has the smallest data difference.
[0017] By adopting the above technical solution, the number of statistical indicator data is counted. When the number of data is greater than 1 and is numerical data, the optional data is determined. The statistical dimensions are parsed, a reference dataset is constructed and the overall mean is calculated. The data difference of the optional data is calculated, and the optional data with the smallest difference is selected and the timestamp is obtained. If the timestamp falls within the required time range, it is filled into the cell to be filled. This solves the problem of difficulty in determining the final data when there are multiple indicator data and constructs a filtering process of overall mean judgment and timestamp verification.
[0018] Optionally, it also includes a handling method if the timestamp does not fall within the required time range, the method including: Step 980: Sort the optional data from smallest to largest according to the data differences to obtain the optional order; Step 981: Query the optional timestamps of the optional data from the data query interface; Step 982: Determine whether the optional timestamps of the optional data fall within the required time range in the order of availability; Step 983: If the selectable timestamp falls within the required time range, output the corresponding selectable data and the preset data confirmation signal; Step 984: If none of the selectable timestamps fall within the required time range, output a preset information error signal; Step 985: When the user confirms the data, fill the confirmation data into the corresponding cell to be filled.
[0019] By adopting the above technical solution, when the timestamp does not fall within the required time range, the optional data is sorted according to the data difference, the optional timestamps are obtained and verified one by one; if they match, the optional data and data confirmation signal are output; if none of them meet the requirements, an information error signal is output. After receiving the confirmation data, it is filled into the cell to be filled. This solves the problem of difficulty in determining the final indicator data and achieves the effect of verifying the timestamps of other optional data in the order of data difference and handing over the data with matching timestamps to the user for verification.
[0020] Optionally, it also includes a method for filtering individual indicator data, which includes: Step 710: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the corresponding constraints of the entity information; Step 711: Extract the association key from the individual indicator data, and query the preset association data table according to the association key to obtain the individual attribute data corresponding to each individual indicator data; Step 712: If the individual attribute data does not meet the limiting conditions, the corresponding individual indicator data will be removed; Step 713: If the individual attribute data meets the limiting conditions, output the corresponding individual indicator data.
[0021] By adopting the above technical solution, a natural language understanding model is used to parse entity information to obtain limiting conditions, extract association keys, and query the associated data table to obtain individual attribute data. Individual indicator data that do not meet the limiting conditions are removed, and individual indicator data that meet the conditions are output. This solves the problem that there may be interfering data in the individual indicator data, which may lead to inaccurate final statistical data, and achieves accurate screening of individual indicator data.
[0022] Optionally, it also includes a method for validating the indicator data, which includes: Step 75: Define the indicator data, overall indicator data, and conversion indicator data as data to be populated; Step 76: Analyze the entity information to obtain the required data type of the cell to be filled, and analyze the data to be filled to obtain the data type to be filled; Step 77: If the required data type matches the data type to be filled, then output the data to be filled; Step 78: If the required data type and the data type to be filled do not match, the natural language understanding model is invoked to generate the corresponding conversion rules based on the required data type and the data type to be filled. Step 79: Based on the conversion rules, convert the data type of the data to be populated into the required data type to obtain the final indicator data and output it.
[0023] By adopting the above technical solution, the required data type and the data type to be filled are obtained by parsing. When the two data types match, the data to be filled is directly output. If the types do not match, a conversion rule is generated by a natural language understanding model. Based on the conversion rule, the final indicator data is generated and output, thus solving the problem of mismatch between the required data type and the data type to be filled.
[0024] Secondly, this invention provides an intelligent report generation system based on template recognition and AI backfilling, employing the following technical solution: An intelligent report generation system based on template recognition and AI-based backfilling includes: The retrieval module is used to retrieve blank template files; The memory is used to store the program for the intelligent report generation method based on template recognition and AI backfilling as described above; The processor loads and executes programs from memory.
[0025] In summary, the present invention has at least one of the following beneficial technical effects: 1. It solves the problems of time-consuming, labor-intensive, and error-prone manual report filling, and achieves automatic data filling function that adapts to complex and customized reports; 2. It solves the problem of difficulty in determining the final data when there are multiple indicator data, and builds a screening process for overall mean judgment and timestamp verification. Attached Figure Description
[0026] Figure 1 This is a flowchart of an intelligent report generation method based on template recognition and AI backfilling in an embodiment of this application; Figure 2 This is a flowchart of the method for selecting and filling multiple optional data in the embodiments of this application. Detailed Implementation
[0027] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0028] This invention discloses an intelligent report generation method based on template recognition and AI-based backfilling. (Refer to...) Figure 1A method for generating intelligent reports based on template recognition and AI backfilling includes: Step 1: Obtain the blank template file uploaded by the user.
[0029] A blank template file is an Excel file that has not yet been filled with specific indicator data. It contains titles for the data items that the user wants to query (such as indicator name, university name, and year), and the data cells corresponding to the titles are blank, waiting to be automatically filled later. This file is selected and uploaded by the user from their local machine to the system through the front-end interface provided by the system (such as the "upload" button on the webpage), and then received by the system.
[0030] Step 2: Perform visual layout analysis on the blank template file to identify the table row and column layout.
[0031] Table row and column layout refers to the overall structural information of a table in an Excel file, including the total number of rows and columns, the number of rows and columns occupied by the header, the row and column range of the data area, and the hierarchical relationships between rows and columns. The system reads the worksheet of the Excel file, traverses each cell in the used area, and obtains the content, border style, and merged cell information of each cell. A contiguous rectangular area containing all cells with content is defined as the table range; consecutive rows with text content are defined as the header area; and the blank cell area corresponding to the header area is defined as the area to be filled; two or more consecutive blank rows are considered table boundaries, used to separate different tables. From this, the total number of rows and columns, the header position, and the data area range of the table are obtained, i.e., the table row and column layout.
[0032] Step 3: Divide the table row and column layout into the header area and the corresponding area to be filled.
[0033] The header area refers to the collection of cells in a table that describe the meaning of the data. The cell content consists of text field names, such as "Indicator Name," "University Name," and "Year." Based on the table's row and column layout, one or more rows of cells containing descriptive text but without specific data values are designated as the header area.
[0034] The area to be filled refers to the set of blank cells in the table that correspond to the header area and require the input of specific indicator data. Each cell in this area corresponds to a specific column or row in the header area. Based on the table's row and column layout, the data rows and columns immediately below (or to the right of) the header area are divided into the area to be filled. The starting position of this area is determined by the boundary of the header area, and the ending position is determined by the overall range of the table or the end position of consecutive data rows.
[0035] Step 4: Establish the row and column correspondence between the header area and the corresponding area to be filled.
[0036] Row-column correspondence refers to the positional mapping between each cell in the header area and the cells in the area to be filled. For example, column 1 of the header area corresponds to column 1 of the area to be filled, row 2 of the header area corresponds to row 2 of the area to be filled, and so on. A one-to-one correspondence is established between the column indices of the header area and the column indices of the area to be filled; a one-to-one correspondence is also established between the row indices of the header area and the row indices of the area to be filled; when merged cells exist in the header area, the multiple columns or rows covered by the merged cells are mapped to the corresponding columns or rows in the area to be filled, thus establishing the row-column correspondence between the header area and the corresponding area to be filled.
[0037] Step 5: Extract the text fields from the blank template file according to the header area.
[0038] Text fields refer to the raw text content extracted from the cells of the header area, typically descriptive information such as indicator names, university names, years, or subject names. By sequentially reading the text content of each cell in the header area according to its row and column range, and then organizing the read text into a text field sequence based on its position in the table, the text fields can be obtained using the method described above.
[0039] Step 6: Input the text field into the preset natural language understanding model to identify entity information.
[0040] Natural Language Understanding (NLE) models are computer models trained using deep learning techniques that can understand the meaning of human language text. Internally, the model establishes multiple mapping relationships from input text to output results through training. These include: mapping text to semantic vectors; mapping semantic vectors to entity types (such as indicator names, university names, and years); mapping keywords in indicator names to statistical methods (such as "number of projects" to counting, "total amount" to summation, and "average" to mean); mapping keywords in indicator names to conversion formulas (such as "age" to the current year minus the birth year, and "year-on-year growth rate" to the difference between the current period's value and the same period last year divided by the previous year's value); mapping input text to semantic similarity scores from a pre-defined standard entity library; and mapping combinations of source and target data types to conversion rules (such as mapping scores from 0 to 100 to excellent, good, and satisfactory levels). The model employs a pre-training and fine-tuning approach: it loads a publicly available pre-trained language model (such as DeepSeek-R1 based on the Transformer architecture) and uses at least 100,000 labeled data points collected from university development planning reports, education department indicator directories, and university website data statistics tables for supervised fine-tuning training. The training data is labeled in the format of "text content, entity type, entity value, statistical method, conversion formula," with a labeling consistency requirement of over 95%. Internally, the model establishes mapping relationships through the labeling patterns in the training data: for example, labeling "number of items" as "count," "total amount" as "summation," and "age" as the age calculation formula. The model learns these mapping patterns by studying a large number of such samples. After model output, a validation step is added to check if the output is within a preset range; if it fails, manual input or an error signal is triggered.
[0041] Entity information refers to key information in text fields that has specific business meaning, including but not limited to indicator names (such as "number of National Natural Science Foundation of China projects"), university names (such as "Tsinghua University"), and year information (such as "2024"). The extracted text fields are first used as input and fed into a pre-defined natural language understanding model. The model performs semantic analysis on the text fields, outputs the entity type corresponding to each text field, and then extracts the corresponding entity value from the text fields. Entity information consists of entity type and entity value.
[0042] If the natural language understanding model cannot identify any entity information from the text field or the identified entity information is insufficient to construct valid query parameters (e.g., only the name of the university is identified, but the specific data to be queried cannot be determined), the unrecognized header position and the corresponding reason (e.g., "The header content cannot be recognized" or "The query conditions are incomplete") will be output to the front-end user interface, prompting the user to modify and re-upload.
[0043] Step 7: Construct the entity information into query parameters, call the preset data query interface, and query the indicator data that matches the query parameters.
[0044] Query parameters are structured sets of information that request data from a data query interface. They are typically in key-value pair format, where the key represents the query dimension (such as an indicator, university, or year), and the value represents the specific value corresponding to that dimension. The identified entity information is converted into query parameters according to preset mapping rules. First, the colloquial entity values are converted into standard database field names or standard codes using an entity mapping table. Entity mapping tables are established separately for different entity types, such as indicator name mapping tables, university name mapping tables, and discipline name mapping tables. For "research funding received," it is mapped to the database field "research_funding_income"; for "Tsinghua," it is mapped to the standard university identifier "TsinghuaUniversity" in the database; and for "computer science," it is mapped to "computer_science." Year information is directly transmitted as a numerical value without conversion. The above mapping tables are pre-entered by those skilled in the art when the system is established, and can also be automatically expanded based on user confirmation of history.
[0045] A data query interface refers to the communication endpoint that retrieves indicator data from the system database. The system database is pre-configured by those skilled in the art during system establishment and stores indicator data, university information, and user information. This interface receives query parameters as input and returns indicator data matching the query parameters as output. The data query interface is pre-configured by those skilled in the art; its address (URL or service name) is pre-configured in the system. The interface is called via HTTP or RPC protocols, and the query parameters are encapsulated according to the interface's agreed format (such as JSON) and sent to the interface, awaiting a response.
[0046] Indicator data refers to the numerical or textual results returned by the data query interface that match the query parameters. For example, querying "number of National Natural Science Foundation of China projects in Tsinghua University in 2024" returns "342," which is indicator data. The data query interface retrieves matching records from the system database and returns the search results to the system; the returned data can be a single numerical value, a single text, or a collection of multiple records (such as a detailed list of multiple projects), which constitutes indicator data.
[0047] Step 8: Based on the row-column correspondence and entity information, find the cell to be filled in the area to be filled that corresponds to the indicator data.
[0048] The cell to be filled refers to a specific cell location within the area to be filled, where data needs to be entered. Based on the previously established row-column correspondence and the identified entity information (such as which row the indicator name corresponds to or which column the university name corresponds to), the system calculates the specific cell location in the area where the indicator data should be entered. For example, when "Tsinghua University" in the entity information corresponds to the second column of the header area, the system determines that the second column of the area to be filled is the university data column through the row-column correspondence, and then determines the specific row by combining it with the indicator name, thus locating the unique cell to be filled.
[0049] Step 9: Fill the corresponding cells with the indicator data to update the blank template file to the filled file and output it.
[0050] The "filled file" refers to the complete Excel file obtained after the retrieved indicator data has been filled into the cells to be filled. This file retains the original template's format and style, only filling in the corresponding blank cells with data. Based on the located positions of the cells to be filled, the indicator data is written into the corresponding cells; after all data has been written, the system saves the updated file content as a new Excel file and provides it to the user for download through the front-end interface.
[0051] This also includes: Step 70: If the data query interface returns a preset query failure signal, call the natural language understanding model to perform semantic analysis on the entity information to obtain the indicator category. The indicator category includes statistical category and formula transformation category.
[0052] A query failure signal is a specific signal returned to the system by the data query interface when it is unable to return valid indicator data. It primarily informs the system that the current query failed to retrieve the indicator data required by the user. This signal is pre-set by those skilled in the art and is triggered when the interface returns a status code that is unsuccessful (such as HTTP 404 Not Found, 400 Bad Request) or a business error code (such as "DATA_NOT_FOUND" or "QUERY_FAILED").
[0053] Indicator categories refer to the classification categories obtained after semantic analysis of indicator names, including at least two types: statistical categories and formula transformation categories. The division between statistical and formula transformation categories is based on preset keyword rules. Statistical categories correspond to statistical keywords such as "number," "total," and "average," while formula transformation categories correspond to formula keywords such as "age," "growth rate," and "BMI." Those skilled in the art can also achieve the same classification using hard-coding methods of keyword matching, which constitutes an equivalent implementation of this invention.
[0054] The system takes the indicator names from the entity information as input and calls a natural language understanding model for semantic analysis. The model outputs corresponding category labels based on keywords in the indicator names (such as "number," "total," "average," "age," "growth rate," etc.). For example, when the indicator name contains keywords such as "number" or "quantity," the model outputs "statistical category"; when the indicator name contains keywords such as "age" or "growth rate," the model outputs "formula conversion category."
[0055] Statistical categories refer to the categories of indicators that require statistical operations (such as counting, summing, and averaging) to obtain overall indicator data from individual indicator data. For example, "number of National Natural Science Foundation of China projects" requires counting statistics, "total research funding" requires summing statistics, and "average grades" require averaging statistics.
[0056] Formula conversion category refers to the type of indicator that needs to be calculated from the original data using a preset calculation formula. For example, "age" needs to be calculated by subtracting the date of birth from the current date, and "year-on-year growth rate" needs to be calculated by dividing the difference between the current period's value and the value of the same period last year by the previous year's value.
[0057] Step 71: If the indicator category is a statistical category, call the data query interface to query the individual indicator data that matches the query parameters corresponding to the entity information.
[0058] Individual indicator data refers to raw data records that match the query parameters but have not undergone statistical aggregation. Each individual indicator data record represents an independent entity (such as a research project, a paper, or an award) and contains detailed attribute information about that entity. For example, when querying "number of National Natural Science Foundation of China projects," the individual indicator data is a detailed record of each project (including project name, principal investigator, approved funding amount, etc.). Individual indicator data is obtained by calling a data query interface, using query parameters corresponding to the entity information, and the interface retrieves matching raw records from the database; these raw records are the individual indicator data.
[0059] If the indicator category is statistical, it means that the required indicator data cannot be obtained through direct query. It is necessary to first query the individual detailed data and then obtain the overall result through statistical calculation. Therefore, the data query interface is first called to query the individual indicator data that matches the query parameters corresponding to the entity information, and then the individual indicator data is used for statistical calculation.
[0060] If the indicator category is not a statistical category, please refer to the corresponding steps below for specific processing.
[0061] Step 72: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the statistical method corresponding to the entity information.
[0062] Statistical methods refer to the specific computational methods used when performing statistical calculations on individual indicator data, including but not limited to counting (COUNT), summing (SUM), and averaging (AVG). The statistical methods are obtained by calling a natural language understanding model to perform semantic analysis on the indicator names in entity information, extracting keywords and outputting the corresponding statistical methods. Specifically, this includes, but is not limited to, the following mapping relationships: keywords such as "number," "quantity," "count," "item count," and "item count" correspond to counting (COUNT); keywords such as "total," "sum," "funding," "amount," and "budget" correspond to summing (SUM); and keywords such as "average," "mean," "per capita," and "per" correspond to averaging (AVG).
[0063] Step 73: Analyze the individual indicator data using statistical methods to obtain the overall indicator data.
[0064] Overall indicator data refers to the final numerical result obtained after summarizing and calculating individual indicator data according to a specified statistical method. If the statistical method is "counting", the number of records in the individual indicator data is counted; if the statistical method is "summing", the numerical fields in the individual indicator data are added together; if the statistical method is "averaging", the sum is calculated first and then divided by the number of records. For example, counting individual data for multiple projects yields "342", summing individual data for multiple expenditures yields "5,000,000", and averaging individual data for multiple scores yields "85.5".
[0065] Step 74: Fill the overall indicator data into the corresponding cells to be filled.
[0066] Based on the row-column correspondence and entity information, the target cell position corresponding to the overall indicator data in the area to be filled is obtained; based on the row number and column number of the target cell, the overall indicator data is written into the cell, and the cell is updated from a blank state to a filled state.
[0067] This also includes a method for handling indicators that fall under the formula transformation category. This method includes: Step 700: Call the data query interface to query individual indicator data that match the query parameters corresponding to the entity information.
[0068] Step 701: Call the natural language understanding model to find the conversion formula corresponding to the entity information.
[0069] A transformation formula is a mathematical expression used to calculate target indicator data from raw data. It can be a simple arithmetic operation (such as addition, subtraction, multiplication, and division) or a complex expression containing multiple variables and conditions. The transformation formula is obtained by inputting the indicator name from the entity information into a natural language understanding model. The model then learns the mapping relationship between indicator name keywords and transformation formulas through pre-training, thus finding the corresponding transformation formula for the indicator name in the current entity information. The specific mapping rules include, but are not limited to, the following: When the indicator name contains age, year of birth, or age in years, the conversion formula is the current year minus the birth year, with a month correction; when it contains year-on-year growth rate or year-on-year increase, the conversion formula is (current period value minus the same period last year) divided by the same period last year and then multiplied by 100%. If the same period last year's value is zero, it is determined that it cannot be calculated, and a general abnormal signal is output; when it contains month-on-month growth rate or month-on-month increase, the conversion formula is (current period value minus the previous period value) divided by the previous period's value and then multiplied by 100%. If the previous period's value is zero, it is determined that it cannot be calculated, and a general abnormal signal is output; when it contains BMI or body mass index, the formula is weight divided by the square of height; when it contains per capita or per thousand people, the conversion formula is total divided by the number of people. If the number of people is zero, it is determined that it cannot be calculated, and a general abnormal signal is output. When no keyword is matched, the model outputs the closest formula or a general formula template based on semantic similarity. The definition of the general abnormal signal is explained in subsequent step 70032.
[0070] Step 702: Extract the required raw data from the individual indicator data according to the transformation formula.
[0071] Raw data refers to the basic numerical values or information required for the transformation formula calculation. Based on the variable names needed in the transformation formula, the corresponding field values are extracted from the individual indicator data; these field values constitute the raw data. For example, when the transformation formula is "current year minus birth year," the system extracts the "birth month and year" field from the individual indicator data and then parses the birth year from it.
[0072] Step 703: Substitute the original data into the conversion formula to calculate the conversion index data.
[0073] Transformation index data refers to the numerical value or information obtained after substituting the original data into a transformation formula for calculation. For example, substituting the birth date "May 15, 1990" into the age calculation formula results in "36 years old," which is a transformation index data.
[0074] Step 704: Fill the conversion index data into the corresponding cells to be filled.
[0075] This also includes a handling method for indicators that are neither statistical nor formula transformation categories. This method includes: Step 7000: Call the natural language understanding model to perform semantic similarity matching between entity information and a preset standard entity library to generate candidate entity information.
[0076] If the indicator category is neither a statistical category nor a formula transformation category, it means that entity information (indicator name, university name, year, etc.) can be identified, but the identified information does not contain a clear statistical or formula-based indicator name, or the identified indicator name does not trigger statistical or formula category judgment. This may be because the indicator name is too vague to be classified (such as "scientific research status") or there is a semantic error in the non-indicator fields of the entity information (such as university name). Therefore, semantic similarity matching is performed on the entity information to generate candidate entity information for the user to select and correct.
[0077] The standard entity library stores mappings between non-standard expressions that users may input and the system's standard names. This includes synonym mappings (e.g., "Tsinghua" to "Tsinghua University"), mappings from higher-level concepts to lower-level concepts (e.g., "number of research projects" to a list of specific indicator names), and mappings from incorrect expressions to correct expressions (e.g., "National Natural Science Foundation of China" to "National Natural Science Foundation of China"). The standard entity library is built as follows: standard names are imported from authoritative data sources (e.g., official lists of universities published by the education department, indicator directories from research management departments); synonym mappings are manually entered by the system administrator through the backend management interface; and new mappings are automatically learned and accumulated by recording user confirmation history. These methods can be used individually or in combination.
[0078] Candidate entity information refers to one or more standard entity names that are semantically similar to the text input by the user. Each field in the entity information (such as the indicator name field) is semantically matched against a standard entity database. For each field, one or more standard names with the highest similarity score exceeding a preset threshold are selected as candidate entity information. Different thresholds can be used for different types of entity names, determined by those skilled in the art through experimental testing. For example, the threshold for university names is set to 0.8, and the threshold for indicator names is set to 0.6.
[0079] Step 7001: Output the candidate entity information and the preset user selection signal.
[0080] A user selection signal is an interactive prompt signal that requests the user to confirm or select candidate entity information. After candidate entity information is generated, these candidate options are displayed to the user through a front-end interface (such as a webpage or application interface), and a signal requesting the user to select is output at the same time. The system waits for the user's feedback until the user makes a selection or cancels the operation. This signal can be presented in the form of a dialog box, drop-down list, or button option.
[0081] Step 7002: When the candidate entity information selected by the user is received, the candidate entity information selected by the user is defined as the target entity information.
[0082] When the candidate entity information selected by the user is received, it means that the candidate entity information selected by the user on the interface has been received, and it is defined as the target entity information for subsequent searching.
[0083] Step 7003: Construct the target entity information into target query parameters, call the preset data query interface, and query the target indicator data that matches the target query parameters.
[0084] Target query parameters refer to the query parameters reconstructed from the target entity information. The method for obtaining target query parameters is the same as that for obtaining query parameters in step 7.
[0085] Target indicator data refers to the indicator data returned after re-calling the data query interface using the target query parameters. The method for obtaining target indicator data is the same as that for indicator data in step 7. Since the target entity information is a modification of the entity information (e.g., modifying "number of National Natural Science Foundation of China projects" to "number of projects funded by the National Natural Science Foundation of China"), the target indicator data should be valid data that can be successfully queried.
[0086] Step 7004: Fill the target indicator data into the corresponding cells to be filled.
[0087] The methods for constructing target entity information into target query parameters, calling a preset data query interface, and querying target indicator data that matches the target query parameters include: Step 70030: If the data query interface returns a query failure signal, filter out the error-free entity information that did not return a query failure signal based on the entity information and the target entity information.
[0088] Error-free entity information refers to entity information fields that did not trigger a query failure signal. Each field in the entity information (such as indicator name, university name, and year) is compared with the target entity information. After excluding the fields corresponding to the target entity information, for each remaining field, it is checked whether that field triggered a query failure signal during a previous query. If a field did not trigger a query failure signal (i.e., a query using that field successfully returned a result), then that field is defined as error-free entity information.
[0089] Step 70031: Check for logical conflicts between the target entity information and the error-free entity information according to the preset verification rules.
[0090] Validation rules refer to a set of judgment conditions used to determine whether there are logical contradictions between fields in entity information. These include, but are not limited to, one or more of the following: time range rules, subject association rules, numerical logic rules, and existence rules. Time range rules are used to check whether the year is within a valid range; subject association rules are used to check whether there is a relationship between the university and the indicator (e.g., whether a university has the corresponding discipline or platform); numerical logic rules are used to check whether the values satisfy a preset size relationship (e.g., the total is not less than the sum of its components); existence rules are used to check whether the field value exists in the system database (e.g., whether the university name is in the national university directory). Validation rules are preset by those skilled in the art; the establishment of time range rules involves pre-setting a valid year range for each indicator (e.g., the valid years for an indicator are 2015 to 2025) and pre-setting the establishment year for each university; the establishment of subject association rules involves maintaining a table of relationships between universities and indicators, recording which indicators each university can query; the establishment of numerical logic rules involves pre-setting a logical relationship template between values (e.g., "A≥B", "A≤100%", etc.); the establishment of existence rules involves comparing the field values in the entity information with the standard values in the system database.
[0091] Logical conflict refers to a relationship between target entity information and correct entity information that violates the verification rules, including but not limited to time conflict, subject conflict, numerical logic conflict, and existence conflict. Time conflict occurs when the year in the target entity information exceeds the valid data time range of the corresponding indicator or university in the correct entity information; subject conflict occurs when there is no pre-defined association between the university in the target entity information and the indicator in the correct entity information; numerical logic conflict occurs when there is a violation of a pre-defined logical relationship between the numerical value in the target entity information and the numerical value in the correct entity information; existence conflict occurs when there is no matching item for the field value in the target entity information in the system database. The target entity information and correct entity information are compared item by item according to the pre-defined verification rules. When a field in the target entity information is found to violate a certain verification rule, a logical conflict is determined between that field and the correct entity information. The type of logical conflict is the conflict type corresponding to the violated rule, and the field information involved in the conflict and its position in the table are recorded.
[0092] Step 70032: If no logical conflict exists, output a preset general exception signal.
[0093] A general error signal is a prompt signal output to the front-end user when no logical conflict is detected and no valid data can be obtained. It is preset by those skilled in the art.
[0094] If no logical conflict exists, it means no logical conflict was detected between the target entity information and the correct entity information, triggering a general exception signal. This signal is output to the front-end user interface in text form, prompting the user that the current query cannot return valid results. The specific reason is not a recognizable logical conflict type; it may be that the entity information entered by the user does not exist in the database, or that the data source itself is missing the data. The prompt text may be "Unable to retrieve data, please check if the indicator name, university name, or year in the template is correct," or "No relevant data found, please confirm whether the indicator exists in the data source." The user should check the template content themselves or contact the system administrator to confirm the data source status based on the prompt.
[0095] Step 70033: If a logical conflict exists, output the table area corresponding to the logical conflict and the target entity information, as well as the preset information anomaly signal.
[0096] An information anomaly signal refers to a specific prompt message output when a logical conflict exists between the detected target entity information and the correct entity information. This signal includes the specific conflict type and conflict information, and its format is preset by those skilled in the art. When the system detects a logical conflict, it collects the following information: the type of conflict (e.g., time conflict, subject conflict, numerical logic conflict, or existence conflict), the field names and values involved in the target entity information, and the position of the field in the table area of the blank template file (e.g., row number and column number or cell address). This information is then organized into a preset format anomaly signal and output to the user interface. For example, the information anomaly signal might display: "Time Conflict: The valid years for the indicator 'Number of National Natural Science Foundation Projects' are from 2015 to 2025. The year you entered is 2026, located in row 3, column 2. Please correct and try again."
[0097] If a logical conflict exists, it indicates that the text information entered by the user is incorrect. Therefore, the specific conflict type and conflict information are collected and output to the user interface in the preset format of the information anomaly signal.
[0098] Reference Figure 2 It also includes: Step 90: Count the number of index data that match the query parameters.
[0099] The number of data entries refers to the number of records of indicator data returned by the data query interface after calling the interface with the same query parameters. For example, if the user fills in the entity information as the indicator name "Project Funding Amount", the university name "Tsinghua University", and the year "2024", and since Tsinghua University has multiple National Natural Science Foundation of China projects in 2024, each with its own funding amount, the data query interface will return multiple records of amounts (such as 500,000 yuan, 800,000 yuan, 300,000 yuan, 600,000 yuan, etc.). The total number of these records is the number of data entries, for example, 50.
[0100] Step 91: If the number of data is greater than 1 and the indicator data is a preset numerical data, define the indicator data with a number of data greater than 1 as optional data.
[0101] Numerical data refers to index data represented by numbers and capable of arithmetic operations, pre-set by those skilled in the art. The system checks the data type returned by the data query interface; when the data returned by the interface is of type integer (int), floating-point number (float), or double-precision floating-point number (double) in the programming language, the data is determined to be numerical data.
[0102] If the number of data points is greater than 1 and the indicator data is a preset numerical value, it means that there are multiple matching records. These records need to be filtered. Therefore, indicator data with a number of data points greater than 1 are defined as optional data.
[0103] If the number of data points is greater than 1 and the indicator data is not the preset numerical data, the optional data will be output to the front-end user and the user will be prompted to select.
[0104] If the number of data points is 1, directly fill the corresponding cell with the indicator data.
[0105] If the number of data entries is 0, then "Query failed" will be output to the front-end user.
[0106] Step 92: Perform dimensional analysis on the query parameters to determine the statistical dimensions of the query parameters.
[0107] Statistical dimension refers to the set of conditions that determine the query scope of the reference dataset. Key fields (such as university name, indicator name, discipline name, year, etc.) are extracted from the query parameters, and the conditions used to limit specific individuals are generalized to higher-level conditions, thereby obtaining a statistically significant range of reference data. The generalization method can be flexibly determined according to the field type. For example, university name can be generalized to a group of universities at the same level, indicator name can be generalized to a set of similar indicators, discipline name can be generalized to the same first-level discipline, and year can be generalized to a range of years. The generalization rules are pre-set by those skilled in the art based on the actual application scenario.
[0108] Step 93: Retrieve the indicator data in the statistical dimensions based on the query parameters through the data query interface to construct a reference dataset.
[0109] A reference dataset refers to a set of comparative data belonging to the same statistical dimension as the optional data. The data query interface is called to retrieve all indicator data under that statistical dimension, and the query results are used as the reference dataset. For example, in a project funding query scenario, the query parameter is "Tsinghua University's 2024 project funding amount," and the statistical dimension is "same-level universities' 2024 project funding amount." The query retrieves the 2024 project funding amounts of universities at the same level (such as "Double First-Class" Category A universities), and these amounts are used as the reference dataset.
[0110] Step 94: Calculate the overall mean by performing a mean calculation on the reference dataset.
[0111] The overall mean is the arithmetic mean of all data in a reference dataset. It is calculated by summing all data in the reference dataset and dividing the sum by the number of data points in the reference dataset.
[0112] Step 95: Calculate the data difference between the optional data and the overall mean.
[0113] Data variance refers to the difference between a specific data point in the available data and the overall mean, expressed as the absolute value of the difference. It is calculated by taking the absolute value of the difference between each data point in the available data and the overall mean. For example, in a project amount query scenario, the overall mean is 800,000 yuan, and the available data includes multiple project amounts from Tsinghua University: 500,000 yuan, 800,000 yuan, 300,000 yuan, and 600,000 yuan. The data variances are 300,000 yuan, 0 yuan, 500,000 yuan, and 200,000 yuan, respectively.
[0114] Step 96: Filter out the optional data with the smallest data difference and query the timestamp of the optional data with the smallest data difference from the data query interface.
[0115] A timestamp refers to the record time of a specific piece of data in the database, such as exam date, project initiation date, and data entry date. The system first filters out one or more data entries with the smallest differences from the optional data, and then queries the database for the corresponding timestamp. For example, in a project amount query scenario, the project amount with the smallest data difference is 800,000 yuan (difference is 0 yuan). The system queries the project's initiation date and finds it to be March 15, 2024.
[0116] Step 97: Analyze the query data to obtain the required time range.
[0117] The required time range refers to the time interval within which the user expects the data. Time information is extracted from the query data (i.e., the query conditions in the user's template) to parse out the specific time range. For example, if the user template contains the year "2024", then the required time range is 2024; if the user template uses a relative time "last three years", then the required time range is calculated backward from the current year.
[0118] Step 98: If the timestamp falls within the required time range, fill the corresponding cell with the optional data that has the smallest data difference.
[0119] If the timestamp falls within the required time range, it means that the time of generation of the optional data with the smallest data difference is valid in the time dimension. Therefore, the optional data with the smallest data difference is filled into the corresponding cell to be filled.
[0120] If the timestamp does not fall within the required time range, it means that it is uncertain whether the optional data with the smallest data difference is the corresponding indicator data. Therefore, the optional data with the smallest data difference cannot be filled into the corresponding cell to be filled. For specific processing methods, please refer to the following steps.
[0121] This filtering method is suitable for scenarios involving multiple results and optimal selection based on historical data. When the query parameters contain future tense keywords such as "planning," "budget," "expectation," or "future," the system will not execute this filtering process and will output the message "The current data is forecast data and cannot be automatically filtered. Please select manually."
[0122] This also includes a handling method for when the timestamp does not fall within the required time range, which includes: Step 980: Sort the optional data from smallest to largest according to the data differences to obtain the optional order.
[0123] Optional order refers to the order obtained by arranging optional data in ascending order of data differences.
[0124] Step 981: Query the optional timestamps of optional data from the data query interface.
[0125] Optional timestamps refer to the timestamp corresponding to each piece of data in the optional data. When querying optional data from the data query interface, the timestamp field corresponding to each piece of data is obtained simultaneously. These timestamps are then associated with and stored with the corresponding optional data to form an optional timestamp list.
[0126] Step 982: Determine whether the optional timestamps of the optional data fall within the required time range in the order of optionality.
[0127] Step 983: If the selectable timestamp falls within the required time range, output the corresponding selectable data and the preset data confirmation signal.
[0128] A data confirmation signal is a confirmation message sent to the front-end user after finding selectable data whose timestamp falls within the required time range. The format of this signal is pre-set by those skilled in the art and is output to the front-end user interface in text form. It typically includes the following information: the specific value of the selected selectable data, the corresponding descriptive information (such as "project funding amount of 800,000 yuan"), and confirmation and modification options (such as "confirm" and "modify" buttons).
[0129] If the available timestamp falls within the required time range, it means that an available data range that matches the required time range has been found. However, the specific value still needs to be determined manually. Therefore, the corresponding available data and the preset data confirmation signal are output to the front-end user to prompt the user to confirm or modify.
[0130] Step 984: If none of the selectable timestamps fall within the required time range, output a preset information error signal.
[0131] An information anomaly signal is a message output to the front-end user when all available timestamps do not fall within the required time range. This message is pre-set by those skilled in the art. The signal is output to the front-end user interface in text form, indicating that the current query cannot return results that meet the time requirements. For example, "The timestamps of all candidate data do not meet the required time range (2024). Please check if the time information in the template is correct."
[0132] If none of the selectable timestamps fall within the required time range, it indicates that the time information in the template may be questionable. Therefore, an error signal is output to remind the user that there may be a problem with the current query conditions.
[0133] Step 985: When the user confirms the data, fill the confirmation data into the corresponding cell to be filled.
[0134] Confirmed data refers to the optional data that the user selects to confirm via the front-end interface after receiving a data confirmation signal. After outputting the data confirmation signal, the system waits for user feedback. When the user clicks the "Confirm" button on the interface, the system defines the currently output optional data as the confirmed data. If the user clicks "Modify" or selects another candidate, the system updates the confirmed data according to the user's selection.
[0135] This also includes methods for filtering individual indicator data, which include: Step 710: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the corresponding constraints of the entity information.
[0136] The limiting conditions refer to the constraints that filter individual indicator data. The system calls a natural language understanding model to perform semantic analysis on the indicator names in the entity information and extract the implicit filtering constraints. Specifically, the model determines the limiting conditions based on the keywords in the indicator name. For example, if the keywords are "college entrance examination" and "admission," the corresponding limiting condition is that the grade is equal to the third year of high school. When the indicator name does not directly match the keywords, the model outputs the closest limiting condition based on semantic similarity. For example, when querying "number of school-age children enrolled," the model understands the semantics of "school-age children" and outputs the limiting condition "aged between 6 and 12 years old."
[0137] Step 711: Extract the association key from the individual indicator data, and query the preset association data table according to the association key to obtain the individual attribute data corresponding to each individual indicator data.
[0138] A join key is a field used to establish relationships between different data tables. The join key is pre-set by someone skilled in the art. This pre-defined join key field is extracted from the individual indicator data, and it matches and connects the individual indicator data with the individual attribute data in the related data table. Common join keys include student ID, employee ID, national ID number, and project number.
[0139] A relational data table is a database table that stores individual attribute information. The table records various attribute fields for each individual, such as grade, age, employment status, and gender. Relational data tables are pre-configured by those skilled in the art when the system is built. They are used to perform relational queries with individual indicator data through association keys. A relational data table can be a single database table or a combination of multiple tables.
[0140] Individual attribute data refers to attribute information used to describe the characteristics of an individual. Using the extracted association key, the record corresponding to that association key is queried in a pre-defined association data table. Then, from the queried records, the values of the attribute fields corresponding to the specified conditions are extracted, and these values are used as the individual attribute data.
[0141] Step 712: If the individual attribute data does not meet the limiting conditions, the corresponding individual indicator data will be removed.
[0142] If the individual attribute data does not meet the limiting conditions, it means that the individual indicator data corresponding to the individual attribute data cannot be used for overall statistical calculation. Therefore, the corresponding individual indicator data will be removed and will not participate in subsequent statistical calculations.
[0143] Step 713: If the individual attribute data meets the limiting conditions, output the corresponding individual indicator data.
[0144] If the individual attribute data meets the limiting conditions, it means that the individual indicator data corresponding to the individual attribute data meets the limiting conditions. Therefore, the corresponding individual indicator data can be output and used in subsequent statistical calculations.
[0145] This also includes a method for verifying indicator data, which includes: Step 75: Define the indicator data, overall indicator data, and conversion indicator data as data to be populated.
[0146] Step 76: Analyze the entity information to obtain the required data type of the cell to be filled, and analyze the data to be filled to obtain the data type to be filled.
[0147] The required data type refers to the expected data format category that the cell to be filled will receive. Common data types include numeric (such as integers and floating-point numbers), text (such as strings), date (such as year, month, and day), and boolean (such as true / false). The required data type can be determined in several ways, including: reading the preset format of the template cell (e.g., when the template cell is preset to "text," the required data type is text); inferring the required data type based on the semantic meaning of the indicator name in the entity information (e.g., when the indicator name is "project funding amount," the required data type is numeric); and analyzing the text description in the header area (e.g., when the header says "score (points)," the required data type is numeric).
[0148] The data type to be filled refers to the data format category of the data itself. The data type is determined based on the actual format of the data to be filled. Specifically: check the data type in the programming language; integers or floating-point numbers are numeric, strings are text, and date objects are date. When the data is a string, attempt to convert it to a numeric or date, but the original data type is still recorded as text. Alternatively, the type can be determined based on the data source; for example, if a statistical count result is numeric and the database field type is text, then it is recorded as text.
[0149] Step 77: If the required data type matches the data type to be filled, then output the data to be filled.
[0150] If the required data type and the data type to be filled match, it means that the data to be filled meets the table requirements.
[0151] Step 78: If the required data type and the data type to be filled do not match, the natural language understanding model is invoked to generate the corresponding conversion rules based on the required data type and the data type to be filled.
[0152] A conversion rule refers to a mapping method that converts data to be filled from one data type to another. The required data type and the data type to be filled are input into an internally trained natural language understanding model, which then outputs the corresponding conversion rule based on the conversion mapping relationship between the data types. For example, when the data to be filled is a numerical score from 0 to 100, and the required data type is a text-based grade, the conversion rule is: 90 to 100 points are converted to Excellent, 75 to 89 points to Good, 60 to 74 points to Pass, and below 60 points to Fail.
[0153] If the required data type and the data type to be filled do not match, it means that the data type of the data to be filled needs to be converted to the required data type before it can be filled into the table. Therefore, the corresponding conversion rule should be generated first.
[0154] Step 79: Based on the conversion rules, convert the data type of the data to be populated into the required data type to obtain the final indicator data and output it.
[0155] The final indicator data refers to the indicator data that meets the data type requirements of the cell to be filled. It is obtained by converting the data to be filled by inputting the conversion rules. For example, if the data to be filled is 85 points, the final indicator data is "good".
[0156] Based on the same inventive concept, embodiments of the present invention provide an intelligent report generation system based on template recognition and AI backfilling.
[0157] An intelligent report generation system based on template recognition and AI-based backfilling includes: The retrieval module is used to retrieve blank template files; The memory stores a computer program that can be loaded and executed by the processor to generate an intelligent report based on template recognition and AI backfilling. The processor loads and executes programs from memory.
[0158] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0159] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating intelligent reports based on template recognition and AI backfilling, characterized in that, include: Step 1: Obtain the blank template file uploaded by the user; Step 2: Perform visual layout analysis on the blank template file to identify the table row and column layout; Step 3: Divide the table row and column layout into a header area and the corresponding area to be filled. Step 4: Establish the row and column correspondence between the header area and the corresponding area to be filled; Step 5: Extract the text fields from the blank template file according to the header area; Step 6: Input the text field into the preset natural language understanding model to identify entity information; Step 7: Construct the entity information into query parameters, call the preset data query interface, and query the indicator data that matches the query parameters; Step 8: Based on the row-column correspondence and entity information, locate the cells to be filled in the area to be filled, corresponding to the indicator data; Step 9: Fill the corresponding cells with the indicator data to update the blank template file to the filled file and then output it. This also includes: Step 70: If the data query interface returns a preset query failure signal, call the natural language understanding model to perform semantic analysis on the entity information to obtain the indicator category. The indicator category includes statistical category and formula transformation category. Step 71: If the indicator category is a statistical category, call the data query interface to query the individual indicator data that matches the query parameters corresponding to the entity information; Step 72: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the statistical method corresponding to the entity information; Step 73: Analyze the individual indicator data using statistical methods to obtain the overall indicator data; Step 74: Fill the overall indicator data into the corresponding cells to be filled.
2. The intelligent report generation method based on template recognition and AI backfilling according to claim 1, characterized in that, It also includes a handling method for indicators that fall under the formula transformation category, which includes: Step 700: Call the data query interface to query individual indicator data that match the query parameters corresponding to the entity information; Step 701: Call the natural language understanding model to find the conversion formula corresponding to the entity information; Step 702: Extract the required raw data from the individual indicator data according to the transformation formula; Step 703: Substitute the original data into the conversion formula to calculate and obtain the conversion index data; Step 704: Fill the conversion index data into the corresponding cells to be filled.
3. The intelligent report generation method based on template recognition and AI backfilling according to claim 1, characterized in that, It also includes a handling method for indicators that are neither statistical nor formula transformation categories, which includes: Step 7000: Call the natural language understanding model to perform semantic similarity matching between entity information and a preset standard entity library to generate candidate entity information; Step 7001: Output the candidate entity information and the preset user selection signal; Step 7002: When the candidate entity information selected by the user is received, the candidate entity information selected by the user is defined as the target entity information; Step 7003: Construct the target entity information into target query parameters, call the preset data query interface, and query the target indicator data that matches the target query parameters; Step 7004: Fill the target indicator data into the corresponding cells to be filled.
4. The intelligent report generation method based on template recognition and AI backfilling according to claim 3, characterized in that, The methods for constructing target entity information into target query parameters and calling a preset data query interface to query target indicator data that matches the target query parameters include: Step 70030: If the data query interface returns a query failure signal, filter out the error-free entity information that did not return a query failure signal based on the entity information and the target entity information; Step 70031: Check for logical conflicts between the target entity information and the error-free entity information according to the preset verification rules; Step 70032: If no logical conflict exists, output a preset general exception signal; Step 70033: If a logical conflict exists, output the table area corresponding to the logical conflict and the target entity information, as well as the preset information anomaly signal.
5. The intelligent report generation method based on template recognition and AI backfilling according to claim 1, characterized in that, Also includes: Step 90: Count the number of index data that match the query parameters; Step 91: If the number of data points is greater than 1 and the indicator data is a preset numerical data, define the indicator data with a number of data points greater than 1 as optional data. Step 92: Perform dimensional analysis on the query parameters to determine the statistical dimensions of the query parameters; Step 93: Retrieve the indicator data in the statistical dimensions based on the query parameters through the data query interface to construct a reference dataset; Step 94: Calculate the overall mean by performing a mean calculation on the reference dataset; Step 95: Calculate the data difference between the optional data and the overall mean separately; Step 96: Filter out the optional data with the smallest data difference and query the timestamp of the optional data with the smallest data difference from the data query interface; Step 97: Analyze the query data to obtain the required time range; Step 98: If the timestamp falls within the required time range, fill the corresponding cell with the optional data that has the smallest data difference.
6. The intelligent report generation method based on template recognition and AI backfilling according to claim 5, characterized in that, It also includes a handling method if the timestamp does not fall within the required time range, which includes: Step 980: Sort the optional data from smallest to largest according to the data differences to obtain the optional order; Step 981: Query the optional timestamps of the optional data from the data query interface; Step 982: Determine whether the optional timestamps of the optional data fall within the required time range in the order of availability; Step 983: If the selectable timestamp falls within the required time range, output the corresponding selectable data and the preset data confirmation signal; Step 984: If none of the selectable timestamps fall within the required time range, output a preset information error signal; Step 985: When the user confirms the data, fill the confirmation data into the corresponding cell to be filled.
7. The intelligent report generation method based on template recognition and AI backfilling according to claim 1, characterized in that, It also includes methods for filtering individual indicator data, which include: Step 710: Call the natural language understanding model to perform semantic analysis on the entity information to obtain the corresponding constraints of the entity information; Step 711: Extract the association key from the individual indicator data, and query the preset association data table according to the association key to obtain the individual attribute data corresponding to each individual indicator data; Step 712: If the individual attribute data does not meet the limiting conditions, the corresponding individual indicator data will be removed; Step 713: If the individual attribute data meets the limiting conditions, output the corresponding individual indicator data.
8. The intelligent report generation method based on template recognition and AI backfilling according to claim 1, characterized in that, It also includes methods for validating indicator data, which include: Step 75: Define the indicator data, overall indicator data, and conversion indicator data as data to be populated; Step 76: Analyze the entity information to obtain the required data type of the cell to be filled, and analyze the data to be filled to obtain the data type to be filled; Step 77: If the required data type matches the data type to be filled, then output the data to be filled; Step 78: If the required data type and the data type to be filled do not match, the natural language understanding model is invoked to generate the corresponding conversion rules based on the required data type and the data type to be filled. Step 79: Based on the conversion rules, convert the data type of the data to be populated into the required data type to obtain the final indicator data and output it.
9. An intelligent report generation system based on template recognition and AI backfilling, characterized in that, include: The retrieval module is used to retrieve blank template files; A memory for storing a program of an intelligent report generation method based on template recognition and AI backfilling as described in any one of claims 1 to 8; The processor loads and executes programs from memory.
Citation Information
Patent Citations
Automatic Excel template data backfilling method based on LLM semantic comprehension technology
CN119537411A