Report rendering method and device, computer equipment and storage medium
By integrating different data sources, configuring report styles and generating layout information, the challenges of reporting engines in the prior art in terms of platform compatibility, dynamic layout and complex document layout are solved, and high flexibility and customized report rendering effects are achieved.
Patent Information
- Application Number
- CN202510098404.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-27
AI Technical Summary
Existing reporting engines have challenges in platform compatibility, dynamic typography capabilities, and complex document typography effectiveness, resulting in generated documents that may not be displayed or edited correctly in different office software and are difficult to achieve high flexibility and personalized reporting typography.
By obtaining data to be rendered from different sources and integrating them, configuring the report style, generating report layout information in combination with built-in rules, and generating report documents based on layout information, and finally visually enhancing processing to achieve highly customized content presentation and personalized report appearance.
It realizes high flexibility and customization of report rendering, improves the reporting layout capabilities and display quality, and ensures the compatibility and professionalism of documents on different platforms.
Smart Images

Figure CN120046594A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a data processing method, and more particularly to a report rendering method, apparatus, computer device, and storage medium. Background Art
[0002] Existing report rendering methods generally use a report engine. However, the report engine has significant platform compatibility issues during document generation. When choosing the Microsoft Word format as the output, the generated document may not be correctly displayed or edited in office software; similarly, if the WPS document format is selected, the document may encounter formatting chaos when opened in Microsoft Word. This incompatibility greatly hinders its wide application in different office environments and limits the user's ability to use documents across platforms.
[0003] For documents that require more advanced dynamic typesetting functions, such as automatic adjustment of shape size, real-time transformation of background color, and custom setting of page numbers, etc., the performance of the report engine is inadequate. These functions are crucial for creating more flexible and personalized reports, but the current engine fails to provide sufficient support, thus reducing the user experience and the professionalism of the document. When facing the typesetting tasks of complex-structured and content-rich documents, the report engine often has difficulty handling effectively. This may result in a chaotic layout and unclear organization of the finally generated document, which not only affects the visual effect and professional image of the document but also increases the workload of later maintenance and optimization. To ensure high-quality typesetting results, users may have to invest additional time and resources in manual correction, thereby increasing the overall cost.
[0004] In summary, although the report engine provides a convenient solution in some aspects, it still faces challenges in the three key areas of platform compatibility, dynamic typesetting ability, and complex document typesetting efficiency, which limits its application potential in more scenarios. Improving these problems will be an important direction to enhance the competitiveness of the engine.
[0005] Therefore, it is necessary to design a new rendering method to achieve high flexibility and customization of rendering and increase the typesetting ability of reports. Summary of the Invention
[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a report rendering method, apparatus, computer device, and storage medium.
[0007] To achieve the above purpose, the present invention adopts the following technical solutions: A report rendering method, including:
[0008] Obtain the data to be rendered from different sources and integrate them to obtain an integration result;
[0009] Configure the report style;
[0010] Generate report layout information according to the report style in combination with built-in rules;
[0011] Generate a report document according to the report layout information and the integration result;
[0012] Perform visual enhancement processing on the report document and output the processing result to the terminal for display.
[0013] A further technical solution thereof is: obtaining the to-be-rendered data from different sources and integrating them to obtain an integration result, including:
[0014] Obtain the to-be-rendered data from different sources, and organize and assemble them in accordance with a predefined JSON format to obtain an integration result.
[0015] A further technical solution thereof is: the configuration of the report style includes:
[0016] Customize various styles of the report through a graphical interface, and the various styles of the report include the cover, the back cover, the header and footer, the table of contents, and the styles corresponding to each level of heading.
[0017] A further technical solution thereof is: the generation of the report layout information according to the report style in combination with the built-in rules includes:
[0018] Use an identifier resolver to search for a built-in rule library to quickly locate specific processing rules in the rule library that match the report style;
[0019] Construct a preliminary layout of the report template according to the body processing rules, and dynamically adjust the preliminary layout to obtain an adjusted layout;
[0020] Render the content of each module in the report in sequence according to the adjusted layout to form a temporary template, so as to obtain the report layout information.
[0021] A further technical solution thereof is: the generation of the report document according to the report layout information and the integration result includes:
[0022] Fill the integration result into the corresponding modules in the report, and assemble the filled modules in sequence according to the report layout information to obtain a report document.
[0023] A further technical solution thereof is: the visual enhancement processing of the report document and the output of the processing result to the terminal for display includes:
[0024] Automatically analyze the numerical and relational data in the integration result and provide visualization services, intelligently recommend and allow manual configuration of chart types and styles to obtain charts, insert the charts into the report document to obtain the processing result, and output the processing result to the terminal for display.
[0025] The present invention also provides a report rendering device, including:
[0026] An acquisition unit for acquiring the data to be rendered from different sources and integrating them to obtain an integration result;
[0027] A configuration unit for configuring the report style;
[0028] A layout generation unit for generating report layout information according to the report style and built-in rules;
[0029] A document generation unit for generating a report document according to the report layout information and the integration result;
[0030] A visualization unit for performing visualization enhancement processing on the report document and outputting the processing result to the terminal for display.
[0031] Its further technical solution is: the acquisition unit is used to acquire the data to be rendered from different sources, and organize and assemble them in a predefined JSON format to obtain an integration result.
[0032] The present invention also provides a computer device, which includes a memory and a processor. A computer program is stored on the memory, and when the processor executes the computer program, the above method is implemented.
[0033] The present invention also provides a storage medium, which stores a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0034] The beneficial effects of the present invention compared with the prior art are as follows: by flexibly integrating the data to be rendered from different data sources, the system can dynamically adjust the data processing method to achieve highly customized content presentation; the report style configuration function allows users to freely design the appearance of the report according to their needs, improving the flexibility of personalized settings; combined with built-in rules, the system can automatically generate layout information according to the specified style and ensure reasonable and beautiful typesetting; after combining the report layout information with the integration result, a complete report document is generated to ensure the matching of data presentation and format; finally, the report document is subjected to visualization enhancement processing, making the report more intuitive and easy to understand when displayed on the terminal, further improving the typesetting effect and display quality.
[0035] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. Brief Description of the Drawings
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0037] Figure 1 Schematic diagram of the application scenario of the report rendering method provided by the embodiment of the present invention;
[0038] Figure 2 Schematic flowchart of the report rendering method provided by the embodiment of the present invention;
[0039] Figure 3 Schematic sub - flowchart of the report rendering method provided by the embodiment of the present invention;
[0040] Figure 4 Schematic block diagram of the report rendering device provided by the embodiment of the present invention;
[0041] Figure 5 Schematic block diagram of the layout generation unit of the report rendering device provided by the embodiment of the present invention;
[0042] Figure 6 Schematic block diagram of the computer device provided by the embodiment of the present invention. Detailed Description of the Embodiments
[0043] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0044] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprise" indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0045] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in this specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0046] It should also be further understood that the term "and / or" used in the specification and appended claims of the present invention refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0047] Please refer to Figure 1 and Figure 2 , Figure 1 which is a schematic diagram of the application scenario of the report rendering method provided by an embodiment of the present invention. Figure 2 which is a schematic flowchart of the report rendering method provided by an embodiment of the present invention. This report rendering method is applied to a server. The server interacts with a terminal, supports custom report styles and layouts by integrating data from different sources, thereby achieving high flexibility and customization. Users can freely set various styles of the report, such as cover, table of contents, and title styles, through a graphical interface to meet different needs. Combining built-in rules, the method automatically generates and dynamically adjusts the report layout to ensure that the content of each module is rendered according to the adjusted layout. When the report document is generated, the integrated data will be accurately filled into the corresponding modules and assembled in sequence to ensure accuracy and aesthetics. Finally, through visual enhancement processing, the data is presented in the form of charts to further improve the typesetting ability and readability of the report.
[0048] Figure 2 is a schematic flowchart of the report rendering method provided by an embodiment of the present invention. As Figure 2 shown, this method includes the following steps S110 to S150.
[0049] S110. Obtain the data to be rendered from different sources and integrate them to obtain an integration result.
[0050] In this embodiment, the integration result refers to the result formed by integrating the data to be rendered from different sources in a specified format.
[0051] Specifically, obtain the data to be rendered from different sources, and organize and assemble them in a predefined JSON format to obtain an integration result.
[0052] In order to obtain the data to be rendered from different sources and organize and assemble them in a predefined JSON format to obtain an integration result, first, a flexible and extensible data receiving interface needs to be established. This interface can be compatible with multiple data sources, including but not limited to databases, file systems, network services, and other applications. This interface is responsible for listening and capturing data streams from various channels.
[0053] Once the data is received, a parsing process will be initiated. This process will perform a preliminary analysis of the raw data based on the characteristics and structure of each data source, identifying key information and the relationships between them. This step is crucial for ensuring data accuracy in subsequent steps.
[0054] Next, it enters the data conversion stage. In this stage, the module converts the parsed data elements into a unified internal representation form according to predefined rules and mapping strategies. This internal representation form is constructed based on a predefined JSON format, which stipulates which data items should be included, their naming methods, data types, and the hierarchical relationships between them, etc.
[0055] During the conversion process, some data cleaning work also needs to be performed, such as removing duplicate records, filling in missing values, correcting incorrect or abnormal data points, etc., to ensure that the finally output data set is clean and consistent.
[0056] After completing the above steps, assemble these converted and cleaned data according to the predefined JSON format. This means organizing all related data items into JSON-standard compliant objects or arrays, so that each data entry can be accurately described and located.
[0057] Finally, the generated JSON object represents the integration result of data obtained from multiple sources. It can be directly used for front-end display logic, such as chart rendering, list display, etc., or as an interaction medium with other systems, provided to services that need further processing or analysis.
[0058] S120. Configure the report style.
[0059] In this embodiment, various styles of the report are customized through a graphical interface. The various styles of the report include the cover, the back cover, the header and footer, the table of contents, and the styles corresponding to each level of headings.
[0060] Specifically, through the graphical interface, easily customize the cover, the back cover, the header and footer, the table of contents, each level of headings, the risk style, and the styles of various data modules of the document. The scope of style settings includes multiple aspects such as font size, color, data position, background color, data panel style, etc. For example, the user can design a unique background image for the cover, set the position, font size, Logo image, and watermark of the title, and can also set different display styles for different chapter modules.
[0061] In this embodiment, the style configuration adopts an intuitive and convenient graphical interface, aiming to help users achieve highly personalized customization of various parts of the document without having to write complex code or possess professional design knowledge. The user can access and adjust various style setting options through simple operations.
[0062] In the cover configuration module of the graphical interface, users can upload background images. The system supports common formats such as JPEG and PNG. After the user clicks on the upload area, they can select a local image file to import.
[0063] For setting the cover title, a text input box is provided. After the user enters the title content, they can adjust its coordinate values (with the upper left corner of the cover as the origin in the pixel coordinate system) to achieve precise positioning. The font size setting area allows users to enter a custom font size, which will update the display effect of the cover title in real time and be synchronously shown in the preview window for the user to adjust conveniently.
[0064] The cover element provides a function to upload a Logo image. After the user uploads the Logo, they can set its display position and can also adjust the transparency of the Logo image through a slider to coordinate with the background image effect. All adjustments will be reflected in real time in the preview window, and users can view and fine-tune until satisfied.
[0065] After enabling the watermark function, users can choose text watermark or image watermark. The content of the text watermark is set through an input box; for the image watermark, it supports uploading an image and optimizing it through methods such as transparency adjustment. The display effect of the watermark will be reflected in real time in the preview window to ensure that users can precisely control its effect.
[0066] The customization of the back cover style is similar to that of the cover, but it also has its uniqueness.
[0067] In the back cover design module, users can upload a back cover background image or choose a solid color background, and perform settings such as stretching, scaling, filling mode selection, and transparency adjustment. These adjustments will be immediately shown in the preview window of the back cover to help users create a visual effect that is coordinated with or in contrast to the cover.
[0068] If the back cover needs to add text such as copyright notices and publication information, users can enter the corresponding content in the back cover text input box and perform personalized settings on the font, font size, color, etc. Users can also adjust the placement position of the text through coordinate settings or dragging operations. All settings will be presented in real time in the back cover preview window to help users ensure that the content is clear and beautiful.
[0069] In the table of contents style setting module, users can first adjust the font style of the entire table of contents, including selecting preset styles, whether to display page numbers, etc. The effects of all settings will be immediately presented in the preview window of the table of contents for users to fine-tune.
[0070] For each level of heading entry in the table of contents, the user can select a specific table of contents level (such as the first-level heading, second-level heading, etc.) and customize its font, font size, color, etc. separately. In addition, the user can choose a beautiful style to make the table of contents structure clearer, more hierarchical, and easier to read. All settings will be updated in real time in the table of contents preview window, and the user can adjust them at any time.
[0071] In the body text style setting area, the user can set the font size and color for various data modules (such as text paragraphs, tables, charts, etc.). The user selects an appropriate font size through the font size drop-down menu and uses the color picker to set different colors for different data elements (such as body text, important data, chart titles, etc.) to highlight key points and improve the information transmission efficiency. In addition, important data can be stylistically enhanced by bolding, etc. All setting effects will be reflected in the body text data module in real time, and the user can adjust according to the document requirements.
[0072] The user can freely adjust the position of the data module in the body text, such as changing the order of the modules, to ensure that the typesetting of the body text content conforms to the overall logic and reading order of the document. All position adjustment operations will be presented in real time in the body text area to help the user instantly optimize the typesetting.
[0073] For specific elements in the body text (such as a single table, a specific text area, etc.), the user can select a background color and adjust the background color through the color picker to enhance the visual appeal. For tables, the background colors of odd and even rows can also be set to make the data more readable. After the setting is completed, the background color effect will be updated in real time to help the user optimize the document appearance and ensure both readability and aesthetics.
[0074] Through the rich operation options provided by the graphical interface, the user can flexibly customize the styles of the cover, back cover, header, footer, table of contents, headings at all levels, and body text data modules, realizing the personalized design of the document, meeting the needs of different users in various application scenarios, and thus demonstrating the innovation and practicality of this patent application in document style configuration.
[0075] S130. Generate report layout information according to the report style and built-in rules.
[0076] In this embodiment, the report layout information refers to a set of instructions or parameter sets that define the positions, sizes, and relative relationships between various data modules in the final document. It not only determines where each module should be placed but also ensures the logicality, aesthetics, and readability of the entire document structure.
[0077] In one embodiment, please refer to Figure 3 , the above step S130 may include steps S131 to S133.
[0078] S131. Use the identifier resolver to search for the built-in rule library to quickly locate the specific processing rule that matches the report style in the rule library.
[0079] In this embodiment, when the system receives the module information with identifiers passed from the graphical user interface, it is first necessary to parse the identifiers and associated attributes in this information. This process is executed by the identifier resolver, which will quickly locate the specific processing rule that matches the current report style from the built-in rule library. The rule library is a set of processing guidelines pre-written based on a large number of common report requirements, covering the processing methods for different types of module identifiers. This means that no matter what combination of styles the user selects, the system can find the corresponding rule to guide the subsequent operations.
[0080] S132. Construct a preliminary layout of the report template according to the body processing rule, and dynamically adjust the preliminary layout to obtain an adjusted layout.
[0081] In this embodiment, once the appropriate processing rule is determined, the next step is to use these rules to construct a preliminary layout of the report template. This step involves arranging all necessary elements in a preset manner to form a basic framework. However, since the user may add or delete data modules at any time, the preliminary layout is not fixed; on the contrary, it is a dynamic process. Whenever the user makes a modification to the content, the layout generator will start the adaptive algorithm to automatically adjust the template layout to adapt to the new changes. For example, if the user adds a new data table to the body part, the layout generator will allocate appropriate space for the table and adjust the positions and sizes of other modules accordingly to maintain the overall coordination and logical order of the page.
[0082] S133. Render the content of each module in the report in sequence according to the adjusted layout to form a temporary template, so as to obtain the report layout information.
[0083] In this embodiment, finally, after the layout adjustment is completed, the system will render the content of each module in the report in sequence according to the adjusted layout. This process includes reading the style settings configured by the user, and precisely arranging the position of each component according to the size of the new module and its relationship with other elements. As each module is drawn one by one, a temporary template is finally formed, and this template is what we call the "report layout information". It not only reflects all the visual and structural preferences selected by the user, but also ensures the harmony and unity among the various components within the document, making the finally generated report both meet the user's expectations and have a professional appearance quality.
[0084] In summary, through the above three-step process - namely, searching for matching rules, constructing and adjusting the preliminary layout, and rendering the module content - the system can effectively convert the user's style selections into specific layout instructions, thus achieving automated and highly customized report generation.
[0085] S140. Generate a report document based on the report layout information and the integration result.
[0086] In this embodiment, the report document refers to a complete, standardized, and beautifully formatted file. It not only contains all the data modules and their styles set by the user through the graphical user interface (GUI), but also ensures that the modules are closely connected in a predefined logical order with natural transitions, thus forming a document with a reasonable structure, rich content, and easy to read and print.
[0087] Specifically, fill the integration result into each corresponding module in the report, and assemble the filled modules in order according to the report layout information to obtain the report document.
[0088] Each of the modules corresponding to these reports has undergone identification parsing and processing, that is, they are assigned specific identifiers to determine their logical positions and relationships in the final document. The next task is to assemble and integrate these prepared modules according to the logical order indicated by the identifiers to construct a complete report template. This process strictly follows the processing rules mentioned in the previous steps to ensure that the connection between each module is tight and natural, such as the typesetting coherence between chapter titles and the text, and the reasonable matching of charts and surrounding text descriptions, etc., so as to ensure the fluency and consistency of the entire document.
[0089] After completing the above assembly, the next step is to fill the generated report template into a Word document and simultaneously render it as a PDF document. The key to this step is to ensure the perfect combination of data and styles, so that the final output Word document not only has accurate content, but also has beautiful typesetting and standardized formats. To further improve the user experience, the system is also responsible for processing the page settings of the document, such as adjusting parameters such as paper size and margins to meet the printing or reading needs in different scenarios. Therefore, the generated report document is not only a carrier of information, but also a carefully designed work aimed at providing the best visual effect and user experience.
[0090] S150. Perform visual enhancement processing on the report document and output the processing result to the terminal for display.
[0091] In this embodiment, automatic feature analysis and visualization services are performed on the numerical and relational data in the integration result. Chart types and styles are intelligently recommended and manual configuration is allowed to obtain charts, and the charts are inserted into the report document to obtain a processing result, and the processing result is output to the terminal for display.
[0092] Specifically, by combining automation and user interaction, the intuitiveness and readability of the report document are significantly improved. Specifically, this step involves automatic feature analysis and visualization services for numerical and relational data in the integration result, as well as intelligent recommendation and allowing manual configuration of chart types and styles, and finally accurately inserting the generated charts into the corresponding positions in the report document. The following elaborates on this process in detail:
[0093] For the numerical data (such as sales figures, financial metrics) and relational data (such as customer behavior patterns, market trend correlations) in the integration result, the system will first perform automated feature analysis. This analysis can identify the key attributes and patterns of the data, such as distribution, trend, outliers, etc., and based on this information, intelligently recommend the most suitable chart types. The recommended charts may include but are not limited to bar charts, line charts, pie charts, scatter plots, etc., and each chart helps to highlight different types of insights or data stories.
[0094] Despite the automatic recommendation function, the system also supports users to manually select chart types according to personal needs or preferences and fully configure the styles of the charts. This means that users can adjust details such as color schemes, font sizes, axis labels, data point styles, etc., to ensure that the charts are not only beautiful but also accurately convey the required information. This flexibility enables the generated visual charts to better meet specific business needs or visual style requirements.
[0095] After the charts are created, the system will accurately insert these visual elements into the appropriate positions in the report document. This process needs to consider the relationship between the charts and the surrounding text content to ensure the coherence of the layout and the beauty of the overall layout. In addition, the addition of charts also enhances the intuitiveness and readability of the report, making it easier for readers to understand and absorb complex data information.
[0096] Finally, the "processing result" obtained through the above steps refers to the complete report document that has been enhanced by visualization. This document not only contains the original text content and data analysis but also incorporates carefully designed charts, making the data presentation more vivid and direct. Subsequently, this processing result will be output to the user's terminal device for display, allowing the user to instantly preview the final effect. For the user, this is not only an opportunity to view the document but also an important step to verify whether the charts meet the expectations and whether further adjustments are needed.
[0097] In summary, in step S150, the "processing result" refers to the version of the report document after visualization enhancement processing, which integrates functions such as automatic feature analysis, intelligent chart recommendation, user-defined configuration, and precise chart insertion, thereby providing users with a beautiful and insightful data presentation method.
[0098] The method of this embodiment realizes the full dynamic style configuration of the report cover, back cover, header, footer, and other modules. Users can adjust the style configuration at any time without re-designing the entire report template. This dynamic nature depends on separating the style, data, and template, and simultaneously constructing a real-time style mapping mechanism. For example, when the user adjusts the font color of the header, the system will automatically update the color of all headers in the document without affecting the content or style of other parts. In addition, the system supports the style inheritance and override mechanism. Users can define global styles and make personalized style adjustments to specific modules, ensuring both the consistency of the report style and meeting the personalized needs of local styles. Adopting the modular design concept, each data module is an independent unit with clear functions and interfaces. Users can easily add, delete, or modify data modules without affecting the functions of other modules. For example, users can easily add a module for comparing fiscal and tax invoice caliber revenues or delete the invoice risk module that is no longer needed. In addition, the data interaction and collaboration mechanism between modules is flexible and efficient. Modules can share the data provided by the data processing module and pass the processed data to other modules that need it or directly use it for report generation. For example, the visualization module can utilize the sales data in the data processing module to generate a sales trend chart and insert it into the corresponding part of the report. The method of this embodiment has a data chart drawing function. The system can automatically recommend the best visualization method according to the type, distribution, and correlation of the data. For example, if the data is time-series data, the system will preferentially recommend a line chart or a bar chart; if the data shows the proportion relationship of each part, the system will recommend a pie chart or a donut chart. In addition, the system supports real-time preview and interactive editing. Users can immediately view the effect when adjusting the chart style and quickly optimize and adjust it. The interactive editing tool helps users explore the data more deeply and enhance the chart display effect.
[0099] The method of this embodiment enables users to quickly adjust the report style and structure according to different requirements and business changes, and easily generate personalized reports that meet the requirements of specific scenarios. This greatly improves the efficiency and adaptability of report generation.
[0100] Rich style configuration options and intelligent visualization capabilities make the generated reports more professional and aesthetically pleasing in appearance, helping to better present the data value and connotation, thereby enhancing the persuasiveness and influence of the reports.
[0101] By combining intuitive visual charts with text content, it helps readers understand the trends and information behind the data more quickly and accurately, providing stronger support for decision-making.
[0102] The graphical style configuration interface and intelligent modules enable non-technical personnel to easily operate and generate high-quality reports, thereby reducing the dependence on technical professionals and enhancing the collaboration efficiency of enterprises or organizations.
[0103] The innovative two-way data binding style engine allows users to instantaneously modify the style of any element during the report generation process and preview the effects in real time. Based on data characteristics and the existing style template library, the system automatically recommends suitable style combinations for the current data display. Functions such as data reading, conversion, cleaning, and integration are encapsulated into independent modules, supporting the unified processing of data from different sources. Modules can be flexibly combined and collaborated according to report requirements, enhancing the flexibility and efficiency of report generation. The pluggable report component library includes common report elements (such as tables, charts, etc.), and users can freely combine these components to generate customized reports.
[0104] Through the above technological innovations, the system has achieved intelligent, modular, and highly adaptive style management, data processing, and report generation, significantly improving the user experience, enhancing the scalability and practicality of the system, and setting a new benchmark in the field of report generation.
[0105] The above-mentioned report rendering method, by flexibly integrating the data to be rendered from different data sources, the system can dynamically adjust the data processing method to achieve highly customized content presentation; the report style configuration function allows users to freely design the appearance of the report according to their needs, enhancing the flexibility of personalized settings; combined with built-in rules, the system can automatically generate layout information according to the specified style and ensure reasonable and beautiful typesetting; after combining the report layout information with the integration result, a complete report document is generated to ensure the matching of data presentation and format; finally, the report document undergoes visual enhancement processing, making the report more intuitive and easy to understand when displayed on the terminal, further improving the typesetting effect and display quality.
[0106] Figure 4 It is a schematic block diagram of a report rendering device 300 provided by an embodiment of the present invention. As Figure 4 shown, corresponding to the above report rendering method, the present invention also provides a report rendering device 300. The report rendering device 300 includes units for executing the above report rendering method, and the device can be configured in a server. Specifically, please refer to Figure 4 , the report rendering device 300 includes an acquisition unit 301, a configuration unit 302, a layout generation unit 303, a document generation unit 304, and a visualization unit 305.
[0107] An acquisition unit 301 for acquiring to-be-rendered data from different sources and integrating them to obtain an integration result; a configuration unit 302 for configuring a report style; a layout generation unit 303 for generating report layout information according to the report style in combination with built-in rules; a document generation unit 304 for generating a report document according to the report layout information and the integration result; a visualization unit 305 for performing visualization enhancement processing on the report document and outputting the processing result to a terminal for display.
[0108] In one embodiment, the acquisition unit 301 is configured to acquire to-be-rendered data from different sources, and organize and assemble them in a predefined JSON format to obtain an integration result.
[0109] In one embodiment, the layout generation unit 303 includes a positioning subunit 3031, an adjustment subunit 3032, and a rendering subunit 3033.
[0110] The positioning subunit 3031 is configured to use an identifier resolver to search an internal rule library to quickly locate a specific processing rule that matches the report style in the rule library; the adjustment subunit 3032 is configured to construct a preliminary layout of a report template according to the body processing rule and dynamically adjust the preliminary layout to obtain an adjusted layout; the rendering subunit 3033 is configured to render the content of each module in the report in sequence according to the adjusted layout to form a temporary template, so as to obtain report layout information.
[0111] In one embodiment, the document generation unit 304 is configured to fill the integration result into the corresponding modules in the report, and assemble the filled modules in sequence according to the report layout information to obtain a report document.
[0112] In one embodiment, the visualization unit 305 is configured to perform automatic feature analysis and visualization services on the numerical and relational data in the integration result, intelligently recommend and allow manual configuration of chart types and styles to obtain charts, and insert the charts into the report document to obtain a processing result, and output the processing result to a terminal for display.
[0113] It should be noted that those skilled in the art can clearly understand that the specific implementation processes of the above report rendering device 300 and each unit can refer to the corresponding descriptions in the foregoing method embodiments. For the sake of convenience and brevity of description, they will not be elaborated here.
[0114] The above report rendering device 300 can be implemented in the form of a computer program, and the computer program can run on a computer device as shown in Figure 6 shown.
[0115] Please refer toFigure 6 , Figure 6 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 may be a server. Among them, the server may be an independent server or a server cluster composed of multiple servers.
[0116] Referring to Figure 6 , the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501. Among them, the memory may include a non-volatile storage medium 503 and an internal memory 504.
[0117] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions. When the program instructions are executed, the processor 502 can be caused to execute a report rendering method.
[0118] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
[0119] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can be caused to execute a report rendering method.
[0120] The network interface 505 is used for network communication with other devices. Those skilled in the art can understand that Figure 6 the structure shown in
[0121] is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0122] Obtain to-be-rendered data from different sources and integrate them to obtain an integration result; configure a report style; generate report layout information according to the report style and built-in rules; generate a report document according to the report layout information and the integration result; perform visual enhancement processing on the report document and output the processing result to a terminal for display.
[0123] In an embodiment, when the processor 502 implements the step of obtaining to-be-rendered data from different sources and integrating them to obtain an integration result, the specific implementation steps are as follows:
[0124] Obtain the data to be rendered from different sources, and organize and assemble them in accordance with a predefined JSON format to obtain an integration result.
[0125] In one embodiment, when the processor 502 implements the step of the configuration report style, the specific implementation steps are as follows:
[0126] Customize various styles of the report through a graphical interface, and the various styles of the report include the cover, the back cover, the header and footer, the table of contents, and the styles corresponding to each level of headings.
[0127] In one embodiment, when the processor 502 implements the step of generating report layout information according to the report style and built-in rules, the specific implementation steps are as follows:
[0128] Use an identity resolver to search for a built-in rule library to quickly locate the specific processing rules matching the report style in the rule library; construct a preliminary layout of the report template according to the body processing rules, and dynamically adjust the preliminary layout to obtain an adjusted layout; render the content of each module in the report in sequence according to the adjusted layout to form a temporary template, so as to obtain report layout information.
[0129] In one embodiment, when the processor 502 implements the step of generating a report document according to the report layout information and the integration result, the specific implementation steps are as follows:
[0130] Fill the integration result into the corresponding modules in the report, and assemble the filled modules in sequence according to the report layout information to obtain a report document.
[0131] In one embodiment, when the processor 502 implements the step of performing visual enhancement processing on the report document and outputting the processing result to a terminal for display, the specific implementation steps are as follows:
[0132] Perform automatic feature analysis and visualization services on the numerical and relational data in the integration result, intelligently recommend and allow manual configuration of the chart type and style to obtain a chart, insert the chart into the report document to obtain a processing result, and output the processing result to a terminal for display.
[0133] It should be understood that in the embodiments of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0134] Those of ordinary skill in the art can understand that all or part of the processes in the methods of implementing the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, and the storage medium is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0135] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps:
[0136] Obtain the to-be-rendered data from different sources and integrate them to obtain an integration result; configure the report style; generate report layout information according to the report style and built-in rules; generate a report document according to the report layout information and the integration result; perform visual enhancement processing on the report document and output the processing result to a terminal for display.
[0137] In an embodiment, when the processor executes the computer program to implement the step of obtaining the to-be-rendered data from different sources and integrating them to obtain an integration result, the specific implementation is as follows:
[0138] Obtain the to-be-rendered data from different sources and organize and assemble them in a predefined JSON format to obtain an integration result.
[0139] In an embodiment, when the processor executes the computer program to implement the step of configuring the report style, the specific implementation is as follows:
[0140] Customize various styles of the report through a graphical interface, and the various styles of the report include the cover, the back cover, the header and footer, the table of contents, and the styles corresponding to each level of headings.
[0141] In one embodiment, when the processor executes the computer program to implement the step of generating report layout information according to the report style and built-in rules, the following specific steps are implemented:
[0142] Use an identifier resolver to search for a built-in rule library to quickly locate specific processing rules in the rule library that match the report style; construct a preliminary layout of the report template according to the body processing rules, and dynamically adjust the preliminary layout to obtain an adjusted layout; render the content of each module in the report in sequence according to the adjusted layout to form a temporary template, so as to obtain report layout information.
[0143] In one embodiment, when the processor executes the computer program to implement the step of generating a report document according to the report layout information and the integration result, the following specific steps are implemented:
[0144] Fill the integration result into the corresponding modules in the report, and assemble the filled modules in sequence according to the report layout information to obtain a report document.
[0145] In one embodiment, when the processor executes the computer program to implement the step of performing visual enhancement processing on the report document and outputting the processing result to a terminal for display, the following specific steps are implemented:
[0146] Perform automatic feature analysis and visualization services on the numerical and relational data in the integration result, intelligently recommend and allow manual configuration of chart types and styles to obtain charts, insert the charts into the report document to obtain a processing result, and output the processing result to a terminal for display.
[0147] The storage medium can be various computer-readable storage media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes.
[0148] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0149] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0150] The steps in the method embodiments of the present invention can be adjusted, combined, and deleted according to actual needs. The units in the device embodiments of the present invention can be combined, divided, and deleted according to actual needs. In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0151] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0152] As mentioned above, the above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art in the technical field of the embodiments of the present invention can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. Report rendering method, characterized in that, include: Obtaining data to be rendered from different sources and integrating them to obtain an integrated result; Configure report style; Generate report layout information according to the report style combined with built-in rules; Generate a report document according to the report layout information and the integration result; The report document is subjected to visual enhancement processing, and the processing result is output to a terminal for display.
2. The report rendering method according to claim 1, characterized in that: The obtaining of the data to be rendered from different sources and integrating them to obtain an integrated result includes: Obtain the data to be rendered from different sources, organize and assemble them according to the predefined JSON format to obtain the integrated result.
3. The report rendering method according to claim 1, characterized in that: The configuration report style includes: Customize various report styles through a graphical interface, including the cover, back cover, header and footer, directory, and styles corresponding to each level of title.
4. The report rendering method according to claim 1, characterized in that: The generating report layout information according to the report style and built-in rules includes: Using an identifier resolver to search a built-in rule base, so as to quickly locate a specific processing rule matching the report style in the rule base; Constructing a preliminary layout of a report template according to the body processing rule, and dynamically adjusting the preliminary layout to obtain an adjusted layout; The contents of each module in the report are rendered in sequence according to the adjusted layout to form a temporary template to obtain the report layout information.
5. The report rendering method according to claim 4, characterized in that: The generating a report document according to the report layout information and the integration result includes: The integration results are filled into the corresponding modules in the report, and the filled modules are assembled in sequence according to the report layout information to obtain a report document.
6. The report rendering method according to claim 1, characterized in that: The step of performing visual enhancement processing on the report document and outputting the processing result to a terminal for display includes: Automatic feature analysis and visualization services are performed on the numerical and relational data in the integration results, intelligently recommending and allowing manual configuration of chart types and styles to obtain charts, and inserting the charts into the report document to obtain processing results, and outputting the processing results to the terminal for display.
7. Report rendering device, characterized in that, include: An acquisition unit, used for acquiring data to be rendered from different sources and integrating them to obtain an integrated result; Configuration unit, used to configure the report style; A layout generation unit, used to generate report layout information according to the report style in combination with built-in rules; A document generating unit, configured to generate a report document according to the report layout information and the integration result; The visualization unit is used to perform visualization enhancement processing on the report document and output the processing result to the terminal for display.
8. The report rendering device according to claim 7, characterized in that: The acquisition unit is used to acquire the data to be rendered from different sources, and to sort and assemble the data according to a predefined JSON format to obtain an integrated result.
9. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.