Artificial intelligence assistant for examining CAD drawing of transformer substation
By building the artificial intelligence assistant for substation CAD drawings, the problem of inefficiency of existing tools in complex drawing reviews is solved, efficient and accurate drawing reviews are achieved, and the automation level and intelligence of the system are improved.
Patent Information
- Application Number
- CN202510595157.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-26
AI Technical Summary
The existing substation CAD drawing review tools cannot effectively handle complex electrical system drawings, lack a deep understanding of design specifications, and cannot update and optimize audit rules in real time, resulting in inefficient reviews and high risk of errors.
Using artificial intelligence methods, DWG drawings and review specification PDF files are obtained through a unified interface, element analysis and OCR processing are carried out, location-based drawing knowledge graphs and review rules text vector knowledge bases are built, knowledge graphs and rules bases are integrated using the LangChain framework, and intelligent audits are combined with deep learning models to generate visual review reports.
It improves the efficiency and accuracy of substation drawing review, reduces human errors, enhances the compatibility and flexibility of the system, realizes automated equipment identification and topological relationship analysis, and supports real-time rule application and visual feedback.
Smart Images

Figure CN120541896A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of drawing review, and in particular to an artificial intelligence assistant for reviewing substation CAD drawings. Background Art
[0002] In modern power system design, substation drawings are crucial documents used to demonstrate equipment configuration and electrical connections. Traditionally, substation drawing reviews are often conducted manually, with reviewers manually checking that connections between equipment, electrical circuits, and spacing between equipment meet relevant standards based on design specifications. To improve review efficiency, some tools have begun to incorporate automated review capabilities from computer-aided design (CAD) software. For example, CAD software such as AutoCAD provides basic drawing drawing and graphic recognition capabilities, allowing for simple drawing verification based on user-defined rules. However, traditional drawing review tools are mostly based on preset rules, and the creation, updating, and maintenance of rules is cumbersome, requiring manual intervention. Furthermore, they are unable to automatically reason and adapt to new design changes based on complex drawing content.
[0003] With the rapid development of artificial intelligence (AI) technology, a growing number of studies are exploring its application to drawing review. AI, in particular, offers enhanced automated processing capabilities in terms of primitive recognition and semantic understanding. Existing AI-assisted tools are typically able to automatically identify basic primitives (such as lines, circles, and blocks) in CAD drawings and perform geometric analysis. However, when faced with complex electrical system drawings like substations, existing tools still have significant limitations in accurately extracting device information, identifying topological relationships between devices, and conducting intelligent reviews based on design specifications. Most of these tools are unable to effectively handle the complexity of drawings, lack a deep understanding of design specifications, and fail to integrate complex information such as spatial relationships between devices and electrical connections into structured knowledge. This inability to update and optimize review rules in real time leads to inefficient reviews and the risk of errors. Summary of the Invention
[0004] This application provides an artificial intelligence assistant for reviewing substation CAD drawings, which can automatically extract equipment information from the drawings, identify equipment topology relationships, and conduct accurate and rapid reviews in combination with relevant review rules, thereby significantly improving the efficiency and accuracy of substation drawing reviews.
[0005] The present application provides an artificial intelligence method for reviewing substation CAD drawings, which includes: obtaining DWG drawings and review specification PDF files as review materials through a unified interface, wherein the DWG drawings are obtained by uploading files or selecting a drawing area in AutoCAD; performing graphic element parsing on the DWG drawings, and using pyautocad or ezdxf libraries to extract layer, line, polyline, spline curve, circle, arc, ellipse and block graphic element information to obtain device entity information and device topology relationship; constructing a location-based drawing knowledge graph based on the device entity information and the device topology relationship, and converting the drawing knowledge graph into an IEC 60624-2-2-1. The 61850 standard is stored in the Neo4j database to obtain the knowledge graph of substation drawings; the review specification PDF file is subjected to OCR processing and text vectorization, and the text is divided into blocks and vectorized using the BERT model customized for the power industry and stored in the FAISS search library to obtain the review rule text vector knowledge base; the LangChain framework is used to integrate the substation drawing knowledge graph and the review rule text vector knowledge base to construct a hybrid retriever, and the relevant context is retrieved according to the review requirements and scope entered by the user to obtain optimized prompt words; the optimized prompt words are input into the locally deployed deepseek large model for review reasoning to obtain a review report, and the error location is selected with a red box in AutoCAD based on the error coordinates in the review report.
[0006] In the technical solution provided by this application, by obtaining DWG drawings and review specification PDF files as review materials through a unified interface, the problem of inconsistent processing of drawings of different formats and sources in traditional drawing review is solved. Whether it is a DWG file uploaded by the user or a drawing area selected in AutoCAD, it can be processed through a unified interface, thereby ensuring the integrity and losslessness of the drawing information and improving the compatibility and flexibility of the system. Secondly, the system uses pyautocad or ezdxf library for primitive parsing. Through multi-level primitive recognition, combined primitive recognition and semantic annotation extraction, it can automatically extract the device entity information and topological relationship in the drawing, avoiding errors and inconsistencies in manual intervention. This process can not only identify the geometric shape of the device, but also parse the attribute information, position relationship and connection relationship of the device, thereby improving the accuracy of device identification. By constructing device information and topological relationships into a location-based drawing knowledge graph, the system expands the drawing review process from simple geometric shape recognition to more complex spatial and electrical relationship analysis. Based on the IEC 61850 standard, the standardized processing of device attributes and the standardized definition of inter-device relationships ensure that each device node in the drawing and its connections have clear semantic identification and can be stored and queried according to a standardized structure. This design not only improves the accuracy of drawing review but also provides a structured knowledge foundation for subsequent reasoning and knowledge deduction. Combining OCR processing and text vectorization of review specification PDF files, the system converts review specifications into high-dimensional text vectors. Using the FAISS search library, an efficient vector index is established, enabling the system to quickly retrieve and match relevant review rules, significantly improving the real-time and accurate application of rules. By integrating the substation drawing knowledge graph with the review rule text vector knowledge base through the LangChain framework, the system enables more intelligent retrieval. Optimized prompt word generation is based on the spatial relationships of the drawings and the review rules, enabling the system to not only perform simple rule matching but also conduct complex compliance checks through multi-dimensional intelligent reasoning. The optimized prompt words are fed into a locally deployed deep learning model for review reasoning, and errors are annotated with red borders in AutoCAD, further enhancing the visualization and interactivity of the review results. This process not only automatically identifies issues within drawings but also provides intuitive feedback to users, making drawing modifications and error correction more efficient. By displaying issues in a hierarchical manner, the system prioritizes issues by severity, helping users prioritize the most important review issues. User feedback controls are used to collect feedback on the accuracy of review results and provide modification suggestions, continuously optimizing the model's reasoning capabilities and ensuring that the system improves review accuracy and reliability over time.In short, this solution not only greatly improves the efficiency of drawing review through intelligent drawing analysis and rule review, but also reduces human errors while ensuring the quality of review, greatly improving the automation and intelligence level of substation drawing review. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0008] Figure 1 This is a schematic diagram of an embodiment of an artificial intelligence method for reviewing substation CAD drawings in an embodiment of the present application. DETAILED DESCRIPTION
[0009] An embodiment of the present application provides an artificial intelligence method for reviewing substation CAD drawings. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0010] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In one embodiment of the present application, an artificial intelligence method for reviewing substation CAD drawings includes:
[0011] Step S101: Obtain a DWG drawing and a review specification PDF file as review materials through a unified interface. The DWG drawing is obtained by uploading a file or selecting a drawing area in AutoCAD.
[0012] Among them, the DWG drawings are preprocessed, and the coordinate information under the world coordinate system is uniformly converted into millimeter units to obtain standardized coordinate data; the standardized coordinate data is subjected to graphic element version control, and the drawing status snapshot at each review is recorded to obtain drawing version information; the drawing version information is incrementally updated and marked, and the changed parts of the drawing are identified to obtain changed area data; the changed area data is cleaned and processed, overlapping graphic elements are merged and broken line segments are repaired to obtain optimized graphic element data; the optimized graphic element data is subjected to functional area identification, and the main equipment area, secondary circuit area and grounding network area are marked to obtain functional zoning information; the functional zoning information is associated and matched with the review specification PDF file, and the corresponding specification clauses are screened for each functional area to obtain the regionalized review basis.
[0013] Specifically, the process involves obtaining DWG drawings and review specification PDF files as review materials through a unified interface. This process first requires two methods for obtaining the drawing materials through the user interface. The first method is for the user to upload the DWG drawing file, while the second is for the user to select a specific drawing area for review in AutoCAD. Both methods import the drawing information into the system through a unified interface, ensuring the integrity of the acquired drawing data. The system performs a series of preprocessing operations on the uploaded DWG drawing files. Specifically, the coordinate information in DWG drawings is typically based on the World Coordinate System (WCS) and may have varying units, such as millimeters, centimeters, or inches. Drawing review requires that all coordinate information in the drawing be consistent. Therefore, the system first standardizes all coordinates in the DWG drawing. By converting the coordinate information to millimeters, the system ensures that the positional data of all elements is within a unified metric space. During this process, the system automatically determines the actual units of the drawing by detecting the drawing's unit settings and converts all coordinates to standard coordinates in millimeters using a linear mapping algorithm, ensuring data consistency and accuracy.
[0014] After standardizing drawing coordinate information, the next task is to implement version control for elements. During each drawing review, the system takes a snapshot of the drawing's status and generates version information. This version control mechanism tracks the results of each review and records the specific content of each change, making it easier to quickly identify changes during subsequent reviews. For example, if certain parts of a drawing have been modified, the system accurately marks these changed areas and performs incremental updates to those areas, avoiding repeated reviews of unchanged areas. This incremental update mechanism significantly improves review efficiency and reduces unnecessary calculations and time. To further optimize drawing quality, the system cleans up the data in the changed areas. This process merges overlapping elements and repairs any broken lines. For example, in some drawings, broken lines may appear due to improper design or during drawing conversion, resulting in incomplete element information. The system automatically repairs these broken lines to ensure the integrity of each element. Furthermore, the system cleans up redundant layers in the drawing, removing irrelevant or redundant elements to optimize drawing processing efficiency and accuracy.
[0015] After optimizing the drawing metadata, the system identifies functional areas and further marks key areas within the drawing. These areas may include the main equipment area, secondary circuit area, and grounding network area. Based on the geometric information and semantic annotations in the drawing, the system automatically identifies these areas and assigns corresponding functional labels to each area. For example, the main equipment area may include key equipment such as transformers and circuit breakers, while the grounding network area marks all grounding-related electrical equipment. This method clearly delineates the different functional areas within the drawing, providing a more precise regionalization basis for subsequent review. Once the functional areas of the drawing are identified and marked, the system correlates this information with the review specification PDF file. The text data in the review specification PDF file also requires processing to ensure effective integration with the drawing data. The system extracts text from the PDF file using OCR technology or the PyPDF2 library, cleansing and structuring the extracted text. This pre-processed review specification file more accurately matches the functional areas in the drawing. The system then selects relevant regulatory clauses for each functional area based on its characteristics. For example, for the main equipment area, the system will filter out the requirements related to the installation of the substation's main equipment from the review specifications, including spacing requirements between equipment and electrical connection requirements. In this way, the system can provide a corresponding review basis for each functional area, ensuring that the design drawings comply with relevant specifications and standards.
[0016] Step S102: performing primitive parsing on the DWG drawing, extracting layer, line, polyline, spline, circle, arc, ellipse and block primitive information using pyautocad or ezdxf library to obtain device entity information and device topology relationship;
[0017] Among them, the graphic element information is subjected to multi-level recognition, and basic graphic element data is obtained through basic graphic element recognition, combined graphic element recognition and semantic annotation extraction; the basic graphic element data is subjected to equipment type recognition, and transformers, circuit breakers, disconnectors, busbars and capacitors are identified through standard graphic template matching to obtain equipment type data; attribute extraction is performed on the equipment type data, and the equipment model, rated voltage, rated current and capacity are extracted to obtain equipment attribute data; coordinate position analysis is performed on the equipment attribute data, and the installation position and spatial orientation information of the equipment are extracted to obtain equipment space data; line segment connection analysis is performed on the equipment space data, and the connection status of wires and cables and the node position are identified to obtain connection relationship data; breakpoint detection and merging processing are performed on the connection relationship data, and the discontinuity points in the connection line are intelligently connected to obtain a complete equipment topology relationship.
[0018] Specifically, DWG drawings are parsed, extracting primitive information from them using the pyautocad or ezdxf libraries. This information is then converted into device entity information and device topology relationships. This step is divided into multiple subtasks, starting with identifying basic primitives, identifying device types, extracting device attributes and spatial information, analyzing inter-device connectivity, and finally detecting and merging connectivity breakpoints to ensure a complete device topology. The system extracts primitive information from DWG drawings using the pyautocad or ezdxf libraries. Primitives in DWG drawings include various geometric shapes, such as layers, lines, polylines, splines, circles, arcs, ellipses, and blocks. Using these primitives, the system can determine the geometric composition of the drawing and perform further processing based on this information. The primary task of primitive parsing is multi-level recognition. Specifically, basic primitive recognition begins with identifying basic geometric elements (such as points, lines, and circles) in the DWG drawing. Next, combined primitive recognition is performed. This stage focuses on identifying complex shapes composed of multiple basic primitives, such as graphical representations of equipment such as transformers and circuit breakers. Finally, the system performs semantic annotation extraction, assigning domain-specific semantics to each primitive through information such as text annotations in the drawing and the name of the primitive. For example, the block primitive labeled "transformer" in the drawing is identified and, based on its annotation, is identified as a transformer device. After completing the recognition of basic and combined primitives, the system will begin to identify the device type. This stage is achieved through standard graphic template matching. The system has built-in standard graphic templates for power equipment, such as transformers, circuit breakers, disconnectors, busbars, capacitors, and other equipment. The system identifies the type of these devices by matching the shapes of the primitives in the DWG drawings. For example, if a block primitive in the drawing has a shape similar to a predefined transformer template, the system will identify it as a transformer.
[0019] After identifying the device type, the system extracts device attribute data for each device. Device attribute extraction is based on device type, including information such as model, rated voltage, rated current, and capacity. The device model can be obtained from annotations or attribute fields in the drawing, while parameters such as rated voltage, rated current, and capacity can be extracted from the device label or other text annotations associated with the device. By extracting these attributes, the system not only determines the device type but also understands each device's technical specifications. The system analyzes the device's coordinate position to extract its installation location and spatial orientation. Devices in DWG drawings are typically represented by coordinate values. The system parses these coordinate values to determine the device's specific location and analyze its spatial orientation. For example, in a substation drawing, the transformer's installation location may be represented by coordinate points. The system extracts these coordinates to determine the transformer's spatial position and analyzes the device's orientation using its coordinate system. Spatial orientation information is crucial for determining the relative position of a device relative to other devices, particularly when performing spatial layout analysis.
[0020] The system performs line segment connectivity analysis on the extracted device spatial data. Connectivity information between devices is crucial for power system design, and the system needs to identify the connections between wires and cables in the drawings. In DWG drawings, connecting wires and cables are typically represented by line segments. The system analyzes the endpoints and connection relationships of these segments, identifying the electrical connections between devices and forming a topological relationship between them. This topological relationship not only includes physical connections but may also include information such as electrical circuits and protection circuits.
[0021] After analyzing the connection relationships, the system detects and merges breakpoints. In some drawings, due to improper design or errors during conversion, connection lines may be broken, resulting in missing or incorrect topological relationships. The system uses intelligent algorithms to detect these breakpoints and merge them. For example, if a line segment has a gap between two points, the system can automatically fill the connection between the two endpoints to ensure the integrity of the connection relationship. In this way, the system can repair breakpoints in the drawing and obtain a complete device topology.
[0022] Step S103: construct a location-based drawing knowledge graph based on the device entity information and the device topology relationship, and store the drawing knowledge graph in a Neo4j database according to the IEC 61850 standard to obtain a substation drawing knowledge graph;
[0023] Among them, the attribute normalization processing of the equipment entity information is performed, and the entity type and standard attribute set are defined according to the IEC 61850 standard to obtain a standardized entity node; the relationship type definition of the equipment topology relationship is performed, and the physical connection, electrical relationship and spatial relationship are mapped to a standardized edge type to obtain a relationship edge set; a triple structure is constructed based on the standardized entity node and the relationship edge set to form an entity-relationship-entity knowledge representation to obtain an initial knowledge graph; the initial knowledge graph is hierarchically organized and associated according to the hierarchical structure of the substation as a whole, functional areas and equipment components to obtain a hierarchical knowledge graph; spatial relationship reasoning is performed on the hierarchical knowledge graph, and the proximity, inclusion and distance values are calculated based on the coordinate position of the entity to obtain a spatially enhanced knowledge graph; a consistency check is performed on the spatially enhanced knowledge graph to verify the consistency of the knowledge representation with the original drawing and incrementally update the version record to obtain a substation drawing knowledge graph.
[0024] Specifically, a location-based drawing knowledge graph is constructed based on device entity information and device topological relationships. This knowledge graph is then stored in a Neo4j database in accordance with the IEC 61850 standard, ultimately resulting in a substation drawing knowledge graph. To achieve this, the device entity information attributes must first be normalized, converting this information into standardized entity nodes. The topological relationships between devices are then defined, ultimately forming a preliminary knowledge graph by constructing a triple structure. The device entity information undergoes attribute normalization. According to the IEC 61850 standard, device attributes must meet specific requirements, so the system standardizes all extracted device information. The IEC 61850 standard defines clear entity types and attribute sets for power system equipment, including device type (such as transformers and circuit breakers), and parameters such as rated voltage, current, and power. The system converts these raw device attributes into a format compliant with the IEC 61850 standard to ensure uniformity and consistency in device entity information. For example, if the labeling information of a device includes the rated voltage of "110kV", and the labeling of another device is "high-voltage capacitor", the system will standardize them into a unified attribute type according to the IEC 61850 standard, thereby generating standardized entity nodes and laying the foundation for subsequent knowledge graph construction.
[0025] Next, the system defines the topological relationships between devices and maps these relationships into standardized edge types. In substation CAD drawings, the connectivity between devices is crucial. These typically include physical connections (such as conductor connections and grounding systems), electrical relationships (such as electrical circuits and protection circuits), and spatial relationships (such as the relative positions of devices). The system maps these different types of relationships into standardized edge types, each representing a different type of connectivity. For example, a physical connection might be represented as "conductor connection," an electrical relationship as "current circuit," and a spatial relationship as "adjacent devices." By defining these edge types, the system can clearly express various relationships between devices and provides foundational data for subsequent reasoning and querying. Based on the standardized set of entity nodes and relationship edges, the system constructs a triple structure, known as the entity-relationship-entity knowledge representation. This process maps device entities and their connectivity relationships into a graph structure, with each triple representing a specific relationship between one device and another. For example, the connectivity between a transformer and a circuit breaker can be represented as a triple, where the transformer and circuit breaker are entities and the conductor or electrical circuit connecting them is a relationship. In this way, the system can convert the equipment information and topological relationships in the substation drawings into triple structures that can be efficiently stored and queried in the graph database, and ultimately form a preliminary knowledge graph.
[0026] After generating a preliminary knowledge graph, the system organizes it hierarchically. Equipment in substation drawings is typically divided into functional areas, such as the main transformer area, distribution equipment area, and grounding network area. The system organizes the initial knowledge graph based on the substation's functional divisions and the hierarchical structure of equipment components. This allows the relationships between devices in the graph to be linked according to their functional areas and hierarchical relationships, making the graph more structured and facilitating subsequent querying and reasoning. For example, the system might place all equipment belonging to the main transformer area in one hierarchy and equipment in the distribution equipment area in another. The system also performs spatial relationship reasoning on the hierarchical knowledge graph. Because the layout of equipment within the substation is crucial, the system calculates spatial relationships between devices, such as proximity, inclusion, and distance, based on their coordinate locations. For example, if the coordinate locations of two devices are very close, the system infers that they may have a certain spatial relationship, such as being adjacent or proximal. Spatial relationship reasoning helps the system understand the spatial layout of equipment and provides effective information for subsequent design verification, optimization, and problem location.
[0027] After completing spatial relationship reasoning, the system performs a consistency check on the spatially enhanced knowledge graph. At this point, the system checks whether the information in the knowledge graph is consistent with the original drawing and performs any necessary incremental updates. The incremental update mechanism ensures that when the drawing changes, the knowledge graph accurately reflects these changes. For example, if the location of a device in a drawing changes, the system can update the coordinate information of the device in the knowledge graph to maintain consistency between the drawing and the knowledge graph. This process also includes version logging to ensure that the knowledge graph is preserved after each drawing change, facilitating subsequent query and tracing.
[0028] Step S104: Perform OCR processing and text vectorization on the review specification PDF file, use the BERT model customized for the power industry to vectorize the text into blocks and store them in the FAISS search library to obtain a review rule text vector knowledge base;
[0029] Among them, text extraction is performed on the review specification PDF file, and the text content in the document is identified using an OCR tool or the PyPDF2 library to obtain the standard original text; the standard original text is preprocessed to remove headers, footers and garbled characters, and the terminology is unified to obtain a cleaned text; the cleaned text is structured and segmented, and the text units are divided into paragraphs, chapters or fixed lengths to obtain a text block set; regular statements are identified on the text block set, and the content containing constraints, specification requirements and design standards is marked to obtain regular text blocks; the regular text blocks are input into the customized BERT model for the power industry, and professional semantics are captured through a multi-layer attention mechanism to obtain a high-dimensional text vector; the high-dimensional text vector is indexed and constructed, and the FAISS library is used to create an HNSW index structure to support millisecond-level queries to obtain a review rule text vector knowledge base.
[0030] Specifically, the system performs optical character recognition (OCR) processing and text vectorization on PDF files of review specifications. Using a BERT model customized for the power industry, the text is segmented and vectorized, stored in the FAISS search database, and ultimately builds a text vector knowledge base of review rules. This process involves multiple key steps, from text extraction, preprocessing, structured segmentation, identification of rule statements, to BERT model vectorization and FAISS index construction, ensuring the system can efficiently process and query review specifications. Text extraction is the starting point of the entire process. During this process, the system uses OCR tools or the PyPDF2 library to extract text from PDF files. Optical Character Recognition (OCR) tools are particularly well-suited for processing scanned PDF files of review specifications, recognizing text in images as text. For electronic PDFs, the system can directly use the PyPDF2 library to read the text content within the document. These methods ensure that the system can extract the original text content from review specification files of various formats.
[0031] Next, the extracted standard raw text enters the preprocessing stage. During this stage, the system performs a series of operations on the extracted text to ensure its suitability for subsequent vectorization and rule recognition. First, the system removes headers and footers from the text, as well as any unnecessary, garbled characters that may affect text quality. Headers and footers typically contain information such as page numbers and document titles, but are not meaningful for text analysis and therefore need to be removed. Next, the system performs terminology unification, standardizing the specialized terminology within the document to ensure consistency in subsequent processing. For example, the system might standardize "circuit breaker" as "switchgear" and "voltage level" as "rated voltage." Through these steps, the system ultimately produces a cleaned text, preparing it for subsequent analysis. The system then performs structured segmentation on the cleaned text. This step involves segmenting the text into multiple text units according to specific rules, typically by paragraph, chapter, or fixed length. For example, the system might segment text at the beginning of each chapter or paragraph to ensure that each text block has independent semantics and logical structure. This process helps the system better understand the text content and provides structured information for subsequent regular statement recognition and vectorization processing.
[0032] After text segmentation, the system enters the regular statement identification stage. In this step, the system analyzes the content of text blocks to identify regular statements. These regular statements typically include constraints, regulatory requirements, and design standards specified in the review specifications. For example, a review specification might state, "Transformer spacing should comply with the requirement of no less than 5 meters." This type of content is marked as a regular text block by the system. By identifying regular statements, the system accurately extracts key information required for review, providing a foundation for subsequent reasoning and retrieval. After extracting regular text blocks, the system inputs these blocks into a BERT model customized for the power industry for vectorization. BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model based on Transformers. When processing natural language, it uses a multi-layer attention mechanism to capture the deep semantics of text. Unlike general-purpose BERT models, this system uses a customized BERT model for the power industry. Trained on literature and datasets related to the power industry, the model's understanding of power industry terminology and specialized semantics is enhanced. The rule text blocks input into the BERT model are converted into high-dimensional text vectors. These vectors can effectively capture the semantic information in the text and provide support for subsequent queries and reasoning. The system will index and build these high-dimensional text vectors. In order to quickly retrieve rules related to user review requirements, the system uses the FAISS (Facebook AI Similarity Search) library to build vector indexes. FAISS is an efficient similarity search library that supports quickly finding the most similar vectors in massive high-dimensional vectors. In this process, the system uses an approximate nearest neighbor search algorithm, which can maintain a query response speed of milliseconds when processing hundreds of millions of vectors. In this way, the system establishes an efficient review rule text vector knowledge base that can quickly respond to review queries entered by users.
[0033] Step S105: Using the LangChain framework, the substation drawing knowledge graph and the review rule text vector knowledge base are integrated to construct a hybrid search engine, and the relevant context is retrieved according to the review requirements and scope input by the user to obtain optimized prompt words;
[0034] Among them, the review requirements input by the user are semantically decomposed to identify the review object, review scope and review standard to obtain structured review requirements; based on the structured review requirements, a graph query is performed in the substation drawing knowledge graph, relevant equipment nodes and connection relationships are extracted, and a graph retrieval result is obtained; based on the structured review requirements, a semantic search is performed in the review rule text vector knowledge base, vector similarity is calculated and sorted, and a rule retrieval result is obtained; the graph retrieval result and the rule retrieval result are fused and sorted, and the search content is integrated according to relevance and importance to obtain a hybrid retrieval result; based on the hybrid retrieval result, a multi-level structure prompt word is constructed, and a task instruction layer, a context information layer, an inference framework layer and an output specification layer are designed to obtain a prompt word template; the prompt word template is filled and combined with the structured review requirements and the hybrid retrieval results to form a complete prompt word that explicitly guides the reasoning process, and an optimized prompt word is obtained.
[0035] Specifically, the review requirements entered by the user undergo semantic decomposition. The goal of this stage is to transform the user's natural language input into a structured review requirement, including a clear review object, scope, and criteria. For example, a user might enter "Check whether the distance between the transformer and the fence meets specifications." During this process, the system identifies "transformer" as the review object, "fence" as the relevant equipment, and "distance requirement" as the review criteria. Through semantic decomposition, the system can transform user input into a specific structured requirement, providing clear guidance for subsequent retrieval and reasoning. Based on the structured review requirements, a graph query is performed within the substation drawing knowledge graph. The substation drawing knowledge graph contains device nodes, connection relationships, and spatial layout information. Therefore, the system can query the graph based on the user's review requirements and extract relevant device nodes and their connection relationships. For example, if the user requests to check the distance between the transformer and the fence, the system will search the graph for the spatial relationship between the transformer and the fence, obtaining their location coordinates and distance information. The results of the graph query provide topological relationships and spatial location information between the devices, which serve as the basic data for the review. Simultaneously, the system performs a semantic search within the review rule text vector knowledge base, calculates vector similarity, and ranks them. The user's review requirements are converted into vectors, compared with the rule text in the review rule text vector knowledge base, and similarity is calculated and ranked. This semantic search enables the system to identify the most relevant review specifications and standards based on user requirements, providing a precise standard basis for subsequent reasoning. For example, when checking the distance between a transformer and a fence, the system retrieves and ranks the relevant clauses from the review specifications, ensuring that the most relevant ones are prioritized.
[0036] Fusion sorting is the next key step. The system integrates the graph retrieval results and the rule retrieval results. Since the graph retrieval provides the spatial and topological relationships between devices, and the rule retrieval provides the regulatory requirements related to these devices, the information of the two needs to be combined to achieve a comprehensive review. During the fusion process, the system will sort each retrieval result according to its relevance and importance, and fuse the results of the two into a final retrieval result. For example, if the query result in the graph shows that the distance between the transformer and the fence is insufficient, and the result of the rule retrieval gives the regulatory requirement of "the minimum distance is 3 meters", the system will combine these two pieces of information to provide a complete context for subsequent review reasoning. Based on the fused retrieval results, a multi-level structure prompt word is constructed. The design of prompts consists of multiple layers. First, the task instruction layer explicitly instructs the reasoning system on the task to be performed, such as "check whether the distance between the transformer and the fence complies with regulations." Second, the context information layer includes relevant background information obtained from graph and rule retrieval results, such as the actual distance between the transformer and the fence and relevant regulatory requirements. Next, the reasoning framework layer defines the logical structure of reasoning, such as "problem decomposition → evidence retrieval → logic verification → answer generation." Finally, the output specification layer defines the format and content requirements of the output results, such as "return audit results, violation clauses, and corrective action recommendations." This multi-level prompt structure explicitly guides the reasoning system to perform audit tasks according to standardized procedures, ensuring the accuracy and interpretability of the results. The prompt template is populated with structured audit requirements and hybrid search results to form a complete set of optimized prompts. By combining the user-entered structured requirements with graph query results and rule retrieval results, the system generates a set of clear prompts to guide the reasoning process. During actual execution, these prompts are passed as input to the large model for audit reasoning, resulting in a detailed audit report.
[0037] Step S106: input the optimized prompt words into the locally deployed deepseek large model for review and reasoning to obtain a review report, and select the error position with a red frame in AutoCAD according to the error coordinates in the review report.
[0038] Among them, the optimized prompt words are input into the deepseek large model, and an initial review report is obtained by decomposing the problem, retrieving evidence, verifying the logic and generating the reasoning framework of the answer; the initial review report is post-processed and verified to check the authenticity of the referenced specification clauses and the correctness of the reasoning logic in the report to obtain a verified review report; the verified review report is structured and parsed to extract the problem description, problem location coordinates and violated specification clauses to obtain problem annotation data; based on the problem annotation data, a visual annotation is created in the AutoCAD interface, and a red border and problem description text are drawn using the pyautocad interface to obtain a visual review result; the visual review result is graded and displayed, and different visual effects and display priorities are set according to the severity of the problem to obtain a graded review display result; the graded review display result is integrated with the user feedback control to record the user's evaluation and modification suggestions on the review results to obtain a feedback data set for subsequent model optimization training.
[0039] Specifically, the optimized prompt words are input into the DeepSeek model. Based on deep learning technology, this model employs a reasoning framework that decomposes the problem, retrieves evidence, verifies logic, and generates answers. Within this framework, the system first decomposes the user's audit requirement into specific tasks or sub-questions, identifying key points to be checked. Then, by retrieving evidence from the review specifications and drawings, the model locates and aggregates all relevant contextual information, including equipment attributes, spatial location, and connectivity. The system then verifies the logic by comparing the extracted evidence against the review rules to ensure that it aligns with the specification requirements, self-validating the reasoning process and ultimately generating a preliminary answer, the review report. After obtaining the initial review report, the system performs post-processing verification. This step primarily ensures the accuracy of the review report, specifically the authenticity of the referenced specification clauses and the correctness of the reasoning logic. The system verifies the existence of the specifications mentioned in the report and performs logical checks on the reasoning process to ensure that the model's judgment aligns with actual design requirements. If errors or logical inconsistencies are found, the system will correct them and generate a verified review report. The system performs a structured analysis of the verified review report, extracting key content from the report, including the problem description, the error location coordinates, and the violated specification clauses. The system extracts this key information from the report and generates problem annotation data. This data includes not only a detailed description of each problem but also the location of the problem on the drawing, which is then highlighted in the subsequent visual display.
[0040] Based on these problem annotation data, the system creates visual annotations within the AutoCAD interface. Using the pyautocad interface, the system draws a red border around each problem location in the drawing and adds problem description text next to the border. The red border visually identifies the error location within the drawing, while the problem description provides users with a detailed description of the error and corrective action suggestions. This allows users to intuitively identify which areas require revisions to ensure the drawing meets regulatory requirements. The system then displays the visual review results in a graded manner. Based on the severity of the issue, the system categorizes the issues into different levels (e.g., critical, major, and minor). Different visual effects and display priorities are applied to each level. For example, critical issues may have a more prominent red border and larger font size, while minor issues may use a lighter color and smaller font size. This helps users prioritize the most important issues and improve review efficiency.
[0041] The system also integrates the hierarchical review display results with user feedback controls. Users can evaluate the review results within the AutoCAD interface, indicating which issues are correctly labeled, which may contain errors, and even suggesting changes. All user feedback is recorded and structured, forming a feedback dataset. This dataset not only helps improve the current review process but also serves as a basis for subsequent model optimization and training. By continuously collecting and analyzing user feedback, the system can continuously optimize the inference process and enhance the accuracy and adaptability of the model.
[0042] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. An artificial intelligence method for reviewing substation CAD drawings, characterized in that: The method comprises: Obtain DWG drawings and review specification PDF files as review materials through a unified interface. The DWG drawings are obtained by uploading files or selecting a drawing area in AutoCAD; Performing primitive parsing on the DWG drawing, using pyautocad or ezdxf library to extract layer, line, polyline, spline, circle, arc, ellipse and block primitive information, and obtaining device entity information and device topology relationship; Constructing a location-based drawing knowledge graph based on the device entity information and the device topology relationship, and storing the drawing knowledge graph in a Neo4j database according to the IEC 61850 standard to obtain a substation drawing knowledge graph; Perform OCR processing and text vectorization on the review specification PDF file, use the BERT model customized for the power industry to vectorize the text into blocks and store them in the FAISS search library to obtain the review rule text vector knowledge base; A hybrid search engine is constructed by integrating the substation drawing knowledge graph and the review rule text vector knowledge base using the LangChain framework. The relevant context is retrieved according to the review requirements and scope entered by the user to obtain optimized prompt words. The optimized prompt words are input into the locally deployed deepseek large model for review and reasoning to obtain a review report, and the error position is selected with a red frame in AutoCAD according to the error coordinates in the review report.
2. The artificial intelligence method for reviewing substation CAD drawings according to claim 1 is characterized in that: The DWG drawings and review specification PDF files are obtained as review materials through a unified interface. The DWG drawings are obtained by uploading files or selecting a drawing area in AutoCAD, including: Preprocessing the DWG drawing to uniformly convert coordinate information in a world coordinate system into millimeter units to obtain standardized coordinate data; Performing primitive version control on the standardized coordinate data, recording a snapshot of the drawing status at each review, and obtaining drawing version information; Incrementally update the drawing version information, identify the changed part of the drawing, and obtain the changed area data; Cleaning the changed area data, merging overlapping primitives and repairing broken line segments to obtain optimized primitive data; Performing functional area identification on the optimized graphic metadata, marking the main equipment area, secondary circuit area and grounding network area, and obtaining functional zoning information; The functional zoning information is associated and matched with the review specification PDF file, and the corresponding specification clauses are screened for each functional area to obtain the regionalized review basis.
3. The artificial intelligence method for reviewing substation CAD drawings according to claim 1 is characterized in that: The DWG drawing is subjected to graphic element parsing processing, and layer, line, polyline, spline curve, circle, arc, ellipse and block graphic element information is extracted using pyautocad or ezdxf library to obtain device entity information and device topology relationship, including: Performing multi-level recognition on the primitive information to obtain basic primitive data through basic primitive recognition, combined primitive recognition and semantic annotation extraction; Performing equipment type identification on the basic graphic metadata, identifying transformers, circuit breakers, disconnectors, busbars, and capacitors through standard graphic template matching to obtain equipment type data; Performing attribute extraction on the device type data to extract the device model, rated voltage, rated current and capacity to obtain device attribute data; Performing coordinate position analysis on the device attribute data, extracting the device's installation position and spatial orientation information, and obtaining device spatial data; Performing line segment connection analysis on the equipment spatial data to identify wire and cable connection conditions and node locations to obtain connection relationship data; The connection relationship data is subjected to breakpoint detection and merging processing, and the discontinuity points in the connection lines are intelligently connected to obtain a complete device topology relationship.
4. The artificial intelligence method for reviewing substation CAD drawings according to claim 1 is characterized in that: The step of constructing a location-based drawing knowledge graph based on the device entity information and the device topology relationship, storing the drawing knowledge graph in a Neo4j database according to the IEC 61850 standard, and obtaining a substation drawing knowledge graph includes: Performing attribute normalization processing on the device entity information, defining entity types and standard attribute sets according to the IEC 61850 standard, and obtaining standardized entity nodes; Defining a relationship type for the device topology relationship, mapping the physical connection, electrical relationship, and spatial relationship into standardized edge types, and obtaining a relationship edge set; Constructing a triple structure based on the standardized entity nodes and the relationship edge set to form an entity-relationship-entity knowledge representation and obtain an initial knowledge graph; The initial knowledge graph is hierarchically organized and associated according to the hierarchical structure of the substation as a whole, functional areas, and equipment components to obtain a hierarchical knowledge graph; Performing spatial relationship reasoning on the hierarchical knowledge graph, calculating proximity, inclusion, and distance values based on the coordinate positions of entities, and obtaining a spatially enhanced knowledge graph; A consistency check is performed on the spatially enhanced knowledge graph to verify the consistency between the knowledge representation and the original drawing and to incrementally update the version record to obtain a substation drawing knowledge graph.
5. The artificial intelligence method for reviewing substation CAD drawings according to claim 1 is characterized in that: The review specification PDF file is subjected to OCR processing and text vectorization, and the text is divided into blocks and vectorized using a customized BERT model for the power industry and stored in the FAISS search library to obtain a review rule text vector knowledge base, including: Extract text from the review specification PDF file and use an OCR tool or the PyPDF2 library to identify the text content in the document to obtain the original text of the specification; Preprocessing the original text of the specification to remove headers, footers and garbled characters, unify terminology expressions, and obtain a cleaned text; Structurally segmenting the cleaned text into blocks, dividing the text into units according to paragraphs, chapters or fixed lengths to obtain a set of text blocks; Identifying regular statements on the text block set, marking the contents including constraints, specification requirements and design standards, and obtaining regular text blocks; The regular text block is input into the BERT model customized for the power industry, and the professional semantics are captured through a multi-layer attention mechanism to obtain a high-dimensional text vector; An index is constructed for the high-dimensional text vector, and an HNSW index structure is created using the FAISS library to support millisecond-level queries, thereby obtaining a knowledge base of review rule text vectors.
6. The artificial intelligence method for reviewing substation CAD drawings according to claim 1, characterized in that: The LangChain framework is used to integrate the substation drawing knowledge graph and the review rule text vector knowledge base to construct a hybrid search engine. The relevant context is retrieved according to the review requirements and scope entered by the user to obtain optimized prompt words, including: Semantically decompose the audit requirements entered by the user to identify the audit object, audit scope, and audit standards, and obtain structured audit requirements; Based on the structured audit requirements, a graph query is performed in the substation drawing knowledge graph to extract relevant equipment nodes and connection relationships to obtain graph retrieval results; Based on the structured audit requirements, semantic retrieval is performed in the review rule text vector knowledge base, vector similarity is calculated and sorted, and rule retrieval results are obtained; Fusion sorting of the graph search results and the rule search results is performed, and the search contents are integrated according to relevance and importance to obtain hybrid search results; Constructing a multi-level structure prompt word based on the hybrid search results, designing a task instruction layer, a context information layer, a reasoning framework layer, and an output specification layer to obtain a prompt word template; The prompt word template is filled and combined with the structured review requirements and the mixed search results to form a complete prompt word that explicitly guides the reasoning process, thereby obtaining an optimized prompt word.
7. The artificial intelligence method for reviewing substation CAD drawings according to claim 1, characterized in that: The optimized prompt words are input into the locally deployed deepseek large model for review and reasoning to obtain a review report, and the error position is selected in AutoCAD with a red frame according to the error coordinates in the review report, including: Input the optimized prompt words into the deepseek large model, and obtain an initial review report through a reasoning framework that decomposes questions, retrieves evidence, verifies logic, and generates answers; Perform post-processing verification on the initial review report to check the authenticity of the regulatory clauses cited in the report and the correctness of the reasoning logic, and obtain a verified review report; Performing structured analysis on the post-verification review report, extracting problem descriptions, problem location coordinates, and violated regulatory clauses, and obtaining problem annotation data; Creating visual annotations in the AutoCAD interface based on the problem annotation data, using the pyautocad interface to draw a red border and problem description text to obtain a visual review result; The visual review results are displayed in a graded manner, and different visual effects and display priorities are set according to the severity of the problem to obtain a graded review display result; The hierarchical review display results are integrated with the user feedback control to record the user's evaluation and modification suggestions on the review results, and a feedback data set is obtained for subsequent model optimization training.
Citation Information
Patent Citations
Substation CAD drawing auditing method and equipment
CN115329556A
Intelligent online drawing review method and system
CN117077239A
Water conservancy project CAD drawing examination method and system based on ezdxf library
CN118965507A
Urban design paperless intelligent interactive review method based on solid model
WO2022088407A1
Cited By
Multi-modal large model drawing checking optimization method and system for power grid drawing
CN120853212A
A multi-modal large model checking optimization method and system for power grid drawings
CN120853212B
Industrial software user auxiliary system and construction method
CN121210522A
Intelligent drawing auditing method and device based on vector atlas and active sensing closed loop
CN121234950A
Vector graph and active perception closed loop based drawing intelligent auditing method and device
CN121234950B
