Information document generation method and device, equipment, medium and product

By parsing JSON configuration data to generate XML templates and populating them with data, the problem of low efficiency in information document generation is solved, achieving automated, secure, and standardized document generation that can adapt to different data needs and access control.

CN121562579APending Publication Date: 2026-02-24CHINA TELECOM CORP LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202610090613.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-22
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing technologies are inefficient in generating information documents, making it difficult to balance uniformity and flexibility, and lacking effective access control and security traceability.

Method used

By parsing JSON configuration data, a structured XML template file is generated, and the JSON data is populated into the XML template to achieve automated generation of information documents. Combined with user access control and dynamic screenshots for graphical display, document security and standardization are ensured.

Benefits of technology

It improves the efficiency of information document generation, reduces the cost of manual intervention, ensures the security and consistency of documents, supports flexible changes in document requirements, and is easy for machines to parse and trace.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121562579A_ABST
    Figure CN121562579A_ABST
Patent Text Reader

Abstract

The invention provides an information document generation method and device, equipment, a medium and a product, and relates to the technical field of data processing, the information document generation method comprises the steps that JSON configuration data acquired by a front end is analyzed, the JSON configuration data is used for defining attribute information of an information document module, and part of the attribute information is determined by user permission; based on the analyzed JSON configuration data, generating a structured XML (Extensible Markup Language) template file; and obtaining JSON data based on the JSON configuration data, and filling the XML template file with the JSON data to generate an information document. According to the embodiment of the invention, the method achieves the dynamic generation of the structured XML template through the analysis of the front-end JSON configuration containing the authority attribute, enables the obtained JSON data to be automatically filled into the template, and finally achieves the efficient and automatic generation of a customized information document which accords with the authority of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing technology, and more specifically, to an information document generation method, apparatus, device, medium, and product. Background Technology

[0002] In the context of digital transformation, information documents, as critical information assets, have become an essential part of enterprise operations due to the need for efficient and standardized generation. The traditional model, relying on manual compilation, has room for improvement in response efficiency and standardization when dealing with dynamic and multi-dimensional information needs.

[0003] In related technologies, as enterprise business modules become more refined and customer needs become more differentiated, the information document generation process needs to balance uniformity requirements with flexible configuration, and achieve effective access control and security traceability in the document generation, transmission and archiving stages.

[0004] Furthermore, the use of structured and standardized architectures to support the automated construction of information documents is gradually becoming an indispensable component of modern enterprise CI / CD systems, which has positive significance for improving operational collaboration efficiency and ensuring the compliant use of information.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide an information document generation method, apparatus, device, medium, and product to overcome, at least to some extent, the problems of low efficiency in information document generation caused by limitations and defects in related technologies.

[0007] According to a first aspect of the present disclosure, an information document generation method is provided, comprising: parsing JSON configuration data obtained from a front end, the JSON configuration data being used to define attribute information of an information document module, wherein some information in the attribute information is determined by user permissions; generating a structured XML template file based on the parsed JSON configuration data; obtaining JSON data based on the JSON configuration data, and filling the JSON data into the XML template file to generate the information document.

[0008] In one exemplary embodiment of this disclosure, obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: According to the data source of any of the information document modules in the JSON configuration data; Based on the data source, the corresponding basic data is obtained and populated into the corresponding position in the XML template file to generate the information document.

[0009] In one exemplary embodiment of this disclosure, obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: Determine whether the JSON configuration data includes the specific module that needs to be graphically displayed; In response to the JSON configuration data including the specified modules that need to be graphically displayed, a screenshot is taken based on the anchor point of the URL address of the specified modules to obtain image data; The image data is filled into the corresponding image position in the XML template file to generate the information document.

[0010] In one exemplary embodiment of this disclosure, in response to the JSON configuration data including a specified module that needs to be graphically displayed, taking a screenshot based on the anchor point of the URL address of the specified module to obtain image data includes: In response to the JSON configuration data including the specified modules that need to be graphically displayed, the URL address corresponding to the specific module is determined; The anchor point is located based on the URL address, and a screenshot is taken. The resulting image data is then converted to Base64 encoding to obtain the image data.

[0011] In one exemplary embodiment of this disclosure, generating a structured XML template file based on the parsed JSON configuration data includes: Parse the JSON configuration data to determine the table orientation and / or merging requirements in the information document module; Based on the table orientation and / or the merging requirements, generate an XML template file with a corresponding table structure and directory hierarchy.

[0012] In one exemplary embodiment of this disclosure, the JSON configuration data includes at least one of the following: module identifier, whether to display to the current role, module title, module level, module URL, submodule list, whether to include a table, whether to include a chart, and whether to include a details area that needs to be screenshotted.

[0013] In one exemplary embodiment of this disclosure, the information document is in the format of Microsoft Word and / or Portable Document format.

[0014] According to a second aspect of the present disclosure, an information document generation apparatus is provided, comprising: The configuration parsing module is configured to parse JSON configuration data obtained from the front end. The JSON configuration data is used to define the attribute information of the information document module, and some of the information in the attribute information is determined by user permissions. The template generation module is configured to generate a structured XML template file based on the parsed JSON configuration data. The data population module is configured to obtain JSON data based on the JSON configuration data and populate the JSON data into the XML template file to generate the information document.

[0015] According to a third aspect of this disclosure, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to perform the method as described in any of the preceding methods based on instructions stored in the memory.

[0016] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the information document generation method as described in any of the preceding claims.

[0017] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program, characterized in that, when executed by a processor, the computer program implements the information document generation method as described in any of the preceding claims.

[0018] This disclosure embodiment enables the system to dynamically define document structure by parsing JSON (JavaScript Object Notation) configuration data obtained from the front end. Crucially, the document's components are linked to user permissions, ensuring the security and fine-grained control of information output and effectively preventing the leakage of unauthorized information. Furthermore, this solution automates the document generation process, transforming the traditional method of manual writing and verification into a highly efficient workflow where the system automatically parses the configuration, generates XML (eXtensible Markup Language) templates, and populates the data. This significantly reduces manual intervention costs and interaction time, while a unified XML template ensures the standardization and consistency of the output documents. In summary, the loosely coupled design of "JSON configuration + XML template" separates document format from business data. When document requirements change, only the JSON configuration needs to be updated, without modifying the core code, significantly enhancing system scalability and maintainability. Simultaneously, the generated structured XML document is easily parsed by machines, facilitating subsequent document traceability, review, and analysis.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0021] Figure 1 A schematic diagram of an exemplary system architecture for an information document generation scheme to which embodiments of the present invention can be applied is shown; Figure 2 This is a flowchart of the information document generation method in an exemplary embodiment of this disclosure; Figure 3 This is a schematic flowchart of a document information generation scheme in an exemplary embodiment of this disclosure; Figure 4 This is a schematic flowchart of another document information generation scheme in an exemplary embodiment of this disclosure; Figure 5 This is a block diagram of an information document generation apparatus according to an exemplary embodiment of the present disclosure; Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0022] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0023] Furthermore, the accompanying drawings are merely illustrative of this disclosure, and the same reference numerals in the drawings denote the same or similar parts, thus repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0024] In related technologies, as enterprise business modules become more refined and customer needs become more differentiated, the information document generation process needs to balance uniformity requirements with flexible configuration, and achieve effective access control and security traceability in the document generation, transmission and archiving stages.

[0025] Furthermore, the use of structured and standardized architectures to support the automated construction of information documents is gradually becoming an indispensable component of modern enterprise CI / CD systems, which has positive significance for improving operational collaboration efficiency and ensuring the compliant use of information.

[0026] Therefore, there is an urgent need for a secure information document generation solution that is efficient and meets customization requirements, which has become a pressing technical problem to be solved.

[0027] Figure 1 A schematic diagram of an exemplary system architecture for an information document generation scheme to which embodiments of the present invention can be applied is shown.

[0028] like Figure 1 As shown, system architecture 100 may include one or more of terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0029] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices, networks, and servers. For example, server 105 could be a server cluster composed of multiple servers.

[0030] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers, etc.

[0031] In some embodiments, the information document generation method provided in this invention is generally executed by server 105, and correspondingly, the information document generation device is generally located in terminal device 103 (or terminal device 101 or 102). In other embodiments, some terminals may have functions similar to those of the server device to execute this method.

[0032] The exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0033] Figure 2 This is a flowchart of an information document generation method in an exemplary embodiment of this disclosure.

[0034] refer to Figure 2 Information document generation methods may include: Step S202: Parse the JSON configuration data obtained from the front end. The JSON configuration data is used to define the attribute information of the information document module. Some of the information in the attribute information is determined by user permissions. Step S204: Based on the parsed JSON configuration data, generate a structured XML template file; Step S206: Obtain JSON data based on the JSON configuration data, and populate the JSON data into the XML template file to generate the information document.

[0035] This disclosure embodiment enables the system to dynamically define document structure by parsing JSON (JavaScript Object Notation) configuration data obtained from the front end. Crucially, the document's components are linked to user permissions, ensuring the security and fine-grained control of information output and effectively preventing the leakage of unauthorized information. Furthermore, this solution automates the document generation process, transforming the traditional method of manual writing and verification into a highly efficient workflow where the system automatically parses the configuration, generates XML (eXtensible Markup Language) templates, and populates the data. This significantly reduces manual intervention costs and interaction time, while a unified XML template ensures the standardization and consistency of the output documents. In summary, the loosely coupled design of "JSON configuration + XML template" separates document format from business data. When document requirements change, only the JSON configuration needs to be updated, without modifying the core code, significantly enhancing system scalability and maintainability. Simultaneously, the generated structured XML document is easily parsed by machines, facilitating subsequent document traceability, review, and analysis.

[0036] The following section provides a detailed explanation of each step in the information document generation method.

[0037] In one exemplary embodiment of this disclosure, obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: According to the data source of any of the information document modules in the JSON configuration data; Based on the data source, the corresponding basic data is obtained and populated into the corresponding position in the XML template file to generate the information document.

[0038] This disclosure embodiment dynamically defines the data source through JSON configuration, achieving separation of data and template. Furthermore, it automatically retrieves data based on the configuration and maps it to placeholders in the XML template file, thereby generating a structured document. Modifying the JSON configuration adjusts the data source without requiring code changes, adapting to different data requirements. This not only reduces manual data input and improves the efficiency of information document generation, but also supports the assembly of complex documents based on the independent configuration of each information document module.

[0039] In one exemplary embodiment of this disclosure, an enterprise report generation system defines a "sales data module" in its JSON configuration, with its data source being a "sales_table" in a database. After parsing the JSON configuration, the system queries the latest sales data from the "sales_table" and then populates the data into predetermined locations (such as table rows) in an XML template. The final generated information document (such as a Word report) automatically includes the updated sales data. A snippet of the JSON configuration is shown below: { "module_id": "sales_module", "data_source": "database: / / sales_table", Title: Sales Report }".

[0040] In one exemplary embodiment of this disclosure, obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: Determine whether the JSON configuration data includes the specific module that needs to be graphically displayed; In response to the JSON configuration data including the specified modules that need to be graphically displayed, a screenshot is taken based on the anchor point of the URL address of the specified modules to obtain image data; The image data is filled into the corresponding image position in the XML template file to generate the information document.

[0041] This disclosure converts dynamic graphic content (such as web page charts) into static images by taking URL screenshots and embedding them into documents. This ensures that the document's visual content is consistent with the source data and automatically embeds graphical content (such as real-time dashboards) as images, making the document more intuitive. When the source URL content changes, the screenshot is automatically updated, ensuring the document's timeliness. No manual screenshotting or insertion is required, increasing the level of automation.

[0042] In one exemplary embodiment of this disclosure, in a project monitoring system, a "performance chart module" is defined by JSON configuration, with the URL "http: / / dashboard / performance". After the system detects that this module requires graphical display, it automatically accesses the URL, takes a screenshot, and inserts the image data into the image tag field of the XML template. The generated PDF report will include the screenshot of the performance chart. A snippet of the JSON configuration is as follows: { "module_id": "chart_module", "requires_viz": true, "URL": "http: / / dashboard / performance" }".

[0043] In one exemplary embodiment of this disclosure, in response to the JSON configuration data including a specified module that needs to be graphically displayed, taking a screenshot based on the anchor point of the URL address of the specified module to obtain image data includes: In response to the JSON configuration data including the specified modules that need to be graphically displayed, the URL address corresponding to the specific module is determined; The anchor point is located based on the URL address, and a screenshot is taken. The resulting image data is then converted to Base64 encoding to obtain the image data.

[0044] This disclosure achieves precise screenshots through anchor point positioning, capturing only relevant areas and avoiding irrelevant content. Base64 encoding allows image data to be directly embedded in XML text without additional file storage. Targeting specific parts of the page for screenshots improves the accuracy and conciseness of the information document. Base64 encoding facilitates the direct storage and transmission of image data in XML, reducing external dependencies and image data size, and increasing generation speed.

[0045] In one exemplary embodiment of this disclosure, in an e-commerce report, the JSON configuration specifies the URL of the "Inventory Chart Module" as "http: / / report / inventory#chart", where "#chart" is the anchor. After parsing the configuration, a browser automation tool (such as Selenium) is used to locate the chart area (anchor) on the page, take a screenshot, and convert it to a Base64 string. This string is then populated into the XML template, and the chart image is directly displayed when generating a Word document. A JSON configuration snippet is as follows: { "module_id": "inventory_chart", "requires_viz": true, "URL": "http: / / report / inventory#chart" }".

[0046] In one exemplary embodiment of this disclosure, generating a structured XML template file based on the parsed JSON configuration data includes: Parse the JSON configuration data to determine the table orientation and / or merging requirements in the information document module; Based on the table orientation and / or the merging requirements, generate an XML template file with a corresponding table structure and directory hierarchy.

[0047] This disclosure embodiment dynamically constructs the structure of the XML template through the layout requirements in the JSON configuration, ensuring that the generated document conforms to the format specifications (such as table layout and table of contents hierarchy), automatically creates complex tables and tables of contents according to the configuration, reduces the workload of template design, ensures that the output document has a unified structure and style, and meets the needs of different documents by adjusting the table direction or merging cells through configuration.

[0048] In one exemplary embodiment of this disclosure, in a financial reporting system, a JSON configuration specifies that the "Profit and Loss Statement Module" requires a horizontal table and merged first-row cells. After parsing the configuration, the horizontal table structure is created when generating the XML template, and the attributes of the merged cells are marked. When data is populated, the XML template automatically applies these formatting rules to generate a visually appealing PDF document. A snippet of the JSON configuration is as follows: { "module_id": "income_statement", "table_orientation": "horizontal", "merge_cells": ["header_row"]".

[0049] In one exemplary embodiment of this disclosure, the JSON configuration data includes at least one of the following: module identifier, whether to display to the current role, module title, module level, module URL, submodule list, whether to include a table, whether to include a chart, and whether to include a details area that needs to be screenshotted.

[0050] This disclosure provides a comprehensive control over all aspects of document generation through rich configuration options, such as content, display permissions, structure, and visualization requirements. It supports role-based access control (e.g., displaying sensitive modules only to administrators) to enhance security. The submodule list supports nested structures, enabling hierarchical generation of complex documents that cover data, tables, charts, screenshots, and other requirements, thus improving the versatility of the method.

[0051] In one exemplary embodiment of this disclosure, in a project management document system, JSON configuration defines multiple attributes for each module. For example, a "Project Overview Module" is displayed only to the project manager role and includes a title, hierarchy, URL, and a list of submodules, thereby filtering modules based on the current user role and generating a customized Word document.

[0052] In one exemplary embodiment of this disclosure, the information document is in the format of Microsoft Word and / or Portable Document format.

[0053] After generating an XML template and populating it with data, the system uses a conversion tool (such as Apache POI for Word or iText for PDF) to convert the XML into a specified format, supporting common document formats and meeting the sharing and printing needs of different users. The Word format is easy to edit, and the PDF format is easy to fix the layout and distribute. The automated conversion process improves the user experience.

[0054] In one exemplary embodiment of this disclosure, within a compliance reporting system, a user can choose between Word or PDF as the output format. Specifically, after generating an XML template based on JSON configuration and populating it with data, a conversion library is used to convert the XML to the desired format. Specifically, a PDF report is generated for formal submission, or a Word report is generated for internal revision.

[0055] In one exemplary embodiment of this disclosure, such as Figure 3 The diagram shown illustrates a document information generation scheme, which includes the following key steps: Step S302: The front-end organizes the project modules to generate complete static pages.

[0056] Specifically, the front-end generates a complete report covering all modules and CSS styles based on the highest-level permissions of the role. CSS stands for Cascading Style Sheets, which are used to define the properties of HTML (HyperText Markup Language) elements, such as color, font, size, position, background, animation, etc., but are not limited to these.

[0057] Step S304: Extract the page's CSS styles and generate JSON data with permission tags.

[0058] Specifically, the JSON data used includes the complete module categories to be displayed, whether the module is displayed based on the role's permissions, the module title, level, URL (Uniform Resource Locator), submodules, and whether there are tables, charts, details, etc. The level part is the XML-generated directory.

[0059] Step S306: Organize the XML template according to the JSON data structure.

[0060] Specifically, the front-end uses the complete JSON data to determine the corresponding module, including table orientation and merging status, and then organizes the XML template.

[0061] Step S308: Send the JSON data to the server. The server retrieves data from the database and populates the JSON data.

[0062] Specifically, the front-end and back-end interact to populate the basic data of each module in the JSON data.

[0063] Step S310: Determine the parts involving special modules.

[0064] Specifically, the backend determines whether there are charts, details, or other parts that need to be screenshotted based on the attributes corresponding to the special modules of the JSON data. If so, it uses an automated testing tool to log in to the account, take a screenshot of the specified anchor point of the specified URL address, and convert it to base64 format to populate the data.

[0065] Step S312: Iterate through the JSON data and populate it into the XML template.

[0066] Specifically, the backend iterates through the JSON data to populate the XML template.

[0067] Step S314: Export the XML template as a Word or PDF document as needed.

[0068] Specifically, the XML can be exported to various formats such as Word or PDF, depending on the user's needs.

[0069] In one exemplary embodiment of this disclosure, such as Figure 4 The diagram illustrates another document information generation scheme, which includes the following key steps: Step S402: The front-end organizes the project modules to generate complete static pages.

[0070] Step S404: Extract the page's CSS styles and generate JSON data with permission tags.

[0071] Step S406: Iterate through the JSON data and make a judgment.

[0072] Step S408: Determine if there is a table. If yes, proceed to step S410; otherwise, proceed to step S418.

[0073] Step S410: Determine if there is a vertical direction. If yes, proceed to step S412; otherwise, proceed to step S414.

[0074] Step S412: Transpose the module table.

[0075] Step S414: Determine if there is a merge. If yes, proceed to step S416; otherwise, proceed to step S418.

[0076] Step S416: Merge rows or columns in the table.

[0077] Step S418: Prepare the XML template.

[0078] Step S420: Send the JSON data to the server. The server retrieves the data from the database and populates the JSON.

[0079] Step S422: Determine the parts involving special modules.

[0080] Step S424: Determine whether a screenshot is needed. If yes, proceed to step S426; otherwise, proceed to step 430.

[0081] Step S426: Extract the paths and anchor points that need to be captured in the module and generate a list.

[0082] In step S428, the server uses an automated testing tool to capture and convert the data into base64 format.

[0083] Step S430: Iterate through the JSON data and populate it into the XML template.

[0084] Step S432: Export the XML as a Word or PDF document as needed.

[0085] Corresponding to the above method embodiments, this disclosure also provides an information document generation apparatus, which can be used to execute the above method embodiments.

[0086] Figure 5 This is a block diagram of an information document generation apparatus according to an exemplary embodiment of the present disclosure.

[0087] refer to Figure 5 The information document generation device 500 may include: The parsing configuration module 502 is configured to parse JSON configuration data obtained from the front end. The JSON configuration data is used to define the attribute information of the information document module, and some of the information in the attribute information is determined by user permissions. The template generation module 504 is configured to generate a structured XML template file based on the parsed JSON configuration data. The data population module 506 is configured to obtain JSON data based on the JSON configuration data and populate the JSON data into the XML template file to generate the information document.

[0088] In one exemplary embodiment of this disclosure, the data filling module 506 is further configured to: According to the data source of any of the information document modules in the JSON configuration data; Based on the data source, the corresponding basic data is obtained and populated into the corresponding position in the XML template file to generate the information document.

[0089] In one exemplary embodiment of this disclosure, the data filling module 506 is further configured to: Determine whether the JSON configuration data includes the specific module that needs to be graphically displayed; In response to the JSON configuration data including the specified modules that need to be graphically displayed, a screenshot is taken based on the anchor point of the URL address of the specified modules to obtain image data; The image data is filled into the corresponding image position in the XML template file to generate the information document.

[0090] In one exemplary embodiment of this disclosure, the data filling module 506 is further configured to: In response to the JSON configuration data including the specified modules that need to be graphically displayed, the URL address corresponding to the specific module is determined; The anchor point is located based on the URL address, and a screenshot is taken. The resulting image data is then converted to Base64 encoding to obtain the image data.

[0091] In one exemplary embodiment of this disclosure, the template generation module 504 is further configured as follows: Parse the JSON configuration data to determine the table orientation and / or merging requirements in the information document module; Based on the table orientation and / or the merging requirements, generate an XML template file with a corresponding table structure and directory hierarchy.

[0092] In one exemplary embodiment of this disclosure, the JSON configuration data includes at least one of the following: module identifier, whether to display to the current role, module title, module level, module URL, submodule list, whether to include a table, whether to include a chart, and whether to include a details area that needs to be screenshotted.

[0093] In one exemplary embodiment of this disclosure, the information document is in the format of Microsoft Word and / or Portable Document format.

[0094] Since the functions of the device 500 have been described in detail in their respective method embodiments, they will not be repeated here.

[0095] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0096] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0097] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely in hardware, entirely in software (including firmware, microcode, etc.), or in a combination of hardware and software, collectively referred to herein as “circuit,” “module,” or “system.”

[0098] The following reference Figure 6 To describe an electronic device 600 according to this embodiment of the present invention. Figure 6 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0099] like Figure 6As shown, the electronic device 600 is manifested in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including storage unit 620 and processing unit 610).

[0100] The storage unit stores program code that can be executed by the processing unit 610, causing the processing unit 610 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform the method shown in the embodiments of this disclosure.

[0101] Storage unit 620 may include readable media in the form of volatile storage units, such as random access memory (RAM) 6201 and / or cache 6202, and may further include read-only memory (ROM) 6203.

[0102] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0103] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0104] Electronic device 600 can also communicate with one or more external devices 640 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. As shown, network adapter 660 communicates with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0105] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0106] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.

[0107] The program product for implementing the above-described method according to embodiments of the present invention may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0108] The readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0109] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0110] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0111] In exemplary embodiments of this disclosure, a computer program product is also provided. This computer program product can be loaded or stored on any combination of one or more readable media. The program code for performing operations of the present invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0112] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0113] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and concept of this disclosure are indicated by the claims.

Claims

1. A method for generating information documents, characterized in that, include: The JSON configuration data obtained from the front end is parsed. This JSON configuration data is used to define the attribute information of the information document module. Some of the information in the attribute information is determined by user permissions; Based on the parsed JSON configuration data, a structured XML template file is generated; The JSON data is obtained based on the JSON configuration data, and the JSON data is populated into the XML template file to generate the information document.

2. The information document generation method as described in claim 1, characterized in that, The process of obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: According to the data source of any of the information document modules in the JSON configuration data; Based on the data source, the corresponding basic data is obtained and populated into the corresponding position in the XML template file to generate the information document.

3. The information document generation method as described in claim 1, characterized in that, The process of obtaining JSON data based on the JSON configuration data and populating the JSON data into the XML template file to generate the information document includes: Determine whether the JSON configuration data includes the specific module that needs to be graphically displayed; In response to the JSON configuration data including the specified modules that need to be graphically displayed, a screenshot is taken based on the anchor point of the URL address of the specified modules to obtain image data; The image data is filled into the corresponding image position in the XML template file to generate the information document.

4. The information document generation method as described in claim 3, characterized in that, In response to the JSON configuration data including a specified module that needs to be graphically displayed, a screenshot is taken based on the anchor point of the URL address of the specified module to obtain image data including: In response to the JSON configuration data including the specified modules that need to be graphically displayed, the URL address corresponding to the specific module is determined; The anchor point is located based on the URL address, and a screenshot is taken. The resulting image data is then converted to Base64 encoding to obtain the image data.

5. The information document generation method as described in claim 1, characterized in that, Based on the parsed JSON configuration data, a structured XML template file is generated, including: Parse the JSON configuration data to determine the table orientation and / or merging requirements in the information document module; Based on the table orientation and / or the merging requirements, generate an XML template file with a corresponding table structure and directory hierarchy.

6. The information document generation method according to any one of claims 1-5, characterized in that, The JSON configuration data includes at least one of the following: module identifier, whether to display to the current role, module title, module level, module URL, submodule list, whether to include a table, whether to include a chart, and whether to include a details area that needs to be screenshotted.

7. The information document generation method according to any one of claims 1-5, characterized in that, The information documents may be in Microsoft Word format and / or portable document format.

8. An information document generation device, characterized in that, include: The configuration parsing module is configured to parse JSON configuration data obtained from the front end. The JSON configuration data is used to define the attribute information of the information document module, and some of the information in the attribute information is determined by user permissions. The template generation module is configured to generate a structured XML template file based on the parsed JSON configuration data. The data population module is configured to obtain JSON data based on the JSON configuration data and populate the JSON data into the XML template file to generate the information document.

9. An electronic device, characterized in that, include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the information document generation method as described in any one of claims 1-7 based on instructions stored in the memory.

10. A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the information document generation method as described in any one of claims 1-7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the information document generation method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Configuration item template dynamic customizing method based on XML

    CN104573053A

  • A method of generating Word document based on data configuration

    CN110187916A

  • Automatic document publishing method for model information of plug-in development system based on Office Word

    CN113515926A

  • Interface fuzz testing method and device

    CN115879117A

  • Configuration method and device of basic input and output system, electronic equipment and medium

    CN118210573A