A method and device for recognizing a docx type file to generate a tender document template
Through the identification and processing of docx-type files, structured, reusable and easy-to-operate bidding file templates are generated, which solves the problems of single types of templates, high degree of professionalism and poor reusability in the existing technology, and realizes the convenient generation of user-defined templates and the standardization of internal system layouts.
Patent Information
- Application Number
- CN202210897872.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-01-11
- Filing Date
- 2022-07-28
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2042-07-28
AI Technical Summary
During the preparation of existing bidding document templates, the system supports a single type of templates, which is difficult to meet the changing business needs. The template files are highly professional, have poor reusability, are time-consuming and cost-effective, and agency users cannot customize templates, which are low in intelligence.
A method of generating bidding file templates based on docx type files, including obtaining tag files and basic bidding file templates from designated locations, filling in basic information according to needs, converting them into zip compression packages, reading document.xml file, obtaining tag data, replacing content through XML parsing rules, generating the first version of bidding file template, and merging it with the sub-template to obtain the final version of bidding file template.
It realizes users to easily generate bidding document templates, reduces work complexity, improves work efficiency, standardizes the internal bidding document layout of the system, and provides a foundation for subsequent analysis and editing.
Smart Images

Figure CN115130452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and particularly to a method and device for generating a tender document template based on the recognition of docx type files. Background Art
[0002] The tender document template is only a guiding document. According to different implementation regions and different entities, the template document can be supplemented. Under the enterprise procurement framework, the agency is mostly a social agency, and the procurement is mostly self-procurement. The tender document template is mostly implemented according to the template stipulated within the social agency.
[0003] The current process of compiling the tender document template is still a pain point and a difficult point in the tendering and bidding implementation process, including the following points:
[0004] 1. Since the types of tender document templates supported by the system are single, it is difficult to meet the ever-changing business requirements. Whenever a new template is added, the implementation personnel cannot simply complete it through page operations, and partial chapter reuse is not possible. Each time, it needs to be processed as a new document. Due to the existence of back-end rendering syntax in the template file and unfamiliar implementation of variable names, R & D personnel often need to intervene. Therefore, each time a new template is added, it needs to be completed with the participation of R & D personnel, with poor reusability, time-consuming, and high costs.
[0005] 2. The template file has a high degree of specialization, is not easy to read, and the maintenance cost for implementation and operation personnel is high.
[0006] 3. Users such as agency handlers cannot customize the template. Each time it is used, it can only be edited offline, with high usage costs and low intelligence. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method and device for generating a tender document template based on the recognition of docx type files, which is convenient for users to generate tender document templates, reduces the complexity of work, and improves work efficiency.
[0008] In the first aspect, the present invention provides a method for generating a tender document template based on the recognition of docx type files, including:
[0009] Step 1: Obtain a tag file and a basic tender document template from a specified location, where the basic tender document template is a word-based flow file;
[0010] Step 2: Fill in the basic information for identifying the tender document according to the requirements to obtain a processed basic tender document, where the basic information includes business data information, key processing chapter information, and filtered chapter information;
[0011] Step 3: Convert the processed basic tender document into a zip archive, and read the document.xml file from the zip archive;
[0012] Step 4: Obtain the label data applicable to the tender document from the label file, where the label data includes label names, label content addresses, and label preview addresses;
[0013] Step 5: Read the content of the document.xml file by chapter according to open-source XML parsing rules, and replace the content read with the label data according to set rules to generate the first version of the tender document template;
[0014] Step 6: Match the names of the key processing chapters and the set chapters to be filtered with the sub-templates of the e-bidding system, and obtain the sub-templates with a value greater than the set threshold for the user to select;
[0015] Step 7: Merge the first version of the tender document template with the sub-templates to obtain the final version of the tender document template.
[0016] Further, Step 6 is further specifically as follows:
[0017] Read the content of the document.xml file by chapter according to open-source XML parsing rules, query the read file content, and replace the business data information with the label data according to set rules; and identify the key processing chapter information and the filtered chapter information to generate the first version of the tender document template.
[0018] Further, Step 6 is further specifically as follows: Match the names of the key processing chapters and the set chapters to be filtered with the sub-templates of the e-bidding system, and obtain the sub-templates with a value greater than the set threshold for the user to select. The user selects from the sub-templates according to their needs, or uploads a custom template.
[0019] Further, Step 7 is further specifically as follows: Merge the first version of the tender document template with the sub-template or the custom template to obtain the final version of the tender document template.
[0020] In a second aspect, the present invention provides a device for generating a tender document template based on the recognition of docx type files, including:
[0021] A file acquisition module that acquires a label file and a basic tender document template from a specified location, where the basic tender document template is a word version streaming file;
[0022] A file processing module that fills in the basic information for recognizing the tender document according to requirements to obtain the processed basic tender document, where the basic information includes business data information, key processing chapter information, and filtered chapter information;
[0023] Obtain the XML module, convert the processed basic tender documents into a ZIP compressed package, and read the document.xml file from the ZIP compressed package;
[0024] The label data module obtains label data applicable to the tender documents from the label file, and the label data includes label names, label content addresses, and label preview addresses;
[0025] The modify label module reads the content of the document.xml file by chapter according to the open-source XML parsing rules, replaces the read content with the label data according to the set rules, and generates the first version of the tender document template;
[0026] The process chapter module matches the names of the key process chapters and the set chapters to be filtered with the sub-templates of the e-bidding system, obtains sub-templates greater than the set threshold for the user to select;
[0027] The generate template module merges the first version of the tender document template with the sub-template to obtain the final version of the tender document template.
[0028] Furthermore, the modify label module is further specifically as follows:
[0029] Read the content of the document.xml file by chapter according to the open-source XML parsing rules, query the read file content, replace the business data information with the label data according to the set rules; and identify the key process chapter information and the filtered chapter information to generate the first version of the tender document template.
[0030] Furthermore, the process chapter module is further specifically as follows: Match the names of the key process chapters and the set chapters to be filtered with the sub-templates of the e-bidding system, obtain sub-templates greater than the set threshold for the user to select, and the user selects from the sub-templates according to the requirements, or uploads a custom template.
[0031] Furthermore, the generate template module is further specifically as follows: Merge the first version of the tender document template with the sub-template or the custom template to obtain the final version of the tender document template.
[0032] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
[0033] A method and device for generating a tender document template based on the recognition of docx type files provided by the embodiments of the present application have the ability to convert word version tender documents into structured, reusable, and easy-to-operate template files, facilitating the work of relevant practitioners in preparing tender documents; standardizing the format files of tender documents within the system, providing a basis for subsequent further analysis and editing.
[0034] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention are hereinafter specifically exemplified. Brief Description of the Drawings
[0035] The present invention will be further described below with reference to the accompanying drawings in conjunction with embodiments.
[0036] Figure 1 It is the flowchart in the method of the first embodiment of the present invention;
[0037] Figure 2 It is the structural schematic diagram of the device in the second embodiment of the present invention. Detailed Embodiments
[0038] The embodiments of the present application provide a method and device for generating a tender document template based on the recognition of docx type files, solving the technical problem of low intelligence in the process of preparing tender documents in the current e-bidding system; providing a reusable and referenceable method and device for quickly preparing tender documents through the integration of existing open-source technologies and the understanding of this profession, assisting in "Internet + e-procurement" and reducing costs and increasing efficiency.
[0039] The overall idea of the technical solution in the embodiments of the present application is as follows:
[0040] The present invention provides a method applied to the conversion of tender documents into templates, and the specific steps include:
[0041] 1.1 The system presets a structured data extraction tag file and a basic tender document template.
[0042] Description:
[0043] Basic tender document template: It is a docx document that only defines the text frame style and has no template content.
[0044] Tag file: It is a set of script files that define the rendering of project content in the e-bidding system.
[0045] 1.2 Import and fill in some key information before recognizing the word version of the streaming file. The information includes the following. (Some key information needs to be filled in manually by the user after import to assist the system in content recognition. That is, the user imports a docx document that can be used as a reference and enters information such as the project name (code), agency name (address), and purchasing unit name (address) in the document to assist the system in recognition. Finally, the program renders according to the data processed by recognition based on the basic tender document template style mentioned in 1.1. Finally, a new docx document file is generated as the final tender template.)
[0046] 1.2.1 Basic information (that is, the information at the project dimension in the imported template content, which may be recognized as template content by the program): For example, project information, agency information, purchaser information, procurement method, organizational form, etc.
[0047] 1.2.2 Rules for the title copywriting of the streaming file. For example, the first-level title: Chapter X; the second-level title: I. XXX; the third-level title: 1. XXX; the fourth-level title: 1.1 XXX.
[0048] 1.2.3 Special chapter names: For example, the front schedule of instructions; project overview; evaluation methods and criteria. (This rule is mainly a business rule, that is, the chapters in the imported document that need to be focused on by the system and need to be rendered according to the actual situation of the project data. Generally, it is the chapter with table content that needs to be rendered.)
[0049] 1.2.4 Filter out chapter information that is not processed: contract text; tender format file. (Considering that the tender document content mainly consists of the following aspects. 1. The chapter content that needs to be rendered according to the project information; 2. The format text that has nothing to do with the project but is regulated by certain regulations and implementation measures; 3. The fixed description content in the tender document. Filter out the chapters that are not processed so that this part of the content can be recommended by the system and uploaded by the user. While being flexible and variable, it does not affect the changes in other chapters. For the filtered chapters, this part will not be processed when reading the content of the imported document later.)
[0050] 1.3 The user imports the word version of the streaming file. The system converts it into a zip compressed package and reads the document.xml file (the file generated after decompressing the zip file after the dox file is imported).
[0051] 1.4 Query the tag data applicable to the tender document in the system. Include tag name, tag content address, and tag preview address.
[0052] 1.5 Read the content of the streaming file by chapter according to the open-source XML parsing rules. The reading rules are detailed as follows:
[0053] 1.5.1 If the chapter read is the one described in 1.2.4, then this chapter is not processed and is skipped.
[0054] 1.5.2 If the chapter read is not the one described in 1.2.3 and 1.2.4, then the operations are as follows:
[0055] 1.5.2.1 Replace the basic data with the corresponding tag names (there is already a tag file in 1.1, and the corresponding tag file path and tag name are stored in the program database. The tag name is represented in human-readable Chinese, such as "Tag - Name of Procurement Agency". Only the tag name is replaced. Since the final generated is a template, it does not contain the content of a specific project). For example, in the basic data, "Project Name: Simulation Test Project, Purchaser Name: Simulation Purchasing Unit, Agency Name: Simulation Agency". The imported data content is "The Simulation Agency is entrusted by the Simulation Purchasing Unit to organize the procurement of the Simulation Test Project by public bidding. Domestic suppliers meeting the qualification requirements are welcome to participate in the bidding." After processing, the data content is "{{Tag - Name of Procurement Agency}} is entrusted by {{Tag - Name of Purchasing Unit}} to organize the procurement of {{Tag - Project Name}} by public bidding. Domestic suppliers meeting the qualification requirements are welcome to participate in the bidding."
[0056] 1.5.2.2 Store the directory data into the chapter object through regular expressions for the content read in 1.5.2.1 (in the example of 1.5.2.1, the initialized data is the content after the imported data content. After being processed by 1.5.2.1, the data content is the data content with tag names, that is, the content after the processed data content). The chapter object attributes include "Chapter Name", "Chapter Content", "Sub - chapter Objects under the Chapter", "Chapter Tag Name", etc.
[0057] 1.5.3 Match the content in the special chapter name with the tags in the system (perform a similarity match. The system is the e - bidding system. That is, compare the chapter name with the preset tag file names in 1.1). And return the tags that pass the threshold to the user for selection.
[0058] 1.5.4 Perform secondary processing on the tags selected by the user in 1.5.3 according to the tags and the imported content. (The output of the process in 1.5.2.3 is a multi - tag selection list, and after the user selects, it is the specified tag. The process in 1.5.2.4 is to perform replacement processing on the tags selected by the user.)
[0059] 1.5.5 Render the generated chapter object data with the basic tender document template. Finally, generate the first - version tender document template.
[0060] 1.6 Query the filtered chapters and match them with the sub - templates (sub - files) in the system (other preset template files in the electronic bidding and tendering system. If there are preset chapter files in the system, such as contract text files, etc., they are matched.). Provide the sub - templates that pass the threshold (the electronic bidding and tendering system needs to set a minimum value for the matching degree, and only those greater than this value after matching can be matched) for the user to select, and at the same time provide an entry for the user to upload sub - templates by themselves.
[0061] 1.7 Merge the first - version bidding document template generated in 1.5.2.5 with the sub - templates generated in 1.6 to generate the final bidding document template.
[0062] Embodiment 1
[0063] As Figure 1 shown, this embodiment provides a method for generating a bidding document template based on the recognition of docx - type files, including:
[0064] Step 1: Obtain a tag file and a basic bidding document template from a specified location, where the basic bidding document template is a word - version flowing file;
[0065] Step 2: Fill in the set information into the basic bidding document template, modify the titles in the basic bidding document template according to the set title copywriting rules, add chapter names to the basic bidding document template according to the setting, and filter the set chapters in the basic bidding document template to obtain the processed basic bidding document;
[0066] Step 3: Convert the processed basic bidding document into a zip compressed package and read the document.xml file from the zip compressed package;
[0067] Step 4: Obtain the tag data applicable to the bidding document from the tag file, where the tag data includes tag names, tag content addresses, and tag preview addresses;
[0068] Step 5: Read the content of the document.xml file by chapter according to the open - source XML parsing rules, query the read file content, replace the business data information with the tag data according to the set rules; and identify the key - processing chapter information and the filtered chapter information to generate the first - version bidding document template;
[0069] Step 6: Match the names of the key - processing chapters and the set filtered chapters with the sub - templates of the electronic bidding and tendering system, obtain the sub - templates greater than the set threshold for the user to select, and the user can select from the sub - templates according to the needs, or upload a custom template;
[0070] Step 7: Merge the first - version bidding document template with the sub - template or custom template to obtain the final - version bidding document template.
[0071] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1. For details, see Embodiment 2.
[0072] Embodiment 2
[0073] As Figure 2 shown, in this embodiment, an apparatus for identifying and generating a tender document template based on a docx type file is provided, including:
[0074] A file acquisition module, which acquires a tag file and a basic tender document template from a specified location, and the basic tender document template is a word version flow file;
[0075] A file processing module, which fills in the set information into the basic tender document template, modifies the title in the basic tender document template according to the set title copywriting rule, adds the set chapter names to the basic tender document template according to the setting, and filters the set chapters in the basic tender document template to obtain the processed basic tender document;
[0076] An xml acquisition module, which converts the processed basic tender document into a zip compressed package and reads the document.xml file from the zip compressed package;
[0077] A tag data module, which acquires tag data applicable to the tender document from the tag file, and the tag data includes a tag name, a tag content address, and a tag preview address;
[0078] A tag modification module, which reads the content of the document.xml file by chapter according to the open source XML parsing rule, queries and reads the file content, replaces the business data information with the tag data according to the set rule; and identifies the key processing chapter information and the filtered chapter information to generate a first version of the tender document template;
[0079] A chapter processing module, which matches the names of the key processing chapters and the set filtered chapters with the sub-templates of the electronic tendering and bidding system, acquires the sub-templates greater than the set threshold for the user to select, and the user selects from the sub-templates according to the needs, or uploads a custom template;
[0080] A template generation module, which merges the first version of the tender document template with the sub-template or the custom template to obtain the final version of the tender document template.
[0081] Since the apparatus introduced in Embodiment 2 of the present invention is the apparatus adopted for implementing the method in Embodiment 1 of the present invention, based on the method introduced in Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus, so it will not be elaborated herein. Any apparatus adopted for the method in Embodiment 1 of the present invention falls within the scope of protection of the present invention.
[0082] Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be covered by the scope protected by the claims of the present invention.
Claims
1. A method for generating a tender document template based on the recognition of docx type files, characterized in that: Including: Step 1: Obtain a label file and a basic tender document template from a specified location, where the basic tender document template is a word-based flowing file; Step 2: Fill in the basic information for identifying the tender document according to requirements to obtain the processed basic tender document, where the basic information includes business data information, key processing chapter information, and filtered chapter information; Step 3: Convert the processed basic tender document into a zip compressed package and read the document.xml file from the zip compressed package; Step 4: Obtain the label data applicable to the tender document from the label file, where the label data includes label name, label content address, and label preview address; Step 5: Read the content of the document.xml file by chapter through open-source XML parsing rules, and replace the read content with the label data according to set rules to generate the first version of the tender document template; Step 6: Match the names of the key processing chapters and the set filtered chapters with the sub-templates of the e-bidding system to obtain sub-templates with a value greater than the set threshold. The user can select from the sub-templates according to requirements or upload a custom template; Step 7: Merge the first version of the tender document template with the sub-template selected by the user to obtain the final version of the tender document template.
2. The method for generating a tender document template based on the recognition of docx type files according to claim 1, characterized in that: The specific content of Step 5 is further as follows: Read the content of the document.xml file by chapter through open-source XML parsing rules, query the read file content, replace the business data information with the label data according to set rules; and identify the key processing chapter information and the filtered chapter information to generate the first version of the tender document template.
3. The method for generating a tender document template based on the recognition of docx type files according to claim 1, characterized in that: The specific content of Step 7 is further as follows: Merge the first version of the tender document template with the sub-template or custom template to obtain the final version of the tender document template.
4. A device for generating a tender document template based on the recognition of docx type files, characterized in that: Including: File acquisition module: Obtain a label file and a basic tender document template from a specified location, where the basic tender document template is a word-based flowing file; File processing module: Fill in the basic information for identifying the tender document according to requirements to obtain the processed basic tender document, where the basic information includes business data information, key processing chapter information, and filtered chapter information; XML acquisition module: Convert the processed basic tender document into a zip compressed package and read the document.xml file from the zip compressed package; Label data module: Obtain the label data applicable to the tender document from the label file, where the label data includes label name, label content address, and label preview address; Label modification module: Read the content of the document.xml file by chapter through open-source XML parsing rules, and replace the read content with the label data according to set rules to generate the first version of the tender document template; Chapter processing module: Match the names of the key processing chapters and the set filtered chapters with the sub-templates of the e-bidding system to obtain sub-templates with a value greater than the set threshold. The user can select from the sub-templates according to requirements or upload a custom template; A generation template module merges the first version of the tender document template with the sub-template to obtain the final version of the tender document template.
5. The device for generating a tender document template based on the recognition of docx type files according to claim 4, characterized in that: The modification tag module is further specifically as follows: Read the content of the document.xml file by chapter according to the open-source XML parsing rules, query the read file content, replace the business data information with the tag data according to the set rules; and identify the key processing chapter information and the filtered chapter information to generate the first version of the tender document template.
6. The device for generating a tender document template based on the recognition of docx type files according to claim 4, characterized in that: The generation template module is further specifically as follows: Merge the first version of the tender document template with the sub-template or the custom template to obtain the final version of the tender document template.
Citation Information
Patent Citations
Method and system for preparing procurement bidding document
CN109062881A
Method for generating word document in templated mode
CN111159995A