Underground Pipe Network Engineering Drawing Drawing Method and System Based on Standard Legend Library
Through deep neural networks and field potential flow optimization algorithms, the problems of standardization and collision detection in the drawing of underground pipeline engineering are solved, and efficient and safe pipeline layout optimization and drawing updates are achieved.
Patent Information
- Application Number
- CN202510661020.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-22
AI Technical Summary
The drawing of traditional underground pipeline engineering drawings lacks standardization and intelligence, resulting in inconsistent use of legends, low conversion efficiency between two-dimensional drawings and three-dimensional models, difficult to detect and optimize pipeline collisions, and high design quality and construction difficulty.
A deep neural network is used to retrieve matching legends from the standard legend library, combine pipeline position and connection relationship to generate two-dimensional drawings, and adjust the pipeline layout in three-dimensional space through a field potential flow optimization algorithm, optimize the pipeline position using variable density fluid dynamics equations, and automatically update the two-dimensional drawings to solve collision risks.
The automation and standardization of underground pipeline engineering drawings has been realized, drawing efficiency and quality have been improved, manual intervention has been reduced, the rationality and safety of pipeline layout have been ensured, and design costs and time have been reduced.
Smart Images

Figure CN120197322B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to engineering drawing technology, and particularly to a method and system for drawing underground pipe network engineering drawings based on a standard legend library. Background Art
[0002] Underground pipe network engineering drawings are the basis for engineering design, construction, and maintenance, and their accuracy and standardization directly affect project quality and safety. Traditional underground pipe network engineering drawing is mainly manually completed by professional designers using software such as CAD. Designers need to select appropriate legend symbols according to engineering specifications and actual requirements, determine the spatial positions and connection relationships of pipelines, and perform two-dimensional drawing and three-dimensional model construction. With the expansion of urban scale and the increasing complexity of underground space, traditional underground pipe network engineering drawing methods face many challenges:
[0003] The selection of legends lacks standardization and intelligence. There are differences in the legend symbols used by different design units, resulting in a lack of unified specifications for engineering drawings, increasing the difficulty of construction and maintenance. Designers need to spend a lot of time manually searching for matching legends from a large number of legend libraries, with low efficiency and easy errors, and it is difficult to ensure the consistency and accuracy of legend usage.
[0004] There is a lack of effective automated means for converting between two-dimensional drawings and three-dimensional models. Designers often need to operate two-dimensional and three-dimensional software separately and manually perform data conversion and model construction, increasing the workload and possibly introducing data inconsistency problems. When a two-dimensional design changes, the three-dimensional model needs to be reconstructed, and vice versa, resulting in low design efficiency and difficulty in promptly responding to design change requirements.
[0005] For complex underground pipe network systems, the spatial position relationships between pipelines are complex, and traditional design methods are difficult to effectively detect and solve pipeline collision problems. Especially in the case of limited underground space, pipeline layout optimization mainly relies on designers' experience and repeated attempts, lacking systematic and intelligent optimization means, and it is difficult to find the optimal pipeline layout scheme under multiple constraint conditions, resulting in low design quality, high construction difficulty, and even the need for rework after problems are found during construction, increasing project costs and construction periods. Summary of the Invention
[0006] The embodiments of the present invention provide a method and system for drawing underground pipe network engineering drawings based on a standard legend library, which can solve the problems in the prior art.
[0007] In the first aspect of the embodiments of the present invention,
[0008] A method for drawing underground pipe network engineering drawings based on a standard legend library is provided, including:
[0009] Obtain the initial data of the underground pipe network project, where the initial data includes the spatial position information, connection relationship information, and engineering legend information of the pipelines;
[0010] Use a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library, and generate a 2D engineering drawing by combining the spatial position information and connection relationship information of the pipelines;
[0011] Convert the 2D engineering drawing into a 3D pipeline model, calculate the spatial position relationship between the pipelines. When it is detected that there is a collision risk between the pipelines, use an optimization algorithm based on field potential flow to adjust the pipeline layout. Model the 3D space as a flow potential field, construct a composite pressure field including pipeline spacing, turning radius, and slope constraints; Construct the pipelines as streamlines with rigid and elastic characteristics, optimize the pipelines based on the variable density fluid dynamics equation, and update the streamline positions under the action of the composite pressure field until the pressure gradient converges to achieve the overall optimization of the pipeline layout;
[0012] Automatically update the 2D engineering drawing according to the optimized 3D pipeline model, and output the underground pipe network engineering drawing.
[0013] In an alternative embodiment,
[0014] Using a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library and generating a 2D engineering drawing by combining the spatial position information and connection relationship information of the pipelines includes:
[0015] Based on the legends in the standard legend feature library and the engineering legend information, use the ResNet-50 network to extract the visual features of the legends, and at the same time use the TransE model for semantic feature encoding;
[0016] Construct a visual-semantic interaction attention mechanism, and adaptively fuse the visual features and semantic features in a weighted fusion manner;
[0017] Calculate the legend matching degree based on the fused features, and the optimization objective function is:
[0018] ;
[0019] where J is the overall matching optimization objective; w i is the weight coefficient of the i-th feature dimension; γ is the penalty factor; Fquery i is the i-th dimension feature of the engineering legend to be matched; Flib i is the i-th dimension feature of the legend in the standard legend library; sim() is the similarity calculation function; Fquery is the complete feature vector of the engineering legend to be matched; Flib is the complete feature vector of the legend in the standard legend library; C() is the semantic consistency constraint function;
[0020] Generate an initial 2D engineering drawing based on the matching results and the spatial location information of the pipelines. Optimize the pipeline connection relationships using the minimum spanning tree algorithm, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final 2D engineering drawing.
[0021] In an alternative embodiment,
[0022] Based on the legends in the standard legend feature library and the engineering legend information, use the ResNet-50 network to extract the visual features of the legends, and at the same time use the TransE model for semantic feature encoding, including:
[0023] The input layer of the ResNet-50 network is provided with three convolutional layers of different sizes in parallel for multi-scale feature extraction; input the multi-scale features into the attention-enhanced residual block, and process the residual mapping through the channel attention mechanism and the spatial attention mechanism to obtain enhanced features; pass the enhanced features through detail-preserving connections, and fuse the deep features and the shallow features in an adaptive weighted manner to obtain visual features;
[0024] Use the TransE model to extract semantic features, initialize the features by assigning attribute importance weights to different relationship dimensions; use the attribute importance weights to guide the TransE model to encode the hierarchical attributes of the legend entities, perform weighted combination of the basic embedding and the attribute embedding of the entities to obtain the semantic representation of the entities, introduce semantic consistency constraints, and optimize the semantic features by minimizing the distance between semantically similar legend pairs and maximizing the distance between semantically different legend pairs.
[0025] In an alternative embodiment,
[0026] Optimize the pipeline connection relationships using the minimum spanning tree algorithm, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final 2D engineering drawing, including:
[0027] Optimize the pipeline connection relationships, including calculating the non-Euclidean distance by weighted calculation of the geological complexity obtained by combining the Euclidean distance with geological survey data, the crossing complexity obtained by the number of crossings with existing infrastructure, and the height change penalty obtained by node elevation difference constraints; construct the pipeline connection relationships into an undirected weighted graph, and calculate the edge weights using the non-Euclidean distance; establish a local reconstruction optimization mechanism, determine the reconstruction area by calculating the grid cell congestion index, and optimize the subgraph within the reconstruction area using the simulated annealing algorithm; construct a minimum spanning tree based on the undirected weighted graph and the local reconstruction optimization mechanism;
[0028] Construct a multi-objective loss function including a position loss term, a connection loss term, and a specification loss term to globally optimize the initial two-dimensional engineering drawing. The position loss term is calculated based on the minimum spacing constraint between adjacent legends and the overall space utilization rate; the connection loss term is calculated based on the sum of the edge set weights of the minimum spanning tree and the turning angle size at the connection; the specification loss term consists of the minimum safety distance constraint between pipelines, the pipeline turning angle range constraint, the pipeline elevation conflict constraint, and the legend direction specification constraint, and is calculated by weighting the degree of violation of each constraint.
[0029] Iteratively optimize the multi-objective loss function through the gradient descent method, and introduce the simulated annealing strategy to obtain the final two-dimensional engineering drawing.
[0030] In an alternative embodiment,
[0031] Adopt an optimization algorithm based on field potential flow to adjust the pipeline layout. Model the three-dimensional space as a flow potential field, and construct a composite pressure field including pipeline spacing, turning radius, and slope constraints; construct the pipeline as a streamline with rigid and elastic properties, and optimize the pipeline based on the variable density fluid dynamics equation. Update the streamline position under the action of the composite pressure field until the pressure gradient converges to achieve the overall optimization of the pipeline layout, including:
[0032] Model the three-dimensional space as a flow potential field, use radial basis functions to model the potential field, and construct a composite pressure field through the control point weight coefficients. The composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field;
[0033] Construct the pipeline as a streamline with rigid and elastic properties, and optimize the pipeline based on the variable density fluid dynamics equation. The variable density fluid dynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field through the momentum source term into the calculation;
[0034] Based on the variable density fluid dynamics equation, iteratively update the streamline position under the action of the composite pressure field, calculate the velocity field according to the time step. The velocity field consists of a pressure gradient driving component, a viscous action component, and an elastic effect component. Among them, the pressure gradient term is driven by the composite pressure field, the viscous term is determined by the local viscosity coefficient, and the elastic term reflects the rigid-elastic properties of the pipeline; use the velocity field to update the streamline position, and calculate the satisfaction degree of the pipeline spacing constraint, turning radius constraint, and slope constraint in real time; dynamically adjust the local viscosity coefficient and the composite pressure field strength coefficient based on the constraint satisfaction degree; when the pressure gradient converges and all constraint conditions are met, determine that the optimization is completed and output the final pipeline layout plan.
[0035] In an alternative embodiment,
[0036] Construct the pipeline as a streamline with rigid and elastic characteristics, and optimize the pipeline based on the variable density hydrodynamics equation. The variable density hydrodynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term, including:
[0037] Model the pipeline as a streamline, map the local stiffness of the pipeline to the fluid density field through a density function, where the density function is determined by the local stiffness distribution of the pipeline, and characterize the elastic characteristics of the pipeline through an elastic restoring force term, where the elastic restoring force term is jointly determined by the local elastic coefficient and the initial pipeline configuration;
[0038] Establish a variable density hydrodynamics equation, which includes a continuity equation and a momentum equation. The continuity equation describes the change of the density field over time, and the momentum equation includes a pressure gradient term, a viscous stress term, an elastic restoring force term, and a momentum source term. The momentum source term consists of a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field that calculate the constraint intensity value at the local position of the pipeline.
[0039] In an alternative embodiment,
[0040] Automatically update the 2D engineering drawing according to the optimized 3D pipeline model, and the output of the underground pipe network engineering drawing includes:
[0041] By comparing the 3D pipeline models before and after optimization, calculate the Euclidean distance of the spatial point set and the edit distance of the topological structure to determine the area that needs to be updated in the 2D drawing; construct a 3D to 2D projection mapping relationship and perform local projection conversion on the determined updated area;
[0042] Automatically generate a multi-view expression, including: automatically dividing the view area according to engineering specifications, automatically adjusting the viewing angle and scale for complex intersection areas; applying legend replacements that maintain semantic consistency for different pipeline types; generating a combined expression including a plan view, a sectional view, and a detail drawing;
[0043] Implement intelligent annotation and legend optimization. Based on the drawing density heat map analysis, calculate the information density of each area, separate the annotations and rearrange the legends for high-density areas, and use a hierarchical layout algorithm to avoid annotation overlap;
[0044] Apply graphic syntax checking to perform a normative check on the updated 2D drawing according to engineering drawing specifications, including line types, annotations, scales, and layer settings, automatically correct non-compliant expressions, and generate the final output of the underground pipe network engineering drawing.
[0045] In the second aspect of the embodiments of the present invention,
[0046] Provide an underground pipe network engineering drawing drawing system based on a standard legend library, including:
[0047] A first unit for obtaining initial data of an underground pipe network project, where the initial data includes spatial position information, connection relationship information, and engineering legend information of pipelines;
[0048] A second unit for using a deep neural network to retrieve the standard legend with the highest matching degree from a standard legend feature library, and generating a two-dimensional engineering drawing by combining the spatial position information and connection relationship information of pipelines;
[0049] A third unit for converting the two-dimensional engineering drawing into a three-dimensional pipeline model, calculating the spatial position relationship between pipelines, and when detecting a collision risk between pipelines, using an optimization algorithm based on field potential flow to adjust the pipeline layout, modeling the three-dimensional space as a flow potential field, constructing a composite pressure field including pipeline spacing, turning radius, and slope constraints; constructing pipelines as streamlines with rigid and elastic characteristics, optimizing the pipelines based on the variable density fluid dynamics equation, and updating the streamline positions under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of the pipeline layout;
[0050] A fourth unit for automatically updating the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model and outputting the underground pipe network engineering drawing.
[0051] In the third aspect of the embodiments of the present invention,
[0052] Provided is an electronic device, including:
[0053] A processor;
[0054] A memory for storing instructions executable by the processor;
[0055] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0056] In the fourth aspect of the embodiments of the present invention,
[0057] Provided is a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method described above is implemented.
[0058] The present invention retrieves the standard legend with the highest matching degree from the standard legend feature library through a deep neural network, and generates an engineering drawing by combining pipeline spatial position and connection relationship information, realizing the automation and standardization of the drawing of underground pipe network engineering drawings, and improving the drawing efficiency and quality of the drawings.
[0059] The present invention uses an optimized algorithm based on field potential flow to adjust the pipeline layout. It models the three-dimensional space as a flow potential field, constructs a composite pressure field, and constructs the pipeline as a streamline with rigid and elastic characteristics. Optimization is carried out based on the variable density fluid dynamics equation, effectively solving the collision risk problem in the layout of complex underground pipe networks and ensuring the rationality and safety of the pipeline layout.
[0060] The present invention automatically updates the two-dimensional engineering drawings according to the optimized three-dimensional pipeline model, realizing the collaborative optimization of the two-dimensional drawings and the three-dimensional model, significantly saving the engineering design time, reducing the design cost, and at the same time improving the design quality and construction feasibility of the underground pipe network project, providing an effective technical means for intelligent pipe network planning. Brief Description of the Drawings
[0061] Figure 1 It is a schematic flow chart of the method for drawing underground pipe network engineering drawings based on a standard legend library in an embodiment of the present invention;
[0062] Figure 2 It is a comparison chart before and after pipeline optimization. Detailed Description of the Embodiment
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0064] The technical solutions of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0065] Figure 1 It is a schematic flow chart of the method for drawing underground pipe network engineering drawings based on a standard legend library in an embodiment of the present invention, as Figure 1 shown, the method includes:
[0066] Obtain the initial data of the underground pipe network project, where the initial data includes the spatial position information, connection relationship information, and engineering legend information of the pipeline;
[0067] Use a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library, and generate two-dimensional engineering drawings in combination with the spatial position information and connection relationship information of the pipeline;
[0068] Convert the 2D engineering drawing into a 3D pipeline model, calculate the spatial position relationship between pipelines. When a collision risk is detected between pipelines, an optimization algorithm based on field potential flow is used to adjust the pipeline layout. Model the 3D space as a flow potential field, and construct a composite pressure field including pipeline spacing, turning radius, and slope constraints. Construct the pipelines as streamlines with rigid and elastic characteristics, optimize the pipelines based on the variable density fluid dynamics equation, and update the streamline positions under the action of the composite pressure field until the pressure gradient converges to achieve the overall optimization of the pipeline layout.
[0069] Automatically update the 2D engineering drawing according to the optimized 3D pipeline model, and output the underground pipe network engineering drawing.
[0070] In an alternative embodiment, using a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library, and generating a 2D engineering drawing in combination with the spatial position information and connection relationship information of the pipelines includes:
[0071] Based on the legends in the standard legend feature library and the engineering legend information, use the ResNet-50 network to extract the visual features of the legends, and at the same time use the TransE model for semantic feature encoding.
[0072] Construct a visual-semantic interaction attention mechanism, and adaptively fuse the visual features and semantic features in a weighted fusion manner.
[0073] Calculate the legend matching degree based on the fused features, and the optimization objective function is:
[0074] ;
[0075] where J is the overall matching optimization objective; w i is the weight coefficient of the i-th feature dimension; γ is the penalty factor; Fquery i is the i-th dimension feature of the engineering legend to be matched; Flib i is the i-th dimension feature of the legend in the standard legend library; sim() is the similarity calculation function; Fquery is the complete feature vector of the engineering legend to be matched; Flib is the complete feature vector of the legend in the standard legend library; C() is the semantic consistency constraint function.
[0076] Generate an initial 2D engineering drawing according to the matching result and the spatial position information of the pipelines, optimize the pipeline connection relationship using the minimum spanning tree algorithm, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final 2D engineering drawing.
[0077] Exemplarily, based on the legends and engineering legend information in the standard legend feature library, the ResNet-50 network structure is used to extract visual features, and the TransE model is used for semantic feature encoding. The standard legend library can be selected from the standard pipeline legend library in AutoCAD Civil 3D or Revit MEP or the legends in industry general specifications.
[0078] The vision-semantic interaction attention mechanism realizes the adaptive fusion of features by calculating the attention weights between visual features and semantic features. First, the similarity matrix of the visual feature matrix V and the semantic feature matrix S is calculated : where d is the feature dimension, and T represents the transpose operation of the matrix. Subsequently, the final feature representation is obtained through weighted fusion: F = αV + βA·S, where α and β are the weight coefficients of visual features and semantic features respectively, and are automatically learned by the network. In practical applications, α is usually initialized to 0.6, β is initialized to 0.4, and is dynamically adjusted during the training process.
[0079] Based on the fused features, the legend matching degree is calculated to optimize the overall matching objective. The matching process considers the weight differences of feature dimensions and introduces semantic consistency constraints. In actual implementation, for the feature vector Fquery of the engineering legend to be matched and the feature vector Flib of the legend in the standard legend library, the similarity calculation function adopts a combination form of cosine similarity and Euclidean distance. First, the cosine similarity between feature vectors is calculated, which is obtained by dividing the inner product of vectors by the product of vector norms; at the same time, the Euclidean distance between feature vectors is calculated and converted into a similarity form. The final similarity score is obtained through weighted combination, where the weight coefficient of cosine similarity is usually taken as 0.6, and the weight coefficient of Euclidean distance similarity is correspondingly taken as 0.4. The feature dimension weight w i is automatically learned through training data, and the typical values are distributed between 0.01 and 0.15. The penalty factor γ is set to 0.2 to balance the similarity calculation and the constraint term.
[0080] The semantic consistency constraint is constructed from three levels: attribute, function, and relationship. Attribute consistency is achieved by calculating the KL divergence of semantic features. When the divergence is less than the preset threshold of 0.35, it is considered semantically consistent; functional semantics calculates the longest common subsequence similarity based on ontology; relationship consistency is measured by the normalized graph edit distance. The three types of constraints are combined by weights, and the constraint intensity coefficient is set to 0.2.
[0081] The matching process adopts the Top-K strategy to retrieve the top K results with the highest matching degree from the standard legend library, and the value of K is usually set to 5. Taking the "ball valve" legend as an example, after inputting the engineering legend, the system retrieves five standard legends with matching degrees of 0.92, 0.87, 0.85, 0.83, and 0.79 respectively, and selects the standard "ball valve" legend corresponding to the highest matching degree of 0.92 as the final matching result.
[0082] Generate the initial 2D engineering drawing according to the matching result and the spatial position information of the pipeline. The spatial position information includes the coordinates of the center point of the legend, the orientation angle, the scaling ratio, etc. For example, the position coordinates of the check valve in a certain pipeline system are (120, 85), the orientation angle is 45 degrees, and the scaling ratio is 1.2. Transform the matching standard legend according to these parameters and place it at the corresponding position to form the initial 2D engineering drawing. For the pipeline connection relationship among them, use the minimum spanning tree algorithm for optimization, and then perform overall optimization through the multi-objective loss function.
[0083] The present invention extracts visual features through a deep learning network and combines with the TransE model for semantic encoding, realizing the effective fusion of visual and semantic information; introducing an attention mechanism to achieve adaptive integration of features, and adopting a multi-dimensional similarity calculation mechanism and semantic consistency constraint to ensure the matching accuracy from three levels of attributes, functions, and relationships; improving the recognition accuracy of engineering legends, reducing manual intervention, and accelerating the drawing update efficiency, especially having significant advantages in dealing with complex pipeline systems and non-standard legends, providing reliable technical support for intelligent engineering drawing generation.
[0084] In an alternative embodiment, based on the legends and the engineering legend information in the standard legend feature library, using the ResNet-50 network to extract the visual features of the legend, and at the same time using the TransE model for semantic feature encoding includes:
[0085] The input layer of the ResNet-50 network sets three parallel convolutional layers with different sizes for multi-scale feature extraction; input the multi-scale features into the attention-enhanced residual block, and process the residual mapping through the channel attention mechanism and the spatial attention mechanism to obtain enhanced features; pass the enhanced features through the detail-preserving connection, and fuse the deep features and the shallow features in an adaptive weighted manner to obtain visual features;
[0086] The TransE model is used to extract semantic features, and the feature initialization is carried out by assigning attribute importance weights to different relationship dimensions; the attribute importance weights are used to guide the TransE model to encode the hierarchical attributes of the legend entities, and the semantic representation of the entities is obtained by weighted combination of the basic embedding and the attribute embedding of the entities. A semantic consistency constraint is introduced, and the semantic features are optimized by minimizing the distance between semantically similar legend pairs and maximizing the distance between semantically different legend pairs.
[0087] Exemplarily, a standard legend feature library is constructed, which contains legend entities in common engineering fields and their attribute information, such as legends like "resistor", "capacitor", "switch" in electrical engineering. Each legend contains attributes such as category, function, shape, etc. The legends are collected from engineering drawings from different sources and stored in the feature library after being standardized. The standardization process includes steps such as uniformly adjusting the size to 224×224 pixels, removing background noise, and enhancing edge features.
[0088] For visual feature extraction, the ResNet-50 network structure is adopted:
[0089] At the input layer, three parallel convolutional layers are set up, and multi-scale feature extraction is carried out using convolutional kernels of different sizes. The first convolutional layer uses a 3×3 convolutional kernel with a stride of 2 to extract local detailed features; the second convolutional layer uses a 5×5 convolutional kernel with a stride of 2 to extract medium-scale features; the third convolutional layer uses a 7×7 convolutional kernel with a stride of 2 to extract large-scale global features. After each convolutional layer, a batch normalization layer and a ReLU activation function are connected.
[0090] After multi-scale feature extraction, the three-scale features are fused through a feature fusion module. The fusion method adopts a concatenation operation in the channel dimension to obtain a fused feature map. The fused feature map goes through a 1×1 convolutional layer for channel dimensionality reduction and is adjusted to the original ResNet-50 input channel number.
[0091] The fused features are input into an attention-enhanced residual block. The attention-enhanced residual block adds a channel attention mechanism and a spatial attention mechanism on the basis of the standard residual block. The channel attention mechanism generates channel descriptors through global average pooling and global max pooling respectively, and after being processed by a shared multi-layer perceptron, they are fused to generate channel weights; the spatial attention mechanism generates a feature map through average pooling and max pooling along the channel dimension, and after concatenation, a spatial weight map is generated through a 7×7 convolutional layer. The result of the residual mapping is first multiplied by the channel weight and then by the spatial weight to obtain enhanced features.
[0092] In the actual implementation, the shared multi-layer perceptron in the channel attention uses two fully-connected layers, the number of intermediate channels is 1 / 16 of the input channels, and the ReLU activation function is used. For example, for a feature map with 256 input channels, the number of channels in the intermediate layer is 16. The 7×7 convolution in the spatial attention outputs a single-channel feature map, followed by a Sigmoid activation function to generate a spatial weight map with a weight value range of 0-1.
[0093] To retain the detailed information of the legend, the present invention introduces a detail-preserving connection. Different from the standard skip connection of ResNet, the detail-preserving connection fuses the deep features and the shallow features through an adaptive weighting method. In the specific implementation, for the feature maps output by conv2_x, conv3_x, conv4_x, and conv5_x of ResNet-50, they are respectively adjusted to the same spatial dimension through adaptive pooling, then the number of channels is adjusted using a 1×1 convolution, and finally weighted summation is performed through the learned weight coefficients. The weight coefficients are adaptively determined based on the global context information, with the initial value set to equal weights and updated during network training. For example, for 4 layers of features, the initial weights are all 0.25.
[0094] For semantic feature extraction, the TransE model is used to extract the semantic features of the legend:
[0095] The attributes of the legend are hierarchically organized, such as basic attributes (shape, color), functional attributes (usage, connection method), and domain attributes (applicable industry, standard type), and importance weights are assigned to different attribute relationship dimensions. The weight of the basic attribute is 0.5, the weight of the functional attribute is 0.3, and the weight of the domain attribute is 0.2.
[0096] In the feature initialization stage, the initial dimensions of the entity vector and the relationship vector of the TransE model are set according to the attribute importance weights. The dimension of the entity vector is 100, and the relationship vector is assigned different dimensions according to the attribute importance weights. The basic attribute relationship is assigned 50 dimensions, the functional attribute is assigned 30 dimensions, and the domain attribute is assigned 20 dimensions.
[0097] The training of the TransE model adopts a triple method, in the form of (legend entity, attribute relationship, attribute value). For example, (resistor, shape, rectangle), (resistor, usage, current limiting), etc. By making the sum of the entity vector and the relationship vector close to the attribute value vector, the semantic representation of the entity is learned.
[0098] To enhance the semantic representation ability, the present invention combines the basic embedding and the attribute embedding of the entity through weighted combination. The weight of the basic embedding is 0.6, and the weight of the attribute embedding is 0.4. The attribute embedding is obtained by aggregating all the attribute value vectors related to the entity, and the attention mechanism is used to assign different importance to different attribute values.
[0099] Meanwhile, semantic consistency constraints are introduced to optimize semantic features. By defining positive sample pairs (semantically similar legends) and negative sample pairs (semantically different legends), the contrastive learning method is used to minimize the distance between positive sample pairs and maximize the distance between negative sample pairs. The positive sample pairs are selected from legends of the same category but with different appearances, and the negative sample pairs are selected from legends of different categories. By setting a boundary value τ (set to 0.5), it is constrained that the distance between positive sample pairs is less than τ and the distance between negative sample pairs is greater than τ.
[0100] The present invention comprehensively captures the visual features of legends through a parallel multi-scale convolution structure, introduces an attention-enhanced residual block to focus on key feature regions, and adopts a detail-preserving connection strategy to effectively fuse shallow and deep layer features. It innovatively applies the TransE model to the encoding of legend semantic features, and through attribute stratification and importance weight assignment, realizes the accurate expression of legend semantic information, improves the accuracy and robustness of engineering legend recognition, especially performs outstandingly when dealing with legends with similar shapes but different semantics, effectively solves the technical problems of inaccurate recognition and low matching degree of traditional methods in complex engineering environments, and provides key technical support for the automatic generation of engineering drawings.
[0101] In an optional implementation manner, the minimum spanning tree algorithm is used to optimize the pipeline connection relationship, and the overall optimization is performed through a multi-objective loss function composed of position loss, connection loss, and specification loss. The output final two-dimensional engineering drawing includes:
[0102] Optimizing the pipeline connection relationship includes calculating the non-Euclidean distance by weighted calculation of the geological complexity obtained from the Euclidean distance combined with geological survey data, the crossing complexity obtained from the number of crossings with existing infrastructure, and the height change penalty obtained from the node elevation difference constraint; constructing the pipeline connection relationship as an undirected weighted graph, and calculating the edge weights using the non-Euclidean distance; establishing a local reconstruction optimization mechanism, determining the reconstruction area by calculating the congestion degree index of grid cells, and optimizing the subgraph within the reconstruction area using the simulated annealing algorithm; constructing a minimum spanning tree based on the undirected weighted graph and the local reconstruction optimization mechanism;
[0103] Constructing a multi-objective loss function including a position loss term, a connection loss term, and a specification loss term to perform overall optimization on the initial two-dimensional engineering drawing. The position loss term is calculated based on the minimum spacing constraint between adjacent legends and the overall space utilization rate; the connection loss term is calculated based on the sum of the edge set weights of the minimum spanning tree and the rotation angle size at the connection; the specification loss term is composed of the minimum safety distance constraint between pipelines, the pipeline rotation angle range constraint, the pipeline elevation conflict constraint, and the legend direction specification constraint, and is obtained by weighted calculation of the violation degree of each constraint;
[0104] Exemplarily, when calculating the non-Euclidean distance, first obtain the Euclidean distance between each pair of nodes, and then combine the geological survey data to divide the area into different geological complexity levels. For example, the geological conditions are divided into 5 levels, with weight coefficients of 1.0, 1.2, 1.5, 1.8, and 2.5 assigned respectively, representing different geological crossing difficulties. In addition, calculate the intersections with existing infrastructure, and add a penalty value for each intersection. For example, a penalty coefficient of 1.5 is assigned for crossing important pipelines, and a penalty coefficient of 1.3 is assigned for crossing roads. For the elevation difference, when the elevation difference between two nodes exceeds a preset threshold (such as 5 meters), a 10% distance penalty is added for each additional meter. Finally, calculate the non-Euclidean distance by weighted combination of these factors, and the weight ratio can be set as 0.4 for geological factors, 0.3 for intersection factors, and 0.3 for elevation factors. Taking a pipe network with 5 nodes as an example, the Euclidean distance from node A to node B is 100 meters, passing through a complex geological area (coefficient 1.8) in the middle, crossing 2 important pipelines (each time increasing the penalty by 1.5 times), and the elevation difference is 8 meters (exceeding the threshold by 3 meters). Then the non-Euclidean distance is calculated as: 100×[0.4×1.8 + 0.3×(1 + 2×0.5) + 0.3×(1 + 3×0.1)] = 100×[0.72 + 0.6 + 0.39] = 171 meters.
[0105] When constructing the pipeline connection relationship into an undirected weighted graph, each station or device serves as a node of the graph, the possible connection relationships between nodes serve as edges, and the weight of the edge is the calculated non-Euclidean distance. In practical applications, an adjacency matrix can be constructed to store these connection relationships and their weights.
[0106] When constructing the local reconstruction optimization mechanism, divide the entire area into grid cells, calculate the congestion index within each cell, and the congestion calculation method is the weighted sum of the pipeline density and the number of intersection points within the cell. For example, in a 100m×100m grid cell, 8 pipelines pass through and form 5 intersection points, then the congestion is 8×0.6 + 5×0.4 = 6.8. When the congestion exceeds a preset threshold (such as 6.0), mark this area as the area to be reconstructed. Apply the simulated annealing algorithm to optimize the marked reconstruction area, set the initial temperature to 100, the temperature decay coefficient to 0.95, and the termination temperature to 0.1. Each iteration generates a new solution by randomly adjusting the pipeline directions within the area, and the acceptance probability is calculated based on the energy change and the current temperature. For example, if a certain adjustment reduces the congestion from 6.8 to 6.2 and the energy change is -0.6, then this adjustment must be accepted; if the adjustment increases the congestion by 0.3, then this non-optimal adjustment is accepted with a certain probability, and the probability value decreases as the temperature decreases.
[0107] Construct a minimum spanning tree based on the above-mentioned undirected weighted graph and local reconstruction optimization mechanism, which is implemented using the Kruskal algorithm. Sort all edges by weight and then add edges one by one to avoid forming loops. For example, for a pipe network system with 10 nodes, the finally generated minimum spanning tree contains 9 edges, and the total weight is the minimum possible value.
[0108] Construct a multi-objective loss function to globally optimize the initial two-dimensional engineering drawing:
[0109] The position loss term is calculated based on the minimum spacing constraint between adjacent legends and the overall space utilization rate. For different types of legends, a minimum safety spacing is specified. For example, the distance between valves should be no less than 0.5 meters, and the distance between a valve and an elbow should be no less than 0.8 meters. The space utilization rate is calculated by the ratio of the area occupied by the legend to the available area, and the ideal value is set to 0.6 - 0.7. Penalties are increased if it is lower or higher than this range. The position loss value is calculated by a weighted combination of the two factors, and the weight ratio can be set as 0.6 for the spacing constraint and 0.4 for the space utilization rate.
[0110] The connection loss term is calculated based on the sum of the edge set weights of the minimum spanning tree and the turning angle at the connection. The turning angle penalty rule is: no penalty is imposed when the turning angle is less than 30 degrees or greater than 150 degrees; the penalty coefficient is 0.2 when the turning angle is in the range of 30 - 60 degrees or 120 - 150 degrees; the penalty coefficient is 0.5 when the turning angle is in the range of 60 - 120 degrees. For example, if the turning angle of a connection is 75 degrees, a penalty coefficient of 0.5 is imposed. The connection loss is calculated by multiplying the cumulative value of the turning angle penalty factor by the sum of the edge set weights.
[0111] The specification loss term consists of multiple constraints: the minimum safety distance constraint between pipelines (the parallel pipeline spacing should be no less than 1.5 times the sum of the pipe diameters); the pipeline turning angle range constraint (the turning angle should be between 30 - 150 degrees); the pipeline elevation conflict constraint (the vertical spacing of intersecting pipelines should be no less than 300 mm); the legend direction specification constraint (the direction of specific legends such as valves should conform to industry standards). The specification loss value is obtained by accumulating the violations of the constraints, and the weight ratio of each constraint can be set as 0.3, 0.2, 0.3, 0.2.
[0112] For the constructed multi-objective loss function, the gradient descent method is used for optimization. Set the learning rate to 0.01, the maximum number of iterations to 1000 times, and the convergence condition to that the loss change is less than 0.001 for 10 consecutive iterations. At the same time, introduce the simulated annealing strategy, with the initial temperature of 50 and the temperature decay coefficient of 0.98, to probabilistically accept suboptimal solutions to avoid falling into local optima.
[0113] By innovatively introducing non-Euclidean distance metrics, the present invention incorporates actual engineering factors such as geological complexity, intersection complexity, and elevation difference into distance calculations, constructing a pipeline connection relationship model that better conforms to engineering practice. Combining a local reconstruction optimization mechanism and a minimum spanning tree algorithm, it can effectively solve the pipeline layout problem in congested areas. An innovative multi-objective loss function is proposed to comprehensively evaluate the drawing quality from three dimensions: position, connection, and specification, achieving a comprehensive optimization of the pipeline layout, improving the engineering feasibility and standardization of the generated drawings, reducing pipeline intersection conflicts, and optimizing the spatial utilization efficiency.
[0114] In an alternative embodiment, an optimization algorithm based on field potential flow is used to adjust the pipeline layout. The three-dimensional space is modeled as a flow potential field, and a composite pressure field including pipeline spacing, turning radius, and slope constraints is constructed. The pipeline is constructed as a streamline with rigid and elastic properties, and the pipeline is optimized based on the variable density hydrodynamics equation. The position of the streamline is updated under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of the pipeline layout, including:
[0115] The three-dimensional space is modeled as a flow potential field, the potential field is modeled using radial basis functions, and a composite pressure field is constructed by controlling the weight coefficients. The composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field;
[0116] The pipeline is constructed as a streamline with rigid and elastic properties, and the pipeline is optimized based on the variable density hydrodynamics equation. The variable density hydrodynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term;
[0117] Based on the variable density hydrodynamics equation, the position of the streamline is iteratively updated under the action of the composite pressure field. The velocity field is calculated according to the time step. The velocity field consists of a pressure gradient driving component, a viscous action component, and an elastic effect component. Among them, the pressure gradient term is driven by the composite pressure field, the viscous term is determined by the local viscosity coefficient, and the elastic term reflects the rigid-elastic properties of the pipeline. The position of the streamline is updated using the velocity field, and the satisfaction degrees of the pipeline spacing constraint, the turning radius constraint, and the slope constraint are calculated in real time. The local viscosity coefficient and the composite pressure field strength coefficient are dynamically adjusted based on the constraint satisfaction degree. When the pressure gradient converges and all constraint conditions are met, it is determined that the optimization is completed and the final pipeline layout scheme is output.
[0118] Exemplarily, extract the planar coordinates (x, y), elevation, and pipe diameter information of pipelines in a 2D drawing; calculate the z coordinate using the elevation of the start and end points of the pipeline and the relative elevation; construct the pipeline centerline using cubic B-spline interpolation; generate a 3D pipe model along the centerline based on the pipe diameter parameter. For collision detection, use the spatial octree partitioning technique to recursively divide the 3D space into sub-spaces; quickly screen potential collision areas based on the pipeline bounding box; use precise distance calculation in the candidate areas, and when the surface distance between two pipelines is less than the safety threshold (usually 10 - 30 cm), mark it as a collision risk point.
[0119] Model the 3D space as a flow potential field, and use radial basis functions to model the potential field. Specifically, set multiple control points in the space, and each control point has a weight coefficient. The radial basis function can be selected as the Gaussian function, and its expression is the negative exponential function of the distance between the control point and any point in the space, and the function value decreases as the distance increases. For example, for a point (x, y, z) in the space and a control point (x i , y i , z i ), its radial distance is the Euclidean distance between the two points. In practical applications, 100 control points can be set and distributed in the pipeline layout space, and a composite pressure field can be constructed by adjusting the weight coefficient of each control point.
[0120] The composite pressure field consists of three parts: pipeline spacing pressure field, turning radius pressure field, and slope pressure field. For the pipeline spacing pressure field, when the distance between two pipelines is less than the safety distance (such as 150 mm), a repulsive force field is generated at the midpoint position between the two pipelines; when the distance is greater than the safety distance, the repulsive force is zero. For example, in practical applications, when the distance between two pipelines is 100 mm, the pressure field intensity can be set to 1.0; when the distance is 130 mm, the pressure field intensity drops to 0.4; when the distance reaches 150 mm, the pressure field intensity is 0. The turning radius pressure field is calculated based on the local curvature of the pipeline. When the curvature is greater than the maximum allowable value (such as the curvature radius is less than 200 mm), a tensile force field is generated at the center of curvature to make the pipeline tend to be straight. For the slope pressure field, when the pipeline slope exceeds the maximum allowable value (such as 10%), a pressure field that makes the pipeline tend to be horizontal is generated in the excess part.
[0121] Construct the pipeline as a streamline with rigid and elastic characteristics, and optimize the pipeline based on the variable density fluid dynamics equation. The fluid dynamics equation ensures mass conservation through the continuity equation and describes the fluid motion characteristics through the momentum equation. In this algorithm, the optimization process of the pipeline streamline is controlled by the momentum equation, which includes a pressure gradient driving term, a viscous action term, and an elastic effect term. The momentum source term is used to incorporate the local constraint intensity of the composite pressure field into the calculation.
[0122] The process of iteratively updating the streamline position is as follows: Calculate the velocity field according to the time step. In the velocity field, the pressure gradient driving component is determined by the negative gradient direction of the composite pressure field; the viscous action component is proportional to the local velocity gradient and is determined by the local viscosity coefficient; the elastic effect component reflects the rigid-elastic characteristics of the pipeline, and a restoring force is generated when the pipeline is compressed or stretched. In practical applications, the time step can be set to 0.01 seconds, and the local viscosity coefficient is initially set to 0.8 and adjusted dynamically during the optimization process. Update the streamline position using the calculated velocity field and calculate the degree of constraint satisfaction in real time. For example, if it is found during the optimization process that the curvature radius of a certain section of the pipeline is 150 mm, which is less than the required 200 mm, then increase the intensity coefficient of the turning radius pressure field in this area from the initial value of 1.0 to 1.5; if it is found that the distance between two pipelines is 120 mm, close to but still less than the safety distance of 150 mm, then adjust the intensity coefficient of the pipeline spacing pressure field in the corresponding area from 1.0 to 1.2. At the same time, based on the degree of constraint satisfaction, dynamically adjust the local viscosity coefficient and the intensity coefficient of the composite pressure field. For example, a lower viscosity coefficient (such as 0.5) can be set at the initial stage of optimization to quickly adjust the layout. As the constraint conditions are gradually met, increase the viscosity coefficient (such as to 1.2) to improve the convergence stability. When the maximum constraint violation degree exceeds the threshold (such as 30%), increase the corresponding pressure field intensity coefficient by 20%; when the constraints are basically met (such as the violation degree is less than 5%), gradually reduce the intensity coefficient by 10% to avoid over-optimization. Finally, when the pressure gradient converges and all constraint conditions are met, it is determined that the optimization is completed and the final pipeline layout plan is output. The convergence judgment criterion is: within 5 consecutive iteration steps, the maximum displacement of the pipeline position is less than 1 mm, and the violation degree of all constraint conditions is less than the set threshold (such as 3%).
[0123] Figure 2 This is a comparison diagram of the pipeline before and after optimization. As shown in the figure, the 3D view comparison: Before optimization: There are multiple problems with three different pipelines (red, blue, and green) in three-dimensional space: two obvious pipeline collision points, not meeting the safety spacing requirements; there is an area with too small a turning radius in the blue pipeline, below the engineering specification requirements; there is a problem with too steep a slope at the end of the green pipeline, exceeding the allowable slope range. After optimization: After being optimized and adjusted by the field potential flow algorithm: The three pipelines are reasonably distributed in space and maintain a safe distance from each other; the turning radii of the pipelines all meet the engineering specification requirements, and the curvature is more gentle; the slope problem is corrected to ensure the construction feasibility of the pipeline layout.
[0124] Plan view comparison (top view): Before optimization: From the top view, it can be seen that there are intersections and overlaps in the plane projection of the pipelines, especially at the two red marked positions, there is a risk of collision. After optimization: The plane layout of the pipelines is optimized, and through reasonable spatial redistribution, the safety distance between the pipelines is ensured, and intersections and collisions are avoided.
[0125] Cross-section comparison (side view): Before optimization: The side view clearly shows the problems of the pipeline in the vertical direction: there is a problem of too small turning radius in the middle area; there is an area with too steep slope on the right side. After optimization: The layout in the vertical direction is optimized: the pipeline turns more gently, meeting the minimum turning radius requirement; the slope is corrected to keep the inclination angle of all pipelines within the safe range.
[0126] Through the field potential flow optimization algorithm, the system regards the pipeline as a streamline in the flow potential field, and uses the composite pressure field to drive the pipeline to automatically adjust its position until all constraint conditions (safe distance, turning radius, slope limit) are met, realizing the overall optimization of the pipeline layout. This method does not require manual solution of collision problems one by one, but realizes the global optimal layout through the natural evolution of the physical field.
[0127] The present invention models the three-dimensional space as a flow potential field, constructs a composite pressure field including pipeline spacing, turning radius and slope constraints through radial basis functions, abstracts the pipeline as a streamline with rigid and elastic characteristics, and realizes layout optimization based on the variable density fluid dynamics equation. It cleverly uses the principles of fluid mechanics to naturally handle multi-constraint problems, and realizes the self-organization optimization of the pipeline layout through the comprehensive action of pressure gradient drive, viscous action and elastic effect. Compared with traditional methods, this method can better handle the spatial layout conflicts under complex constraints, significantly improving the optimization efficiency and result quality. It is especially suitable for the layout of pipeline systems with high density and multiple constraints, providing a powerful tool for engineering design.
[0128] In an alternative embodiment, the pipeline is constructed as a streamline with rigid and elastic characteristics, and the pipeline is optimized based on the variable density fluid dynamics equation. The variable density fluid dynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term, including:
[0129] The pipeline is modeled as a streamline, and the local stiffness of the pipeline is mapped to the fluid density field through a density function. The density function is determined by the local stiffness distribution of the pipeline, and the elastic characteristics of the pipeline are characterized by an elastic restoring force term. The elastic restoring force term is jointly determined by the local elastic coefficient and the initial pipeline configuration;
[0130] The variable density fluid dynamics equation is established. The variable density fluid dynamics equation includes the continuity equation and the momentum equation. The continuity equation describes the change of the density field with time. The momentum equation includes a pressure gradient term, a viscous stress term, an elastic restoring force term and a momentum source term. The momentum source term is composed of a pipeline spacing pressure field, a turning radius pressure field and a slope pressure field for calculating the constraint intensity value at the local position of the pipeline.
[0131] Exemplarily, the pipeline is discretized into a sequence of spatial nodes, and each node has a spatial position and local stiffness properties. For a pipeline with a length of L, n discrete nodes are set , the spacing between adjacent nodes is L / (n - 1), and the position coordinates of each node are P i (x i , y i , z i ). To reflect the rigid characteristics of different parts of the pipeline, this method assigns a stiffness value si ∈ [0, 1] to each node, and the stiffness value is determined according to the pipe material type, wall thickness, connection method, and usage requirements. For example, for key nodes or regions with higher rigidity, a larger stiffness value (0.7 - 0.9) is assigned; for ordinary regions, a medium stiffness value (0.4 - 0.6) is assigned; for regions with higher flexibility, a smaller stiffness value (0.1 - 0.3) is assigned. A density mapping function is established to convert the stiffness value into a fluid density field: ρ(si) = ρ min + si·(ρ max - ρ min ); where ρ min = 1000 kg / m³ is the base density value, and ρ max = 10000 kg / m³ is the maximum density value. The density field forms a continuous change in spatial distribution, and the density value at any position between nodes can be obtained by linear interpolation between nodes.
[0132] Furthermore, the elastic characteristics of the pipeline are characterized by the elastic restoring force term. The initial configuration of the pipeline is recorded as the reference state, that is, the initial position coordinates of all nodes {P 10 , P 20 , ..., P n0}. Subsequently, a local elastic coefficient ki is assigned to each node, and this coefficient reflects the magnitude of the restoring force generated when the position of the node deviates from the initial position. The elastic coefficient is calculated based on the elastic modulus, cross-sectional area of the pipeline material, and node spacing, and usually ranges between 0.1 N / m and 100 N / m. During the optimization process, when the node P i moves from the initial position P i0 to the current position, the generated elastic restoring force is calculated as:
[0133] ;
[0134] where, is the elastic restoring force vector at node i; is the elastic coefficient at node i, representing the stiffness characteristics of the pipeline; is the initial or equilibrium position coordinates of node i; is the current position coordinate of node i; this elastic restoring force always points to the initial position of the node, and the magnitude of the force is proportional to the displacement. The elastic restoring force term makes the pipeline tend to restore its original shape during deformation, simulating the elastic behavior of real pipelines. The elastic restoring force and the pipeline density field act together. In the subsequent variable density hydrodynamic calculations, the high-density (high stiffness) regions are less affected by the elastic restoring force and remain relatively stable; while the low-density (low stiffness) regions are more likely to deform under the combined action of external forces and the elastic restoring force, thus accurately expressing the rigid-elastic characteristics of the pipeline.
[0135] Then, the variable density hydrodynamic equations are established, which include the continuity equation and the momentum equation, and are used to describe the fluid characteristics and optimize the pipeline layout.
[0136] The continuity equation describes the change of the density field over time:
[0137] ;
[0138] where ρ refers to the previously established density field, representing the mass density of each point in space; is the fluid velocity field, representing the fluid motion velocity vector of each point in space; represents the rate of change of density with respect to time; represents the divergence of the mass flow rate. In actual calculations, for node i, the density rate of change can be approximated by finite differences:
[0139] ;
[0140] where / is the rate of change of density with respect to time at node i; is the density value at node i at the next time step (n + 1); is the density value at node i at the current time step (n); Δt is the time step, that is, the time interval between two adjacent calculations. Using the forward difference method, the continuous partial differential equation is discretized into a computable difference form for estimating the time rate of change of density in numerical simulations.
[0141] The momentum equation includes a pressure gradient term, a viscous stress term, an elastic restoring force term, and a momentum source term. The pressure gradient term reflects the influence of fluid pressure on flow, and usually the reference pressure is set to 1 standard atmosphere. The viscous stress term describes the viscous effect of the fluid. The elastic restoring force term is the elastic restoring force defined above.
[0142] The formula for the momentum equation is:
[0143] ;
[0144] where ρ is the fluid density; is the material derivative of velocity, representing the rate of change of velocity following a fluid particle; is the pressure gradient term, representing the driving force generated by the composite pressure field; The viscous stress term reflects the viscous resistance within the fluid; is the elastic restoring force term, characterizing the elastic properties of the pipeline; is the momentum source term, including external forces such as the pipeline spacing pressure field, turning radius pressure field, and slope pressure field.
[0145] For the pressure gradient term, where P is a scalar function of the pressure field. In the calculation, for node i, the pressure gradient is calculated using central differences:
[0146] ;
[0147] where, is the pressure gradient vector at node i; P i+1,x is the pressure value at node i + 1 in the x direction; P i-1,x is the pressure value at node i - 1 in the x direction; Δx is the spatial step in the x direction; P i+1,y , P i-1,y are the pressure values of adjacent nodes in the y direction; Δy is the spatial step in the y direction; P i+1,z , P i-1,z are the pressure values of adjacent nodes in the z direction; Δz is the spatial step in the z direction.
[0148] For the viscous stress term:
[0149] ;
[0150] where, τ is the viscous stress tensor, describing the stress distribution within the fluid due to viscosity; μ is the dynamic viscosity coefficient of the fluid, representing the ability of the fluid to resist shear deformation; is the velocity gradient tensor, describing the rate of change of the velocity field in space; is the transpose of the velocity gradient tensor;
[0151] μ is usually set to 0.5 - 2.0 Pa·s and is dynamically adjusted with the optimization process. The viscous stress term for node i can be calculated in the following way:
[0152] ;
[0153] where, is the divergence of the viscous stress tensor at node i, representing the net force generated by viscous forces; is the dynamic viscosity coefficient of the fluid at node i; is the Laplace operator, representing the second-order spatial derivative; is the fluid velocity vector at node i. This formula is a simplified approximation of the viscous term and is applicable to incompressible fluids or fluids with a constant viscosity. It simplifies the divergence of the complete viscous stress tensor to the Laplacian term of the velocity field multiplied by the viscosity coefficient, essentially describing how the spatial variation of the velocity gradient in a viscous fluid leads to the generation of viscous forces. This simplification is commonly used in numerical simulations to reduce computational complexity.
[0154] The momentum source term is composed of the pipeline spacing pressure field, the turning radius pressure field, and the slope pressure field added together, and is used to incorporate the local constraint strength of the composite pressure field into the calculation. The pipeline spacing pressure field ensures an appropriate distance between pipelines. In practical applications, the minimum safety distance can be set to 0.5 meters. The turning radius pressure field ensures that the curved sections of the pipelines meet the minimum turning radius requirements. Depending on the pipeline material and usage, the minimum turning radius is usually set to 5 to 10 times the pipeline diameter. For example, for a pipeline with a diameter of 0.1 meters, the minimum turning radius can be set to 0.5 meters. When an area with a turning radius smaller than this value is detected, a corrective force is applied to adjust the pipeline towards a larger radius. The magnitude of the force is proportional to the deviation of the turning radius. For example, when the actual turning radius is 0.3 meters, the corrective force can reach 400 N. The slope pressure field controls the inclination of the pipeline to avoid overly steep slopes. The maximum allowable slope is usually set to 30 degrees. When a slope exceeding this value is detected, a corrective force is generated to make the pipeline tend towards a flatter layout. For example, when a slope of 45 degrees is detected, the generated corrective force is approximately 200 N, and when the slope is 35 degrees, the corrective force is approximately 100 N.
[0155] The pipeline distance pressure field is generated when the distance d between two pipelines ij is less than the safety distance d safe as follows:
[0156] ;
[0157] where, is the distance safety source term force vector acting on node i; is the distance force coefficient that controls the strength of this force; is the actual distance between node i and adjacent node j; dsafe is the safety distance threshold, representing the minimum safety distance that should be maintained between pipelines; max() is the distance influence factor that generates a force when the actual distance is less than the safety distance; is the position vector pointing from node j to node i; is the magnitude of the position vector; / is a unit vector pointing toward node i, indicating the direction of the force. This formula describes the repulsive force that prevents pipelines from getting too close. When the distance between two nodes is less than the safe distance, a force is generated along the connecting line, pushing the two nodes apart. The smaller the distance, the greater the force; when the distance exceeds the safe distance, the force is zero. This mechanism helps prevent pipeline collisions or intersections, ensuring the safety of pipeline layouts.
[0158] The turning radius pressure field is generated when the local curvature radius Ri of the pipeline is less than the minimum allowable radius Rmin:
[0159] ;
[0160] in, is the turning radius source force vector acting on node i; is the turning radius force coefficient (typical value 2.0-10.0), which controls the strength of this force; is the actual turning radius of the pipeline at node i; R min The minimum turning radius allowed for the pipeline is determined based on material properties and engineering specifications. max() is the radius influencing factor. When the actual radius is less than the minimum radius, a force is generated. is the unit vector of curvature at node i, pointing away from the bend center. This formula describes the restraining force that prevents excessive pipeline bending. When the pipeline's bend radius at a node is less than the minimum allowable turning radius, a force along the curvature is generated, pushing the pipeline toward a larger bend radius. This mechanism ensures that pipeline layout complies with engineering standards and avoids structural damage or functional impairment caused by excessive bending. Using the three-point method, the current node i and its adjacent preceding and following nodes i-1 and i+1 are selected to form a point set. The lengths of the three line segments formed between these three points are calculated: the distance from the previous node to the current node, the distance from the current node to the next node, and the distance from the previous node to the next node. These three line segment lengths are multiplied together to obtain a product value. The area of the triangle formed by these three points is also calculated. Finally, the product value is divided by four times the area of the triangle to obtain the radius of the circle passing through these three points. This value is the radius of curvature of the pipeline at node i.
[0161] The slope pressure field is generated when the local slope of the pipeline exceeds the maximum allowable slope:
[0162] ;
[0163] in, is the slope source force vector acting on node i, which is used to control the slope of the pipeline to not exceed the allowable range; αg is the slope force coefficient, which controls the strength of the force; is the actual slope angle of the pipeline at node i; θmax is the maximum allowable slope angle of the pipeline, determined based on engineering specifications; max() is the slope influence factor, which generates a force when the actual slope exceeds the maximum allowable slope. is the unit vector in the horizontal direction at node i, indicating the direction of the force; this formula describes the binding force that restricts the pipeline from having too steep a slope. When the slope angle of the pipeline at a certain node exceeds the maximum allowable slope, a force in the horizontal direction is generated, prompting the pipeline to tend towards a gentler slope. This mechanism ensures that the pipeline layout meets the construction and operation safety requirements, avoiding construction difficulties or operation risks caused by too steep a slope. is calculated by first determining the three-dimensional spatial coordinates of two adjacent nodes i-1 and i+1 before and after node i. Then calculate the vertical height difference between these two adjacent nodes, that is, the absolute value of the coordinate difference in the z direction. At the same time, calculate the spatial straight-line distance between these two adjacent nodes, that is, the square root of the sum of the squares of the coordinate differences in the x, y, and z directions. Finally, divide the vertical height difference by the spatial straight-line distance, the result obtained is the sine value, and then take the arcsine of it.
[0164] The present invention maps the local stiffness of the pipeline into a fluid density field through a density function, and at the same time introduces an elastic restoring force to characterize the elastic properties of the pipeline, realizing the accurate simulation of the rigid-elastic behavior of the pipeline; based on the principle of variable density hydrodynamics, a complete mechanical model including a continuity equation and a momentum equation is established, and through the synergistic action of the pressure gradient, viscous stress, and elastic restoring force, the natural optimization of the pipeline layout is realized; in particular, engineering constraints such as pipeline spacing, turning radius, and slope are introduced through the momentum source term, so that the optimization result not only conforms to the laws of fluid mechanics but also meets the engineering requirements. The present invention organically combines continuum mechanics with pipeline engineering practice, significantly improving the efficiency and quality of the design of complex pipeline systems.
[0165] In an optional implementation manner, the two-dimensional engineering drawings are automatically updated according to the optimized three-dimensional pipeline model, and the output underground pipe network engineering drawings include:
[0166] By comparing the three-dimensional pipeline models before and after optimization, calculating the Euclidean distance of the spatial point set and the edit distance of the topological structure, determining the area that needs to be updated in the two-dimensional drawing; constructing a three-dimensional to two-dimensional projection mapping relationship, and performing local projection conversion on the determined updated area;
[0167] Automatically generate multi-view expressions, including: automatically dividing the view area according to engineering specifications, automatically adjusting the viewing angle and scale for complex intersection areas; applying legend replacements that maintain semantic consistency for different pipeline types; generating a combined expression including a plan view, a sectional view, and a detail drawing;
[0168] Implement intelligent annotation and legend optimization. Based on the analysis of the drawing density heat map, calculate the information density of each area, separate the annotations and rearrange the legend for high-density areas, and use a hierarchical layout algorithm to avoid annotation overlap.
[0169] Apply graphic syntax checking to conduct a normative inspection of the updated 2D drawings according to engineering drawing specifications, including line types, annotations, scales, and layer settings, automatically correct non-compliant expressions, and generate the final output of the underground pipeline network engineering drawings.
[0170] Exemplarily, the system compares the 3D pipeline models before and after optimization to identify areas that need to be updated. During the comparison process, the system calculates the Euclidean distance of the spatial point set. When the Euclidean distance between corresponding points in the two models exceeds a preset threshold (usually set to 5 cm), mark the point as a change point. For example, for the point P1(120.5, 85.3, -2.6) in the original model and the corresponding point P1'(120.8, 85.6, -2.9) in the optimized model, the calculated Euclidean distance is 0.529 cm, which is less than the threshold and is not marked as a change point; for the point P2(156.3, 92.4, -3.2) and the optimized P2'(158.1, 93.5, -3.4), the calculated Euclidean distance is 2.138 cm, which is still less than the threshold; but for the point P3(201.8, 145.6, -5.4) and the optimized P3'(201.8, 151.2, -5.4), the Euclidean distance is 5.6 cm, which exceeds the threshold, so P3 is marked as a change point. The system also calculates the edit distance of the model topology. When the connection relationship of pipe segments changes (such as node addition, deletion, or connection method change), mark the relevant area as a topology change area. For example, in the original model, the node N1 is connected to the pipe segments S1 and S2, and in the optimized model, the node N1' is connected to the pipe segments S1', S2', and S3', which is identified as a topology structure change.
[0171] Combine the spatial change points and the topology change areas to determine the areas that need to be updated in the 2D drawings. The spatial change point set forms a change area CR, and expand a certain buffer distance (usually 1 m) outside the boundary of CR to ensure complete coverage of all content that needs to be updated.
[0172] Then, the system constructs a projection mapping relationship from 3D to 2D. For the plan view, use the orthographic projection method to project the 3D model onto the XY plane; for the sectional view, use the sectional projection along a specific direction. For example, project the 3D point (x, y, z) onto the 2D plane to get the point (x, y) on the plan view; project the point onto a specific section (such as a section along the y-axis direction) to get the point (x, z) on the sectional view.
[0173] The system also supports the automatic generation of multi-view expressions. According to engineering drawing specifications, when the pipe network coverage area exceeds a certain range (such as 100 square meters), the area is divided into multiple sub-view areas to ensure that the display ratio of each sub-view is appropriate (usually from 1:100 to 1:500). For areas with dense pipeline intersections (such as more than 3 intersecting pipelines within 5 meters), the system implements intelligent perspective and ratio automatic adjustment, and conducts geometric analysis on the pipelines within the intersection area: calculates the three-dimensional direction vectors of each pipeline, and then constructs a pipeline direction matrix. Performs principal component analysis on this matrix, extracts the first two principal components, and these two vectors determine the main plane that best reflects the pipeline distribution. The system sets the view point direction as the vector perpendicular to this plane, calculated through the cross product of the two principal component vectors. For example, for an intersection area containing 5 pipelines, the best view point direction obtained through analysis can maximize the display of the spatial relationship of the pipelines. For special cases, such as when two groups of pipelines are perpendicularly intersecting (the included angle is within the range of 80° - 100°), the system uses the bisection method to find the optimal perspective: first calculates the average direction vectors of the two groups of pipelines, then takes the direction of the angle bisector and offsets it upward by 30° as the initial view point direction, and then iteratively adjusts the perspective within the range of 5° up and down, evaluates the pipeline visibility score under each perspective, and selects the perspective with the highest score. The score is calculated based on the minimum distance between the pipelines after projection and the clarity of the intersection angle. In terms of ratio adjustment, the system adaptively calculates the best scale based on the principle of information entropy, calculates the pipeline density index within the area, that is, the total length of each pipeline within the area divided by the area, and determines the final scale according to the empirical formula, which takes into account the logarithmic relationship between the default scale and the current density and the reference density. For example, when the pipeline density within a certain intersection area reaches three times the standard density, the system automatically adjusts the scale from 1:200 to 1:100, and when the density reaches six times, it is further adjusted to 1:50 to ensure that the details in the complex area are clearly visible. The system also ensures that the adjusted scale meets the engineering drawing standards and takes the closest standard scale value. For the expression of different pipeline types, the system maintains a legend library, including standard legends such as water supply pipes (blue solid lines, line width 0.5mm), drainage pipes (brown dashed lines, line width 0.5mm), gas pipes (yellow double-dotted lines, line width 0.6mm), etc., to ensure semantic expression consistency. For example, converts the DN200 ductile iron water supply pipe in the 3D model into a blue solid line in the 2D drawing and marks "DN200 DICL". Generates a complete combined drawing expression, including: general plan (bird's-eye view, scale 1:500), sectional plan of each zone (front projection, scale 1:200), key node section drawing (vertical section along the pipeline direction, scale 1:50), and local details of complex intersection areas (orthogonal multi-view, scale 1:20).
[0174] Regarding drawing annotations and legends, the system first constructs a drawing density heatmap. The drawing is divided into 10×10 grids, and the number of graphic elements in each grid is calculated to form a density matrix. When the density value of a certain grid exceeds the threshold (such as more than 5 graphic elements per square centimeter), it is marked as a high-density area. For example, a certain area of the drawing (sized 20 cm × 15 cm) contains 85 graphic elements, with an average density of 0.283 elements per square centimeter, but the local grid (4, 6) contains 28 elements, with a density of 1.4 elements per square centimeter, which is marked as a high-density area. For high-density areas, the system adopts an annotation separation strategy, moving the annotation text from the position close to the graphic to a relatively empty area and connecting it with a guiding line to ensure readability. For example, the pipe diameter annotation "DN150" is moved from the overlapping area of the pipeline to a blank area 5 cm away, and a guiding line is added for connection. For legends, the system adopts a hierarchical layout algorithm, classifying them into key legends (such as pipe materials, pipe diameters) and secondary legends (such as coordinates, auxiliary annotations) according to visual importance. The key legends are retained in the main view, and the secondary legends are moved to the edge of the drawing or the appendix table.
[0175] The annotation arrangement adopts a force-directed algorithm to avoid overlap. A repulsive force field is assigned to each annotation, and a minimum distance is maintained between annotations (usually 1.2 times the annotation height). When potential overlap is detected, the system attempts to adjust the annotation position, searching for the best placement position in eight main directions (up, down, left, right, and four diagonal directions), and selecting the position that does not cause new overlap and deviates from the original position minimally. For example, the annotations of pipe segments S1 and S2 would originally overlap, and the system offsets the annotation of S2 by 1.5 cm along the 45° direction to solve the overlap problem.
[0176] Apply graphic syntax checking to check whether the line types (solid line, dashed line, dotted line, etc.), line widths (0.13 mm, 0.25 mm, 0.5 mm, etc.), annotations (character height 3.5 mm, 5 mm, etc.), scales (ratio of the illustration to the actual size), and layer settings comply with the specifications. When a non-compliant expression is found, such as an incorrect line type (e.g., using the drainage pipeline line type for the water supply pipeline by mistake), the system automatically corrects it to a compliant expression. Layer checking ensures that different types of pipelines (water supply, drainage, gas, etc.) are located in the correct layers for subsequent viewing and modification.
[0177] Through the calculation of Euclidean distance and topological editing distance, the present invention accurately identifies the areas to be updated, realizes local projection conversion, and avoids redrawing the entire map. An innovative multi-view automatic generation mechanism is introduced, the principal component analysis is used to determine the best viewing angle, and the scale is adaptively adjusted in combination with the pipeline density, effectively solving the problem of expressing complex intersection areas. Based on the density heat map analysis, intelligent annotation optimization is implemented, and the force-directed algorithm is applied to solve the problem of annotation overlap. The entire system ensures that the output drawings comply with engineering specifications through graphic syntax verification, greatly improving the efficiency and accuracy of updating underground pipeline network engineering drawings, reducing the need for manual intervention, and being particularly suitable for the design and update of large and complex pipeline network systems.
[0178] In the second aspect of the embodiments of the present invention,
[0179] A drawing system for underground pipeline network engineering based on a standard legend library is provided, including:
[0180] A first unit for obtaining initial data of an underground pipeline network project, where the initial data includes spatial position information, connection relationship information, and engineering legend information of pipelines;
[0181] A second unit for retrieving the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library by using a deep neural network, and generating a two-dimensional engineering drawing in combination with the spatial position information and connection relationship information of the pipelines;
[0182] A third unit for converting the two-dimensional engineering drawing into a three-dimensional pipeline model, calculating the spatial position relationship between pipelines, and when detecting a collision risk between pipelines, using an optimization algorithm based on field potential flow to adjust the pipeline layout, modeling the three-dimensional space as a flow potential field, constructing a composite pressure field including pipeline spacing, turning radius, and slope constraints; constructing the pipelines as streamlines with rigid and elastic characteristics, optimizing the pipelines based on the variable density hydrodynamics equation, and updating the streamline positions under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of the pipeline layout;
[0183] A fourth unit for automatically updating the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model and outputting the underground pipeline network engineering drawing.
[0184] In the third aspect of the embodiments of the present invention,
[0185] An electronic device is provided, including:
[0186] A processor;
[0187] A memory for storing instructions executable by the processor;
[0188] Wherein, the processor is configured to call the instructions stored in the memory to execute the method described above.
[0189] In a fourth aspect of the embodiments of the present invention,
[0190] a computer-readable storage medium is provided, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
[0191] The present invention may be a method, an apparatus, a system, and / or a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for performing various aspects of the present invention are loaded.
[0192] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for drawing underground pipe network engineering drawings based on a standard legend library, characterized in that, Including: Obtain the initial data of the underground pipe network project, where the initial data includes the spatial location information, connection relationship information, and engineering legend information of the pipelines; Use a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library, and generate a 2D engineering drawing by combining the spatial location information and connection relationship information of the pipelines; Convert the 2D engineering drawing into a 3D pipeline model, calculate the spatial position relationship between the pipelines. When a collision risk is detected between the pipelines, use an optimization algorithm based on field potential flow to adjust the pipeline layout. Model the 3D space as a flow potential field, construct a composite pressure field including pipeline spacing, turning radius, and slope constraints; Construct the pipelines as streamlines with rigid and elastic characteristics, optimize the pipelines based on the variable density fluid dynamics equation, and update the streamline positions under the action of the composite pressure field until the pressure gradient converges to achieve the overall optimization of the pipeline layout, including: Modeling the 3D space as a flow potential field, using radial basis functions to model the potential field, and constructing a composite pressure field through control point weight coefficients, where the composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field; Construct the pipelines as streamlines with rigid and elastic characteristics, optimize the pipelines based on the variable density fluid dynamics equation, and the variable density fluid dynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term; Based on the variable density fluid dynamics equation, iteratively update the streamline positions under the action of the composite pressure field, calculate the velocity field according to the time step, and the velocity field consists of a pressure gradient driving component, a viscous action component, and an elastic effect component, where the pressure gradient term is driven by the composite pressure field, the viscous term is determined by the local viscosity coefficient, and the elastic term reflects the rigid-elastic characteristics of the pipelines; Use the velocity field to update the streamline positions and calculate the satisfaction degrees of the pipeline spacing constraint, turning radius constraint, and slope constraint in real time; Dynamically adjust the local viscosity coefficient and the composite pressure field intensity coefficient based on the constraint satisfaction degrees; When the pressure gradient converges and all constraint conditions are met, determine that the optimization is completed and output the final pipeline layout plan; Automatically update the 2D engineering drawing according to the optimized 3D pipeline model and output the underground pipe network engineering drawing.
2. The method according to claim 1, wherein Using a deep neural network to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library and generating a 2D engineering drawing by combining the spatial location information and connection relationship information of the pipelines includes: Based on the legends in the standard legend feature library and the engineering legend information, use the ResNet-50 network to extract the visual features of the legends, and at the same time use the TransE model for semantic feature encoding; Construct a visual-semantic interaction attention mechanism and adaptively fuse the visual features and semantic features in a weighted fusion manner; Calculate the legend matching degree based on the fused features, and the optimization objective function is: ; where J is the overall matching optimization objective; w i is the weight coefficient of the i-th feature dimension; γ is the penalty factor; is the i-th dimension feature of the engineering legend to be matched; is the i-th dimension feature of the legend in the standard legend library; sim() is the similarity calculation function; is the complete feature vector of the engineering legend to be matched; is the complete feature vector of the legend in the standard legend library; C() is the semantic consistency constraint function; Generate an initial 2D engineering drawing based on the matching results and the spatial location information of the pipelines. Optimize the pipeline connection relationships using the minimum spanning tree algorithm, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final 2D engineering drawing.
3. The method according to claim 2, wherein Based on the legends in the standard legend feature library and the engineering legend information, use the ResNet-50 network to extract the visual features of the legends, and at the same time use the TransE model for semantic feature encoding, including: The input layer of the ResNet-50 network sets three convolutional layers with different sizes in parallel for multi-scale feature extraction; input the multi-scale features into the attention-enhanced residual block, and process the residual mapping through the channel attention mechanism and the spatial attention mechanism to obtain enhanced features; pass the enhanced features through detail-preserving connections, and fuse the deep features and shallow features in an adaptive weighting manner to obtain visual features; Use the TransE model to extract semantic features, and perform feature initialization by assigning attribute importance weights to different relationship dimensions; use the attribute importance weights to guide the TransE model to encode the hierarchical attributes of legend entities, and perform weighted combination of the basic embedding and attribute embedding of the entities to obtain the semantic representation of the entities. Introduce semantic consistency constraints, and optimize the semantic features by minimizing the distance between semantically similar legend pairs and maximizing the distance between semantically different legend pairs.
4. The method according to claim 2, wherein Optimize the pipeline connection relationships using the minimum spanning tree algorithm, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final 2D engineering drawing, including: Optimize the pipeline connection relationships, including calculating the non-Euclidean distance by weighted calculation of the geological complexity obtained by combining the Euclidean distance with geological survey data, the crossing complexity obtained by the number of crossings with existing infrastructure, and the height change penalty obtained by the node elevation difference constraint; construct the pipeline connection relationships as an undirected weighted graph, and use the non-Euclidean distance to calculate the edge weights; establish a local reconstruction optimization mechanism, determine the reconstruction area by calculating the congestion index of grid cells, and use the simulated annealing algorithm to optimize the subgraph within the reconstruction area; construct the minimum spanning tree based on the undirected weighted graph and the local reconstruction optimization mechanism; Construct a multi-objective loss function including a position loss term, a connection loss term, and a specification loss term to perform overall optimization on the initial 2D engineering drawing. The position loss term is calculated based on the minimum distance constraint between adjacent legends and the overall space utilization rate; the connection loss term is calculated based on the sum of the edge set weights of the minimum spanning tree and the corner size at the connection; the specification loss term is composed of the minimum safety distance constraint between pipelines, the pipeline corner range constraint, the pipeline elevation conflict constraint, and the legend direction specification constraint, and the degree of violation of each constraint is calculated by weighted calculation; Iteratively optimize the multi-objective loss function through the gradient descent method, and introduce the simulated annealing strategy to obtain the final 2D engineering drawing.
5. The method according to claim 1, characterized in that, Construct the pipeline into a streamline with rigid and elastic characteristics, and optimize the pipeline based on the variable density hydrodynamics equation. The variable density hydrodynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term, including: Model the pipeline as a streamline, map the local stiffness of the pipeline to the fluid density field through a density function, where the density function is determined by the local stiffness distribution of the pipeline, and characterize the elastic characteristics of the pipeline through an elastic restoring force term, where the elastic restoring force term is jointly determined by the local elastic coefficient and the initial pipeline configuration; Establish a variable density hydrodynamics equation, which includes a continuity equation and a momentum equation. The continuity equation describes the change of the density field over time, and the momentum equation includes a pressure gradient term, a viscous stress term, an elastic restoring force term, and a momentum source term. The momentum source term consists of a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field for calculating the constraint intensity value at the local position of the pipeline.
6. The method according to claim 1, wherein Automatically update the 2D engineering drawing according to the optimized 3D pipeline model, and output the underground pipe network engineering drawing, including: By comparing the 3D pipeline models before and after optimization, calculate the Euclidean distance of the spatial point set and the edit distance of the topological structure, and determine the area that needs to be updated in the 2D drawing; construct a projection mapping relationship from 3D to 2D, and perform local projection conversion on the determined updated area; Automatically generate multi-view expressions, including: automatically divide the view area according to engineering specifications, automatically adjust the viewing angle and scale for complex intersection areas; apply legend replacements that maintain semantic consistency for different pipeline types; generate a combined expression including a plan view, a sectional view, and a detail drawing; Implement intelligent annotation and legend optimization. Based on the drawing density heat map analysis, calculate the information density of each area, separate the annotations and rearrange the legends for high-density areas, and use a hierarchical layout algorithm to avoid annotation overlap; Apply graphic syntax checking, and perform a normative check on the updated 2D drawing according to the engineering drawing specifications, including line types, annotations, scales, and layer settings, automatically correct the non-compliant expressions, and generate the final underground pipe network engineering drawing output.
7. An underground pipe network engineering drawing drawing system based on a standard legend library, for implementing the method described in any one of the foregoing claims 1-6, characterized in that, Including: The first unit is used to obtain the initial data of the underground pipe network project, and the initial data includes the spatial position information, connection relationship information, and engineering legend information of the pipeline; The second unit is used to retrieve the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library by using a deep neural network, and generate a 2D engineering drawing in combination with the spatial position information and connection relationship information of the pipeline; A third unit is configured to convert the two-dimensional engineering drawing into a three-dimensional pipeline model, calculate the spatial position relationship between pipelines, and when a collision risk is detected between pipelines, an optimization algorithm based on field potential flow is adopted to adjust the pipeline layout. The three-dimensional space is modeled as a flow potential field, and a composite pressure field including pipeline spacing, turning radius, and slope constraints is constructed. The pipelines are constructed as streamlines with rigid and elastic characteristics, and the pipelines are optimized based on the variable density hydrodynamics equation. The streamline positions are updated under the action of the composite pressure field until the pressure gradient converges, achieving the overall optimization of the pipeline layout, including: modeling the three-dimensional space as a flow potential field, modeling the potential field using radial basis functions, and constructing a composite pressure field through control point weight coefficients. The composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field. The pipelines are constructed as streamlines with rigid and elastic characteristics, and the pipelines are optimized based on the variable density hydrodynamics equation. The variable density hydrodynamics equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint intensity of the composite pressure field into the calculation through the momentum source term. Based on the variable density hydrodynamics equation, the streamline positions are iteratively updated under the action of the composite pressure field, and the velocity field is calculated according to the time step. The velocity field is composed of a pressure gradient driving component, a viscous action component, and an elastic effect component, where the pressure gradient term is driven by the composite pressure field, the viscous term is determined by the local viscosity coefficient, and the elastic term reflects the rigid-elastic characteristics of the pipeline. The streamline positions are updated using the velocity field, and the satisfaction degrees of the pipeline spacing constraint, the turning radius constraint, and the slope constraint are calculated in real time. The local viscosity coefficient and the composite pressure field intensity coefficient are dynamically adjusted based on the constraint satisfaction degrees. When the pressure gradient converges and all constraint conditions are satisfied, it is determined that the optimization is completed and the final pipeline layout scheme is output. A fourth unit is configured to automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model and output the underground pipe network engineering drawing.
8. An electronic device, characterized in that, Comprising: A processor; A memory for storing instructions executable by the processor; Wherein, the processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Distribution network engineering drawing two-dimensional and three-dimensional conversion method, system, equipment and medium
CN115457195A
Underground pipe network electrical drawing generation method and system based on AI
CN119514091A