A data rendering visualization method and system based on PowerPoint document as template

By introducing renderers and conversion modules in PowerPoint document rendering, processing multiple data labels is solved, and the problem of data labels being split and style loss in the existing technology is achieved, flexible template production and high scalability are achieved, suitable for complex Requirement scenario.

CN117539565BActive Publication Date: 2024-12-27CHINA LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311351233.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-18
Publication Date
2024-12-27
Estimated Expiration
2043-10-18

AI Technical Summary

Technical Problem

The existing data rendering solution based on PowerPoint documents as templates is simple to function and cannot handle the problem of data labels being split, resulting in lost styles, complex development and poor scalability.

Method used

Using a data rendering visualization method based on PowerPoint documents as templates, it supports multiple data label types (such as connector labels, single-value labels, table labels, picture labels, etc.) through the renderer and conversion module, and through the execution chain and The rendering module processes data labels to ensure consistency and scalability of rendering effects.

Benefits of technology

It realizes complex data rendering support for PowerPoint documents, ensures that the rendering style is not lost, reduces development difficulty, supports custom expansion, and is suitable for various demand scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117539565B_ABST
    Figure CN117539565B_ABST
Patent Text Reader

Abstract

The present invention provides a data rendering visualization method based on a PowerPoint document as a template, comprising the following steps: S1: the caller carries request information and sends a rendering request; S2: the server receives the request information of the caller and passes the request information to the renderer; S3: the renderer renders the template according to the request information and converts it into result data in the format specified by the request, and returns the final format file generated after rendering to the server; S4: the server packages the received final format file into response information and returns it to the caller. A data rendering visualization method based on a PowerPoint document as a template is also provided. The method and system of the present invention solve the problem of data rendering visualization based on a PowerPoint document as a template, provide a unified data label, provide high scalability, reduce the difficulty of programmer development, are simple and convenient for users to use, and are flexible in template making, and support various complex demand scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer applications, and in particular to a data rendering visualization method and system based on a PowerPoint document as a template. Background Art

[0002] In some rendering visualization scenarios, such as generating user business cards, promotional pictures, good news pictures, etc., data rendering based on PowerPoint documents as templates can greatly facilitate users. Users can easily adjust the display effect by editing the data labels on the PowerPoint document template to achieve what you see is what you get. However, due to the complex format of PowerPoint documents, data labels will be split into several irregular blocks in PowerPoint (see Figure 5 ), so there is no complete rendering solution based on PowerPoint documents as templates on the market. These solutions basically have the following problems:

[0003] 1. The function is too simple, only supporting text boxes and tables, and the style cannot be guaranteed to remain unchanged, so it can only be fixed to a certain style.

[0004] 2. The problem of data label splitting cannot be handled, and can only be handled simply. There is a possibility of losing document style, and the effect before and after rendering cannot be guaranteed to be consistent.

[0005] 3. Complex development and poor scalability. Developers need to modify a lot of code to add custom data tags. Summary of the invention

[0006] The purpose of the present invention is to solve the problem of data rendering visualization based on PowerPoint documents as templates, provide unified data labels, provide high scalability, reduce the development difficulty of programmers, make it simple and convenient for users to use, make templates flexible, and support various complex demand scenarios. A data rendering visualization method and system based on PowerPoint documents as templates is proposed.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] A data rendering visualization method based on a PowerPoint document as a template comprises the following steps:

[0009] S1: The caller carries the request information and sends a rendering request;

[0010] S11: The caller packages the request information;

[0011] S12: The caller sends the request information to the server;

[0012] S2: The server receives the request information from the caller and passes it to the renderer;

[0013] S3: The renderer renders the template according to the request information and converts it into the result data in the format specified by the request, and returns the final format file generated after rendering to the server;

[0014] S31: The renderer creates an executor according to the request information;

[0015] The renderer finds the specified type of rendering module and conversion module according to the template file format and generation format of the request information, and creates an executor. The executor contains an execution chain, and rendering is performed in the order of the execution chain.

[0016] S32: The renderer passes the request information to the executor;

[0017] S33: The executor transmits the request information to the rendering module;

[0018] S34: The rendering module performs rendering;

[0019] S35: After the rendering module completes the rendering, the rendered template is passed to the conversion module;

[0020] S36: The conversion module receives the template file and converts the template file into a final format file of a specified format;

[0021] S37: The conversion module returns the final format file to the executor;

[0022] S38: The executor returns the final format file to the renderer;

[0023] S39: The renderer returns the final format file to the server;

[0024] S4: The server packages the received final format file into a response message and returns it to the caller.

[0025] Furthermore, the request information includes template files, rendering data, and generation formats;

[0026] The template file is a PowerPoint document file in binary format; the template file has data tags for editing;

[0027] Render data in the form of key-value pairs;

[0028] The generated formats include PowerPoint format, image format, and PDF format.

[0029] Further, step S2 includes:

[0030] S21: The server receives the request information from the caller;

[0031] S22: The server verifies the request information;

[0032] The verification content is: if the format of the template file or the generated format is wrong or the rendering data format is wrong, it will fail, otherwise it will pass.

[0033] S23: If the request information verification fails, an error message is directly returned without executing the following process;

[0034] S24: After verification, the request information is passed to the renderer.

[0035] Furthermore, data tags have many different types, including: connector tags, single-value tags, table tags, image tags, rendering block tags, conditional tags, placeholder tags, table formula tags, and intermediate single-value tags;

[0036] 1) Connector tag: applicable to single-value tags;

[0037] 2) Placeholder tag: Applicable to single value labels and table data sub-labels;

[0038] 3) Single value label: applicable to text boxes, table cells, smart shapes, shapes, and artistic text;

[0039] 4) Table tags: only applicable to tables, divided into two types, table data tags and table data sub-tags;

[0040] 5) Image tag: only applicable to images, there are two types: one is that the data of the data tag is an image, and the other is that the data of the data tag is a string;

[0041] 6) Conditional tags: applicable to text boxes, table cells, smart shapes, shapes, and artistic text;

[0042] 7) Rendering block tags: applicable to text boxes, table cells, shapes, and artistic text. There are two types: rendering block data tags and rendering block data sub-tags;

[0043] 8) Table formula tag: applicable to table cells;

[0044] 9) Intermediate single-value tag: It is only applicable to rendering blocks and is not used by users. Instead, it is an intermediate tag for the renderer to parse the rendering block label and is set to facilitate program parsing.

[0045] Furthermore, the rendering module receives the request information and reads the template file. If the reading fails, an error message is returned and the subsequent process steps are not executed. If the reading is normal, the rendering work is executed. The rendering module loops through each data tag in the PowerPoint document and renders the data onto the template.

[0046] Specifically include:

[0047] S341: Text box rendering;

[0048] The rendering module first determines whether there is a data tag in the text box. If not, it skips rendering. If so, it loops through all paragraphs in the text box and establishes a relationship table between rendering block tags, conditional tags, and paragraphs.

[0049] The first step is to determine whether there is a rendering block tag in the relationship table. If there is a rendering block tag, obtain all paragraphs of the rendering block tag and the data name in the rendering block tag, obtain the number of rows of data through the data name, cyclically copy the content in the rendering block tag, and insert it above the end tag of the rendering block tag, and parse the rendering block data subtag into an intermediate single-value tag;

[0050] The second step is to determine whether there is a conditional tag in the relationship table. If not, skip rendering. If so, get all paragraphs of the conditional tag, parse the conditions in the conditional tag, and delete the content of the conditional subtag that is judged to be false.

[0051] In the third step, the rendering module re-traverses the paragraphs in the text box. If there is a single-value tag in the traversed paragraph, it loops and traverses multiple text blocks according to the length of the single-value tag and the number of text blocks in the paragraph until it is confirmed that the data tag is in several consecutive text blocks. The data tags in these text blocks are replaced with the data to be rendered, and the next paragraph is traversed until all paragraphs are traversed;

[0052] S342: Image rendering;

[0053] The rendering module reads the image tag. If there is no image tag, the rendering ends. If there is an image tag, the type of the image tag is determined. If the data of the image tag is an image, the rendering module directly replaces the image of the data tag in PowerPoint with the data image. If the data of the image tag is a string, the rendering module first converts the string into a QR code image, and then replaces the image of the data tag in PowerPoint with the QR code, and the rendering ends.

[0054] S343: table rendering;

[0055] First, the rendering module loops through each row and each cell of the table to create a relationship table between data labels, data label categories, and cell positions;

[0056] The first step is to determine whether there is a table data tag in the table according to the relationship table. If not, skip the table rendering list data. If it exists, find the position of the cell where the table data sub-tag is located, start from the row where the cell is located, loop through each subsequent row in turn, and perform the following operations on the column where the table data sub-tag is located in each row: first clear the cell data, and then insert the specified row and column data of the list data into the cell;

[0057] The second step is to determine whether there are other data tags in the relationship table. If not, the rendering ends. If so, find the cell where the data tag is located and use the rendering logic of the text box to complete the data rendering of the cell.

[0058] S344: Chart rendering;

[0059] The rendering module reads the title information of the optional text in the chart area format and reads the chart data label. If the chart data label does not exist, the rendering ends. If the chart data label exists, the Excel file in the chart is first read and the data is rendered to Excel. Then, the series and categories of the drawing area are increased or decreased according to the number of rows and columns of the data, and the data is rendered to the drawing area, and the rendering ends.

[0060] Furthermore, there are two format categories for table data tags, and different table data tag rendering methods are used according to the table data tag category;

[0061] A rendering method is to render a minimum value of the number of table rows from the table data sub-label row to the last row and the number of data rows;

[0062] The other is that if the number of rendering rows is the same as the number of data rows and the number of table rows is not enough, the slide will be automatically copied and inserted below the slide until the number of rendering rows of the table in the slide and the copied slide is greater than or equal to the number of data rows.

[0063] Furthermore, it also includes:

[0064] S345: Intelligent graphics rendering;

[0065] The rendering module loops through all text boxes in the intelligent graph and processes them according to the text box rendering method;

[0066] S346: shape rendering;

[0067] S347: Artistic word rendering;

[0068] The rendering logic of shape rendering and artistic text rendering is the same as that of text box rendering.

[0069] A data rendering and visualization system based on a PowerPoint document as a template, which executes the data rendering and visualization method based on a PowerPoint document as a template as claimed in claim 1, comprising a caller, a server, and a renderer;

[0070] The caller is used to exchange information with the server, send request information, receive response information, and generate the final result;

[0071] The server is used to transmit information with the caller and the renderer, receive the request information of the caller, transmit the request information to the renderer, receive the final format file generated by the renderer, package it into response information and return it to the caller;

[0072] The renderer is used to render data onto a template and perform format conversion; it includes a rendering module, a conversion module, and an executor;

[0073] The rendering module is used to render data onto the template, the conversion module is used to convert the rendered template into a specified format file, and the executor is used to select the specified rendering module and conversion module according to the request information, create an execution chain, and the execution chain completes the rendering and conversion into the final format in steps.

[0074] Furthermore, the rendering module is mainly composed of five sub-modules, namely, a text box rendering module, a table rendering module, a chart rendering module, an image rendering module and a rendering extension module; each rendering module contains a label renderer for each label; the rendering extension module is used to customize labels according to different requirements and perform corresponding customized label rendering function extensions;

[0075] The conversion module is mainly composed of four sub-modules: PowerPoint to PDF module, PowerPoint to picture module, empty module and extended module. The PowerPoint to PDF module, PowerPoint to picture module and empty module are used to respond to user needs and realize conversion of different formats; the extended module is used to realize the conversion function extension of custom formats according to different needs.

[0076] Compared with the prior art, the present invention has the following beneficial effects:

[0077] (1) The present invention is aimed at data rendering visualization scenarios based on PowerPoint documents as templates. Based on custom data tags and renderers, data rendering visualization based on PowerPoint documents as templates becomes possible, and supports common functions of PowerPoint documents such as text boxes, tables, charts, pictures, shapes, and artistic words.

[0078] (2) The present invention solves the problem of data label splitting and data rendering style loss by changing the existing rendering logic, ensuring that the rendering style is not lost, what you see is what you get, and rendering labels are standardized.

[0079] (3) The present invention supports custom extensions and custom tags, is simple and convenient to use, and has flexible template making. Users can modify the templates at any time to achieve different effects, reducing the development difficulty for programmers. There is no need to repeatedly develop the same functions, but only to develop extensions according to needs, supporting various complex demand scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0080] Figure 1 This is an architectural diagram of a renderer of a data rendering visualization system based on a PowerPoint document as a template according to the present invention;

[0081] Figure 2 A rendering flow chart of a data rendering visualization method based on a PowerPoint document as a template according to the present invention;

[0082] Figure 3 It is an execution flow chart of a renderer of the data rendering visualization method based on a PowerPoint document as a template of the present invention;

[0083] Figure 4 A flowchart of the steps of the data rendering visualization method based on a PowerPoint document as a template of the present invention;

[0084] Figure 5 The present invention is an example diagram of a special case of PowerPoint rendering in the prior art. Implementation

[0085] In order to provide a further understanding of the purpose, structure, features, and functions of the present invention, the following detailed description is given in conjunction with the embodiments.

[0086] A data rendering visualization method based on a PowerPoint document as a template, comprising a data rendering visualization system based on a PowerPoint document as a template, the system comprising a caller, a server, a renderer, etc.;

[0087] The caller is used to exchange information with the server, send request information, receive response information, and generate the final result;

[0088] The server is used to transmit information with the caller and the renderer, receive the request information of the caller, transmit the request information to the renderer, receive the final format file generated by the renderer, package it into response information and return it to the caller;

[0089] The renderer is used to render data to the template and convert the format. The renderer consists of three parts: the rendering module, the conversion module, and the executor. The rendering module is responsible for rendering the data to the template, and the conversion module is responsible for converting the rendered template into a specified format file. The executor selects the specified rendering module and conversion module according to the request information, creates an execution chain, and the execution chain completes the work of converting the rendering into the final format according to the steps.

[0090] The rendering module is mainly composed of five sub-modules: text box rendering module, table rendering module, chart rendering module, image rendering module and rendering extension module. Each rendering module contains a label renderer for its own label. The rendering extension module can customize labels according to different needs and perform corresponding customized label rendering function extensions.

[0091] The conversion module mainly consists of 4 submodules: PowerPoint to PDF module, PowerPoint to image module, empty module (no conversion, return in the original format) and extension module. PowerPoint to PDF module, PowerPoint to image module and empty module respond to user needs and realize the conversion function of different formats; the extension module can realize the conversion function extension of custom formats according to different needs.

[0092] Based on the PowerPoint document as a template and with custom data labels, the data is rendered to generate PowerPoint documents, pictures, or PDFs. The specific steps include:

[0093] S1: The caller sends a rendering request with the request information.

[0094] S11: The caller packages the request information.

[0095] The request information includes a template file, rendering data and a generated format; the template file is a PowerPoint document file in binary format; the template file supports the following types: PowerPoint documents of office 2010 and above, and PowerPoint documents of WPS.

[0096] The template file has data tags for editing. Rendering data refers to the data that needs to be rendered, that is, the data used to replace the data tags to achieve the effect required by the user; the rendering data is in the form of key-value pairs. A key-value pair means that each key corresponds to a value. For example, attributes are added to tags through the "attribute" and "attribute value" methods, where "attribute" is the key in the key-value pair and "attribute value" is the value in the key-value pair.

[0097] The generation formats include PowerPoint format, image format, and PDF format.

[0098] The supported file types for rendering are: PowerPoint documents, pictures, and PDF files.

[0099] S12: The caller sends the request information to the server.

[0100] S2: The server receives the request information from the caller and passes the request information to the renderer.

[0101] S21: The server receives the request information from the caller.

[0102] S22: The server verifies the request information.

[0103] The verification content is: if the format of the template file or the generated format is wrong or the rendering data format is wrong, it will fail, otherwise it will pass.

[0104] S23: If the request information verification fails, an error message is directly returned without executing the following process;

[0105] S24: After verification, the request information is passed to the renderer.

[0106] S3: The renderer renders the template according to the request information and converts it into the result data in the format specified by the request, and returns the final format file generated after rendering to the server.

[0107] S31: The renderer creates an executor according to the request information;

[0108] The renderer finds the rendering module and conversion module of the specified type according to the template file format and generation format of the request information, and creates an executor. The executor contains an execution chain, and rendering is performed in the order of the execution chain.

[0109] S32: The renderer passes the request information to the executor.

[0110] S33: The executor passes the request information to the rendering module.

[0111] S34: The rendering module performs rendering;

[0112] The rendering module receives the request information and reads the template file. If the reading fails, an error message is returned and the subsequent process steps are no longer executed. If the reading is normal, the rendering work is performed. The rendering module loops through each data tag in the PowerPoint document and renders the data on the template.

[0113] Data tags are some special strings in PowerPoint documents. By parsing these special strings, the data can be rendered on the template as required.

[0114] There are many different types of data tags, including connector tags, single value tags, table tags, image tags, rendering block tags, conditional tags, placeholder tags, etc.

[0115] PowerPoint consists of one or more slides, each of which consists of text boxes, pictures, tables, charts, shapes, artistic words, smart graphics, etc. Different types of data labels are designed according to the usage and characteristics of each component.

[0116] (1) Connector tag: Applicable to single-value tags.

[0117] Format: ., period, connector. The function of the tag is to obtain a sub-element of data, such as ${user.name}.

[0118] (2) Placeholder tag: Applicable to single value labels and table data sub-labels.

[0119] Format: *, asterisk, used in conjunction with other tags, placeholders can be zero or more, and their function is to hold places for user typesetting, such as ${ datetime ****}, $[name******].

[0120] (3) Single-value label: Applicable to text boxes, table cells, smart shapes, shapes, and artistic text.

[0121] Format: ${attribute name}, such as ${name}.

[0122] (4) Table tags: only applicable to tables, divided into two types, table data tags and table data sub-tags.

[0123] There are 2 types of table data tags:

[0124] The first format: ${#table data name}, such as ${#users}. The number of rendered rows is the minimum value of the number of table rows from the table data sub-label row to the last row and the number of data rows.

[0125] The second format: ${#table data name~}, such as ${#users~}. The number of rendered rows is the number of data rows. If the number of table rows is not enough, the slide will be automatically copied and inserted below the slide until the number of rendered rows of the table in the slide and the copied slide is greater than or equal to the number of data rows.

[0126] Table data subtag:

[0127] Format: $[table data sub-element name], used to locate the rendering start row and the rendered element name.

[0128] (5) Image tags: only applicable to images, divided into two types.

[0129] The first format: ${!Picture data name}, and the data of the data label is a picture.

[0130] The second format: ${@Picture data name}, and the data of the data label is a string. The purpose of this label is to convert the string into a QR code. Users can freely edit the string to obtain different QR codes.

[0131] (6) Conditional label: Applicable to text boxes, table cells, smart graphics, shapes, and WordArt.

[0132] Format: <if condition 1>…… [<elseif condition 2>……] <else>……], elseif can be zero or more, and else can be zero or one. It must end with. Some content can be dynamically displayed through conditional tags. Single-value tags can be used in combination inside conditional tags.

[0133] The conditional tag must be in a text box or a cell. Each sub-tag of the conditional tag, namely the if, elseif, and else sub-tags, i.e., the <> angle bracket pairs, must be in a paragraph. Zero or more paragraphs can be included between sub-tags. Nested conditional tags are not supported. Due to the characteristics of PowerPoint documents, and because nested conditional tags would become complex and difficult to maintain, the final rendering effect would be unpredictable and unable to achieve the what-you-see-is-what-you-get effect.

[0134] (7) Rendering block tags: Applicable to text boxes, table cells, shapes, and WordArt, divided into 2 types, rendering block data tags and rendering block data sub-tags.

[0135] Rendering block data tags:

[0136] Format: <for rendering block data name>……, which is used to loop through and render according to the number of data rows of the rendering block data name. Single-value tags and rendering block data sub-tags can be used in combination inside the rendering block tag. The start tag (<for rendering block data name>) and end tag () of the rendering block tag must also be in a paragraph. Zero or more paragraphs can be included between the start and end tags of the rendering block tag. Only one rendering block tag is allowed in a text box, and nested rendering block tags are not supported. Due to the characteristics of PowerPoint documents, and because using multiple rendering block tags and nested rendering block tags in a text box would become complex and difficult to maintain, the final rendering effect would be unpredictable and unable to achieve the what-you-see-is-what-you-get effect.

[0137] Rendering block data sub-tags:

[0138] Format: $[rendering block data sub-element name], used to display the data in the rendering block data name.

[0139] (8) Table formula tags: Applicable to table cells.

[0140] Format: [%][.number]=calculation formula

[0141] Format description: % indicates conversion to percentage, . indicates decimal places, specifies the first column of the table as column A, the second column as column B, and so on, specifies the first line of the table as 1, the second line as 2, and so on, similar to Excel tables, you can use column calculations, such as =C3-D3, %.2=C3 / B3, support common functions, such as max(), min(), sum(), avg(), sort(), etc. Example =max(A1,B1). Support user-defined functions.

[0142] (9) Intermediate single-value label: It is only applicable to rendering blocks and is not used by users. Instead, it is an intermediate tag for the renderer to parse the rendering block label and is set to facilitate program parsing.

[0143] include:

[0144] S341: Text box rendering;

[0145] In PowerPoint, a text box consists of one or more paragraphs, and a paragraph consists of one or more text blocks. Each text block has its own style, and the number of text blocks is dynamically changed by PowerPoint software according to the user's addition, deletion, and modification of the content in the text box. Paragraphs are determined by line breaks, so the data label of a text box must be in one paragraph, but it may be in one or more text blocks, that is, the data label of a text box will be split into several irregular blocks in PowerPoint.

[0146] The rendering module first determines whether there is a data tag in the text box. If not, the rendering is skipped. If so, all paragraphs in the text box are looped through to establish a relationship table among rendering block tags, conditional tags, and paragraphs.

[0147] The first step is to determine whether there is a rendering block tag in the relationship table. If there is a rendering block tag, obtain all paragraphs of the rendering block tag and the data name in the rendering block tag, obtain the number of rows of data through the data name, cyclically copy the content in the rendering block tag, and insert it above the end tag of the rendering block tag, and at the same time parse the rendering block data sub-tag into an intermediate single-value tag.

[0148] The second step is to determine whether there is a conditional tag in the relationship table. If not, skip rendering. If so, get all the paragraphs of the conditional tag, parse the conditions in the conditional tag, and delete the content of the conditional subtag that is judged to be false (that is, the paragraph of the conditional subtag).

[0149] In the third step, the rendering module re-traverses the paragraphs in the text box. If there is a single-value tag in the traversed paragraph, it will loop and traverse multiple text blocks according to the length of the single-value tag and the number of text blocks in the paragraph until it is confirmed that the data tag is in several consecutive text blocks. The data tags in these text blocks are replaced with the data to be rendered, and the next paragraph is traversed until all paragraphs are traversed.

[0150] S342: Image rendering;

[0151] The rendering module reads the title information of the optional text in the image format and reads the image tag. If there is no image tag, the rendering ends. If there is an image tag, it determines the type of the image tag. If the data of the image tag is an image, the rendering module directly replaces the image of the data tag in PowerPoint with the data image. If the data of the image tag is a string, the rendering module first converts the string into a QR code image, and then replaces the image of the data tag in PowerPoint with the QR code, and the rendering ends.

[0152] The picture data label is in the PowerPoint document - right-click the picture - set picture format - optional text - title.

[0153] S343: table rendering;

[0154] In PowerPoint, a table consists of one or more rows, a row consists of one or more cells, a cell consists of one or more paragraphs, and a paragraph consists of one or more text blocks, so the rendering logic of table cells is the same as that of text boxes. The table data label is placed in the first cell of the first row of the table.

[0155] First, the rendering module loops through each row and each cell of the table to create a relationship table between data labels, data label categories, and cell positions.

[0156] The first step is to determine whether there is a table data tag in the table based on the relationship table. If not, skip the table rendering list data. If it exists, find the position of the cell where the table data sub-tag is located, start from the row where the cell is located, and loop through each subsequent row in turn. For each row, perform the following operations on the column where the table data sub-tag is located: first clear the cell data, and then insert the specified row and column data of the list data into the cell.

[0157] The second step is to determine whether there are other data tags in the relationship table. If not, the rendering ends. If so, find the cell where the data tag is located and use the rendering logic of the text box to complete the data rendering of the cell.

[0158] S344: Chart rendering;

[0159] The rendering module reads the title information of the optional text in the chart area format and reads the chart data label. If the chart data label does not exist, the rendering ends. If the chart data label exists, the Excel file in the chart is first read and the data is rendered to Excel. Then, the series and categories of the drawing area are increased or decreased according to the number of rows and columns of the data, and the data is rendered to the drawing area, and the rendering ends.

[0160] The chart data label is in the PowerPoint document - right-click the chart - Set Chart Area Format - Optional Text - Title.

[0161] S345: Intelligent Graphics Rendering

[0162] Rendering logic: The rendering module loops through all text boxes in the smart graphic and processes them according to the text box rendering logic.

[0163] S346: Shape Rendering:

[0164] Rendering logic: Same as text box rendering.

[0165] S347: Artistic Word Rendering:

[0166] Rendering logic: Same as text box rendering.

[0167] S35: After the rendering module completes rendering, the rendered template is passed to the conversion module.

[0168] S36: The conversion module receives the template file and converts the template file into a final format file of a specified format.

[0169] S37: The conversion module returns the final format file to the executor.

[0170] S38: The executor returns the final format file to the renderer.

[0171] S39: The renderer returns the final format file to the server.

[0172] S4: The server packages the received final format file into a response message and returns it to the caller.

[0173] S41: The server creates a response message;

[0174] The response information includes the response code, response message and response data; the response code includes 1 and 0, where 1 represents success and 0 represents failure;

[0175] The response message is the information of rendering success or failure. If it fails, the response message is the reason for failure.

[0176] The response data is the final result of the renderer completing the rendering of the template, that is, the result that the caller needs to generate.

[0177] S42: The server returns the response information to the caller.

[0178] The caller receives the response information and generates the final result based on the response data.

[0179] The present invention has been described by the above-mentioned relevant embodiments, however, the above-mentioned embodiments are only examples for implementing the present invention. It must be pointed out that the disclosed embodiments do not limit the scope of the present invention. On the contrary, changes and modifications made without departing from the spirit and scope of the present invention are all within the scope of patent protection of the present invention.< / else>

Claims

1. A data rendering visualization method based on a PowerPoint document as a template, characterized in that: The following steps are involved: S1: The caller carries the request information and sends a rendering request; The request information includes template files, rendering data, and generation format; The template file is a PowerPoint document file in binary format; The template file has data tabs for editing; Render data in the form of key-value pairs; The generated formats include PowerPoint format, image format, and PDF format; There are many different types of data tags, including: connector tags, single value tags, table tags, image tags, rendering block tags, conditional tags, placeholder tags, table formula tags, and intermediate single value tags; Connector tag: Applicable to single value tags; Placeholder tag: suitable for single value labels and table data sub-labels; Single value label: applicable to text boxes, table cells, smart shapes, shapes, and artistic words; Table tags: only applicable to tables, divided into two types, table data tags and table data sub-tags; Image label: only applicable to images, divided into two types, one is that the data of the data label is an image, the other is that the data of the data label is a string; Conditional tags: applicable to text boxes, table cells, smart shapes, shapes, and WordArt; Rendering block tags: applicable to text boxes, table cells, shapes, and artistic text. There are two types: rendering block data tags and rendering block data sub-tags; Table formula tag: applicable to table cells; Intermediate single-value tag: It is only applicable to rendering blocks and is not used by users. Instead, it is an intermediate tag for the renderer to parse the rendering block tag. It is set to facilitate program parsing. S11: The caller packages the request information; S12: The caller sends the request information to the server; S2: The server receives the request information from the caller and passes it to the renderer; S3: The renderer renders the template according to the request information and converts it into the result data in the format specified by the request, and returns the final format file generated after rendering to the server; S31: The renderer creates an executor according to the request information; The renderer finds the specified type of rendering module and conversion module according to the template file format and generation format of the request information, and creates an executor. The executor contains an execution chain, and rendering is performed in the order of the execution chain. S32: The renderer passes the request information to the executor; S33: The executor transmits the request information to the rendering module; S34: The rendering module performs rendering; The rendering module receives the request information and reads the template file. If the reading fails, an error message is returned and the subsequent process steps are not executed. If the reading is normal, the rendering work is executed. The rendering module loops through each data tag in the PowerPoint document and renders the data onto the template. Specifically include: S341: Text box rendering; The rendering module first determines whether there is a data tag in the text box. If not, it skips rendering. If so, it loops through all paragraphs in the text box and establishes a relationship table between rendering block tags, conditional tags, and paragraphs. The first step is to determine whether there is a rendering block tag in the relationship table. If there is a rendering block tag, obtain all paragraphs of the rendering block tag and the data name in the rendering block tag, obtain the number of rows of data through the data name, cyclically copy the content in the rendering block tag, and insert it above the end tag of the rendering block tag, and parse the rendering block data subtag into an intermediate single-value tag; The second step is to determine whether there is a conditional tag in the relationship table. If not, skip rendering. If so, get all paragraphs of the conditional tag, parse the conditions in the conditional tag, and delete the content of the conditional subtag that is judged to be false. In the third step, the rendering module re-traverses the paragraphs in the text box. If there is a single-value tag in the traversed paragraph, it loops and traverses multiple text blocks according to the length of the single-value tag and the number of text blocks in the paragraph until it is confirmed that the data tag is in several consecutive text blocks. The data tags in these text blocks are replaced with the data to be rendered, and the next paragraph is traversed until all paragraphs are traversed; S342: Image rendering; The rendering module reads the image tag. If there is no image tag, the rendering ends. If there is an image tag, the type of the image tag is determined. If the data of the image tag is an image, the rendering module directly replaces the image of the data tag in PowerPoint with the data image. If the data of the image tag is a string, the rendering module first converts the string into a QR code image, and then replaces the image of the data tag in PowerPoint with the QR code, and the rendering ends. S343: Table rendering; First, the rendering module loops through each row and each cell of the table to create a relationship table between data labels, data label categories, and cell positions; The first step is to determine whether there is a table data tag in the table according to the relationship table. If not, skip the table rendering list data. If it exists, find the position of the cell where the table data sub-tag is located, start from the row where the cell is located, loop through each subsequent row in turn, and perform the following operations on the column where the table data sub-tag is located in each row: first clear the cell data, and then insert the specified row and column data of the list data into the cell; The second step is to determine whether there are other data tags in the relationship table. If not, the rendering ends. If so, find the cell where the data tag is located and use the rendering logic of the text box to complete the data rendering of the cell. S344: Chart rendering; The rendering module reads the title information of the optional text in the chart area format and reads the chart data label. If the chart data label does not exist, the rendering ends. If the chart data label exists, the Excel file in the chart is first read and the data is rendered to Excel. Then, the series and categories of the drawing area are increased or decreased according to the number of rows and columns of the data, and the data is rendered to the drawing area. The rendering ends. S35: After the rendering module completes the rendering, the rendered template is passed to the conversion module; S36: The conversion module receives the template file and converts the template file into a final format file of a specified format; S37: The conversion module returns the final format file to the executor; S38: The executor returns the final format file to the renderer; S39: The renderer returns the final format file to the server; S4: The server packages the received final format file into a response message and returns it to the caller.

2. The data rendering and visualization method based on a PowerPoint document as a template according to claim 1, characterized in that: Step S2 includes: S21: The server receives the request information from the caller; S22: The server verifies the request information; The verification content is: if the format of the template file or the generated format is wrong or the rendering data format is wrong, it will fail, otherwise it will pass; S23: If the request information verification fails, an error message is directly returned without executing the following process; S24: After verification, the request information is passed to the renderer.

3. The data rendering and visualization method based on a PowerPoint document as a template according to claim 1, characterized in that: PowerPoint consists of one or more slides, each of which consists of text boxes, pictures, tables, charts, shapes, artistic words, and smart shapes; table data labels have two format categories, and different table data label rendering methods are used according to the table data label category; A rendering method is to render a minimum value of the number of table rows from the table data sub-label row to the last row and the number of data rows; The other is that the number of rendering rows is the number of data rows. If the number of table rows is not enough, the currently rendered slide will be automatically copied and inserted below the currently rendered slide until the number of rendering rows of the table in the currently rendered slide and the copied slide is greater than or equal to the number of data rows.

4. The data rendering and visualization method based on a PowerPoint document as a template according to claim 1, characterized in that: Also includes: S345: Intelligent graphics rendering; The rendering module loops through all text boxes in the intelligent graph and processes them according to the text box rendering method; S346: shape rendering; S347: Artistic word rendering; The rendering logic of shape rendering and artistic text rendering is the same as that of text box rendering.

5. A data rendering and visualization system based on a PowerPoint document as a template, executing the data rendering and visualization method based on a PowerPoint document as a template according to claim 1, characterized in that: Including caller, server and renderer; The caller is used to exchange information with the server, send request information, receive response information, and generate the final result; The server is used to transmit information with the caller and the renderer, receive the request information of the caller, transmit the request information to the renderer, receive the final format file generated by the renderer, package it into response information and return it to the caller; The renderer is used to render data onto a template and perform format conversion; Includes rendering module, conversion module, and executor; The rendering module is used to render data onto the template, the conversion module is used to convert the rendered template into a specified format file, and the executor is used to select the specified rendering module and conversion module according to the request information, create an execution chain, and the execution chain completes the rendering and conversion into the final format in steps.

6. The data rendering visualization system based on PowerPoint document as template according to claim 5, characterized in that: The rendering module is mainly composed of five sub-modules: text box rendering module, table rendering module, chart rendering module, image rendering module and rendering extension module; each rendering module contains the label renderer of its own label; The rendering extension module is used to customize tags according to different requirements and perform corresponding customized tag rendering function expansion; The conversion module is mainly composed of four sub-modules: PowerPoint to PDF module, PowerPoint to picture module, empty module and extended module. The PowerPoint to PDF module, PowerPoint to picture module and empty module are used to respond to user needs and realize conversion of different formats; the extended module is used to realize the conversion function extension of custom formats according to different needs.