Method and system for dynamically generating file based on online Office service

Through the collaboration between the support system and online Web Office services, document documents in the field of government services are dynamically generated, which solves the compatibility issues and functional limitations of file generation in the existing technology, and achieves efficient and flexible file generation and improvements in application scope.

CN119514500APending Publication Date: 2025-02-25INSPUR SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411398391.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art has compatibility issues, functional limitations and maintenance difficulties in the generation and printing of process document files in the field of government services, and it is difficult to increase the scope of application by dynamically generating files on the online Office service.

Method used

By supporting the collaboration between the system and the online Web Office service, define the layout file template type, call the online Web Office service to compile the file template content, and insert bookmark identifiers into the template file to form a template file. Then, an intermediate template file is generated based on the template type and bookmark actual value, and sent to the online Web Office service for final file generation and storage.

Benefits of technology

It realizes dynamically generating files without installing browser controls and software, solves the compatibility problem of file generation, improves the scope of application, and simplifies the operation and maintenance process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119514500A_ABST
    Figure CN119514500A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for dynamically generating a file based on an online Office service, belongs to the technical field of document processing, and aims to solve the technical problem of how to dynamically generate a file through the online Office document service, solve the compatibility problem of file generation and improve the application range. Comprising the following steps: compiling the content of a file template by calling an online Web Office service, inserting a bookmark identifier into the file template to form a corresponding template file, and storing a template type identifier, the bookmark identifier and a file storage identifier related to the file template as a piece of data in a support system local; the support system generates a new template file as an intermediate template file based on the file template and the actual value of the preprocessed special bookmark, and the online Web Office service generates a final file based on the intermediate template file and the actual value of the conventional bookmark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of document processing, in particular to a method and system for dynamically generating files based on online Office services. Background Art

[0002] At present, the generation or printing of process documents in the field of government services mainly adopts browser middleware such as NTKO components, C-Lodop components, rich text editors, or customized file generation services (POI file generation). The first two methods are to edit the standard file template in the browser, insert the bookmark mark, replace it with the actual business data when the file is generated, and generate the final file; the customized file generation service directly provides interface services, passes in the actual business data, and assembles and splices the files into files with the background code. All the above three methods have application limitations and shortcomings.

[0003] The browser middleware-based approach requires the installation of browser components, and the components rely on client users' Office and other services. The components have poor browser compatibility and are prone to startup failures, browsers being unable to load components, and subsequent upgrades and maintenance are difficult.

[0004] The rich text editor has good browser compatibility, but the components have few functions, and the functions such as font size adjustment and style layout are single. The operation settings are complex, and a preview is required to see the editing effect. In addition, the actual generated file and the page preview file will deviate and be easily distorted. At the same time, it cannot meet special needs such as internal government document headers.

[0005] The customized file generation service generates service files through POI dynamic assembly. The file generation accuracy is high, but the customized development cost is high. Changes in the file format require adjustments to the background service code, which is labor-intensive and difficult to maintain. There is no functional interface setting file, which is often suitable for the generation and printing of fixed-format files for specific application scenarios.

[0006] How to dynamically generate files through online Office document services, solve compatibility issues in file generation and increase the scope of application are technical issues that need to be addressed. Summary of the invention

[0007] The technical task of the present invention is to address the above shortcomings and provide a method and system for dynamically generating files based on online Office services to solve the technical problems of how to dynamically generate files through online Office document services, solve the compatibility problems of file generation and improve the scope of application.

[0008] In a first aspect, the present invention provides a method for dynamically generating files based on an online Office service, which is applied between a business system, a support system and an online Web Office service, and comprises the following steps:

[0009] Template file generation: define the type of layout file template through the support system. For each type of file template, call the online Web Office service to compile the content of the file template. Insert a bookmark identifier into the file template through the support system's back-end metadata service and the front-end encapsulated metadata tag identification script to form the corresponding template file. The support system stores the template file returned by the online Web Office service to a third-party network disk and returns the file storage identifier. The template type identifier, bookmark identifier, and file storage identifier related to the file template are stored as a piece of data in the local support system.

[0010] Dynamic file generation: submit a file generation request to the support system through the business system, the file generation request includes a template type identifier and an actual value of a bookmark, the support system obtains the corresponding file template based on the template type identifier, generates a new template file as an intermediate template file based on the file template and the actual value of the special bookmark after preprocessing, sends the intermediate template file to the server of the online Web Office service, stores the intermediate template file in a third-party network disk through the online Web Office service and returns a file storage identifier of the intermediate template file, the support system sends a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark, the online WebOffice service obtains the intermediate template file based on the file storage identifier of the intermediate template file, generates a final file based on the intermediate template file and the actual value of the regular bookmark, stores the file in a third-party network disk, and returns the file storage identifier of the final file to the business system through the support system, the business system obtains the final file from the third-party network disk based on the file storage identifier and operates on the final file.

[0011] Preferably, the template file generation includes the following steps:

[0012] Define the types of document templates through the support system, and for each type of document template, define metadata constituting the document template layout file;

[0013] Use the online office SDK to call the online Web Office service to compile the content of the document template;

[0014] Insert a bookmark identifier into the file template through the backend metadata service of the support system and the metadata tag identifier script encapsulated by the front end through the support system backend, form a corresponding template file, and return the template file to the support system;

[0015] The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system;

[0016] The template type identifier, bookmark identifier and file storage identifier related to the file template are stored locally as a piece of data through the support system.

[0017] Preferably, the dynamic generation of files includes the following steps:

[0018] Submit a file generation request to the support system through the business system, where the file generation request includes a template type identifier, an actual value of a bookmark, and a file format;

[0019] The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, where the special bookmark includes a table, formats the actual value of the special bookmark based on the predefined metadata format, and preprocesses the file template. The file template is converted into a predefined object through preprocessing, and a new template file is assembled as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and the intermediate template file is sent to the server of the Web Office service;

[0020] The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service;

[0021] Sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format;

[0022] The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format, and stores the final file in the third-party network disk. The third-party network disk returns a file storage identifier for indicating the address of the final file to the support system;

[0023] The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

[0024] Preferably, for the actual value of a regular bookmark, when the actual value of the bookmark is inserted into the template file, if it is a repeated bookmark, the bookmark is distinguished by adding a suffix after the bookmark identifier.

[0025] Preferably, the business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of the file.

[0026] In a second aspect, the present invention provides a system for dynamically generating files based on an online Office service, which is used to dynamically generate files by using a method for dynamically generating files based on an online Office service as described in any one of the first aspects, including a business system, a support system and an online Web Office service;

[0027] When the template file is generated, the support system is used to perform the following: define the type of the layout file template, for each type of file template, call the online Web Office service to compile the content of the file template, insert a bookmark identifier into the file template through the background metadata service and the metadata tag identifier script encapsulated by the front end, form a corresponding template file, store the template file returned by the online Web Office service to a third-party network disk, and accept the file storage identifier returned by the third-party network disk, and store the template type identifier, bookmark identifier and file storage identifier related to the file template as a piece of data locally;

[0028] When a file is dynamically generated, the business system is used to submit a file generation request to the support system, and the file generation request includes a template type identifier and an actual value of a bookmark; correspondingly, the support system is used to execute the following: obtain the corresponding file template based on the template type identifier, generate a new template file as an intermediate template file based on the file template and the actual value of the pre-processed special bookmark, and send the intermediate template file to the server of the online Web Office service; correspondingly, the online Web Office service is used to execute the following: store the intermediate template file in a third-party network disk, receive a file storage identifier of the intermediate template file returned by the third-party network disk, and send the file storage identifier to the support system; correspondingly, the support system is used to execute the following: send a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark; correspondingly, the online Web The Office service is used to perform the following: obtain the intermediate template file based on the file storage identifier of the intermediate template file, generate the final file based on the actual value of the intermediate template file and the regular bookmark, store the file to a third-party network disk, receive the file storage identifier of the final file returned by the third-party network disk and send the file storage identifier to the support system, the support system sends the file storage identifier of the final file to the business system, and the business system obtains the final file from the third-party network disk based on the file storage identifier and operates on the final file.

[0029] As a preferred method, when the template file is generated, the business system, the support system and the Web Office service cooperate to perform the following operations:

[0030] Define the types of document templates through the support system, and for each type of document template, define metadata constituting the document template layout file;

[0031] Use the online office SDK to call the online Web Office service to compile the content of the document template;

[0032] Insert a bookmark identifier into the file template through the backend metadata service of the support system and the metadata tag identifier script encapsulated by the front end through the support system backend, form a corresponding template file, and return the template file to the support system;

[0033] The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system;

[0034] The template type identifier, bookmark identifier and file storage identifier related to the file template are stored locally as a piece of data through the support system.

[0035] Preferably, when the file is dynamically generated, the business system, the support system and the online Office service cooperate to perform the following operations:

[0036] Submit a file generation request to the support system through the business system, where the file generation request includes a template type identifier, an actual value of a bookmark, and a file format;

[0037] The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, where the special bookmark includes a table, formats the actual value of the special bookmark based on the predefined metadata format, and preprocesses the file template. The file template is converted into a predefined object through preprocessing, and a new template file is assembled as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and the intermediate template file is sent to the server of the Web Office service;

[0038] The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service;

[0039] Sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format;

[0040] The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format, and stores the final file in the third-party network disk. The third-party network disk returns a file storage identifier for indicating the address of the final file to the support system;

[0041] The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

[0042] Preferably, for the actual value of a regular bookmark, when inserting the actual value of the bookmark into the template file, if it is a repeated bookmark, the support system is used to distinguish the bookmark by adding a suffix after the bookmark identifier.

[0043] Preferably, the business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of the file.

[0044] The method and system for dynamically generating files based on online Office services of the present invention have the following advantages:

[0045] 1. For operation and maintenance implementation personnel, there is no need to install any controls and software and there is no restriction on browsers, which greatly reduces the implementation workload and implementation costs. Template files can be configured online with rich editing functions, WYSIWYG, simple and convenient operation, and metadata can be directly inserted into bookmarks to reduce the probability of configuration errors;

[0046] 2. For document review and approval personnel, there is no need to install any controls and software, and there are no browsing restrictions. Errors in the generated document files can be adjusted online in real time. Daily operations such as file printing, downloading, annotations, signatures, etc. are all supported, and it is easy and quick to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] The present invention is further described below in conjunction with the accompanying drawings.

[0049] Figure 1 This is a flowchart of a method for dynamically generating files based on online Office services in Example 1;

[0050] Figure 2 This is a method for generating a template file in a method for dynamically generating a file based on an online Office service in Example 1;

[0051] Figure 3 This is a method for dynamically generating files in a method for dynamically generating files based on online Office services in Example 1. DETAILED DESCRIPTION

[0052] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments may be combined with each other.

[0053] The embodiment of the present invention provides a method and system for dynamically generating files based on online Office services, which are used to solve the technical problems of how to dynamically generate files through online Office document services, solve the compatibility problem of file generation and improve the application scope.

[0054] Embodiment 1:

[0055] The invention discloses a method for dynamically generating files based on online Office service, which is applied between a business system, a support system and online Web Office service, and comprises two steps: template file generation and file dynamic generation.

[0056] Step S100: Template file generation: define the type of layout file template through the support system, for each type of file template, call the online Web Office service to compile the content of the file template, insert a bookmark identifier into the file template through the support system's background metadata service and the front-end encapsulated metadata tag identification script to form a corresponding template file, store the template file returned by the online Web Office service to a third-party network disk through the support system and return a file storage identifier, and store the template type identifier, bookmark identifier and file storage identifier related to the file template as a piece of data locally in the support system.

[0057] As a specific implementation of template file generation, this step includes the following operations:

[0058] (1) defining the types of document templates through the support system, and for each type of document template, defining metadata constituting the document template layout file;

[0059] (2) Call the online Web Office service through the online office SDK to compile the content of the document template;

[0060] (3) inserting a bookmark identifier into the file template through the support system backend metadata service and the front-end encapsulated metadata tag identifier script, forming a corresponding template file, and returning the template file to the support system;

[0061] (4) The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system;

[0062] (5) The template type identifier, bookmark identifier, and file storage identifier related to the file template are stored locally as a piece of data through the support system.

[0063] Step S200: Dynamic file generation: submitting a file generation request to the support system through the business system, the file generation request includes a template type identifier and an actual value of a bookmark, the support system obtains a corresponding file template based on the template type identifier, generates a new template file as an intermediate template file based on the file template and the actual value of the pre-processed special bookmark, sends the intermediate template file to the server of the online Web Office service, stores the intermediate template file in a third-party network disk through the online Web Office service and returns a file storage identifier of the intermediate template file, the support system sends a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark, the online Web Office service obtains the intermediate template file based on the file storage identifier of the intermediate template file, generates a final file based on the intermediate template file and the actual value of the regular bookmark, stores the file in a third-party network disk, and returns the file storage identifier of the final file to the business system through the support system, the business system obtains the final file from the third-party network disk based on the file storage identifier and operates the final file.

[0064] As a specific implementation of dynamic file generation, this step includes the following operations:

[0065] (1) Submitting a file generation request to the support system through the business system. The file generation request includes the template type identifier, the actual value of the bookmark, and the file format;

[0066] (2) The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, where the special bookmark includes a table, a picture, and a paragraph. The actual value of the special bookmark is formatted based on a predefined metadata format (for example, the actual value of the special bookmark is converted into a node such as XWPFTable), and the file template is preprocessed to convert the file template into a predefined object (converted into an XWPFDocument object in this embodiment) through preprocessing. A new template file is assembled as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and the intermediate template file is sent to the server of the WebOffice service;

[0067] (3) The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service;

[0068] (4) sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format;

[0069] (5) The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format (such as PDF format), and stores the final file in the third-party network disk. The third-party network disk returns the file storage identifier for indicating the address of the final file to the support system;

[0070] (6) The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

[0071] In this embodiment, the business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of the file.

[0072] In this embodiment, the business system first obtains the identifier of the template file according to the template file type code, and then obtains the final generated file through the bookmark replacement API service interface. The API request parameter data for the bookmark replacement generated file is as follows:

[0073]

[0074]

[0075] Bookmark type description:

[0076] (1) _b_t_ bookmark name table type bookmark, pass in a two-dimensional array

[0077] (2) _b_p_ bookmark name picture type bookmark, passed into the base file stream

[0078] (3) _b_w_ Bookmark name paragraph text bookmark, incoming text

[0079] (4) _b_ Bookmark name: ordinary bookmark, input type such as text, date, etc.

[0080] Online Office documents do not support bookmarks with the same name. When inserting bookmarks, duplicate bookmarks are added with a suffix. Therefore, the interface only needs to pass in one bookmark value. For example, if there are multiple bookmarks for a company name, you only need to pass in one _b_enterName:"company name".

[0081] In this implementation, the format of the bookmark data passed in needs to match the data format set in the metadata. If the metadata is a table, the parameter must be a two-dimensional array.

[0082] In this embodiment, the image type bookmark, the base64 file encoding is passed in, the generation service will store the image in the network disk, and pass an accessible network disk link address to the online document replacement service.

[0083] Based on the method of this embodiment, the implementation personnel only need to add the corresponding template file type in the support system, compile the metadata type of the file, set the specific format content of the file in the system layout file, and insert a bookmark to complete the operation. The specific operation steps and usage order of the implementation and maintenance personnel are as follows:

[0084] (1) Support system to add template file types;

[0085] (2) Sort out file metadata under the newly added template file type;

[0086] (3) Edit the style and content of the configuration template file online, insert the metadata bookmark template file in the corresponding location, save it, and submit it for publication.

[0087] Business system access application process steps:

[0088] (1) Obtaining the stored template file identifier according to the template file type code displayed by the support system;

[0089] (2) Call the bookmark replacement file generation interface, input the identifier of step 1 and the data of the specific bookmark, and obtain the generated file;

[0090] (3) Through document identification, online preview, printing, stamping and other operations can be performed.

[0091] The method of this embodiment inserts bookmarks in the form of template document metadata, simplifies bookmark insertion operations, and avoids bookmark setting errors. At the same time, the specific encoding format definition and suffix format corresponding to the metadata solve the problems of document bookmark name uniqueness and bookmark type determination, uses bookmark encoding format characteristics to determine the type of bookmark, and uses POI operations to assemble content nodes to replace special bookmarks. This provides an extended implementation method for bookmark replacement for special types of bookmarks such as tables that are not supported by online Office document bookmark replacement services.

[0092] Embodiment 2:

[0093] The present invention discloses a system for dynamically generating files based on online Office services, comprising a business system, a support system and online Web Office services.

[0094] When a template file is generated, the support system is used to perform the following: define the type of layout file template, for each type of file template, call the online Web Office service to compile the content of the file template, insert a bookmark identifier into the file template through the background metadata service and the metadata tag identification script encapsulated by the front end, form a corresponding template file, store the template file returned by the online Web Office service to a third-party network disk, and accept the file storage identifier returned by the third-party network disk, and store the template type identifier, bookmark identifier and file storage identifier related to the file template as a piece of data locally.

[0095] As a specific implementation of template file generation, the business system, support system and Web Office service cooperate to perform the following operations:

[0096] (1) defining the types of document templates through the support system, and for each type of document template, defining metadata constituting the document template layout file;

[0097] (2) Call the online Web Office service through the online office SDK to compile the content of the document template;

[0098] (3) inserting a bookmark identifier into the file template through the support system backend metadata service and the front-end encapsulated metadata tag identifier script, forming a corresponding template file, and returning the template file to the support system;

[0099] (4) The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system;

[0100] (5) The template type identifier, bookmark identifier, and file storage identifier related to the file template are stored locally as a piece of data through the support system.

[0101] When a file is dynamically generated, the business system is used to submit a file generation request to the support system, and the file generation request includes a template type identifier and an actual value of a bookmark; correspondingly, the support system is used to execute the following: obtain the corresponding file template based on the template type identifier, generate a new template file as an intermediate template file based on the file template and the actual value of the pre-processed special bookmark, and send the intermediate template file to the server of the online Web Office service; correspondingly, the online Web Office service is used to execute the following: store the intermediate template file in a third-party network disk, receive a file storage identifier of the intermediate template file returned by the third-party network disk, and send the file storage identifier to the support system; correspondingly, the support system is used to execute the following: send a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark; correspondingly, the online Web The Office service is used to perform the following: obtain the intermediate template file based on the file storage identifier of the intermediate template file, generate the final file based on the actual value of the intermediate template file and the regular bookmark, store the file to a third-party network disk, receive the file storage identifier of the final file returned by the third-party network disk and send the file storage identifier to the support system, the support system sends the file storage identifier of the final file to the business system, and the business system obtains the final file from the third-party network disk based on the file storage identifier and operates on the final file.

[0102] As a specific implementation of dynamic file generation, the business system, support system and online Office service cooperate to perform the following operations:

[0103] (1) Submitting a file generation request to the support system through the business system. The file generation request includes the template type identifier, the actual value of the bookmark, and the file format;

[0104] (2) The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, wherein the special bookmark includes a table, formats the actual value of the special bookmark based on a predefined metadata format, and preprocesses the file template, converting the file template into a predefined object through preprocessing, assembling a new template file as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and sending the intermediate template file to the server of the Web Office service;

[0105] (3) The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service;

[0106] (4) sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format;

[0107] (5) The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format, and stores the final file in the third-party network disk. The third-party network disk returns the file storage identifier for indicating the address of the final file to the support system;

[0108] (6) The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

[0109] In this embodiment, the business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of the file.

[0110] In this embodiment, the business system first obtains the identifier of the template file according to the template file type code, and then obtains the final generated file through the bookmark replacement API service interface. The API request parameter data for the bookmark replacement generated file is as follows:

[0111]

[0112]

[0113] Bookmark type description:

[0114] (1) _b_t_ bookmark name table type bookmark, pass in a two-dimensional array

[0115] (2) _b_p_ bookmark name picture type bookmark, passed into the base file stream

[0116] (3) _b_w_ Bookmark name paragraph text bookmark, incoming text

[0117] (4) _b_ Bookmark name: ordinary bookmark, input type such as text, date, etc.

[0118] Online Office documents do not support bookmarks with the same name. When inserting bookmarks, duplicate bookmarks are added with a suffix. Therefore, the interface only needs to pass in one bookmark value. For example, if there are multiple bookmarks for a company name, you only need to pass in one _b_enterName:"company name".

[0119] In this implementation, the format of the bookmark data passed in needs to match the data format set in the metadata. If the metadata is a table, the parameter must be a two-dimensional array.

[0120] The system of this embodiment can execute the method disclosed in Embodiment 1 to dynamically generate files.

[0121] The present invention has been shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the means in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A method for dynamically generating files based on online Office services, characterized in that: Applied between business systems, support systems, and online Web Office services, including the following steps: Template file generation: define the type of layout file template through the support system. For each type of file template, call the online Web Office service to compile the content of the file template. Insert a bookmark identifier into the file template through the support system's back-end metadata service and the front-end encapsulated metadata tag identification script to form the corresponding template file. The support system stores the template file returned by the online Web Office service to a third-party network disk and returns the file storage identifier. The template type identifier, bookmark identifier, and file storage identifier related to the file template are stored as a piece of data in the local support system. Dynamic file generation: submit a file generation request to the support system through the business system, the file generation request includes a template type identifier and an actual value of a bookmark, the support system obtains the corresponding file template based on the template type identifier, generates a new template file as an intermediate template file based on the file template and the actual value of the special bookmark after preprocessing, sends the intermediate template file to the server of the online Web Office service, stores the intermediate template file in a third-party network disk through the online Web Office service and returns a file storage identifier of the intermediate template file, the support system sends a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark, the online WebOffice service obtains the intermediate template file based on the file storage identifier of the intermediate template file, generates a final file based on the intermediate template file and the actual value of the regular bookmark, stores the file in a third-party network disk, and returns the file storage identifier of the final file to the business system through the support system, the business system obtains the final file from the third-party network disk based on the file storage identifier and operates on the final file.

2. The method for dynamically generating files based on online Office services according to claim 1, characterized in that: Template file generation includes the following steps: Define the types of document templates through the support system, and for each type of document template, define metadata constituting the document template layout file; Use the online office SDK to call the online Web Office service to compile the content of the document template; Insert a bookmark identifier into the file template through the backend metadata service of the support system and the metadata tag identifier script encapsulated by the front end through the support system backend, form a corresponding template file, and return the template file to the support system; The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system; The template type identifier, bookmark identifier and file storage identifier related to the file template are stored locally as a piece of data through the support system.

3. The method for dynamically generating files based on online Office services according to claim 1 or 2, characterized in that: Dynamic file generation includes the following steps: Submit a file generation request to the support system through the business system, where the file generation request includes a template type identifier, an actual value of a bookmark, and a file format; The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, where the special bookmark includes a table, formats the actual value of the special bookmark based on the predefined metadata format, and preprocesses the file template. The file template is converted into a predefined object through preprocessing, and a new template file is assembled as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and the intermediate template file is sent to the server of the Web Office service; The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service; Sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format; The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format, and stores the final file in the third-party network disk. The third-party network disk returns a file storage identifier for indicating the address of the final file to the support system; The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

4. The method for dynamically generating files based on online Office services according to claim 1 or 2, characterized in that: For the actual value of a regular bookmark, when inserting the actual value of the bookmark into the template file, if it is a repeated bookmark, the bookmark is distinguished by adding a suffix after the bookmark identifier.

5. The method for dynamically generating files based on online Office services according to claim 1 or 2, characterized in that: The business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of files.

6. A system for dynamically generating files based on online Office services, characterized in that: Used to dynamically generate files by using a method for dynamically generating files based on an online Office service as described in any one of claims 1 to 5, comprising a business system, a support system and an online Web Office service; When the template file is generated, the support system is used to perform the following: define the type of the layout file template, for each type of file template, call the online Web Office service to compile the content of the file template, insert a bookmark identifier into the file template through the background metadata service and the metadata tag identifier script encapsulated by the front end, form a corresponding template file, store the template file returned by the online Web Office service to a third-party network disk, and accept the file storage identifier returned by the third-party network disk, and store the template type identifier, bookmark identifier and file storage identifier related to the file template as a piece of data locally; When a file is dynamically generated, the business system is used to submit a file generation request to the support system, and the file generation request includes a template type identifier and an actual value of a bookmark; correspondingly, the support system is used to execute the following: obtain the corresponding file template based on the template type identifier, generate a new template file as an intermediate template file based on the file template and the actual value of the pre-processed special bookmark, and send the intermediate template file to the server of the online Web Office service; correspondingly, the online WebOffice service is used to execute the following: store the intermediate template file in a third-party network disk, receive a file storage identifier of the intermediate template file returned by the third-party network disk, and send the file storage identifier to the support system; correspondingly, the support system is used to execute the following: send a file generation request to the online Web Office service based on the file storage identifier of the intermediate template file and the actual value of the regular bookmark; correspondingly, the online Web The Office service is used to perform the following: obtain the intermediate template file based on the file storage identifier of the intermediate template file, generate the final file based on the actual value of the intermediate template file and the regular bookmark, store the file to a third-party network disk, receive the file storage identifier of the final file returned by the third-party network disk and send the file storage identifier to the support system, the support system sends the file storage identifier of the final file to the business system, and the business system obtains the final file from the third-party network disk based on the file storage identifier and operates on the final file.

7. The system for dynamically generating files based on online Office services according to claim 6, characterized in that: When the template file is generated, the business system, support system, and Web Office service work together to perform the following operations: Define the types of document templates through the support system, and for each type of document template, define metadata constituting the document template layout file; Use the online office SDK to call the online Web Office service to compile the content of the document template; Insert a bookmark identifier into the file template through the backend metadata service of the support system and the metadata tag identifier script encapsulated by the front end through the support system backend, form a corresponding template file, and return the template file to the support system; The template file is stored in a third-party network disk through the support system, and the third-party network disk returns a file storage identifier indicating the address of the stored template file to the support system; The template type identifier, bookmark identifier and file storage identifier related to the file template are stored locally as a piece of data through the support system.

8. The system for dynamically generating files based on online Office services according to claim 6 or 7, characterized in that: When files are dynamically generated, the business system, support system, and online Office service work together to perform the following operations: Submit a file generation request to the support system through the business system, where the file generation request includes a template type identifier, an actual value of a bookmark, and a file format; The support system obtains the corresponding file template from the third-party network disk based on the template type identifier, and parses the actual value of the bookmark to obtain the actual value of the regular bookmark and the actual value of the special bookmark, where the special bookmark includes a table, formats the actual value of the special bookmark based on the predefined metadata format, and preprocesses the file template. The file template is converted into a predefined object through preprocessing, and a new template file is assembled as an intermediate template file based on the actual value of the formatted special bookmark and the preprocessed file template, and the intermediate template file is sent to the server of the Web Office service; The intermediate template file is sent to a third-party network disk for storage through the online Web Office service, and the third-party network disk returns a file storage identifier indicating the address of the intermediate template file to the online Web Office service; Sending a file generation request to the online Web Office service through the support system, wherein the file generation request includes a file storage identifier of the intermediate template file, an actual value of the regular bookmark, and a file format; The online Web Office service obtains the intermediate template file from the third-party network disk based on the file storage identifier of the intermediate template file, generates a final file in a predetermined format based on the intermediate template file, the actual value of the conventional bookmark, and the file format, and stores the final file in the third-party network disk. The third-party network disk returns a file storage identifier for indicating the address of the final file to the support system; The support system sends the file storage identifier of the final file address to the business system, and the business system operates the final file from the third-party network disk based on the file storage identifier of the final file address.

9. The system for dynamically generating files based on online Office services according to claim 6 or 7, characterized in that: For the actual value of a regular bookmark, when inserting the actual value of the bookmark into a template file, if it is a repeated bookmark, the support system is used to distinguish the bookmark by adding a suffix after the bookmark identifier.

10. The system for dynamically generating files based on online Office services according to claim 6 or 7, characterized in that: The business system operates the final file from the third-party network disk based on the file storage identifier, including online preview, annotation and printing of files.