Report generation method, device, storage medium, and program product

By automatically creating data content generation functions through pre-trained language models, the limitations of manual template creation and rule writing in existing technologies are overcome, enabling efficient and customized report generation.

CN120045173BActive Publication Date: 2026-03-31ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing report generation technologies have limitations in automation, requiring manual template creation or rule writing, resulting in high costs and low efficiency.

Method used

By using pre-trained language models, data content generation functions can be automatically created. By using user input information, target description objects and data items can be determined, and customized reports can be generated, reducing manual intervention.

Benefits of technology

Significantly improves report generation efficiency, reduces the complexity and error rate of manual operations, and achieves a fully automated report generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045173B_ABST
    Figure CN120045173B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present specification provide a report generation method, device, storage medium and program product. The report generation method comprises: determining, based on user input information, an identification of a target description object to be generated, at least one data item to be displayed in the report to be generated, and API interface calling information related to each data item; for each data item, creating, using a pre-trained language model, a data content generation function with the identification of any description object as an input parameter and encapsulating the API interface calling information related to the data item; creating, using the pre-trained language model, a main function with the identification of any description object as an input parameter, capable of calling each data content generation function to obtain output content, and generating a report based on the output content; and running the main function based on the identification of the target description object to obtain a report for the target description object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer software technology, and more particularly to a report generation method, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] As businesses and organizations increasingly demand data analytics, report generation has become a crucial part of daily operations. Effective report generation helps businesses quickly obtain the information needed for decision-making and improve operational efficiency. However, existing report generation technologies still have limitations in terms of automation.

[0003] Currently, there are two main methods for generating reports: one is based on predefined templates. This method requires manual template creation, which is costly when dealing with diverse reporting needs and constantly changing data. The other common method is based on rules embedded in computer code. This method typically relies on manually written rules to determine how data is extracted and how the report content is organized, requiring manual writing and maintenance of these rules. Summary of the Invention

[0004] In view of the above, this specification provides a report generation method, an electronic device, a computer-readable storage medium, and a computer program product through one or more embodiments.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a report generation method is provided, comprising:

[0007] Based on user input information, the identifier of the target description object to be generated in the report, at least one data item to be displayed in the report to be generated, and API interface call information related to each data item are determined; the API interface call information related to each data item is used to obtain the data content of any description object in that data item;

[0008] For each of the aforementioned data items, a data content generation function is created using a pre-trained language model, taking the identifier of any descriptive object as input parameters and encapsulating API interface call information related to the data item; and,

[0009] A main function is created using the pre-trained language model, which takes the identifier of any described object as input parameter, can call each of the data content generation functions to obtain output content, and generates a report based on the output content;

[0010] The main function is executed based on the identifier of the target description object to obtain a report for the target description object.

[0011] According to a second aspect of the embodiments of this specification, an electronic device is provided, comprising:

[0012] processor;

[0013] Memory used to store processor-executable instructions;

[0014] Wherein, when the processor executes the executable instructions, it is used to implement the method described in the first aspect.

[0015] According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in the first aspect.

[0016] According to a fourth aspect of the embodiments of this specification, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.

[0017] The technical solutions provided in the embodiments of this specification may include the following beneficial effects:

[0018] In the embodiments of this specification, the target description object, the data items to be displayed, and the API interface call information related to these data items can be flexibly determined by user input information. Then, a pre-trained language model is used to automatically create data content generation functions corresponding to each data item and a main function that can call these data content generation functions. Finally, the main function is run based on the identifier of the target description object, which can generate a customized report for the target description object. This avoids the tedious process of manually configuring templates or rules and reduces human intervention. Through intelligent and automated processes, the efficiency of report generation is not only significantly improved, but also the complexity and error rate of manual operation are greatly reduced.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the architecture of a report generation service system provided in an exemplary embodiment.

[0021] Figure 2 This is a flowchart of a report generation method provided in an exemplary embodiment.

[0022] Figure 3 This is a schematic diagram illustrating a report generation implementation process provided in an exemplary embodiment.

[0023] Figure 4 This is an interactive schematic diagram of a reference sample report generation provided in an exemplary embodiment.

[0024] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an exemplary embodiment. Detailed Implementation

[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0026] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0027] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0028] The relevant terms are explained here:

[0029] Pre-trained language models, such as Large Language Models (LLMs), are artificial intelligence models based on deep learning techniques, especially trained using large corpora. They aim to understand and generate text similar to human language, possessing powerful natural language understanding and generation capabilities. The goal of LLMs is to leverage natural language processing capabilities to achieve various applications, such as text generation, translation, summarization, question answering, and dialogue systems, thereby helping to improve the efficiency and automation of human-computer interaction.

[0030] Figure 1 This is a schematic diagram of the architecture of a report generation service system provided in an exemplary embodiment. For example... Figure 1As shown, the system may include a server 11, a network 12, and several user terminals, such as a PC (Personal Computer) 13, a mobile phone 14, etc.

[0031] Server 11 can be a physical server containing a single host, or it can be a virtual server hosted in a host cluster. During operation, server 11 can run server-side programs for report generation applications to provide a corresponding report generation service platform.

[0032] PC13 and mobile phone14 are only some of the types of user terminals that users can use. In reality, users can obviously also use user terminals such as tablets, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smartwatches, etc.), etc., and one or more embodiments in this specification do not limit this. During operation, the user terminal can run a client-side program for the report generation application to provide a client for the report generation service. The client application for the aforementioned report generation service can be launched and run on the user terminal. This client-side program can be a native application installed on the user terminal, or it can be a mini-program, quick app, or other similar form. Of course, when using web technologies such as HTML5, the relevant functions can be implemented through a browser-displayed page. This browser can be a standalone browser application or a browser module embedded in some applications.

[0033] As for the network 12 that enables interaction between user terminals such as PC13 and mobile phone 14 and server 11, communication can be implemented using either wired or wireless networks based on the communication methods supported by the respective user terminals. This specification does not impose any restrictions on this. For example, PC13 can support both wired and wireless communication, so it can use either wired or wireless networks as needed. Mobile phone 14 typically only supports wireless communication, so it can use a wireless network for communication.

[0034] Based on the issues in the relevant technologies, please refer to Figure 2 This specification provides a report generation method, which can be executed by the server 11 described above. The method includes:

[0035] In S201, based on user input information, the identifier of the target description object to be generated, at least one data item to be displayed in the report to be generated, and API interface call information related to each data item are determined; the API interface call information related to each data item is used to obtain the data content of any description object in that data item.

[0036] For example, based on Figure 1 The report generation service system shown allows users to input relevant information through their user terminals, such as information about the target object (e.g., company name, product name), data items to be displayed in the report to be generated, etc. The user terminal can then send the user input information to the server 11. The user input information can be content entered by the user in one go or content entered multiple times, such as information transmitted through multiple rounds of dialogue with the server. This embodiment does not impose any restrictions on this.

[0037] For example, the server can pre-store several API (Application Programming Interface) call information. After determining at least one data item to be displayed in the report to be generated, the server can filter the pre-stored API call information related to each data item. Any API call information can be stored in the form of an API document, which describes detailed information related to the API, including how to call the API, what input parameters are required, and what data is returned.

[0038] For example, API documentation includes basic information about the API interface, basic information about the input parameters, basic information about the returned data, and examples of how to call the API.

[0039] Basic API information includes, but is not limited to: (1) API name: The name or function description of the API. For example, get_company_info indicates an API for obtaining company information. (2) Version information: The version number of the API, ensuring compatibility between the client and the server. (3) Request type: Describes the request method of the API, usually GET (get data), POST (submit data), PUT (update data), DELETE (delete data), etc. (4) API path (URL): The request path of the API, usually included after the base URL, for example: https: / / api.example.com / v1 / get_company_info.

[0040] The basic information of the input parameters includes, but is not limited to: (1) Parameter name: The parameter required for each API request. For example, company_name (company name), company_id (company ID), etc. (2) Type: The type of the parameter, usually string, integer, boolean value, etc. (3) Parameter description: A detailed description of each input parameter to help developers understand the meaning of the parameter and how to fill it in. For example, "company_name: The name of the company, which must be consistent with the name registered in the system." (4) Input example value: Provides example values ​​for the parameter to facilitate understanding how to use it. For example, company_name: "ABC Corp".

[0041] The basic information returned includes, but is not limited to: (1) Returned data structure: The data format returned by the API, usually JSON or XML. The documentation will describe in detail the returned data structure, field names, types, and meanings. (2) Field descriptions: Descriptions of each returned field, including field name, type, and meaning. For example, "company_name: Returns the name of the company; revenue: The company's annual revenue, in ten thousand yuan." (3) Sample response: An example of the returned data to help developers understand the actual returned data format. (4) Error codes and error messages: Descriptions of the error codes that the API may return and their meanings. For example, 404 means the resource could not be found, and 400 means the request parameters are incorrect.

[0042] Examples of calls include: (1) Example requests: showing how to call the API interface, which may include request headers, request bodies, and query parameters. For example, GET / v1 / get_company_info?company_name=ABC%20Corp, or an example of a JSON request body using the POST method. (2) Example responses: showing the possible results returned after calling the interface, helping developers understand how to handle the returned data.

[0043] In S202, for each data item, a data content generation function is created using a pre-trained language model. This function takes the identifier of any descriptive object as input parameter and encapsulates API interface call information related to the data item.

[0044] In this step, each data item and its associated API call information can be input into a pre-trained language model. The pre-trained language model then creates a data content generation function that takes the identifier of any descriptive object as input parameters and encapsulates the API call information related to the data item. Through the pre-trained language model, data content generation functions for each data item can be automatically generated, reducing manual coding and saving development time and manpower costs. The pre-trained language model can understand and process complex data structures, automatically encapsulate API call information, and improve the intelligence level of the data acquisition process.

[0045] It is understood that this embodiment does not impose any restrictions on the specific form of the data content generation function. For example, the data content generation function can be a Python function or a function written in other programming languages.

[0046] In S203, a main function is created using a pre-trained language model. This function takes the identifier of any described object as input parameter, calls various data content generation functions to obtain output content, and generates reports based on the output content.

[0047] In this step, all data items and their corresponding data content generation functions can be input into a pre-trained language model. The pre-trained language model then creates a main function, which takes the identifier of any described object as an input parameter. This main function calls each data content generation function to obtain the output content and uses this output content to generate the final report. The main function combines the various data content generation functions, automatically calls these functions, and summarizes the results, thus automating report generation.

[0048] In S204, the main function is run based on the identifier of the target description object to obtain a report for the target description object.

[0049] In this step, the main function is run based on the identifier of the target description object, which can automatically obtain various data contents of the target description object and complete the fully automated process of report generation. Through the above-mentioned automated operation, the need for manual operation is greatly reduced, and the time and cost required to generate the report are reduced.

[0050] The report generation method provided in this embodiment, through steps S201 to S204, enables a fully automated report generation process. First, the target description object and related data items to be displayed can be flexibly determined based on user input. The server intelligently determines and obtains API interface call information related to these data items, avoiding the tedious process of manually configuring templates or rules. Next, a pre-trained language model is used to automatically create data content generation functions corresponding to each data item, as well as a main function that can call these data content generation functions. Finally, the main function is run based on the identifier of the target description object, generating a customized report for the target description object, reducing manual intervention and improving generation efficiency and flexibility. Overall, this method, through intelligent and automated processes, not only significantly improves the efficiency of report generation but also greatly reduces the complexity and error rate of manual operations.

[0051] In some embodiments, please refer to Figure 3 The data report generation process includes an intent recognition process, a first report generation process, a second report generation process, and a routine response process.

[0052] In the intent recognition process, the server can identify the intent of the user input. Intent recognition is an important task in natural language processing. First, the server parses the user input, including word segmentation, syntactic analysis, and named entity recognition, to extract key information such as the target object mentioned by the user and the desired report generation method. Next, useful features are extracted from the parsed text, and based on these features, the user input is categorized into different intents. Through intent recognition, the server can understand the user's specific needs and determine the expected operation type based on the user's input, thus providing more accurate and customized services.

[0053] For example, user input information can be categorized into any one of three intents, namely, a first intent, a second intent, and a third intent. The first intent instructs the generation of a report with reference to a sample, the second intent instructs the generation of a report without a sample, and the third intent instructs other questions that do not involve generating a report.

[0054] After identifying the first intent, the server enters the first report generation process, where user input typically includes information about the target object and a sample report for reference. After identifying the second intent, the server enters the second report generation process, where user input typically includes information about the target object, such as "provide a report on basic information about Company A". After identifying the third intent, the server enters the regular response process.

[0055] The following is an example illustration of the first report generation process:

[0056] In the first report generation process, user input typically includes information about the target description object and a sample report for reference. Therefore, the server can determine the identifier of the target description object based on the user input and retrieve the sample report. Then, based on the sample report and pre-stored API call information, it determines at least one data item to be displayed in the generated report and the API call information associated with each data item. In this embodiment, by referring to existing sample reports, the server can quickly identify and determine the data items and related API interfaces required for the report, avoiding the lengthy process of generating a report from scratch. Furthermore, by using sample reports and pre-stored API call information, the server can automatically decide which data items to display and their sources, reducing manual intervention and improving automation.

[0057] For example, the server can convert the sample report into a first vector, convert each API call information in a pre-stored set of API call information into a second vector, and then, based on the similarity between the first vector and each second vector, recall multiple candidate API call information from the pre-stored set of API call information. For instance, the API call information can be sorted in descending order of similarity, and then the first n API call information with the highest similarity can be selected as candidate API call information, where n > 0. Alternatively, API call information with a similarity higher than a preset threshold can be identified as candidate API call information; the preset threshold can be set according to the specific application scenario.

[0058] The sample report provides the specific content and structure of the report, while the API call information provides specific data source information related to the data items, including how to obtain the data and the data type. The server can input the sample report and multiple candidate API call information into a pre-trained language model. The pre-trained language model can then use this information to identify at least one data item from the sample report and establish a data item mapping relationship. This mapping relationship includes, but is not limited to, the display position and type of each data item in the sample report, and its related API call information.

[0059] For example, after receiving sample reports and candidate API interface information, the pre-trained language model transforms them into a format suitable for model understanding. For instance, the pre-trained language model decomposes the sample report text into different data segments, identifies the context of each data item, and then infers the type of data item based on the context information in the sample report text; for example, "company name" might be a string, while "establishment date" might be a date format. Furthermore, by analyzing the description of each candidate API interface call information, the model determines the function of each API interface and matches it with the data items in the sample report. For example, if the report contains the data item "company name," the pre-trained language model might match it with an API interface such as `get_company_info`, which returns company name information. Finally, the pre-trained language model establishes a mapping relationship for each data item, clarifying the data item's position, type, and API interface call information in the sample report. Through deep understanding of the sample report and intelligent analysis of API interface descriptions, the pre-trained language model completes the processes of data item identification, type inference, display position determination, and API interface matching, thus providing a foundation for automatic report generation.

[0060] The server can input each data item and its associated API call information into a pre-trained language model, so that the pre-trained language model can create a data content generation function that takes the identifier of any descriptive object as input parameter and encapsulates the API call information associated with the data item.

[0061] In one possible scenario, it's possible that the display format of at least some data items in the sample report may differ from the format of the returned data described in the API call information associated with those data items. This format difference could prevent the API's returned data from being used directly during report generation. Therefore, the server can define data processing logic for the API's returned data based on these differences. This embodiment, by defining corresponding data processing logic, can automatically convert the API's returned data format into the format required in the sample report, thereby ensuring data consistency and accuracy during report generation.

[0062] During the data content generation function generation process, the server can input various data items, related API call information, and potential data processing logic into a pre-trained language model. The pre-trained language model then creates a data content generation function that takes the identifier of any descriptive object as input parameters and encapsulates the API call information related to the data item and the data processing logic for the returned data from the API. This data content generation function can directly output content that meets the report display requirements, reducing the manual work of data format conversion by developers during report generation and improving automation.

[0063] For example, suppose there is a data item "Enterprise Establishment Date" in a sample report with the format "February 10, 2025", and the data format returned by the relevant API interface get_company_info is a date object "2025-02-10T00:00:00Z". Due to the format difference between the two, the date object returned by the API cannot be directly put into the report when generating the report. Therefore, the server needs to solve this problem through the following steps: The server discovers that the data returned by the API is a date object, while the report requires a date in string format. The server can define data processing logic based on the format difference between the two, and convert the date object returned by the API into the format of "YYYY year MM month DD day" (i.e., "February 10, 2025"). The server inputs the data item "Enterprise Establishment Date", the relevant API interface call information, and the data processing logic into the pre-trained language model. The pre-trained language model creates a data content generation function based on this information, and intelligently converts the date format returned by the API into the string format required by the report. In this way, the format difference can be automatically adapted, and the data content generation function can directly output content that meets the report display requirements, significantly improving the flexibility and accuracy of automatically generating reports.

[0064] In some possible implementation manners, after generating the data content generation function, the data content generation function can be verified to improve the stability of the data content generation function. The server can obtain the identifier of the example description object from the sample report included in the user input information, and obtain the reference data content of the example description object in each data item from the sample report. Then, the server runs each data content generation function using the identifier of the example description object to obtain the output content of the data content generation function. If there is an abnormal data content generation function whose output content is inconsistent with the reference data content, the pre-trained language model can be used to modify the abnormal data content generation function based on the difference between the output content and the reference data content of the abnormal data content generation function.

[0065] In this implementation manner, by verifying after generating the data content generation function, the stability and accuracy of the data content generation function can be significantly improved. The server can run the data content generation function based on the identifier of the example description object, and compare its output content with the expected output (i.e., the reference data content) to automatically detect abnormal data content generation functions. If an abnormality is found, the server can analyze the difference between the output content and the reference data content of the abnormal data content generation function through the pre-trained language model, and automatically adjust the abnormal data content generation function to correct potential problems in the generation process. This process can not only enhance the accuracy and reliability of report generation, but also reduce manual intervention and improve the intelligence and automation level of the system.

[0066] For example, assume there is a sample report that contains multiple data items, such as company name, establishment date, number of employees, etc. The reference data content of these 3 data items in the sample report are respectively: (1) Company name: XXX Technology Co., Ltd.; (2) Establishment date: February 10, 2025; (3) Number of employees: 100.

[0067] The server generates 3 data content generation functions corresponding to the enterprise identifier input and the "company name", "establishment date", and "number of employees" respectively. The output content of the data content generation function corresponding to the "company name" is "XXX Technology Co., Ltd.", the output content of the data content generation function corresponding to the "establishment date" is "2025-02-10T00:00:00Z", and the output content of the data content generation function corresponding to the "number of employees" is "100".

[0068] By comparison, it can be seen that the actual output content of the "establishment date" data item is "2025-02-10T00:00:00Z", while the reference data content in the sample report is "February 10, 2025", and the two are inconsistent. The server automatically detects this difference and marks the "establishment date" as an abnormal data item. The server can input the data content generation function corresponding to the "establishment date", the actual output content, and the reference data content into the pre-trained language model, so that the pre-trained language model can modify the data content generation function corresponding to the abnormal data item based on the difference between the output content corresponding to the abnormal data item and the reference data content. For example, encapsulate the data processing logic in the data content generation function to convert the date returned by the API interface into the format of "YYYY year MM month DD day".

[0069] Of course, in addition to format differences, the anomalies of the data content generation function also include: the numerical value returned by the API interface may be in a different unit from that expected in the report, the data returned by the API interface may be incomplete, or the data returned by the API interface may exceed the reasonable range or expected value in the report (for example, exceeding the allowed maximum or minimum value), etc. By validating and correcting the data content generation function, ensure the accuracy and stability of the report generation process.

[0070] Exemplarily, the maximum verification times for the data content generation function corresponding to the same data item can be set. When the verification of the data content generation function corresponding to the same data item passes (the output content of the data content generation function is consistent with the reference data content) or reaches the maximum verification times, the verification is stopped to prevent getting into an infinite loop or excessive resource consumption when encountering unsolvable anomalies, and ensure the efficiency and stability of the report generation process.

[0071] After obtaining the data content generation functions corresponding to each data item, the server can input the sample report, data item mapping relationships, and all data content generation functions into the pre-trained language model to create a main function. This main function includes: taking the identifier of any descriptive object as an input parameter; calling each data content generation function to obtain output content; replacing the reference data content of each data item in the sample report based on its display position and corresponding output content; and outputting the final report. In this embodiment, the pre-trained language model can automatically generate the main function based on the structure of the sample report without manual intervention, greatly improving the speed and efficiency of report generation. The main function can automatically call the data content generation functions and fill the data into the correct positions in the report, automatically completing the report generation. By automatically generating the main function, the workload of manually writing report generation logic can be reduced, making the report generation process more intelligent and efficient.

[0072] Finally, after obtaining the main function output by the pre-trained language model, the server can run the main function based on the identifier of the target description object, thereby obtaining a report for the target description object.

[0073] In one example, please refer to Figure 4 Suppose the user inputs the message "Generate a report for Company A by imitating Company B's sample report" and uploads Company B's sample report. The server determines this as the first intent through intent recognition. Then, following the report generation process described in the first report generation process above, the server generates a report for Company A and displays it to the user.

[0074] The following is an example illustration of the second report generation process:

[0075] In the second report generation process, user input information typically includes relevant information about the target description object. For example, if the user input is "provide a report with basic information about Company A," the server can determine the identifier of the target description object based on the user input information. Based on the user input information and a pre-built knowledge base containing at least several data items, the server can determine at least one data item to be displayed in the report to be generated, and retrieve API call information related to each data item from pre-stored API call information. In this embodiment, when there is no sample report, the server can automatically determine data items based on user input information and a pre-built knowledge base, ensuring that report generation still proceeds smoothly. By utilizing the pre-stored data items in the knowledge base, the server can generate matching report content based on the information provided by the user, ensuring report customization and flexibility.

[0076] For example, the knowledge base can pre-store a specific set of data items corresponding to different types of descriptive objects. For instance, data items for a company-type descriptive object might include: company name, establishment date, number of employees, and company address; data items for a product-type descriptive object might include: product name, product category, launch date, number of units, product description, and manufacturer; and data items for an employee-type descriptive object might include: employee name, position, start date, department, and work location. In practical applications, the server can determine the type of the target descriptive object based on user input information, and then retrieve data items related to the target descriptive object from the knowledge base based on that type.

[0077] For example, user input may also include data items related to the target object being described, and this implementation does not impose any restrictions on this.

[0078] After identifying at least one data item to be displayed in the report to be generated and the API call information associated with each data item, the server can input at least one data item and the API call information associated with each data item into a pre-trained language model, so that the pre-trained language model can create a data content generation function that takes the identifier of any descriptive object as input parameter and encapsulates the API call information associated with the data item.

[0079] In one possible scenario, the knowledge base can pre-store data processing logic for API interface return data corresponding to at least some data items. During the generation of the data content generation function, the server can input each data item, related API interface call information, and data processing logic obtained from the knowledge base into a pre-trained language model. The pre-trained language model then creates a data content generation function that takes the identifier of any descriptive object as input parameters and encapsulates the API interface call information related to the data item and the data processing logic for the API interface return data. This data content generation function can directly output content that meets the report display requirements, reducing the manual work of data format conversion by developers during report generation and improving automation. This embodiment, through pre-stored data processing logic, can automatically handle the conversion of different formats when generating the data content function, avoiding manual intervention and thus improving the efficiency of report generation.

[0080] In another possible scenario, users can also specify the display format of at least some data items in the report to be generated based on their user input. If there is a difference between the display format of the data item described in the user input and the return data format described in the API call information related to that data item, the server can define the data processing logic for the API return data based on this difference. The server can input each data item, the related API call information, and the data processing logic into a pre-trained language model, so that the pre-trained language model can create a data content generation function that takes the identifier of any descriptive object as input parameters and encapsulates the API call information related to the data item and the data processing logic for the API return data. In this embodiment, users no longer need to manually adjust the data display format; the server can automatically complete the conversion according to the predefined format requirements, avoiding the tediousness of manual processing and improving the degree of automation.

[0081] In some possible implementations, after generating the data content generation function, the function can be validated to improve its stability. For example, the knowledge base can pre-store example information corresponding to each type of descriptive object. This example information can include the identifier of the example descriptive object and the reference data content of the example descriptive object in each data item. The server can obtain the identifier of the example descriptive object and the reference data content of the example descriptive object in each data item from the knowledge base, and then run each data content generation function using the identifier of the example descriptive object to obtain the output content of the data content generation function. If there are abnormal data content generation functions whose output content is inconsistent with the reference data content, a pre-trained language model can be used to modify the abnormal data content generation function based on the difference between the output content of the abnormal data content generation function and the reference data content.

[0082] In this implementation, verifying the data content generation function after its generation significantly improves its stability and accuracy. The server can run the data content generation function based on the identifier of the example description object and compare its output with the expected output (i.e., the reference data content), automatically detecting anomalous data content generation functions. If an anomaly is detected, the server can analyze the differences between the output of the anomalous data content generation function and the reference data content using a pre-trained language model and automatically adjust the anomalous data content generation function, thereby correcting potential problems in the generation process. This process not only enhances the accuracy and reliability of report generation but also reduces manual intervention, improving the system's intelligence and automation level.

[0083] After obtaining the data content generation functions corresponding to each data item, the server can input the preset display logic and the data content generation functions corresponding to each data item into a pre-trained language model to create a main function. This main function includes: taking the identifier of any described object as an input parameter, calling each data content generation function to obtain the output content, and generating a report based on the preset display logic for the output content corresponding to each data item. This embodiment can improve the automation level of report generation, reduce manual intervention, and the main function can call the generation functions to obtain the output content based on the identifier of the described object and generate a complete report based on the preset display logic, thus improving the efficiency of report generation.

[0084] Finally, after obtaining the main function output by the pre-trained language model, the server can run the main function based on the identifier of the target description object, thereby obtaining a report for the target description object.

[0085] The following is an example of a standard response process:

[0086] After entering the normal response process, the server can input the user's input information into the pre-trained language model, which will then generate a response based on the user's input and return the response to the user.

[0087] In some embodiments, when displaying a report on a target description object to a user, the user can also edit the report according to their needs. The server can obtain the user's editing information for the report on the target description object, and then input the main function and the user's editing information into a pre-trained language model. The pre-trained language model then modifies the main function based on the user's editing information, ensuring that the format of the report output by the modified main function conforms to the format edited by the user. The modified main function can be saved for later reuse.

[0088] In some embodiments, the generated main function can take the identifier of any described object as an input parameter to generate a report for any described object. Therefore, to improve report generation efficiency, the main function can be reused as a report generation template. After obtaining the main function, the server can also use a pre-trained language model to generate functional description information of the main function, and then store the main function and its functional description information in a template library.

[0089] In subsequent practical applications, the main functions in the template library can be displayed as report generation templates in the user interface for users to select. Functional descriptions of each main function template can also be provided to users to help them understand the function and applicable scope of each main function. The server can then respond to the selection of at least one main function in the template library, reusing the selected main function and the identifier of the user-input description object to generate the report. This embodiment, by storing the main functions as templates, avoids recreating related functions each time a report is generated. The main functions in the template library can be reused in different application scenarios, greatly improving the efficiency of report generation.

[0090] In some embodiments, another report generation method is provided, in which relevant report generation data can be prepared to fine-tune any pre-trained language model to obtain a report generation model. The report generation model can flexibly adjust the generation strategy according to different inputs and requirements to handle more diverse report generation tasks.

[0091] For example, if the primary intent is identified, the input to the report generation model is user input information and several API call information, and the output is a report describing the target object.

[0092] For example, if a second intent is identified, the input to the report generation model is user input information, relevant knowledge obtained from the knowledge base, and several API call information, and the output is a report describing the target object.

[0093] The various technical features in the above embodiments can be combined arbitrarily, as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, the arbitrary combination of various technical features in the above embodiments is also within the scope of this specification.

[0094] In some embodiments, this specification also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor implements the method described in any one of the above embodiments by executing the executable instructions.

[0095] Figure 5 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 5At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, memory 508, and non-volatile memory 510, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 502 reads the corresponding computer program from the non-volatile memory 510 into memory 508 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0096] The report generation device can be applied to, for example Figure 5 The device shown is used to implement the technical solution of this specification. The report generation apparatus may include:

[0097] The information determination module is used to determine, based on user input information, the identifier of the target description object to be generated in the report, at least one data item to be displayed in the report to be generated, and API interface call information related to each data item; the API interface call information related to each data item is used to obtain the data content of any description object in that data item.

[0098] The function creation module is used to create a data content generation function for each of the data items using a pre-trained language model. The function takes the identifier of any descriptive object as an input parameter and encapsulates API interface call information related to the data item.

[0099] The function creation module is also used to create a main function using the pre-trained language model, which takes the identifier of any descriptive object as an input parameter, can call each of the data content generation functions to obtain output content, and generates a report based on the output content.

[0100] The report generation module is used to run the main function based on the identifier of the target description object to obtain a report for the target description object.

[0101] In some embodiments, the information determination module is specifically configured to: perform intent recognition on the user input information; if a first intent is recognized, the first intent instructs the generation of a report with reference to a sample, determine the identifier of the target description object based on the user input information and obtain a sample report for reference in the report to be generated, and determine at least one data item to be displayed in the report to be generated and API interface call information related to each data item based on the sample report and a number of pre-stored API interface call information; if a second intent is recognized, the second intent instructs the generation of a report without a sample, determine the identifier of the target description object based on the user input information, and determine at least one data item to be displayed in the report to be generated based on the user input information and a pre-built knowledge base including at least a number of data items, and obtain API interface call information related to each data item from a number of pre-stored API interface call information.

[0102] In some embodiments, the information determination module is specifically used to: obtain a first vector converted from the sample report and a second vector converted from each API interface call information in the pre-stored plurality of API interface call information; based on the similarity between the first vector and each of the second vectors, recall a plurality of candidate API interface call information from the pre-stored plurality of API interface call information; and using the pre-trained language model to refer to the plurality of candidate API interface call information, identify the at least one data item from the sample report and establish a data item mapping relationship, wherein the data item mapping relationship includes at least each data item and its associated API interface call information.

[0103] In some embodiments, the data content generation function corresponding to at least some of the data items further encapsulates data processing logic for the returned data of the API interface.

[0104] Wherein, when the first intent is identified from the user input information, the data processing logic corresponding to the data item is defined based on the format difference between the following two: the display format of the data item in the sample report, and the return data format described by the API interface call information related to the data item.

[0105] If the second intent is identified from the user input information, the data processing logic corresponding to the data item is obtained from the knowledge base, or defined based on the format difference between the following two: the display format of the data item described in the user input information, and the return data format described by the API interface call information related to the data item.

[0106] In some embodiments, the data item mapping relationship further includes the display position of each data item in the sample report. The function creation module is specifically used to input the sample report, the data item mapping relationship, and the data content generation function into the pre-trained language model to create a main function using the pre-trained language model. The main function takes the identifier of any descriptive object as an input parameter, can call each of the data content generation functions to obtain output content, and replaces and outputs the reference data content of each data item in the sample report based on the display position of each data item in the sample report and the corresponding output content of each data item.

[0107] In some embodiments, the function creation module is specifically used to, if a second intent is identified, input a preset display logic and the data content generation function into the pre-trained language model, so as to use the pre-trained language model to create a main function that takes the identifier of any descriptive object as an input parameter, can call each of the data content generation functions to obtain output content, and generates a report on the output content corresponding to each data item based on the preset display logic.

[0108] In some embodiments, the apparatus further includes a function verification module, configured to obtain the identifier of the example description object and the reference data content of the example description object in each of the data items; run each of the data content generation functions using the identifier of the example description object to obtain the output content of the data content generation functions; if there is an abnormal data content generation function whose output content is inconsistent with the reference data content, modify the abnormal data content generation function using the pre-trained language model based on the difference between the output content of the abnormal data content generation function and the reference data content.

[0109] In some embodiments, the function validation module is specifically configured to, when a first intent is identified from user input information, obtain an identifier of an example description object from a sample report included in the user input information, and obtain reference data content of the example description object in each of the data items from the sample report; and when a second intent is identified from user input information, obtain an identifier of an example description object and reference data content of the example description object in each of the data items from a knowledge base.

[0110] In some embodiments, a reuse module is further included, which is used to generate functional description information of the main function using the pre-trained language model; store the main function and its functional description information in a template library; and reuse the selected main function to generate a report in response to the selection operation of at least one main function in the template library.

[0111] The specific implementation process of the functions and roles of each module in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0112] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.

[0113] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0114] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.

[0115] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A report generation method, comprising: determining, based on user input information, an identification of a target description object to be generated for a report, at least one data item to be displayed in the report, and API interface call information associated with each data item, the API interface call information being used to obtain data content of any description object in the data item; creating, for each data item, a data content generation function using a pre-trained language model, the function taking the identification of any description object as an input parameter and encapsulating the API interface call information associated with the data item; creating, using the pre-trained language model, a main function taking the identification of any description object as an input parameter, being able to call each data content generation function to obtain output content, and generating a report based on the output content; running the main function based on the identification of the target description object to obtain a report for the target description object.

2. The method of claim 1, wherein the determining, based on user input information, an identification of a target description object to be generated for a report, at least one data item to be displayed in the report, and API interface call information associated with each data item comprises: performing intent recognition on the user input information; if a first intent is recognized, the first intent indicating that a sample report is to be generated, determining the identification of the target description object based on the user input information and obtaining a sample report for the target description object from a pre-stored sample report, and determining the at least one data item to be displayed in the report and the API interface call information associated with each data item based on the sample report and pre-stored API interface call information; if a second intent is recognized, the second intent indicating that a report is to be generated without a sample, determining the identification of the target description object based on the user input information, determining the at least one data item to be displayed in the report based on the user input information and a pre-constructed knowledge base including at least a plurality of data items, and obtaining the API interface call information associated with each data item from pre-stored API interface call information.

3. The method of claim 2, wherein the determining, based on the sample report and pre-stored API interface call information, the at least one data item to be displayed in the report and the API interface call information associated with each data item comprises: obtaining a first vector converted from the sample report and a second vector converted from each API interface call information in the pre-stored API interface call information; based on the similarity between the first vector and each second vector, recalling a plurality of candidate API interface call information from the pre-stored API interface call information; using the pre-trained language model, referring to the plurality of candidate API interface call information, identifying the at least one data item from the sample report and establishing a data item mapping relationship, the data item mapping relationship including at least each data item and its associated API interface call information. ​ 4. The method of claim 2, wherein the data content generation function corresponding to each of the data items further encapsulates data processing logic for returned data of the API interface; wherein in a case where the first intention is identified from the user input information, the data processing logic corresponding to the data item is defined based on a format difference between a display format of the data item in the sample report and a returned data format described by the API interface calling information related to the data item; in a case where the second intention is identified from the user input information, the data processing logic corresponding to the data item is obtained from the knowledge base, or is defined based on a format difference between a display format of the data item described in the user input information and a returned data format described by the API interface calling information related to the data item.

5. The method of claim 2, wherein the data item mapping relationship further comprises a display position of each of the data items in the sample report; the main function created by using the pre-trained language model and taking an identification of any description object as an input parameter, capable of calling the data content generation function to obtain output content, and generating a report based on the output content, comprises: inputting the sample report, the data item mapping relationship and the data content generation function into the pre-trained language model to create a main function by using the pre-trained language model, the main function taking an identification of any description object as an input parameter, capable of calling each of the data content generation functions to obtain output content, and replacing reference data content of each of the data items in the sample report based on a display position of each of the data items in the sample report and the output content corresponding to each of the data items, and outputting.

6. The method of claim 2, wherein the main function created by using the pre-trained language model and taking an identification of any description object as an input parameter, capable of calling the data content generation function to obtain output content, and generating a report based on the output content, comprises: if the second intention is identified, inputting preset display logic and the data content generation function into the pre-trained language model to create a main function by using the pre-trained language model, the main function taking an identification of any description object as an input parameter, capable of calling each of the data content generation functions to obtain output content, and generating a report based on the preset display logic for the output content corresponding to each of the data items.

7. The method of any one of claims 1 to 6, after the step of creating, by using the pre-trained language model, the data content generation function corresponding to each of the data items and taking an identification of any description object as an input parameter and encapsulating API interface calling information related to the data item, further comprising: obtaining an identification of a sample description object and reference data content of the sample description object for each of the data items; running each of the data content generation functions by using the identification of the sample description object to obtain output content of the data content generation function; If there is an abnormal data content generation function whose output content is inconsistent with the reference data content, the pre-trained language model is used to modify the abnormal data content generation function based on the difference between the output content of the abnormal data content generation function and the reference data content.

8. The method of claim 7, wherein the obtaining of the identification of the example description object and the reference data content of the example description object in each of the data items comprises: in a case where the first intention is identified from the user input information, obtaining the identification of the example description object from a sample report included in the user input information, and obtaining the reference data content of the example description object in each of the data items from the sample report; in a case where the second intention is identified from the user input information, obtaining the identification of the example description object and the reference data content of the example description object in each of the data items from a knowledge base.

9. The method of claim 1, further comprising: generating, by the pre-trained language model, functional description information of the main function; storing the main function and the functional description information thereof into a template library; and in response to a selection operation on at least one main function in the template library, reusing the selected main function to generate a report.

10. An electronic device comprising: a processor; a memory for storing processor-executable instructions, wherein the processor implements the steps of the method of any one of claims 1-9 by running the executable instructions.

11. A computer-readable storage medium having computer instructions stored thereon, the instructions being executed by a processor to implement the steps of the method of any one of claims 1-9.

12. A computer program product comprising computer program / instructions, the computer program / instructions being executed by a processor to implement the steps of the method of any one of claims 1-9.

Citation Information

Patent Citations

  • Data report generation method, electronic device, storage medium and computer program product

    CN119202140A

  • Report generation system and method

    US20030046264A1