A form generation method and system for authenticating a document
By converting certified documents into XML files and standardizing them using globally unique identifiers and tag systems, and extracting template candidates, the problem of insufficient matching accuracy when converting documents into structured form data is solved, achieving efficient and accurate document form processing.
Patent Information
- Application Number
- CN202511448203.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-10-11
AI Technical Summary
In existing technologies, traditional word processing software and version control systems can only process the text level of documents and cannot understand the semantic relationships and data structure of document content. This results in insufficient matching accuracy and poor usability when certified documents are converted into structured form data.
The authentication document is converted into an XML file, standardized using a globally unique identifier and tag system, template candidates that conform to different data templates are extracted, and the target form and authentication document are synchronized and updated through a two-way mapping relationship.
It achieves high-precision matching between document content and structured form data, avoids human error, and improves the automation, accuracy, and practicality of document conversion. It is particularly suitable for the generation and form-making of authentication documents that require high precision and efficient processing.
Smart Images

Figure CN120911407B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method and system for generating authentication documents forms. Background Technology
[0002] Certification documents typically refer to formal documents used to prove, verify, or confirm certain facts, conditions, or events. These documents may include contracts, reports, certificates, audit logs, etc. Certification documents often contain multiple documents such as requirements specifications, system design documents, implementation descriptions, and security test cases. A single "security requirement" may be defined in the requirements document, broken down in the design document, mapped to a specific code module in the implementation document, and covered by multiple test cases in the test document. The same data entity (such as an encryption algorithm name or an interface ID) may appear in various forms, such as text, table entries, and chart labels, scattered across different locations in different documents. This contradiction of "structured data, unstructured carriers" leads to a series of bottlenecks in the current document processing workflow. First, to ensure data consistency and traceability (e.g., verifying that each requirement has been adequately tested), current practices heavily rely on domain experts for intensive review, comparison, and verification. This is not only labor-intensive and prone to human error, but also severely restricts the efficiency of product iteration. When a change occurs in a certain underlying design, accurately assessing its impact and simultaneously modifying all relevant documents is a challenging and extremely risky task.
[0003] The key to form-based certification documentation lies in automating the transformation of traditional static documents into dynamic, populateable, and updatable forms, thereby improving the efficiency of document generation and management. Form-based processing allows users to easily fill in and update data, reducing errors and tedious manual input. Furthermore, form-based documentation enables seamless integration of documents with data from other systems, ensuring data accuracy and consistency, and contributing to faster and more accurate certification document generation, which is particularly important in legal, auditing, and other fields requiring strict compliance.
[0004] However, traditional word processing software and version control systems can only process the text level of documents, often only tracking changes in characters or lines of code. They cannot understand the semantic relationships and data structure of the document content, resulting in insufficient matching accuracy and poor usability during the process of converting certified documents into structured form data. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a form generation method for authentication documents, which can solve the technical problem that traditional word processing software and version control systems can only process the text level of documents, often only track changes in characters or lines of code, and cannot understand the semantic relationships and data structure of document content, resulting in insufficient matching accuracy and poor practicality in the process of converting authentication documents into structured form data.
[0006] A first aspect of this invention provides a method for generating an authentication document form, comprising:
[0007] S1: Obtain the authentication document;
[0008] S2: Convert the authentication document into an XML file to map the authentication document data to the XML tree nodes of the XML file;
[0009] S3: Standardize the XML file using globally unique identifiers and a tag system to obtain a standardized XML file;
[0010] S4: Combine standardized XML files to extract template candidates that conform to different manageable data templates from the certification documents;
[0011] S5: Combine template candidates to map the authentication document to the target form;
[0012] S6: Establish a two-way mapping relationship between the target form and the authentication document to achieve two-way conversion between the target form and the authentication document, and complete the form-based processing of the authentication document.
[0013] A second aspect of the present invention provides a form generation system for authentication documents, comprising: a processor and a memory;
[0014] The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the form generation method for authentication documents as described in the first aspect.
[0015] A third aspect of the present invention provides a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the form generation method for authentication documents as described in the first aspect.
[0016] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0017] In this embodiment of the invention, by converting the authentication document into an XML file and standardizing the document using globally unique identifiers and a tag system, the limitations of traditional technologies that can only process the document text level are overcome. This method can deeply parse the document content, automatically extract candidate options that match different data templates, and map them to the target form, ensuring high-precision matching between the document content and structured form data. Through the establishment of a bidirectional mapping relationship, synchronous updates between the form and document content can be achieved, avoiding errors from manual operations and significantly improving the automation, accuracy, and practicality of document conversion. It is particularly suitable for the generation and form-based processing of authentication documents requiring high precision and efficiency. Attached Figure Description
[0018] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0019] Figure 1 This is a flowchart illustrating a method for generating an authentication document form according to an embodiment of the present invention;
[0020] Figure 2 This is a schematic diagram of the structure of a form generation system for authentication documents provided in an embodiment of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] The form generation method for authentication documents provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0023] Reference manual attached Figure 1 The diagram illustrates a flowchart of a form generation method for authentication documents provided in an embodiment of the present invention.
[0024] This invention provides a method for generating an authentication document form, which may include the following steps:
[0025] S1: Obtain the authentication document.
[0026] In this context, authentication documents refer to the original documents that need to be converted into structured form data. These documents typically contain specific formats and content used for authenticating, verifying, or documenting certain matters, such as contracts, certificates, requirements documents, and audit reports. Authentication documents can be in various formats.
[0027] S2: Convert the authentication document into an XML file to map the authentication document data to the XML tree nodes of the XML file.
[0028] XML (Extensible Markup Language) is a standard text format for storing and transmitting data. XML files are self-descriptive; they define data structures using tags and allow data exchange between different systems. Converting authentication documents into XML files means that the document content will be stored in a structured format, facilitating subsequent processing and parsing.
[0029] Optionally, the document content can be encoded as a structured XML file. As an alternative, the document structure can be represented as a directed acyclic graph (DAG). In this graph, each node represents a semantic unit (such as a paragraph, sentence, or table unit), while edges represent the order, nesting, or referencing relationships between them. This graph-based representation can more flexibly capture non-linear or complex document structures, such as footnotes, annotations, and cross-chapter references.
[0030] An XML tree node is a hierarchical structure where the content of an XML document is organized using combinations of tags, attributes, and values. Each tag, attribute, and data value is called a node. The entire XML document can be viewed as a "tree" structure, called an XML tree, where each node represents a component of the document. Each node has parent and child nodes, and this structure clearly represents the hierarchy and relationships within the document.
[0031] It's worth noting that converting authentication documents into XML files and mapping them to XML tree nodes structures the document's content, clearly displaying its hierarchical relationships and data. This conversion method allows information in the document to be processed and modified using standardized formats, facilitating subsequent automated operations. It also improves data interoperability and accuracy, avoiding the ambiguity and errors inherent in traditional text formats.
[0032] In one possible implementation, the authentication documents include Word documents and markup language documents. S2 specifically includes:
[0033] S201: When the certified document is a Word document, the Word document body file is parsed based on the Office Open XML standard. The Word document body file includes the word.xml file and the document.xml file.
[0034] S202: Traverse the Word document body file node tree and map each Word document body file node to the XML tree node of the XML file.
[0035] S203: When the certified document is a markup language document, convert the markup language document into an abstract syntax tree using a Markdown parser.
[0036] S204: Traverse the abstract syntax tree nodes and map each abstract syntax tree node to the XML tree node of the XML file.
[0037] Specifically, Word documents are .docx documents, and markup language documents are .md documents.
[0038] Specifically, this process involves parsing the authentication document using different methods and converting it into a standardized XML format. For Word documents (.docx), the Office Open XML standard is used to parse the document body file (including word.xml and document.xml), and then the node tree is traversed, mapping each node to a tree node in the XML file. For Markdown documents (.md), a Markdown parser is used to convert the document into an Abstract Syntax Tree (AST), and then the AST nodes are mapped to XML tree nodes. Through this standardization process, the document content is converted into a structured XML format, ensuring the consistency and accuracy of document data in subsequent processing, and enabling compatibility with documents of different formats, thus improving the flexibility and automation of data processing.
[0039] S3: Standardize the XML file by using a globally unique identifier and tag system to obtain a standardized XML file.
[0040] A Globally Unique Identifier (UUID) is a standardized identifier used to uniquely identify an object or element. In document processing, UUIDs can be used to generate a unique identifier for each element in a document (such as paragraphs, headings, table cells, etc.), ensuring that each element can be accurately tracked and distinguished across different documents and systems.
[0041] A tag system refers to a set of predefined tags used to describe and organize the structure of document content. For example, XML tags can represent elements at different levels in a document, such as paragraphs, headings, and table rows. Through a tag system, appropriate tags can be assigned to each part of a document, giving it a clear structure and semantics.
[0042] Standardized XML files refer to the structuring and standardization of XML files through globally unique identifiers and tag systems, ensuring that each part of the document follows a uniform format and rules. Standardized XML files not only have a clear hierarchical relationship, but each element can also be accurately located using a unique identifier, facilitating subsequent operations and processing.
[0043] It's important to note that standardizing XML files through globally unique identifiers and tag systems ensures that each element in the document has a unique identifier and clear structural tags. This makes subsequent data mapping, management, and updates more accurate and efficient. Standardized XML files facilitate cross-system data exchange and automated processing, while avoiding the problems of information chaos and unclear hierarchy in traditional document formats, thus improving the operability and stability of document processing.
[0044] In one possible implementation, S3 specifically includes:
[0045] S301: Generate globally unique identifiers for different logical units in an XML file, where logical units include paragraphs, headings, chapters, table cells, and list items.
[0046] S302: A standardized XML file is obtained by wrapping each logical unit with a globally unique identifier using a tag system. The tag system includes structured tags that describe the macro layout of the document, block-level tags that describe independent and complete spatial content blocks, and inline tags that mark changes in text style and semantics.
[0047] Specifically, structured tags include <document> 、 <section> 、 Headings at all levels Block-level tags include paragraphs. <h1>-< / h1> <h6>list items Table rows < / h6> and cells Inline tags include bold. <strong>italics <em>or text fragments with a specific format <run>.
[0048] Specifically, by generating globally unique identifiers (UUIDs) for different logical units (such as paragraphs, headings, chapters, table cells, and list items) in an XML file, the uniqueness and traceability of each element in the document can be ensured. These logical units are then wrapped using a tag system to generate a standardized XML file. The tag system includes structured tags (such as...) <document> 、 <section>), block-level tags (such as 、 <h1>、 、 < / h1> < / section> < / document> < / run> < / em> < / strong> ) and inline tags (such as <strong>、 <em>、 <run>This process uses a clear hierarchy and identifiers to accurately describe the document's layout, content blocks, and text styles. It makes the document data more structured, facilitating subsequent parsing, processing, and updates, and ensuring data consistency, operability, and flexibility.
[0049] For example, for a document fragment containing the following content: 2.1 System Components, this system consists of a main control module and a data acquisition module. Component One, Component Two. The specific encoding format of the standardized XML file is as follows:
[0050] <section id="uuid-sec-01">
[0051] <h2 id="uuid-h2-01"> 2.1 System Components< / h2>
[0052]
[0053] <run id="uuid-run-01a"> This system is composed of< / run>
[0054] <strong id="uuid-strong-01"> Main control module< / strong>
[0055] <run id="uuid-run-01b"> It consists of a data acquisition module.< / run>
[0056]
[0057]
[0058] Component 1
[0059] Component Two
[0060]
[0061] < / section> .
[0062] Through this detailed encoding method, the system not only retains all text information, but more importantly, it solidifies the document's structure, hierarchy, style, and the unique identity of each unit, providing a solid and reliable data foundation for subsequent accurate template suggestions and document mapping.
[0063] S4: Combine standardized XML files to extract template candidates from the certification documents that conform to different manageable data templates.
[0064] Manageable data templates refer to template structures used to organize and process different types of data in documents. Template candidates are data items or areas extracted from certified documents that may conform to a certain type of manageable data template. For example, a paragraph, table, or list item in a certified document may serve as a template candidate, pending further matching with manageable data templates and conversion into structured data.
[0065] It should be noted that by extracting candidate data that conforms to different data templates from standardized XML files, the system can automatically identify the type of each data block in the document and match it with the corresponding template. This method improves the accuracy of data extraction and document transformation, reduces errors and workload from manual intervention, ensures that the content in the document can be efficiently and accurately mapped to the form structure, and enhances the system's ability to process different types of data.
[0066] In one possible implementation, manageable data templates include global variable templates, entity list templates, and chapter structure templates. Template candidates include global variable template candidates, entity list template candidates, and chapter structure template candidates.
[0067] The global variable template is used to define a single data item that appears repeatedly in multiple places within a document set, but whose value should remain globally unique. For example, the TOE name or product version number in a general information certification document. The entity list template is used to define a collection of entities with the same data structure and attributes. For example, a list containing all "subsystems," where each subsystem has attributes such as "name" and "functional overview." The chapter structure template is used to define complex, reusable content blocks with a fixed internal structure, such as a complete chapter or section. For example, all "test cases" chapters follow a fixed structure of "test purpose," "preconditions," and "test steps."
[0068] S4 specifically includes:
[0069] S401: Combine standardized XML files to extract global variable template candidates, entity list template candidates, and chapter structure template candidates from the certification document using global variable templates, entity list templates, and chapter structure templates, respectively.
[0070] In one possible implementation, extracting global variable template candidates from the authentication document using a global variable template in step S401 specifically includes:
[0071] S4011: Perform preprocessing on the certified documents, including removing special characters, converting to lowercase, and word segmentation.
[0072] S4012: Extract candidate entities from preprocessed authentication documents using part-of-speech tagging, where candidate entities include personal names, place names, organizations, and noun phrases.
[0073] S4013: Calculate candidate entity word frequency, candidate entity TF-IDF score, and candidate entity formatted feature score.
[0074] S4014: The candidate entity saliency score is obtained by weighted summation of candidate entity word frequency, candidate entity TF-IDF score, and candidate entity formatted feature score.
[0075] ;
[0076] in, , and Representing candidate entities respectively e Candidate entity word frequency, TF-IDF score, and formatted feature score, , and These represent the weights of candidate entity word frequency, TF-IDF score, and formatted feature score, respectively. Indicates candidate entities e The salience score of the candidate entity.
[0077] S4015: Output candidate entities with a significance score greater than the preset candidate entity as global variable template candidates.
[0078] Specifically, a series of natural language processing techniques are used to extract global variable template candidates from authentication documents. First, the documents are preprocessed, including removing special characters, converting to lowercase, and word segmentation, for subsequent analysis. Then, part-of-speech tagging is used to extract candidate entities from the documents, such as names of people, places, and organizations. Next, the saliency of these entities is weighted and summed by calculating their term frequency, TF-IDF score, and formatting feature score to obtain a saliency score. Finally, candidate entities with saliency scores higher than a preset threshold are output as global variable template candidates. This process, through multi-dimensional feature analysis, improves the accuracy of data extraction, accurately identifies key data elements in the document, and ensures the accuracy and usability of the generated templates.
[0079] In one possible implementation, the step of S401, extracting entity list template candidates from the authentication document using an entity list template, specifically includes:
[0080] S4016: Traverse all non-leaf nodes of the XML file and obtain the direct child nodes, where each direct child node forms a sequence of direct child nodes.
[0081] S4017: Generate a structural fingerprint of the direct child node sequence, where the structural fingerprint is a sequence of direct child node label types.
[0082] S4018: Store the structure fingerprint using a hash table, and use the hash table to count the number of structure fingerprints and their positions.
[0083] S4019: Combine the structural fingerprint location to extract the text content from the structural fingerprint corresponding to a number of times the preset structural fingerprint is obtained.
[0084] S4020: Output the font with the highest overlap in each text content as the candidate for the entity list template.
[0085] Specifically, this step involves first extracting candidate entity list templates by traversing the non-leaf nodes of the XML file to obtain direct child nodes and assembling them into a sequence of child nodes. Next, the system generates structural fingerprints for these child nodes, identifying and analyzing their structural features by recording the sequence of child node label types. A hash table is used to store these structural fingerprints, and their frequency and location are statistically analyzed to identify frequently occurring structural fingerprints. Combining this frequency information, the system extracts the text content and outputs candidate entity list templates based on the most common font features within the content. This process accurately identifies recurring important entity list sections in the document, ensuring efficient extraction of representative data elements during template generation and improving data structuring and automated processing capabilities.
[0086] In one possible implementation, the step of S401, extracting chapter structure template candidates from the authentication document using a chapter structure template, specifically includes:
[0087] S4021: Identify chapters using globally unique identifiers.
[0088] S4022: Extract dual features of the chapter, where the dual features include structural fingerprint sequence and semantic content vector.
[0089] Optionally, the structural fingerprint sequence is extracted in the following way:
[0090] In the XML file, the XML subtrees corresponding to the chapters are traversed to generate a structural fingerprint string, i.e., a structural fingerprint sequence, that reflects the chapter order and chapter hierarchy.
[0091] The specific method for extracting semantic content vectors is as follows:
[0092] Extract the text content of the chapter.
[0093] The text content of a chapter is encoded into a high-dimensional semantic vector, or semantic content vector, describing the meaning of the chapter through a pre-trained sentence vector model. The sentence vector model includes the Sentence-BERT model and the SBERT model.
[0094] It's important to note that this process effectively combines the structural information of chapters with the deep semantics of the text content through the extraction of structural fingerprint sequences and semantic content vectors. The structural fingerprint sequence accurately reflects the hierarchy and sequence of chapters, while the semantic content vector captures the latent semantics of chapters through a deep learning model, enhancing the accuracy of chapter similarity calculations. This combination of structure and semantics enables better identification of similar chapters in a document, improving the accuracy and robustness of chapter extraction and template generation.
[0095] S4023: Calculate the weighted fusion-based similarity score between every two chapters:
[0096] ;
[0097] in, Indicates the first i Chapter and the j Similarity scores between chapters Indicates the first i The structural fingerprint sequence corresponding to each chapter and the j The structural fingerprint sequence corresponding to each chapter Structural similarity between them Indicates the first i Semantic content vectors corresponding to each chapter and the j Semantic content vectors corresponding to each chapter Semantic similarity between them and They represent and The adjustable weights are: structural similarity is normalized tree edit distance or normalized Levenstein distance, and semantic similarity is cosine similarity.
[0098] S4024: Construct a chapter similarity network graph, where each chapter similarity network graph node corresponds to a chapter, and two chapter similarity network graph nodes with a similarity score greater than the preset score have an edge.
[0099] It should be noted that those skilled in the art can set the preset similarity score according to actual needs, and this invention does not limit this.
[0100] S4025: Determine the node clusters representing the community from the chapter similarity network graph using a community discovery algorithm.
[0101] Specifically, the steps for identifying node clusters representing communities from a chapter similarity network graph using a community detection algorithm include: First, calculating the similarity between chapters and constructing a network graph based on the similarity. Next, using algorithms (such as the Louvain algorithm or spectral clustering) to analyze the connections between nodes and identify groups of nodes with high similarity and tight connections. The algorithm then groups these similar nodes into a community or cluster based on criteria such as modularity optimization. Finally, the generated node clusters represent chapters in the document that are structurally or content-similar, which helps extract the core parts of the document for subsequent processing.
[0102] S4026: Count the number of nodes in the node cluster, and output the chapter name corresponding to any node in the node cluster with a number of nodes greater than the preset number of nodes as a candidate chapter structure template.
[0103] It should be noted that those skilled in the art can set the number of preset nodes according to actual needs, and this invention does not limit this.
[0104] Specifically, this step first extracts chapter structure template candidates from the certified document using chapter structure templates, identifying each chapter using a globally unique identifier. Then, the system extracts dual features from each chapter, including a structural fingerprint sequence and a semantic content vector. Next, it calculates similarity scores between chapters, and by weighted fusion of structural and semantic similarities, obtains the final similarity score for each pair of chapters. Based on this similarity information, a chapter similarity network graph is constructed, where nodes represent chapters and edges represent the similarity between chapters. Finally, a community detection algorithm is used to identify chapter clusters, and the chapter names in clusters with a sufficient number of nodes are output as chapter structure template candidates. This process, by combining structural and semantic analysis, effectively identifies and extracts chapters with similar structures and content, thus providing an efficient and accurate data extraction method for document templatening and automated processing.
[0105] S402: Output global variable type template candidates, entity list type template candidates, and chapter structure type template candidates through the visual template designer to open the template candidate setting interface.
[0106] S403: Receive confirmation instructions through the visual template designer and output confirmed template candidates.
[0107] Specifically, this step first involves the system extracting template candidates from the certification document based on different types of manageable data templates (such as global variable templates, entity list templates, and chapter structure templates) by combining standardized XML files. These candidates represent important data elements in the document, such as global variables, entity lists, and chapter structures. Subsequently, the system presents these candidates through a visual template designer, allowing users to configure and adjust them, ensuring template flexibility and customization. Through the visual interface, users can easily confirm and adjust these candidates, improving the efficiency and accuracy of template design and ensuring that the generated document format meets actual needs, thus enhancing the system's user-friendliness and operability.
[0108] Optionally, relationship confirmation can be achieved using NER and pattern matching, combined with a "human-machine loop." An alternative implementation is to employ an end-to-end deep learning model for relationship extraction. This model can directly input the raw text and simultaneously output entities and their relationship types, reducing reliance on multiple independent modules (NER, coreference resolution, etc.). Furthermore, active learning strategies can be used to optimize the manual confirmation process. The system can proactively select the most valuable potential relationships for user annotation based on uncertainty sampling or information density sampling, thereby minimizing the number of manual interventions while ensuring accuracy.
[0109] S5: Combine template candidates to map the authentication document to the target form.
[0110] The target form refers to the structured form generated during the form generation process of the authentication document, after template matching. This form is constructed based on template candidates extracted from the authentication document, aiming to map dynamic data in the document into a structured format, facilitating data entry, updating, and management by users. The target form typically includes input fields, dropdown lists, checkboxes, and other controls, allowing users to fill in the corresponding information based on the document content.
[0111] The target form is created by combining template candidates extracted from a standardized XML file. This target form is not merely a static form; it is a dynamically generated structured template based on the document content and requirements, establishing an accurate mapping between it and the original document.
[0112] In one possible implementation, S5 specifically includes:
[0113] S501: Traverse the standardized XML file, using template candidates as the retrieval unit, and extract target instances that conform to the same type of manageable data template from the certified documents.
[0114] S502: Create storage entries in the target form that conform to the different categories of manageable data templates.
[0115] S503: Store the extracted target instance into the storage entry of the corresponding manageable data template.
[0116] S504: Generate tag data about the target instance in a standardized XML file to complete the mapping between the authentication document and the target form. The tag data includes the manageable data template followed by the target instance and the storage entry of the target instance in the target form.
[0117] For example, an identified "subsystem" instance might be tagged in an XML tree as:
[0118] <instance template_id="tpl-subsystem-01" item_id="uuid-item-subsys-001">
[0119] <field name="subsystem_name">
[0120] <unit id="uuid-doc2-h3-01" type="heading"> Subsystem A< / unit>
[0121] < / field>
[0122] <field name="description">
[0123] <unit id="uuid-doc2-p-05" type="paragraph"> This is a detailed description of subsystem A...< / unit>
[0124] < / field>
[0125] < / instance> .
[0126] Specifically, by traversing a standardized XML file and extracting target instances based on template candidates, the data in the authentication document is mapped to the target form. First, the system creates corresponding storage entries in the target form based on different types of manageable data templates. Then, the extracted target instances are stored in these storage entries, and tag data for these instances is generated in the standardized XML file, completing the mapping between the authentication document and the target form. This process ensures data consistency and structure, enabling effective synchronization between document content and the form, greatly improving the efficiency and accuracy of document processing, and providing a reliable foundation for subsequent data updates and management.
[0127] Optionally, the solution generates a centralized, hierarchical web target form. Alternatively, this invention can avoid generating a separate, complete form interface and instead provide an "embedded document editing" interactive experience. In this mode, users interact directly with the rendered document (such as a Word or PDF view). When a user clicks on a data entity managed by the system, the system dynamically presents a "micro-form" containing only the relevant fields next to the entity or in a pop-up window. After the user makes modifications in the micro-form, the content is updated instantly. This approach provides a more intuitive and context-sensitive editing experience.
[0128] S6: Establish a two-way mapping relationship between the target form and the authentication document to achieve two-way conversion between the target form and the authentication document, and complete the form-based processing of the authentication document.
[0129] The bidirectional mapping relationship refers to the mutual conversion and synchronous update between the target form and the authentication document. Specifically, when a user fills in or modifies data in the target form, these changes are reflected in the authentication document in real time. Conversely, when the content of the authentication document changes, the corresponding update is reflected in the target form. This bidirectional mapping ensures data consistency and synchronization, allowing the authentication document and the target form to remain synchronized and accurate across different platforms or scenarios. By establishing a bidirectional mapping relationship between the target form and the authentication document, data consistency between the document and the form in different directions can be ensured. When a user fills in data in the target form, the form's content can be dynamically updated in the authentication document, achieving automated document content updates. Conversely, when the content of the authentication document changes, the target form can also be updated accordingly. This bidirectional conversion mechanism greatly improves the interactivity between the form and the document, reduces errors from manual operations, and ensures that the content of the document and the form always remains synchronized, improving the efficiency and accuracy of document management.
[0130] In one possible implementation, S6 specifically includes:
[0131] S601: Identify the location of each target instance in the authentication document using a globally unique identifier.
[0132] S602: Traverse the standardized XML file and replace each target instance position in the authentication document with a template syntax placeholder using template syntax. The template syntax placeholders form the rendering template, and the template syntax is either Jinja2 template syntax or Velocity template syntax.
[0133] Optionally, the proposed solution describes document rendering via generating template engine code (such as Jinja2). A viable alternative is to employ a content-address-based direct document manipulation mechanism. In this approach, instead of generating intermediate template files, the system records the precise location identifier of each data entity within the document (e.g., an XPath path within the internal XML structure of a DOCX). When form data is updated, the system directly accesses and modifies the document's underlying structure via a programming interface (e.g., using the Office Open XML SDK), writing the new data to all addressed locations. This approach avoids the parsing overhead of template languages and may be more efficient for document formats with fixed structures.
[0134] S603: After receiving the target form update data, inject the target form update data into the template syntax placeholder according to the rendering template to complete the establishment of a two-way mapping relationship between the target form and the authentication document.
[0135] Specifically, the system identifies the location of the target instance in the authentication document using a globally unique identifier (UUID). Then, it iterates through the standardized XML file, replacing the target instance location with template placeholders using template syntax to generate a rendered template. The template syntax employs standardized formats such as Jinja2 or Velocity to ensure flexible mapping between document content and form data. When the target form updates its data, the system injects the updated data into the placeholders in the template, completing the bidirectional mapping between the target form and the authentication document. This process achieves automated updates and synchronization between the document and the form, improving the accuracy, efficiency, and operability of data processing, while ensuring the timely updates and accuracy of document content.
[0136] For the entire solution, the form-based process can be understood as follows: Initialization Phase: Users upload all relevant documents for a project (such as requirements documents, design documents, test cases, etc.) to the system and can manually configure macro-level dependencies between documents (e.g., declaring that "design document" depends on "requirements document"). Parsing and Structured Truncation: Content extraction and encoding are performed on all uploaded documents to generate their respective structured XML trees. Relationship Extraction and Modeling Phase: NER and relationship discovery algorithms are activated to find potential data relationships within a single document and across documents. Human-Computer Collaborative Confirmation Phase: The system pushes the discovered potential relationships to an interactive confirmation interface for final decision-making by the user, gradually improving the data relationship graph. Form and Template Generation Phase: Once the relationship graph is complete, the system automatically constructs a form data model based on the graph and generates the corresponding web form interface. Simultaneously, the [Template Generation and Document Rendering Module] generates corresponding document templates based on the position of data entities in the original text. Data Recording and Document Template Generation: Users no longer directly edit the original documents but instead view, fill in, and modify data through the newly generated web forms. Each time form data is saved, the system can use the template engine to render the data into a complete, consistent, and correctly formatted latest version of the document set in real time or on demand.
[0137] In practical applications, the entire process involves converting certified documents (such as Word or Markdown documents) into standardized XML format, structuring the document content and clearly identifying each element. Next, the XML file is standardized using globally unique identifiers and a tag system to ensure the uniqueness and traceability of each element. Then, by extracting template candidates that conform to different data templates, the system can generate structured forms, allowing users to fill in and update data. By establishing a two-way mapping relationship between certified documents and target forms, updates to form data are synchronized to the document, and vice versa. This automated and standardized process significantly improves the efficiency, accuracy, and flexibility of document data processing, reduces manual intervention and errors, and ensures efficient collaboration between documents and forms, making it particularly suitable for application scenarios requiring high-precision and efficient data processing.
[0138] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following:
[0139] In this embodiment of the invention, by converting the authentication document into an XML file and standardizing the document using globally unique identifiers and a tag system, the limitations of traditional technologies that can only process the document text level are overcome. This method can deeply parse the document content, automatically extract candidate options that match different data templates, and map them to the target form, ensuring high-precision matching between the document content and structured form data. Through the establishment of a bidirectional mapping relationship, synchronous updates between the form and document content can be achieved, avoiding errors from manual operations and significantly improving the automation, accuracy, and practicality of document conversion. It is particularly suitable for the generation and form-based processing of authentication documents requiring high precision and efficiency.
[0140] Reference manual attached Figure 2 The diagram shows a structural schematic of a form generation system for authentication documents provided in an embodiment of the present invention.
[0141] This invention provides a form generation system 20 for authentication documents, including: a processor 201 and a memory 202;
[0142] The memory 202 stores programs or instructions that can run on the processor 201. When the program or instructions are executed by the processor 201, they implement the steps of the above-described form generation method for authentication documents and achieve the same technical effect. To avoid repetition, the present invention will not elaborate further.
[0143] It should be understood that the processor 201 in this embodiment of the invention may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0144] It should also be understood that the memory 202 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM).
[0145] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.
[0146] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0147] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0148] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, apparatuses, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0149] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0150] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0151] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0152] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0153] This invention provides a readable storage medium comprising: storing a program or instructions on the readable storage medium, wherein when the program or instructions are executed by a processor, the program or instructions implement the steps of the above-described form generation method for authentication documents and achieve the same technical effect. To avoid repetition, this invention will not elaborate further.
[0154] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.< / run> < / em> < / strong> < / section> < / document>
Claims
1. A method for generating a form for authentication documents, characterized in that, include: S1: Obtain the authentication document; S2: Convert the authentication document into an XML file to map the authentication document data to the XML tree nodes of the XML file; S3: Standardize the XML file using a globally unique identifier and tag system to obtain a standardized XML file; S4: Based on the standardized XML file, extract the template candidates that conform to different manageable data templates from the certification document; S5: Based on the template candidates, map the authentication document to the target form; S6: Establish a bidirectional mapping relationship between the target form and the authentication document to achieve bidirectional conversion between the target form and the authentication document, and complete the form-based processing of the authentication document; Specifically, S3 includes: S301: Generate globally unique identifiers for different logical units in the XML file, wherein the logical units include paragraphs, headings, chapters, table units, and list items; S302: The standardized XML file is obtained by wrapping the globally unique identifiers of each logical unit with a tag system, wherein the tag system includes structured tags that describe the macro layout of the document, block-level tags that describe independent and complete spatial content blocks, and inline tags that mark text style changes and text semantic changes. The manageable data templates include global variable templates, entity list templates, and chapter structure templates; the template candidates include global variable template candidates, entity list template candidates, and chapter structure template candidates; S4 specifically includes: S401: Combining the standardized XML file, extract the global variable template candidate, entity list template candidate, and chapter structure template candidate from the authentication document using the global variable template, the entity list template, and the chapter structure template, respectively; S402: Output the global variable type template candidate, the entity list type template candidate, and the chapter structure type template candidate through the visual template designer to open the setting interface of the template candidate; S403: Receive confirmation instructions through the visual template designer and output confirmed template candidates.
2. The method for generating a form for an authentication document according to claim 1, characterized in that, The authentication documents include Word documents and markup language documents; S2 specifically includes: S201: If the certified document is the Word document, parse the Word document body file of the Word document based on the Office Open XML standard, wherein the Word document body file includes a word.xml file and a document.xml file; S202: Traverse the Word document body file node tree and map each Word document body file node to the XML tree node of the XML file; S203: If the certified document is the markup language document, the markup language document is converted into an abstract syntax tree by a Markdown parser; S204: Traverse the abstract syntax tree nodes and map each of the abstract syntax tree nodes to the XML tree nodes of the XML file.
3. The form generation method for authentication documents according to claim 1, characterized in that, The step S401, which involves extracting global variable template candidates from the authentication document using the global variable template, specifically includes: S4011: Perform preprocessing on the authentication document, including removing special characters, converting to lowercase, and word segmentation. S4012: Extract candidate entities from the preprocessed authentication document through part-of-speech tagging, wherein the candidate entities include personal names, place names, organizations, and noun phrases; S4013: Calculate candidate entity word frequency, candidate entity TF-IDF score, and candidate entity formatted feature score; S4014: The candidate entity word frequency, the candidate entity TF-IDF score, and the candidate entity formatting feature score are weighted and summed to obtain the candidate entity salience score: ; in, , and Representing candidate entities respectively e Candidate entity word frequency, TF-IDF score, and formatted feature score, , and These represent the weights of candidate entity word frequency, TF-IDF score, and formatted feature score, respectively. Indicates candidate entities e The significance score of candidate entities; S4015: Output candidate entities with a significance score greater than the preset candidate entity as global variable template candidates.
4. The method for generating a form for an authentication document according to claim 1, characterized in that, The step S401, which involves extracting candidate entity list templates from the authentication document using the entity list template, specifically includes: S4016: Traverse each non-leaf node of the XML file to obtain direct child nodes, wherein each direct child node forms a sequence of direct child nodes; S4017: Generate a structural fingerprint of the direct child node sequence, wherein the structural fingerprint is a direct child node label type sequence; S4018: Store the structural fingerprint using a hash table, and use the hash table to count the number of structural fingerprints and the location of structural fingerprints; S4019: Based on the structural fingerprint position, extract the text content from the structural fingerprint corresponding to a number of times the number of structural fingerprints exceeds the preset number; S4020: Output the font with the highest overlap among the various text contents as the candidate for the entity list template.
5. The method for generating a form for an authentication document according to claim 1, characterized in that, The step S401, which involves extracting candidate chapter structure templates from the authentication document using the chapter structure template, specifically includes: S4021: Identify the chapter using the globally unique identifier; S4022: Extract the dual features of the chapter, wherein the dual features include a structural fingerprint sequence and a semantic content vector; S4023: Calculate a weighted fusion-based similarity score between every two of the stated chapters: ; in, Indicates the first i Chapter and the j Similarity scores between chapters Indicates the first i The structural fingerprint sequence corresponding to each chapter and the j The structural fingerprint sequence corresponding to each chapter Structural similarity between them Indicates the first i Semantic content vectors corresponding to each chapter and the j Semantic content vectors corresponding to each chapter Semantic similarity between them and They represent and The adjustable weights are as follows: the structural similarity is the normalized tree edit distance or the normalized Levenstein distance, and the semantic similarity is the cosine similarity. S4024: Construct a chapter similarity network graph, wherein each chapter similarity network graph node corresponds to one chapter, and two chapter similarity network graph nodes with a similarity score greater than a preset value have an edge; S4025: Determine the node clusters representing the community from the chapter similarity network graph using the community detection algorithm; S4026: Count the number of nodes in the node cluster, and output the chapter name corresponding to any node in the node cluster with a number of nodes greater than the preset number of nodes as the candidate for the chapter structure template.
6. The method for generating a form for an authentication document according to claim 1, characterized in that, S5 specifically includes: S501: Traverse the standardized XML file, using the template candidates as the retrieval unit, and extract target instances that conform to the same type of manageable data template from the authentication document; S502: Create storage entries in the target form that conform to the different categories of manageable data templates; S503: Store the extracted target instance into the storage entry of the corresponding manageable data template; S504: Generate tag data about the target instance in the standardized XML file to complete the mapping between the authentication document and the target form, wherein the tag data includes the manageable data template followed by the target instance and the storage entry of the target instance in the target form.
7. The method for generating a form for an authentication document according to claim 6, characterized in that, S6 specifically includes: S601: Identify the target instance location of each target instance in the authentication document using the globally unique identifier; S602: Traverse the standardized XML file and replace each target instance position in the authentication document with a template syntax placeholder using template syntax, wherein the template syntax placeholders form a rendering template, and the template syntax is Jinja2 template syntax or Velocity template syntax. S603: After receiving the target form update data, inject the target form update data into the template syntax placeholder according to the rendering template to complete the establishment of a two-way mapping relationship between the target form and the authentication document.
8. A form generation system for authentication documents, characterized in that, include: Processor and memory; The memory stores programs or instructions that can run on the processor, which, when executed by the processor, implement the steps of the form generation method for authentication documents as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Hazardous chemical substance enterprise HSE field system conformity intelligent management method and system
CN117494694A
Enhanced document generation and retrieval method based on knowledge graph
CN119646178A