An automated document generation system
By employing an adaptive mechanism of dynamic decomposition and containerized isolation, the problem of poor compatibility between multiple AutoCAD versions is resolved, enabling seamless cross-version document generation and improving the efficiency and reliability of engineering document generation.
Patent Information
- Application Number
- CN202510640878.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-05-19
AI Technical Summary
Poor compatibility between existing AutoCAD versions leads to interruptions and inefficiencies in automated operations. Traditional solutions struggle to achieve seamless cross-version operation and pose risks of data loss or format corruption.
An adaptive mechanism based on dynamic decomposition and containerized isolation is adopted. By detecting the AutoCAD file version and switching the object decomposition logic, combined with intermediate format conversion and containerized environment isolation technology, cross-version operation commands can be executed compatiblely.
Ensuring stable operation of automated processes across different AutoCAD versions avoids manual intervention, improves the efficiency and reliability of engineering document generation, and reduces development and maintenance costs.
Smart Images

Figure CN120540748B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer-aided design automation technology, and in particular to an automated document generation system. Background Technology
[0002] Automated generation technology for engineering documents is a core means to improve design efficiency and accuracy, especially in fields such as architecture and mechanical engineering, where AutoCAD, as the mainstream design tool, handles a large number of drawing generation and modification needs. However, with the iterative updates of AutoCAD versions, the differences in object structure, API interfaces, and file formats between different versions have increased significantly, leading to serious compatibility challenges for automated systems. For example, features such as parametric blocks and dynamic attributes introduced in newer versions of AutoCAD cannot be directly parsed in older versions, and traditional automation solutions often only adapt to a single version, making it difficult to achieve seamless cross-version operation, which severely restricts the continuity and collaborative efficiency of engineering documents.
[0003] In existing technologies, cross-version document generation mainly relies on manual intervention or version locking strategies. Some solutions circumvent compatibility issues by using a fixed AutoCAD version, but sacrifice the features of the newer version. Other solutions use manual conversion tools (such as version downsampling and format export) for indirect processing, which not only introduces additional steps but may also lead to data loss or formatting errors. More seriously, issues such as third-party plugin dependency conflicts and runtime environment differences between different versions cause frequent interruptions in multi-version scenarios, forcing enterprises to maintain independent systems for each version and significantly increasing development and maintenance costs.
[0004] To address the aforementioned multi-version compatibility bottlenecks, this 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 (e.g., basic primitive decomposition for the 2016 version and parametric block parsing for the 2021 version), combined with intermediate format conversion and containerized environment isolation technology, cross-version operation commands can be executed compatibly. This solution overcomes the limitations of traditional fixed-version adaptation, ensuring stable operation of automated processes across different AutoCAD versions without manual intervention, providing reliable technical support for the large-scale generation of engineering documents. Summary of the Invention
[0005] The purpose of this invention is to provide an automated document generation system that solves the problems of interruption and low efficiency in automated operation caused by poor compatibility between multiple versions of AutoCAD.
[0006] To achieve the above objectives, the present invention provides the following technical solution: an automated document generation system, comprising:
[0007] The data input parsing module is used to read structured data files and extract project parameters and operation instructions;
[0008] The trigger rule parsing module is connected to the data input parsing module and is used to parse user-defined special symbols based on the operation instructions to construct a multi-level trigger rule tree.
[0009] The 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.
[0010] The 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.
[0011] An atomic operation execution module, connected to the multi-version adaptive engine, is used to execute the operation instructions and generate the final document.
[0012] Preferably, the data input parsing module includes:
[0013] The structured file reading unit is used to parse the item identifiers, template category codes, and operation instruction sets in Excel files;
[0014] The field validity verification unit calculates the validity score S of the input data based on preset rules, satisfying:
[0015]
[0016] Where: Field k : The k-th validation field; M(·): Regular expression matching function; V(·): Checksum verification function; δ k γ: Preset weighting coefficient; when S≥S threshold The system determines data validity in real time; the data cleaning unit is used to filter invalid data (S). threshold And generate standardized intermediate data formats;
[0017] The multi-source data adaptation unit supports extracting dynamic tag symbol sets from multi-source data using regular expressions.
[0018] Preferably, the trigger rule parsing module includes:
[0019] The symbol recognition unit matches user-defined dynamic trigger symbols using the regular expression R = r"{([A-Za-z0-9.]+)} to generate a symbol set.
[0020] The rule tree construction unit converts nested rules in the tag set into a tree structure. in:
[0021] Each node This represents a triggering rule;
[0022] The node hierarchy depth L(v) is defined as the path length from the root node to v; the weight calculation unit is based on the hierarchy depth L(v) and the block complexity C. block (v), calculate the operation weight w(v) according to the formula:
[0023] w(v)=α·L(v)+β·C block (v);
[0024] Where: α, β are preset non-negative coefficients used to adjust the weight ratio of hierarchy depth and block complexity; C block (v) Calculated based on the number and type of block attributes associated with node v.
[0025] Preferably, the dynamic topology mapping engine includes:
[0026] The adjacency matrix generation unit is used to construct an adjacency matrix A = [a...] based on the block operation dependencies in the template document. ij ] m×m ,in:
[0027]
[0028] The weight matrix generation unit is used to parse the operation weights {w1,w2,...,w} output by the triggering rule module. m Construct a diagonal weight matrix W = diag(w1, w2, ..., w m );
[0029] The optimization unit, based on the adjacency matrix A and the weight matrix W, generates an optimized sequence of operation instructions O = [o1, o2, ..., o] by minimizing the objective function C = W·O. m ] T ,in:
[0030] O must satisfy the operation dependency constraint A·O=0;
[0031] C represents the total cost of performing the operation.
[0032] Preferably, the dynamic topology mapping engine is based on a trigger rule tree. Generating the adjacency matrix A and the weight matrix W specifically includes:
[0033] The rule tree node mapping unit will trigger the rule tree. Each node v is mapped to an operation instruction oi ∈O, where:
[0034] The node hierarchy depth L(v) is associated with the priority of the weight coefficient α;
[0035] leaf node set This corresponds to the subset of operations that must be executed last.
[0036] Dependency injection unit, based on node parent-child relationship Define the elements of the adjacency matrix:
[0037]
[0038] Dynamic weight adjustment unit, based on the structural complexity of rule tree Adjust the weight matrix according to the formula:
[0039]
[0040] in: λ represents the topological complexity of the rule tree; λ is a preset complexity factor; I is the identity matrix.
[0041] Preferably, the multi-version adaptive engine includes:
[0042] The AEC object decomposer is used to select the appropriate decompose function based on the AutoCAD file version number.
[0043]
[0044] Where: φ(·), ψ(·) are preset decomposition logic functions; Line, Text, Arc, and Polyline represent basic AutoCAD primitives;
[0045] The DXF format conversion unit is used to perform format conversion logic.
[0046]
[0047] The containerized environment management module is used to load container images that match the version number and isolate third-party plugin conflicts.
[0048] Preferably, the atomization operation execution module includes:
[0049] The conflict detection unit is used to verify the trigger rule tree. Does each node v exist in the vertex set of the topology graph generated by the dynamic topology mapping engine? In the middle, the constraints are satisfied:
[0050] or Make Type(v′) = Type(v);
[0051] Where: Type(v) represents the instruction type identifier of node v;
[0052] Automatic correction unit, when it detects At that time, perform one of the following operations:
[0053] From the template library Search for the preset node v that matches Type(v) default ;
[0054] Generate alternative instructions o alt And update operation sequence O;
[0055] The atomic operation execution unit, based on the modified operation sequence O′, performs block operations according to the topological sorting result, satisfying:
[0056] in: This indicates the logical order constraint for the execution of operations; InsertBlock(·) and ReplaceAttr(·) are preset atomic operation functions.
[0057] Preferably, the system further includes:
[0058] The user interface module is used to receive dynamic rule adjustment commands input by the user and update the trigger rule tree in real time. The structure includes:
[0059] The rule editor unit provides a graphical interface for modifying nodes. The hierarchical relationship or operational weight w(v);
[0060] The real-time conflict warning unit, based on the current adjacency matrix A of the dynamic topology mapping engine, detects whether the user-modified rule tree violates the operation dependency constraint A·O=0, and generates an alarm signal when a conflict occurs.
[0061] In summary, the present invention has at least one of the following beneficial technical effects:
[0062] 1. This invention solves the compatibility problem caused by differences in object structure between different versions of AutoCAD files by using a version-aware decomposition and containerized isolation mechanism based on a multi-version adaptive engine. Based on dynamically switching decomposition functions and intermediate format conversion processes, it ensures seamless execution of operation commands across versions from 2016 to 2021, avoiding efficiency bottlenecks caused by manual adaptation.
[0063] 2. This invention utilizes a matrix-based dependency modeling and weight optimization mechanism based on a dynamic topology mapping engine to parse nested rules into a directed acyclic graph (DAG). It generates an operation sequence by minimizing the execution cost objective function. This approach avoids deadlocks or duplicate operations caused by rule conflicts in traditional sequential execution, significantly improving the reliability of processing highly complex templates.
[0064] 3. This invention allows users to dynamically modify rule levels, weights, or dependencies by triggering multi-level tree structure modeling in the rule parsing module and providing real-time conflict warnings in the user interface module. Combined with real-time verification of topological constraints, it ensures that the operation sequence after rule adjustment still satisfies dependency legality, enhancing system flexibility while reducing manual maintenance costs.
[0065] 4. The data input parsing module of this invention uses a regular expression-driven dynamic tag extraction and validity scoring model to standardize the processing flow of multi-source data. Based on a preset rule base, the automated cleaning and adaptation mechanism reduces parsing interruptions caused by data format errors or missing data, thus improving the robustness of the input data.
[0066] 5. This invention achieves atomic execution of operation instructions and exception rollback by combining conflict detection and automatic correction mechanisms in the atomic operation execution module with transaction isolation and log tracking technologies. This solution avoids document inconsistencies caused by partial operation failures and provides end-to-end traceability through operation logs, meeting the compliance requirements of engineering documents. Attached Figure Description
[0067] Figure 1 This is a schematic diagram of the method flow system of the present invention. Detailed Implementation
[0068] The following is in conjunction with the appendix Figure 1 The present invention will be further described in detail below.
[0069] This invention provides an automated document generation system, comprising:
[0070] The data input parsing module is used to read structured data files and extract project parameters and operation instructions;
[0071] The trigger rule parsing module, connected to the data input parsing module, is used to parse user-defined special symbols based on operation instructions and construct a multi-level trigger rule tree;
[0072] The 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.
[0073] The multi-version adaptive engine connects with the dynamic topology mapping engine to detect the AutoCAD file version and perform AEC object decomposition and format conversion, outputting operation instructions after compatibility processing.
[0074] The atomic operation execution module connects to the multi-version adaptive engine and is used to execute operation instructions and generate the final document.
[0075] The data input parsing module includes:
[0076] The structured file reading unit is used to parse the item identifiers, template category codes, and operation instruction sets in Excel files;
[0077] The field validity verification unit calculates the validity score S of the input data based on preset rules, satisfying:
[0078]
[0079] Where: Field k : The k-th validation field; M(·): Regular expression matching function; V(·): Checksum verification function; δ k γ: Preset weighting coefficient; when S≥S threshold The system determines data validity in real time; the data cleaning unit is used to filter invalid data (S). threshold And generate standardized intermediate data formats;
[0080] The multi-source data adaptation unit supports extracting dynamic tag symbol sets from multi-source data using regular expressions.
[0081] The trigger rule parsing module includes:
[0082] The symbol recognition unit matches user-defined dynamic trigger symbols using the regular expression R = r"{([A-Za-z0-9.]+)} to generate a symbol set. The rule tree building unit transforms nested rules in a tag set into a tree structure. in:
[0083] Each node This represents a triggering rule;
[0084] The node hierarchy depth L(v) is defined as the path length from the root node to v; the weight calculation unit is based on the hierarchy depth L(v) and the block complexity C. block (v), calculate the operation weight w(v) according to the formula:
[0085] w(v)=α·L(v)+β·C block (v);
[0086] Where: α, β are preset non-negative coefficients used to adjust the weight ratio of hierarchy depth and block complexity; C block (v) Calculated based on the number and type of block attributes associated with node v.
[0087] The dynamic topology mapping engine includes:
[0088] The adjacency matrix generation unit is used to construct an adjacency matrix A = [a...] based on the block operation dependencies in the template document. ij ] m×m ,in:
[0089]
[0090] The weight matrix generation unit is used to parse the operation weights {w1,w2,...,w} output by the triggering rule module. m Construct a diagonal weight matrix W = diag(w1, w2, ..., w m );
[0091] The optimization unit, based on the adjacency matrix A and the weight matrix W, generates an optimized sequence of operation instructions O = [o1, o2, ..., o] by minimizing the objective function C = W·O. m ] T ,in:
[0092] O must satisfy the operation dependency constraint A·O=0;
[0093] C represents the total cost of performing the operation.
[0094] The dynamic topology mapping engine is based on a trigger rule tree. Generating the adjacency matrix A and the weight matrix W specifically includes:
[0095] The rule tree node mapping unit will trigger the rule tree. Each node v is mapped to an operation instruction o i ∈O, where:
[0096] The node hierarchy depth L(v) is associated with the priority of the weight coefficient α;
[0097] leaf node set This corresponds to the subset of operations that must be executed last.
[0098] Dependency injection unit, based on node parent-child relationship Define the elements of the adjacency matrix:
[0099]
[0100] Dynamic weight adjustment unit, based on the structural complexity of rule tree Adjust the weight matrix according to the formula:
[0101]
[0102] in: λ represents the topological complexity of the rule tree; λ is a preset complexity factor; I is the identity matrix.
[0103] Multiple versions of the adaptive engine include:
[0104] The AEC object decomposer is used to select the appropriate decompose function based on the AutoCAD file version number.
[0105]
[0106] Where: φ(·), ψ(·) are preset decomposition logic functions; Line, Text, Arc, and Polyline represent basic AutoCAD primitives;
[0107] The DXF format conversion unit is used to perform format conversion logic.
[0108]
[0109] The containerized environment management module is used to load container images that match the version number and isolate third-party plugin conflicts.
[0110] The atomic operation execution module includes:
[0111] The conflict detection unit is used to verify the trigger rule tree. Does each node v exist in the vertex set of the topology graph generated by the dynamic topology mapping engine? In the middle, the constraints are satisfied:
[0112] or Make Type(v′) = Type(v);
[0113] Where: Type(v) represents the instruction type identifier of node v;
[0114] Automatic correction unit, when it detects At that time, perform one of the following operations:
[0115] From the template library Search for the preset node v that matches Type(v) default ;
[0116] Generate alternative instructions o alt And update operation sequence O;
[0117] The atomic operation execution unit, based on the modified operation sequence O′, performs block operations according to the topological sorting result, satisfying:
[0118] in: This indicates the logical order constraint for the execution of operations; InsertBlock(·) and ReplaceAttr(·) are preset atomic operation functions.
[0119] The system also includes:
[0120] The user interface module is used to receive dynamic rule adjustment commands input by the user and update the trigger rule tree in real time. The structure includes:
[0121] The rule editor unit provides a graphical interface for modifying nodes. The hierarchical relationship or operational weight w(v);
[0122] The real-time conflict warning unit, based on the current adjacency matrix A of the dynamic topology mapping engine, detects whether the user-modified rule tree violates the operation dependency constraint A·O=0, and generates an alarm signal when a conflict occurs.
[0123] 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. The module ensures the integrity of the input data and the parsability of the rules through multi-layered validation and dynamic adaptation mechanisms, providing reliable input for the subsequent construction of the trigger rule tree.
[0124] Specifically, the data input parsing module includes a structured file reading unit, a field validation 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) from the Excel file. The project identifier uniquely identifies 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 set of dynamic marker symbols. The field validation unit performs logical validation on the input data based on preset rules. This validation unit calculates the validity score S of the input data using a regular expression matching function M(·) and a checksum validation function V(·), the mathematical expression of which is:
[0125]
[0126] Among them, Field k This represents the k-th field to be validated (such as Project_ID, Template_Code, etc.), M(Field) kReturns the matching result of this field with the preset regular expression rule (1 for a successful match, 0 for a failure). V(Code) verifies whether the template category code has a valid mapping in the pre-stored template library. Parameter δ k γ is a preset weighting coefficient used to adjust the influence of each field on the total score. If and only if S ≥ S threshold When the input data is valid, it is determined that the input data is valid.
[0127] The data cleaning unit is used to process invalid data (S threshold It achieves standardization in the following ways:
[0128] Fill missing values with null values or replace them with default values;
[0129] Perform type casting or truncation on malformed fields;
[0130] Generate an intermediate data file containing cleaning logs, preferably in JSON or XML format.
[0131] The multi-source data adaptation unit extracts marker symbols from multi-source data using dynamic regular expressions. Specifically, the regular expression R = r"{([A-Za-z0-9 . ]+)}”, where:
[0132] The delimiter {} is used to identify the boundaries of dynamic marker symbols;
[0133] The internal matching rule [A-Za-z0-9_.]+ supports combinations of letters, numbers, underscores, and periods to accommodate nested tags (such as {BlockA.{Row2}});
[0134] Extracted tag set It is passed to the trigger rule parsing module as the input basis for building the rule tree.
[0135] Preferably, the regular expression design adopts a non-greedy matching mode to avoid parsing conflicts of multi-level nested symbols.
[0136] For example, given the input {TableA.{Column1.{SubItem}}}, the expression can be parsed layer by layer as TableA→Column1→SubItem, ensuring the integrity of the nesting hierarchy.
[0137] In addition, the multi-source data adaptation unit supports the conversion and processing of unstructured data (such as CSV and text files). Through a preset delimiter recognition and field mapping table, heterogeneous data is uniformly converted into a standard key-value pair format and then merged with structured data before output.
[0138] 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 allocation mechanisms, it provides a computable dependency model for the dynamic topology mapping engine. The module achieves accurate mapping from dynamic rules to operation sequences through symbol recognition, tree structure construction, and operation weight quantization.
[0139] 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 . "]+)}" extracts a set of dynamic trigger symbols from the operation instructions. The regular expression uses {} as the delimiter to match nested symbols containing letters, numbers, underscores, and periods, such as {BlockA.Attr1} or {TableB.{Row2}}}. The periods are used to indicate hierarchical relationships between 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. Nested relationships generate tree structures Each node This represents a triggering rule, where the parent-child relationship between nodes corresponds to the nesting level of symbols. The root node of the tree structure is the outermost symbol (e.g., {TableA}), and the child nodes are the innermost nested symbols (e.g., {TableA.Column1}). The node level depth L(v) is defined as the path length from the root node to that node; for example, if the root node L(v) = 0, its direct child nodes L(v) = 1, and so on. The tree structure is preferably stored in the form of an adjacency list, where 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:
[0140] w(v)=α·L(v)+β·C block (v);
[0141] Here, α and β are preset non-negative coefficients used to adjust the weight ratio between hierarchy depth and block complexity. Block complexity C block (v) Calculated based on the number and type of block attributes associated with node v, specifically including:
[0142] Attribute quantity dimension: The total number of block attributes associated with a node. For example, a block with 5 attributes (such as length, color, line type, etc.) is more complex than a block with only 2 attributes.
[0143] Attribute type dimension: Distinguish the influence weight of attribute types; for example, geometric attributes (such as coordinates and angles) contribute more to complexity than text attributes (such as tags). Preferably, the block complexity calculation function can be configured as follows:
[0144]
[0145] Where, N k ω represents the number of attributes in the k-th class. k These are preset weighting coefficients for the corresponding type. For example, the geometric attribute weight ω. geo =0.6, text attribute weight ω text =0.3, other attribute weights ω other =0.1.
[0146] The trigger rule parsing module further collaborates with the dynamic topology mapping engine to map the nodes of the rule tree into operation commands. i ∈O, and operation dependencies are defined through node parent-child relationships. For example, if node v p It is v c If the parent node is a, then set a in the adjacency matrix. ij =1 indicates operation o i Need to be in o j Execution is performed beforehand. Furthermore, the module considers the structural complexity of the rule tree. The weight matrix is dynamically adjusted, where deg(v) represents the number of child nodes of a node. This complexity metric is used to adjust the fault tolerance priority of the operation sequence, ensuring the execution stability of complex nested rules.
[0147] In this embodiment, the module achieves accurate parsing of dynamic rules through the following technical means:
[0148] Symbol hierarchical parsing: Utilizing regular expressions and dot separators, it supports the automatic recognition of multi-level nested symbols;
[0149] Tree-based dependency modeling: Mapping the nested relationships of symbols into a tree structure to clarify the sequential dependencies of operation instructions;
[0150] Weighted quantization model: Combining hierarchical depth and block complexity, it quantifies operation priority and provides computable parameters for topology optimization.
[0151] It should be noted that the regular expression, weight coefficients α and β, and complexity calculation rules can be dynamically adjusted through configuration files to adapt to the needs of different application scenarios, but their specific values do not constitute a limitation on this invention. The module's output (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.
[0152] In this embodiment, the dynamic topology mapping engine models the operation dependencies of the template document as a directed acyclic graph (DAG) and generates an optimized block operation instruction sequence through matrix operations. The engine achieves topological sorting and execution cost optimization of operation instructions through adjacency mapping, weight quantization, and constraint solving mechanisms, ensuring the efficiency and consistency of multi-version document generation.
[0153] 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...] based on the dependencies of block operations in the template document. ij ] m×m , where matrix element a ij The definition of is:
[0154]
[0155] Dependency determination is based on the trigger rule tree. The parent-child relationship of nodes. If node v p It is v c If the parent node is the node, then its corresponding operation o i with o j Establish dependency constraints between them (i.e., a) ij =1). The weight matrix generation unit parses the set of operation weights {w1, w2, ..., w} output by the trigger rule parsing module. m Construct a diagonal weight matrix W = diag(w1, w2, ..., w m ), where the weight value w i The hierarchy depth L(v) of the rule tree node v and the block complexity C block (v) is calculated, and its formula is:
[0156] w(v)=α·L(v)+β·C block (v);
[0157] The construction of the diagonal matrix allows for the independent quantization of the execution priority of each operation instruction and provides weight coefficients for subsequent optimization of the objective function.
[0158] The optimization unit, based on the adjacency matrix A and the weight matrix W, generates an optimization operation sequence O = [o1, o2, ..., o] that satisfies the dependency constraints by minimizing the objective function C = W·O. m ] T The optimization of the objective function must satisfy the linear constraint A·O = 0, which physically means: all dependencies (a ijThe corresponding operation sequence must be strictly followed. Preferably, the solution process adopts a topological sorting algorithm combined with a greedy strategy to preferentially execute high-weight operations to reduce the total execution cost. Further, the dynamic topological 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 of the trigger rule tree T to an operation instruction o i ∈0, where the set of leaf nodes The corresponding operation instructions are marked as a subset that must be executed last. The dynamic weight correction unit adjusts the weight matrix based on the structural complexity of the rule tree The correction formula is as follows:
[0159]
[0160] where 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 influence factor, and I is the identity matrix. This correction mechanism enables the operation instructions corresponding to complex rule trees to obtain higher execution priorities, avoiding execution conflicts caused by overly deep nesting levels.
[0161] 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 its dependency number is k (usually k << m2), sparse storage can reduce the space complexity from O(m2) to O(m + k).
[0162] The output result of the dynamic topological mapping engine is an optimized operation instruction sequence O′, which satisfies the following conditions:
[0163] All operation dependencies are strictly followed;
[0164] High-weight operations are preferentially executed to minimize the total cost;
[0165] Operations corresponding to complex rule trees obtain redundant execution resources through dynamic correction.
[0166] It should be noted that the weight coefficients α, β, the complexity factor λ, and the specific algorithms for matrix operations (such as topological sorting, greedy strategy) can be adjusted through a configuration file or an external interface, 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.
[0167] In this embodiment, the multi-version adaptive engine detects version differences in AutoCAD files and performs compatibility processing. Through version-aware object decomposition and format conversion mechanisms, it ensures that the generated operation instructions are executable in different AutoCAD environments. The engine achieves seamless integration of cross-version document generation by dynamically selecting decomposition logic, isolating version conflicts, and adapting to containerized environments.
[0168] 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 based on the AutoCAD file version number. When a file version of 2016 is detected, the decomposition function φ(·) is called, decomposing the AEC object into a set of basic primitive line segments (Line) and text (Text); when a version of 2021 is detected, the decomposition function ψ(·) is called, decomposing the AEC object into a set of arcs (Arc) and polylines (Polyline). Its mathematical expression is:
[0169]
[0170] The choice of decomposition function is based on the differences in the internal storage structure of AEC objects in different versions of AutoCAD. For example, the 2016 version uses a layer-based primitive organization method, while the 2021 version introduces a parametric block structure, requiring different decomposition strategies to extract editable basic elements.
[0171] The DXF format conversion unit performs a cross-version format conversion process, the steps of which include:
[0172] Convert the original DWG file to intermediate DXF format and strip away the version-specific binary encoding;
[0173] Insert operation instruction markers generated by the dynamic topology mapping engine into the DXF intermediate file;
[0174] The modified DXF file is then repackaged into a DWG file of the target version. The mathematical representation of the conversion process is as follows:
[0175]
[0176] Preferably, the intermediate file of the modified DWG is in ASCII-encoded DXF format, and the insertion position of the operation instructions is located by paragraph marks (such as ENTITIES, BLOCKS) to ensure the integrity of the modified file structure.
[0177] 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 (e.g., 2016 or 2021), it pulls a pre-configured Docker image (e.g., 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:
[0178] Dependency isolation: Pre-install runtime libraries and third-party plugins that match the target version within the container to avoid plugin conflicts in the host environment; Process sandbox: Restrict resource access permissions for processes within the container, allowing only reading and writing of project files in a specified directory;
[0179] Version binding: The container image embeds a version verification script to ensure that the operation command execution engine strictly matches the file version.
[0180] In this embodiment, the multi-version adaptive engine achieves version compatibility through the following technical means:
[0181] Dynamic decomposition strategy: Switch the decomposition function according to the version number to adapt to the differences in object structure between different versions;
[0182] Intermediate format conversion: Taking advantage of the version independence of the DXF format, version-specific encoding is stripped and operation instructions are injected;
[0183] Containerization isolation: Isolate version dependencies through image-based environments to ensure the purity of the environment in which operation instructions are executed.
[0184] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An automated document generation system, characterized by, Comprise: data input analysis module for reading structured data files and extracting project parameters and operation instructions; trigger rule analysis module connected with the data input analysis module, for analyzing user-defined special symbols based on the operation instructions, and constructing a multi-level trigger rule tree; dynamic topology mapping engine connected with the trigger rule analysis module, for modeling template documents as directed acyclic graphs, and generating optimized block operation instruction sequences based on the operation weight of the trigger rule tree through matrix operations; multi-version adaptive engine connected with the dynamic topology mapping engine, for detecting AutoCAD file versions and performing AEC object decomposition and format conversion, and outputting compatibility-processed operation instructions; atomized operation execution module connected with the multi-version adaptive engine, for executing the operation instructions and generating final documents; The dynamic topology mapping engine comprises: An adjacency matrix generating unit is configured to construct an adjacency matrix according to the block operation dependency relationship in the template document wherein: ; The weight matrix generating unit is configured to generate a weight matrix according to the operation weight output by the trigger rule analysis module , construct a diagonal weight matrix ; Optimization solving unit, based on an adjacency matrix and a weight matrix by minimizing an objective function to generate an optimized operation instruction sequence wherein: Operation dependency constraints need to be satisfied ; represents the total cost of operation execution; The multi-version adaptive engine comprises: AEC object decomposer for selecting a corresponding decomposition function according to the AutoCAD file version number: Decomposition operation ; wherein: is a preset decomposition logic function; Line, Text, Arc, Polyline represent AutoCAD basic primitives; DXF format conversion unit for performing format conversion logic: Conversion procedure ; Containerized environment management module for loading container images matching the version number and isolating third-party plug-in conflicts.
2. The automated document generation system of claim 1, wherein, The data input analysis module comprises: Structured file reading unit for parsing project identifiers, template category codes and operation instruction sets in Excel files; Field validity checking unit for calculating the validity score S of the input data based on the preset rules, satisfying: ; Wherein: is the kth check field; M(·) is a regular expression matching function; V(·) is a check code verification function; is a preset weight coefficient; when , the data is determined to be valid; a data cleaning unit is configured to filter invalid data (i.e., data satisfying the condition ) and generate a standardized intermediate data format; Multi-source data adaptation unit supporting the extraction of dynamic marker symbol sets in multi-source data through regular expressions.
3. The automated document generation system of claim 1, wherein, The trigger rule analysis module comprises: Symbol recognition unit, by regular expression Matching user-defined dynamic trigger symbols, generating a set of tokens ; a rule tree construction unit, which converts the nested rules in the tag set into a tree structure wherein: Each node represents a trigger rule; Node hierarchy depth defined as the path length from the root node to ; a weight calculation unit calculates the operation weight based on the hierarchy depth and the block complexity according to the formula : ; wherein: is a preset non-negative coefficient used to adjust the weight proportion of the hierarchy depth and the block complexity; According to the node The associated block attribute number and type calculation.
4. The automated document generation system of claim 1, wherein, The dynamic topology mapping engine is based on a trigger rule tree Generating an adjacency matrix With a weight matrix Specifically comprising: The rule tree node mapping unit will trigger the rule tree. Each node Mapped to operation instructions ,in: Node hierarchy depth Priority associated to weight coefficient Priority associated to weight coefficient Leaf node set corresponding to a subset of operations that must be performed last; Dependency injection unit, according to the node parent-child relationship Defining the adjacency matrix elements: ; a dynamic weight correction unit, based on the complexity of the rule tree adjusts the weight matrix according to a formula: ; wherein: represents the topological complexity of the rule tree; is a pre-set complexity influence factor; is an identity matrix.
5. The automated document generation system of claim 1, wherein, The atomized operation execution module comprises: A conflict detection unit for verifying whether each node in the trigger rule tree exists in the vertex set of the topology graph generated by the dynamic topology mapping engine satisfies the constraint condition : ; wherein: represents a node of the instruction type identifier; an automatic correction unit, when it is detected that one of the following operations: retrieving a preset node matching from a template library ; Generating alternative instructions and updating the sequence of operations ; An atomization operation execution unit executes the blocks of operations based on the modified sequence of operations in topological order, subject to: ; wherein: represents a logical order constraint of operation execution; , is a preset atomic operation function.
6. The automated document generation system of claim 1, wherein, The system further comprises: a user interaction interface module for receiving user inputted dynamic rule adjustment instructions and updating the triggering rule tree in real time a structure comprising: a rule editor unit providing a graphical interface to modify the hierarchy of nodes or the operation weight ; A real-time conflict warning unit, based on the current adjacency matrix of the dynamic topology mapping engine , detects whether the user-modified rule tree violates the operational dependency constraints , and generates a warning signal when a conflict is detected.
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