Format document processing method, device and equipment

By storing the first target file and the second target file of the layout document in the database and the file server respectively, and generating the target layout document when loading the request, the problem of insufficient flexibility of the traditional layout document is solved, and the content of the layout document is realized. Flexible application and efficient use.

CN119149492AInactive Publication Date: 2024-12-17BEIJING SUWELL TECHNOLOGY CO LTD +2

Patent Information

Application Number
CN202411658271.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The storage and reading methods of traditional layout documents are less flexible and difficult to adapt to complex and diverse application scenarios and user needs.

Method used

By storing the first target file of the layout document in the first database, the corresponding second target file is stored in the second database, and upon receiving the user's load request, data is read from both to generate the target layout document. Realize the restoration and flexible application of original documents.

Benefits of technology

It improves the flexibility and utilization of layout documents, can adapt to different application scenarios, and achieves flexible application of layout documents content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149492A_ABST
    Figure CN119149492A_ABST
Patent Text Reader

Abstract

The invention provides a format document processing method, device and equipment. The method comprises the steps of obtaining a first target file of a layout document and a second target file corresponding to the first target file; storing the first target file in a first database according to the format of the first target file; according to a preset storage rule, storing the second target file in a second database; when a loading request of a user is received, the first target file is read from the first database according to the loading request, and the second target file is read from the second database; and according to the first target file and the second target file, generating a target format document, and loading the target format document. According to the method, the original edition document can be restored, the content of the edition document can be flexibly applied according to user requirements, the purpose of adapting to different application scenes is achieved, and high flexibility is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of layout document processing, and also to a layout document processing method, device and equipment. Background Art

[0002] The layout document format is an electronic document format with a fixed layout presentation effect. The presentation of the layout document is independent of the device. When reading, printing or printing on various devices, the presentation results of the layout are consistent. The layout document is mainly used for the release, dissemination and archiving of written documents. Its characteristics are fixed layout, and its presentation effect will not change due to changes in the software and hardware environment or operation. It is completely consistent with the paper document in terms of layout, layout, font, font size, etc.

[0003] Traditional layout documents are saved in the form of files. When reading, it is necessary to extract the entire file according to the original data structure to restore the layout document. This storage and reading method has low flexibility and cannot adapt to complex and diverse application scenarios and user needs. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method, device and equipment for processing layout documents so as to improve the flexibility of layout document utilization and adaptability to application scenarios.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] A first aspect of the present invention provides a method for processing a layout document, comprising:

[0007] Acquire a first target file of a layout document and a second target file corresponding to the first target file;

[0008] According to the format of the first target file, storing the first target file in a first database;

[0009] According to a preset storage rule, storing the second target file in a second database;

[0010] When receiving a loading request from a user, reading the first target file from the first database and reading the second target file from the second database according to the loading request;

[0011] A target layout document is generated according to the first target file and the second target file, and the target layout document is loaded.

[0012] Optionally, acquiring a first target file of a layout document and a second target file corresponding to the first target file includes:

[0013] Get layout document data;

[0014] Performing format conversion on the format document data to obtain converted format document data;

[0015] Traversing the converted layout document data according to a preset format to obtain a first target file;

[0016] The converted layout document data is traversed according to a preset type to obtain a second target file corresponding to the first target file.

[0017] Optionally, the converted layout document data is traversed according to a preset format to obtain a first target file, including:

[0018] Traversing the converted layout document data according to a preset format to obtain an original file;

[0019] The original file is parsed according to a preset data structure to obtain a first target file.

[0020] Optionally, according to the format of the first target file, storing the first target file in a first database includes:

[0021] Determining a target data structure according to a format of the first target file;

[0022] After adding the identification and classification label of the layout document to the first target file, the first target file is stored in the first database of the target data structure.

[0023] Optionally, storing the second target file in a second database according to a preset storage rule includes:

[0024] Determining the storage address of the second target file according to the address list in the preset storage rule;

[0025] After adding the layout document identifier to the second target file according to the storage address of the second target file, the file data of the second target file is stored in the second database, and the storage address is stored in the first database.

[0026] Optionally, according to the load request, reading the first target file from the first database and reading the second target file from the second database includes:

[0027] Determine a target tag according to the loading request;

[0028] Reading the first target file from the first database according to the target tag;

[0029] The second target file is read from the second database according to the first target file.

[0030] Optionally, generating a target format document according to the first target file and the second target file includes:

[0031] Determine a target template according to the first target file;

[0032] The target template and the second target file are embedded to generate a target layout document.

[0033] A second aspect of the present invention provides a layout document processing device, comprising:

[0034] An acquisition module, used for acquiring a first target file of a layout document and a second target file corresponding to the first target file;

[0035] A processing module is used to store the first target file in a first database according to the format of the first target file; store the second target file in a second database according to a preset storage rule; when receiving a request to load the layout document data, read the first target file from the first database and read the second target file from the second database according to the loading request; generate a target layout document according to the first target file and the second target file, and load the target layout document.

[0036] According to a third aspect of the present invention, a computing device is provided, comprising: a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to the first aspect is executed.

[0037] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions, which, when executed on a computer, causes the computer to execute the method described in the first aspect.

[0038] The above solution of the present invention includes at least the following beneficial effects:

[0039] The above-mentioned scheme of the present invention, by storing the first target file of the layout document in the first database, storing the second target file corresponding to the first target file in the second database, and when receiving the user's loading request, reading the first target file from the first database according to the loading request, and reading the second target file from the second database, thereby generating a target layout document, can not only realize the restoration of the original layout document, but also realize the flexible use of the layout document content according to user needs, so as to achieve the purpose of adapting to different application scenarios, has high flexibility, and improves the utilization rate of layout documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 is a flowchart of a method for processing a layout document in an embodiment of the present invention;

[0041] Figure 2 It is a schematic diagram of the structure of a layout document processing device in an embodiment of the present invention. DETAILED DESCRIPTION

[0042] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0043] like Figure 1 As shown, an embodiment of the present invention provides a method for processing a layout document, comprising the following steps:

[0044] Step 101, obtaining a first target file of a layout document and a second target file corresponding to the first target file;

[0045] Step 102, storing the first target file in a first database according to the format of the first target file;

[0046] Step 103, storing the second target file in a second database according to a preset storage rule;

[0047] Step 104, upon receiving a loading request from a user, reading the first target file from the first database and reading the second target file from the second database according to the loading request;

[0048] Step 105: Generate a target layout document according to the first target file and the second target file, and load the target layout document.

[0049] The method for processing layout documents proposed in the embodiment of the present invention stores the first target file of the layout document in a first database, stores the second target file corresponding to the first target file in a second database, and when receiving a loading request from a user, reads the first target file from the first database according to the loading request, and reads the second target file from the second database, thereby generating a target layout document. This method can not only restore the original layout document, but also flexibly use the content of the layout document according to user needs, thereby achieving the purpose of adapting to different application scenarios. It has high flexibility and improves the utilization rate of layout documents.

[0050] In an optional embodiment of the present invention, step 101 includes:

[0051] Step 1011, obtaining layout document data;

[0052] Specifically, the layout document data can be document data in PDF (Portable Document Format) format, or document data in OFD (Layout Document Standard) format, or other fixed formats. Here, taking OFD format as an example, OFD document data is actually a series of folders and subfolders packaged in ZIP (compressed file) format. These folders are in accordance with the OFD format agreement, and the XML (Extensible Markup Language) format description files are used to form the structure of the entire OFD layout document. At the same time, the various resource files required for the layout document are also stored in the agreed folder. The layout document data is a compressed package including various layout document formats, which contains description files (usually in text format, which can contain various data types, such as text, numbers, dates, etc.) and resource files (various resources embedded in the layout document, such as pictures, audio, video, fonts, etc.).

[0053] Step 1012, performing format conversion on the layout document data to obtain converted layout document data;

[0054] Specifically, it is necessary to decompress the compressed package of the layout document data to obtain all folders and subfolders in the compressed package for subsequent extraction of the first target file and the second target file.

[0055] Step 1013, traversing the converted layout document data according to a preset format to obtain a first target file;

[0056] Specifically, all folders and their subfolders are traversed to extract all XML format (i.e., files with .xml suffix) description files (description files usually contain metadata, structural information, style definitions, etc. of layout documents) as the first target file. The first target file describes the structure and content of the layout document.

[0057] Step 1014, traverse the converted layout document data according to a preset type to obtain a second target file corresponding to the first target file.

[0058] Specifically, the preset type may be a picture, audio, video, font, etc. When all folders and their subfolders are traversed, all files that meet the preset type are extracted as the second target file, ie, the resource file.

[0059] In an optional embodiment of the present invention, step 1013 includes:

[0060] Step 10131, traversing the converted layout document data according to a preset format to obtain an original file;

[0061] Specifically, after traversing the converted layout document data, all files in XML format are extracted as original files.

[0062] Step 10132: parse the original file according to a preset data structure to obtain a first target file.

[0063] Specifically, use XML parsing libraries (such as xml.etree.ElementTree (standard library), lxml (third-party library), etc.) to parse the file with XML suffix (i.e. original file) into a tree structure, traverse the tree structure to convert it into a dictionary structure, and then use the json module to convert the dictionary structure into a JSON (an open standard file format and data exchange format) string for subsequent storage and retrieval. The JSON format has the advantages of flexible data structure, high query performance, and easy parsing and processing, which is conducive to improving the efficiency of subsequent retrieval.

[0064] In an optional embodiment of the present invention, step 102 includes:

[0065] Step 1021, determining a target data structure according to the format of the first target file;

[0066] Specifically, in this embodiment, the format of the first target file is converted into JSON format. Therefore, the target data structure is a JSON data structure. The purpose of determining the target data structure is to provide a basis for the subsequent selection of a database. Here, a MongoDB (a database based on distributed file storage) database that can store JSON data can be selected according to the JSON data structure.

[0067] Step 1022: After adding the identification and classification label of the layout document to the first target file, the first target file is stored in the first database of the target data structure.

[0068] Specifically, a unique identifier is assigned to each stored layout document, and the unique identifier is added or bound to the first target file, so that the corresponding first target file and / or second target file can be found according to the unique identifier during subsequent retrieval; in addition, classification tags can be added to each file according to the specific content of each file in the first target file, so that the corresponding first target file can be found according to the keywords and classification tags in the user's loading requirements, thereby improving processing efficiency. The first database is a database that can store data of the target data structure. In this embodiment, if the format of the first target file is JSON format, the first database can be a MongoDB database.

[0069] In an optional embodiment of the present invention, step 103 includes:

[0070] Step 1031, determining the storage address of the second target file according to the address list in the preset storage rule;

[0071] Specifically, in order to quickly and accurately find the second target file according to the first target file, it is necessary to bind the storage address of the second target file to the first target file. Here, the storage address can be assigned to the second target file according to a preset address list. The preset storage rule can be set according to actual needs or the type of database used.

[0072] Step 1032: after adding the layout document identifier to the second target file according to the storage address of the second target file, the file data of the second target file is stored in the second database, and the storage address is stored in the first database.

[0073] Specifically, in order to facilitate the restoration of the layout document, the first target file and the second target file are both added with a unique identifier of the layout document, so that all the first target files and the second target files of the layout document can be quickly and accurately found according to the unique identifier, and restored and loaded. At the same time, the second target file with the added identifier is stored in the second database according to the storage address, and the storage address also needs to be stored in the corresponding first target file in the first database, so as to facilitate the rapid and accurate reading of the corresponding second target file according to the first target file and the storage address.

[0074] In an optional embodiment of the present invention, step 104 includes:

[0075] Step 1041, determining a target tag according to the loading request;

[0076] Specifically, the loading request may be text class information or a document identifier input by a user, and keywords or document identifiers, ie, target tags, are extracted from the loading request to match the classification tags or document identifiers of the first target file in the first database.

[0077] Step 1042, reading the first target file from the first database according to the target tag;

[0078] Specifically, by matching the keyword or document identifier of the target tag with the classification tag or document identifier of the first target file in the first database, the N (which can be set as needed, such as N can be 5 or 8) first target files with the highest similarity can be read.

[0079] Step 1043: Read the second target file from the second database according to the first target file.

[0080] Specifically, according to the storage address or document identifier bound to the first target file, the corresponding second target file can be read from the second database.

[0081] It should be noted that, in this embodiment, a first target file with the same identifier can be read from the first database according to the document identifier, and a second target file with the same identifier can be read from the second database to restore the original document.

[0082] Specifically, an XML parser may be used to open the first target file and extract reference information (such as file name, identifier, address, etc.) of the image resource, and the second target file may be read from the second database based on the extracted reference information.

[0083] In an optional embodiment of the present invention, step 105 includes:

[0084] Step 1051, determining a target template according to the first target file;

[0085] Specifically, since the first target file is a description file, including metadata, structural information, style definition, etc. of the layout document, the layout format of the layout document, ie, the target template, can be determined according to the first target file.

[0086] Step 1052: embedding the target template and the second target file to generate a target layout document.

[0087] Specifically, the table, image and other contents in the second target file may be correspondingly embedded according to the layout format in the target template and the contents of each section to obtain a target layout document.

[0088] Here, you can also adjust and optimize the target layout document so that its font, paragraph, layout, etc. meet the preset requirements.

[0089] A specific embodiment of the method for processing a layout document proposed in an embodiment of the present invention is:

[0090] Step 111, obtaining a first target file and a second target file of a layout document.

[0091] In this embodiment, taking the layout document in OFD format as an example, the OFD file is actually composed of a series of folders and subfolders packaged in ZIP format. In these folders, according to the OFD format agreement, the XML format description file is used to form the structure of the entire OFD layout document, and the various resource files required for this layout document are also stored in the agreed folder. With such a complete structure, users can use the OFD reader to restore and read the layout document according to these structural information and data.

[0092] First, obtain the layout document data, that is, the ZIP package of the OFD layout document;

[0093] Then, after decompressing the ZIP package, traverse all folders and their subfolders, extract all files with the .xml suffix, and parse these description files into a dictionary or json format data structure according to the XML specification as the first target file; extract all pictures, audio, video, fonts and other resource file types in the folder as the second target file.

[0094] Step 112: store the first target file in the first database.

[0095] The structural description information of the parsed layout document (i.e., the first target file) is stored in the first database. Here, the database can be selected and used according to the characteristics of the scene requirements in the actual application. In this embodiment, a target database between a relational database and a non-relational database can be used as a description file data storage database (i.e., the first database) for the layout document. For example, the MongoDB database can be used to store the first target file. MongoDB is the most feature-rich and relational database among non-relational databases. The data structure it supports is very loose, and is a bson format (computer data exchange format) similar to json, so it can store more complex data types. The description file information of OFD can be converted into json format and saved in MongoDB.

[0096] The description files parsed from each layout file can be saved in MongoDB, but they will be associated with each other through the unique ID (identifier) ​​of the document (such as adding the unique ID of the first target file to the document) to facilitate tracing and restoring the layout document.

[0097] The descriptive file data of the layout document structure can be stored in a relational or non-relational database according to the needs of the business scenario. However, it should be noted that it must meet the requirements of convenient call and retrieval, such as being able to easily query all descriptive information data belonging to the same layout document. According to the actual situation, choose the appropriate first database.

[0098] In addition, some features are extracted from the layout document, such as entity information, content classification, etc., as the classification label of the document, which is bound to the first target file and stored in the first database, so as to retrieve and recall the required description information data and resource files according to different scene requirements, and dynamically generate scene applications of the layout document. The more labels are extracted, the more complex and diverse application scenarios can be adapted.

[0099] Step 113: store the second target file in the second database.

[0100] The second target file is all kinds of data and associated files in all layout document data except the description file, such as pictures, tables and other files, which are stored in the file server (i.e., the second database) through the network. In this embodiment, object storage is used as file storage to store these files. The address information of the object storage is saved in the target database and associated with the original layout document (such as adding the unique ID of the document to the second target file).

[0101] All kinds of resource files in the layout document, such as text, graphics and other files, are stored in an independent file server, such as an object storage server, for the purpose of centralized storage management and convenient retrieval. Depending on the actual situation, other types of databases can also be selected as the second database.

[0102] Step 114: Read the first target file and the second target file according to the loading request.

[0103] The export and read process is basically the reverse operation of storage. According to certain search conditions (i.e., load request), a layout document description file information (first target file) and related file data (second target file) are downloaded to the local computer. And based on the previously saved index (such as the unique ID of the document) and related information (such as storage address), the OFD or PDF layout document is regenerated.

[0104] Step 115, generating and loading the target layout document.

[0105] Document editing software can be used to generate a template based on the first target file, and the pictures, fonts, etc. in the second target file can be embedded in the corresponding positions. The size, position and format of the second target file can be adjusted as needed to ensure that they match the description in the description file. The typesetting tools of the document editing software can also be used to adjust the layout of the document according to the requirements in the description of the first target file, such as setting fonts, paragraphs, page layout, etc. The output target layout document is loaded on the display interface for the user to view.

[0106] The processing method of the layout document proposed in the embodiment of the present invention saves all the description information and resource files of the layout document in the database and the file server, which brings the possibility of flexible expansion of applications. The simplest way is to read the first target file and the second target file from the first database and the second database according to the needs of the scene to generate a new layout or layout layout document and deliver it to the user for reading application. For example, a new data template can be introduced, and the layout can be deleted according to the user's needs, and even various authorization services and user-specified business systems can be used for unified authentication to realize various authorization methods that cannot be realized by the original layout document encryption authorization, thereby achieving expansion capabilities such as paging authorization, segmented authorization, etc. (which can be realized by adding an encryption tag to the first target file). Among them, according to the needs of the user application, the required layout document is recalled, and the corresponding layout document is generated for presentation and reading applications, which is to retrieve and recall the original layout document from the data information and files in the database and the file server, and restore the layout document according to the original description information, so as to obtain the same effect as opening the original layout document file.

[0107] The processing method of the layout document proposed in the embodiment of the present invention saves the description file and resource file in the layout document to a database and a separate file storage service respectively. The structural information of the layout document is recorded in a database, and the characteristics of the database can be used for retrieval. The corresponding XML description file is generated according to the retrieved information, and the corresponding resource file is downloaded from the object storage. These data and files are recombined according to the specifications of the layout document, and the layout document is dynamically generated and restored for users to load and read. It can better make up for some deficiencies in the transmission, security and application scenarios of files as carriers of layout documents, give full play to the advantages of layout documents, and expand more applications of layout documents. For example, layout documents related to users themselves can be generated according to scenario requirements, according to user data and habits, and various Internet solutions can be used to expand the authorization and other application methods of layout documents. In addition to the function of restoring the original layout document, the processing method of the layout document in the embodiment of the present invention can also be used for more extended applications, but is not limited to the following applications:

[0108] Data layout application: The original layout document determines the fixed format and layout, uses the user's dynamic data for layout, and directly outputs the layout document filled with user data for presentation and other applications by the user system. That is, the format and layout of the layout document are determined according to the first target file, and the first target file is filled with different data in the second target file to obtain a target layout file with the same format and layout but different content, such as invoices, medical records, etc.

[0109] Application of templates: Use a standard general layout document as a template. The main text can be submitted to the large model based on the relevant prompt words input by the user, and filled with the content generated by the large model. For example, some layout documents of notices can use the large model to generate the notification text according to the classification content requirements input by the user, and use the template document to generate the layout document for output.

[0110] Authorization applications: Currently, the encryption information of layout documents is basically placed in files for description. The layout document processing method of the embodiment of the present invention can be seamlessly managed with the user's authorization system, and can perform detailed authorization management for layout pages, signatures, etc.

[0111] As the diversified data of description files for various types of layout documents increases, the corresponding layout style and content can be provided according to the user's keywords, and related resource files can be searched to dynamically generate various types of layout documents for user reference.

[0112] The processing method of the layout document proposed in the embodiment of the present invention saves the description file and various resource data files originally stored in the OFD folder into the network database and network storage according to the preset storage rules. Correspondingly, when reading, the description file information and related data resource files are obtained from the network database and network storage according to the same rules, and dynamically combined into a new OFD file, which is then handed over to the OFD reader for reading and presentation, which can improve the flexibility and utilization rate of the layout document.

[0113] like Figure 2 As shown, an embodiment of the present invention provides a layout document processing device 200, comprising:

[0114] An acquisition module 201 is used to acquire a first target file of a layout document and a second target file corresponding to the first target file;

[0115] The processing module 202 is used to store the first target file in a first database according to the format of the first target file; store the second target file in a second database according to a preset storage rule; when receiving a request to load the layout document data, read the first target file from the first database and read the second target file from the second database according to the loading request; generate a target layout document according to the first target file and the second target file, and load the target layout document.

[0116] Optionally, acquiring a first target file of a layout document and a second target file corresponding to the first target file includes:

[0117] Get layout document data;

[0118] Performing format conversion on the format document data to obtain converted format document data;

[0119] Traversing the converted layout document data according to a preset format to obtain a first target file;

[0120] The converted layout document data is traversed according to a preset type to obtain a second target file corresponding to the first target file.

[0121] Optionally, the converted layout document data is traversed according to a preset format to obtain a first target file, including:

[0122] Traversing the converted layout document data according to a preset format to obtain an original file;

[0123] The original file is parsed according to a preset data structure to obtain a first target file.

[0124] Optionally, according to the format of the first target file, storing the first target file in a first database includes:

[0125] Determining a target data structure according to a format of the first target file;

[0126] After adding the identification and classification label of the layout document to the first target file, the first target file is stored in the first database of the target data structure.

[0127] Optionally, storing the second target file in a second database according to a preset storage rule includes:

[0128] Determining the storage address of the second target file according to the address list in the preset storage rule;

[0129] After adding the layout document identifier to the second target file according to the storage address of the second target file, the file data of the second target file is stored in the second database, and the storage address is stored in the first database.

[0130] Optionally, according to the load request, reading the first target file from the first database and reading the second target file from the second database includes:

[0131] Determine a target tag according to the loading request;

[0132] Reading the first target file from the first database according to the target tag;

[0133] The second target file is read from the second database according to the first target file.

[0134] Optionally, generating a target format document according to the first target file and the second target file includes:

[0135] Determine a target template according to the first target file;

[0136] The target template and the second target file are embedded to generate a target layout document.

[0137] The device for processing layout documents proposed in the embodiment of the present invention stores the first target file of the layout document in a first database, stores the second target file corresponding to the first target file in a second database, and upon receiving a loading request from a user, reads the first target file from the first database according to the loading request, and reads the second target file from the second database, thereby generating a target layout document. This device can not only restore the original layout document, but also flexibly use the content of the layout document according to user needs, thereby adapting to different application scenarios. It has high flexibility and improves the utilization rate of layout documents.

[0138] It should be noted that the device is a device corresponding to the above method, and all implementations in the above method embodiment are applicable to the embodiment of the device and can achieve the same technical effect, which will not be described in detail in this embodiment.

[0139] The embodiment of the present invention further provides a computing device, comprising: a processor, and a memory storing a computer program, wherein when the computer program is executed by the processor, the method described in any one of the above embodiments is executed. All implementations in the above method embodiments are applicable to the embodiments of the device, and can achieve the same technical effects. They will not be described in detail in this embodiment.

[0140] The embodiment of the present invention further provides a computer-readable storage medium on which instructions are stored. When the instructions are executed on a computer, the computer executes the method as described in any one of the above embodiments. All implementations in the above method embodiments are applicable to the embodiments of the device and can achieve the same technical effects. They will not be repeated in this embodiment.

[0141] It should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present invention. In addition, the steps of performing the above series of processes can naturally be performed in chronological order according to the order of description, but do not necessarily need to be performed in chronological order. Some steps can be performed in parallel, crosswise or independently of each other.

[0142] It should be noted that, in the above-mentioned embodiments, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the implementation of the above-mentioned embodiments is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0143] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing a layout document, It is characterized in that include: Acquire a first target file of a layout document and a second target file corresponding to the first target file; According to the format of the first target file, storing the first target file in a first database; According to a preset storage rule, storing the second target file in a second database; When receiving a loading request from a user, reading the first target file from the first database and reading the second target file from the second database according to the loading request; A target layout document is generated according to the first target file and the second target file, and the target layout document is loaded.

2. The method for processing a layout document according to claim 1, It is characterized in that Acquiring a first target file of a layout document and a second target file corresponding to the first target file includes: Get layout document data; Performing format conversion on the layout document data to obtain converted layout document data; Traversing the converted layout document data according to a preset format to obtain a first target file; The converted layout document data is traversed according to a preset type to obtain a second target file corresponding to the first target file.

3. The method for processing a layout document according to claim 2, It is characterized in that The converted layout document data is traversed according to a preset format to obtain a first target file, including: Traversing the converted layout document data according to a preset format to obtain an original file; The original file is parsed according to a preset data structure to obtain a first target file.

4. The method for processing a layout document according to claim 1, It is characterized in that According to the format of the first target file, storing the first target file in a first database includes: Determining a target data structure according to a format of the first target file; After adding the identification and classification label of the layout document to the first target file, the first target file is stored in the first database of the target data structure.

5. The method for processing a layout document according to claim 1, It is characterized in that According to a preset storage rule, storing the second target file in a second database includes: Determining the storage address of the second target file according to the address list in the preset storage rule; After adding the layout document identifier to the second target file according to the storage address of the second target file, the file data of the second target file is stored in the second database, and the storage address is stored in the first database.

6. The method for processing a layout document according to claim 1, It is characterized in that Reading the first target file from the first database and reading the second target file from the second database according to the load request includes: Determine a target tag according to the loading request; Reading the first target file from the first database according to the target tag; The second target file is read from the second database according to the first target file.

7. The method for processing a layout document according to claim 1, It is characterized in that Generating a target format document according to the first target file and the second target file includes: Determine a target template according to the first target file; The target template and the second target file are embedded to generate a target layout document.

8. A device for processing formatted documents, It is characterized in that include: An acquisition module, used for acquiring a first target file of a layout document and a second target file corresponding to the first target file; A processing module, configured to store the first target file in a first database according to a format of the first target file; According to a preset storage rule, storing the second target file in a second database; When receiving a request to load the layout document data, reading the first target file from the first database and reading the second target file from the second database according to the request to load; A target layout document is generated according to the first target file and the second target file, and the target layout document is loaded.

9. A computing device, It is characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is performed.

10. A computer-readable storage medium, It is characterized in that Instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Representation method and system of layout file logical structure information

    CN101271463A

Cited By

  • Document processing method, electronic device and computer program product

    CN121434353A

  • Document processing methods, electronic devices and computer program products

    CN121434353B