Method and system for extracting cable connection identification information of transformer substation drawing
By using a clustering algorithm based on multi-dimensional feature fusion and a three-level binding strategy, the inefficiency and inaccuracy of cable connection identification information in the design drawings of substation secondary equipment are solved, and the accurate identification and efficient extraction of cable connection relationships are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID FUJIAN ELECTRIC POWER CO LTD
- Filing Date
- 2025-12-10
- Publication Date
- 2026-05-08
AI Technical Summary
In the existing technology, the identification of cable connection relationships in the design drawings of substation secondary equipment relies on manual identification, which is inefficient and prone to errors. Existing drawing recognition technology cannot determine the cable connection identification and connection logic based on the spatial topology of line segments, resulting in an incomplete construction of the cable connection relationship network.
A clustering algorithm based on multidimensional feature fusion is used to classify line segment elements. Combined with a three-level binding strategy and a dynamic anomaly spacing threshold, a spatial association mapping between annotation text and external cable routing line segment data is established to extract cable connection identification information.
It achieves comprehensive, accurate and efficient extraction of cable connection identification information, avoiding the problem of incomplete information extraction, and can accurately identify cable connection relationships.
Smart Images

Figure CN121999511A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation and information technology, and in particular to a method and system for extracting cable connection identification information from substation drawings. Background Technology
[0002] Substation secondary equipment design drawings are the core basis for the implementation of power system engineering. The key information they contain, such as cable connection relationships and terminal block layouts, directly affects the installation, commissioning, and other management matters of secondary equipment. Currently, cable connection relationships in secondary equipment design drawings mainly rely on manual identification and annotation, which suffers from low annotation efficiency and susceptibility to errors. Existing drawing recognition technology can only extract textual information from the drawings and cannot determine cable connection identification and connection logic based on the spatial topological relationships of line segments (such as parallelism and abnormal spacing). This results in an incomplete construction of the cable connection relationship network, leading to incomplete information extraction. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method and system for extracting cable connection identification information from substation drawings, which can comprehensively, accurately and efficiently extract cable connection identification information.
[0004] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for extracting cable connection identification information from substation drawings, comprising the following steps: Extract line segment elements and annotation text from the secondary equipment design drawings of the substation; The line segment elements are classified using a clustering algorithm that uses multidimensional feature fusion to obtain terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data to obtain an external cable segment annotation group. The dynamic abnormal spacing threshold is used to identify the annotation text based on the terminal block frame segment data to obtain the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation group and the terminal block name.
[0005] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A system for extracting cable connection identification information from substation drawings includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: Extract line segment elements and annotation text from the secondary equipment design drawings of the substation; The line segment elements are classified using a clustering algorithm that uses multidimensional feature fusion to obtain terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data to obtain an external cable segment annotation group. The dynamic abnormal spacing threshold is used to identify the annotation text based on the terminal block frame segment data to obtain the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation group and the terminal block name.
[0006] The beneficial effects of this invention are as follows: Line segment elements and annotation text are extracted from the secondary equipment design drawings of substations. A multi-dimensional feature fusion clustering algorithm is used to classify the line segment elements, obtaining terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing line segment data, resulting in external cable segment annotation groups. A dynamic anomaly spacing threshold is used to identify the annotation text based on the terminal block frame line segment data, obtaining the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation groups and terminal block names. By combining a multi-dimensional feature fusion clustering algorithm with a three-level binding strategy and a dynamic anomaly spacing threshold, not only can the text information in the secondary equipment design drawings be accurately extracted, but the cable connection relationships can also be accurately identified, avoiding incomplete information extraction. By extracting cable connection identification information through external cable segment annotation groups and terminal block names, cable connection identification information can be extracted comprehensively, accurately, and efficiently. Attached Figure Description
[0007] Figure 1 This is a flowchart illustrating the steps of a method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Figure 2 This is a schematic diagram of a cable connection identification information extraction system for substation drawings according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the secondary equipment design drawings of a substation in the method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the line segment elements extracted in the method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Figure 5 This is a schematic diagram of the extracted annotation text in the method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Figure 6 From Figure 3 A schematic diagram of terminal block frame line segment data and external cable routing line segment data obtained by clustering; Figure 7 for Figure 3 Detailed diagram of the external cable routing segment; Figure 8 This is a schematic diagram of the external cable segment annotation group and terminal block name in the method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Figure 9 This is a schematic representation of cable connection relationship information in the method for extracting cable connection identification information from substation drawings according to an embodiment of the present invention. Detailed Implementation
[0008] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0009] In existing technologies, cable connection relationships in secondary equipment design drawings mainly rely on manual identification and labeling. Labeling is inefficient and prone to errors. Drawing recognition technology can only extract text information from the drawings and cannot determine cable connection identification and connection logic based on the spatial topology of line segments. This results in an incomplete construction of the cable connection relationship network and incomplete information extraction.
[0010] To solve at least the above-mentioned technical problems, please refer to Figure 1 A method for extracting cable connection identification information from substation drawings, comprising the following steps: Extract line segment elements and annotation text from the secondary equipment design drawings of the substation; The line segment elements are classified using a clustering algorithm that uses multidimensional feature fusion to obtain terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data to obtain an external cable segment annotation group. The dynamic abnormal spacing threshold is used to identify the annotation text based on the terminal block frame segment data to obtain the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation group and the terminal block name.
[0011] As can be seen from the above description, the beneficial effects of the present invention are as follows: Line segment elements and annotation text are extracted from the secondary equipment design drawings of substations; a multi-dimensional feature fusion clustering algorithm is used to classify the line segment elements, obtaining terminal block frame line segment data and external cable routing line segment data; a three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing line segment data, obtaining external cable line segment annotation groups; and a dynamic abnormal spacing threshold is used to identify the annotation text based on the terminal block frame line segment data, obtaining the terminal block name; and cable connection identification information is extracted based on the external cable line segment annotation groups and the terminal block name. By combining the multi-dimensional feature fusion clustering algorithm with the three-level binding strategy and the dynamic abnormal spacing threshold, not only can the text information in the secondary equipment design drawings be accurately extracted, but the cable connection relationship can also be accurately identified, avoiding incomplete information extraction. By extracting cable connection identification information through the external cable line segment annotation groups and the terminal block name, cable connection identification information can be extracted comprehensively, accurately, and efficiently.
[0012] Furthermore, a clustering algorithm based on multi-dimensional feature fusion is used to classify the line segment elements, resulting in terminal block frame line segment data and external cable routing line segment data, including: Determine the line segment feature vector for each of the aforementioned line segment elements; A two-dimensional feature matrix is generated based on the feature vector of each line segment; Clustering algorithms are used to cluster the two-dimensional feature matrix to obtain the terminal block frame reference cluster and the external cable routing segment cluster; The closed rectangle detection algorithm is used to correct the terminal block frame line reference cluster and the external cable routing line segment cluster to obtain the terminal block frame line segment data and the external cable routing line segment data.
[0013] As described above, the clustering algorithm using multi-dimensional feature fusion for accurate classification of line segment elements is based on the principle of overcoming the limitations of single-feature classification through multi-dimensional feature complementarity and data-driven clustering mechanism. This enables accurate differentiation between terminal block frame lines and external cable routing line segments. Furthermore, the closed rectangle detection algorithm is used to correct the clustered terminal block frame line reference cluster and external cable routing line segment cluster, further improving the accuracy of identifying terminal block frame line segment data and external cable routing line segment data.
[0014] Furthermore, the two-dimensional feature matrix is clustered using a clustering algorithm to obtain the terminal block frame reference cluster and the external cable routing segment cluster, including: The Euclidean distance between the line segment feature vectors in the two-dimensional feature matrix is calculated using a density-based clustering algorithm, and the clusters are divided based on the Euclidean distance to obtain the divided clusters. Calculate the coefficient of variation for each of the partitioned clusters; The clusters after division with a coefficient of variation less than a preset coefficient are identified as terminal block frame reference clusters, and the clusters after division with a coefficient of variation greater than or equal to a preset coefficient are identified as external cable routing segment clusters.
[0015] As described above, the density-based clustering algorithm (DBSCAN) does not require a preset number of clusters and can automatically identify noise points (such as isolated non-frame segments). It avoids the sensitivity of traditional algorithms such as K-means to initial centers. Since the external cable routing segments are unevenly distributed, the density-based clustering algorithm is used to first divide them into an indefinite number of clusters before post-processing. This is more in line with the layout habits of design drawings, has strong anti-noise ability, and can flexibly adapt to the sparse / dense distribution of segments in the drawings. It is especially suitable for mixed scenarios of terminal block frame lines (high-density clustering) and cable routing segments (dispersed distribution). In addition, the introduction of a coefficient of variation evaluation mechanism optimizes the clustering results, effectively improving the accuracy of distinguishing between terminal block frame lines and external cable routing segments.
[0016] Furthermore, the line segment feature vector includes a length feature; Calculating the coefficient of variation for each of the partitioned clusters includes: Calculate the standard deviation and mean of the length feature for each of the partitioned clusters, and calculate the length variation coefficient based on the standard deviation and mean of the length feature.
[0017] As described above, the standard deviation and average value of the length characteristics of each divided cluster are calculated, and the coefficient of variation of length is calculated based on the standard deviation and average value of the length characteristics. Using the coefficient of variation of length, clusters with stable length characteristics can be screened out, namely the terminal block frame line reference cluster. Cable routing segments with dispersed lengths are effectively excluded from the terminal block frame line reference cluster, forming the external cable routing segment cluster, thereby achieving accurate differentiation between the terminal block frame line and the external cable routing segment.
[0018] Furthermore, the closed rectangle detection algorithm is used to correct the terminal block frame reference cluster and the external cable routing segment cluster, resulting in terminal block frame segment data and external cable routing segment data, including: The largest closed rectangle is selected based on the line segment feature vector of the terminal block frame reference cluster; Determine the boundary line of the largest closed rectangle; If the terminal block frame line in the reference cluster of the terminal block frame line is located within the boundary frame line, then the terminal block frame line is retained to obtain the terminal block frame line segment data; If the terminal block frame line in the reference cluster of the terminal block frame line is not located within the boundary frame line, then the terminal block frame line is added to the external cable routing segment cluster to obtain the external cable routing segment data.
[0019] As described above, some external cable routing segments may be included in the terminal block frame reference cluster due to their similarity to the terminal block frame lines in terms of length and location. Therefore, it is necessary to select the largest closed rectangle using the closed rectangle detection algorithm to determine the boundary frame lines. Only terminal block frame line segments located within the boundary frame lines are considered terminal block frame line segments. Due to their characteristics, external cable routing segments will inevitably have one endpoint outside the terminal block frame lines, not inside the boundary frame lines, and will not intersect with other terminal block frame lines, thus failing to meet the boundary frame line conditions. Therefore, the closed rectangle detection algorithm can effectively exclude such segments from the terminal block frame line segment data.
[0020] Furthermore, a three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data, resulting in an external cable segment annotation group including: Based on the distance between the annotation text and the external cable routing segment data, the direct proximity binding method is used to bind the annotation text and the external cable routing segment data to obtain the first external cable segment annotation group; For external cable route segment data that cannot be bound using the direct proximity binding method, the proximity segment backtracking binding method is used to bind it with the annotation text to obtain a second external cable segment annotation group. For unbound annotation text, the floating annotation group association method is used to bind the unbound annotation text with the nearest external cable route segment data to obtain the third external cable segment annotation group; The external cable segment annotation group is obtained based on the first external cable segment annotation group, the second external cable segment annotation group, and the third external cable segment annotation group.
[0021] As described above, the direct proximity binding method can quickly establish a high-confidence association between annotation text and external cable routing segments by leveraging the principle of local optima. The adjacent segment backtracking binding method can utilize spatial topology to transfer associations, solving the problem of direct binding failure caused by omissions in design drawings. The mapping is indirectly established through topological association, improving the binding success rate. The floating annotation group association method can improve the binding success rate of isolated annotation text, especially suitable for scenarios with dense annotation areas. Thus, the three-level binding strategy can effectively improve the efficiency and accuracy of binding external cable routing segments and annotation text.
[0022] Furthermore, the line segment feature vector includes directional features; Based on the distance between the annotation text and the external cable routing segment data, the direct proximity binding method is used to bind the annotation text and the external cable routing segment data, resulting in a first external cable segment annotation group including: Determine the distance between the annotation text and the external cable routing segment data, as well as the direction of the annotation text; The annotation text that is closest in distance and whose direction is consistent with the direction feature of the external cable route segment data is bound to the external cable route segment data to obtain the first external cable segment annotation group.
[0023] As described above, the direct proximity binding method prioritizes binding annotation text that is spatially closest to the external cable route segment and meets the direction constraints. Noisy annotations are filtered through double constraints to avoid misbinding (such as irrelevant text far from the line segment or annotation text with conflicting directions).
[0024] Furthermore, the line segment feature vector includes directional features and midpoint coordinates; The annotation text is identified using a dynamic anomaly spacing threshold based on the terminal block frame line segment data, resulting in the following terminal block names: The terminal block frame line segment data are classified and sorted in ascending order according to the midpoint coordinates and the direction features to obtain sorted terminal block frame line segment data of different categories. Calculate the spacing between each sorted terminal block frame line segment data and its adjacent terminal block frame line segment data of the same category, and calculate the average value of the spacing; Determine the target adjacent terminal block frame line segment data whose spacing is greater than the average value, and combine the target adjacent terminal block frame line segment data to obtain the terminal block name area boundary group; The terminal block frame line segment data, excluding the terminal block name area boundary group, in the sorted terminal block frame line segment data are determined as the terminal block content frame lines; The direct proximity binding method is used to bind the annotation text located within the boundary group of the terminal block name area to the boundary group of the terminal block name area, and the annotation text located within the boundary group of the terminal block name area is determined to be the terminal block name; Add the terminal block name to the external cable segment annotation group corresponding to the boundary group of the terminal block name area.
[0025] As described above, by using the dynamic abnormal spacing threshold (i.e., the average spacing) to detect abnormal spacing intervals in parallel terminal block frame line segment groups, the terminal block area can be automatically and accurately identified and terminal block names can be generated. The terminal block names are then added to the external cable segment annotation group corresponding to the boundary group of the terminal block name area, which can achieve accurate association between the terminal block names and the external cable segment annotation group, ensuring the comprehensiveness and reliability of the finally extracted cable connection identification information.
[0026] Furthermore, extracting cable connection identification information based on the external cable segment annotation group and the terminal block name includes: The external cable segment annotation groups are merged to obtain a cable connection relationship network; For each external cable segment annotation group in the cable connection relationship network, use regular expressions to extract cable connection identification information; After sorting the cable connection identification information, a cable connection relationship information table is generated.
[0027] As described above, after merging the external cable segment annotation groups, regular expressions are used to extract cable connection identification information from each external cable segment annotation group in the obtained cable connection relationship network. After sorting them, a cable connection relationship information table is generated, which enables staff to intuitively and comprehensively understand the cable connection identification information.
[0028] Please refer to Figure 2 Another embodiment of the present invention provides a cable connection identification information extraction system for substation drawings, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements each step of the above-described method for extracting cable connection identification information from substation drawings.
[0029] The method and system for extracting cable connection identification information from substation drawings described above are applicable to the identification of secondary equipment design drawings in substations. The following detailed embodiments illustrate these methods: Please refer to Figure 1 Embodiment 1 of the present invention is as follows: A method for extracting cable connection identification information from substation drawings, comprising the following steps: S1. Extract line segment elements and annotation text from the secondary equipment design drawings of the substation.
[0030] In one alternative implementation, a graphics parsing library is used to extract line segment elements and annotation text from the secondary equipment design drawings of the substation. For example... Figure 3 As shown, the substation secondary equipment design drawings include line segment elements and annotation text. These line segment elements include external cable routing lines (…). Figure 3 (External cable segments in the cable) and terminal block frame wires.
[0031] Among them, such as Figure 4 As shown, the extracted line segment elements include the coordinates of the first starting point and the coordinates of the first ending point; the extracted annotation text includes the coordinates of the second starting point, the coordinates of the second ending point, and the text content, such as... Figure 5 As shown, Figure 5 In the text box coordinates, the first two coordinates are the coordinates of the second starting point, and the last two coordinates are the coordinates of the second ending point.
[0032] S2. A clustering algorithm based on multi-dimensional feature fusion is used to classify the line segment elements, obtaining terminal block frame line segment data and external cable routing line segment data, specifically including S21-S24: S21. Determine the line segment feature vector for each of the line segment elements.
[0033] The line segment feature vector includes length features, direction features, and midpoint coordinates; the length feature is the line segment length; the direction feature is either horizontal or vertical.
[0034] Specifically, the direction feature is determined based on the first starting point coordinates and the first ending point coordinates of each line segment element; the midpoint of the line segment is calculated based on the first starting point coordinates and the first ending point coordinates; the midpoint coordinates of the midpoint of the line segment are determined; and the length of the line segment is calculated based on the first starting point coordinates and the first ending point coordinates to obtain the length feature.
[0035] S22. Generate a two-dimensional feature matrix based on the feature vector of each line segment.
[0036] For example, if the feature vector of line segment element 1 is (horizontal direction 1, midpoint coordinate 1, line segment length 1), and the feature vector of line segment element 2 is (horizontal direction 2, midpoint coordinate 2, line segment length 2), then after fusing the features of these two line segment elements, a two-dimensional feature matrix is obtained: ; Generating a two-dimensional feature matrix makes it easier to use for subsequent clustering.
[0037] S23. Cluster the two-dimensional feature matrix using a clustering algorithm to obtain the terminal block frame reference cluster and the external cable routing segment cluster, specifically including S231-S233: S231. Calculate the Euclidean distance between the feature vectors of the line segments in the two-dimensional feature matrix using a density-based clustering algorithm, and divide the data into clusters based on the Euclidean distance to obtain the divided clusters.
[0038] like Figure 3 As shown, due to the uneven distribution of external cable routing segments, even with a preset cluster size of 2 (terminal strip frame lines and external cable routing segments), effective identification is difficult. A density-based clustering algorithm is used to first divide the data into an indefinite number of clusters before post-processing, which better aligns with the layout habits of design drawings. By using the neighborhood radius (eps=30) and minimum sample size (min_samples=1) parameters, it can flexibly adapt to the sparse / dense distribution of line segments in the drawing, making it particularly suitable for mixed scenarios involving terminal strip frame lines (high-density clustering) and cable routing segments (dispersed distribution).
[0039] S232. Calculate the coefficient of variation for each of the partitioned clusters.
[0040] Specifically, the standard deviation and mean of the length feature of each of the partitioned clusters are calculated, and the length variation coefficient is calculated based on the standard deviation and mean of the length feature, specifically as follows: CV = / ; In the formula, CV Represents the coefficient of variation of length. The standard deviation representing the length characteristic, This represents the average value of the length characteristic. The smaller the coefficient of variation, the higher the consistency of the length.
[0041] S233. The clusters after division with a coefficient of variation less than a preset coefficient are determined as terminal block frame reference clusters, and the clusters after division with a coefficient of variation greater than or equal to a preset coefficient are determined as external cable routing segment clusters.
[0042] In one optional implementation, the preset coefficient is 0.2.
[0043] Specifically, the clusters with a coefficient of variation less than 0.2 are defined as the terminal block frame reference clusters, and the clusters with a coefficient of variation greater than or equal to 0.2 are defined as the external cable routing segment clusters. For example... Figure 6 As shown, Figure 6 The light-colored lines represent the baseline clusters of terminal block frames obtained from clustering, while the dark-colored lines represent the clusters of external cable routing segments obtained from clustering.
[0044] This effectively distinguishes the clusters of external cable routing segments with varying lengths from the reference clusters of terminal block frame lines.
[0045] This invention employs a multi-dimensional feature fusion clustering algorithm to accurately classify line segment elements. Its core principle lies in overcoming the limitations of single-feature classification through multi-dimensional feature complementarity and a data-driven clustering mechanism, thereby achieving accurate differentiation between terminal block frame lines and external cable routing lines. In substation secondary equipment design drawings, the combination of line segment elements forms terminal block frame lines or external cable routing lines. A single line segment (such as only direction or only length) cannot fully describe the essential attributes of the line segment.
[0046] Directional feature limitations: Terminal block frame lines and some cable routing segments may be horizontal or vertical (such as horizontally arranged cable trays and terminal block horizontal frame lines). Relying solely on directional features for judgment can lead to misclassification.
[0047] Length limitation: The short connecting wires inside the terminal block and the local short segments of the external cable may overlap in length, and functional differences cannot be distinguished by length alone.
[0048] Locational limitations: The spatial distribution pattern of line segments (such as the dense parallelism of terminal block frame lines and the dispersion of cable routing line segments) is not considered, making it susceptible to interference from designers' layout of drawings.
[0049] Therefore, the multi-dimensional feature fusion of this invention, by integrating complementary features such as direction, midpoint coordinates, and length, can characterize line segment attributes from multiple perspectives, significantly improving the robustness of classification. Specifically, the direction feature can distinguish the basic functional types of line segments. Terminal block frame lines are typically strictly horizontal or vertical (used for structured layout), and their line segments are dense in a certain direction. External cable routing line segments, on the other hand, have a relatively even distribution in both horizontal and vertical directions. The direction feature can initially screen candidate frame lines. The midpoint coordinates reflect the spatial distribution pattern of line segments. The spatial distribution of terminal block frame lines exhibits local density (frame lines are concentrated in specific areas to form rectangular structures), while the spatial distribution of cable routing line segments is more dispersed. By grouping the midpoint coordinates using a clustering algorithm, terminal block frame line clusters corresponding to high-density areas can be identified. The length feature characterizes the scale consistency of line segments. The lengths of terminal block frame lines are usually consistent (e.g., horizontal frame lines are similar in length, vertical frame lines are similar in length), while cable routing line segments show significant length differences due to different wiring positions. Using length as a clustering dimension can further distinguish frame lines with similar lengths from cable segments with dispersed lengths.
[0050] The above four features are input into a density-based clustering algorithm. This algorithm uses Euclidean distance to measure feature similarity and automatically identifies high-density regions (terminal strip frame clusters) and low-density regions (cable routing segment clusters), achieving multi-dimensional collaborative classification.
[0051] S24. The closed rectangle detection algorithm is used to correct the terminal block frame reference cluster and the external cable routing segment cluster to obtain the terminal block frame segment data and the external cable routing segment data, specifically including S241-S244: S241. Select the largest closed rectangle based on the line segment feature vector of the terminal block frame reference cluster.
[0052] Specifically, based on the length characteristics, direction characteristics, and midpoint coordinates of each terminal block frame line in the terminal block frame line reference cluster, closed rectangles with a number of horizontal / vertical line segment intersections greater than or equal to 4 are selected from the terminal block frame line reference cluster. Then, the largest closed rectangle is selected from the selected closed rectangles, such as... Figure 3 As shown, the terminal block frame area can form multiple closed rectangles.
[0053] S242. Determine the boundary line of the largest closed rectangle.
[0054] S243. If the terminal block frame line in the terminal block frame line reference cluster is located within the boundary frame line, then the terminal block frame line is retained to obtain the terminal block frame line segment data.
[0055] S244. If the terminal block frame line in the terminal block frame line reference cluster is not located within the boundary frame line, then the terminal block frame line is added to the external cable routing segment cluster to obtain external cable routing segment data.
[0056] S3. Using a three-level binding strategy, establish a spatial association mapping between the annotation text and the external cable routing segment data to obtain an external cable segment annotation group. Then, using a dynamic abnormal spacing threshold, identify the annotation text based on the terminal block frame segment data to obtain the terminal block name, specifically including S31-S310: S31. Based on the distance between the annotation text and the external cable routing segment data, the direct proximity binding method is used to bind the annotation text and the external cable routing segment data to obtain the first external cable segment annotation group, specifically including S311-S312: S311. Determine the distance between the annotation text and the external cable routing segment data, as well as the direction of the annotation text.
[0057] Specifically, the distance between the annotation text and the external cable routing segment data, as well as the direction of the annotation text, are determined based on the second starting point coordinates and the second ending point coordinates of the annotation text.
[0058] S312. Bind the annotation text that is closest in distance and whose direction is consistent with the direction feature of the external cable route segment data to the external cable route segment data to obtain the first external cable segment annotation group.
[0059] If the direction of the annotation text is horizontal, then the line segment bound to the annotation text should also be horizontal and located below the text, not vertical.
[0060] In an alternative implementation, S312 can be replaced with: The annotation text whose distance is less than or equal to a preset threshold and whose direction is consistent with the direction feature of the external cable route segment data is bound to the external cable route segment data to obtain the first external cable segment annotation group.
[0061] S32. For external cable routing segment data that cannot be bound using the direct proximity binding method, the adjacent segment backtracking binding method is used to bind it with the annotation text to obtain a second external cable segment annotation group.
[0062] Specifically, for external cable routing segment data that cannot be bound using the direct proximity binding method, the adjacent external cable routing segment data is found, and the annotation text that has been bound to the adjacent external cable routing segment data is bound to the external cable routing segment data according to the spatial position relationship, and an inheritance mark is added to obtain the second external cable segment annotation group.
[0063] For example, for such Figure 7 The loop number 801 shown can be bound to the 801 annotation using the direct proximity binding method. However, the other five line segments below it have no annotations to bind to. In this case, the annotations are bound to the nearest one above the line segment based on spatial relationship, and an inheritance marker "_" is added. That is, the annotations bound to the above six line segments are "801", "801_", "801_", "801_", "801_", and "801_" respectively. The "_" inheritance marker is used to remind the table user that the annotation is inherited from above and is not directly bound. The above practice of omitting the loop number is a common practice in drawing design, so special logic needs to be designed.
[0064] S33. For unbound annotation text, use the floating annotation group association method to bind the unbound annotation text with the nearest external cable route segment data to obtain the third external cable segment annotation group.
[0065] Specifically, for unbound annotation text, the unbound annotation text is bound to the nearest external cable route segment data according to spatial location relationship to obtain the third external cable segment annotation group.
[0066] For example, for unbound annotation text, based on the X-axis (vertical line segment) or Y-axis (horizontal line segment) coordinates of spatial location, the unbound annotation text is divided into several groups, each group representing the same potential semantic unit (such as the cable number, number of wires, and cable destination of a cable); for each group of annotation text, the distance between its center point and all external cable routing line segment data is calculated, and the external cable routing line segment data with the closest distance is bound.
[0067] S34. Obtain an external cable segment annotation group based on the first external cable segment annotation group, the second external cable segment annotation group, and the third external cable segment annotation group.
[0068] like Figure 8 As shown, the annotation group for external cable segments includes the start point, end point, loop number, terminal location, and internal wire.
[0069] Based on this three-level binding strategy, all annotation texts are bound to the external cable routing segment data, and the binding type between the segment and the annotation text is one-to-many, forming an external cable segment annotation group.
[0070] S35. Classify and sort the terminal block frame line segment data in ascending order according to the midpoint coordinates and the direction features to obtain sorted terminal block frame line segment data of different categories.
[0071] Specifically, the terminal block frame line segment data is classified according to the horizontal and vertical directions based on the directional characteristics, and the classified terminal block frame line segment data is sorted in ascending order according to the midpoint coordinates to obtain sorted terminal block frame line segment data in the horizontal direction and sorted terminal block frame line segment data in the vertical direction.
[0072] S36. Calculate the spacing between each sorted terminal block frame line segment data and its adjacent terminal block frame line segment data of the same category, and calculate the average value of the spacing.
[0073] S37. Determine the target adjacent terminal block frame line segment data where the spacing is greater than the average value, and combine the target adjacent terminal block frame line segment data to obtain the terminal block name area boundary group.
[0074] like Figure 3 As shown, some line segments in the terminal block frame area have larger spacing, that is, the spacing is greater than the average. The boundary group of the terminal block name area can be determined based on these line segments. The annotation text within the boundary group of the terminal block name area is the name of the terminal block.
[0075] The terminal block name area boundary group includes the upper boundary start and end coordinates and the lower boundary start and end coordinates.
[0076] S38. The terminal block frame line segment data other than the terminal block name area boundary group in the sorted terminal block frame line segment data are determined as the terminal block content frame line.
[0077] S39. Use the direct proximity binding method to bind the annotation text located in the boundary group of the terminal block name area to the boundary group of the terminal block name area, and determine that the annotation text located in the boundary group of the terminal block name area is the terminal block name.
[0078] S310. Add the terminal block name to the external cable segment annotation group corresponding to the boundary group of the terminal block name area.
[0079] like Figure 8 As shown, add the terminal block name to the corresponding external cable segment annotation group.
[0080] S4. Extract cable connection identification information based on the external cable segment annotation group and the terminal block name, specifically including S41-S43: S41. Merge the external cable segment annotation groups to obtain a cable connection relationship network.
[0081] Specifically, the external cable segment annotation groups containing two external cable routing segments with the same endpoint coordinates are merged to obtain a cable connection relationship network.
[0082] S42. Use regular expressions to extract cable connection identification information for each external cable segment annotation group in the cable connection relationship network.
[0083] In one optional implementation, the cable connection identification information includes cable number, cable destination, number of cable cores, core circuit number, core terminal number, and internal wire name, etc.
[0084] S43. After sorting the cable connection identification information, a cable connection relationship information table is generated.
[0085] The sorting rules can be flexibly set according to actual needs. For example, cable connection identification information can be sorted in the order of cable number, cable destination, number of cable cores, core circuit number, core terminal number, and internal wire name to generate a cable connection relationship information table. Figure 9 As shown, Figure 9 Two tables displaying cable connection information are shown.
[0086] Please refer to Figure 2 Embodiment two of the present invention is as follows: A system for extracting cable connection identification information from substation drawings includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the method for extracting cable connection identification information from substation drawings in Embodiment 1.
[0087] In summary, this invention provides a method and system for extracting cable connection identification information from substation drawings. It extracts line segment elements and annotation text from the secondary equipment design drawings of a substation. A multi-dimensional feature fusion clustering algorithm is used to classify the line segment elements, obtaining terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing line segment data, resulting in external cable segment annotation groups. A dynamic anomaly spacing threshold is used to identify the annotation text based on the terminal block frame line segment data, obtaining the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation groups and the terminal block name. By combining a multi-dimensional feature fusion clustering algorithm with a three-level binding strategy and a dynamic anomaly spacing threshold, it can not only accurately extract text information from secondary equipment design drawings but also accurately identify... To avoid incomplete information extraction regarding cable connections, cable connection identification information is extracted through external cable segment annotation groups and terminal block names, resulting in comprehensive, accurate, and efficient extraction of cable connection identification information. Furthermore, a density-based clustering algorithm is used, eliminating the need for pre-setting the number of clusters and automatically identifying noise points. This avoids the sensitivity to initial centers found in traditional algorithms like K-means. Since external cable routing segments are unevenly distributed, a density-based clustering algorithm is used to first divide the data into an indefinite number of clusters before post-processing, which better aligns with design drawing layout habits, has strong noise resistance, and can flexibly adapt to sparse / dense distributions of segments in drawings, making it particularly suitable for mixed scenarios involving terminal block outlines and cable routing segments. Additionally, a coefficient of variation evaluation mechanism is introduced to optimize the clustering results, effectively improving the accuracy of distinguishing between terminal block outlines and external cable routing segments.
[0088] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for extracting cable connection identification information from substation drawings, characterized in that, Including the following steps: Extract line segment elements and annotation text from the secondary equipment design drawings of the substation; The line segment elements are classified using a clustering algorithm that uses multidimensional feature fusion to obtain terminal block frame line segment data and external cable routing line segment data. A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data to obtain an external cable segment annotation group. The dynamic abnormal spacing threshold is used to identify the annotation text based on the terminal block frame segment data to obtain the terminal block name. Cable connection identification information is extracted based on the external cable segment annotation group and the terminal block name.
2. The method for extracting cable connection identification information from substation drawings according to claim 1, characterized in that, Clustering algorithms using multi-dimensional feature fusion are used to classify the line segment elements, resulting in terminal block frame line segment data and external cable routing line segment data, including: Determine the line segment feature vector for each of the aforementioned line segment elements; A two-dimensional feature matrix is generated based on the feature vector of each line segment; Clustering algorithms are used to cluster the two-dimensional feature matrix to obtain the terminal block frame reference cluster and the external cable routing segment cluster; The closed rectangle detection algorithm is used to correct the terminal block frame line reference cluster and the external cable routing line segment cluster to obtain the terminal block frame line segment data and the external cable routing line segment data.
3. The method for extracting cable connection identification information from substation drawings according to claim 2, characterized in that, Clustering algorithms were used to cluster the two-dimensional feature matrix to obtain the terminal block frame reference cluster and the external cable routing segment cluster, including: The Euclidean distance between the line segment feature vectors in the two-dimensional feature matrix is calculated using a density-based clustering algorithm, and the clusters are divided based on the Euclidean distance to obtain the divided clusters. Calculate the coefficient of variation for each of the partitioned clusters; The clusters after division with a coefficient of variation less than a preset coefficient are identified as terminal block frame reference clusters, and the clusters after division with a coefficient of variation greater than or equal to a preset coefficient are identified as external cable routing segment clusters.
4. The method for extracting cable connection identification information from substation drawings according to claim 3, characterized in that, The line segment feature vector includes length features; Calculating the coefficient of variation for each of the partitioned clusters includes: Calculate the standard deviation and mean of the length feature for each of the partitioned clusters, and calculate the length variation coefficient based on the standard deviation and mean of the length feature.
5. The method for extracting cable connection identification information from substation drawings according to claim 2, characterized in that, The terminal block frame reference cluster and the external cable routing segment cluster are corrected using a closed rectangle detection algorithm to obtain terminal block frame segment data and external cable routing segment data, including: The largest closed rectangle is selected based on the line segment feature vector of the terminal block frame reference cluster; Determine the boundary line of the largest closed rectangle; If the terminal block frame line in the reference cluster of the terminal block frame line is located within the boundary frame line, then the terminal block frame line is retained to obtain the terminal block frame line segment data; If the terminal block frame line in the reference cluster of the terminal block frame line is not located within the boundary frame line, then the terminal block frame line is added to the external cable routing segment cluster to obtain the external cable routing segment data.
6. The method for extracting cable connection identification information from substation drawings according to claim 2, characterized in that, A three-level binding strategy is used to establish a spatial association mapping between the annotation text and the external cable routing segment data, resulting in an external cable segment annotation group including: Based on the distance between the annotation text and the external cable routing segment data, the direct proximity binding method is used to bind the annotation text and the external cable routing segment data to obtain the first external cable segment annotation group; For external cable route segment data that cannot be bound using the direct proximity binding method, the proximity segment backtracking binding method is used to bind it with the annotation text to obtain a second external cable segment annotation group. For unbound annotation text, the floating annotation group association method is used to bind the unbound annotation text with the nearest external cable route segment data to obtain the third external cable segment annotation group; The external cable segment annotation group is obtained based on the first external cable segment annotation group, the second external cable segment annotation group, and the third external cable segment annotation group.
7. The method for extracting cable connection identification information from substation drawings according to claim 6, characterized in that, The line segment feature vector includes directional features; Based on the distance between the annotation text and the external cable routing segment data, the direct proximity binding method is used to bind the annotation text and the external cable routing segment data, resulting in a first external cable segment annotation group including: Determine the distance between the annotation text and the external cable routing segment data, as well as the direction of the annotation text; The annotation text that is closest in distance and whose direction is consistent with the direction feature of the external cable route segment data is bound to the external cable route segment data to obtain the first external cable segment annotation group.
8. The method for extracting cable connection identification information from substation drawings according to claim 2, characterized in that, The line segment feature vector includes directional features and midpoint coordinates; The annotation text is identified using a dynamic anomaly spacing threshold based on the terminal block frame line segment data, resulting in the following terminal block names: The terminal block frame line segment data are classified and sorted in ascending order according to the midpoint coordinates and the direction features to obtain sorted terminal block frame line segment data of different categories. Calculate the spacing between each sorted terminal block frame line segment data and its adjacent terminal block frame line segment data of the same category, and calculate the average value of the spacing; Determine the target adjacent terminal block frame line segment data whose spacing is greater than the average value, and combine the target adjacent terminal block frame line segment data to obtain the terminal block name area boundary group; The terminal block frame line segment data, excluding the terminal block name area boundary group, in the sorted terminal block frame line segment data are determined as the terminal block content frame lines; The direct proximity binding method is used to bind the annotation text located within the boundary group of the terminal block name area to the boundary group of the terminal block name area, and the annotation text located within the boundary group of the terminal block name area is determined to be the terminal block name; Add the terminal block name to the external cable segment annotation group corresponding to the boundary group of the terminal block name area.
9. A method for extracting cable connection identification information from substation drawings according to claim 8, characterized in that, Based on the external cable segment annotation group and the terminal block name, the cable connection identification information is extracted, including: The external cable segment annotation groups are merged to obtain a cable connection relationship network; For each external cable segment annotation group in the cable connection relationship network, use regular expressions to extract cable connection identification information; After sorting the cable connection identification information, a cable connection relationship information table is generated.
10. A system for extracting cable connection identification information from substation drawings, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the method for extracting cable connection identification information from a substation drawing according to any one of claims 1 to 9.