Excel report automatic conversion and rendering method, system, equipment and medium

Through the combination of the intelligent Excel parsing engine and React dynamic components, the flexibility and visualization problems of existing Excel report generation tools are solved, and efficient automation processing and high-quality visualization of complex format Excel files are realized to generate PDF documents.

CN120354827AInactive Publication Date: 2025-07-22BEIJING QINGWANG TECH CORP
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510483671.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-22
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing Excel report generation tools lack flexibility, limited visualization capabilities, low integration, insufficient automation, and difficult to process complex formats and real-time data, resulting in inefficient generation and error-prone.

Method used

The intelligent Excel parsing engine is used to automatically analyze the file structure, build a structured data model based on the xlsx library and data structured conversion mechanism, and use React's dynamic components and headless browser technology to dynamically load and render the visual content to generate PDF documents.

Benefits of technology

It realizes automatic identification and processing of complex format Excel files, supports efficient and flexible data conversion and visualization, meets complex visualization needs, realizes full process automation, and improves generation efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354827A_ABST
    Figure CN120354827A_ABST
Patent Text Reader

Abstract

The invention discloses an Excel report automatic conversion and rendering method, system, device and medium, and relates to the field of data processing, visualization and document generation, the method comprises the following steps: adopting an intelligent Excel analysis engine to automatically analyze Excel file structure features, and selecting a most suitable analyzer to analyze an Excel file; based on an xlsx library and a data structured conversion mechanism, performing data processing on the analyzed Excel file, and constructing a structured data model; based on a dynamic component of React, constructing different types of visual generation components according to the structured data model, and determining a layout framework; and based on a dynamic component and a structured data model of React, dynamically loading and rendering the visual content in the layout framework by adopting a headless browser technology, configuring browser parameters suitable for generating a PDF format, and displaying a PDF document according to the browser parameters. The method has the advantages of high-flexibility Excel analysis capability, strong data processing capability, rich visual expressive force, high-quality PDF rendering and efficient batch processing capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of data processing, visualization, and document generation, and particularly to a method, system, device, and medium for automatically converting and rendering Excel reports. Background Art

[0002] With the development of information technology, enterprises and organizations have accumulated a large amount of data resources, which are usually stored and managed in the form of Excel tables. Excel, as a general spreadsheet tool, is widely used in data storage, analysis, and display. However, the data in Excel tables often needs to be further processed and visualized to facilitate decision-makers' understanding and analysis. Especially in the fields of network monitoring, performance analysis, financial statements, etc., it is necessary to convert the original data in Excel into intuitive and beautiful report documents.

[0003] Traditional report generation methods usually rely on manual operations. Analysts need to manually extract data from Excel, create visual content using chart tools, and then use document editing software for typesetting and generating the final report. This method is not only time-consuming and laborious but also error-prone and difficult to meet the requirements of large-scale and high-frequency report generation. With the development of automation technology, some Excel data processing and report generation tools have emerged in the market, such as the tools in Solution 1 and the processing methods shown in Solution 2.

[0004] Solution 1: Template-based Excel report generation tool.

[0005] Some existing report tools, such as Jasper Reports, BIRT, etc., provide template-based report generation functions. These tools allow users to design report templates and then fill Excel data into the templates to generate the final report.

[0006] Main disadvantages:

[0007] 1. Fixed template, lack of flexibility: These tools usually use predefined templates and it is difficult to dynamically adjust the report structure and layout according to the data content.

[0008] 2. Limited data processing ability: For complex Excel files, especially those containing multiple worksheets, complex formulas, and data relationships, the processing ability is insufficient.

[0009] 3. Limited visualization effects: The provided chart types and styles are limited and it is difficult to meet advanced visualization requirements.

[0010] 4. Low integration: Usually, additional data processing tools are required to prepare the data, increasing the usage complexity.

[0011] 5. Insufficient automation: Many processes still require manual intervention, such as template design, data mapping, etc.

[0012] Solution 2: A method for Excel data processing and report generation based on scripts.

[0013] Some enterprises use programming languages such as Python and R to write scripts, combined with libraries such as pandas and matplotlib to achieve Excel data processing and visualization, and then use libraries such as reportlab to generate PDF reports.

[0014] Main disadvantages:

[0015] 1. High development cost: Professional programming skills are required, and a separate script needs to be developed for each report type.

[0016] 2. Difficult to maintain: Scripts are usually designed for specific Excel formats, and need to be modified when the Excel format changes.

[0017] 3. Limited visualization effect: Script-based visualization is usually less flexible and beautiful than professional visualization tools.

[0018] 4. Lack of a unified framework: Different scripts may use different technologies and methods, making it difficult to form a unified solution.

[0019] 5. Difficult to handle complex layouts: When generating PDFs, it is difficult to implement functions such as complex page layouts, headers, footers, and tables of contents.

[0020] It can be seen that these tools or methods still have the following problems:

[0021] Lack of flexibility: Most tools can only handle Excel files in specific formats, and it is difficult to adapt to different data structures and formats.

[0022] Limited visualization ability: The chart types and styles of existing tools are limited, and it is difficult to meet complex visualization requirements.

[0023] Low integration: Data extraction, processing, visualization, and report generation usually require multiple tools to cooperate, increasing the difficulty of use.

[0024] Insufficient automation: Many processes still require manual intervention, and it is difficult to achieve a fully automated report generation process.

[0025] Lack of real-time performance: It cannot support the rapid processing and report generation of real-time data. Summary of the Invention

[0026] The objective of this application is to provide a method, system, device, and medium for automatic conversion and rendering of Excel reports to solve the problems existing in the prior art.

[0027] To achieve the above objective, this application provides the following solutions:

[0028] In the first aspect, this application provides a method for automatic conversion and rendering of Excel reports, including:

[0029] Using an intelligent Excel parsing engine to automatically analyze the structural characteristics of an Excel file and select the most suitable parser to parse the Excel file;

[0030] Based on the xlsx library and a data structuring conversion mechanism, performing data processing on the parsed Excel file to construct a structured data model; the structured data model includes all the data required to generate all reports in the parsed Excel file;

[0031] Based on dynamic components of React, constructing different types of visualization generation components according to the structured data model and determining a layout framework;

[0032] Based on dynamic components of React and the structured data model, using headless browser technology to dynamically load and render the visualization content in the layout framework, configuring browser parameters suitable for generating a PDF format, and displaying a PDF document according to the browser parameters; the PDF document includes report content, a table of contents, and metadata.

[0033] In the second aspect, this application provides an apparatus for automatic conversion and rendering of Excel reports, including:

[0034] An Excel parsing module, which uses an intelligent Excel parsing engine to automatically analyze the structural characteristics of an Excel file and select the most suitable parser to parse the Excel file;

[0035] A data processing module, which is used to perform data processing on the parsed Excel file based on the xlsx library and a data structuring conversion mechanism to construct a structured data model; the structured data model includes all the data required to generate all reports in the parsed Excel file;

[0036] A visualization generation module, which is used to construct different types of visualization generation components according to the structured data model and determine a layout framework;

[0037] A PDF rendering module, for dynamic components based on React, uses headless browser technology to dynamically load and render the visual content in the layout framework, configures browser parameters suitable for generating PDF format, and displays a PDF document according to the browser parameters; the PDF document includes report content, a table of contents, and metadata.

[0038] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the Excel report automation conversion and rendering method described in any one of the above.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the Excel report automation conversion and rendering method described in any one of the above.

[0040] According to the specific embodiments provided by the present application, the following technical effects are disclosed in the present application:

[0041] The present application has a highly flexible Excel parsing ability: adopting a modular parsing framework, namely an intelligent Excel parsing engine, automatically analyzes the structural characteristics of Excel files, selects the most suitable dedicated parser, without manual intervention, increasing the usage difficulty, and automatically identifies data structures and relationships based on the xlsx library and the data structured conversion mechanism, so as to be able to automatically identify and process Excel files of various complex formats, including multiple worksheets, merged cells, and formula calculations, etc.

[0042] Powerful data processing capabilities: support complex data conversion, aggregation, filtering, and calculation, and can extract valuable information from the original data.

[0043] Rich visual expressiveness: integrating modern visualization technologies, constructing different types of visualization generation components according to the structured data model, providing a variety of chart types and styles, and meeting complex visualization requirements.

[0044] Complete automated workflow: from Excel file download, parsing, data processing, visualization generation to PDF document output, realizing full-process automation.

[0045] High-quality PDF rendering: based on React dynamic components, using headless browser technology, ensuring high-quality presentation of visual content in the PDF document, supporting complex page layouts, headers, footers, and table of contents generation;

[0046] Efficient batch processing capability: It supports the rapid processing of real-time data and report generation, and can meet the requirements of large-scale and high-frequency report generation, improving the efficiency of data analysis and decision-making.

[0047] In summary, this application can significantly improve the efficiency and quality of report generation, reduce labor costs, and provide better data visualization and analysis tools for enterprises and organizations. Brief Description of the Drawings

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0049] Figure 1 It is a flowchart of the Excel report automation conversion and rendering method provided by the present application. Detailed Embodiments

[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present application.

[0051] To make the above objects, features, and advantages of the present application more obvious and understandable, the following will further describe the present application in detail with reference to the drawings and specific embodiments.

[0052] The embodiment of the present application provides an Excel report automation conversion and rendering method, which is executed by a computer device. Specifically, it can be executed independently by a computer device such as a terminal or a server, or jointly executed by a terminal and a server. In the embodiment of the present application, as Figure 1 shown, the method includes the following steps.

[0053] S1: Automatically analyze the Excel file structure characteristics using an intelligent Excel parsing engine, and select the most suitable parser to parse the Excel file.

[0054] S2: Based on the xlsx library and the data structured conversion mechanism, perform data processing on the parsed Excel file to construct a structured data model; the structured data model includes all the data required to generate reports in the parsed Excel file.

[0055] S3: Based on the React-based dynamic components, construct visualization generation components of different types according to the structured data model, and determine the layout framework.

[0056] S4: Based on the React-based dynamic components and the structured data model, use the headless browser technology to dynamically load and render the visualization content in the layout framework, configure browser parameters suitable for generating PDF format, and display the PDF document according to the browser parameters; the PDF document includes report content, table of contents structure, and metadata.

[0057] In an exemplary embodiment, S1 can be replaced by the following steps.

[0058] S11: Based on the Excel file download request, download the Excel file.

[0059] S12: Use the intelligent Excel parsing engine to analyze the Excel file structure features; the structure features include the number of worksheets, worksheet naming patterns, and data organization methods.

[0060] In this embodiment, a worksheet is each sheet in the Excel, and a report is the chart shown in the PDF, such as a curve chart and a pie chart, etc.

[0061] S13: According to the analysis result of the Excel file structure features, determine whether there is a parser in the parser suite library that is most suitable for the current Excel file. If so, execute S14; if not, execute S16.

[0062] S14: Take the screened parser as the most suitable parser, and initialize the most suitable parser, and allocate system resources to adapt to the parsing environment.

[0063] S15: Run the most suitable parser according to the system resources, analyze the Excel file, and determine the parsed Excel file.

[0064] S16: Output an exception and record the log.

[0065] In practical applications, the specific steps in the Excel file parsing stage are as follows:

[0066] File acquisition and preprocessing:

[0067] Step 1.: Receive the Excel file download request, including parameters such as file URL, download method, and time zone offset.

[0068] Step 2: Download the Excel file according to the request parameters, supporting HTTP / HTTPS protocols.

[0069] Step 3: Detect the file type, supporting.xlsx,.xls, and compressed package format (.zip).

[0070] Step 4: If it is in compressed package format, decompress and extract the Excel file inside.

[0071] Step 5: Verify the file integrity and check for damage or incorrect format.

[0072] Implementation of technical key points:

[0073] Intelligent Excel parsing engine: At this stage, the system first establishes a file processing pipeline that can automatically recognize multiple file formats (.xls,.xlsx,.zip). For compressed files, the system uses the unzipper library to achieve streaming decompression, enabling processing to start without complete download, thus improving efficiency. The system also detects the file encoding format, supporting multiple encoding standards such as UTF-8 and GBK to ensure that Excel files from different sources can be correctly parsed.

[0074] The output at this stage is the binary data of the verified Excel file, providing the basic data source for the parser selection in the next step.

[0075] Parser selection and initialization:

[0076] Step 1: Analyze the Excel file structure to identify the number of worksheets, naming patterns, and data organization methods.

[0077] In this step, the system comprehensively analyzes the Excel file to determine its internal structure and data organization characteristics.

[0078] Analysis of the number of worksheets: Count the number of worksheets in the Excel file, which is an important indicator for judging data complexity.

[0079] Recognition of worksheet naming patterns: Analyze the naming rules of worksheets, such as specific naming patterns like "Real-time Overview" and "Shared Subscription Throughput Trend". These names usually reflect the data type and purpose of the worksheets.

[0080] Recognition of data organization methods: Analyze the data organization forms in each worksheet, including:

[0081] Tabular data: It has a clear row and column structure and usually contains a header row.

[0082] Time series data: Data points arranged in chronological order.

[0083] Hierarchical data: A data structure with parent-child relationships.

[0084] Aggregate data: Data that has been summarized or statistically processed.

[0085] Original data: Unprocessed original records.

[0086] Determination of data collection time interval: By analyzing the timestamp column, determine the data collection frequency (such as 60 seconds, 300 seconds, etc.).

[0087] Recognition of special structures: Detect special structures such as merged cells, hidden rows and columns, and conditional formatting.

[0088] Step 2: Select the most suitable parser from the parser suite library according to the file characteristics.

[0089] Based on the analysis results of the previous step, the system selects the most suitable parser for the current Excel file from the predefined parser suite library.

[0090] File feature matching: The system will consider the following file features for matching.

[0091] Version identification: The version information (such as v1, v2, etc.) contained in the Excel file, which is the main basis for matching.

[0092] Worksheet structure: Specific worksheet combinations and naming patterns.

[0093] Data format: Specific data formats and organization methods.

[0094] Special markers: Special markers or metadata that may be contained in the file.

[0095] Parser suite library: The system maintains a library containing multiple dedicated parsers (such as the V1 to V45 parsers in the code), each parser is designed for Excel files of specific versions and formats and has the following characteristics:

[0096] Each parser has a clear version identification (static version attribute).

[0097] Each parser contains dedicated parsing methods for specific data types, such as shared subscription throughput table data parsing and client online number table data parsing.

[0098] Step 3: If there is no matching parser, throw an exception and record the log.

[0099] Step 4: Initialize the selected parser and configure parameters such as time zone offset and language settings.

[0100] Time zone offset configuration:

[0101] The time zone offset is a key parameter used to process time data in different time zones.

[0102] Formats such as "+0800" (East 8th District), "-0500" (West 5th District), etc.

[0103] The system uses the time zone function of the dayjs library to convert the time data in Excel into a standard timestamp.

[0104] Ensures that data from different time zones can be compared and analyzed under a unified time benchmark.

[0105] Language setting: Sets the language environment used by the parser (such as Chinese, English), which affects error messages and certain data interpretations.

[0106] Implementation of technical key points:

[0107] Intelligent Excel parsing engine: The system implements a parser registration mechanism. Each parser inherits from the BaseExcelParserSuite abstract class and implements specific parsing logic. The system automatically matches the most suitable parser by analyzing the worksheet name pattern, specific marker cells, and data structure characteristics of the Excel file. This mode enables the system to process Excel files with different formats and structures without manual intervention.

[0108] Multi-language internationalization support: In the parser initialization stage, the system sets the corresponding language environment according to the language parameter in the request to ensure that texts, date formats, etc. in the subsequent processing process meet the requirements of a specific language.

[0109] The parser instance initialized in this stage is output. This instance contains all the logic and configurations required to process a specific Excel format, providing a processing framework for the next step of data extraction.

[0110] In an exemplary embodiment, S2 can be replaced by the following steps.

[0111] S21: Use the xlsx library to load all worksheets in the parsed Excel file, and perform basic processing on the worksheets to determine a preliminarily structured original data set; the basic processing includes identifying the data area of each worksheet, processing merged cells and hidden rows and columns, extracting cell data, identifying time series data, performing standardization processing according to the time zone offset, and detecting data anomalies and recording anomaly information; the preliminarily structured original data set includes all data and corresponding metadata extracted from the parsed Excel file; the metadata includes data type, format, and location;

[0112] S22: Based on the data structuring and conversion mechanism, preprocess the preliminarily structured original data set to build a structured data model; the preprocessing includes data cleaning and normalization, as well as data conversion and aggregation.

[0113] In practical applications, data extraction and basic processing:

[0114] Step 1: Use the xlsx library to open the Excel file and load all worksheets.

[0115] Step 2: Identify the data regions of each worksheet and handle merged cells and hidden rows / columns.

[0116] Step 3: Extract cell data while preserving the original format and data type.

[0117] Step 4: Process formula cells to obtain the calculation results.

[0118] Step 5: Identify time series data and standardize it according to the time zone offset.

[0119] Time zone standardization refers to converting the date and time data in the Excel file (usually recorded in the local time zone) into a unified standard timestamp (Unix timestamp, i.e., the number of milliseconds since January 1, 1970 UTC) so that these data can be correctly interpreted and processed in systems with different time zones.

[0120] Step 6: Detect data anomalies such as missing values, outliers, etc., and record the anomaly information.

[0121] Implementation of technical key points:

[0122] Intelligent Excel parsing engine: The system uses advanced features of the xlsx library and can handle complex Excel features such as merged cells, hidden rows / columns, conditional formatting, etc. For merged cells, the system can automatically identify their ranges and correctly extract the values; for formula cells, the system not only extracts the calculation results but also analyzes the formula dependencies to ensure data integrity.

[0123] Data structuring conversion mechanism: While extracting data, the system starts preliminary data structuring, converting the two-dimensional table data in Excel into a structured array with row and column indexes, while preserving the original format information and data type of the cells.

[0124] Multi-language and internationalization support: The system can correctly process text data in different languages, including special characters and non-Latin character sets, to ensure the accuracy of data extraction. For date and time data, the system standardizes it according to the configured time zone offset to ensure the consistency of time data.

[0125] This stage outputs a preliminary structured original dataset, which contains all the data extracted from Excel and its meta-information (such as data type, format, location, etc.). These data will be used as the input for the next stage of data cleaning and normalization.

[0126] The Excel file parsing phase finally generates a structured object, which is a complex data structure containing all relevant data extracted from the Excel file. Specifically, it includes:

[0127] 1. Basic information: ˋlanguageˋ: Language setting (such as Chinese, English). ˋcustomerNameˋ: Customer name.

[0128] 2. Real-time overview data (ˋrealTimeOverviewˋ): Includes overall statistical information such as the number of subscriptions, the number of CPEs, and the number of sites. Includes network performance metrics such as throughput, packet loss rate, and latency. All time data has been converted to standard timestamps.

[0129] 3. Subscription data (ˋsubscriptionˋ): ˋoverallAnalysisˋ: Overall analysis of subscriptions, including analysis of throughput and the number of online clients.

[0130] - ˋsharedSubscriptionˋ: Shared subscription data, including throughput trends and a list of the number of online clients.

[0131] 4. CPE resource data (ˋcpeResourceˋ): ˋrealTimeˋ: Real-time resource usage of CPE, including CPU, memory, disk usage, etc. ˋtimePeriodˋ: Resource usage of CPE over a period of time.

[0132] 5. Site data: ˋlocalBreakoutSiteˋ: Escape site data. ˋexclusiveSiteˋ: Exclusive site data, including various throughput trends and connection quality data.

[0133] 6. Application data: ˋapplicationThroughputTrendˋ: Application throughput trend data. Applied in the data structuring process.

[0134] In the data structuring process, the system further processes the ˋExcelAnalyzerResultˋ object generated in the Excel parsing phase:

[0135] 1. Data cleaning and normalization: Remove invalid data points (such as negative or extremely large throughput values). Handle missing values (such as no data at certain time points). Ensure data type consistency (such as all throughput values being numeric). This step utilizes the standardized timestamps generated in the Excel parsing phase to accurately identify outliers in the time series.

[0136] 2. Data Transformation and Aggregation: Resample time series based on standardized timestamps (e.g., convert data at 60 - second intervals to 5 - minute intervals). Calculate statistical metrics (such as average, maximum, minimum). Generate derived metrics (such as growth rate, usage percentage). The standardized timestamps enable accurate alignment of time series from different data sources for meaningful comparison and aggregation.

[0137] 3. Data Model Construction:

[0138] Organize the cleaned and transformed data into a more advanced data model.

[0139] Establish relationships between data (such as the relationship between subscriptions and CPE).

[0140] Prepare a data structure for visualization.

[0141] The standardized timestamps ensure that the time dimension in the data model is consistent and accurate.

[0142] In an exemplary embodiment, S22 can be replaced by the following steps.

[0143] S221: Based on the data structuring and transformation mechanism, clean and standardize the initially structured original data set to determine the cleaned and standardized data set; the data cleaning and standardization include removing invalid data, handling missing values, converting data types, unit standardization processing, and text data normalization processing.

[0144] S222: Perform data transformation and aggregation on the cleaned and standardized data set to determine the transformed and aggregated data set; the transformation and aggregation include performing transformation operations on data characteristics, handling time - series data, aggregating data, pivoting multi - dimensional data, generating data views in different dimensions, and data correlation analysis to identify relationships between different data sets.

[0145] S223: Construct a structured data model based on the transformed and aggregated data set.

[0146] In practical applications, in the data structuring process:

[0147] Data Cleaning and Standardization

[0148] Step 1.: Remove invalid data, such as blank lines, comment lines, etc.

[0149] Step 2: Handle missing values, fill or ignore according to the configuration.

[0150] Step 3: Convert data types to ensure consistency of types such as numerical values and dates.

[0151] Step 4: Unit standardization, converting data in different units into a unified unit.

[0152] Step 5: Text data normalization, handling special characters, extra spaces, etc.

[0153] Implementation of technical key points:

[0154] Data structured conversion mechanism: The system has implemented a set of data cleaning rule engines, which can automatically apply appropriate cleaning strategies according to data characteristics. For missing values, the system can select different processing methods according to the configuration, such as filling with the average value, filling with the previous value, interpolation, etc. For outliers, the system uses statistical methods (such as the 3σ rule) to automatically detect and process them.

[0155] Multilingual internationalization support: During the text data normalization process, the system takes into account the characteristics of different languages, such as the conversion between Chinese full-width and half-width characters, the standardization of Japanese kana, etc., to ensure the consistency of text data in different language environments.

[0156] The output of this stage is the cleaned and normalized data, which has removed invalid content, and the types and formats have been standardized, providing a high-quality data foundation for the next step of data conversion and aggregation.

[0157] Data conversion and aggregation:

[0158] Step 1: According to data characteristics, perform necessary conversion operations, such as normalization, standardization, etc.

[0159] Correspondence between data characteristics and conversion operations:

[0160] 1. Numerical data characteristics: Different size ranges: When the numerical ranges of different data sets vary greatly (e.g., throughput may range from KB to GB). Conversion operation: Normalization processing, mapping the data to the [0,1] interval, formula: ˋ(value - min) / (max - min)ˋ. Uneven distribution: When the data distribution is skewed and concentrated in a certain area. Conversion operation: Logarithmic conversion, using ˋlog(value)ˋ to make the data distribution more uniform. Different units: When the data is recorded in different units (e.g., a mixture of KB, MB, and GB). Conversion operation: Unit standardization, uniformly converting to the basic unit (such as bytes).

[0161] 2. Time series data characteristics: Different sampling frequencies: The sampling intervals of different data sources are different (e.g., 60 seconds, 5 minutes, etc.). Conversion operation: Resampling, adjusting all data to a unified time interval. Missing values: There is no data at some time points in the time series. Conversion operation: Interpolation processing, using methods such as linear interpolation and spline interpolation to fill in the missing values.

[0162] 3. Categorical Data Characteristics: Text Category: Such as device status ("online", "offline", "fault", etc.). Conversion Operation: Encoding conversion, converting the text category to a numerical encoding (such as 0, 1, 2). The system automatically selects the appropriate conversion operation based on the data analysis results. For example: For throughput data, when it is detected that the throughput ranges of different subscriptions vary greatly, normalization processing is applied. For percentage data such as CPU usage, the original value is usually kept unchanged. For data containing outliers, truncation or replacement processing is applied.

[0163] Step 2: Time series data processing, including resampling, interpolation, etc.

[0164] Selection of processing methods for different time series data:

[0165] 1. High-frequency sampled data (such as network throughput at 60-second intervals): Resampling method: Aggregation resampling, combining multiple data points into one. Aggregation function: Mean (applicable to throughput), Maximum (applicable to peak detection). Application scenario: Trend analysis over a long time range, reducing data volume, and improving visualization efficiency.

[0166] 2. Low-frequency sampled data (such as the number of online clients per hour): Resampling method: Interpolation resampling, creating new data points between existing data points. Interpolation method: Linear interpolation (simply connecting adjacent points), Spline interpolation (creating a smooth curve). Application scenario: Scenarios requiring more fine-grained analysis, or comparison with other high-frequency data.

[0167] 3. Time series with missing values:

[0168] Processing method: Select the filling strategy according to the data characteristics. Filling strategy: Forward filling (using the previous valid value), Backward filling (using the next valid value), Interpolation filling. Application scenario: Ensuring the continuity of the time series and avoiding breakpoints in visualization. The system will automatically select the appropriate processing method according to the time interval, integrity, and analysis purpose of the data. For example: For network throughput data, aggregation resampling at 5 minutes or 15 minutes is usually applied, using the mean function. For the number of online clients, the original sampling frequency is usually maintained, but interpolation is used to fill in the missing values.

[0169] Step 3: Data aggregation, calculating statistical metrics such as mean, maximum, minimum, etc.

[0170] Data aggregation process and results:

[0171] Data aggregation is the process of converting raw data points into statistical summaries, and the system implements multi-level aggregation:

[0172] 1. Time - dimension aggregation: Input: Time - series data points (such as throughput records per minute). Process: Group by time windows (such as hours, days) and apply aggregation functions. Output: Aggregated time - series, with one data point for each time window. Example: Aggregate throughput data at 60 - second intervals into hourly averages.

[0173] 2. Entity - dimension aggregation: Input: Data of multiple entities (such as subscriptions, CPEs). Process: Group by entities and calculate statistical metrics. Output: Statistical summary for each entity. Example: Calculate the average throughput, maximum throughput, etc. for each subscription.

[0174] 3. Metric - dimension aggregation: Input: Data of multiple metrics (such as RX throughput, TX throughput). Process: Calculate statistical values for each metric separately, and may also calculate relationships between metrics. Output: Statistical summary for each metric, which may include relationships between metrics. Example: Calculate the RX / TX ratio to analyze the balance of upstream and downstream traffic.

[0175] Technical key - point implementation:

[0176] Data structured - conversion mechanism: The system implements a set of advanced data - conversion frameworks that support various data - conversion operations. For time - series data, the system can perform resampling operations to convert data with irregular time points into a time - series with a fixed interval; for multi - dimensional data, the system can perform pivot operations to analyze data from different perspectives. The system also implements various aggregation methods, such as average, median, percentile, etc., and can automatically select the appropriate aggregation method according to the data characteristics.

[0177] The output of this stage is a set of converted and aggregated data. These data have been converted from the original data into a form that is more valuable for analysis, containing various statistical metrics and multi - dimensional views, providing a rich data source for the next - step data - model construction.

[0178] In an exemplary embodiment, S223 can be replaced by the following steps.

[0179] S2231: Construct a standardized data structure according to a predefined data - model template; the predefined data - model template includes a core data model, a real - time data model, a time - series data model, and an aggregated - analysis data model.

[0180] S2232: Map the converted and aggregated data set to each field of the standardized data structure, and verify the integrity and consistency of the standardized data structure to determine the data structure that passes the verification; the verification methods for integrity and consistency include structural - integrity verification, data - consistency verification, anomaly detection, and repair strategies.

[0181] S2233: Calculate the derived fields of the converted and aggregated dataset.

[0182] S2234: Integrate each mapped field and the derived fields into the verified data structure to construct a structured data model.

[0183] Data model construction:

[0184] Step 1: Construct a standardized data structure according to a predefined data model template.

[0185] Association with dataset relationships:

[0186] Data model construction is based on the dataset relationships identified earlier, formalizing these relationships into a structured data model:

[0187] Dataset relationships: Describe the logical associations between different datasets (such as subscriptions, CPEs, sites).

[0188] Data model: Transforms these relationships into a specific data structure, defining the organization and access paths of the data.

[0189] Predefined data model template:

[0190] The system defines a series of data model templates using TypeScript interfaces, mainly including:

[0191] 1. Core data models: ˋExcelAnalyzerResultˋ: The top-level model of the entire analysis result, containing all other models. ˋSubscriptionDataˋ: Subscription-related data model. ˋCpeResourceDataˋ: CPE resource data model. ˋLocalBreakoutSiteDataˋ: Escape site data model.

[0192] 2. Real-time data models: ˋExcelAnalyzerRealTimeOverviewˋ: Real-time overview data model. ˋCpeRealTimeResourceˋ: CPE real-time resource data model.

[0193] ˋLocalBreakoutSiteRealtimeClassˋ: Escape site real-time data model.

[0194] 3. Time series data models: ˋSubscriptionThroughputTrendsListItemˋ: Subscription throughput trend item model. ˋSubscriptionClientOnlineListItemˋ: Subscription client online count item model.

[0195] ˋApplicationThroughputTrendListItemˋ: Application throughput trend item model.

[0196] Trend item models related to various independent sites.

[0197] 4. Aggregation analysis data model: ˋSubscriptionOverallAnalysisˋ: Subscription overall analysis model. ˋCommonThroughputAnalysisˋ: General throughput analysis model. ˋCommonAnalysisˋ: General analysis model.

[0198] Step 2: Map the processed data to each field of the data model.

[0199] Sources of the processed data:

[0200] The processed data mainly comes from the previous two stages: Excel file parsing stage: Extracted raw data. Data transformation and aggregation stage: Data that has been cleaned, transformed, and aggregated.

[0201] Data mapping process:

[0202] 1. Direct mapping: For simple fields, directly assign the processed data to the model field. For example: Directly map the parsed subscription ID to the ˋsubscriptionIdˋ field.

[0203] 2. Transformation mapping: For fields that require format conversion, perform the necessary conversion first and then map. For example: Convert the throughput in string form to a numerical type and then map it to the ˋrxThroughputˋ field.

[0204] 3. Aggregation mapping: For fields that require aggregation, calculate the aggregation value first and then map. For example: Calculate the average throughput and then map it to the ˋavgRXThroughputˋ field.

[0205] 4. Relationship mapping: Establish reference relationships between different data entities. For example: Associate CPE data with the site to which it belongs.

[0206] Step 3: Verify the integrity and consistency of the data model.

[0207] Methods for integrity and consistency verification:

[0208] 1. Structural Integrity Verification: - Required Field Check: Ensure that all required fields have values and there are no unexpected 'undefined'. - Type Check: Ensure that the field value types match the expectations (e.g., numeric fields are not strings). - Range Check: Ensure that numerical values are within a reasonable range (e.g., percentages are between 0 - 100). - Implementation: Combine the use of the TypeScript type system and runtime checks.

[0209] 2. Data Consistency Verification: - Relationship Consistency: Ensure that reference relationships are correct (e.g., subscription ID matches the subscription name). - Temporal Consistency: Ensure that timestamps in time - series data are ordered and non - repetitive. - Aggregation Consistency: Ensure that aggregated values are consistent with the original data (e.g., the average value is indeed the average of all values). - Implementation: Use specialized validation functions for checking.

[0210] 3. Anomaly Detection: - Outlier Detection: Identify and handle outliers (e.g., unusually high throughput). - Missing Value Detection: Identify and handle missing critical data. - Implementation: Combine statistical methods and business rules.

[0211] 4. Repair Strategies: - Default Value Filling: Use default values for missing non - key fields. - Interpolation Filling: Use interpolation for missing points in time - series. - Outlier Handling: Replace outliers with reasonable values or mark them as anomalies. - Implementation: Select appropriate repair methods based on data characteristics.

[0212] Step 4: Calculate derived fields such as growth rate, percentage, etc.

[0213] Derived Field Calculation Formulas:

[0214] 1. Growth Rate: - Formula: '(currentValue - previousValue) / previousValue * 100%'. - Application: Calculate the month - on - month growth of metrics such as throughput, number of clients, etc. - Example: If the current hourly throughput is 100 Mbps and the previous hour was 80 Mbps, the growth rate is 25%.

[0215] 2. Percentage: - Formula: 'partValue / totalValue * 100%'. - Application: Calculate the percentage of a specific application, subscription, or site in the overall total. - Example: If the throughput of a certain application is 20 Mbps and the total throughput is 100 Mbps, the percentage is 20%.

[0216] 3. Utilization Rate: - Formula: 'currentValue / capacityValue * 100%'. - Application: Calculate resource utilization such as bandwidth utilization, CPU utilization. - Example: If the current throughput is 80 Mbps and the link capacity is 100 Mbps, the utilization rate is 80%.

[0217] 4. Balance Ratio: Formula: ˋminValue / maxValue*100%ˋ. Application: Evaluate the balance of uplink and downlink traffic, resource allocation, etc. Example: If the uplink throughput is 30Mbps and the downlink is 60Mbps, the balance ratio is 50%.

[0218] 5. Anomaly Rate: Formula: ˋanomalyCount / totalCount*100%ˋ. Application: Evaluate the frequency of abnormal events. Example: If there are 2 hours of anomalies within 24 hours, the anomaly rate is 8.33%.

[0219] Applications of Derived Fields:

[0220] The calculated derived fields are applied in the following processes:

[0221] 1. Report Content Generation: Display indicators such as growth rate and proportion in the overall analysis report. Mark important change rates in the trend chart. Use the anomaly rate to evaluate the system health status in anomaly analysis.

[0222] 2. Visualization Enhancement: Use derived metrics as additional dimensions of the chart. Represent the size of the growth rate or proportion through color coding. Use threshold lines to mark key utilization levels.

[0223] 3. Decision Support: Provide a basis for capacity planning (such as utilization trends). Help identify performance bottlenecks (such as unbalanced uplink and downlink traffic). Support resource optimization decisions (such as resource allocation based on proportion). Step 5: Generate the final structured data object for visualization rendering.

[0224] Generation of Structured Data Objects:

[0225] 1. Data Integration: Integrate the basic data and derived data into a unified data structure. Ensure the correct establishment of relationships between data. Remove intermediate calculation results and temporary data.

[0226] 2. Format Optimization: Adjust the data format according to visualization requirements. Pre-calculate possible aggregated values to reduce the computational burden during rendering. Optimize the data structure for fast access and rendering.

[0227] 3. Metadata Addition: Add descriptive metadata such as data source, generation time, version information, etc. Add display-related metadata such as units, formatting rules, display names, etc. Add analysis-related metadata such as anomaly marks, importance ratings, etc.

[0228] Implementation of Technical Key Points:

[0229] Data Structured Conversion Mechanism: The system defines a set of standardized data model interfaces (such as the ExcelAnalyzerResult interface), which contain the data structures required for various reports. The system fills the processed data into these models through mapping rules to ensure the structuring and standardization of the data. The system also implements a data model verification mechanism to check whether necessary fields exist, whether the data types are correct, etc., to ensure the integrity and consistency of the data model.

[0230] The output of this stage is a complete structured data model (such as an ExcelAnalyzerResult object), which contains all the data required for report generation, with a clear structure and unified format, providing a standardized data source for the generation of visualization components in the next stage.

[0231] In an exemplary embodiment, S3 can be replaced by the following steps.

[0232] S31: Analyze the data characteristics of all data in the structured data model; the data characteristics include data type, dimension, and order of magnitude.

[0233] S32: Based on the dynamic components of React, select the visualization component type according to the analysis results of the data characteristics and report requirements.

[0234] S33: According to the visualization component type, configure the component parameters and apply the theme style to determine the component configuration object; the component parameters include size, color scheme, and font; the component configuration object includes component type, data mapping, and style configuration.

[0235] S34: Based on the component configuration object, determine the overall layout structure according to the report type and content.

[0236] S35: Based on the overall layout structure, divide the page into partitions, arrange the component positions, design a responsive layout, and plan the paging strategy to determine the layout framework.

[0237] In practical applications, in the visualization component generation stage:

[0238] Component Selection and Configuration:

[0239] Step 1: Analyze the data characteristics, such as data type, dimension, order of magnitude, etc.

[0240] Data Characteristic Analysis Method:

[0241] The system analyzes the data characteristics through the following methods:

[0242] 1. Data Type Identification: Time Series Data: A data set containing a timestamp field, such as

[0243] ˋthroughputTrendsListˋ. Categorical data: Data that contains discrete categories, such as subscription IDs and application IDs. Numerical data: Continuous numerical data, such as throughput and CPU usage. Text data: Descriptive text, such as subscription names and application names.

[0244] 2. Dimension analysis: Time dimension: The time span, sampling frequency, and number of time points of the data. Entity dimension: The number of entities involved in the data (such as the number of subscriptions and applications).

[0245] Metric dimension: The types and number of metrics contained in the data.

[0246] 3. Order of magnitude analysis: Number of data points: The total number of data points, which affects rendering performance and interactive response. Value range: The minimum value, maximum value, and distribution characteristics of the data.

[0247] Magnitude of change: The degree of change of the data over time.

[0248] 4. Identification of special features: Periodicity: Whether the data has a periodic pattern. Trend: Whether the data has an obvious upward or downward trend. Outliers: Outlier values or points in the data.

[0249] Step 2: Select a suitable type of visualization component according to the data characteristics and report requirements.

[0250] Corresponding relationship between data characteristics and visualization components:

[0251] The system automatically selects the most suitable type of visualization component according to the data characteristics and report requirements:

[0252] 1. Time series data:

[0253] Suitable components: Line chart, area chart, time heat map.

[0254] Selection basis: When it is necessary to show a continuous change trend, select a line chart. When it is necessary to emphasize the cumulative effect, select an area chart. When it is necessary to show a multi-dimensional time pattern, select a time heat map.

[0255] Practical application: The system uses line charts for time series data such as network throughput and the number of online clients.

[0256] 2. Categorical comparison data:

[0257] Suitable components: Column chart, bar chart, radar chart.

[0258] Selection basis: When the number of categories is moderate and it is necessary to compare numerical values, select a column chart. When the number of categories is large, select a bar chart for better label readability. When multi-dimensional comparison is required, select a radar chart.

[0259] Practical application: The system uses bar charts to compare the performance of different subscriptions and applications.

[0260] 3. Part-whole relationship data:

[0261] Applicable components: Pie charts, donut charts, tree charts.

[0262] Selection criteria: When the number of categories is small and the proportion needs to be emphasized, select a pie chart. When additional information needs to be displayed in the central area, select a donut chart. When there is a hierarchical structure, select a tree chart.

[0263] Practical application: The system uses pie charts or donut charts for traffic distribution and resource usage ratio.

[0264] 4. Text and structured data:

[0265] Applicable components: Tables, tree structures, cards.

[0266] Selection criteria: When precise numerical values need to be displayed, select a table. When displaying a hierarchical structure, select a tree structure. When displaying overview information, select a card.

[0267] Practical application: The system uses a card layout for overall analysis data.

[0268] The main component types implemented in the system include: ECharts chart components: line charts, bar charts, pie charts, etc. React custom components: data cards, metric panels, status indicators, etc. HTML table components: detailed data tables.

[0269] Step 3: Configure component parameters such as size, color scheme, font, etc.

[0270] Basis for component parameter configuration:

[0271] The system configures component parameters based on the following factors:

[0272] 1. Data characteristics: The data range determines the axis scale and range. Data density affects the smoothness of the chart and symbol display. Data distribution characteristics affect color mapping and legend design.

[0273] 2. Visual perception principles: Use contrasting colors to distinguish different data series. Use gradient colors to represent data intensity changes. Ensure that the contrast between text and background meets readability requirements.

[0274] 3. Report purposes: Analytical reports emphasize data accuracy and use more data labels. Decision-making reports emphasize trends and patterns and use a more concise visual design. Presentation reports emphasize visual appeal and use more rich animations and interactions.

[0275] 4. Brand Consistency: Use a color scheme that is consistent with the enterprise brand. Apply unified font and style specifications. Maintain consistency in component styles.

[0276] Step 4: Apply theme styles to ensure visual consistency.

[0277] Implementation of Technical Key Points:

[0278] Dynamic Component Generation Based on React: The system implements a set of component selection algorithms that can automatically select the most suitable visualization components according to data characteristics. For example, for time series data, the system will select line charts or area charts; for categorical data, the system will select bar charts or pie charts; for multi-dimensional data, the system will select heatmaps or scatter plots. The system will also automatically adjust component configurations according to the data volume. For example, when there are many data points, sampling or aggregation techniques will be used to reduce the rendering pressure.

[0279] Multi-language Internationalization Support: The system applies internationalization settings during the component configuration phase to ensure that the text, date formats, number formats, etc. in the components meet the requirements of specific languages. The system uses the i18n library to implement multi-language support and automatically translates the text content in the components through the autoI18n function.

[0280] The output of this stage is a component configuration object, which contains information such as component type, data mapping, and style configuration, providing component-level configuration for the next layout planning.

[0281] Layout Planning and Organization:

[0282] Step 1: Determine the overall layout structure according to the report type and content.

[0283] 1. Mechanism for Determining Report Types:

[0284] Real-time Report: When the `realTimeOverview` data exists, the system will generate a real-time overview report.

[0285] Time Period Report: When time series data (such as `throughputTrendsList`) exists, the system will generate a trend analysis report.

[0286] Site Report: When the `exclusiveSite` data exists, the system will generate a dedicated report for each site.

[0287] Application Report: When the `applicationThroughputTrend` data exists, the system will generate an application throughput trend report.

[0288] 2. Determination of Report Content: The system checks whether each data section has valid data (non-empty and with sufficient data points). Only sections containing valid data will be included in the final report.

[0289] For example, the conditional check in the code: `if (!data.realTimeOverview) { return null;}`.

[0290] Determination of the Overall Layout Structure:

[0291] Based on the report type and content, the system will adopt different layout structures:

[0292] 1. Main Layout Structure Types: Single-page Information Card Layout: Used for overview information such as real-time overview, overall analysis, etc. Chart Grid Layout: Used to display multiple related charts such as subscription throughput trends. Detailed Data Table Layout: Used to display detailed data records such as CPE resource usage. Hybrid Layout: Combines the above layout types and is used for complex report pages.

[0293] 2. Determining Factors of the Layout Structure: Data Type: Time series data is suitable for chart layouts, and categorical data is suitable for card layouts; Data Volume: A large number of data points are suitable for charts or tables, and a small number of key metrics are suitable for cards; Data Relationship: Related data will be organized on the same page or adjacent pages; Importance Hierarchy: Important information is placed in a more prominent position (such as the top of the page).

[0294] 3. Layout Implementation Method: Use React components to define the layout structure, such as ` <div classname="realtimeoverview">Use CSS classes to control layout styles, such as grids, flexboxes, etc.; each report type has a corresponding React component, such as ˋRealTimeOverviewˋ,

[0295] ˋSharedSubscriptionˋ, etc.

[0296] Step 2: Plan the page sections, such as the title section, chart section, table section, etc.

[0297] Implementation method: Use nested div structures in the React component to define the page sections; each section has a clear class name, such as ˋrealTimeOverviewTitleˋ, ˋrealTimeOverviewContentˋ.

[0298] The sections usually include: title section, content section, chart section, statistics section, etc.; section types: title section: Displays the title of the report or part, usually at the top of the page; chart section: Contains data visualization charts, usually occupying the main part of the page; table section: Displays detailed data records, suitable for scenarios where precise numerical values are required; statistics section: Displays key statistical indicators, such as maximum value, average value, etc.; explanation section: Provides additional context information or explanations.

[0299] Step 3: Arrange the component positions, considering the information hierarchy and reading flow.

[0300] Implementation method: Use CSS to control the position and size of the components; consider the logical hierarchy and reading flow of the information (usually from top to bottom, from left to right); place related components together to form a visual grouping.

[0301] Principles for arranging component positions: Importance principle: Place important information at the top or upper left of the page; Relevance principle: Place related data together, such as subscription ID and name; Comparison principle: Place data that needs to be compared (such as upstream / downstream throughput) adjacent to each other; Hierarchy principle: From overview to details, from general to specific.

[0302] Step 4: Design a responsive layout to adapt to different page sizes.

[0303] Implementation method: Use relative units (such as percentages) instead of fixed pixel values; Use CSS Flexbox and Grid to implement an adaptive layout; Set minimum / maximum size constraints to ensure readability at different sizes.

[0304] Responsive Strategy: The PDF page is fixed to the A4 size, set by `format: "A4"`. Content adaptability: Elastic layout is used inside the components to adapt to different content lengths. Chart responsiveness: Relative sizes and adaptive settings are used in chart configurations. Text wrapping: Long texts wrap automatically to maintain readability.

[0305] Step 5: Plan the pagination strategy to determine how the content is distributed across pages.

[0306] Implementation method:

[0307] Determine the pagination points based on the content type and quantity.

[0308] Use the PDF document object model to manage pages.

[0309] Create a new page for each major section.

[0310] Build a table of contents structure to reflect the pagination organization.

[0311] Pagination strategy: Each major report section is on a separate page. For example, the real-time overview and overall analysis each occupy one page. Large datasets are processed across pages. For example, data from multiple sites is distributed across multiple pages. Keep related content on the same page. For example, charts and statistics for the same subscription. Avoid content being split. Ensure that charts and related explanations are on the same page. There are mutual dependencies and influences.

[0312] Step 2 (page partitioning) provides the container structure for Step 3 (component placement).

[0313] The component arrangement in Step 3 needs to consider the constraints of Step 4 (responsive layout).

[0314] The responsive design in Step 4 affects the content distribution in Step 5 (pagination strategy).

[0315] Implementation of technical key points:

[0316] Intelligent layout engine: The system implements a set of layout planning algorithms that can automatically generate the best layout according to the report type and content. The system uses a grid-based layout system to divide the page into multiple regions and assigns positions according to the importance and relevance of the components. The system also considers the information hierarchy and reading flow to ensure that important information is presented first and related information is placed adjacent to each other.

[0317] Dynamic component generation based on React: The system uses the component nesting and composition features of React to build complex layout structures. The system defines a series of layout components such as Row, Column, Card, etc., and realizes flexible page layouts by combining these components.

[0318] The output of this stage is a complete layout configuration, which contains information such as page structure, component positions, responsive rules, etc., providing a layout framework for the rendering of React components in the next step.

[0319] In an exemplary embodiment, S4 can be replaced by the following steps.

[0320] S41: Initialize the React rendering environment, pass the structured data model to the dynamic components of React, construct a React component tree, and recursively render all React components on the React component tree;

[0321] S42: Convert the React component tree into recognizable code; the recognizable code includes HTML code, CSS code, and JavaScript code; the recognizable code is a complete web page;

[0322] S43: Initialize and configure a headless browser based on the recognizable code;

[0323] S44: Render the configured headless browser page according to the rendered React components, and capture the rendered headless browser page;

[0324] S45: Set PDF printing parameters, and convert the captured headless browser page into a PDF format page according to the PDF printing parameters;

[0325] S46: Generate a basic PDF document based on the PDF format page;

[0326] S47: Process and optimize the basic PDF document to determine the PDF document;

[0327] S48: Configure browser parameters suitable for generating PDF format, and display the PDF document according to the browser parameters.

[0328] In practical applications, React component rendering

[0329] Step 1: Initialize the React rendering environment.

[0330] Step 2: Pass the data model to the React component.

[0331] In this step, the system passes the structured data model as props to the corresponding React component:

[0332] Data model source:

[0333] The data model refers to the 'ExcelAnalyzerResult' object generated in the previous 'Data Structuring Processing Stage'.

[0334] This object contains all the structured data extracted from Excel and processed.

[0335] For example, real-time overview data, subscription throughput trends, CPE resource usage, etc.

[0336] Data transfer method:

[0337] Transfer data through the props mechanism of React components.

[0338] For example: `React.createElement(ReportFirstConvert,{data,excelZip,reportTaskName,siteName})`.

[0339] Among them, the `data` parameter is the `ExcelAnalyzerResult` object, which contains all the structured data.

[0340] `excelZip` contains the meta-information of the Excel file, such as time range, time zone, etc.

[0341] `reportTaskName` is the name of the report.

[0342] `siteName` is the optional site name (used to generate reports for specific sites).

[0343] Data distribution:

[0344] According to different parts of the report, the system will pass the relevant data subsets to the corresponding components.

[0345] For example, the overall analysis page only needs the data in the `data.subscription.overallAnalysis` part.

[0346] The shared subscription throughput trends page requires

[0347] the data of `data.subscription.sharedSubscription.throughputTrendsList`.

[0348] This data transfer method based on props ensures the decoupling of components and data, enabling components to focus on the visualization of data without caring about the source and processing process of the data.

[0349] Step 3: Component tree construction, starting from the root component, recursively rendering child components.

[0350] The `ReactDOMServer.renderToString` method converts the entire component tree into an HTML string.

[0351] This component tree structure makes the organization and rendering of the report content modular and maintainable. Each component is responsible for a specific functional area and can be developed and tested independently.

[0352] Step 4: Apply styles and themes to ensure visual consistency.

[0353] Step 5: Generate the final HTML / CSS / JavaScript code.

[0354] In this step, the system converts the React component tree into complete HTML / CSS / JavaScript code:

[0355] HTML generation:

[0356] Use the `ReactDOMServer.renderToString` method to convert the React component tree into an HTML string.

[0357] The generated HTML contains the complete document structure, including the `<!DOCTYPE html>`, `<html>`, `<head>`, and `<body>` tags.

[0358] The HTML contains all the content elements, such as headings, paragraphs, tables, chart containers, etc.

[0359] CSS includes:

[0360] External CSS is introduced via the `<link>` tag. <link> < / link>

[0361] Inline CSS is added via the `<style>` tag. <style>ˋ标签嵌入。

[0362] 确保所有必要的样式都被包含在最终的HTML中。

[0363] JavaScript生成:

[0364] 对于交互式内容(如图表),系统生成必要的JavaScript代码。

[0365] 例如,ECharts图表的初始化和配置代码通过ˋ<script>ˋ标签嵌入。

[0366] JavaScript代码通常包含数据处理、图表配置和事件处理等功能。

[0367] 最终生成的HTML / CSS / JavaScript代码是一个完整的网页,包含所有必要的内容、样式和交互功能。这个网页将被传递给Puppeteer进行渲染和PDF生成,从而完成从数据到可视化报告的转换过程。

[0368] 通过这种方式,系统实现了从结构化数据到可视化HTML内容的自动转换,为后续的PDF渲染提供了高质量的输入。React的组件化设计和服务端渲染能力使这个过程既灵活又高效,能够生成各种复杂的报表内容。

[0369] 技术关键点实现:

[0370] 基于React的动态组件生成:系统使用ReactDOMServer.renderToString方法将React组件渲染为HTML字符串,实现服务端渲染。系统构建了一套完整的React组件库,包括各种图表组件(如折线图、柱状图、饼图等)、表格组件、文本组件等,能够满足各种报表需求。系统还实现了组件的动态加载和条件渲染,根据数据内容动态调整组件的显示与隐藏。

[0371] 多语言国际化支持:在React组件渲染阶段,系统应用国际化设置,确保所有文本内容都使用正确的语言。系统使用ContextAPI传递语言设置,使所有组件都能访问当前的语言环境。

[0372] 输出与下一步骤的关联:

[0373] 此阶段输出完整的HTML字符串,包含了所有可视化组件和布局结构,为下一阶段的PDF渲染提供了HTML内容源。

[0374] PDF报表渲染阶段:

[0375] 无头浏览器初始化与配置:

[0376] 步骤1:启动Puppeteer无头浏览器实例。

[0377] 步骤2:配置浏览器参数,如视口大小、DPI设置等。

[0378] 步骤3:设置页面加载超时和等待策略。

[0379] 步骤4:配置字体和样式资源的加载。

[0380] 步骤5:初始化页面环境,准备接收React渲染内容。

[0381] 可视化组件生成阶段的关系:

[0382] 无头浏览器是渲染可视化组件生成的HTML / CSS / JavaScript代码的环境。

[0383] 可视化组件生成阶段输出的是静态HTML字符串,而无头浏览器提供了一个完整的浏览器环境,能够执行JavaScript、应用CSS样式、渲染图表等。

[0384] 无头浏览器充当了"虚拟显示器"的角色,将静态HTML转换为视觉上完整的网页。

[0385] 这个步骤建立了一个隔离的浏览器环境,为后续的页面渲染提供基础。

[0386] 技术关键点实现:

[0387] 无头浏览器渲染技术:系统使用Puppeteer库启动Chrome无头浏览器,实现高质量的HTML渲染。系统配置了适合PDF生成的浏览器参数,如禁用沙箱(--no-sandbox)以适应容器环境、禁用开发共享内存(--disable-dev-shm-usage)以提高稳定性等。系统还实现了浏览器实例的池化管理,提高资源利用效率,减少启动开销。

[0388] 此阶段输出配置完成的Puppeteer浏览器实例和页面对象,为下一步的页面渲染与捕获提供了执行环境。

[0389] 页面渲染与捕获:

[0390] 步骤1:将React渲染生成的HTML内容加载到无头浏览器页面。

[0391] 步骤2:等待页面完全渲染,包括所有图表和样式。

[0392] 步骤3:执行必要的JavaScript,确保交互式内容正确显示。

[0393] 在这一步骤中,系统执行页面中的JavaScript代码,特别是用于初始化和配置交互式内容的脚本。

[0394] 执行完成确认:

[0395] 系统通过ˋwaitUntil:"networkidle0"ˋ设置确保所有JavaScript执行完成。

[0396] 对于复杂的图表,可能还需要额外的等待时间,确保动画和渲染完全完成。

[0397] 这一步骤确保了页面中的交互式内容(主要是数据可视化图表)被正确初始化和显示,使最终捕获的PDF能够包含完整的可视化效果。

[0398] 步骤4:设置PDF打印参数,如页面大小、边距、页眉页脚等。

[0399] 步骤5:捕获页面为PDF格式,保留高质量的视觉效果。

[0400] 技术关键点实现:

[0401] 无头浏览器渲染技术:系统使用Puppeteer的page.setContent方法将HTML内容加载到页面,并使用page.waitForSelector和page.waitForFunction等方法确保页面完全渲染。系统还实现了自定义的等待策略,能够检测图表渲染完成、字体加载完成等状态。

[0402] 智能布局引擎:系统生成PDF打印配置,包括页面大小、边距、页眉页脚等。系统支持自定义页眉页脚,能够在页眉显示报表名称和时间范围,在页脚显示客户名称和页码。

[0403] 此阶段输出PDF二进制数据,包含了完整渲染的页面内容,为下一步的PDF后处理提供了基础PDF文档。

[0404] PDF后处理与优化:

[0405] 步骤1:加载生成的PDF文档。

[0406] 步骤2:创建文档目录,建立页面导航结构。

[0407] 1.收集目录项信息。

[0408] 在生成各个报告页面的过程中,系统会收集目录项信息,存储在

[0409] ˋcomprehensiveSiteCatalogListˋ数组中。

[0410] 每次生成新的报告页面(如实时概览、共享订阅等),系统会记录该页面的标题和页码。

[0411] 目录项使用ˋComprehensiveSiteCatalogItemˋ结构,包含标题、起始页码、结束页码和子目录项。

[0412] 对于独立站点,系统会创建父级目录项,并为站点下的各个报告类型创建子目录项。

[0413] 目录项的层级结构反映了报告的逻辑组织结构。

[0414] 2.创建目录页面:

[0415] 在所有报告页面生成完成后,系统调用ˋgenerateCatalogToPdfˋ方法创建目录页面:

[0416] 创建一个临时的PDF文档用于生成目录。

[0417] 加载必要的字体资源(普通字体和粗体字体)。

[0418] 在临时PDF中添加页面,并设置页面大小和边距。

[0419] 绘制目录标题和各个目录项。

[0420] 对于每个目录项,绘制标题、点线和页码。

[0421] 如果目录内容超过一页,系统会自动创建新页面继续绘制。

[0422] 目录项的绘制包括:

[0423] 绘制目录项标题(使用粗体字体)。

[0424] 绘制点线连接标题和页码。

[0425] 绘制页码。

[0426] 对于子目录项,增加缩进并使用普通字体。

[0427] 3.存储链接信息:

[0428] 在绘制目录项的同时,系统会记录每个目录项的位置信息和目标页码,用于后续创建链接。

[0429] 这个信息包括:

[0430] 目录项在页面上的矩形区域(用于定义可点击区域)、目录项所在的页面索引、目录项指向的目标页面编号。

[0431] 4.合并目录页面到主文档:

[0432] 目录页面绘制完成后,系统将临时PDF中的页面复制到主PDF文档中:目录页面被插入在封面页之后,主报告内容之前;创建交互式链接。

[0433] 最后,系统为每个目录项创建指向对应报告页面的交互式链接:

[0434] 这个过程包括:在目录页面上创建透明的矩形区域作为可点击区域;为这个区域创建PDF注释(Annotation);设置注释类型为链接(Link);设置链接的目标为对应的报告页面。

[0435] 步骤3:添加元数据,如标题、作者、创建日期等。

[0436] 步骤4:优化PDF文件大小,压缩图像和内容。

[0437] 步骤5:添加页码、水印等辅助元素。

[0438] 步骤6:生成最终的PDF文档,准备输出或存储。

[0439] 技术关键点实现:

[0440] 智能布局引擎:系统使用pdf-lib库处理PDF文档,实现目录生成、元数据添加等功能。系统根据报表结构自动生成目录,建立页面之间的导航关系。系统还实现了页码自动生成和水印添加功能,提高报表的专业性和安全性。

[0441] 无头浏览器渲染技术:系统实现了PDF文档的合并和优化,将多个页面的PDF合并为一个完整的文档,并进行必要的优化,如压缩图像、删除冗余数据等,减小文件大小。

[0442] 本申请适用于但不限于以下应用领域:

[0443] 网络监控与性能分析:将网络设备生成的性能数据转换为直观的报表,帮助网络管理员监控网络状态、分析性能瓶颈。

[0444] IT基础设施管理:自动生成服务器、存储设备等IT基础设施的运行状态报告,支持IT运维决策。

[0445] 财务报表自动化:将财务Excel数据转换为标准化的财务报表,提高财务报告的效率和准确性。

[0446] 销售与市场分析:将销售数据转换为可视化报表,帮助分析销售趋势、客户行为和市场变化。

[0447] 医疗数据分析:将医疗数据转换为标准化报告,支持医疗研究和临床决策。

[0448] 本申请的智能Excel解析引擎能够自动识别和处理各种复杂格式的Excel文件,包括多工作表、合并单元格、公式计算等。

[0449] 本申请能够自动分析Excel文件结构特征,从多个专用解析器中选择最适合的一个,无需人工干预。这种基于特征识别的解析器匹配机制,使系统能够处理各种复杂格式的Excel文件,大大提高了系统的适应性和通用性。同时,系统能够智能处理Excel中的复杂元素,如合并单元格、公式计算、隐藏行列等,确保数据提取的准确性和完整性。

[0450] 本申请的数据结构化转换机制将非结构化或半结构化的Excel数据转换为标准化的结构化数据模型。

[0451] 本申请实现了一套高级数据转换框架,能够根据数据特性自动执行适当的转换操作,如时间序列重采样、数据聚合等。系统还定义了标准化的数据模型接口,能够将处理后的数据自动映射到这些模型中,形成结构清晰、格式统一的数据对象。这种数据结构化转换机制,使系统能够将非结构化或半结构化的Excel数据转换为标准化的数据模型,为后续的可视化渲染提供了高质量的数据源。

[0452] 本申请生成基于React的动态组件,根据数据特性自动选择和生成适合的React可视化组件。

[0453] 本申请实现了一套组件选择算法,能够根据数据特性(如数据类型、维度、数量级等)自动选择最适合的可视化组件,并自动配置组件参数。系统还构建了一套完整的React组件库,能够根据数据内容动态生成组件树,实现复杂的可视化效果。这种基于React的动态组件生成机制,使系统能够根据数据特性自动生成最适合的可视化表现形式,提高了报表的可读性和信息传达效率。

[0454] 本申请采用了无头浏览器渲染技术,使用Puppeteer等工具将React组件渲染为高质量的PDF页面。

[0455] 使用Puppeteer无头浏览器技术,实现了HTML内容的高质量渲染和PDF捕获。系统实现了自定义的等待策略,能够确保所有内容(包括异步加载的图表、字体等)完全渲染后再进行捕获。系统还优化了PDF捕获参数,确保生成的PDF文档具有高质量的视觉效果。这种无头浏览器渲染技术,解决了传统HTML到PDF转换方法中的渲染质量问题,使系统能够生成专业水准的PDF报表。

[0456] 智能布局引擎能够自动处理页面布局、分页、页眉页脚等,确保报表的专业性和可读性。

[0457] 本申请实现了一套布局规划算法,能够根据报表类型和内容自动生成最佳布局。系统考虑了信息层次和阅读流程,确保重要信息优先展示,相关信息相邻放置。系统还实现了PDF后处理功能,能够自动生成目录、添加页码和水印等,提高报表的专业性和可用性。这种智能布局引擎,解决了自动生成报表中的布局问题,使系统能够生成结构清晰、易于阅读的专业报表。

[0458] 多语言国际化支持:自动适应不同语言环境,生成符合本地化要求的报表

[0459] 本申请实现了全流程的国际化支持机制,从数据解析、处理到可视化渲染,都考虑了不同语言环境的特性。系统使用i18n库和ContextAPI实现多语言支持,能够自动适应不同语言环境,生成符合本地化要求的报表。这种多语言国际化支持机制,使系统能够在全球范围内使用,满足不同语言环境的报表需求。

[0460] 基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的Excel报表自动化转换和渲染方法的Excel报表自动化转换和渲染装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个Excel报表自动化转换和渲染装置实施例中的具体限定可以参见上文中对于Excel报表自动化转换和渲染方法的限定,在此不再赘述。

[0461] 在一个示例性的实施例中,提供了一种Excel报表自动化转换和渲染装置包括:

[0462] Excel解析模块,采用智能Excel解析引擎自动分析Excel文件结构特征,选择最适合的解析器解析Excel文件。

[0463] 数据处理模块,用于基于xlsx库以及数据结构化转换机制,对解析后的Excel文件进行数据处理,构建结构化数据模型;所述结构化数据模型包括解析后的Excel文件中生成所有报表所需的数据。

[0464] 可视化生成模块,用于根据所述结构化数据模型构建不同类型的可视化生成组件,确定布局框架。

[0465] PDF渲染模块,用于基于React的动态组件,采用无头浏览器技术对所述布局框架中的可视化内容进行动态加载和渲染,配置适合生成PDF格式的浏览器参数,并根据所述浏览器参数显示PDF文档;所述PDF文档包括报表内容、目录结构以及元数据。

[0466] 本申请具有以下技术效果:

[0467] 高效率:将传统需要数小时甚至数天的手动报表生成过程缩短至分钟级别,大幅提高工作效率。

[0468] 高准确性:通过自动化处理,消除人工操作可能引入的错误,提高报表数据的准确性和可靠性。

[0469] 高一致性:确保所有报表遵循统一的格式和标准,提高企业报表的专业性和品牌形象。

[0470] 高可扩展性:模块化设计使系统易于扩展,可以快速适应新的数据源和报表需求。

[0471] 降低成本:减少人力资源投入,降低报表生成的总体成本。

[0472] 提升决策支持能力:通过高质量的数据可视化,帮助决策者更快、更准确地理解数据并做出决策。

[0473] 支持大规模应用:能够处理大量并发的报表生成请求,满足企业级应用需求。

[0474] 通过上述技术方案,本申请解决了现有技术中Excel报表自动化转换与渲染过程中的关键技术问题,为企业和组织提供了一种高效、准确、灵活的报表生成解决方案。

[0475] 本申请中,所有获取信号、信息或数据的动作,都是在遵照所在地国家相应的数据保护法规政策的前提下,并获得由相应装置所有者给予授权的前提下进行的。

[0476] 本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。

[0477] 以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。

[0478] 本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本申请的限制。< / style>

Claims

1. An Excel report automation conversion and rendering method, characterized in that, including: Using an intelligent Excel parsing engine to automatically analyze the structural characteristics of the Excel file and select the most suitable parser to parse the Excel file; Based on the xlsx library and the data structuring conversion mechanism, performing data processing on the parsed Excel file to construct a structured data model; the structured data model includes the data required for generating all reports in the parsed Excel file; Based on the dynamic components of React, constructing different types of visualization generation components according to the structured data model and determining the layout framework; Based on the dynamic components of React and the structured data model, using headless browser technology to dynamically load and render the visualization content in the layout framework, configuring browser parameters suitable for generating PDF format, and displaying the PDF document according to the browser parameters; the PDF document includes report content, table of contents structure, and metadata.

2. The Excel report automation conversion and rendering method according to claim 1, wherein Using an intelligent Excel parsing engine to automatically analyze the structural characteristics of the Excel file and select the most suitable parser to parse the Excel file, specifically including: Downloading the Excel file based on the Excel file download request; Using an intelligent Excel parsing engine to analyze the structural characteristics of the Excel file; the structural characteristics include the number of worksheets, worksheet naming patterns, and data organization methods; According to the analysis result of the Excel file structural characteristics, determining whether there is a most suitable parser for the current Excel file in the parser suite library; If so, taking the filtered parser as the most suitable parser and initializing the most suitable parser, allocating system resources to adapt to the parsing environment; Running the most suitable parser according to the system resources to analyze the Excel file and determining the parsed Excel file; If not, outputting an exception and recording the log.

3. The Excel report automation conversion and rendering method according to claim 1, characterized in that Based on the xlsx library and the data structuring conversion mechanism, performing data processing on the parsed Excel file to construct a structured data model, specifically including: Using the xlsx library to load all worksheets in the parsed Excel file and performing basic processing on the worksheets to determine a preliminarily structured original data set; the basic processing includes identifying the data areas of each worksheet, processing merged cells and hidden rows and columns, extracting cell data, retaining the original format and data integrity, processing formula cells to obtain calculation results, identifying time series data and normalizing it according to time zone offsets, and detecting data anomalies and recording anomaly information; the preliminarily structured original data set includes all data extracted from the parsed Excel file and the corresponding metadata; the metadata includes data types, formats, and locations; Based on the data structuring conversion mechanism, performing preprocessing on the preliminarily structured original data set to construct a structured data model; the preprocessing includes data cleaning and standardization and data conversion and aggregation.

4. The Excel report automatic conversion and rendering method according to claim 3, wherein, Based on the data structuring conversion mechanism, performing preprocessing on the preliminarily structured original data set to construct a structured data model, specifically including: Based on the data structured conversion mechanism, clean and standardize the initially structured original data set to determine the standardized data set after cleaning; the data cleaning and standardization include removing invalid data, handling missing values, converting data types, unit standardization processing, and text data standardization processing; Perform data conversion and aggregation on the standardized data set after cleaning to determine the data set after conversion and aggregation; the conversion and aggregation include performing conversion operations on data characteristics, handling time series data, aggregating data, pivoting multi-dimensional data, generating data views in different dimensions, and data association analysis to identify the relationships between different data sets; Construct a structured data model based on the data set after conversion and aggregation.

5. The Excel report automatic conversion and rendering method according to claim 4, characterized in that Construct a structured data model based on the data set after conversion and aggregation, specifically including: Construct a standardized data structure according to a predefined data model template; the predefined data model template includes a core data model, a real-time data model, a time series data model, and an aggregation analysis data model; Map the data set after conversion and aggregation to each field of the standardized data structure, and verify the integrity and consistency of the standardized data structure to determine the data structure that passes the verification; the verification methods for integrity and consistency include structural integrity verification, data consistency verification, anomaly detection, and repair strategies; Calculate the derived fields of the data set after conversion and aggregation; Integrate the mapped fields and the derived fields into the data structure that passes the verification to construct a structured data model.

6. The Excel report automation conversion and rendering method according to claim 1, characterized in that Based on the dynamic components of React, construct different types of visualization generation components according to the structured data model, and determine the layout framework, specifically including: Analyze the data characteristics of all data in the structured data model; the data characteristics include data type, dimension, and order of magnitude; Based on the dynamic components of React, select the visualization component type according to the analysis results of the data characteristics and the report requirements; According to the visualization component type, configure the component parameters and apply the theme style to determine the component configuration object; the component parameters include size, color scheme, and font; the component configuration object includes component type, data mapping, and style configuration; Based on the component configuration object, determine the overall layout structure according to the report type and content; Based on the overall layout structure, divide the page into partitions, arrange the component positions, design a responsive layout, and plan the paging strategy to determine the layout framework.

7. The Excel report automatic conversion and rendering method according to claim 1, wherein Based on the dynamic components of React and the structured data model, use headless browser technology to dynamically load and render the visualization content in the layout framework, configure browser parameters suitable for generating PDF format, and display the PDF document according to the browser parameters, specifically including: Initialize the React rendering environment, pass the structured data model to the dynamic components of React, construct a React component tree, and recursively render all React components on the React component tree; Convert the React component tree into recognizable code; the recognizable code includes HTML code, CSS code, and JavaScript code; the recognizable code is a complete web page; Initialize and configure a headless browser based on the recognizable code; Render the configured headless browser page according to the rendered React components, and capture the rendered headless browser page; Set PDF printing parameters, and convert the captured headless browser page into a PDF format page according to the PDF printing parameters; Generate a basic PDF document based on the PDF format page; Process and optimize the basic PDF document to determine the PDF document; Configure browser parameters suitable for generating PDF format, and display the PDF document according to the browser parameters.

8. An Excel report automated conversion and rendering device, characterized in that, Comprising: An Excel parsing module that automatically analyzes the Excel file structure characteristics using an intelligent Excel parsing engine and selects the most suitable parser to parse the Excel file; A data processing module for processing the parsed Excel file based on the xlsx library and a data structured conversion mechanism to construct a structured data model; the structured data model includes all the data required for generating reports in the parsed Excel file; A visualization generation module for constructing different types of visualization generation components according to the structured data model and determining the layout framework; A PDF rendering module for dynamically loading and rendering the visualization content in the layout framework using a headless browser technology based on React dynamic components, configuring browser parameters suitable for generating PDF format, and displaying the PDF document according to the browser parameters; the PDF document includes report content, a table of contents structure, and metadata.

9. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the Excel report automated conversion and rendering method according to any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the Excel report automated conversion and rendering method according to any one of claims 1-7.

Citation Information

Cited By

  • Method and system for converting Excel line data into visual blueprint view

    CN120805844A

  • Customized document automatic generation method and system

    CN121303059A

  • A method and system for automatically generating customized documents

    CN121303059B

  • Message pushing method and system for instant processing of enterprise operation information, and medium

    CN121924101A

  • A message pushing method, system and medium for instant processing of enterprise operation information

    CN121924101B