Method and device for marking SVG construction drawings

By parsing construction plans using a large language model and generating visual markers, the problem of insufficient construction drawing processing capabilities has been solved, achieving high-precision and high-efficiency intelligent marking, and improving the marking accuracy and overall efficiency of power system drawings.

CN121330102APending Publication Date: 2026-01-13GUANGZHOU ZHITU STARWAY INTERNET TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511273056.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing construction drawing processing technologies suffer from limited processing capacity, insufficient industry adaptability, low marking accuracy, and difficulties in system integration. In particular, they are difficult to identify branch substations and node numbers in power system drawings and lack intelligent analysis capabilities, resulting in low marking efficiency and frequent mismarking.

Method used

A pre-trained large language model is used to parse construction plan data, identify structured information, and calculate node coordinates by parsing element attributes and transformation attributes of SVG format drawings. Visual markers are generated and combined with structured information to merge into the drawings, achieving high-precision and high-efficiency intelligent marking.

Benefits of technology

It enables intelligent understanding and automated processing of unstructured construction plans, reduces manual intervention, improves the accuracy and practicality of marking, and builds an end-to-end automated process, significantly improving the processing efficiency and accuracy of construction drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330102A_ABST
    Figure CN121330102A_ABST
Patent Text Reader

Abstract

The invention provides a marking method and device for SVG construction drawings. The method comprises the steps that a pre-trained large language model is used for analyzing and recognizing construction scheme data to obtain structured information; analyzing the construction drawing in the SVG format, and extracting to obtain element attributes and transformation attributes; identifying construction system nodes, branch equipment and a connection relationship between the branch equipment and the construction system nodes from the element attributes; analyzing translation transformation and affine transformation in the transformation attributes, and calculating element coordinates of nodes of the construction system; generating different types of visual marks based on branch equipment, construction system nodes, a connection relation of the branch equipment and the construction system nodes and the element coordinates; and converting the visual mark and the structured information into a parameter instruction set, and merging the parameter instruction set into the construction drawing in the SVG format to obtain a marked target construction drawing. Therefore, the problems that a traditional method is limited in processing capacity, insufficient in industry adaptability, low in marking precision, difficult in system integration and the like are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of engineering information technology and artificial intelligence integration, and in particular to a method and apparatus for marking SVG construction drawings. Background Technology

[0002] In the field of construction drawing processing, with the continuous development of engineering construction, the demand for intelligent marking technology for construction drawings is increasing. Accurate and efficient drawing marking helps improve construction efficiency and ensure project quality.

[0003] Traditional methods suffer from limitations in processing power, industry adaptability, marking accuracy, and system integration. Specifically, traditional methods are mostly based on raster image processing, making it difficult to effectively process vector format drawings, resulting in accuracy loss and low processing efficiency. Furthermore, they lack specialized processing algorithms for power system drawings, failing to identify industry-specific elements such as branch substations and node numbers. Template-matching-based methods are prone to mismarking in complex drawing environments and lack intelligent analysis capabilities based on graphical structures. Existing solutions are mostly independent systems, lacking plug-in architecture and standardized interfaces, making integration with mainstream engineering software difficult. In addition, existing technical solutions lack sufficient intelligence at the information input level, typically relying on manual identification of work content and risk points in construction plan documents and manual configuration of marking parameters—a cumbersome and error-prone process that lacks the ability to utilize Natural Language Processing (NLP) and artificial intelligence technologies for intelligent parsing and automatic marking of construction plans.

[0004] In summary, to address the problems existing in current technologies, there is an urgent need for an intelligent marking method for construction drawings to achieve high-precision and high-efficiency intelligent marking of construction drawings. Summary of the Invention

[0005] This invention provides a method and apparatus for marking SVG construction drawings, which is used to automatically identify elements of SVG format power construction drawings and generate accurate visual markings by intelligently parsing construction schemes described in natural language, thereby achieving high-precision, high-efficiency, and highly automated intelligent marking of construction drawings.

[0006] In a first aspect, the present invention provides a marking method for SVG construction drawings, comprising:

[0007] The pre-trained large language model is used to parse the acquired construction plan data and identify structured information including work content, risk items and work grouping information.

[0008] The acquired SVG format construction drawings are parsed to extract element attributes and transformation attributes; construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes are identified from the element attributes.

[0009] Analyze the translation and affine transformations in the transformation attributes, and calculate the element coordinates of the nodes in the construction system;

[0010] Based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates, different types of visual markers are generated;

[0011] The visual markers and structured information are converted into a set of parameter instructions and merged into the SVG format construction drawings to obtain the marked target construction drawings.

[0012] Optionally, the element attributes include text elements and graphic elements; identifying construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes includes:

[0013] Identify the branch equipment and the construction system nodes from the text elements respectively;

[0014] Extract line elements and path elements from the graphic elements;

[0015] Based on the line elements and the path elements, the connection relationship between the branch equipment and the construction system node is identified.

[0016] Optionally, the acquired SVG format construction drawings are parsed to extract element attributes and transformation attributes, including:

[0017] The SVG format construction drawings are parsed using an HTML parser to construct a DOM tree structure;

[0018] Traverse the DOM tree structure to extract the text elements and the graphic elements;

[0019] Extract the transformation attribute from the text element and the graphic element.

[0020] Optionally, identifying the branch equipment and the construction system node from the text elements includes:

[0021] The branch device is identified from the text elements using a multi-level search strategy;

[0022] Based on the numbering pattern, the text elements are matched to obtain the construction system nodes.

[0023] Optionally, the text elements include: text elements and text fragment elements; identifying the branch device from the text elements through a multi-level search strategy includes:

[0024] The first-level matching step is to traverse the text fragment elements and match them based on preset keywords. If the match is successful, the branch device is generated. If the match fails, the second-level matching step is executed.

[0025] The second matching step is to traverse the text elements and their nested text fragment combinations, match the complete text containing the target device name of the external input, generate the branch device if the match is successful, and execute the third matching step if the match fails.

[0026] The third matching step: using a fuzzy matching algorithm, the text elements are scored for text similarity, and the branch device is determined based on the scoring results.

[0027] Optionally, a fuzzy matching algorithm is used to perform a comprehensive text similarity score on the text elements, and the branch device is determined based on the score result, including:

[0028] Extract the numeric sequence and special character identifiers from the target device name;

[0029] Calculate the numerical matching weight, special character matching weight, and text similarity weight of the text elements, and sum them to obtain a comprehensive score;

[0030] When the overall score is greater than the score threshold, the branch device is generated based on the target device name.

[0031] Secondly, the present invention provides a marking device for SVG construction drawings, comprising:

[0032] The structured information acquisition module is used to parse the acquired construction plan data using a pre-trained large language model to identify structured information including work content, risk items, and work grouping information.

[0033] The parsing module is used to parse the acquired SVG format construction drawings and extract element attributes and transformation attributes.

[0034] An identification module is used to identify construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes.

[0035] The coordinate calculation module is used to parse the translation and affine transformations in the transformation attributes and calculate the element coordinates of the construction system nodes.

[0036] A tagging module is used to generate different types of visual tags based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates;

[0037] The target construction drawing generation module is used to convert the visual markers and structured information into a parameter instruction set and merge it into the SVG format construction drawing to obtain the marked target construction drawing.

[0038] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the steps of the method provided in the first aspect above.

[0039] Fourthly, the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method provided in the first aspect above.

[0040] Fifthly, the present invention provides a computer program product comprising a computer program that, when executed by a processor, performs the steps of the method provided in the first aspect above.

[0041] As can be seen from the above technical solutions, the present invention has the following advantages:

[0042] This invention provides a method and apparatus for marking SVG construction drawings. The method includes: parsing acquired construction plan data using a pre-trained large language model to identify structured information including work content, risk factors, and work grouping information; parsing the acquired SVG format construction drawings to extract element attributes and transformation attributes; identifying construction system nodes, branch equipment, and the connection relationships between the branch equipment and the construction system nodes from the element attributes; parsing translation and affine transformations in the transformation attributes to calculate the element coordinates of the construction system nodes; generating different types of visual markers based on the branch equipment, construction system nodes, their connection relationships, and the element coordinates; and converting the visual markers and structured information into a parameter instruction set and merging it into the SVG format construction drawings to obtain the marked target construction drawings.

[0043] By analyzing the structure of SVG drawings and identifying key elements and their spatial relationships, visual markers are generated based on element attributes and coordinate information, and then merged into the original drawing. This overcomes the problems of limited processing power, insufficient industry adaptability, low marker accuracy, and difficulty in system integration inherent in traditional methods.

[0044] Meanwhile, by introducing large language model technology, the following significant advantages have been achieved: intelligent understanding and automated processing of unstructured natural language construction plans have been realized, reducing reliance on human expertise and manual configuration; through the reasoning capabilities of large language models, the content of construction plans can be more accurately associated with specific elements of drawings, generating more business-specific high-value tags, improving the accuracy and practicality of the tags; and an end-to-end automated process has been built, from text plans to final marked drawings without human intervention, greatly improving overall efficiency. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart illustrating the steps of a first embodiment of the SVG construction drawing marking method of the present invention;

[0047] Figure 2 This is a flowchart illustrating the second embodiment of the SVG construction drawing marking method of the present invention;

[0048] Figure 3 This is a structural block diagram of an embodiment of an SVG construction drawing marking device according to the present invention. Detailed Implementation

[0049] This invention provides a method and apparatus for marking SVG construction drawings. It is used to parse natural language construction plans through a large language model, automatically generate marking instructions, drive SVG marking tools to execute, and ultimately achieve fully automated and intelligent processing from construction plan text to drawing marking, significantly improving processing efficiency and accuracy.

[0050] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0051] Example 1

[0052] Please see Figure 1 , Figure 1This is a flowchart illustrating the steps of a first embodiment of an SVG construction drawing marking method according to the present invention. The method includes:

[0053] Step S101: Use a pre-trained large language model to parse the acquired construction plan data and identify structured information including work content, risk items and work grouping information.

[0054] Step S102: Parse the obtained SVG format construction drawings to extract element attributes and transformation attributes;

[0055] In this embodiment of the application, an SVG format construction drawing file is obtained and the SVG file is parsed. During the parsing process, element attributes, such as text elements and graphic elements, as well as transformation attributes, such as translation transformation and affine transformation, are extracted from the SVG file.

[0056] Step S103: Identify construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes;

[0057] Specifically, the element attributes include text elements and graphic elements; identifying construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes includes:

[0058] Identify the branch equipment and the construction system nodes from the text elements respectively;

[0059] Extract line elements and path elements from the graphic elements;

[0060] Based on the line elements and the path elements, the connection relationship between the branch equipment and the construction system node is identified.

[0061] In this embodiment, branch equipment and construction system nodes are identified from the extracted text elements, and line elements and path elements are extracted from the graphic elements. Then, based on the extracted line elements and path elements, the connection relationship between the branch equipment and the construction system nodes is identified.

[0062] Step S104: Analyze the translation and affine transformations in the transformation attributes, and calculate the element coordinates of the construction system nodes;

[0063] In this embodiment of the application, the translation and affine transformations in the extracted transformation attributes are analyzed to determine their transformation rules. Based on the analysis of the transformation rules and the initial information of the construction system nodes, the element coordinates of the construction system nodes are calculated.

[0064] Step S105: Based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates, generate different types of visual markers;

[0065] In this embodiment, the identified branch equipment, construction system nodes and their connections, as well as the calculated element coordinates, are integrated. Based on the construction plan and requirements, different types of visual markers are generated using the integrated information, such as work area markers, risk area markers, and safety warning icons.

[0066] Step S106: Convert the visual markers and structured information into a parameter instruction set and merge it into the SVG format construction drawing to obtain the marked target construction drawing.

[0067] In this embodiment of the application, the generated visual markers are embedded into the original SVG format construction drawings, and the drawings after embedding the markers are merged to obtain the marked target construction drawings.

[0068] This invention provides a method for marking SVG construction drawings, comprising: parsing acquired construction scheme data using a pre-trained large language model to identify structured information including work content, risk factors, and work grouping information; parsing the acquired SVG format construction drawings to extract element attributes and transformation attributes; identifying construction system nodes, branch equipment, and the connection relationships between the branch equipment and the construction system nodes from the element attributes; parsing translation and affine transformations in the transformation attributes to calculate the element coordinates of the construction system nodes; generating different types of visual markers based on the branch equipment, construction system nodes, their connection relationships, and the element coordinates; converting the visual markers and structured information into a parameter instruction set and merging it into the SVG format construction drawings to obtain the marked target construction drawings.

[0069] By analyzing the structure of SVG drawings and identifying key elements and their spatial relationships, visual markers are generated based on element attributes and coordinate information, and then merged into the original drawing. This overcomes the problems of limited processing power, insufficient industry adaptability, low marker accuracy, and difficulty in system integration inherent in traditional methods.

[0070] Meanwhile, by introducing large language model technology, the following significant advantages have been achieved: intelligent understanding and automated processing of unstructured natural language construction plans have been realized, reducing reliance on human expertise and manual configuration; through the reasoning capabilities of large language models, the content of construction plans can be more accurately associated with specific elements of drawings, generating more business-specific high-value tags, improving the accuracy and practicality of the tags; and an end-to-end automated process has been built, from text plans to final marked drawings without human intervention, greatly improving overall efficiency.

[0071] Example 2

[0072] Please see Figure 2 , Figure 2 This is a flowchart illustrating a second embodiment of the SVG construction drawing marking method of the present invention. The steps include:

[0073] Step S201: Use a pre-trained large language model to parse the acquired construction plan data and identify structured information including work content, risk items and work grouping information.

[0074] Step S202: Parse the SVG format construction drawings using an HTML parser and construct a DOM tree structure;

[0075] In this embodiment of the application, the parser is selected: an HTML parser (such as the html.parser parser of BeautifulSoup) is used to parse the SVG format construction drawings.

[0076] Building the DOM tree: During the parsing process, the SVG file is converted into a DOM tree structure, which facilitates subsequent operations and extraction of elements.

[0077] Step S203: Traverse the DOM tree structure and extract the text elements and the graphic elements;

[0078] In this embodiment of the application, the constructed DOM tree structure is traversed, each node in the tree is visited, and text elements (such as text elements and text fragment elements) and graphic elements are extracted during the traversal.

[0079] Step S204: Extract the transformation attribute from the text element and the graphic element;

[0080] In this embodiment of the application, information related to transformation attributes is searched and extracted from the extracted text elements and graphic elements.

[0081] Step S205: Identify the branch device from the text elements using a multi-level search strategy;

[0082] In this embodiment of the application, the text elements include: text elements and text fragment elements; identifying the branch device from the text elements through a multi-level search strategy includes:

[0083] The first-level matching step is to traverse the text fragment elements and match them based on preset keywords. If the match is successful, the branch device is generated. If the match fails, the second-level matching step is executed.

[0084] The second matching step is to traverse the text elements and their nested text fragment combinations, match the complete text containing the target device name of the external input, generate the branch device if the match is successful, and execute the third matching step if the match fails.

[0085] The third matching step: using a fuzzy matching algorithm, the text elements are scored for text similarity, and the branch device is determined based on the scoring results.

[0086] In an optional embodiment, a fuzzy matching algorithm is used to perform a comprehensive text similarity score on the text elements, and the branch device is determined based on the score result, including:

[0087] Extract the numeric sequence and special character identifiers from the target device name;

[0088] Calculate the numerical matching weight, special character matching weight, and text similarity weight of the text elements, and sum them to obtain a comprehensive score;

[0089] When the overall score is greater than the score threshold, the branch device is generated based on the target device name.

[0090] In this embodiment of the application, the first-level matching step is specifically as follows: traverse the text fragment elements and match them based on preset keywords (such as "change", "station", "kV", etc.). If the match is successful, a branch device is generated; if the match fails, the second-level matching step is executed.

[0091] The second-level matching step is as follows: traverse the text elements and their nested text fragment combinations, match the complete text containing the target device name of the external input, generate a branch device if the match is successful, and execute the third-level matching step if the match fails.

[0092] The third-level matching step involves extracting the numeric sequence and special character identifiers from the target device name. A fuzzy matching algorithm is used to calculate the numeric matching weight, special character matching weight, and text similarity weight of the text elements, and these are summed to obtain a comprehensive score. When the comprehensive score exceeds a threshold, a branch device is generated based on the target device name.

[0093] Step S206: Based on the numbering pattern, match the text elements to obtain the construction system nodes;

[0094] In this embodiment of the application, the numbering pattern of the construction system nodes is determined (e.g., numbering from #1 to #156), and then the extracted text elements are matched to find the elements that match the numbering pattern and identify them as construction system nodes.

[0095] Step S207: Extract line elements and path elements from the graphic elements;

[0096] In this embodiment of the application, line elements and path elements are selected from the extracted graphic elements.

[0097] Step S208: Based on the line elements and the path elements, identify the connection relationship between the branch equipment and the construction system nodes;

[0098] In this embodiment of the application, the position and connection of line elements and path elements are analyzed, and the connection relationship between branch equipment and construction system nodes is determined based on the analysis results.

[0099] Step S209: Analyze the translation and affine transformations in the transformation attributes, and calculate the element coordinates of the construction system nodes;

[0100] In this embodiment of the application, the translation and affine transformations in the transformation attributes are analyzed, and then the element coordinates of the construction system nodes are calculated based on the analysis results.

[0101] In the specific implementation, coordinate transformation algorithms are adopted, such as coordinate translation in the format of translate(x,y), affine transformation in the format of matrix(a,b,c,d,e,f), and combined transformation processing of multiple transformation types. Combined with Euclidean distance nearest neighbor node search, the identification of construction system nodes is realized, and then the element coordinates of construction system nodes are calculated.

[0102] Step S210: Based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates, generate different types of visual markers;

[0103] In this embodiment of the application, based on the construction plan and requirements, the identified branch equipment, construction system nodes and their connection relationships, as well as the calculated element coordinates, are integrated, and different types of visual markers are generated based on the integrated information.

[0104] In a preferred embodiment, before executing step S210, an intelligent parameter generation step is further included, specifically: the identified branch equipment, construction system nodes, their connection relationships, and element coordinate information, along with the externally input natural language construction plan document, are submitted to a large language model for processing; the large language model outputs targeted tag generation parameters based on its understanding of the semantics of the construction plan. These parameters include, but are not limited to: the scope of the work area to be tagged, the location and type of risk points, the type of icon to be embedded, and the color scheme for job grouping; step S210 then generates the visual tags based on the parameters output by the large language model.

[0105] Step S211: Convert the visual markers and structured information into a parameter instruction set and merge it into the SVG format construction drawing to obtain the marked target construction drawing.

[0106] In this embodiment of the application, the generated visual markers are embedded into the original SVG format construction drawings, and the drawings after embedding the markers are merged to obtain the marked target construction drawings.

[0107] This invention provides a method for marking SVG construction drawings. It converts verbal query commands into structured query intent information, then parses the SVG drawing structure and identifies key elements and their spatial relationships. Based on element attributes and coordinate information, it generates visual markers and merges them into the original drawing. This overcomes the limitations of traditional methods, such as limited processing power, insufficient industry adaptability, low marking accuracy, and difficulties in system integration.

[0108] To facilitate those skilled in the art to understand the beneficial effects of the present invention, the following is an example of an SVG construction drawing marking method based on an embodiment of the present invention, which is illustrated from four aspects: system implementation, method flow, practical application, and engineering case.

[0109] Example 1: This example provides an SVG-based intelligent marking system for construction drawings, including:

[0110] The SVG parsing module is responsible for parsing the SVG document structure and extracting text elements, graphic elements, and transformation attributes.

[0111] The element identification module is used to identify branch nodes, device identifiers, and connection relationships through a multi-level search strategy;

[0112] The tag generation module is used to generate different types of visual tags based on the recognition results;

[0113] The plug-in interface module provides a standardized API interface to support integration with third-party engineering software.

[0114] The SVG parsing module and the element recognition module are connected via a DOM event bus, ensuring that changes to the SVG document will notify the element recognition module in real time for re-analysis. The element recognition module and the markup generation module are connected via a data pipeline, transmitting the recognized element information to the markup generation module in structured data format. The markup generation module communicates with the plugin interface module through a standardized interface, supporting integration with various engineering software.

[0115] The SVG parsing module consists of a document parsing unit, an element extraction unit, and an attribute parsing unit.

[0116] The document parsing unit uses an HTML5-compliant parser to parse the input SVG document and construct its Document Object Model (DOM) tree structure. During the parsing process, it locates and verifies the existence of the SVG root element; if a valid SVG root element is not found, a format error exception is thrown.

[0117] The element extraction unit extracts key elements from SVG in batches by traversing the DOM tree structure and using selector patterns. Specifically, this includes locating and collecting all text elements (such as...). <text>and <tspan>Labels) and graphic elements (such as) <path> 、 <line> 、 <polyline>and <polygon>The tags are then categorized and returned for further processing. The Python code for this is as follows:

[0118]

[0119] The attribute parsing unit is responsible for parsing the transformation attributes (such as transform) of elements. This unit supports parsing various transformation types, including translation transformations (translate(x,y)) and affine transformation matrices (matrix(a,b,c,d,e,f)). It extracts valid translation parameters or displacement components from the transformation attribute string using regular expression pattern matching and converts them into numeric coordinate values. Its Python code representation is as follows:

[0120]

[0121] The element recognition module includes a branch recognition unit, a node localization unit, a connection analysis unit, and a fuzzy matching unit.

[0122] The branch recognition unit employs a multi-level progressive search strategy to identify branch devices from text elements:

[0123] First-level matching: Traversing text fragment elements ( <tspan>It performs precise matching based on a preset keyword library (such as "change", "station", "kV", etc.). If a match is successful, the corresponding branch device identifier is generated immediately.

[0124] Second-level matching: If the first-level matching fails, then iterate through the text elements ( <text>The system attempts to match the complete text of the target device name entered by the user from external input, along with its nested text fragments. If a match is found, a branch device is generated.

[0125] Third-level matching: If the first two levels fail to match, a fuzzy matching algorithm is used. This algorithm comprehensively evaluates the numerical sequence matching degree of text elements, the presence of special characters (such as "#"), and the overall text similarity, and calculates a comprehensive score. If the score exceeds a preset threshold, a branch device is generated based on the target device name. Its Python code representation is as follows:

[0126]

[0127]

[0128] The node localization unit performs nearest neighbor node search based on the element coordinates obtained from parsing, using spatial indexing and geometric calculation algorithms (such as Euclidean distance calculation). This unit traverses all possible text elements, filters out elements that match the target node numbering pattern, calculates their distance to a specified reference point, and if the distance is within tolerance, identifies it as a construction system node and records its coordinates and connection relationships.

[0129] The connection analysis unit analyzes graphic elements (including lines) <line>,path <path>, broken line <polyline>The geometric properties (such as start and end coordinates, path data point sequence, etc.) of elements are used to infer the connection relationships between them. By processing the geometric data of these elements, the physical or logical connection topology between branch equipment and construction system nodes is determined.

[0130] The fuzzy matching unit employs a fuzzy matching algorithm based on a combination of edit distance and feature weighting. This algorithm first extracts numeric sequences and special character identifiers from the target name and the text to be matched; then, it calculates the weights for numeric matching, special character matching, and similarity based on a text similarity algorithm (such as SequenceMatcher); finally, it sums these three weights to obtain a comprehensive score, and determines whether to generate a branch device based on the score threshold. Its Python code is as follows:

[0131]

[0132]

[0133]

[0134] The marking generation module includes: a work area marking unit, a risk area marking unit, a power outage area marking unit, an icon embedding unit, and a group identification unit.

[0135] The work area marking unit calculates the geometric boundary (e.g., minimum bounding rectangle) of the area to be marked based on the identified node coordinates. This unit supports configurable grouping color schemes (e.g., one group of blue, two groups of green, three groups of orange, and mixed red), and sets specific style attributes for the generated rectangular marking areas, such as semi-transparent fill (fill-opacity) and dashed border (stroke-dasharray). Finally, it creates the corresponding SVG graphic element and adds it to the specified location on the drawing.

[0136] Risk area marking unit, used to generate circular markers to identify risk points.

[0137] The power outage area marking unit is used to generate special style markings for the power outage area.

[0138] The icon embedding unit is responsible for embedding external icon resources into the SVG drawing. This unit first obtains the icon content (supporting download from the network or local retrieval), parses it, and then creates a container group based on the target location and specified size. <g>The element is defined, and the corresponding transformation attribute (translate) is set for positioning; then a new SVG element is created. <svg>The process involves copying the icon content into the drawing and adjusting its size and viewbox to fit the drawing scale; finally, the processed icon element is added to the drawing's DOM structure. The unit has a built-in exception handling mechanism, providing a fallback solution (such as adding a backup icon) in case icon processing fails. Its Python code representation is as follows:

[0139]

[0140]

[0141] Group identification unit, used to generate color-coded identifiers based on workgroups.

[0142] In addition, the work area marking units adopt a grouped color scheme: (1) Group 1: blue (#2196F3); (2) Group 2: green (#4CAF50); (3) Group 3: orange (#FF9800); (4) Mixed work: red (#FF0000). Each color mark uses 30% transparency fill and a dashed border (stroke-dasharray="8,4").

[0143] Specifically, the icon embedding unit includes:

[0144] The network download subunit supports downloading icon resources via HTTP / HTTPS protocols;

[0145] The format conversion subunit is used to convert formats such as PNG, JPEG, and SVG into base64 encoding;

[0146] The size optimization subunit is used to adjust the icon size to fit the drawing scale;

[0147] The location calculation subunit is used to automatically calculate the optimal placement position of the icon based on the marked area.

[0148] In addition, the plugin interface module adopts a standardized API design, supports parameter passing in JSON format, provides RESTful style interface calls, supports batch marking operations, and provides error handling and status feedback mechanisms.

[0149] Example 2: This example provides an SVG-based intelligent tagging method for construction drawings, applied to the SVG-based intelligent tagging system for construction drawings in Example 1. The steps include:

[0150] SVG document parsing steps: Receive SVG format construction drawings as input; construct the DOM tree structure using an HTML parser; extract text elements, graphic elements, and transformation attributes.

[0151] Element identification and location steps: Identify branch equipment names through keyword matching; identify power system nodes based on numbering patterns; calculate element coordinates and establish spatial indexes; analyze the connection relationships between elements.

[0152] Tag generation and rendering steps: Select the appropriate graphic style according to the tag type; calculate the geometric boundary of the tag area; generate SVG tag elements and set style attributes; embed risk icons and group identifiers.

[0153] Output and integration steps: Merge the tagging results into the original SVG document; verify the correctness of the output SVG format; return the tagging results through a standardized interface.

[0154] In some preferred embodiments of this example, the element identification and localization steps employ a branching algorithm and a node localization algorithm, with the following Plaintext tag descriptions:

[0155] Branch recognition algorithm:

[0156]

[0157] In some preferred embodiments of this example, the markup generation in the markup generation and rendering steps employs a configurable style system. An example of a Plaintext markup configuration is as follows:

[0158]

[0159]

[0160] Example 3: This example provides a method for generating a single working drawing based on an tagged SVG drawing, including: an information integration module: integrating task information, weather data, risk points, and grounding locations; a template rendering module: generating an A4-sized working drawing using a responsive HTML template; a content generation module: dynamically generating a list of work tasks and risk measure descriptions; and an interactive function module: providing drag-and-drop adjustment and scaling functions.

[0161] The worksheet generation module uses responsive HTML template technology to generate output documents conforming to the A4 size standard. The template defines a grid layout (CSS Grid) that divides the page into multiple functional areas, including a weather information area, a work task list area, an SVG drawing embedding area, and a risk information / grounding location display area. The final HTML document content is generated through dynamic data population (such as weather data, task list, SVG drawing URLs, risk point list, etc.). This template ensures clear display and good readability of the output content. Its Python code representation is as follows:

[0162]

[0163]

[0164] Example 4: In a 110kV substation renovation project, the construction drawings involve complex line markings and equipment identification. This example follows these steps:

[0165] 1. SVG Parsing Phase: The system receives an SVG file containing the substation's main wiring diagram. The document size is approximately 2MB, containing over 3000 SVG elements. Document parsing unit 5 completes DOM tree construction within 50ms, and element extraction unit 6 identifies 1200 text elements and 800 graphic elements.

[0166] 2. Element Recognition Stage: Branch Recognition Unit 8 successfully identified 15 branch devices, including "110kV Chunhua Substation" and "35kV Distribution Room A," with an accuracy rate of 98%. Node Positioning Unit 9 identified all nodes numbered from #1 to #156, with a coordinate resolution success rate of 95%.

[0167] 3. Marker generation stage: Based on the construction plan, the system generated 3 work area markers (Group 1 and Group 2 work areas), 2 risk area markers, and embedded 8 safety warning icons, with a processing time of approximately 200ms.

[0168] 4. One-map generation: Integrate weather information (temperature 32℃, humidity 65%), 24 work tasks, and 6 risk point descriptions to generate an A4-sized one-map, with a total processing time of approximately 500ms.

[0169] Through the above implementation methods, this example achieves high-precision intelligent marking of complex power engineering drawings, significantly improving the efficiency and quality of construction management. Compared with traditional manual marking methods, processing efficiency is increased by 80%, and marking accuracy is improved by 15%, providing strong technical support for the digital transformation of power engineering.

[0170] Example 3

[0171] Please see Figure 3 , Figure 3 This is a structural block diagram of an embodiment of a marking device for SVG construction drawings according to the present invention. The device includes:

[0172] The structured information acquisition module 301 is used to parse the acquired construction plan data using a pre-trained large language model, and identify structured information including work content, risk factors, and work grouping information.

[0173] Parsing module 302 is used to parse the acquired SVG format construction drawings and extract element attributes and transformation attributes;

[0174] The identification module 303 is used to identify construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes.

[0175] The coordinate calculation module 304 is used to parse the translation and affine transformations in the transformation attributes and calculate the element coordinates of the construction system nodes.

[0176] The tagging module 305 is used to generate different types of visual tags based on the branch equipment, construction system nodes and their connection relationships and the element coordinates;

[0177] The target construction drawing generation module 306 is used to convert the visual markers and structured information into a parameter instruction set and merge it into the SVG format construction drawing to obtain the marked target construction drawing.

[0178] In an optional embodiment, the element attributes include text elements and graphic elements; the recognition module 302 includes:

[0179] Identify sub-modules, used to identify the branch equipment and the construction system nodes from the text elements respectively;

[0180] Extract sub-modules to extract line elements and path elements from the graphic elements;

[0181] The connection relationship determination sub-module is used to identify the connection relationship between the branch equipment and the construction system node based on the line element and the path element.

[0182] In an optional embodiment, the parsing module 301 includes:

[0183] Construct sub-modules to parse the SVG format construction drawings using an HTML parser and build a DOM tree structure;

[0184] The element extraction submodule is used to traverse the DOM tree structure and extract the text elements and the graphic elements.

[0185] The transformation attribute extraction submodule is used to extract the transformation attributes from the text elements and the graphic elements.

[0186] In an optional embodiment, the identification sub-module includes:

[0187] A branch device identification unit is used to identify the branch device from the text elements through a multi-level search strategy;

[0188] The matching unit is used to match the text elements based on the numbering pattern to obtain the construction system nodes.

[0189] In an optional embodiment, the text element includes: text elements and text fragment elements; the latter includes:

[0190] The first-level matching unit is used to traverse the text fragment elements and match them based on preset keywords. If the match is successful, the branch device is generated; if the match fails, it is input to the second-level matching unit.

[0191] The second-level matching unit is used to traverse the text elements and their nested text fragment combinations, match the complete text containing the target device name of the external input, generate the branch device if the match is successful, and input the third-level matching unit if the match fails.

[0192] The third-layer matching unit is used to perform a comprehensive text similarity score on the text elements using a fuzzy matching algorithm, and to determine the branch device based on the score result.

[0193] In an optional embodiment, the third-layer matching unit includes:

[0194] An extraction subunit is used to extract the numeric sequence and special character identifiers from the target device name;

[0195] The evaluation subunit is used to calculate the numerical matching weight, special character matching weight, and text similarity weight of the text element, and sum them to obtain a comprehensive score;

[0196] A branch device determination subunit is used to generate the branch device based on the target device name when the comprehensive score is greater than the score threshold.

[0197] Example 4

[0198] This invention also provides an electronic device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a marking method for SVG construction drawings according to any embodiment.

[0199] Example 5

[0200] This invention also provides a computer storage medium storing a computer program thereon, wherein the computer program, when executed by the processor, implements the steps of a marking method for SVG construction drawings according to any embodiment.

[0201] Example 6

[0202] This invention also provides a computer program product having a computer program stored thereon, wherein when the computer program is executed by the processor, it implements the steps of a marking method for SVG construction drawings according to any embodiment.

[0203] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0204] In the several embodiments provided in this application, it should be understood that the methods, apparatuses, electronic devices, and storage media disclosed in this invention can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0205] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0206] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0207] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0208] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / svg> < / g> < / polyline> < / path> < / line> < / text> < / tspan> < / polygon> < / polyline> < / line> < / path> < / tspan> < / text>

Claims

1. A marking method for SVG construction drawings, characterized in that, include: The pre-trained large language model is used to parse the acquired construction plan data and identify structured information including work content, risk items and work grouping information. The acquired SVG format construction drawings are parsed to extract element attributes and transformation attributes; Identify construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes; Analyze the translation and affine transformations in the transformation attributes, and calculate the element coordinates of the nodes in the construction system; Based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates, different types of visual markers are generated; The visual markers and structured information are converted into a set of parameter instructions and merged into the SVG format construction drawings to obtain the marked target construction drawings.

2. The marking method for SVG construction drawings according to claim 1, characterized in that, The element attributes include text elements and graphic elements; Identifying construction system nodes, branch equipment, and the connection relationships between the branch equipment and the construction system nodes from the element attributes includes: Identify the branch equipment and the construction system nodes from the text elements respectively; Extract line elements and path elements from the graphic elements; Based on the line elements and the path elements, the connection relationship between the branch equipment and the construction system node is identified.

3. The marking method for SVG construction drawings according to claim 2, characterized in that, The acquired SVG format construction drawings are parsed to extract element attributes and transformation attributes, including: The SVG format construction drawings are parsed using an HTML parser to construct a DOM tree structure; Traverse the DOM tree structure to extract the text elements and the graphic elements; Extract the transformation attribute from the text element and the graphic element.

4. The marking method for SVG construction drawings according to claim 3, characterized in that, Identifying the branch equipment and the construction system nodes from the text elements includes: The branch device is identified from the text elements using a multi-level search strategy; Based on the numbering pattern, the text elements are matched to obtain the construction system nodes.

5. The marking method for SVG construction drawings according to claim 4, characterized in that, The text elements include: text elements and text fragment elements; identifying the branch device from the text elements through a multi-level search strategy includes: The first-level matching step is to traverse the text fragment elements and match them based on preset keywords. If the match is successful, the branch device is generated. If the match fails, the second-level matching step is executed. The second matching step is to traverse the text elements and their nested text fragment combinations, match the complete text containing the target device name of the external input, generate the branch device if the match is successful, and execute the third matching step if the match fails. The third matching step: using a fuzzy matching algorithm, the text elements are scored for text similarity, and the branch device is determined based on the scoring results.

6. The marking method for SVG construction drawings according to claim 5, characterized in that, Using a fuzzy matching algorithm, the text elements are comprehensively scored for text similarity, and the branch device is determined based on the scoring results, including: Extract the numeric sequence and special character identifiers from the target device name; Calculate the numerical matching weight, special character matching weight, and text similarity weight of the text elements, and sum them to obtain a comprehensive score; When the overall score is greater than the score threshold, the branch device is generated based on the target device name.

7. A marking device for SVG construction drawings, characterized in that, include: The structured information acquisition module is used to parse the acquired construction plan data using a pre-trained large language model to identify structured information including work content, risk items, and work grouping information. The parsing module is used to parse the acquired SVG format construction drawings and extract element attributes and transformation attributes. An identification module is used to identify construction system nodes, branch equipment, and the connection relationship between the branch equipment and the construction system nodes from the element attributes. The coordinate calculation module is used to parse the translation and affine transformations in the transformation attributes and calculate the element coordinates of the construction system nodes. A tagging module is used to generate different types of visual tags based on the branch equipment, construction system nodes and their connection relationships, and the element coordinates; The target construction drawing generation module is used to convert the visual markers and structured information into a parameter instruction set and merge it into the SVG format construction drawing to obtain the marked target construction drawing.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the method as described in any one of claims 1-6.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-6.