Form generation method and system for authentication document
By converting authentication documents into XML files and standardizing them using globally unique identifiers and tag systems, template candidates are extracted, and a two-way mapping between the target form and the authentication document is achieved. This solves the problem of insufficient matching accuracy when converting documents into structured form data in traditional technologies, and improves the automation and accuracy of document processing.
Patent Information
- Application Number
- CN202511448203.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-10-11
AI Technical Summary
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 converting certified documents 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 improves the automation, accuracy, and usability of document conversion, ensures high-precision matching between document content and structured form data, reduces human error, and is suitable for the generation and management of authentication documents that require high precision and efficient processing.
Smart Images

Figure CN120911407A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and in particular to a form generation method and system for authenticating documents. BACKGROUND
[0002] An authentication document generally refers to a formal document used to prove, verify or confirm certain facts, conditions or events. Such documents may include contracts, reports, certificates, audit records, etc. An authentication document usually contains requirement specification, system design document, implementation description, security test case, etc. Among them, a "security requirement" may be defined in the requirement document, decomposed in the design document, corresponding 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 be scattered in different locations of different documents in various forms such as text, table entries, chart labels, etc. This contradiction between "structured data and unstructured carrier" leads to a series of bottlenecks in the current document processing process. First, in order to ensure the consistency and traceability of data (for example, to verify that each requirement has been fully tested), the current practice highly depends on domain experts to conduct intensive review, comparison and verification. This is not only labor-intensive and prone to human error, but also severely restricts the iteration efficiency of the product. When a change occurs in the underlying design, it is a difficult and high-risk task to accurately assess its impact and synchronize the modification of all related documents.
[0003] The key to formulating authentication documents is to convert traditional static documents into dynamic, fillable and updateable forms through automated means, thereby improving the efficiency of document generation and management. Through form processing, users can conveniently fill in and update data, reducing errors and tedious operations. In addition, formulating can also realize seamless integration of documents with other systems, ensuring data accuracy and consistency, and helping to improve the generation speed and accuracy of authentication documents, especially in the legal, audit and other fields that require strict compliance.
[0004] However, traditional word processing software and version control systems can only handle the text level of documents, often only tracking changes in characters or code lines, and cannot understand the semantic relationship and data structure of the document content, resulting in insufficient matching accuracy and poor practicability in the process of converting authentication documents into structured form data. SUMMARY
[0005] In view of the above prior art deficiencies, the purpose of the embodiments of the present application is to provide a form generation method for authenticating documents, which can solve the technical problems in the prior art that the traditional word processing software and version control system can only process the text level of the document, often can only track the changes of characters or code lines, cannot understand the semantic relationship and data structure of the document content, and leads to insufficient matching accuracy and poor practicability in the process of converting the authentication document into structured form data.
[0006] The first aspect of the embodiments of the present application provides a form generation method for authenticating documents, comprising: S1: obtaining an authentication document; S2: converting the authentication document into an XML file to map the authentication document data to the XML tree nodes of the XML file; S3: standardizing the XML file through a globally unique identifier and a tag system to obtain a standardized XML file; S4: combining the standardized XML file, and extracting template candidates in the authentication document that meet different manageable data templates, respectively; S5: combining the template candidates, and mapping the authentication document to a target form; S6: establishing a bidirectional mapping relationship between the target form and the authentication document to realize bidirectional conversion between the target form and the authentication document, and completing the form processing of the authentication document.
[0007] The second aspect of the embodiments of the present application provides a form generation system for authenticating documents, comprising: a processor and a memory; The memory stores programs or instructions that can be run on the processor, and the programs or instructions are executed by the processor to realize the steps of the form generation method for authenticating documents as described in the first aspect.
[0008] The third aspect of the embodiments of the present application provides a readable storage medium, and the readable storage medium stores programs or instructions, and the programs or instructions are executed by the processor to realize the steps of the form generation method for authenticating documents as described in the first aspect.
[0009] The technical scheme provided by the embodiments of the present application has at least the following beneficial effects: In the embodiment of the present application, by converting the authentication document into an XML file and standardizing the document by using a globally unique identifier and a tag system, the deficiency of the traditional technology that can only process the text level of the document is solved. The method can deeply analyze the document content, automatically extract the candidate items conforming to different data templates, and map them to the target form, ensuring high-precision matching between the document content and the structured form data. Through the establishment of a bidirectional mapping relationship, the synchronous updating of the form and the document content can be realized, avoiding the errors of manual operation, and significantly improving the automation, accuracy and practicability of the document conversion. It is especially suitable for authentication document generation and formization that requires high precision and efficient processing. BRIEF DESCRIPTION OF DRAWINGS
[0010] The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the principles of the application. In the drawings:
[0011] Figure 1 is a flowchart of a form generation method for authentication documents provided by an embodiment of the present application; Figure 2 is a structural diagram of a form generation system for authentication documents provided by an embodiment of the present application. DETAILED DESCRIPTION
[0012] In order for those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions of the present application will be described clearly and completely below in conjunction with the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all. It should be understood that these descriptions are exemplary and not intended to limit the scope of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0013] The form generation method for authentication documents provided by the embodiments of the present application will be described in detail below in conjunction with the drawings and specific embodiments and their application scenarios.
[0014] Reference is made to the accompanying drawings Figure 1 , which shows a flowchart of a form generation method for authentication documents provided by an embodiment of the present application.
[0015] The form generation method for authentication documents provided by the embodiments of the present application can include the following steps: S1: Obtain an authentication document.
[0016] wherein the authentication document refers to an original document that needs to be converted into structured form data. These documents usually contain specific formats and contents for authentication, verification or recording certain matters, such as contracts, certificates, requirement documents, audit reports, etc. The authentication document can be a document in multiple formats.
[0017] S2: converting the authentication document into an XML file to map the authentication document data to the XML tree nodes of the XML file.
[0018] wherein XML (Extensible Markup Language) is a standard text format for storing and transmitting data. XML files are self-descriptive, which define data structures through tags and allow data exchange between different systems. The conversion of the authentication document into an XML file means that the document content will be stored in a structured format for subsequent processing and parsing.
[0019] Optionally, the document content is encoded into a structured XML file. As an alternative, the document structure can be represented as a directed acyclic graph. In this graph, each node represents a semantic unit (such as a paragraph, sentence, table cell), and the edges represent their order, nesting or reference relationship. This graph-based representation can more flexibly capture non-linear or complex document structures, such as footnotes, annotations and cross-chapter references.
[0020] The XML tree node is the content of the XML file organized into a hierarchical structure through the combination of tags, attributes and values. Each tag, attribute and data value is called a node. The entire XML document can be regarded as a "tree" structure, called an XML tree, where each node represents a component of the document. Each node has a parent node and a child node, and through this structure, the hierarchy and relationship of the document can be clearly represented.
[0021] It should be noted that the process of converting the authentication document into an XML file and mapping it to the XML tree node can structure the content in the document, clearly showing the hierarchical relationship and data of the document. This conversion method allows the information in the document to be processed and modified through a standardized format, facilitating subsequent automation operations, while improving the interoperability and accuracy of the data, avoiding the ambiguity and errors of traditional text formats.
[0022] In one possible implementation, the authentication document includes a word document and a markup language document. S2 specifically includes: S201: in the case of the authentication document being a word document, parsing 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.
[0023] 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.
[0024] S203: When the certified document is a markup language document, convert the markup language document into an abstract syntax tree using a Markdown parser.
[0025] S204: Traverse the abstract syntax tree nodes and map each abstract syntax tree node to an XML tree node in the XML file.
[0026] Specifically, Word documents are .docx documents, and markup language documents are .md documents.
[0027] 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.
[0028] S3: Standardize the XML file by using a globally unique identifier and tag system to obtain a standardized XML file.
[0029] 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.
[0030] 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.
[0031] The standardized XML file refers to the structural and standardized processing of the XML file through the global unique identifier and the tag system, so that each part of the document follows a unified format and rules. The standardized XML file not only has a clear hierarchical relationship, but also each element can be accurately located through a unique identifier, which is convenient for subsequent operation and processing.
[0032] It should be noted that the standardized XML file can ensure that each element of the document has a unique identifier and a clear structural tag through the global unique identifier and the tag system, which makes the subsequent data mapping, management and updating more accurate and efficient. The standardized XML file facilitates cross-system data exchange and automated processing, while avoiding the problems of information confusion and unclear hierarchy in traditional document formats, improving the operability and stability of document processing.
[0033] In one possible implementation, S3 specifically includes: S301: generating a global unique identifier of different logical units in the XML file, wherein the logical units include paragraphs, titles, chapters, table cells and list items.
[0034] S302: wrapping the global unique identifier of each logical unit with a tag system to obtain a standardized XML file, wherein the tag system includes a structured tag describing the macro layout of the document, a block-level tag describing the content block of an independent and complete space, and an inline tag marking the change of text style and text semantic change.
[0035] Specifically, the structured tag includes <document> 、 <section> 、 , Level Headings et al. Block-level tags include paragraphs <h1>-< / h1> <h6>, list item , Table Row < / h6> and cells . In-line tags include bold <strong>, italicized <em>or a text snippet with a specific format <run>.
[0036] In particular, by generating globally unique identifiers (UUIDs) for different logical units in the XML file, such as paragraphs, headings, chapters, table cells, and list items, the uniqueness and traceability of each element in the document can be ensured. Subsequently, the logical units are wrapped using a tag system to generate a standardized XML file. The tag system includes structured tags, such as <document> 、 <section>), block-level tags (e.g., 、 <h1>、 、 < / h1> < / section> < / document> < / run> < / em> < / strong> ) and in-line labels (such as <strong>、 <em>、 <run>), to accurately describe the layout, content blocks, and text styles of the document. This process makes the document data more structured through a clear hierarchy and identifiers, facilitating subsequent parsing, processing, and updating, ensuring data consistency, operability, and flexibility.
[0037] For example, for a document fragment that includes the following content: 2.1 System components, the system is composed of a master module and a data acquisition module. Component one, component two. The encoding form of the standardized XML file is as follows: <section id="uuid-sec-01"> <h2 id="uuid-h2-01">2.1 System Components< / h2> <run id="uuid-run-01a">The system consists of< / run> <strong id="uuid-strong-01">Master Module< / strong> <run id="uuid-run-01b">and Data Acquisition Module.< / run> Component One Component Two < / section> .
[0038] Through this detailed encoding method, the system not only preserves all the text information, but more importantly, it solidifies the structure, hierarchy, style, and unique identity of each unit of the document, providing a solid and reliable data foundation for subsequent accurate template suggestions and document mapping.
[0039] S4: Extract template candidates that meet different manageable data templates from the standardized XML file.
[0040] Among them, the manageable data template refers to the template structure used to organize and process different types of data in the document. Template candidates refer to data items or areas extracted from the certified document that may meet a certain type of manageable data template. For example, a paragraph, table, or list item in the certified document may serve as a template candidate for a certain type of template, which will be further matched with the manageable data template and converted into structured data.
[0041] It should be noted that by extracting template candidates that meet different data templates from the standardized XML file, the types of each data block in the document can be automatically identified and matched with the corresponding template. This method improves the accuracy of data extraction and document conversion, reduces errors and workload of manual intervention, ensures that the content in the document can be efficiently and accurately mapped to the form structure, and enhances the system's processing capacity for different types of data.
[0042] In one possible implementation, the manageable data template includes a global variable type template, an entity list type template, and a chapter structure type template. The template candidate includes a global variable type template candidate, an entity list type template candidate, and a chapter structure type template candidate.
[0043] Among them, the global variable type template is used to define a single data item that repeatedly appears in multiple places in the document set, but the value should be kept globally unique. For example, the TOE name or product version number in the general information authentication document. The entity list type template is used to define a set 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 type template is used to define a reusable complex content block with a fixed internal structure, such as a complete chapter or section. For example, all "test case" chapters follow the fixed structure of "test purpose", "preconditions", "test steps".
[0044] S4 specifically comprises: S401: In combination with the standardized XML file, the global variable type template candidate, the entity list type template candidate and the chapter structure type template candidate in the authentication document are extracted by the global variable type template, the entity list type template and the chapter structure type template respectively.
[0045] In a possible implementation, the global variable type template candidate in the authentication document is extracted by the global variable type template in S401, specifically comprising: S4011: The authentication document is preprocessed including special character removal operation, conversion to lowercase operation and word segmentation operation.
[0046] S4012: The candidate entities are extracted from the preprocessed authentication document by part-of-speech tagging, wherein the candidate entities include personal names, place names, organizations and noun phrases.
[0047] S4013: The candidate entity word frequency, the candidate entity TF-IDF score and the candidate entity formatting feature score are calculated.
[0048] 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 saliency score: ; Wherein, , and represent the candidate entity word frequency, TF-IDF score and formatting feature score of the candidate entity e , , and represent the weights of the candidate entity word frequency, TF-IDF score and formatting feature score, represents the candidate entity saliency score of the candidate entity e .
[0049] S4015: Output the candidate entity corresponding to the preset candidate entity saliency score as a global variable type template candidate.
[0050] Specifically, the global variable type template candidate in the authentication document is extracted through a series of natural language processing techniques. First, the document is preprocessed, including removing special characters, converting to lowercase letters and tokenization, so as to facilitate subsequent analysis. Then, the part-of-speech tagging is used to extract candidate entities from the document, such as names, places, organizations, etc. Next, the saliency of these entities is weighted and summed by calculating the term frequency, TF-IDF score and formatting feature score of the candidate entities, to obtain the saliency score of the candidate entities. Finally, the candidate entities with saliency scores higher than the preset threshold are output as global variable type template candidates. This process improves the accuracy of data extraction through multi-dimensional feature analysis, accurately identifies key data elements in the document, and ensures the accuracy and practicality of template generation.
[0051] In one possible implementation, the entity list type template in the authentication document is extracted by the entity list type template in S401, specifically including: S4016: Traverse each non-leaf node of the XML file to obtain the direct child nodes, wherein each direct child node constitutes a direct child node sequence.
[0052] S4017: Generate a structure fingerprint of the direct child node sequence, wherein the structure fingerprint is a direct child node label type sequence.
[0053] S4018: Store the structure fingerprint in a hash table and count the number of structure fingerprints and the position of the structure fingerprint through the hash table.
[0054] S4019: Extract the text content in the structure fingerprint corresponding to the preset structure fingerprint number in combination with the structure fingerprint position.
[0055] S4020: Output the font with the highest coincidence degree in each text content as an entity list type template candidate.
[0056] Specifically, in this step, the process of extracting entity list type template candidates first involves obtaining the direct child nodes by traversing the non-leaf nodes of the XML file and composing them into a child node sequence. Then, the system generates a structural fingerprint for these child nodes, i.e., by recording the sequence of child node tag types, to identify and analyze the structural characteristics of the nodes. The structural fingerprints are stored using a hash table, and their frequency and position of occurrence are counted to identify structural fingerprints with high frequency of occurrence. Combining these frequency information, the system extracts the text content and outputs the entity list type template candidates according to the most common font features in the content. This process can accurately identify the important entity list part that repeatedly appears in the document, ensuring that the template generation can efficiently extract representative data elements, improving the ability of data structuring and automated processing.
[0057] In one possible implementation, the step of extracting section structure type template candidates in the authentication document through the section structure type template in S401 specifically includes: S4021: Identify the section through the globally unique identifier.
[0058] S4022: Extract the dual features of the section, wherein the dual features include a structural fingerprint sequence and a semantic content vector.
[0059] Optionally, the extraction method of the structural fingerprint sequence is specifically: In the XML file, traverse the XML sub-tree corresponding to the section to generate a structural fingerprint string reflecting the order and level of the section, i.e., the structural fingerprint sequence.
[0060] The extraction method of the semantic content vector is specifically: Extract the text content of the section.
[0061] Encode the text content of the section into a high-dimensional semantic vector describing the meaning of the section, i.e., the semantic content vector, through a pre-trained sentence vector model, wherein the sentence vector model includes a Sentence-BERT model and a SBERT model.
[0062] It should be noted that this process effectively combines the structural information of the section and the deep semantics of the text content through the extraction of the structural fingerprint sequence and the semantic content vector. The structural fingerprint sequence accurately reflects the hierarchical and sequential relationship of the section, while the semantic content vector captures the potential semantics of the section through a deep learning model, enhancing the accuracy of the section similarity calculation. This combination of structure and semantics can better identify similar sections in the document, improving the accuracy and robustness of section extraction and template generation.
[0063] S4023: Calculate the similarity score between each two sections based on weighted fusion: ; wherein, represents the similarity score between the i th chapter and the j th chapter, represents the structural similarity between the structural fingerprint sequence corresponding to the i th chapter and the structural fingerprint sequence corresponding to the j th chapter, represents the semantic similarity between the semantic content vector corresponding to the th chapter i and the semantic content vector corresponding to the th chapter, j respectively represent the adjustable weights of and , wherein the structural similarity is a normalized tree edit distance or a normalized Levenshtein distance, and the semantic similarity is a cosine similarity.
[0064] S4024: Construct a chapter similarity network graph, wherein each chapter similarity network graph node corresponds to a chapter, and two chapter similarity network graph nodes with a similarity score greater than a preset similarity score have an edge.
[0065] It should be noted that the size of the preset similarity score can be set by those skilled in the art according to actual needs, and the present application does not limit it here.
[0066] S4025: Determine a node cluster representing a community from the chapter similarity network graph by a community discovery algorithm.
[0067] Specifically, the specific steps of determining a node cluster representing a community from the chapter similarity network graph by a community discovery algorithm include: first, calculating the similarity between chapters and constructing a network graph between chapters according to the similarity. Next, use an algorithm (such as Louvain algorithm or spectral clustering) to analyze the connection relationship between nodes, and identify a node group with high similarity and tight connection. The algorithm divides these similar nodes into a community or cluster according to the modularity optimization criterion. Finally, the generated node cluster represents the chapters with similar structure or content in the document, which helps to extract the core part of the document for subsequent processing.
[0068] 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 node number greater than a preset node number as a chapter structure type template candidate.
[0069] It should be noted that the size of the preset node number can be set by those skilled in the art according to actual needs, and the present application does not limit it here.
[0070] Specifically, in this step, the chapter structure template candidates in the certified document are first extracted by the chapter structure template. Each chapter is first identified by a globally unique identifier. Then, the system extracts the dual features of each chapter, including the structure fingerprint sequence and the semantic content vector. Next, the similarity scores between chapters are calculated, and the final similarity of each pair of chapters is obtained by weighted fusion of structural similarity and semantic similarity. Based on these similarity information, a chapter similarity network graph is constructed, where the nodes represent chapters and the edges represent the similarity between chapters. Finally, the community discovery algorithm is used to identify the clusters of chapters, and the chapter names in the clusters with sufficient number of nodes are output as the chapter structure template candidates. This process combines structural and semantic analysis, effectively identifies and extracts chapters with similar structure and content, providing an efficient and accurate data extraction method for document templating and automated processing.
[0071] S402: Output the global variable template candidate, the entity list template candidate and the chapter structure template candidate through the visual template designer to open the setting interface of the template candidate.
[0072] S403: Receive the determination instruction through the visual template designer, and output the confirmed template candidate.
[0073] Specifically, in this step, the system extracts template candidates from the certified 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 the visual template designer, allowing users to configure and adjust them in the designer, ensuring the flexibility and customization of the templates. 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 the actual needs, enhancing the user-friendliness and operability of the system.
[0074] Optionally, NER and pattern matching are used, and relationship confirmation is performed in combination with "human-computer loop". An alternative implementation is to use an end-to-end relationship extraction deep learning model. This model can directly input the original text and output entities and their relationship types at the same time, reducing the dependence on multiple independent modules (NER, coreference resolution, etc.). In addition, an active learning (Active Learning) strategy can be used to optimize the manual confirmation link. The system can actively select the most valuable potential relationships based on uncertainty sampling or information density sampling, and ask users to label them, thereby minimizing the number of manual interventions while ensuring accuracy.
[0075] S5: Map the authentication document to the target form by combining the template candidates.
[0076] The target form refers to the structured form generated after template matching during the form generation process of the authentication document. This form is constructed based on the template candidates extracted from the authentication document, aiming to map the dynamic data in the document into a structured format for user data filling, updating, and management. The target form usually includes input fields, drop-down boxes, check boxes, and other controls, allowing users to fill in the corresponding information according to the document content.
[0077] The target form is created by combining the template candidates extracted from the standardized XML file. This target form is not just a static form, but a structured template dynamically generated according to the document content and requirements, which can establish an accurate mapping relationship with the original document.
[0078] In one possible implementation, S5 specifically includes: S501: Traverse the standardized XML file to extract target instances that conform to the same type of manageable data template from the authentication document using the template candidates as the search unit.
[0079] S502: Create storage entries in the target form that conform to different types of manageable data templates.
[0080] S503: Store the extracted target instances into the storage entries corresponding to the manageable data templates.
[0081] S504: Generate tag data about the target instances in the standardized XML file, completing the mapping of 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.
[0082] For example, an identified "subsystem" instance may be marked as: <instance template_id="tpl-subsystem-01" item_id="uuid-item-subsys-001"> <field name="subsystem_name"> <unit id="uuid-doc2-h3-01" type="heading">Subsystem A< / unit> < / field> <field name="description"> <unit id="uuid-doc2-p-05" type="paragraph">This is a detailed description of Subsystem A...< / unit> < / field> < / instance> .
[0083] Specifically, by traversing the standardized XML file and extracting target instances according to 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 according to different types of manageable data templates. Then, the extracted target instances are stored in these storage entries, and tag data about these instances is generated in the standardized XML file, completing the mapping of the authentication document and the target form. This process ensures data consistency and structure, enabling effective synchronization between document content and forms, greatly improving document processing efficiency and accuracy, and providing a reliable foundation for subsequent data updating and management.
[0084] Optionally, the solution generates a centralized, hierarchical web form for the target. Alternatively, instead of generating a standalone, complete form interface, the present invention can provide an "in-document inline editing" interactive experience. In this mode, the user operates directly on the rendered generated document (e.g. Word or PDF view). When the user clicks on a data entity managed by the system, the system dynamically renders a "micro form" containing only the relevant fields next to the entity or in a pop-up window. After the user completes the modifications in the micro form, the content is updated in place. This approach provides a more intuitive and contextually relevant editing experience.
[0085] S6: Establishing a bidirectional mapping relationship between the target form and the authentication document to realize the bidirectional conversion between the target form and the authentication document, and completing the form processing of the authentication document.
[0086] The bidirectional mapping relationship refers to the relationship that the target form and the authentication document can be converted and synchronously updated each other. Specifically, when the 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 updates are reflected in the target form. This bidirectional mapping ensures the consistency and synchronization of data, so that the authentication document and the target form can maintain a synchronized and accurate state in different platforms or scenarios. By establishing a bidirectional mapping relationship between the target form and the authentication document, the consistency of data between the document and the form in different directions can be ensured. When the user fills in data in the target form, the content of the form can be dynamically updated to the authentication document, realizing the automatic update of the document content. 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 the error of manual operation, and ensures that the content of the document and the form always remains synchronized, improving the efficiency and accuracy of document management.
[0087] In one possible implementation, S6 specifically includes: S601: Identifying the target instance position of each target instance in the authentication document through a globally unique identifier.
[0088] S602: Iterating through the standardized XML file, replacing each target instance position in the authentication document with a template syntax placeholder through template syntax, wherein the template syntax placeholders constitute a rendering template, and wherein the template syntax is Jinja2 template syntax or Velocity template syntax.
[0089] Optionally, the solution describes implementing document rendering by generating template engine code (e.g. Jinja2). A viable alternative is to employ a content-addressing based direct document manipulation mechanism. In this solution, the system does not generate intermediate template files, but instead records for each data entity its precise location identifier in the document (e.g. an XPath path in the internal XML structure of DOCX). When form data is updated, the system directly accesses and modifies the underlying structure of the document (e.g. using the Office Open XML SDK) through a programmatic interface, writing the new data to all addressed locations. This approach avoids the parsing overhead of template languages and can be more efficient for fixed-structure document formats.
[0090] S603: After receiving the target form update data, inject the target form update data into the template syntax placeholder according to the rendering template, complete the establishment of the bidirectional mapping relationship between the target form and the authentication document.
[0091] Specifically, the target instance position in the authentication document is identified by a globally unique identifier (UUID), and then the standardized XML file is traversed to replace the target instance position with a template placeholder through template syntax, generating a rendering template. The template syntax adopts standardized formats such as Jinja2 or Velocity, ensuring flexible mapping of document content and form data. When the target form update data is updated, the system injects the update data into the placeholder in the template, completing the bidirectional mapping relationship between the target form and the authentication document. This process realizes the automatic update and synchronization of the document and the form, improves the accuracy, efficiency and operability of data processing, and ensures the timely update and accuracy of the document content.
[0092] For the entire scheme, the formulating process can be understood as the initialization stage: the user uploads all relevant documents of a project (such as requirement documents, design documents, test cases, etc.) to the system and can manually configure the macro dependency relationship between the documents (for example, declare that the "design document" depends on the "requirement document"). Parsing and structuring truncation: perform content extraction and encoding on all uploaded documents to generate respective structured XML trees. Relationship extraction and modeling stage: start NER and relationship discovery algorithms to find potential data associations within a single document and across documents. Human-computer collaborative confirmation stage: the system pushes the discovered potential associations to an interactive confirmation interface for the user to make a final ruling and gradually improve the data relationship graph. Form and template generation stage: when the relationship graph is complete, the system automatically constructs a form data model according to the graph and generates a corresponding Web form interface. At the same time, the
template generation and document rendering module
[0093] In practical applications, the entire process converts authentication documents (such as Word or Markdown documents) into standardized XML format, structures the content of the documents, and clearly identifies each element. Then, through a global unique identifier and a tag system, the XML file is standardized to ensure the uniqueness and traceability of each element. Then, by extracting template candidates that meet different data templates, the system can generate structured forms that allow users to fill out and update data. By establishing a bidirectional mapping relationship between the authentication documents and the target forms, when the form data is updated, it can be synchronized to the documents. Conversely, when the documents are updated, they will also be automatically synchronized to the forms. 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, especially suitable for application scenarios that require high precision and efficient data processing.
[0094] The technical solutions provided by the embodiments of the present application have at least the following beneficial effects: In the embodiment of the present application, by converting the authentication document into an XML file and standardizing the document by using a globally unique identifier and a tag system, the deficiency of the traditional technology that can only process the text level of the document is solved. The method can deeply analyze the document content, automatically extract the candidate items that meet different data templates, and map them to the target form, ensuring high-precision matching between the document content and the structured form data. Through the establishment of a bidirectional mapping relationship, the synchronous update of the form and the document content can be realized, avoiding the error of manual operation, and significantly improving the automation, accuracy and practicability of the document conversion, which is especially suitable for the authentication document generation and formularization that requires high precision and efficient processing.
[0095] Referring to the accompanying drawings Figure 2 , a structural schematic diagram of a form generation system for authentication documents provided by an embodiment of the present application is shown.
[0096] An embodiment of the present application provides a form generation system 20 for authentication documents, comprising a processor 201 and a memory 202. The memory 202 stores programs or instructions that can run on the processor 201, and when the programs or instructions are executed by the processor 201, the steps of the form generation method for authentication documents described above are realized, and the same technical effects can be achieved. To avoid repetition, the present application will not be described again.
[0097] It should be understood that the processor 201 in the embodiment of the present application can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), ready-to-program gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0098] It is also to be understood that the memory 202 in embodiments of the present application can be volatile or nonvolatile memory, or can include both volatile and nonvolatile memory. Nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as external cache. By way of example, and not limitation, many forms of random access memory can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct Rambus RAM (DR RAM).
[0099] The above-described embodiments can be implemented in whole or in part by software, hardware (e.g., circuitry), firmware, or any combination of the three. When implemented in software, the above-described embodiments can be implemented in the form of one or more computer programs that are stored in a computer-readable storage medium. The computer-readable storage medium stores one or more computer instructions or computer programs that, when loaded into a computer, cause the computer to perform the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, such as from a website, a computer, a server, or a data center to another website, computer, server, or data center, via a wired (e.g., infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium or a collection of one or more available media that is accessible by a computer or a data storage device such as a server, data center, etc. 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. The semiconductor medium can be a solid-state disk.
[0100] It should be understood that the size of the sequence number of each process described above in various embodiments of the present application does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0101] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0102] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0103] In several embodiments provided by the present application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation. For example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0104] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0105] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.
[0106] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts of the technical solutions that make contributions to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0107] The embodiments of the present application provide a readable storage medium, which includes: a program or instructions stored on the readable storage medium, the program or instructions are executed by a processor to implement the steps of the form generation method of the authentication document described above, and the same technical effects can be achieved. To avoid repetition, the present application will not be described again.
[0108] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present application, but not to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed by the present application should be covered within the protection scope of the present application.< / run> < / em> < / strong> < / section> < / document>
Claims
1. A form generation method for authenticating a document, characterized by, The method comprises the following steps: S1: obtaining an authentication document; S2: converting the authentication document into an XML file to map authentication document data to XML tree nodes of the XML file; S3: standardizing the XML file by a global unique identifier and a tag system to obtain a standardized XML file; S4: combining the standardized XML file to extract template candidates in the authentication document that conform to different manageable data templates; S5: combining the template candidates to map the authentication document to a target form; S6: establishing a bidirectional mapping relationship between the target form and the authentication document to realize bidirectional conversion between the target form and the authentication document and complete form processing of the authentication document.
2. The form generation method of authenticating a document according to claim 1, characterized by, The authentication document comprises a word document and a markup language document; and the S2 specifically comprises the following steps: S201: in the case that the authentication document is the word document, parsing a Word document main file of the word document based on an Office Open XML standard, wherein the Word document main file comprises a word.xml file and a document.xml file; S202: traversing a Word document main file node tree to map each Word document main file node to an XML tree node of the XML file; S203: in the case that the authentication document is the markup language document, converting the markup language document into an abstract syntax tree through a Markdown parser; S204: traversing an abstract syntax tree node to map each abstract syntax tree node to an XML tree node of the XML file.
3. The form generation method of authenticating a document according to claim 1, wherein, The S3 specifically comprises the following steps: S301: generating a global unique identifier of different logical units in the XML file, wherein the logical units comprise a paragraph, a title, a chapter, a table cell and a list item; S302: wrapping the global unique identifier of each logical unit by a tag system to obtain the standardized XML file, wherein the tag system comprises a structured tag describing a macroscopic layout of a document, a block-level tag describing an independent and complete space content block, and an inline tag marking a text style change and a text semantic change.
4. The form generation method of authenticating a document according to claim 1, wherein, The manageable data template comprises a global variable type template, an entity list type template and a chapter structure type template; the template candidate comprises a global variable type template candidate, an entity list type template candidate and a chapter structure type template candidate; and the S4 specifically comprises the following steps: S401: combining the standardized XML file to extract the global variable type template candidate, the entity list type template candidate and the chapter structure type template candidate in the authentication document through the global variable type template, the entity list type template and the chapter structure type template respectively; S402: outputting the global variable type template candidate, the entity list type template candidate and the chapter structure type template candidate through a visual template designer to open a setting interface of the template candidate. S403: receiving a determination instruction through the visualization template designer, and outputting a confirmed template candidate.
5. The form generation method of authenticating a document according to claim 4, wherein, The global variable type template in S401 extracts the global variable type template candidate in the authentication document, specifically comprising: S4011: preprocessing the authentication document, including special character removal, conversion to lowercase, and word segmentation; S4012: extracting 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: calculating candidate entity word frequency, candidate entity TF-IDF score, and candidate entity formatting feature score; S4014: weighting and summing the candidate entity word frequency, the candidate entity TF-IDF score, and the candidate entity formatting feature score to obtain a candidate entity saliency 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: outputting the candidate entity corresponding to the preset candidate entity saliency score as the global variable type template candidate.
6. The form generation method of authenticating a document according to claim 4, wherein, The entity list type template in S401 extracts the entity list type template candidate in the authentication document, specifically comprising: S4016: traversing each non-leaf node of the XML file to obtain direct child nodes, wherein each direct child node forms a direct child node sequence; S4017: generating a structure fingerprint of the direct child node sequence, wherein the structure fingerprint is a direct child node label type sequence; S4018: storing the structure fingerprint in a hash table and counting the number of structure fingerprints and the location of structure fingerprints through the hash table; S4019: combining the structure fingerprint location to extract the text content in the structure fingerprint corresponding to the preset structure fingerprint number; S4020: outputting the font with the highest overlap degree in each text content as the entity list type template candidate.
7. The form generation method of authenticating a document according to claim 4, wherein, The chapter structure type template in S401 extracts the chapter structure type template candidate in the authentication document, specifically comprising: S4021: identifying the chapter through the globally unique identifier; S4022: extracting the dual features of the chapter, wherein the dual features include a structure fingerprint sequence and a semantic content vector; S4023: calculating the similarity score between each two chapters based on weighted fusion: ; wherein, denotes the similarity score between the i th chapter and the j th chapter, denotes the structural similarity between the structural fingerprint sequence of the i th chapter and the structural fingerprint sequence of the th chapter, j denotes the structural similarity between the structural fingerprint sequence of the th chapter and the structural fingerprint sequence of the th chapter, i denotes the semantic similarity between the semantic content vector of the th chapter and the semantic content vector of the j th chapter, denotes the semantic similarity between the semantic content vector of the th chapter and the semantic content vector of the th chapter, and are respectively adjustable weights, wherein the structural similarity is a normalized tree edit distance or a normalized Levenshtein distance, and the semantic similarity is a cosine similarity. S4024: constructing a chapter similarity network graph, wherein each chapter similarity network graph node corresponds to a chapter, and two chapter similarity network graph nodes with a similarity score greater than a preset similarity score have an edge; S4025: determining a node cluster representing a community from the chapter similarity network graph through a community discovery algorithm; S4026: counting the number of nodes in the node cluster, and outputting the chapter name corresponding to any node in the node cluster with a node number greater than a preset node number as the chapter structure type template candidate.
8. The form generation method of authenticating a document according to claim 1, wherein, S501: traversing the standardized XML file, and extracting target instances that match the same type of the template candidate from the authentication document as a search unit; S502: creating a storage entry conforming to a different category of manageable data template in the target form; S503: storing the extracted target instance into the storage entry of the corresponding manageable data template; S504: generating tag data about the target instance in the standardized XML file, completing the mapping of the authentication document and the target form, wherein the tag data comprises the manageable data template followed by the target instance and the storage entry of the target instance in the target form.
9. The form generation method of authenticating a document according to claim 8, wherein, The S6 specifically comprises: S601: identifying the target instance position of each target instance in the authentication document through the globally unique identifier; S602: traversing the standardized XML file, replacing each target instance position in the authentication document with a template syntax placeholder through template syntax, wherein the template syntax placeholder constitutes a rendering template, and wherein the template syntax is Jinja2 template syntax or Velocity template syntax; S603: after receiving target form update data, injecting the target form update data into the template syntax placeholder according to the rendering template, and completing the establishment of the bidirectional mapping relationship between the target form and the authentication document.
10. A form generation system for authenticating a document, characterized by Comprise: a processor and a memory; the memory stores programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the form generation method of the authentication document according to any one of claims 1 to 9.
Citation Information
Patent Citations
Hazardous chemical substance enterprise HSE field system conformity intelligent management method and system
CN117494694A
Method and device for automatically converting cross-format document into Markdown document and form enhancement method and system
CN119598980A
Enhanced document generation and retrieval method based on knowledge graph
CN119646178A
File arrangement processing method and system
CN120278118A
Dynamic report generation method and system and application thereof
CN120493869A
Cited By
Synchronous processing method and device for demand document and prototype file and electronic equipment
CN121579603A
Authentication document generation method and system
CN121683749A
A method and system for generating an authentication document
CN121683749B