Report generation method, electronic device, and computer program product

By constructing a mapping relationship between business fields and page elements and splitting tasks into parallel processing using a large language model, combined with a virtual force-guided model to adjust the position of page elements, the problems of low efficiency and poor consistency in manual report generation were solved, achieving efficient and accurate automated report generation.

CN122452525APending Publication Date: 2026-07-24KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
KE COM (BEIJING) TECHNOLOGY CO LTD
Filing Date
2026-04-28
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In the business sector, manual report generation is inefficient, time-consuming, and inconsistent in quality, making it difficult to achieve a unified professional output. Existing automation solutions are disconnected from real estate business logic and pose a risk of data leakage.

Method used

By establishing a mapping relationship between business fields and page elements, a standardized report generation process is constructed. A large language model is used to split tasks for parallel processing, and a virtual force-guided model is combined to adjust the position of page elements, thereby achieving automation and standardization of data filling.

Benefits of technology

It improves the efficiency and consistency of report generation, reduces the risk of human error, expands the flexibility of application scenarios, avoids full recalculation caused by partial errors, and ensures the accuracy and fault tolerance of reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122452525A_ABST
    Figure CN122452525A_ABST
Patent Text Reader

Abstract

The present disclosure provides a report generation method, an electronic device and a computer program product. The report generation method of the present disclosure comprises: in response to obtaining a report content generation task, determining business data, the report content generation task being used to indicate obtaining a field value of a business field in a report template, the business data containing a field identifier of the business field and the field value of the business field; determining a target page element applicable to the business field based on element configuration information, the element configuration information recording a mapping relationship between the field identifier of the business field and a page element; and filling the field value into the target page element in the report template to generate a target report.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the technical fields of data processing, and in particular to a report generation method, electronic device, and computer program product. Background Technology

[0002] In the business world, reports are crucial for transforming fragmented business data into visualized information. However, the quality and efficiency of manually produced reports are highly dependent on individual abilities. Faced with vast amounts of scattered property data and market information, the depth of analysis and presentation vary significantly among different business personnel, resulting in low standardization of reports and difficulty in achieving a unified professional output. Summary of the Invention

[0003] This disclosure provides a report generation method, an electronic device, and a computer program product.

[0004] According to one aspect of this disclosure, a report generation method is provided, comprising: in response to obtaining a report content generation task, determining business data, the report content generation task being used to instruct the acquisition of field values ​​of business fields in a report template, the business data including field identifiers of business fields and field values ​​of business fields; determining target page elements applicable to the business fields based on element configuration information, the element configuration information recording a mapping relationship between field identifiers of business fields and page elements; and filling the field values ​​into the target page elements in the report template to generate a target report.

[0005] Based on one technical solution, by establishing a mapping relationship between business fields and page elements, the data population process during report generation is automated and standardized. It can not only quickly match the corresponding target page elements based on field identifiers, but also accurately inject business data into the report template, significantly improving the efficiency and consistency of report generation while reducing the risk of errors caused by manual operation. It is suitable for batch report automation generation needs in multiple scenarios.

[0006] In some implementations, prior to obtaining a report content generation task, the method includes: determining the report content generation task in response to receiving a report generation request.

[0007] In some implementations, in response to receiving a report generation request, determining the report content generation task includes: determining a report template applicable to the report generation request by a first model based on the business scenario specified in the report generation request; determining the business fields included in the business dimensions according to the business dimensions involved in the report template; and generating a report content generation task to indicate the acquisition of the field values ​​of the business fields.

[0008] In some implementations, in response to obtaining a report content generation task, determining business data includes: executing the report content generation task by a second model to generate initial business data; and performing validity checks on the initial business data by a first model, and using the valid initial business data as the business data.

[0009] In some implementations, determining business data includes: reading basic data related to the business field from a business database by a second model; analyzing the business field by the second model in conjunction with the basic data to obtain the field value of the business field; and forming key-value pairs of business data using the field identifier of the business field as the key and the field value as the value.

[0010] In some implementations, after obtaining the field value of the business field, the method further includes: setting a style tag for the field value of the business field according to the style requirement information of the business field in the report generation request, and obtaining the field value with the style tag.

[0011] In some implementations, filling the field value into a target page element in the report template to generate a target report includes: filling the field value into a target page element in the report template; determining whether the target page element has an overlapping area with other page elements, wherein the overlapping area refers to the area occupied by the target page element in the report template being the same as or partially the same as the area occupied by other page elements in the report template; when the overlapping area exists, invoking a virtual force guidance model to determine the target area occupied by the target page element, wherein the target area occupied ensures that the target page element does not have the overlapping area with other page elements; and rendering the target page element in the target area to generate the target report.

[0012] In some implementations, determining whether the target page element overlaps with other page elements includes: determining the position data of the target page element based on its occupied area, the position data including the x-coordinate value of the center point of the target page element, the y-coordinate value of the center point of the target page element, the width value of the target page element, and the height value of the target page element; determining whether the x-coordinate deviation between the target page element and other page elements is less than the average width between the target page element and other page elements based on the position data; determining whether the y-coordinate deviation between the target page element and other page elements is less than the average height between the target page element and other page elements based on the position data; and determining that the target page element overlaps with other page elements when the x-coordinate deviation is less than the average width and the y-coordinate deviation is less than the average height.

[0013] In some implementations, invoking a virtual force-guided model to determine the target occupied area of ​​the target page element includes: determining the position data of the target page element based on its occupied area; determining the repulsive force between the target page element and each of the other page elements based on the position data, wherein the repulsive force is proportional to the area of ​​the corresponding overlapping area; determining the restoring force of the target page element based on the position data; adding all the repulsive forces and restoring forces of the target page element to obtain the resultant force of the target page element; and determining new position data of the target page element based on the resultant force when the resultant force is greater than a first threshold, until the resultant force is less than or equal to the first threshold, and using the occupied area corresponding to the new position data as the target occupied area of ​​the target page element.

[0014] In some implementations, filling the field values ​​into target page elements in the report template to generate a target report includes: when the report template is a custom template, determining whether the target page element is a chart element, wherein the chart element is a page element that displays field values ​​in graphical form; and when the target page element is a chart element, determining the chart type of the target page element based on the data characteristics of the field values ​​corresponding to the target page element, and generating the target report that presents the target page element in the chart type, wherein the chart type is used to define the visualization form of the chart element.

[0015] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, causing the processor to perform a report generation method according to any embodiment of this disclosure.

[0016] According to another aspect of this disclosure, a readable storage medium is provided that stores executable instructions, which, when executed by a processor, are used to implement a report generation method according to any embodiment of this disclosure.

[0017] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a report generation method according to any embodiment of this disclosure. Attached Figure Description

[0018] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0019] Figure 1 This is a schematic diagram illustrating an application scenario of the report generation method according to the embodiments of this disclosure.

[0020] Figure 2 This is a schematic flowchart of a report generation method according to an embodiment of the present disclosure.

[0021] Figure 3 This is a flowchart of the process for determining the task based on the report content of the embodiments of this disclosure.

[0022] Figure 4 This is a flowchart of a process for determining business data according to an embodiment of the present disclosure.

[0023] Figure 5 This is another flowchart of the process for determining business data according to an embodiment of this disclosure.

[0024] Figure 6 This is a flowchart of a process for generating an objective report according to an embodiment of this disclosure.

[0025] Figure 7 This is a schematic diagram of the overlapping region detection process according to an embodiment of the present disclosure.

[0026] Figure 8 This is a flowchart illustrating the process of determining the target occupied area according to an embodiment of this disclosure.

[0027] Figure 9 This is another flowchart of the process for generating an objective report according to an embodiment of this disclosure.

[0028] Figure 10 This is a schematic diagram of a target report generation process in a specific scenario according to an embodiment of the present disclosure.

[0029] Figure 11 This is a schematic block diagram of the structure of a report generation apparatus according to an embodiment of the present disclosure.

[0030] Figure 12 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Detailed Implementation

[0031] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0032] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0033] In the new home sales business, reports are a crucial vehicle for transforming scattered business data into visualized information. Currently, the production of such reports is highly dependent on manual labor, with a single professional report often requiring half a day or even a full day, resulting in high time costs. Furthermore, due to the varying skill levels of business personnel, the produced reports differ significantly in quality and style, making it difficult to achieve a unified and standardized professional output.

[0034] While some automated report generation solutions have emerged in the market, these solutions are often disconnected from real estate business logic, resulting in content lacking professional depth. Furthermore, introducing external systems to process internal corporate data may introduce potential data breach risks.

[0035] To this end, this disclosure proposes a report generation method.

[0036] Figure 1 This is a schematic diagram illustrating an application scenario of the report generation method according to embodiments of this disclosure. For example... Figure 1 As shown, in this application scenario, a server 100 and a terminal device 200 may be included. The server 100 and the terminal device 200 can connect via a network or Bluetooth to exchange data. The server 100 can be a cloud server or a physical server, and the terminal device 200 can be a smart device such as a computer, mobile phone, or tablet. The server 100 provides the basic data required to run the report generation method, and the terminal device 200 executes the report generation method of this disclosure based on the basic data provided by the server 100.

[0037] Figure 2 This is a schematic flowchart illustrating a report generation method according to embodiments of this disclosure. Figure 2 As shown, this disclosure proposes a report generation method M200, which constructs a standardized report generation process and records the mapping relationship between the field identifiers of business fields and the corresponding page elements through configuration, thereby decoupling business data from report templates. This not only effectively overcomes the problems of low efficiency, high time consumption, and insufficient standardization of manual report generation, but also improves the flexibility and scalability of report templates, thus expanding the application scenarios of this method.

[0038] Step S210: In response to the task of obtaining report content generation, determine multi-service data.

[0039] The report content generation task is used to instruct the retrieval of field values ​​for business fields in a report template; it is the instruction to generate the field values ​​for these business fields. Each report content generation task typically focuses on one business dimension of the report template, aiming to retrieve the field values ​​of all associated business fields within that dimension. Therefore, a single task encapsulates the field identifiers for multiple business fields to be retrieved. These field identifiers are the unique codes or names of the business fields within the corresponding report template.

[0040] A report template is a visual container that defines the layout of the business fields and page elements contained in a report. It can be a preset, fixed report template, or a custom template that is dynamically generated based on user interaction content on top of a basic report template.

[0041] Different business scenarios have different focuses and display objectives. To match the diverse display needs of different scenarios, each business scenario corresponds to a different report template. This template defines and filters the business fields most relevant to the current business scenario and plans the page element layout that best suits the browsing habits of that business scenario, thereby ensuring the relevance of the report content. Report templates typically include the business dimensions that should be included in the corresponding business scenario, the business fields under each dimension, and the area and style information of these business fields in the report.

[0042] Business dimensions refer to the classification results of business fields, such as time, region, and project, used for logical grouping of data; while business fields are the smallest data units that constitute the report content, and are attributes that specifically carry business information, such as sales revenue and customer name. Through this hierarchical definition, the report template achieves a precise mapping from abstract business logic to concrete visualization pages.

[0043] Business dimensions refer to different business concerns within a business scenario, such as sales volume and price trends, customer churn analysis, and customer acquisition sources. Each dimension revolves around a specific business concern, aggregating the business fields that need to be analyzed for that concern. Business dimensions make the report structure clearer, allowing users to quickly locate areas of interest.

[0044] Business fields are the smallest analytical units that constitute a business dimension, representing specific business characteristics that need to be quantified or described. Each business field has a unique code or name as a field identifier to ensure the accuracy of the match between field values ​​and page elements. In report templates and the final generated reports, business fields are typically populated into page elements (such as value cards, trend charts, detail lists, etc.) so that they can be viewed as content on the page.

[0045] Business data includes the field identifiers and values ​​of the business fields. It represents the execution result of the report content generation task and provides data support for content rendering of the page elements corresponding to the business fields. Typically, a report content generation task generates a corresponding amount of business data based on the business fields it needs to analyze.

[0046] Step S220: Based on the element configuration information, determine the target page element applicable to the business field.

[0047] Element configuration information records the mapping relationship between business field identifiers and page elements. After determining the business data, the element configuration information allows associating field values ​​with corresponding page elements, thereby enabling the input of field values ​​and the rendering of page elements. Element configuration information is configurable, eliminating the need to hardcode business fields into report templates, thus improving the flexibility and scalability of report templates. This also provides a foundation for generating personalized templates based on interactive information, thereby producing customized reports.

[0048] In addition, since business data is usually in the form of {field identifier: field value}, for ease of mapping, element configuration information is also recorded in the form of key-value pairs such as {field identifier: page element}, where the field identifier is the key and the page element is the value, ensuring accurate matching between page elements and field values.

[0049] The target page element is the page element that matches the field value of the business field. Page elements are the visualization units of the report, used to present the field values ​​of the business fields in a visual way. Page elements can be divided into various forms, such as text elements for displaying descriptive text and chart elements for presenting data trends or distributions.

[0050] Step S230: Fill the field values ​​into the target page element in the report template to generate the target report.

[0051] The target report is the rendering result of all target page elements in the report template. It retains the standardized framework of the report template while incorporating personalized field values, thus improving the efficiency and flexibility of report generation.

[0052] In some implementations, prior to obtaining a report content generation task, the method includes: determining a report content generation task in response to receiving a report generation request.

[0053] A report generation request is a user-initiated instruction to generate a target report. The report generation request records the user's requirements for the report's content and layout, such as the business dimensions to be included in the target report, the corresponding business fields for each business dimension, the position of the business dimensions in the report, and the area occupied by each business field in the report.

[0054] When a user initiates a report generation request, they can directly select a fixed report template. When selecting a fixed report template, users can choose by clicking on template controls or other operations. Alternatively, they can initiate interactive information through a dialog box, expressing their needs for adding, deleting, or modifying page elements in the basic report template in natural language. This allows them to provide information such as the business dimensions the report is expected to cover, the business fields included in those dimensions, and the desired style and layout.

[0055] When a user initiates a report generation request through a dialog box, basic data about the business fields can be provided in the interactive information to provide data support for the subsequent analysis of the field values ​​of the business fields.

[0056] Upon receiving a report generation request, to address issues such as localized errors caused by AI (Artificial Intelligence) illusions in single-model processing, the need for full recalculation upon error, and low fault tolerance, this solution adopts a "general-specific-general" processing architecture: First, the first model globally coordinates the report generation request, discretizing the analysis tasks of all business fields in the report template into multiple independent report generation tasks according to the business dimensions in the report template, and assigning them to various second models for parallel "specific" processing; finally, the first model verifies and summarizes the business data returned by each second model. Through task splitting and parallel processing, full rework caused by localized analysis errors is effectively avoided, improving the accuracy, fault tolerance, and processing efficiency of report generation.

[0057] Figure 3 This is a flowchart illustrating the process of determining tasks based on the report content of this embodiment. For example... Figure 3 The diagram shows the process by which the aforementioned first model determines the report generation task according to the report generation request, which is the first "general" processing stage.

[0058] After receiving the report generation request, through methods such as Figure 3 The process shown determines the task of generating the report content.

[0059] In this embodiment, steps 301 to 303 are proposed, namely: the first model determines a report template applicable to the report generation request based on the business scenario specified by the report generation request; the business fields included in the business dimensions involved in the report template are determined; and a report content generation task is generated to indicate the field values ​​of the business fields to be obtained.

[0060] The first model performs semantic parsing on the report generation request to identify its business dimensions and fields. Then, based on these business dimensions, the analysis task for each business field in the report template is discretized into multiple report content generation tasks, allowing for parallel processing by the second models. The first model can employ a large language model with strong logical reasoning and semantic understanding capabilities. Discretizing the processing task of a report generation request into multiple report content generation tasks based on business dimensions reduces the probability of AI illusions. Furthermore, even if AI illusions occur, they only affect the portion of the report corresponding to one business dimension, without impacting the analysis results of other business dimensions, thus improving the fault tolerance of the report generation process.

[0061] Business scenarios are used to define the context of a report, clarifying the business dimensions, fields, and page layout that the report focuses on. Therefore, different business scenarios correspond to different report templates to present the focus and browsing habits of the corresponding business scenario in a personalized way.

[0062] In the standard report generation mode, users submit a report generation request by clicking the selection control for the report template. This selection control is typically used to represent a specific business scenario and is bound to the corresponding report template. Therefore, the report generation request carries a clear business scenario and is associated with the corresponding report template.

[0063] In non-standard interactive mode, users provide their desired report content and layout via a dialog box. In this case, the business scenario of the report can be extracted from the requirements, namely the relevant business dimensions, business fields, and layout. Alternatively, users can select a basic report template and add, delete, or modify business fields according to their actual needs to obtain a report template corresponding to the business scenario described in the requirements.

[0064] It's important to note that the report content generation task involves retrieving the field values ​​of all business fields within the corresponding business dimension of the report template. This task is distributed to different second models for parallel processing, which improves the speed of generating the business dataset. Furthermore, it reduces the probability of AI illusions; even if AI illusions occur, their impact is limited to the content of only one business dimension within the report.

[0065] Figure 4 This is a flowchart illustrating a process for determining business data according to an embodiment of this disclosure. For example... Figure 4 As shown, the second and first models together present the two processing stages of "diversity-overall" in the business data processing process.

[0066] In this embodiment, steps 401 to 404 are proposed, namely: the second model performs the report content generation task to generate initial business data; and the first model performs validity verification on the initial business data respectively, and uses the valid initial business data as the business data.

[0067] The second model is a large language model used to perform report content generation tasks. It can respond to report content generation tasks, obtain the field values ​​of corresponding business fields, and generate initial business data in key-value pair format. The second model is used to complete the "segmentation" stage of the report content generation task, and its specific implementation process will be introduced later.

[0068] The initial business data is the output of the second model after processing the report content generation task, which includes field identifiers and their corresponding field values. To ensure the accuracy of the report content, the output of the second model is only temporarily stored as initial business data and can only be confirmed as valid business data after being verified by the first model.

[0069] The first model has the capability to validate the initial business data to ensure the usability and standardization of the output results from the second model. The validation process may include: determining whether the initial business data covers all business fields required for the report content generation task, avoiding missing content; determining whether the initial business data is in the form of key-value pairs ({field identifier: field value}), ensuring the standardization of business data; and determining the rationality of field values, avoiding issues such as field values ​​being irrelevant to the corresponding business fields or logically unreasonable.

[0070] If the initial business data meets the above validation requirements, it is considered valid and can be used as business data. Otherwise, the initial business data is considered invalid, an error message needs to be generated, and the second model needs to be triggered to re-execute the task of generating report content. In this case, it will not affect the output results of other second models, avoiding the problem of full recalculation.

[0071] Figure 5 This is another flowchart illustrating the process of determining business data according to an embodiment of this disclosure. The following is in conjunction with... Figure 5 The process of determining business data in the second model is explained.

[0072] In this embodiment, steps 501 to 503 are proposed, namely: the second model reads basic data related to the business field from the business database; the second model analyzes the business field in combination with the basic data to obtain the field value of the business field; and business data in the form of key-value pairs is formed with the field identifier of the business field as the key and the field value as the value.

[0073] The business database records all of the enterprise's basic data. This basic data preserves the objective facts of the business processes and is unprocessed, atomic data. Based on this, the business database provides flexible data access for the second model. Through the free combination of various basic data, it provides data support for the personalized customization of report templates to meet diverse business field analysis needs. The data source for the business database can be industry indicator databases, new housing data centers, property dictionaries, etc., without any restrictions.

[0074] In some implementations, style tags are set for the field values ​​of business fields based on the style requirement information for business fields in the report generation request, thereby obtaining the field values ​​with style tags.

[0075] Style requirements specify the font format and color preferences for field values. Font formatting can include bold, italics, font style, font size, underline, etc. By setting font formatting and color, the values ​​of relevant business fields can be highlighted to attract user attention. Style requirements can be submitted via dialog boxes during the interaction process.

[0076] Style tags are structured markers for style requirements, specifically HTML markup language in this solution. For example, if you need to bold or highlight the increase of "30%", you would set a style tag at that field value. <font color="red"> Up 30% < / font> .

[0077] Based on style requirement information, the large language model wraps unstructured text data in standard HTML tags to generate rich text field values ​​with semantics and styles. Subsequently, before rendering the target page elements, the rendering engine can use parsing tools such as Jsoup to identify these style tags and convert them into content that the rendering engine can execute, ultimately restoring the corresponding font format, color and other diverse effects in the target report.

[0078] Figure 6 This is a flowchart illustrating a process for generating an objective report according to an embodiment of this disclosure. For example... Figure 6 The image shows a process for generating a target report, implemented by a rendering engine.

[0079] In this embodiment, steps 601 to 604 are proposed, namely: filling field values ​​into the target page element in the report template; determining whether there is an overlapping area between the target page element and other page elements; when there is an overlapping area, calling the virtual force guidance model to determine the target occupied area of ​​the target page element; and rendering the target page element in the target occupied area to generate the target report.

[0080] While page elements in the report template do not overlap initially, their content may expand due to increased data volume after field values ​​are dynamically populated (e.g., the number of columns in a table increases from five to ten), encroaching on surrounding areas and causing layout conflicts. Therefore, it is necessary to determine whether the target page element overlaps with other page elements after field values ​​are populated. If overlap exists, its position needs to be adjusted to avoid element obscuring caused by content overflow.

[0081] Overlapping areas refer to the areas occupied by a target page element in a report template that are the same as or partially the same as the areas occupied by other page elements in the same report template. In other words, overlapping areas mean that the target page element and other page elements have overlapping areas in the report.

[0082] The Virtual Force Guidance Model abstracts the spatial relationships between target page elements and other page elements into virtual forces, dynamically adjusting the positions of page elements by simulating the interaction forces in a physical system. In this model, overlap or excessively close spacing between elements is considered as generating mutually repulsive "repulsive forces," while maintaining the compactness or alignment of the overall structure is considered as "restoring forces." By calculating the resultant force vector of these virtual forces, page elements are driven to adaptively shift and iterate in the two-dimensional space of the report. This eliminates layout conflicts while automatically finding the stable equilibrium state with the lowest energy, ultimately achieving intelligent organization and aesthetic presentation of the report layout. The process of determining the target report using the Virtual Force Guidance Model will be described later.

[0083] The target area ensures that the target page element does not overlap with other page elements. This area maintains the same geometric dimensions as the initial area occupied by the target page element, that is, it keeps the original width and height unchanged. Its spatial position in the report is changed only by adjusting the horizontal and vertical coordinates of the center point. Thus, while maintaining the element's own shape and specifications, it eliminates conflicts with other page elements through pure displacement operations.

[0084] Figure 7 This is a schematic diagram of the overlapping region detection process according to an embodiment of the present disclosure. Figure 7 As shown, this disclosure proposes a process for detecting overlapping regions.

[0085] In this embodiment, steps 701 to 704 are proposed, namely: determining the position data of the target page element i based on the area occupied by the target page element i; and determining the horizontal coordinate deviation value between the target page element i and other page elements j based on the position data. Is it smaller than the average width between target page element i and other page elements j? Based on the location data, determine the ordinate deviation value between the target page element i and other page elements j. Is it less than the average height of target page element i and other page elements j? ; and when ,and When this happens, it is determined that there is an overlapping area between the target page element i and other page elements j.

[0086] The x-coordinate deviation value is the absolute value of the difference between the x-coordinate of the center point of the target page element and the x-coordinate of the center point of other page elements. The average width is the average of the width of the target page element and the width of other page elements. The y-axis deviation value is the absolute value of the difference between the y-axis coordinate of the center point of the target page element and the y-axis coordinate of the center point of other page elements. The average height is the average of the height of the target page element and the height of other page elements, i.e. .

[0087] After the field values ​​are filled into the target page element, the x-coordinate of the target page element's center point can be determined based on the area occupied by the target page element in the report template. , center point ordinate value and the width of the area it occupies. and height value These together constitute the location data of the target element.

[0088] Other page elements j refer to all page elements in the report that have been populated with the corresponding field values. Each page element needs to be considered as other page element j and its overlap area needs to be detected with the target page element i.

[0089] when ,and If the target page element i overlaps with other page elements j to at least partially, its position needs to be adjusted to avoid element occlusion.

[0090] Figure 8 This is a flowchart illustrating the process of determining the target occupied area according to an embodiment of this disclosure. The following is in conjunction with... Figure 8 The process of determining the target occupied area is explained, and this process is implemented by a virtual force-guided model.

[0091] In this embodiment, steps 801 to 807 are proposed, namely: determining the position data of the target page element based on the occupied area of ​​the target page element; determining the repulsive force between the target page element and each other page element based on the position data, wherein the repulsive force is proportional to the area of ​​the corresponding overlapping area; determining the restoring force of the target page element based on the position data; adding all the repulsive forces and restoring forces of the target page element to obtain the resultant force of the target page element; and determining new position data of the target page element based on the resultant force when the resultant force is greater than a first threshold, until the resultant force is less than or equal to the first threshold, and using the occupied area corresponding to the new position data as the target occupied area of ​​the target page element.

[0092] The position data of target page element i after the field values ​​are filled includes: the x-coordinate of the center point of the target page element. , center point ordinate value and the width of the area it occupies. and height value .

[0093] Repulsive force is the force generated by the overlap between page elements. Its direction is the direction of the line connecting the center points of the target page element i and other page elements j. The magnitude of the repulsive force is proportional to the area of ​​the overlapping region.

[0094] Repulsive force ,in The repulsive force coefficient, Let be the area of ​​the overlapping region between target page element i and other page elements j, and D be the Euclidean distance between the center point of target page element i and the center points of other page elements j. This is a unit vector pointing from target page element i to other page elements j.

[0095] Resilience is the force that pulls the target page element back to its initial occupied area, preventing the element from drifting indefinitely during the avoidance process and ensuring the overall stability of all page elements in the report template. The initial occupied area refers to the area occupied by the target page element after the field values ​​are populated.

[0096] resilience ,in The restoring force coefficient, Let x and y be the initial x and y coordinates of the center point of the area occupied by the target page element i when the field value is first populated, i.e., the initial ( , ); This represents the coordinates of the center point of the currently occupied area of ​​the target page element i, i.e., the new ( , ).

[0097] Typically, the repulsive force coefficient Both the restoring force coefficient and the restoring force coefficient are known. D , , Both can be obtained through the position data of the target page element and the position data of other page elements. Therefore, the repulsive force and the restoring force can be calculated based on the aforementioned formula after knowing the position data of the target page element.

[0098] Of course, the position data of other page elements can be determined in the same way, so I won't go into details.

[0099] Furthermore, calculate the resultant force on the target page element, which is the sum of the repulsive forces of all other page elements with overlapping areas on the target page element and the restoring force of the center point coordinates of its initially occupied area.

[0100] Among them, synergy .

[0101] If the resultant force is greater than the first threshold, it proves that the current occupied area has not achieved a balance between the restoring force and the repulsive force, and a new center point coordinate needs to be determined. The first threshold can be 0 or other values ​​slightly greater than 0; there are no restrictions here.

[0102] New center point coordinates of the currently occupied area: .

[0103] Where t represents the t-th element. The first one Right now . This represents the step size factor, used to control the convergence speed of the iteration, and is known.

[0104] Then use the new Iterate through the position data of the target page element i until the resultant force is less than or equal to the first threshold. Use this as the new center point coordinate of the target occupied area, and combine it with the width and height values ​​to determine the new target occupied area.

[0105] In some implementations, the iteration of the occupied areas of all target page elements can be stopped early when the sum of the areas of the overlapping regions corresponding to all target page elements is less than the overlapping area threshold.

[0106] In some implementations, the iteration of the occupied areas of all target page elements can be stopped early when the displacement vector magnitude of all target page elements from the center point coordinates of their initial occupied area to the center point coordinates of their current occupied area is less than the movement magnitude threshold.

[0107] In some implementations, iteration of target page element i can be stopped when the number of iterations of the area occupied by target page element i exceeds a threshold.

[0108] The area threshold, moving modulus threshold, and number of times threshold mentioned above can all be set according to the actual situation, and there are no restrictions here.

[0109] Figure 9 This is another flowchart illustrating the generation process of the target report according to an embodiment of this disclosure. For example... Figure 9 The image shows the report generation process when the selection of chart type is involved.

[0110] In this embodiment, steps 901 to 904 are proposed, namely: determining whether the report template is a custom template; when the report template is a custom template, determining whether the target page element is a chart element, where a chart element is a page element that displays field values ​​in graphical form; determining whether the target page element is a chart element; when the target page element is a chart element, determining the chart type of the target page element based on the data characteristics of the field values ​​corresponding to the target page element, and generating a target report that presents the target page element in chart type.

[0111] Report templates include two types: fixed report templates and custom templates. Fixed report templates are those that users specify directly through selection controls when initiating a report generation request. Their page element types and rendering styles are fixed and can be presented directly according to established rules. Custom templates, on the other hand, are created by users interacting through dialog boxes, using natural language to describe their specific needs for the report content and layout. This allows for the parsing of requirements such as the business dimensions, related business fields, and distribution strategies for the business dimensions to be presented in the target report.

[0112] For chart elements in custom templates, this solution proposes an intelligent adaptation approach that can dynamically match and determine the most suitable chart type, such as line chart, pie chart, and column chart, based on the data characteristics corresponding to the field values, thereby achieving data visualization.

[0113] Data feature representations can be categorized by the combination of field values. Different combinations correspond to different analytical logics, thus requiring adaptation to different chart types for more professional expression. Field values ​​can include various combinations such as categorical and numerical fields, time series and numerical fields, single categorical fields and numerical sums, numerical fields with numerical fields, and cumulative percentages.

[0114] Chart types are used to define the visualization of chart elements, transforming abstract field values ​​into intuitive graphical symbols, thereby enabling the visual expression and semantic communication of field values ​​based on the analytical intent they carry.

[0115] This implementation can be achieved by the rendering engine calling a large language model, inputting the mapping relationship between field values, data features, and chart types into the large language model so that it can analyze the data features of the field values ​​and then determine the appropriate chart type for the field value.

[0116] The mapping relationship between data features and chart types can be preset based on experience. For example: when the data feature is a combination of categorical and numerical fields, a bar chart is used as the chart type, such as to show the comparison of sales in different regions; when the data feature is a combination of time series and numerical fields, a line chart is used as the chart type, such as to show monthly sales trends; when the data feature is a combination of a single categorical field and the sum of numerical values, a pie chart is used as the chart type, such as to show market share; when the data feature is a combination of numerical fields, a scatter plot is used as the chart type, such as to show the relationship between price and sales volume; when the data feature is a cumulative percentage, an area chart is used as the chart type, such as to show the cumulative revenue trend.

[0117] In some implementations, a state machine can be configured for the entire report generation process to drive the execution of each step. The state machine may include an initial state, a data collection state, a collection completion state, a rendering state, a report generation state, a failure state, etc.

[0118] In the initial state, the first model is driven to discretize the task and obtain the report content generation task. During the data collection state, the second model is driven to read and analyze basic data to obtain initial business data; the first model then renders the initial business data to obtain valid business data. After obtaining all valid business data related to the report, the target page elements are determined based on each business data point, thus obtaining standard input parameters composed of multiple target page elements. After obtaining the standard input parameters, the data collection is complete, at which point the rendering engine is triggered to render the target page elements. The rendering phase includes processes such as overlapping area detection and processing, and chart type determination. Once rendering is complete, the target report is obtained, and the report generation state is reached. Of course, if any process fails to complete normally, the state machine will be adjusted to a failure state to drive the generation and push of error messages, assisting business personnel in identifying the cause of the error or retrying until the target report is obtained.

[0119] Figure 10 This is a schematic diagram illustrating a target report generation process in a specific scenario according to an embodiment of this disclosure. The following is based on... Figure 10 This demonstrates the process of generating a target report in a specific business scenario.

[0120] Upon receiving a report generation request, a report template is determined based on the request. Each report template contains multiple business dimensions. These business dimensions can include multiple dimensions such as transaction volume and price trends, customer churn, and customer acquisition source. Based on these business dimensions, the first model determines the report content generation tasks for each business field within that dimension. For example, there is a transaction volume and price trend analysis task corresponding to the transaction volume and price trend dimension, a customer churn analysis task corresponding to the customer churn analysis dimension, and a customer acquisition source analysis task corresponding to the customer acquisition source dimension.

[0121] Each task is executed concurrently by a secondary model. The process of each secondary model handling a task may include steps such as basic data acquisition, data processing, data analysis, and obtaining initial business data. Among these, data processing may involve cleaning the basic data, such as removing duplicate values.

[0122] Then, the first model verifies the initial business data provided by each of the second models, and uses the valid initial business data as the business data to obtain the business dataset.

[0123] Furthermore, based on the element configuration information, the target page elements corresponding to each field value are determined, and the target page elements and their field values ​​are organized into standard input parameters. Then, the rendering engine performs tasks such as chart type selection, overlapping area detection and processing, and rendering, ultimately outputting the target report. The target report can be in PPT format; there are no restrictions on its format.

[0124] Figure 11 This is a schematic block diagram of the report generation apparatus according to embodiments of the present disclosure. Figure 11 As shown, this disclosure provides a report generation apparatus 2000, including: a business data determination module 2100, used to determine business data in response to obtaining a report content generation task, wherein the report content generation task is used to instruct the acquisition of field values ​​of business fields in a report template, and the business data includes field identifiers and field values ​​of the business fields; a page element matching module 2200, used to determine target page elements applicable to the business fields based on element configuration information, wherein the element configuration information records the mapping relationship between field identifiers of business fields and page elements; and a rendering module 2300, used to fill the field values ​​into the target page elements in the report template to generate a target report.

[0125] The report generation apparatus 2000 disclosed herein may be in the form of computer software, and the various modules of the report generation apparatus 2000 may be in the form of computer software modules.

[0126] The various modules of the report generation apparatus 2000 disclosed herein are set up to implement the various steps of the report generation method. The execution principle and steps can be referred to the above text and will not be repeated here.

[0127] Figure 12 This is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. Figure 12 As shown, this disclosure also provides an electronic device 1000, including: a processor 1200 and a memory 1300, the memory 1300 storing execution instructions; the processor 1200 executes the execution instructions stored in the memory 1300, causing the processor 1200 to execute a report generation method.

[0128] The hardware architecture of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application of the hardware and overall design constraints. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0129] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, this diagram uses only one connection line, but this does not imply that there is only one bus or one type of bus.

[0130] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.

[0131] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.

[0132] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.

[0133] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, electronic devices, readable storage media, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0134] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0137] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., refer to specific features, structures, or characteristics described in connection with that embodiment / mode or example, which are included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

[0138] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this disclosure, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0139] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A report generation method, characterized in that, include: In response to obtaining a report content generation task, business data is determined. The report content generation task is used to instruct the acquisition of field values ​​of business fields in the report template. The business data includes field identifiers of business fields and field values ​​of business fields. Based on the element configuration information, the target page element applicable to the business field is determined. The element configuration information records the mapping relationship between the field identifier of the business field and the page element. as well as The field values ​​are populated into the target page element in the report template to generate the target report.

2. The report generation method according to claim 1, characterized in that, Prior to responding to the task of generating report content, including: In response to receiving a report generation request, the report content generation task is determined.

3. The report generation method according to claim 1, characterized in that, In response to the task of generating report content, determine the business data, including: The second model performs the report content generation task to generate initial business data; and The first model performs validity checks on the initial business data, and the valid initial business data is used as the business data.

4. The report generation method according to claim 1, characterized in that, Determine business data, including: The second model reads basic data related to the business field from the business database; Based on the aforementioned basic data, the second model analyzes the business fields to obtain their values; and Business data is formed in key-value pair format, using the field identifier of the business field as the key and the field value as the value.

5. The report generation method according to claim 4, characterized in that, After obtaining the field value of the business field, the process also includes: Based on the style requirements for business fields in the report generation request, style tags are set for the field values ​​of the business fields to obtain the field values ​​with style tags.

6. The report generation method according to claim 1, characterized in that, The field values ​​are populated into the target page elements in the report template to generate the target report, including: Populate the field values ​​into the target page element in the report template; Determine whether the target page element has an overlapping area with other page elements. The overlapping area refers to the area occupied by the target page element in the report template being the same as or partially the same as the area occupied by other page elements in the report template. When the overlapping area exists, the virtual force guidance model is invoked to determine the target occupied area of ​​the target page element, such that the target page element does not overlap with other page elements; and The target page element is rendered in the target occupied area to generate the target report.

7. The report generation method according to claim 6, characterized in that, The virtual force guidance model is invoked to determine the target occupied area of ​​the target page element, including: Based on the area occupied by the target page element, determine the position data of the target page element; Based on the location data, the repulsive force between the target page element and each of the other page elements is determined, and the repulsive force is proportional to the area of ​​the corresponding overlapping region. Based on the location data, determine the resilience of the target page element; Adding all the repulsive forces and restoring forces of the target page element together yields the resultant force of the target page element; and When the resultant force is greater than the first threshold, the new position data of the target page element is determined based on the resultant force until the resultant force is less than or equal to the first threshold, and the occupied area corresponding to the new position data is taken as the target occupied area of ​​the target page element.

8. The report generation method according to claim 1, characterized in that, The field values ​​are populated into the target page elements in the report template to generate the target report, including: When the report template is a custom template, determine whether the target page element is a chart element, where a chart element is a page element that displays field values ​​graphically; and When the target page element is a chart element, the chart type of the target page element is determined based on the data characteristics of the field values ​​corresponding to the target page element, and the target report is generated to present the target page element in the chart type. The chart type is used to limit the visualization form of the chart element.

9. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes execution instructions stored in the memory, causing the processor to perform the report generation method according to any one of claims 1 to 8.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the report generation method according to any one of claims 1 to 8.