Visual report generation method and device, equipment and storage medium

By receiving project report generation requests and data, and using device type and layout constraint rules for data transformation and genetic algorithm optimization, the report layout is automatically adjusted, solving the inefficiency problem caused by manual layout adjustment in existing technologies, and achieving efficient generation of compliant visual reports.

CN121580964APending Publication Date: 2026-02-27启朔(深圳)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511514896.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

When generating project reports using existing technologies, the layout needs to be manually adjusted to conform to the specifications of different companies or users, resulting in low typesetting efficiency and affecting the professionalism and credibility of the reports.

Method used

By receiving project report generation requests and data, data transformation is performed using device type and layout constraint rules to generate visual charts. Furthermore, a genetic algorithm is used to optimize the layout, automatically adjusting the report layout to adapt to different device types and generating visual reports with the best reading experience.

Benefits of technology

It enables the generation of optimal report layouts that conform to equipment and enterprise standards without manual adjustments, improving report layout efficiency and professionalism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580964A_ABST
    Figure CN121580964A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a visual report generation method and device, equipment and a storage medium. The method comprises the steps of receiving a generation request of a project report and project data, wherein the generation request comprises a first equipment type of a target terminal for displaying the project report and a preset layout constraint rule; performing data conversion by utilizing the project data and a preset visual chart format to obtain target visual chart data of the project data, and transmitting the target visual chart data into a preset rendering engine to generate a first visual chart; performing layout optimization according to the layout constraint rule, the first equipment type and a layout optimization algorithm to obtain an optimal report layout corresponding to the optimal reading experience of the user under the first equipment type; and performing report generation processing based on the first visual chart and the optimal report layout to obtain a target visual report. Through the mode, the optimal report layout is obtained based on the equipment type of the display terminal, the layout constraint rule and the layout optimization algorithm, and the report typesetting efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of intelligent project management, and in particular to a visual report generation method and device, equipment and a storage medium. BACKGROUND

[0002] Currently, when generating a project report, a general version is usually generated. When different enterprises or users want to use it, manual adjustment of the layout is required to obtain a report layout that meets their respective specifications, resulting in low layout efficiency and bringing many inconveniences to users. This not only increases the workload, but also may cause errors in subsequent manual adjustment of the report, affecting the professionalism and credibility of the report. SUMMARY

[0003] The main purpose of the present application is to provide a visual report generation method and device, equipment and a storage medium, which can solve the problem of low efficiency of project report layout in the prior art.

[0004] To achieve the above purpose, the first aspect of the present application provides a visual report generation method, which comprises: receiving a project report generation request and project data, wherein the generation request comprises a first device type of a target terminal for displaying the project report and a preset layout constraint rule; performing data conversion using the project data and a preset visual chart format to obtain target visual chart data of the project data; transmitting the target visual chart data into a preset rendering engine to generate a first visual chart; performing layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm to obtain an optimal report layout, wherein the optimal report layout is used to indicate a report layout corresponding to the best reading experience of a user in the first device type; performing report generation processing based on the first visual chart and the optimal report layout to obtain a target visual report.

[0005] In a feasible implementation manner, the layout optimization according to the layout constraint rule, the first device type and the layout optimization algorithm to obtain the optimal report layout comprises: determining a display interface size corresponding to the first device type; taking the layout constraint rule and the display interface size as initial constraint conditions; initializing the number of individuals in a report layout population under the initial constraint conditions, wherein each individual corresponds to a candidate report layout; determining a target reading line and a target information density of each candidate report layout; The fitness of each candidate report layout is determined based on the target reading path, target information density, and a preset fitness algorithm. Determine the optimal report layout based on the fitness level; If N is less than or equal to the preset iteration number threshold, then let N = N + 1, and perform crossover and mutation operations based on the optimal report layout to generate a new generation of report layout population, and return to execute the step of determining the target reading path and target information density of each candidate report layout, where N is the current iteration number and the initial value of N is 1; If N is greater than the preset iteration number threshold, then the optimal report layout is output.

[0006] In one feasible implementation, determining the target reading path and target information density for each candidate report layout includes: Using the correspondence between the report layout and reading path determined in a pre-experiment and the candidate report layouts, the target reading path corresponding to each candidate report layout is determined; By utilizing the correspondence between report layout and information density determined in a pre-experiment and the candidate report layouts, the target information density corresponding to each candidate report layout is determined.

[0007] In one feasible implementation, if the visualization chart is an interactive visualization chart, then the method further includes: When a user interacts with the first visual chart, the pixel coordinates of the interaction position corresponding to the interaction are determined. Based on the pixel coordinates and the first visualization chart, the data dimensions and data filtering conditions that the user is interested in are parsed out. Using the data dimensions and data filtering conditions, generate GraphQL query statements; Based on the GraphQL query statement, the project data is aggregated and calculated to obtain the target data slice; The first visualization chart is updated based on the target data slice to obtain a second visualization chart that the user is interested in, and the second visualization chart is displayed.

[0008] In one feasible implementation, the method further includes: During the presentation of the target visualization report, the equipment characteristics of the actual display device are monitored; Based on the device characteristics and the preset responsive breakpoint detection rules, the second device type of the actual display device is determined; Determine whether the second device type and the first device type are the same device type; If the second device type is not the same as the first device type, a target layout adjustment rule corresponding to the second device type is determined according to the second device type and a preset correspondence between device types and layout adjustment rules. The layout of the target visual report is adjusted according to the target layout adjustment rule, and a target visual report adapted to the second device type is obtained.

[0009] In an implementation, the target visual chart data is transmitted into a preset rendering engine to generate a visual chart, including: If the visual chart format is a 2D chart, the target visual chart data is transmitted into a preset 2D rendering engine to generate a 2D visual chart. If the visual chart format is a 3D chart, the target visual chart data is transmitted into a preset 3D rendering engine to generate a 3D visual chart.

[0010] In an implementation, the method further includes: A report set is generated according to a preset file format and the target visual report, the report set including target visual reports in multiple file formats, the file formats including at least an HTML format, a PDF format and a PNG format.

[0011] To achieve the above object, the second aspect of the present application provides a visual report generation device, including: A data input module is configured to receive a project report generation request and project data, the generation request including a first device type of a target terminal for displaying the project report and a preset layout constraint rule. A data conversion module is configured to perform data conversion on the project data according to a preset visual chart format, to obtain target visual chart data of the project data. A chart rendering module is configured to transmit the target visual chart data into a preset rendering engine to generate a first visual chart. A layout optimization module is configured to perform layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm, to obtain an optimal report layout, the optimal report layout being used to indicate a report layout corresponding to the best reading experience of a user in the first device type. A report generation module is configured to perform report generation processing based on the first visual chart and the optimal report layout, to obtain a target visual report.

[0012] To achieve the above object, the third aspect of the present application provides a computer readable storage medium, which stores a computer program, and the computer program, when executed by a processor, causes the processor to perform the steps of the first aspect and any possible implementation.

[0013] To achieve the above object, the fourth aspect of the present application provides a computer device, which comprises a memory and a processor, and the memory stores a computer program, and the computer program, when executed by the processor, causes the processor to perform the steps of the first aspect and any possible implementation.

[0014] The embodiment of the present application has the following beneficial effects: The present application provides a method for generating a visual report, which comprises: receiving a generation request of a project report and project data, the generation request comprising a first device type of a target terminal for displaying the project report and a preset layout constraint rule; performing data conversion on the project data and a preset visual chart format to obtain target visual chart data of the project data; inputting the target visual chart data into a preset rendering engine to generate a first visual chart; performing layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm to obtain an optimal report layout, the optimal report layout being used for indicating a report layout corresponding to a best reading experience of a user in the first device type; and performing report generation processing based on the first visual chart and the optimal report layout to obtain a target visual report. In this way, the layout optimization can be performed based on the device type of the display terminal, the layout constraint rule and the layout optimization algorithm to obtain the optimal report layout, so that the optimal report layout meeting the device type and the layout constraint rule can be obtained without manual adjustment of the layout, thereby improving the report layout efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0016] Among them: Figure 1 A flow chart of a method for generating a visual report in an embodiment of the present application; Figure 2 A structure block diagram of a device for generating a visual report in an embodiment of the present application; Figure 3 A structure block diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0017] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0018] Please refer to Figure 1 , Figure 1 A flowchart of a method for generating a visual report in an embodiment of the present application. The method can be applied to a terminal or a server. The terminal can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a notebook computer, etc. The server can be implemented by an independent server or a server cluster composed of multiple servers. The present embodiment is illustrated by taking application to a terminal as an example. As shown in the method Figure 1 includes the following steps: 101. Receive a generation request of a project report and project data. The generation request includes a first device type of a target terminal for displaying the project report and a preset layout constraint rule. It should be noted that the project referred to in the present application can be an IT development project or an AI development project, etc. The project report is a project report of a software development project, such as a development project of an e-commerce platform or a medical AI development project, etc.

[0019] Further, the method for generating a visual report shown in the present application can assist a user in automatically generating a project report, receiving project data in real time, and generating a project report. The generation request of the project report can be initiated by the user on an interactive interface, or can be automatically initiated by a computer, such as generating a report generation request when new project data is generated to generate a new report with new project data. This is not limited.

[0020] In order to meet the respective standard report layouts of different users and improve the typesetting efficiency, the generation request can carry the first device type of the target terminal for displaying the project report and the preset layout constraint rule. The first device type can be a PC, a mobile phone, or a tablet computer, etc. The layout constraint rule can be extracted from the report template of different users (such as the enterprise VI specification of each enterprise) to perform corresponding layout and typesetting as the layout constraint rule, or a preset interactive position is provided for the user to make a basic design of the report as the layout constraint rule. This is not limited.

[0021] The project data includes, but is not limited to, various data in the development process of the project, whether generated by the project itself or the project operating environment, wherein the project data at least includes risk quantification results and strategy optimization results, wherein the risk quantification results include risk weights of various development links such as requirement changes (weight 0.35) and technical debt (weight 0.28), and the strategy optimization results include, but are not limited to, Pareto frontier solution set (5 groups of strategies). The enterprise VI specification: font / color / LOGO position design specification. That is, the layout constraint rules include, but are not limited to, the font / color / LOGO position design specification.

[0022] 102. Data conversion is performed using the project data and a preset visualization chart format to obtain target visualization chart data of the project data; 103. The target visualization chart data is transmitted into a preset rendering engine to generate a first visualization chart; Further, the project data is converted into a data format of a visualization chart to generate a visualization chart. Specifically, data conversion is performed using the project data and a preset visualization chart format to obtain target visualization chart data of the project data, and the target visualization chart data is transmitted into a preset rendering engine to generate a first visualization chart, wherein the visualization chart format can be a visualization special format, including but not limited to Vega-Lite format, which is used to generate column charts, line charts, heat maps and other visualization charts.

[0023] For example, the data analysis module converts the original data into a {values: [], dimensions: []} structure; the format standardization applies Vega-Lite specification; the Vega-Lite converter outputs JSON specification conforming to 15 preset templates; the visualization specification output generates declarative configuration containing Sankey diagram / heat map elements; the WebGL rendering pipeline calls the WebGLRenderer object of Three.js; GPU accelerated rendering achieves an efficiency improvement of η=68.75%; the interactive canvas supports perspective rotation and scaling.

[0024] Vega-Lite is a declarative language used to create, save and share interactive visualization charts. It provides a concise syntax to specify data visualization, and the chart specified by the syntax can be rendered into an interactive web visualization. The system converts the preprocessed data into Vega-Lite format, which defines the type of chart, data fields, coordinate axes, color coding and other key elements. The converted data can be parsed by the Vega-Lite rendering engine and generate corresponding visualization charts, ensuring that the generation of charts has high consistency and predictability.

[0025] In an implementation, the application can generate a 2D visualization chart or a 3D visualization chart, step 103, including: if the visualization chart format is a 2D chart, transmitting the target visualization chart data into a preset 2D rendering engine to generate a 2D visualization chart; if the visualization chart format is a 3D chart, transmitting the target visualization chart data into a preset 3D rendering engine to generate a 3D visualization chart.

[0026] It should be noted that the visualization rendering engine of the application supports 2D / 3D mode switching, has 15 preset chart templates (column chart / sankey chart / heat map, etc.) built-in, and supports mode switching based on actual needs. The 2D rendering engine includes D3.js, the 3D rendering engine includes Three.js, and the rendering process is accelerated by GPU.

[0027] For example, the processing of the hybrid rendering engine includes the following 1 to 17 links, specifically as follows: 1) Raw data input: receiving risk quantification results and strategy solution set; 2) Risk quantification data injection: transmitting parameters such as demand change weight 0.35 and technical debt weight 0.28; 3) D3 / Three mode selector: supporting 2D / 3D mode switching; 4) Rendering mode instruction: generating configuration parameters containing chart_type=threejs|d3; 5) Data analysis module: converting raw data into {values: [], dimensions: []} structure; 6) Format standardization: applying Vega-Lite specification; 7) Vega-Lite converter: outputting JSON specification conforming to 15 preset templates; 8) Visualization specification output: generating declarative configuration containing elements such as sankey chart / heat map, etc.; 9) WebGL rendering pipeline: calling WebGLRenderer object of Three.js; 10) GPU accelerated rendering: achieving 68.75% efficiency improvement; 11) Interactive canvas: supporting view rotation and scaling; 12) User switching event: capturing mode switching click event to form an interactive closed loop; 13) WebSocket service: establishing low-latency bidirectional communication; 14) Real-time data push: transmitting Avro data with compression rate >80%; 15) Frame rate monitoring: continuously detecting FPS≥60; 16) Performance optimization controller: Dynamically adjusts the LOD level of geometry; 17) Dynamically adjust rendering parameters: Automatically degrade rendering quality based on load.

[0028] The mode switching closed loop is 12→4→3→5→11, which realizes dynamic switching of rendering modes. Real-time closed-loop update: 14→3→7→9→11, ensuring data updates and rendering are synchronized; Performance optimization closed loop: 15→16→17→9, forming an adaptive adjustment of rendering parameters.

[0029] 104. Optimize the layout according to the layout constraint rules, the first device type and the layout optimization algorithm to obtain the optimal report layout. The optimal report layout is used to indicate the report layout corresponding to the best reading experience for the user under the first device type. Furthermore, to provide the best reading experience for users, layout optimization is performed based on the layout constraint rules, the first device type, and the layout optimization algorithm to obtain the optimal report layout. This optimal report layout is then used to indicate the best reading experience for users under the first device type. The layout optimization algorithm can be a genetic algorithm, which is used to obtain the optimal report layout.

[0030] For example, step 104 includes steps A01 to A08: A01. Determine the display interface size corresponding to the first device type; A02. Use the layout constraint rules and the display interface size as initial constraint conditions; It is understandable that the display interface size of the report is fixed when displayed on an electronic device, so this display interface size needs to be used as a constraint on the layout. Furthermore, different companies have different layout constraint rules, which should also be included as layout constraints. These layout constraint rules and the display interface size are used as the initial constraints for the genetic algorithm.

[0031] A03. Under the initial constraints, initialize the number of individuals in the report layout population, with each individual corresponding to a candidate report layout; After obtaining the initial constraints, the population of the genetic algorithm can be initialized under the initial constraints to generate an initial number of individuals. At this time, each individual represents a report layout, and each report layout is a candidate, from which the best layout is selected.

[0032] A04. Determine the target reading flow and target information density for the layout of each candidate report; In order to select the report layout corresponding to the best reading experience, the application screens through the reading path and information density of the report layout, and specifically, determines the target reading path and target information density of each candidate report layout. Both are optimized through fitness function weights (a=0.6, b=0.4), and finally the layout is realized to meet the user's reading habits and ensure efficient information transmission.

[0033] Wherein, the definition of reading path: the reading path refers to the rationality of the visual moving path when the user browses the visual report. It is quantitatively evaluated through eye tracking experiment data to ensure that the visual path conforms to the natural reading habit (such as Z-shaped browsing), thereby improving the information readability and user efficiency.

[0034] Collection and determination of reading path: Collection means: the reading path is quantified through the visual path data of the user collected by the eye tracking experiment, and the genetic algorithm is further used to quantitatively evaluate and select the best layout.

[0035] Specific process: 1) Experimental design: The user browses the visual report of different layout schemes, and records the eye movement trajectory (such as fixation point distribution, saccade path).

[0036] The experimental data includes fixation duration, path continuity, key information positioning efficiency and other indicators.

[0037] 2) Data quantification: Map the eye movement data to the reading path score (0-1 interval), for example: The path conforms to the Z-shaped browsing rule → the score is improved; Repeated saccades occur → the score is reduced.

[0038] 3) Algorithm optimization: In the genetic algorithm, the reading path weight a=0.6, and the score directly affects the layout optimization direction.

[0039] Wherein, the definition of information density: information density refers to the balance of the distribution of information elements in the layout. It avoids local information overload or sparseness through visual heat map analysis, and ensures that the key information is prominent and the overall layout is beautiful.

[0040] Collection and determination of information density Collection means: information density is quantified through visual heat map analysis and layout structure parameters (such as grid column number, element spacing).

[0041] Specific process: 1) Heat analysis: Generate the visual heat map when the user browses, and analyze the information concentration: Local area click / gaze-intensive → information overload; Region without interactive behavior → information sparse.

[0042] 2) Structure optimization: Adjust the layout parameters according to the heat map: PC uses 12 columns of CSS Grid → complete information display; Pad adjusts to 8 columns → avoid element congestion.

[0043] 3) Algorithm constraints: Information density weight β = 0.4, combined with genetic algorithm to optimize the position and size of the layout elements.

[0044] In one possible implementation, the determination of the target reading line and the target information density of each candidate report layout includes: determining the target reading line corresponding to each candidate report layout by using the pre-experimentally determined correspondence between the report layout and the reading line and the candidate report layout; and determining the target information density corresponding to each candidate report layout by using the pre-experimentally determined correspondence between the report layout and the information density and the candidate report layout.

[0045] It can be understood that the application pre-determines the correspondence between the report layout and the reading line, and the relationship between the report layout and the information density through pre-experiment, so as to query the target reading line and the target information density.

[0046] A05, according to the target reading line, the target information density and the preset fitness algorithm, determine the fitness of each candidate report layout; Further, according to the target reading line, the target information density and the preset fitness algorithm, determine the fitness of each candidate report layout. Wherein, the fitness algorithm is designed based on reading line and information density, for example, the fitness algorithm includes the following expression: F = α * reading line + β * information density; In the formula, α is the reading line rationality weight (based on eye tracking experiment data), β is the information density distribution weight (based on visual heat map analysis); wherein, the parameter constraint α + β = 1, α = 0.6, β = 0.4.

[0047] A06, according to the fitness to determine the best report layout; After the fitness of each candidate report layout is obtained, the best report layout can be selected based on the fitness, wherein the reading experience of the report layout with higher fitness is better, and thus the reading experience with higher fitness is better, so as to select the best report layout. If the iteration number N of the genetic algorithm is less than or equal to a preset iteration number threshold, the best report layout needs to be obtained by continuing iteration, and step A07 is performed; otherwise, the iteration process is completed, the best report layout is output, and step A08 is performed.

[0048] A07, if N is less than or equal to a preset iteration number threshold, then N=N+1, and a cross and mutation operation is performed based on the best report layout to generate a new generation of report layout population, and the step of determining the target reading line and the target information density of each candidate report layout is returned to be performed, wherein N is the current iteration number, and the initial value of N is 1; A08, if N is greater than the preset iteration number threshold, the best report layout is output.

[0049] Further, in order to obtain the best report layout, the iteration number threshold is preset, if N is less than or equal to the preset iteration number threshold, then N=N+1, and a cross and mutation operation is performed based on the best report layout to generate a new generation of report layout population, and the step A04 is returned to be performed, until N is greater than the preset iteration number threshold, and then the best report layout is output.

[0050] 105, based on the first visualization chart and the best report layout, a report generation process is performed to obtain a target visualization report.

[0051] Finally, the final target visualization report can be generated through the best report layout and the first visualization chart.

[0052] Exemplarily, the visualization report generation includes the following 1 to 18 links, and the details are as follows: 1) Data access layer: receiving risk quantification results and strategy optimization solution set; 2) Raw data injection: transmitting 100,000 data nodes; 3) Distributed OLAP engine: Apache Druid engine; 4) Avro compression transmission: returning Avro data with a compression rate of >80%; 5) Hybrid rendering engine: integrating D3.js / Three.js; 6) WebGL accelerated rendering: GPU acceleration efficiency η=68.75%; 7) Interactive canvas: supporting Gantt chart time series display; 8) Pixel event capture: analyzing coordinate range x[120, 250], y[80, 180]; 9) Drilling down analysis controller: generate query with time range filter; 10) GraphQL statement generation: build {congestionAnalysis{intersections}} structure; 11) Incremental data return: response time < 300ms; 12) VI specification injection: read enterprise font / color values; 13) Genetic algorithm optimizer: fitness function F = 0.6 reading flow + 0.4 information density; 14) Adaptive layout: generate PC / Pad / phone three-end templates; 15) Multi-end output module: generate HTML / PDF / PNG combination package; 16) WebSocket push: two-way communication delay < 100ms; 17) Real-time rendering service: support incremental update; 18) Local refresh instruction: update DOM through diff algorithm; Among them, the analysis closed loop: 5→10→2→4→5, forms the drilling down analysis data closed loop; The rendering closed loop: 8→18→3→6, realizes the local refresh rendering closed loop; The layout closed loop: 12→13→14→15→16→17→18→3, realizes the real-time layout update closed loop.

[0053] In a feasible implementation manner, the visual chart is an interactive visual chart, and a user can perform an interactive operation on the visual chart, such as selecting a data range of interest to update the chart representation, to realize interactive drilling down analysis. Therefore, the method further includes steps B01 to B05: B01, when receiving an interactive operation of a user on the first visual chart, determining a pixel coordinate of an interactive position corresponding to the interactive operation; B02, based on the pixel coordinate and the first visual chart, analyzing the data dimension and the data filtering condition of interest of the user; B03, generating a GraphQL query statement by using the data dimension and the data filtering condition; B04, performing aggregation calculation on the project data based on the GraphQL query statement to obtain a target data slice; B05, updating the first visual chart based on the target data slice to obtain a second visual chart of interest of the user, and displaying the second visual chart.

[0054] Exemplary, the flow of interactive drill-down analysis includes the following 1-17 steps, as follows: 1) User click operation: Frame the coordinate range x[120, 250], y[80, 180] in the 3D heat map; 2) Pixel coordinate capture: Analyze the click position by getBoundingClientRect(), and the interactive analysis controller captures the position; 3) Spatial coordinate resolver: Map the screen coordinates to data space coordinates; 4) Semantic information extraction: Identify the dimension information such as area: "CBD", and determine the data dimension 5) Dimension condition constructor: Construct the filter condition {time: "7:00-9:00", metrics: ["avg_speed"]} to obtain the data filtering condition; 6) Time range filtering: Apply the sliding time window mechanism; 7) GraphQL generator: Output the query field containing congestionAnalysis; 8) OLAP query submission: Apache Druid engine executes the query and performs data aggregation; 9) Distributed aggregation engine: Response time < 300ms, data aggregation service; 10) Avro compression return: Data compression rate 83%; 11) Data slice decoding: Parse the avro binary data into JSON format to obtain the data slice; 12) Local visualization update: Update the 3D heat map by diff algorithm to realize local refresh; 13) Interactive canvas: Support superimposed historical accident point markers; 14) New event ready: Wait for the next user interaction to form a closed loop; 15) Response time monitoring: Record the OLAP query 220ms index; 16) Performance log recording: Store the query mode for index optimization; 17) Query optimization suggestion: Recommend adding time column bitmap index.

[0055] Among them, the above steps can form a main interaction closed loop (interactive drill-down analysis closed loop): 1→2→3→4→5→6→7→8→9→10→11→12→13→14→1; It can also form a performance optimization closed loop: 15→16→17→4→5→6 to continuously improve the query efficiency.

[0056] In an implementation, the application further includes multi-terminal adaptation processing, i.e. real-time detection of actual display devices through responsive breakpoint detection, so that the report can adapt to the display screen when displayed on any type of terminal, and the user has the best reading experience. Specifically, the method further includes steps C01 to C05: C01. During display of the target visual report, monitor the device characteristics of the actual display device; C02. According to the device characteristics and the preset responsive breakpoint detection rule, determine the second device type of the actual display device; C03. Determine whether the second device type and the first device type are the same device type; C04. If the second device type and the first device type are not the same device type, according to the second device type and the preset correspondence between device types and layout adjustment rules, determine the target layout adjustment rule corresponding to the second device type; C05. Adjust the layout of the target visual report using the target layout adjustment rule to obtain a target visual report adapted to the second device type.

[0057] It should be noted that the device characteristics of the actual display device can be detected in real time. The device characteristics can be obtained from the user's request. If the user's request is an HTTP request, the device characteristics can be the User-Agent header, screen size, etc. in the HTTP request. The device characteristics are obtained according to the device characteristics and the preset responsive breakpoint detection rule, and the second device type of the actual display device is determined according to the device characteristics. The device is identified as a PC, a Pad, or a mobile phone. For example, the device type is identified through the User-Agent string, or the screen width and other information are obtained through JavaScript. Further, it is determined whether the second device type and the first device type are the same device type. If the second device type and the first device type are not the same device type, the layout is adjusted to adapt to the screen of the second device type. According to the second device type and the preset correspondence between device types and layout adjustment rules, the target layout adjustment rule corresponding to the second device type is determined, and the layout of the target visual report is adjusted using the target layout adjustment rule to obtain a target visual report adapted to the second device type.

[0058] The responsive breakpoint detection rule includes different breakpoint thresholds for distinguishing different device types. Different device types are distinguished by comparing the screen size and the breakpoint threshold. According to the determined device type, the corresponding layout adjustment rule is selected. For example, a PC uses a multi-column layout, a Pad uses a medium column number layout, and a mobile phone uses a single-column layout.

[0059] Layout parameters include CSS Grid layout parameters, element styles, and so on.

[0060] For example, adjust the CSS Grid layout parameters: adjust the CSS Grid layout parameters such as the number of grid columns, the number of rows, the width of each column, the height of each row, and so on according to the device type. For example: PC end: set the number of grid columns to 12 columns and the width of each column to 1fr; Pad end: set the number of grid columns to 8 columns and the width of each column to 1fr; mobile phone end: set the number of grid columns to 4 columns and the width of each column to 1fr.

[0061] Adjust the element style: adjust the font size, margin, padding, and other style parameters of the element according to the device type to ensure consistency of display effects on different devices.

[0062] In one possible implementation, the method further comprises: Using the preset file format and the target visual report, a report set is generated, which includes target visual reports in multiple file formats, including at least HTML format, PDF format, and PNG format. That is, multiple types of file formats can be obtained to meet different use requirements.

[0063] For example, the automatic layout optimization process includes 1 to 17 steps, as follows: 1) VI specification reading: load enterprise fonts / color values / logo positions; 2) Design constraint injection: includes hard rules such as non-movable logo positions and adapts to enterprise VI; 3) Genetic algorithm initialization: set population size N=50, mutation rate 0.15, and automatic layout optimization algorithm; 4) Generate initial population: randomly generate 20 candidate layout schemes; 5) Fitness evaluation module: calculate F=0.6 reading dynamic line + 0.4 information density; 6) Calculate F value: based on eye tracking experiment data (alpha=0.6) and visual heat map (beta=0.4); 7) Selection / crossover / variation: perform roulette selection and two-point crossover operation, genetic operation; 8) New generation population: after 150 iterations, 150 is the iteration threshold; 9) Reach iteration threshold: terminate when the F value improves <0.01; 10) Optimal layout generation: output CSS Grid template to obtain the best layout; 11) CSS Grid conversion: generate a grid layout with fr units and integrate CSS Grid; 12) Multi-terminal adaptation engine: Realize PC / PAD / mobile phone three terminal adaptation, realize multi-screen self-adaptation; 13) Responsive breakpoint detection: Match device size through Media Query, realize multi-terminal self-adaptation; 14) Output report combination package: Including HTML / PDF / PNG three formats, system output report combination package; 15) User feedback collection: Record 91% interaction satisfaction data; 16) Parameter tuner: Dynamically adjust a / β weight according to feedback; 17) α / β weight adjustment: Constraint a+β=1; Among them, the genetic algorithm closed loop: 4→5→6→7→8→3→4, form optimization iteration closed loop; Parameter tuning closed loop: 15→16→17→5→6→7, realize adaptive parameter adjustment; Multi-terminal adaptation closed loop: 13→12→6→13, ensure the correctness of responsive layout.

[0064] Exemplary, multi-terminal adaptation process includes 1 to 20 links, as follows: 1) CSS Grid template: 12 column grid with fr unit, realize CSS Grid integration; 2) Device feature detection: Identify device type through navigator.userAgent for multi-screen self-adaptation; 3) Responsive breakpoint judgment: Preset PC / PAD / mobile phone three terminal threshold for multi-terminal adaptation; 4) Screen width≥1200px: Trigger PC terminal layout rules; 5) PC terminal layout: Display complete risk matrix and Gantt chart; 6) Adjust the number of grid columns: Pad terminal changes to 8 column grid layout; 7) Pad terminal layout: Keep core heat map interaction function; 8) Screen width<768px: Enable mobile terminal responsive rules; 9) Mobile terminal layout: Vertically stack chart elements; 10) Apply enterprise VI specification: Forced to use #004C97 main color; 11) HTML interactive report: Contains dynamic signal lamp simulation; 12) Adjust the number of grid columns: Automatically scale according to device DPI; 13) Hide secondary information: Remove 3D rotation control on mobile terminal; 14) Format conversion engine: Generate PDF that meets municipal standards; 15) PDF print version: Fix the position of the right bottom corner LOGO; 16) Screenshot renderer: PNG generation using Headless Chrome; 17) PNG static snapshot: Key data annotation preservation; 18) User device feedback: 91% satisfaction data collection; 19) Breakpoint rule optimizer: Dynamic threshold adjustment based on usage data; 20) Update breakpoint threshold: Pad side adjustment to 600px; Among them, the multi-terminal adaptation closed loop: 2→4→6→12→3→2, so as to realize the dynamic adjustment of device threshold; Format generation closed loop: 14→16→17→18→19→20→2, so as to ensure the continuous optimization of output format; VI specification closed loop: 10→15→17→18→19→20→10, so as to maintain the consistency of enterprise VI.

[0065] It should be noted that the final system output can include 1) visual report: interactive risk matrix, resource heat map, and time series display of Gantt chart, 2) multi-terminal adaptation: generation of HTML interactive file, PDF print version, and PNG screenshot package.

[0066] It can be understood that the project risk response strategy visualization report generation system corresponding to the method shown in the present application can include: a hybrid rendering engine supporting 2D / 3D mode switching and GPU acceleration of D3.js and Three.js; an interactive drill-down analysis module generating a GraphQL query through pixel-level coordinate analysis; an automatic layout optimization module combining CSS Grid and genetic algorithm to adapt to enterprise VI specification; a real-time rendering service based on WebSocket to realize <100ms delay incremental update.

[0067] Among them, the hybrid rendering engine supports the following functions: dynamic chart generation: automatically matching chart types, supporting 15 preset templates; WebGL rendering: using GPU acceleration to ensure frame rate ≥60fps; data conversion: converting raw data into a visualization-specific format according to Vega-Lite specification.

[0068] Among them, the interactive drill-down analysis module supports: click event analysis: capturing user click coordinates and analyzing semantic information; refined data request: generating a query statement containing time range and dimension filtering conditions; data aggregation: returning compressed data slices through a distributed OLAP engine.

[0069] Among them, the automatic layout optimization module supports: enterprise VI adaptation: read font / color value / LOGO position and other design constraint files; Layout optimization: adopt genetic algorithm to balance the rationality of reading dynamic line and information density; Multi-screen self-adaptation: realize PC / pad / mobile phone three-end adaptation through MediaQuery.

[0070] Through the above-mentioned visual report generation method, the following advantages are realized: 1) limited traditional visualization capability: traditional tools only support static charts, which cannot meet the multi-dimensional display needs of complex risk data, and the application can generate dynamic charts from project data; 2) lack of interaction of traditional report: lack of drilling analysis function, users cannot obtain detailed data through interactive operation, the application can drill down to analyze data according to user interaction behavior; 3) low layout efficiency: existing systems cannot automatically adapt to enterprise VI specifications, and a large amount of manual adjustment is required after report generation, the application can adapt to enterprise specifications and device display interface; 4) poor real-time performance: data update and chart rendering are not synchronized, resulting in information lag, the application improves processing speed through GPU acceleration, enhances real-time performance, and provides real-time rendering service based on WebSocket two-way communication service, with delay <100ms, supporting incremental update and local refresh.

[0071] The application provides a visual report generation method, which comprises the following steps: receiving a project report generation request and project data, wherein the generation request comprises a first device type of a target terminal for displaying the project report and a preset layout constraint rule; performing data conversion on the project data and a preset visual chart format to obtain target visual chart data of the project data; inputting the target visual chart data into a preset rendering engine to generate a first visual chart; performing layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm to obtain an optimal report layout, wherein the optimal report layout is used for indicating a report layout corresponding to the best reading experience of a user in the first device type; and performing report generation processing based on the first visual chart and the optimal report layout to obtain a target visual report. Through the above-mentioned method, the layout optimization can be performed based on the device type of the display terminal, the layout constraint rule and the layout optimization algorithm to obtain the optimal report layout, so that the optimal report layout meeting the device type and the layout constraint rule can be obtained without manual adjustment of the layout, and the report layout efficiency is improved.

[0072] Please refer to Figure 2 , Figure 2 The structure block diagram of the visual report generation device in the embodiment of the application is shown in Figure 2 The device comprises: The data input module 201 is configured to receive a project report generation request and project data, wherein the generation request comprises a first device type of a target terminal for displaying the project report and a preset layout constraint rule. The data conversion module 202 is configured to perform data conversion on the project data and a preset visualization chart format to obtain target visualization chart data of the project data. The chart rendering module 203 is configured to input the target visualization chart data into a preset rendering engine to generate a first visualization chart. The layout optimization module 204 is configured to perform layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm to obtain an optimal report layout, which is used to indicate a report layout corresponding to an optimal reading experience of a user in the first device type. The report generation module 205 is configured to perform report generation processing based on the first visualization chart and the optimal report layout to obtain a target visualization report.

[0073] It should be noted that, Figure 2 the functions of the modules in the device are similar to those of the modules in the device Figure 1 the contents of the steps in the method are similar to those of the steps in the method Figure 1 the contents of the steps in the method.

[0074] The present application provides a visualization report generation device, which comprises: a data input module configured to receive a project report generation request and project data, the generation request comprising a first device type of a target terminal for displaying a project report and a preset layout constraint rule; a data conversion module configured to perform data conversion on the project data and a preset visualization chart format to obtain target visualization chart data of the project data; a chart rendering module configured to input the target visualization chart data into a preset rendering engine to generate a first visualization chart; a layout optimization module configured to perform layout optimization according to the layout constraint rule, the first device type and a layout optimization algorithm to obtain an optimal report layout, which is used to indicate a report layout corresponding to an optimal reading experience of a user in the first device type; and a report generation module configured to perform report generation processing based on the first visualization chart and the optimal report layout to obtain a target visualization report. In this way, the device type of the display terminal, the layout constraint rule and the layout optimization algorithm can be used to perform layout optimization to obtain an optimal report layout, which can be obtained without manual adjustment of the layout and is consistent with the device type and the layout constraint rule, thereby improving the report layout efficiency.

[0075] Figure 3 An internal structure diagram of a computer device in an embodiment is shown. The computer device can be a terminal or a server. As shown in FIG. 1, the computer device comprises a central processing unit (CPU), a memory, a display screen, an input device and the like. The memory stores an operating system and one or more programs. Figure 3As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program, which, when executed by the processor, causes the processor to perform the aforementioned methods. The internal memory may also store a computer program, which, when executed by the processor, causes the processor to perform the aforementioned methods. Those skilled in the art will understand that… Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0076] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform actions such as... Figure 1 The steps of the method shown.

[0077] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following actions: Figure 1 The steps of the method shown.

[0078] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0079] The technical features of the above embodiments can be combined in any manner. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not contradict each other, they should be considered to be within the scope of the present disclosure.

[0080] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the patent protection scope of the present application should be subject to the appended claims.

Claims

1. A method for generating a visual report, characterized in that, The method includes: Receive a request to generate a project report and project data. The request to generate the project report includes a first device type of the target terminal and preset layout constraint rules. The project data and a preset visualization chart format are used to perform data transformation to obtain the target visualization chart data of the project data; The target visualization chart data is input into a preset rendering engine to generate the first visualization chart; Based on the layout constraint rules, the first device type, and the layout optimization algorithm, the layout is optimized to obtain the optimal report layout. The optimal report layout is used to indicate the report layout corresponding to the best reading experience for users under the first device type. The report generation process is performed based on the first visualization chart and the optimal report layout to obtain the target visualization report.

2. The method according to claim 1, characterized in that, The step of optimizing the layout according to the layout constraint rules, the first device type, and the layout optimization algorithm to obtain the optimal report layout includes: Determine the display interface size corresponding to the first device type; Use the layout constraint rules and the display interface size as initial constraint conditions. Under the initial constraints, the number of individuals in the initial report layout population is initialized, and each individual corresponds to a candidate report layout; Determine the target reading flow and target information density for the layout of each candidate report; The fitness of each candidate report layout is determined based on the target reading path, target information density, and a preset fitness algorithm. Determine the optimal report layout based on the fitness level; If N is less than or equal to the preset iteration number threshold, then let N = N + 1, and perform crossover and mutation operations based on the optimal report layout to generate a new generation of report layout population, and return to execute the step of determining the target reading path and target information density of each candidate report layout, where N is the current iteration number and the initial value of N is 1; If N is greater than the preset iteration number threshold, then the optimal report layout is output.

3. The method according to claim 2, characterized in that, Determining the target reading path and target information density for each candidate report layout includes: Using the correspondence between the report layout and reading path determined in a pre-experiment and the candidate report layouts, the target reading path corresponding to each candidate report layout is determined; By utilizing the correspondence between report layout and information density determined in a pre-experiment and the candidate report layouts, the target information density corresponding to each candidate report layout is determined.

4. The method according to claim 1, characterized in that, If the visualization is interactive, then the method further includes: When a user interacts with the first visual chart, the pixel coordinates of the interaction position corresponding to the interaction are determined. Based on the pixel coordinates and the first visualization chart, the data dimensions and data filtering conditions that the user is interested in are parsed out. Using the data dimensions and data filtering conditions, generate GraphQL query statements; Based on the GraphQL query statement, the project data is aggregated and calculated to obtain the target data slice; The first visualization chart is updated based on the target data slice to obtain a second visualization chart that the user is interested in, and the second visualization chart is displayed.

5. The method according to claim 1, characterized in that, The method further includes: During the presentation of the target visualization report, the equipment characteristics of the actual display device are monitored; Based on the device characteristics and the preset responsive breakpoint detection rules, the second device type of the actual display device is determined; Determine whether the second device type and the first device type are the same device type; If the second device type is not the same as the first device type, then the target layout adjustment rule corresponding to the second device type is determined according to the second device type and the preset correspondence between device type and layout adjustment rule; The layout of the target visualization report is adjusted using the target layout adjustment rules to obtain a target visualization report adapted to the second device type.

6. The method according to claim 1, characterized in that, The step of inputting the target visualization chart data into a preset rendering engine to generate a visualization chart includes: If the visualization chart format is a 2D chart, then the target visualization chart data is passed into a preset 2D rendering engine to generate a 2D visualization chart; If the visualization chart format is a 3D chart, then the target visualization chart data is passed to a preset 3D rendering engine to generate a 3D visualization chart.

7. The method according to claim 1, characterized in that, The method further includes: Using preset file formats and the target visualization report, a report set is generated. The report set includes target visualization reports in various file formats, including at least HTML, PDF, and PNG formats.

8. A device for generating a visual report, characterized in that, The device includes: Data input module: used to receive a request to generate a project report and project data. The request to generate the project report includes a first device type of the target terminal and preset layout constraint rules. Data conversion module: used to convert the project data and preset visualization chart format to obtain the target visualization chart data of the project data; Chart rendering module: used to input the target visualization chart data into a preset rendering engine to generate the first visualization chart; Layout optimization module: used to optimize the layout according to the layout constraint rules, the first device type and the layout optimization algorithm to obtain the best report layout. The best report layout is used to indicate the report layout corresponding to the best reading experience for users under the first device type. Report generation module: used to generate a target visual report based on the first visualization chart and the optimal report layout.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 7.

10. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 7.