Underground pipe network engineering drawing drawing method and system based on standard legend library

Through deep neural networks and field potential flow optimization algorithms based on standard legend library, the problems of unstandard legends, unauthorized conversions and pipeline collision problems in traditional underground pipeline engineering drawing methods are solved, and efficient and safe pipeline layout design is achieved.

CN120197322AActive Publication Date: 2025-06-24BEIJING XINGCHANG CIVICISM ENG CO LTD

Patent Information

Application Number
CN202510661020.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-06-24
Estimated Expiration
2045-05-22

AI Technical Summary

Technical Problem

The traditional underground pipeline engineering drawing method lacks standardization and intelligence in the selection of legends, lacks automation in the conversion of two-dimensional drawings and three-dimensional models, and it is difficult to detect and optimize pipeline collision problems, resulting in inefficient design efficiency and difficult construction.

Method used

A deep neural network method based on the standard legend library is used to generate two-dimensional engineering drawings, and the pipeline layout is adjusted through a field potential flow optimization algorithm, and the pipeline position is optimized in combination with variable density fluid dynamics equations to achieve overall optimization of pipeline layout.

Benefits of technology

The automation and standardization of underground pipeline engineering drawings has been realized, the efficiency and quality of drawings have been improved, the problem of pipeline collision risks has been effectively solved, and the rationality and safety of pipeline layout have been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120197322A_ABST
    Figure CN120197322A_ABST
Patent Text Reader

Abstract

The invention provides an underground pipe network engineering drawing drawing method and system based on a standard legend library, and relates to the technical field of engineering drawing, and the method comprises the steps: obtaining pipeline space positions, connection relations and initial data of legend information; retrieving the standard legend with the highest matching degree by using a deep neural network to generate a two-dimensional engineering drawing; the two-dimensional drawing is converted into a three-dimensional model, and the pipeline layout with the collision risk is adjusted through an optimization algorithm based on field potential flow; and automatically updating and outputting an engineering drawing according to the optimized three-dimensional model. According to the method, intelligent optimization of pipeline layout is realized, and the drawing efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to engineering drawing technology, and particularly to a method and system for drawing underground pipeline network engineering drawings based on a standard legend library. Background Art

[0002] Underground pipeline 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 pipeline 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 pipeline network engineering drawing methods face many challenges: 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 prone to errors, and it is difficult to ensure the consistency and accuracy of legend use.

[0003] 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 two-dimensional design changes, the three-dimensional model needs to be reconstructed, and vice versa, resulting in low design efficiency and difficulty in responding to design change requirements in a timely manner.

[0004] For complex underground pipeline 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 plan under various 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

[0005] Embodiments of the present invention provide a method and system for drawing underground pipeline network engineering drawings based on a standard legend library, which can solve the problems in the prior art.

[0006] In the first aspect of the embodiments of the present invention, A method for drawing underground pipeline network engineering drawings based on a standard legend library is provided, including: Obtaining initial data of the underground pipeline network project, where the initial data includes spatial position information, connection relationship information, and engineering legend information of the pipelines; 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 two-dimensional engineering drawing by combining the spatial position information and connection relationship information of the pipelines; Convert the two-dimensional engineering drawing into a three-dimensional pipeline model, calculate the spatial position relationship between the pipelines. When a collision risk is detected between the pipelines, an optimization algorithm based on field potential flow is used to adjust the pipeline layout. Model the three-dimensional space as a flow potential field, construct a composite pressure field including pipeline spacing, turning radius and slope constraints; Construct the pipelines into 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; Automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model, and output the underground pipe network engineering drawing.

[0007] In an alternative embodiment, 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 by combining the spatial position 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; 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; Generate an initial two-dimensional engineering drawing according to the matching result and the spatial position information of the pipelines, optimize the pipeline connection relationship by 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 two-dimensional engineering drawing.

[0008] In an alternative embodiment, Based on the legends in the standard legend feature library and the engineering legend information, the visual features of the legends are extracted using the ResNet-50 network, and at the same time, the TransE model is used for semantic feature encoding, including: The input layer of the ResNet-50 network sets three parallel convolutional layers with different sizes for multi-scale feature extraction; the multi-scale features are input into the attention-enhanced residual block, and the residual mapping is processed through the channel attention mechanism and the spatial attention mechanism to obtain enhanced features; the enhanced features are passed through the detail-preserving connection, and the deep features and shallow features are fused through an adaptive weighting method to obtain visual features; The TransE model is used to extract semantic features, and the feature initialization is performed 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 basic embedding and attribute embedding of the entities are weighted and combined to obtain the semantic representation of the entities. A semantic consistency constraint is introduced, and by minimizing the distance between semantically similar legend pairs and maximizing the distance between semantically different legend pairs, the semantic features are optimized.

[0009] In an alternative embodiment, The pipeline connection relationship is optimized using the minimum spanning tree algorithm, and the overall optimization is performed through a multi-objective loss function composed of position loss, connection loss, and specification loss, and the final 2D engineering drawing is output, including: Optimizing the pipeline connection relationship, including calculating the non-Euclidean distance by weighting 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 using the non-Euclidean distance to calculate the edge weights; establishing a local reconstruction optimization mechanism, determining the reconstruction area by calculating the congestion degree index of the grid cells, and using the simulated annealing algorithm to optimize the subgraph within the reconstruction area; constructing a minimum spanning tree based on the undirected weighted graph and the local reconstruction optimization mechanism; 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 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 consists 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 weighted and calculated; 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.

[0010] 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 fluid dynamics equation. The streamline position is updated under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of the pipeline layout, including: The three-dimensional space is modeled as a flow potential field, and a radial basis function is used to model the potential field. A composite pressure field is constructed through the control point weight coefficient. The composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field; The pipeline is constructed as a streamline with rigid and elastic properties, 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 through the momentum source term; Based on the variable density fluid dynamics equation, the streamline position is iteratively updated under the action of the composite pressure field. 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. 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 streamline position 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 intensity coefficient are dynamically adjusted based on the constraint satisfaction degree. When the pressure gradient converges and all constraint conditions are satisfied, it is determined that the optimization is completed and the final pipeline layout plan is output.

[0011] In an alternative embodiment, The pipeline is constructed as a streamline with rigid and elastic properties, 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 through the momentum source term, including: 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 properties 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; Establish a variable-density fluid dynamics equation, where the variable-density fluid dynamics equation includes a continuity equation and a momentum equation. The continuity equation describes the change of the density field over 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 consists of a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field for calculating the constraint intensity value at a local position of the pipeline.

[0012] In an alternative embodiment, Automatically update the 2D engineering drawing according to the optimized 3D pipeline model. The output underground pipe network engineering drawing includes: 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 projection mapping relationship from 3D to 2D and perform local projection conversion on the determined updated area; 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; 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 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 the non-compliant expressions, and generate the final output of the underground pipe network engineering drawing.

[0013] In the second aspect of the embodiments of the present invention, Provide an underground pipe network engineering drawing drawing system based on a standard legend library, including: A first unit for obtaining 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; 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 2D engineering drawing in combination with the spatial position information and connection relationship information of the pipeline; A third unit, configured to convert the two-dimensional engineering drawing into a three-dimensional pipeline model, calculate the spatial position relationship between pipelines, and when detecting a collision risk between pipelines, 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 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, so as to achieve the overall optimization of the pipeline layout; A fourth unit, configured to automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model and output an underground pipe network engineering drawing.

[0014] In the third aspect of the embodiments of the present invention, a kind of electronic device is provided, including: 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 described above.

[0015] In the fourth aspect of the embodiments of the present invention, 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 method described above is implemented.

[0016] 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 in combination with 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.

[0017] The present invention adopts an optimization algorithm based on field potential flow to adjust the pipeline layout, models the three-dimensional space as a flow potential field, constructs a composite pressure field, constructs the pipelines as streamlines with rigid and elastic characteristics, and optimizes 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.

[0018] The present invention automatically updates the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model, realizes the collaborative optimization of the two-dimensional drawing and the three-dimensional model, significantly saves the engineering design time, reduces the design cost, improves the design quality and construction feasibility of the underground pipe network project at the same time, and provides an effective technical means for intelligent pipe network planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic flowchart of the method for drawing an underground pipe network engineering drawing based on a standard legend library according to the embodiments of the present invention; Figure 2 This is a comparison chart before and after pipeline optimization. Specific implementation manners

[0020] 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. Apparently, the described embodiments are only some of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0021] The technical solutions of the present invention will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

[0022] Figure 1 This is a schematic flowchart of a method for drawing underground pipeline network engineering drawings based on a standard legend library in an embodiment of the present invention. As Figure 1 shown, the method includes: Obtain initial data of the underground pipeline network project, where the initial data includes spatial position 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 two-dimensional engineering drawing in combination with the spatial position information and connection relationship information of the pipelines; Convert the two-dimensional engineering drawing into a three-dimensional pipeline model, calculate the spatial position relationship between the pipelines. When it is detected that there is a collision risk between the pipelines, an optimization algorithm based on field potential flow is used to adjust the pipeline layout. Model the three-dimensional 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; Automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model, and output the underground pipeline network engineering drawing.

[0023] In an alternative implementation manner, 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 two-dimensional engineering drawing in combination with the spatial position 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 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; 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; Generate an initial 2D engineering drawing according to the matching result and the spatial position information of the pipeline, 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.

[0024] Exemplarily, based on the legend and engineering legend information in the standard legend feature library, use the ResNet-50 network structure to extract visual features, and use the TransE model for semantic feature encoding. Among them, the standard legend library can select the standard pipeline legend library in AutoCAD Civil 3D or Revit MEP or the legend in the industry general specification.

[0025] The visual-semantic interaction attention mechanism realizes the adaptive fusion of features by calculating the attention weights between visual features and semantic features. First, calculate the similarity matrix of the visual feature matrix V and the semantic feature matrix S : where d is the feature dimension, and T represents the transpose operation of the matrix. Subsequently, the final feature representation is obtained through a weighted fusion method: 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.

[0026] Calculate the legend matching degree based on the fusion features to optimize the overall matching objective. The matching process takes into account 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, calculate the cosine similarity between the feature vectors, which is obtained by dividing the inner product of the vectors by the product of the vector norms; at the same time, calculate the Euclidean distance between the feature vectors and convert it 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 taken as 0.4 accordingly. The weight w of the feature dimension 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.

[0027] The semantic consistency constraint is constructed from three levels: attribute, function, and relationship. The 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; the functional semantics calculates the longest common subsequence similarity based on ontology; the 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.

[0028] The Top-K strategy is adopted in the matching process to retrieve the top K results with the highest matching degree from the standard legend library. 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.

[0029] 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 legend center point coordinates, orientation angle, scaling ratio, etc. For example, the position coordinates of the check valve in a pipeline system are (120, 85), the orientation angle is 45 degrees, and the scaling ratio is 1.2. Transform the matched 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, the minimum spanning tree algorithm is used for optimization, and then the overall optimization is carried out through the multi-objective loss function.

[0030] The present invention extracts visual features through a deep learning network and combines them with a TransE model for semantic encoding, achieving an 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 constraints to ensure the accuracy of matching at three levels of attributes, functions, and relationships; improving the recognition accuracy of engineering legends, reducing manual intervention, and accelerating the drawing update efficiency. It has significant advantages especially in dealing with complex pipeline systems and non-standard legends, providing reliable technical support for intelligent engineering drawing generation.

[0031] In an alternative embodiment, based on the legends and the engineering legend information in the standard legend feature library, the ResNet-50 network is used to extract the visual features of the legends, and at the same time, the semantic feature encoding using the TransE model includes: The input layer of the ResNet-50 network is provided with three parallel convolutional layers of different sizes for multi-scale feature extraction; the multi-scale features are input into an attention-enhanced residual block, and the residual mapping is processed through a channel attention mechanism and a spatial attention mechanism to obtain enhanced features; the enhanced features are connected through detail preservation, and the deep features and shallow features are fused in an adaptive weighting manner to obtain visual features; The TransE model is used to extract semantic features, and the feature initialization is performed 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 legend entities, and the basic embedding and attribute embedding of the entities are weighted and combined to obtain the semantic representation of the entities. A semantic consistency constraint is introduced, and by minimizing the distance between semantically similar legend pairs and maximizing the distance between semantically different legend pairs, the semantic features are optimized.

[0032] Exemplarily, a standard legend feature library is constructed, which contains legends and their attribute information in common engineering fields, 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 standardization processing. The standardization processing includes steps such as uniformly adjusting the size to 224×224 pixels, removing background noise, and enhancing edge features.

[0033] For visual feature extraction, the ResNet-50 network structure is adopted: Three parallel convolutional layers are set in the input layer, and multi-scale feature extraction is performed using convolutional kernels of different sizes. The first convolutional layer uses a 3×3 convolutional kernel with a stride of 2 to extract local detail 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. A batch normalization layer and a ReLU activation function are connected after each convolutional layer.

[0034] After multi-scale feature extraction, the three-scale features are fused through a feature fusion module. The fusion method uses a concatenation operation in the channel dimension to obtain a fused feature map. The fused feature map passes through a 1×1 convolutional layer for channel dimensionality reduction and is adjusted to the original ResNet-50 input channel number.

[0035] 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.

[0036] In actual implementation, the shared multi-layer perceptron in the channel attention uses two fully connected layers, the middle channel number is 1 / 16 of the input channel number, and the activation function uses ReLU. For example, for a feature map with an input channel of 256, the middle layer channel number 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.

[0037] To retain the legend detail information, the present invention introduces a detail retention connection. Different from the standard skip connection of ResNet, the detail retention connection fuses deep features and shallow features through an adaptive weighting method. In 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 channel number is adjusted using a 1×1 convolution, and finally weighted summation is performed through learned weight coefficients. The weight coefficients are adaptively determined through global context information, with the initial value set to equal weights and updated during network training. For example, for 4-layer features, the initial weights are all 0.25.

[0038] For semantic feature extraction, the TransE model is used to extract the semantic features of the legend: Hierarchically organize the attributes of the legend, such as basic attributes (shape, color), functional attributes (usage, connection method), and domain attributes (applicable industries, standard types), and assign importance weights 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.

[0039] In the feature initialization stage, set the initial dimensions of the entity vector and the relationship vector of the TransE model 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.

[0040] The training of the TransE model adopts a triple format, such as (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, learn the semantic representation of the entity.

[0041] To enhance the semantic representation ability, the present invention performs weighted combination of the basic embedding and the attribute embedding of the entity. 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.

[0042] At the same time, introduce semantic consistency constraints to optimize the semantic features. By defining positive sample pairs (semantically similar legends) and negative sample pairs (semantically different legends), use the contrastive learning method to minimize the distance between positive sample pairs and maximize the distance between negative sample pairs. Positive sample pairs are selected from legends of the same category but may have different appearances, and negative sample pairs are selected from legends of different categories. By setting the boundary value τ (set to 0.5), constrain the distance of positive sample pairs to be less than τ and the distance of negative sample pairs to be greater than τ.

[0043] The present invention comprehensively captures the visual features of the legend through a parallel multi-scale convolutional 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. Innovatively apply the TransE model to the semantic feature encoding of the legend. Through attribute stratification and importance weight assignment, it realizes the accurate expression of the semantic information of the legend, improves the accuracy and robustness of engineering legend recognition, especially performs outstandingly when dealing with legends with similar shapes but different semantics, and effectively solves the technical problems of inaccurate recognition and low matching degree of traditional methods in complex engineering environments, providing key technical support for the automatic generation of engineering drawings.

[0044] In an alternative embodiment, the pipeline connection relationship is optimized using the minimum spanning tree algorithm, and 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: Optimizing the pipeline connection relationship includes 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; constructing the pipeline connection relationship into 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 grid cell congestion index, 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; 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 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 consists 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 is obtained by weighted calculation of the violation degree of each constraint; Exemplarily, when calculating the non-Euclidean distance, first obtain the Euclidean distance between each node, 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, and the weight coefficients 1.0, 1.2, 1.5, 1.8, and 2.5 are assigned respectively to represent different geological crossing difficulties. In addition, calculate the crossing situation with existing infrastructure, and add a penalty value for each crossing. 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 distance penalty of 10% is added for each additional 1 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 crossing 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 1.5 times the penalty), 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.

[0045] 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.

[0046] When constructing the local reconstruction optimization mechanism, the entire area is divided into grid cells, and the congestion index within each cell is calculated. 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, if 8 pipelines pass through and form 5 intersection points, the congestion degree is 8×0.6 + 5×0.4 = 6.8. When the congestion degree exceeds the preset threshold (such as 6.0), this area is marked as a reconstruction area. The simulated annealing algorithm is applied to optimize the marked reconstruction area, with the initial temperature set to 100, the temperature decay coefficient to 0.95, and the termination temperature to 0.1. In each iteration, a new solution is generated 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 degree from 6.8 to 6.2 and the energy change is -0.6, this adjustment must be accepted; if the adjustment increases the congestion degree by 0.3, this suboptimal adjustment is accepted with a certain probability, and the probability value decreases as the temperature decreases.

[0047] Based on the above undirected weighted graph and local reconstruction optimization mechanism, a minimum spanning tree is constructed, implemented using the Kruskal algorithm. All edges are sorted by weight, and then edges are added one by one to avoid forming loops. For example, for a pipeline network system with 10 nodes, the finally generated minimum spanning tree contains 9 edges, and the total weight is the minimum possible value.

[0048] Construct a multi-objective loss function to globally optimize 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. For different types of legends, a minimum safe distance 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 added if it is lower or higher than this range. The position loss value is calculated by a weighted combination of these two factors, and the weight ratio can be set as 0.6 for the distance constraint and 0.4 for the space utilization rate.

[0049] The connection loss term is calculated based on the sum of the edge set weights of the minimum spanning tree and the turning angles at the connections. The turning angle penalty rules are as follows: 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.

[0050] The specification loss term consists of multiple constraints: the minimum safety distance constraint between pipelines (the parallel pipeline spacing should not be 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 not be 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 ratios of each constraint can be set to 0.3, 0.2, 0.3, and 0.2.

[0051] For the constructed multi - objective loss function, the gradient descent method is used for optimization. The learning rate is set to 0.01, the maximum number of iterations is 1000 times, and the convergence condition is that the loss change is less than 0.001 for 10 consecutive iterations. At the same time, a simulated annealing strategy is introduced, with an initial temperature of 50 and a temperature decay coefficient of 0.98, to probabilistically accept sub - optimal solutions to avoid falling into local optima.

[0052] The present invention innovatively introduces non - Euclidean distance metrics, incorporates actual engineering factors such as geological complexity, intersection complexity, and elevation difference into distance calculations, constructs a pipeline connection relationship model that better conforms to engineering reality; combines a local reconstruction optimization mechanism and a minimum spanning tree algorithm, can effectively solve the pipeline layout problem in congested areas, innovatively proposes a multi - objective loss function, comprehensively evaluates the drawing quality from three dimensions of position, connection, and specification, realizes the overall optimization of pipeline layout, improves the engineering feasibility and standardization of the generated drawings, reduces pipeline intersection conflicts, and optimizes the spatial utilization efficiency.

[0053] 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 pipelines are constructed as streamlines with rigid and elastic characteristics, and the pipelines are optimized based on the variable - density fluid dynamics equation, and the streamline positions are updated under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of pipeline layout, including: 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 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; Construct the pipeline as a streamline with rigid and elastic properties, and optimize the pipeline based on the variable density hydrodynamics equation. The variable density hydrodynamics equation describes the fluid properties 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, 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 is composed 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 degrees of the pipeline spacing constraint, the turning radius constraint, and the 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 satisfied, determine that the optimization is completed and output the final pipeline layout scheme.

[0054] Exemplarily, extract the plane coordinates (x, y), elevation, and pipe diameter information of the pipeline in the 2D drawing; calculate the z coordinate using the start and end point elevations 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. The collision detection adopts the spatial octree partitioning technology to recursively divide the 3D space into sub-spaces; quickly screen the potential collision areas according to the pipeline bounding box; use the exact distance calculation in the candidate areas. When the surface distance between two pipelines is less than the safety threshold (usually 10 - 30 cm), mark it as a collision risk point.

[0055] Model the 3D space as a flow potential field, and use the radial basis function 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 to be distributed in the pipeline layout space, and the composite pressure field is constructed by adjusting the weight coefficient of each control point.

[0056] The composite pressure field consists of three parts: the pipeline spacing pressure field, the turning radius pressure field, and the slope pressure field. For the pipeline spacing pressure field, when the spacing between two pipelines is less than the safe 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 safe distance, the repulsive force is zero. For example, in practical applications, when the spacing between two pipelines is 100 mm, the pressure field intensity can be set to 1.0; when the spacing is 130 mm, the pressure field intensity drops to 0.4; when the spacing 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 radius of curvature 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.

[0057] The pipeline is constructed as a streamline with rigid and elastic characteristics, and the pipeline is optimized based on the variable density hydrodynamics equation. The hydrodynamics 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.

[0058] The process of iteratively updating the streamline position is as follows: Calculate the velocity field based on 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 generates a restoring force 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, and 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 intensity coefficient of the corresponding pressure field 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%).

[0059] Figure 2 The figure shows the comparison of the pipeline before and after optimization. In the 3D view comparison: Before optimization: There are multiple problems with three different pipelines (red, blue, and green) in the three-dimensional space: two obvious pipeline collision points, not meeting the safety distance 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, maintaining 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.

[0060] Plan view comparison (top view): Before optimization: From the top view, it can be seen that the pipelines have intersections and overlaps in the plane projection, especially at two red marked positions where 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, avoiding intersections and collisions.

[0061] Profile 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.

[0062] 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 spacing, turning radius, slope limit) are met, achieving the overall optimization of the pipeline layout. This method does not require manual resolution of collision problems one by one, but realizes the global optimal layout through the natural evolution of the physical field.

[0063] 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 ingeniously uses the principles of fluid mechanics to naturally handle multi-constraint problems, and through the combined action of pressure gradient driving, viscous action and elastic effect, realizes the self-organization optimization of the pipeline layout. 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.

[0064] 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: Model the pipeline as a streamline, map the local stiffness of the pipeline to the fluid density field through the 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 the elastic restoring force term, the elastic restoring force term is jointly determined by the local elastic coefficient and the initial pipeline configuration; Establish the variable density fluid dynamics equation, which includes the continuity equation and the momentum equation. The continuity equation describes the change of the density field over 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 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.

[0065] Exemplarily, the pipeline is discretized into a sequence of spatial nodes, and each node has a spatial position and a local stiffness attribute. For a pipeline with a length of L, n discrete nodes are set , the distance 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 rigidity characteristics of different parts of the pipeline, this method assigns a stiffness value si ∈ [0, 1] to each node. The stiffness value is determined according to the pipe material type, wall thickness, connection method, and usage requirements. For example, for key nodes or areas with higher rigidity, a larger stiffness value (0.7 - 0.9) is assigned; for ordinary areas, a medium stiffness value (0.4 - 0.6) is assigned; for areas 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.

[0066] 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, which reflects the magnitude of the restoring force generated when the node position 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: ; 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 coordinate 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 the deformation process, simulating the elastic behavior of a real pipeline. The elastic restoring force and the pipeline density field act together. In the subsequent variable-density hydrodynamics calculation, the high-density (high stiffness) region is less affected by the elastic restoring force and remains relatively stable; while the low-density (low stiffness) region is 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.

[0067] Then, the variable-density hydrodynamics 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.

[0068] The continuity equation describes the change of the density field over time: ; where ρ refers to the density field established above, 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 over 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: ; where / is the rate of change of density over 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 simulation.

[0069] 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 the reference pressure is usually 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.

[0070] The formula for the momentum equation is: ; 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, which 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, the turning radius pressure field, and the slope pressure field.

[0071] 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: ; 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 and 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 and P i-1,z are the pressure values of adjacent nodes in the z direction; Δz is the spatial step in the z direction.

[0072] For the viscous stress term: ; where τ is the viscous stress tensor, describing the stress distribution due to viscosity within the fluid; μ 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; μ 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: ; where is the divergence of the viscous stress tensor at node i, representing the net force generated due to 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, applicable to incompressible or fluids with constant viscosity. It simplifies the divergence of the full viscous stress tensor to the Laplace 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.

[0073] 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 intensity of the composite pressure field into the calculation. The pipeline spacing pressure field ensures that an appropriate distance is maintained 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 parts of the pipelines meet the minimum turning radius requirements. Depending on the pipeline material and use, 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.

[0074] The pipeline distance pressure field is generated when the distance d between two pipelines ij is less than the safety distance d safe : ; where, is the distance safety source term force vector acting on node i; is the distance force coefficient, controlling the intensity 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, and a force is generated 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 the unit vector pointing to node i, representing the direction of the force; this formula describes the repulsive force to prevent pipelines from getting too close. When the distance between two nodes is less than the safety distance, a force is generated along the connection line to push the two nodes apart. The smaller the distance, the greater the force; when the distance is greater than the safety distance, this force is zero. This mechanism helps prevent pipeline collisions or crossings and ensures the safety of the pipeline layout.

[0075] The turning radius pressure field is generated when the local curvature radius Ri of the pipeline is less than the minimum allowable radius Rmin: ; where, is the turning radius source term 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 It is the minimum turning radius allowed for the pipeline, which is determined based on material properties and engineering specifications; max() is the radius influence factor, and force is generated when the actual radius is less than the minimum radius; is the unit vector of the curvature direction at node i, pointing in the opposite direction of the bend center; this formula describes the restraining force that prevents excessive bending of the pipeline. When the bending radius of the pipeline at a certain node is less than the minimum allowable turning radius, a force along the curvature direction will be generated, causing the pipeline to tend to a larger bending radius. This mechanism ensures that the pipeline layout meets engineering standards and avoids structural damage or functional disorders caused by excessive bending. The three-point method is used for calculation. The current node i and its adjacent front and rear 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. The three line segment lengths are multiplied to obtain a product value. At the same time, the area of ​​the triangle formed by these three points is calculated. Finally, the radius of the circle passing through these three points is obtained by dividing the aforementioned product value by four times the area of ​​the triangle. This value is the radius of curvature of the pipeline at node i.

[0076] The slope pressure field is generated when the local slope of the pipeline exceeds the maximum allowable slope: ; in, is the slope source force vector acting on node i, which is used to control the slope of the pipeline not to 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 slope angle allowed for the pipeline, which is determined based on engineering specifications; max() is the slope influence factor, which generates force when the actual slope exceeds the maximum allowable slope; is the horizontal unit vector at node i, indicating the direction of force; this formula describes the constraint force that limits the steepness of the pipeline slope. When the slope angle of the pipeline at a certain node exceeds the maximum allowable slope, a horizontal force will be generated, causing the pipeline to tend to a gentler slope. This mechanism ensures that the pipeline layout meets the construction and operation safety requirements and avoids construction difficulties or operation risks caused by steep slopes. The calculation method is to first determine the three-dimensional spatial coordinates of the 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, and the result obtained is the sine value, and then take the arcsine of it.

[0077] The present invention maps the local stiffness of the pipeline into the fluid density field through the density function, and at the same time introduces the elastic restoring force to characterize the elastic characteristics of the pipeline, realizing the accurate simulation of the rigid-elastic behavior of the pipeline; based on the variable density hydrodynamics principle, a complete mechanical model including the continuity equation and the momentum equation is established, and the natural optimization of the pipeline layout is realized through the synergistic action of the pressure gradient, the viscous stress and the elastic restoring force; 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.

[0078] In an optional implementation manner, the two-dimensional engineering drawing is automatically updated according to the optimized three-dimensional pipeline model, and the output underground pipe network engineering drawing includes: By comparing the three-dimensional 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 two-dimensional drawing; construct the projection mapping relationship from three-dimensional to two-dimensional, and perform local projection conversion on the determined updated area; 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 partial detail drawing; 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 legends for high-density areas, and use a hierarchical layout algorithm to avoid annotation overlap; Apply graphic grammar checking, and perform normative checks on the updated two-dimensional drawing according to engineering drawing specifications, including line types, annotations, scales and layer settings, automatically correct the expressions that do not conform to the specifications, and generate the final output of the underground pipe network engineering drawing.

[0079] Exemplarily, the system compares the 3D pipeline models before and after optimization to identify the areas that need to be updated. During the comparison process, the system calculates the Euclidean distance of the spatial point sets. When the Euclidean distance between the corresponding points in the two models exceeds a preset threshold (usually set to 5 cm), that point is marked 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 points 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, still less than the threshold; but for the points P3(201.8, 145.6, -5.4) and the optimized P3'(201.8, 151.2, -5.4), the Euclidean distance is 5.6 cm, exceeding the threshold, so P3 is marked as a change point. The system also calculates the edit distance of the model topological structure. When the pipe segment connection relationship changes (such as node addition or deletion, connection method change), the relevant area is marked as a topological change area. For example, if 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', it is recognized as a topological structure change.

[0080] Combining the spatial change points and the topological change areas, the areas that need to be updated in the 2D drawing are determined. The spatial change point set forms a change region CR, and a certain buffer distance (usually 1 m) is extended outside the boundary of CR to ensure complete coverage of all the content that needs to be updated.

[0081] Then, the system constructs the projection mapping relationship from 3D to 2D. For the plan view, the orthographic projection method is adopted to project the 3D model onto the XY plane; for the sectional view, the sectional projection along a specific direction is adopted. For example, projecting the 3D point (x, y, z) onto the 2D plane, the point (x, y) on the plan view is obtained; projecting the point onto a specific section (such as the section along the y-axis direction), the point (x, z) on the sectional view is obtained.

[0082] 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: calculate the three-dimensional direction vectors of each pipeline, and then construct a pipeline direction matrix. Perform principal component analysis on this matrix to extract the first two principal components, and these two vectors determine the main plane that best reflects the pipeline distribution. The system sets the viewing direction as the vector perpendicular to this plane, which is calculated by the cross product of the two principal component vectors. For example, for an intersection area containing 5 pipelines, the best viewing 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 intersect perpendicularly (the included angle is within the range of 80° - 100°), the system uses the bisection method to find the optimal perspective: first calculate the average direction vectors of the two groups of pipelines, and then take the direction of the angle bisector shifted upward by 30° as the initial viewing direction, and then iteratively adjust the perspective within the range of ±5°, evaluate the visibility scores of the pipelines at each perspective, and select 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 in the area, that is, the total length of each pipeline in the area divided by the area of 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 in 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 the consistency of semantic expression. For example, convert the DN200 ductile iron water supply pipe in the 3D model into a blue solid line in the 2D drawing and mark "DN200 DICL". Generate a complete combined drawing expression, including: general layout plan (bird's-eye view, scale 1:500), sectional plan of each zone (front projection, scale 1:200), key node sectional view (vertical section along the pipeline direction, scale 1:50), and local details of complex intersection areas (orthogonal multi-view, scale 1:20).

[0083] Regarding drawing annotations and legends, the system first constructs a drawing density heatmap. The drawing is divided into a 10×10 grid, 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 place 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, dividing 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.

[0084] The annotation arrangement uses a force-directed algorithm to avoid overlap. A repulsive force field is assigned to each annotation, and a minimum distance (usually 1.2 times the annotation height) is maintained between annotations. 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.

[0085] Apply graphic syntax checking to check whether the line type (solid line, dashed line, dotted line, etc.), line width (0.13mm, 0.25mm, 0.5mm, etc.), annotation (character height 3.5mm, 5mm, etc.), scale (ratio of the illustration to the actual size), and layer settings conform to the specifications. When an unqualified expression is found, such as an incorrect line type (e.g., the water supply pipeline misuses the drainage pipeline line type), the system automatically corrects it to a qualified 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.

[0086] 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. It innovatively introduces a multi-view automatic generation mechanism, determines the optimal viewing angle using principal component analysis, adaptively adjusts the scale in combination with pipeline density, and effectively solves the problem of expressing complex intersection areas. Based on 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 is particularly suitable for the design and update of large and complex pipeline network systems.

[0087] In the second aspect of the embodiments of the present invention, A drawing system for underground pipeline network engineering based on a standard legend library is provided, including: A first unit for obtaining initial data of the underground pipeline network project, where the initial data includes spatial position information, connection relationship information, and engineering legend information of the pipelines; A second unit for retrieving the standard legend with the highest matching degree with the engineering legend information from the standard legend feature library 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; A third unit for converting the two-dimensional engineering drawing into a three-dimensional pipeline model, calculating the spatial position relationship between the pipelines, and when detecting a collision risk between the 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 streamline with rigid and elastic characteristics, optimizing the pipelines based on the variable density hydrodynamics equation, and updating the streamline position under the action of the composite pressure field until the pressure gradient converges, realizing the overall optimization of the pipeline layout; 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.

[0088] In the third aspect of the embodiments of the present invention, An electronic device is provided, including: 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 described above.

[0089] In the fourth aspect of the embodiments of the present invention, 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 method described above is implemented.

[0090] 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 having thereon computer-readable program instructions for performing various aspects of the present invention.

[0091] 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 described 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 various 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 position 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 two-dimensional engineering drawing by combining the spatial position information and connection relationship information of the pipelines; Convert the two-dimensional engineering drawing into a three-dimensional pipeline model, calculate the spatial position relationship between the pipelines. When detecting a collision risk between the pipelines, use an optimization algorithm based on field potential flow to adjust the pipeline layout. Model the three-dimensional 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; Automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model, and output the underground pipe network engineering drawing.

2. The method according to claim 1, characterized in that, 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 two-dimensional engineering drawing by combining the spatial position 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 use a weighted fusion method to adaptively fuse the visual features and semantic features; Calculate the legend matching degree based on the fusion 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; 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; Generate an initial two-dimensional engineering drawing according to the matching result and the spatial position information of the pipelines, use the minimum spanning tree algorithm to optimize the pipeline connection relationship, and perform overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss, and output the final two-dimensional engineering drawing.

3. The method according to claim 2, characterized in that, Based on the legends in the standard legend feature library and the engineering legend information, using the ResNet-50 network to extract the visual features of the legends, and at the same time using the TransE model for semantic feature encoding includes: The input layer of the ResNet-50 network is set with three parallel convolutional layers of 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 a detail-preserving connection, and fuse the deep features and shallow features in an adaptive weighted manner to obtain visual features; Use the TransE model to extract semantic features, and 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, and perform a 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 relationship using the minimum spanning tree algorithm, and conduct overall optimization through a multi-objective loss function composed of position loss, connection loss, and specification loss. The output of the final 2D engineering drawing includes: Optimize the pipeline connection relationship, including 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; construct the pipeline connection relationship as 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 congestion index of grid cells, 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; Construct a multi-objective loss function including a position loss term, a connection loss term, and a specification loss term to conduct overall optimization of 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 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 obtained by weighted calculation of the violation degree of each constraint; 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, wherein Adjust the pipeline layout using an optimization algorithm based on field potential flow. 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 characteristics, and optimize the pipeline based on the variable density hydrodynamics 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: Model the three-dimensional space as a flow potential field, model the potential field using radial basis functions, and construct a composite pressure field through the control point weight coefficient. The composite pressure field includes a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field; 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; Based on the variable density hydrodynamic equation, the streamline position is iteratively updated under the action of the composite pressure field, and 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 characteristics of the pipeline; the streamline position is updated using the velocity field, and the satisfaction degrees of pipeline spacing constraints, turning radius constraints, and slope constraints are calculated in real time; the local viscosity coefficient and the composite pressure field strength 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.

6. The method according to claim 5, wherein The pipeline is constructed as a streamline with rigid and elastic characteristics, and the pipeline is optimized based on the variable density hydrodynamic equation. The variable density hydrodynamic equation describes the fluid characteristics through the continuity equation and the momentum equation, and incorporates the local constraint strength of the composite pressure field into the calculation through the momentum source term, including: 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; A variable density hydrodynamic equation is established. The variable density hydrodynamic equation includes a continuity equation and a momentum equation. The continuity equation describes the change of the density field over 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 consists of a pipeline spacing pressure field, a turning radius pressure field, and a slope pressure field that calculate the constraint strength values at local pipeline positions.

7. 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 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; 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 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 the expressions that do not meet the specifications, and generate the final underground pipe network engineering drawing for output.

8. An underground pipe network engineering drawing system based on a standard legend library, which is used to implement the method described in any one of the foregoing claims 1-7, and is characterized in that, Including: The first unit is used to obtain the initial data of the underground pipe network project. The initial data includes the spatial position information, connection relationship information, and engineering legend information of the pipeline; A second unit, configured to retrieve, from a standard legend feature library, a standard legend with the highest matching degree with the engineering legend information by using a deep neural network, and generate a two-dimensional engineering drawing in combination with the spatial position information and connection relationship information of the pipelines; A third unit, 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, adopt an optimization algorithm based on field potential flow to adjust the pipeline layout, model the three-dimensional space as a flow potential field, construct a composite pressure field including pipeline spacing, turning radius, and slope constraints; construct the pipelines as streamline with rigid and elastic characteristics, optimize the pipelines based on the variable density hydrodynamics equation, and update the streamline position under the action of the composite pressure field until the pressure gradient converges, so as to realize the overall optimization of the pipeline layout; A fourth unit, configured to automatically update the two-dimensional engineering drawing according to the optimized three-dimensional pipeline model and output an underground pipe network engineering drawing.

9. 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 7.

10. 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 7 is implemented.

Citation Information

Patent Citations

  • Distribution network engineering drawing two-dimensional and three-dimensional conversion method, system, equipment and medium

    CN115457195A

  • CAD and BIM coordinate automatic conversion method and system based on coordinate mapping

    CN119478285A

  • Underground pipe network electrical drawing generation method and system based on AI

    CN119514091A

  • Intelligent construction control method and system for bridge girder erection machine based on machine vision

    CN119648041A

  • News scene three-dimensional reconstruction and visualization method based on multi-source remote sensing data

    CN119904592A

Cited By

  • Underground pipe network construction drawing generation and verification method and system based on image recognition

    CN120493593A

  • Image recognition-based underground pipe network construction drawing generation and verification method and system

    CN120493593B

  • Graph symbol library unified management method and device based on geological data

    CN121636636A