Automatic document generation system

Through the adaptive mechanism of dynamic decomposition and containerization isolation, the problem of poor compatibility of AutoCAD multi-version is solved, seamless document generation across versions is realized, and the efficiency and reliability of engineering document generation is improved.

CN120540748AActive Publication Date: 2025-08-26BEIJING WORLEY ENGINEERING TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510640878.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-19
Publication Date
2025-08-26
Estimated Expiration
2045-05-19

AI Technical Summary

Technical Problem

The automation operation interruption and inefficiency caused by poor compatibility of existing AutoCAD multiple versions is difficult to achieve seamless cross-version operations, and there is a risk of data loss or format mismatch.

Method used

Adaptive mechanism based on dynamic decomposition and containerized isolation is adopted, and the compatible execution of cross-version operation instructions is achieved by detecting the AutoCAD file version and automatically switching object decomposition logic, combining intermediate format conversion and containerized environment isolation technology.

Benefits of technology

Ensure that the automated process runs stably between different AutoCAD versions, avoid manual intervention, improve the efficiency and reliability of engineering document generation, and reduce development and operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120540748A_ABST
    Figure CN120540748A_ABST
Patent Text Reader

Abstract

The invention relates to the field of automation of computer-aided design, and discloses an automatic document generation system, which comprises a data input analysis module used for reading a structured data file and extracting a project parameter and an operation instruction; the trigger rule analysis module is connected with the data input analysis module and is used for analyzing a special symbol defined by a user based on the operation instruction and constructing a multi-stage trigger rule tree; the dynamic topology mapping engine is connected with the trigger rule analysis module and used for modeling a template document into a directed acyclic graph and generating an optimized block operation instruction sequence through matrix operation based on the operation weight of the trigger rule tree; and the multi-version adaptive engine is connected with the dynamic topology mapping engine. According to the method, through a version perception decomposition and containerization isolation mechanism of the multi-version self-adaptive engine, the compatibility problem caused by object structure difference of different versions of AutoCAD files is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer-aided design automation technology, in particular to an automatic document generation system. Background Art

[0002] The automated generation of engineering documents is a core means of improving design efficiency and accuracy, especially in fields such as architecture and machinery. As a mainstream design tool, AutoCAD carries a large number of demands for drawing generation and modification. However, with the iterative updates of AutoCAD versions, the differences in object structures, API interfaces, and file formats between different versions have increased significantly, resulting in serious compatibility challenges for automation systems. For example, features such as parametric blocks and dynamic attributes introduced in the new version of AutoCAD cannot be directly parsed in older versions, and traditional automation solutions are often only compatible with a single version, making it difficult to achieve seamless cross-version operations, which seriously restricts the continuity and collaborative efficiency of engineering documents.

[0003] In existing technologies, cross-version document generation primarily relies on manual intervention or version locking strategies. Some solutions circumvent compatibility issues by fixing the use of a specific AutoCAD version, but at the expense of newer version features. Others use manual conversion tools (such as version downgrades and format exports) for indirect processing, which not only introduces additional steps but can also lead to data loss or formatting errors. More seriously, issues such as dependency conflicts between different versions of third-party plug-ins and differences in runtime environments cause automated processes to frequently interrupt in multi-version scenarios, forcing companies to maintain independent systems for each version, significantly increasing development and operation costs.

[0004] In response to the above-mentioned multi-version compatibility bottleneck, the present invention proposes an adaptive mechanism based on dynamic decomposition and containerized isolation. By detecting the AutoCAD file version and automatically switching the object decomposition logic (such as the 2016 version uses basic primitive decomposition, and the 2021 version adapts to parametric block parsing), combined with intermediate format conversion and containerized environment isolation technology, compatible execution of cross-version operation instructions is achieved. This solution breaks through the limitations of traditional fixed version adaptation, ensures the stable operation of automated processes between different AutoCAD versions without manual intervention, and provides reliable technical support for the large-scale generation of engineering documents. Summary of the Invention

[0005] The purpose of the present invention is to provide an automatic document generation system, which solves the problems of automatic operation interruption and low efficiency caused by the poor compatibility of multiple versions of AutoCAD.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: an automated document generation system, comprising: Data input parsing module, used to read structured data files and extract project parameters and operation instructions; A trigger rule parsing module, connected to the data input parsing module, for parsing user-defined special symbols based on the operation instructions and constructing a multi-level trigger rule tree; A dynamic topology mapping engine, connected to the trigger rule parsing module, is used to model the template document as a directed acyclic graph and generate an optimized block operation instruction sequence through matrix operations based on the operation weights of the trigger rule tree; A multi-version adaptive engine, connected to the dynamic topology mapping engine, is used to detect the AutoCAD file version and perform AEC object decomposition and format conversion, and output operation instructions after compatibility processing; The atomic operation execution module is connected to the multi-version adaptive engine and is used to execute the operation instructions and generate a final document.

[0007] Preferably, the data input parsing module includes: Structured file reading unit, used to parse the project identifier, template category code and operation instruction set in the Excel file; The field validity check unit calculates the validity score S of the input data based on preset rules, satisfying: Where: Field k : kth checksum field; M(·): regular expression matching function; V(·): checksum verification function; δ k ,γ: preset weight coefficient; when S≥S threshold The data is determined to be valid; the data cleaning unit is used to filter invalid data (S threshold ) and generate standardized intermediate data formats; The multi-source data adaptation unit supports extracting dynamic tag symbol sets from multi-source data through regular expressions.

[0008] Preferably, the trigger rule parsing module includes: The symbol recognition unit matches the user-defined dynamic trigger symbol through the regular expression R=r"{([A-Za-z0-9.]+)} to generate a tag set A rule tree construction unit converts the nested rules in the tag set into a tree structure in: Each node Represents a trigger rule; The node level depth L(v) is defined as the path length from the root node to v; the weight calculation unit is based on the level depth L(v) and the block complexity C block ​(v), calculate the operation weight w(v) according to the formula: w(v)=α·L(v)+β·C block (v); Among them: α, β are preset non-negative coefficients used to adjust the weight ratio of layer depth and block complexity; C block (v) Calculated based on the number and type of block attributes associated with node v.

[0009] Preferably, the dynamic topology mapping engine includes: The adjacency matrix generating unit is used to construct the adjacency matrix A=[a ij ] m×m ,in: The weight matrix generation unit is used to analyze the operation weights {w1,w2,...,w m}, construct the diagonal weight matrix W=diag(w1,w2,...,w m ); The optimization solving unit generates the optimized operation instruction sequence O=[o1,o2,...,o m ] T ,in: O must satisfy the operation dependency constraint A·O=0; C represents the total cost of executing the operation.

[0010] Preferably, the dynamic topology mapping engine is based on a trigger rule tree Generate the adjacency matrix A and weight matrix W, specifically including: Rule tree node mapping unit, which will trigger the rule tree Each node v is mapped to an operation instruction o i ∈O, where: The node level depth L(v) is associated with the priority of the weight coefficient α; Leaf node set Corresponding to the subset of operations that must be executed last; Dependency injection unit, based on the parent-child relationship of the node Define the adjacency matrix elements: Dynamic weight correction unit, based on the structural complexity of the rule tree Adjust the weight matrix according to the formula: in: represents the topological complexity of the rule tree; λ is the preset complexity influencing factor; I is the unit matrix.

[0011] Preferably, the multi-version adaptive engine includes: AEC object decomposer, used to select the corresponding decomposition function according to the AutoCAD file version number: Where: φ(·), ψ(·) are the preset decomposition logic functions; Line, Text, Arc, and Polyline represent AutoCAD basic primitives; DXF format conversion unit, used to execute format conversion logic: The containerized environment management module is used to load container images that match the version number and isolate third-party plug-in conflicts.

[0012] Preferably, the atomic operation execution module includes: Conflict detection unit, used to verify the trigger rule tree Whether each node v exists in the topology graph vertex set generated by the dynamic topology mapping engine , satisfying the constraints: or Make Type(v′)=Type(v); Where: Type(v) represents the instruction type identifier of node v; Automatic correction unit, when detected , do one of the following: From the template library Retrieve the preset node v that matches Type(v) default ; Generate replacement instruction o alt And update the operation sequence O; The atomic operation execution unit performs block operations based on the modified operation sequence O′ and the topological sorting result, satisfying: in: Represents the logical order constraint of operation execution; InsertBlock(·) and ReplaceAttr(·) are preset atomic operation functions.

[0013] Preferably, the system further comprises: User interaction interface module, used to receive dynamic rule adjustment instructions input by users and update the trigger rule tree in real time The structure includes: Rule editor unit, providing a graphical interface to modify nodes The hierarchical relationship or operation weight w(v); The real-time conflict warning unit detects whether the user-modified rule tree violates the operation dependency constraint A·O=0 based on the current adjacency matrix A of the dynamic topology mapping engine, and generates an alarm signal when a conflict occurs.

[0014] In summary, the present invention includes at least one of the following beneficial technical effects: This invention addresses compatibility issues caused by differences in object structure between different AutoCAD versions through a multi-version adaptive engine's version-aware decomposition and containerized isolation mechanisms. Dynamically switching decomposition functions and intermediate format conversion processes ensure seamless execution across versions from 2016 to 2021, avoiding the efficiency bottlenecks associated with manual adaptation.

[0015] 2. This approach, based on the matrixed dependency modeling and weight optimization mechanism of a dynamic topology mapping engine, parses nested rules into a directed acyclic graph (DAG) and generates an operation sequence based on the objective function of minimizing execution cost. This approach avoids deadlocks and duplicate operations caused by rule conflicts in traditional sequential execution, significantly improving the processing reliability of highly complex templates.

[0016] 3. This invention allows users to dynamically modify rule hierarchies, weights, or dependencies by triggering multi-level tree-structure modeling in the rule parsing module and real-time conflict warnings in the user interface module. Combined with real-time verification of topological constraints, this ensures that the adjusted rule operation sequence still meets dependency validity, enhancing system flexibility while reducing manual maintenance costs.

[0017] 4. The data input parsing module of this invention unifies the standardized processing flow of multi-source data through regular expression-driven dynamic tag extraction and validity scoring models. An automated cleaning and adaptation mechanism based on a pre-set rule base reduces parsing interruptions caused by incorrect or missing data formats, improving the robustness of input data.

[0018] 5. This invention utilizes conflict detection and automatic correction mechanisms within the atomic operation execution module, combined with transaction isolation and log tracking technologies, to achieve atomic execution of operation instructions and rollback of exceptions. This solution avoids document state inconsistencies caused by local operation failures and provides full-link traceability through operation logs, meeting compliance requirements for engineering documents. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the method process system of the present invention. DETAILED DESCRIPTION

[0020] The following is combined with Figure 1, the present invention is described in further detail.

[0021] The present invention provides an automatic document generation system, comprising: Data input parsing module, used to read structured data files and extract project parameters and operation instructions; The trigger rule parsing module is connected to the data input parsing module and is used to parse user-defined special symbols based on operation instructions and build a multi-level trigger rule tree; The dynamic topology mapping engine is connected to the trigger rule parsing module and is used to model the template document as a directed acyclic graph and generate an optimized block operation instruction sequence through matrix operations based on the operation weights of the trigger rule tree; The multi-version adaptive engine is connected to the dynamic topology mapping engine to detect the AutoCAD file version and perform AEC object decomposition and format conversion, and output compatibility-processed operation instructions; The atomic operation execution module is connected to the multi-version adaptive engine to execute operation instructions and generate the final document.

[0022] The data input parsing module includes: Structured file reading unit, used to parse the project identifier, template category code and operation instruction set in the Excel file; The field validity check unit calculates the validity score S of the input data based on preset rules, satisfying: Where: Field k : kth checksum field; M(·): regular expression matching function; V(·): checksum verification function; δ k ,γ: preset weight coefficient; when S≥S threshold The data is determined to be valid; the data cleaning unit is used to filter invalid data (S threshold ) and generate standardized intermediate data formats; The multi-source data adaptation unit supports extracting dynamic tag symbol sets from multi-source data through regular expressions.

[0023] The trigger rule parsing module includes: The symbol recognition unit matches the user-defined dynamic trigger symbol through the regular expression R=r"{([A-Za-z0-9.]+)} to generate a tag set Rule tree building unit, converting nested rules in a tag set into a tree structure in: Each node Represents a trigger rule; ​The node level depth L(v) is defined as the path length from the root node to v; the weight calculation unit is based on the level depth L(v) and the block complexity C block (v), calculate the operation weight w(v) according to the formula: w(v)=α·L(v)+β·C block (v); Among them: α, β are preset non-negative coefficients used to adjust the weight ratio of layer depth and block complexity; C block (v) Calculated based on the number and type of block attributes associated with node v.

[0024] The dynamic topology mapping engine includes: The adjacency matrix generating unit is used to construct the adjacency matrix A=[a ij ] m×m ,in: The weight matrix generation unit is used to analyze the operation weights {w1,w2,...,w m}, construct the diagonal weight matrix W=diag(w1,w2,...,w m ); The optimization solving unit generates the optimized operation instruction sequence O = [o1, o2, ..., o by minimizing the objective function C = W·O based on the adjacency matrix A and the weight matrix W. m ] T ,in: O must satisfy the operation dependency constraint A·O=0; C represents the total cost of executing the operation.

[0025] Dynamic topology mapping engine based on trigger rule tree Generate the adjacency matrix A and weight matrix W, specifically including: Rule tree node mapping unit, which will trigger the rule tree Each node v is mapped to an operation instruction o i ∈O, where: The node level depth L(v) is associated with the priority of the weight coefficient α; Leaf node set Corresponding to the subset of operations that must be executed last; Dependency injection unit, based on the parent-child relationship of the node Define the adjacency matrix elements: Dynamic weight correction unit, based on the structural complexity of the rule tree Adjust the weight matrix according to the formula: in: represents the topological complexity of the rule tree; λ is the preset complexity influencing factor; I is the unit matrix.

[0026] The multi-version adaptive engine includes: AEC object decomposer, used to select the corresponding decomposition function according to the AutoCAD file version number: Where: φ(·), ψ(·) are the preset decomposition logic functions; Line, Text, Arc, and Polyline represent AutoCAD basic primitives; DXF format conversion unit, used to execute format conversion logic: The containerized environment management module is used to load container images that match the version number and isolate third-party plug-in conflicts.

[0027] The atomic operation execution module includes: Conflict detection unit, used to verify the trigger rule tree Whether each node v exists in the topology graph vertex set generated by the dynamic topology mapping engine , satisfying the constraints: or Make Type(v′)=Type(v); Where: Type(v) represents the instruction type identifier of node v; Automatic correction unit, when detected , do one of the following: From the template library Retrieve the preset node v that matches Type(v) default ; Generate replacement instruction o alt And update the operation sequence O; The atomic operation execution unit performs block operations based on the modified operation sequence O′ and the topological sorting result, satisfying: in: Represents the logical order constraint of operation execution; InsertBlock(·) and ReplaceAttr(·) are preset atomic operation functions.

[0028] The system also includes: User interaction interface module, used to receive dynamic rule adjustment instructions input by users and update the trigger rule tree in real time The structure includes: Rule editor unit, providing a graphical interface to modify nodes The hierarchical relationship or operation weight w(v); The real-time conflict warning unit detects whether the user-modified rule tree violates the operation dependency constraint A·O=0 based on the current adjacency matrix A of the dynamic topology mapping engine, and generates an alarm signal when a conflict occurs.

[0029] In this embodiment, the data input parsing module extracts structured information from heterogeneous data sources and converts it into standardized intermediate data that the system can process. Through multi-layered validation and dynamic adaptation mechanisms, the module ensures the integrity of input data and the parsability of rules, providing reliable input for the subsequent construction of the trigger rule tree.

[0030] Specifically, the data input parsing module includes a structured file reading unit, a field validity check unit, a data cleaning unit, and a multi-source data adaptation unit. The structured file reading unit is configured to parse the project identifier (Project_ID), template category code (Template_Code), and operation instruction set (Operation_Set) in the Excel file. Among them, the project identifier is used to uniquely identify the current document generation task, the template category code is associated with a pre-stored template configuration library, and the operation instruction set contains a user-defined dynamic markup symbol set. The field validity check unit performs logical verification on the input data based on preset rules. The verification unit calculates the validity score S of the input data through the regular expression matching function M(·) and the check code verification function V(·), and its mathematical expression is: Among them, Field k Indicates the kth field to be checked (such as Project_ID, Template_Code, etc.), M(Field k ) returns the matching result between the field and the preset regular rule (1 for successful matching and 0 for failure), and V(Code) verifies whether the template category code has a valid mapping in the pre-stored template library. Parameter δ k and γ are preset weight coefficients used to adjust the influence of each field on the total score. threshold , the input data is determined to be valid.

[0031] The data cleaning unit is used to process invalid data (S threshold ), which is standardized by: Fill missing fields with empty values ​​or replace them with default values; Perform type coercion or truncation on fields with incorrect format; ​Generate an intermediate data file containing the cleaning log, preferably in JSON or XML format.

[0032] The multi-source data adaptation unit extracts the markup symbols from the multi-source data through dynamic regular expressions. Specifically, the regular expression R=r"{([A-Za-z0-9 . ]+)}", where: The delimiter {} is used to identify the boundary of the dynamic markup symbol; The internal matching rule [A-Za-z0-9_.]+ supports a combination of letters, numbers, underscores, and periods to accommodate nested tags (e.g. {BlockA.{Row2}}); Extracted tag set Passed to the trigger rule parsing module as the input basis for rule tree construction.

[0033] Preferably, the regular expression is designed to adopt a non-greedy matching mode to avoid parsing conflicts of multi-level nested symbols.

[0034] For example, for the input {TableA.{Column1.{SubItem}}}, the expression can be parsed layer by layer as TableA→Column1→SubItem, ensuring the integrity of the nested hierarchy.

[0035] In addition, the multi-source data adapter unit supports the conversion of unstructured data (such as CSV and text files). Through preset delimiter recognition and field mapping tables, heterogeneous data is uniformly converted into a standard key-value pair format and merged with structured data for output.

[0036] In this embodiment, the trigger rule parsing module converts user-defined operation instructions into a structured, multi-level trigger rule tree. Through hierarchical rule expression and weight assignment, it provides a computable dependency model for the dynamic topology mapping engine. Through symbol recognition, tree structure construction, and operation weight quantification, the module achieves precise mapping of dynamic rules to operation sequences.

[0037] Specifically, the trigger rule parsing module includes a symbol recognition unit, a rule tree construction unit and a weight calculation unit. The symbol recognition unit is configured to use the regular expression R=r"{([A-Za-z0-9 . ]+)}" Extract dynamic trigger symbol set from operation instructions The regular expression uses {} as a delimiter to match nested symbols containing letters, numbers, underscores, and periods, such as {BlockA.Attr1} or {TableB.{Row2}}}. The period is used to identify the hierarchical relationship of symbols, for example, {TableB.Row2} indicates that TableB is the parent symbol and Row2 is its child symbol. The rule tree construction unit is based on the symbol set. The nested relationship generates a tree structure Each of these nodes Represents a trigger rule, and the parent-child relationship between nodes corresponds to the nested level of symbols. The root node of the tree structure is the outermost symbol (such as {TableA}), and the child nodes are the inner nested symbols (such as {TableA.Column1}). The node level depth L(v) is defined as the length of the path from the root node to the node. For example, the root node L(v) = 0, its direct child node L(v) = 1, and so on. The tree structure is preferably stored in the form of an adjacency list, and each node is associated with its parent node list, child node list and block attribute set. The weight calculation unit is based on the node level depth L(v) and the block complexity C block (v), calculate the operation weight w(v) according to the formula: w(v)=α·L(v)+β·C block (v); Among them, α and β are preset non-negative coefficients used to adjust the weight ratio of layer depth and block complexity. Block complexity C block (v) Calculation based on the number and type of block attributes associated with node v, specifically including: Attribute quantity dimension: counts the total number of block attributes associated with a node. For example, a block containing five attributes (such as length, color, line type, etc.) is more complex than a block containing only two attributes. Attribute type dimension: distinguish the influence weight of attribute types, for example, the complexity contribution value of geometric attributes (such as coordinates and angles) is higher than that of text attributes (such as labels). Preferably, the block complexity calculation function can be configured as: Among them, N k represents the number of attributes of the kth category, ω k is the preset weight coefficient of the corresponding type. For example, the geometric attribute weight ω geo =0.6, text attribute weight ω text =0.3, other attribute weights ω other =0.1.

[0038] The trigger rule parsing module further works with the dynamic topology mapping engine to map the nodes in the rule tree into operation instructions. i∈O, and define the operation dependency through the node parent-child relationship. For example, if the node v p It is v c The parent node of , then set a in the adjacency matrix ij =1, indicating operation o i Need to be in o j In addition, the module is based on the structural complexity of the rule tree Dynamically modify the weight matrix, where deg(v) represents the number of children of a node. This complexity metric is used to adjust the fault-tolerant priority of the operation sequence and ensure the execution stability of complex nested rules.

[0039] In this embodiment, the module achieves accurate parsing of dynamic rules through the following technical means: Hierarchical symbol parsing: using regular expressions and dot separators to support automatic recognition of multi-level nested symbols; Tree dependency modeling: Map the symbol nesting relationship into a tree structure to clarify the order of operation instructions; Weight quantization model: combines hierarchical depth and block complexity to quantify operation priorities and provide computable parameters for topology optimization.

[0040] It should be noted that the regular expression, weight coefficients α, β and complexity calculation rules can be dynamically adjusted through the configuration file to meet the needs of different application scenarios, but their specific values ​​do not constitute a limitation of the present invention. The output result of the module (rule tree The set of operation weights is directly passed to the dynamic topology mapping engine as the core input for generating the optimized operation sequence.

[0041] In this embodiment, a dynamic topology mapping engine is used to model the operational dependencies of a template document as a directed acyclic graph (DAG) and generate optimized block operation instruction sequences through matrix operations. Through adjacency mapping, weight quantization, and constraint solving, the engine achieves topological sorting of operation instructions and optimizes execution costs, ensuring efficient and consistent generation of multiple versions of documents.

[0042] Specifically, the dynamic topology mapping engine includes an adjacency matrix generation unit, a weight matrix generation unit and an optimization solution unit. The adjacency matrix generation unit constructs an adjacency matrix A=[a ij ] m×m , where the matrix element a ij is defined as: Dependency determination is based on the trigger rule tree The parent-child relationship of nodes. If node v p It is v cThe parent node of i With o j Establish dependency constraints between ij =1). The weight matrix generation unit generates the operation weight set {w1, w2, ..., w m}, construct the diagonal weight matrix W=diag(w1,w2,...,w m ). Among them, the weight value w i The level depth L(v) of the rule tree node v and the block complexity C block (v) is calculated, and the formula is: w(v)=α·L(v)+β·C block (v); The construction of the diagonal matrix enables the execution priority of each operation instruction to be quantified independently and provides a weight coefficient for the subsequent optimization objective function.

[0043] The optimization solution unit generates an optimization operation sequence O = [o1, o2, ..., o3] that satisfies the dependency constraints by minimizing the objective function C = W·O based on the adjacency matrix A and the weight matrix W. m ] T The optimization of the objective function must satisfy the linear constraint A·O=0, and its physical meaning is: all dependencies (a ij =1) The corresponding operation sequence must be strictly followed. Preferably, the solution process adopts a topological sorting algorithm combined with a greedy strategy to prioritize high-weight operations to reduce the total execution cost. Furthermore, the dynamic topology mapping engine includes a rule tree node mapping unit and a dynamic weight correction unit. The rule tree node mapping unit maps each node v that triggers the rule tree T to an operation instruction o i ∈0, where the leaf node set The corresponding operation instructions are marked as the subset that must be executed last. The dynamic weight correction unit is based on the structural complexity of the rule tree. Adjust the weight matrix, and its correction formula is: in, represents the topological complexity of the rule tree, deg(v) is the number of child nodes of node v, λ is a preset non-negative complexity factor, and I is the identity matrix. This correction mechanism gives operations corresponding to complex rule trees higher execution priority, avoiding execution conflicts caused by deeply nested levels.

[0044] In this embodiment, the storage and calculation of the adjacency matrix preferably adopt a sparse matrix compression format (such as CSR or CSC) to reduce memory occupancy and improve operation efficiency. For example, for a template document containing m operation instructions, if the number of its dependency relationships is k (usually k << m2), sparse storage can reduce the space complexity from O(m2) to O(m + k).

[0045] The output result of the dynamic topology mapping engine is an optimized operation instruction sequence O′, which satisfies the following conditions: All operation dependency relationships are strictly followed; High-weight operations are executed first to minimize the total cost; The operations corresponding to the complex rule tree obtain redundant execution resources through dynamic correction.

[0046] It should be noted that the weight coefficients α and β, the complexity factor λ, and the specific algorithms of matrix operations (such as topological sorting and greedy strategy) can be adjusted through configuration files or external interfaces, but their specific implementation methods do not constitute a limitation to the present invention. The engine works in cooperation with the multi-version adaptive engine to ensure that the generated instruction sequence adapts to the environmental requirements of different AutoCAD versions.

[0047] In this embodiment, the multi-version adaptive engine is used to detect the version differences of AutoCAD files and perform compatibility processing. Through the version-aware object decomposition and format conversion mechanism, it ensures that the generated operation instructions are executable in different AutoCAD environments. The engine realizes the seamless connection of cross-version document generation by dynamically selecting decomposition logic, isolating version conflicts, and containerized environment adaptation.

[0048] Specifically, the multi-version adaptive engine includes an AEC object decomposer, a DXF format conversion unit, and a containerized environment management module. The AEC object decomposer is configured to select the corresponding decomposition function according to the AutoCAD file version number. When the detected file version is 2016, the decomposition function φ(·) is called to decompose the AEC object into a set of basic primitive line segments (Line) and texts (Text); when the detected version is 2021, the decomposition function ψ(·) is called to decompose the AEC object into a set of arcs (Arc) and polylines (Polyline). Its mathematical expression is: The selection of the decomposition function is based on the differences in the internal storage structures of AEC objects in different versions of AutoCAD. For example, the 2016 version uses a primitive organization method based on layers (Layer), while the 2021 version introduces a parametric block (ParametricBlock) structure, and different decomposition strategies are required to extract editable basic elements.

[0049] The DXF format conversion unit executes a cross-version format conversion process Ω, the steps of which include: Convert the original DWG file to the intermediate DXF format, stripping the version-specific binary encoding; Insert the operation instruction mark generated by the dynamic topology mapping engine into the DXF intermediate file; Repackage the modified DXF file into the target version of the DWG file. The mathematical representation of the conversion process is: Preferably, the intermediate file of the modified DWG adopts the ASCII-encoded DXF format, and the insertion position of the operation instruction is located by paragraph marks (such as ENTITIES, BLOCKS) to ensure the structural integrity of the modified file.

[0050] The containerized environment management module is used to load a runtime environment that matches the target version. Specifically, based on the detected AutoCAD version number (such as 2016 or 2021), it pulls a pre-configured Docker image (such as autocad2016_env:2.1 or autocad2021_env:3.0) from the image repository and starts the AutoCAD process in a separate container. The containerized environment ensures compatibility through the following mechanisms: Dependency isolation: pre-install runtime libraries and third-party plug-ins that match the target version in the container to avoid plug-in conflicts in the host environment; process sandbox: restrict resource access rights of processes in the container, allowing only reading and writing of project files in specified directories; Version binding: The container image has an embedded version verification script to ensure that the operation instruction execution engine strictly matches the file version.

[0051] In this embodiment, the multi-version adaptive engine achieves version compatibility through the following technical means: Dynamic decomposition strategy: switch the decomposition function according to the version number to adapt to the differences in object structure between different versions; Intermediate format conversion: Utilize the version independence of DXF format to strip version-specific codes and inject operation instructions; Containerized isolation: Isolate version dependencies through a mirrored environment to ensure the purity of the operation instruction execution environment.

[0052] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. An automated document generation system, characterized in that: include: Data input parsing module, used to read structured data files and extract project parameters and operation instructions; A trigger rule parsing module, connected to the data input parsing module, for parsing user-defined special symbols based on the operation instructions and constructing a multi-level trigger rule tree; A dynamic topology mapping engine, connected to the trigger rule parsing module, is used to model the template document as a directed acyclic graph and generate an optimized block operation instruction sequence through matrix operations based on the operation weights of the trigger rule tree; A multi-version adaptive engine, connected to the dynamic topology mapping engine, is used to detect the AutoCAD file version and perform AEC object decomposition and format conversion, and output operation instructions after compatibility processing; The atomic operation execution module is connected to the multi-version adaptive engine and is used to execute the operation instructions and generate a final document.

2. The automated document generation system according to claim 1, wherein: The data input parsing module includes: Structured file reading unit, used to parse the project identifier, template category code and operation instruction set in the Excel file; The field validity check unit calculates the validity score S of the input data based on preset rules, satisfying: Where: Field k is the kth check field; M(·) is the regular expression matching function; V(·) is the check code verification function; δ k ,γ is the preset weight coefficient; when S≥S threshold The data is determined to be valid; the data cleaning unit is used to filter invalid data (S threshold ) and generate standardized intermediate data formats;​ The multi-source data adaptation unit supports extracting dynamic tag symbol sets from multi-source data through regular expressions.

3. The automated document generation system according to claim 1, wherein: The trigger rule parsing module includes: The symbol recognition unit matches the user-defined dynamic trigger symbol through the regular expression R=r"{([A-Za-z0-9.]+)} to generate a tag set A rule tree construction unit converts the nested rules in the tag set into a tree structure in: Each node Represents a trigger rule; The node level depth L(v) is defined as the path length from the root node to v; the weight calculation unit is based on the level depth L(v) and the block complexity C block (v), calculate the operation weight w(v) according to the formula: w(v)=α·L(v)+β·C block (v); Among them: α, β are preset non-negative coefficients used to adjust the weight ratio of layer depth and block complexity; C block (v) Calculated based on the number and type of block attributes associated with node v.

4. The automated document generation system according to claim 1, wherein: The dynamic topology mapping engine includes: The adjacency matrix generating unit is used to construct the adjacency matrix A=[a ij ] m×m ,in: The weight matrix generation unit is used to analyze the operation weights {w1,w2,...,w m }, construct the diagonal weight matrix W=diag(w1,w2,...,w m ); The optimization solving unit generates the optimized operation instruction sequence O=[o1,o2,...,o m ] T ,in: O must satisfy the operation dependency constraint A·O=0; C represents the total cost of executing the operation.

5. The automatic document generation system according to claim 1, characterized in that: The dynamic topology mapping engine is based on a trigger rule tree Generate the adjacency matrix A and weight matrix W, specifically including: Rule tree node mapping unit, which will trigger the rule tree Each node v is mapped to an operation instruction o i ∈O, where: The node level depth L(v) is associated with the priority of the weight coefficient α; Leaf node set Corresponding to the subset of operations that must be executed last; Dependency injection unit, based on the parent-child relationship of the node Define the adjacency matrix elements: Dynamic weight correction unit, based on the structural complexity of the rule tree Adjust the weight matrix according to the formula: in: represents the topological complexity of the rule tree; λ is the preset complexity influencing factor; I is the unit matrix.

6. The automated document generation system according to claim 1, characterized in that: The multi-version adaptive engine includes: AEC object decomposer, used to select the corresponding decomposition function according to the AutoCAD file version number: Decomposition operation Where: φ(·), ψ(·) are the preset decomposition logic functions; Line, Text, Arc, and Polyline represent AutoCAD basic primitives; DXF format conversion unit, used to execute format conversion logic: Conversion processΩ: The containerized environment management module is used to load container images that match the version number and isolate third-party plug-in conflicts.

7. The automatic document generation system according to claim 1, characterized in that: The atomic operation execution module includes: Conflict detection unit, used to verify the trigger rule tree Whether each node v exists in the topology graph vertex set generated by the dynamic topology mapping engine , satisfying the constraints: or Make Type(v′)=Type(v); Where: Type(v) represents the instruction type identifier of node v; Automatic correction unit, when detected , do one of the following: From the template library Retrieve the preset node v that matches Type(v) default ; Generate replacement instruction o alt And update the operation sequence O; The atomic operation execution unit performs block operations based on the modified operation sequence O′ and the topological sorting result, satisfying: in: Represents the logical order constraint of operation execution; InsertBlock(·) and ReplaceAttr(·) are preset atomic operation functions.

8. The automatic document generation system according to claim 1, characterized in that: The system further comprises: User interaction interface module, used to receive dynamic rule adjustment instructions input by users and update the trigger rule tree in real time The structure includes: Rule editor unit, providing a graphical interface to modify nodes The hierarchical relationship or operation weight w(v); The real-time conflict warning unit detects whether the user-modified rule tree violates the operation dependency constraint A·O=0 based on the current adjacency matrix A of the dynamic topology mapping engine, and generates an alarm signal when a conflict occurs.

Citation Information

Patent Citations

  • Cloud-based universal parameterized model analysis method and design system

    CN111324965A

  • Method for batch modification and annotation of DWG format files

    CN116932499A

  • Inspection rule generation method fusing standard file and CAD data analysis

    CN117932708A

  • Method and system for generating design drawing of printed circuit board

    CN119397990A

  • System and method for dynamic generation of structured documents

    US20020087571A1

Cited By

  • Off-line detection report automatic generation system and method based on intelligent template matching

    CN122389843A