A power grid station wiring fault auxiliary analysis system
By using multiple neural network models to identify components and text content in the power grid site wiring fault analysis system, the problem of low efficiency in power grid site wiring fault analysis in the existing technology is solved, and more accurate and Efficient failure source link and impact link analysis.
Patent Information
- Application Number
- CN202411506245.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-10-28
AI Technical Summary
The prior art is inefficient in the analysis of wiring faults of power grid sites, making it difficult to quickly identify wiring diagrams, automatically display the fault source link and influence range link of components, and easily miss the text in the drawings, resulting in missing and inaccurate identification results. .
It provides a power grid station wiring fault assisted analysis system, including a station drawing introduction module, a wiring data identification module, a wiring topology identification module, an auxiliary analysis input module and a fault assisted analysis module. The system uses multiple neural network models to identify components and text content, constructs wiring link information, and analyzes the fault source link and influence link through multi-level cascade.
It improves the efficiency of fault analysis and the accuracy of problem positioning, solves the identification difficulties caused by complex lines, ensures the integrity of text content, and reduces the error rate of operation and maintenance personnel through automated processes.
Smart Images

Figure CN119027971B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault analysis, and in particular to an auxiliary analysis system for power grid station wiring faults. Background Art
[0002] As the scale and complexity of power grids continue to increase, wiring drawings are becoming more and more complex and there are many types of electrical components. Once a problem occurs with an electrical component, it is very cumbersome and error-prone for operation and maintenance personnel to locate the problem based on the original design of the power grid wiring diagram. Therefore, how to quickly identify the wiring diagram and automatically display the fault source link and impact range link of the component is a problem worthy of attention.
[0003] With the development of artificial intelligence technology, object detection based on deep learning has become the main way to automate and intelligentize two-dimensional drawings. However, existing methods do not consider all the information in the wiring diagram, and are prone to miss the text in the drawing, resulting in missing and inaccurate recognition results.
[0004] When a line fails, the operation and maintenance personnel usually search and locate it according to the wiring diagram. If the lines are complex and cross-linked, the positioning work is cumbersome and prone to errors. There is a lack of automatic fault link analysis of components and lines based on the topological relationship of the wiring diagram. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a power grid station wiring fault auxiliary analysis system to solve the problem of low efficiency of existing wiring fault analysis.
[0006] An embodiment of the present invention provides a power grid station wiring fault auxiliary analysis system, comprising:
[0007] A station drawing import module is used to import the original image of the power grid station drawing, segment the original image to obtain each wiring diagram, obtain each image to be detected by scaling each wiring diagram to a preset size, and obtain an auxiliary image corresponding to the image to be detected by rotating and scaling each wiring diagram to a preset size;
[0008] The wiring data recognition module is used to identify components and text content and associate them based on each image to be detected and its corresponding auxiliary image using multiple neural network models; the text content includes: label, terminal number and line number;
[0009] A wiring topology recognition module is used to recognize each line segment in each image to be detected, and to construct wiring link information of each wiring diagram according to the components or line segments connected at both ends of the line segment;
[0010] An auxiliary analysis input module is used to select the grid station drawings, wiring diagrams, and component numbers or line numbers in sequence through a multi-stage cascade method;
[0011] The fault auxiliary analysis module is used to analyze and display the fault source link and the influencing link from the corresponding wiring link information according to the component number or line number in the wiring diagram selected by the auxiliary analysis input module.
[0012] Based on the further improvement of the above system, the wiring data recognition module uses multiple neural network models to identify components and text content and associate them, including:
[0013] First, identify the component frame and component category in each image to be detected, cut out the component frame image according to the component frame and component category, identify the first text frame inside the component frame, and obtain the terminal number inside the component; then identify the second text frame outside the component frame and its text content, calculate the distance between the component frame and the center point coordinates of each second text frame, associate the second text frame with a distance less than the distance threshold with the corresponding component frame, and if there is only one associated second text frame, obtain the label corresponding to the component; otherwise, identify the text content in multiple second text frames, and when the text content is pure numbers, obtain the terminal number outside the component; when the second text content contains characters, obtain the component label;
[0014] The remaining text content that is not associated with a component frame and contains numbers is the wire number.
[0015] Based on the further improvement of the above system, the wiring topology recognition module recognizes each line segment in each image to be detected, including:
[0016] Cover the bounding box where the components and text content in each image to be detected are located; use a straight line detection algorithm to detect each image to be detected to obtain multiple original line segments; divide each original line segment into a horizontal line segment or a vertical line segment according to the slope of the original line segment; merge the overlapping line segments in the horizontal line segment and the vertical line segment according to the horizontal distance and vertical distance between the line segments;
[0017] Identify whether there is an intersection between the merged horizontal and vertical line segments. If so, segment the merged horizontal or vertical line segments according to the intersection. After deduplication, each line segment obtained after segmentation is the final identified line segment.
[0018] Based on the further improvement of the above system, before identifying whether the merged horizontal and vertical line segments have an intersection, it is identified whether the merged horizontal and vertical line segments will form a closed loop, including: taking the merged horizontal and vertical line segments as nodes, if the endpoints of the two line segments coincide, then establishing an edge between the two line segments to construct a line segment connection graph; using a graph search algorithm to identify whether there is a closed loop in the line segment connection graph, and if so, removing the line segments corresponding to the nodes that form the closed loop.
[0019] Based on the further improvement of the above system, the wiring topology identification module obtains the components or line segments connected at both ends of the line segment through the following steps:
[0020] For a horizontal line segment, the endpoint with the smallest abscissa is taken as the starting point, and for a vertical line segment, the endpoint with the largest ordinate is taken as the starting point;
[0021] The connection condition is that the closest to the starting point / end point of the line segment and the distance is less than the distance threshold. For each line segment, first search for the component boxes that meet the connection conditions, and obtain the components connected to the starting point / end point of each line segment; identify whether the connected component has a pin number. If so, obtain the pin number closest to the starting point / end point based on the coordinates of the text box where the pin number is located; if the starting point or end point does not find a component box that meets the connection conditions, search for the end points or starting points that meet the connection conditions in the remaining line segments, and obtain the line segment connected to the starting point or end point of each line segment.
[0022] Based on the further improvement of the above system, the wiring topology identification module constructs the wiring link information of each wiring diagram, including:
[0023] Get the ID corresponding to the components or line segments connected at both ends of each line, save the line segment ID, starting point coordinates, end point coordinates, starting point connection ID, starting point connection type, starting point connection text, end point connection ID, end point connection type, and end point connection text for each line segment in each wiring diagram, and obtain the wiring link information of each wiring diagram; among which, the starting point connection ID and the end point connection ID are used to store the component ID or line segment ID; the starting point connection type includes components and line segments; the starting point connection text and the end point connection text are used to store the terminal number closest to the endpoint.
[0024] Based on the further improvement of the above system, the fault auxiliary analysis module analyzes the fault source link from the corresponding wiring link information according to the selected component number or line number in the wiring diagram selected by the auxiliary analysis input module, including:
[0025] First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the end connection ID in the wiring link information corresponding to the wiring diagram to find the starting connection ID, and continue to use the one or more starting connection IDs found as new end connection IDs for recursive search until no new starting connection ID is found. Then, filter out the information whose starting connection type is a component or the starting connection type is a line segment and the line number is not empty from the found information to obtain one or more fault source links.
[0026] Based on the further improvement of the above system, the fault auxiliary analysis module analyzes the influencing link from the corresponding wiring link information according to the component number or line number selected by the auxiliary analysis input module, including:
[0027] First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the starting connection ID in the wiring link information corresponding to the wiring diagram to search for the end connection ID. Use the one or more end connection IDs found as new starting connection IDs for recursive search until no new end connection ID is found. Then, filter out the information whose end connection type is a component or the end connection type is a line segment and whose line number is not empty from the found information to obtain one or more influencing links.
[0028] Based on the further improvement of the above system, the component frames and component categories in each image to be detected are identified by passing each image to be detected and its auxiliary image into the component detection model in sequence, and obtaining the component frames and component categories in each image to be detected by fusing the two detection results output; the component detection model is obtained by training the improved YOLOv5 model.
[0029] Based on further improvements of the above system, the second text box outside the component box and its text content are identified. Two text detection images are obtained for each image to be detected based on the first text box and the component box, and are simultaneously passed into a text box detection model to obtain the second text box outside the component box; the second text box image is intercepted from each image to be detected and passed into a text recognition model to identify the second text content; the text box detection model is obtained by training an improved Faster R-CNN model; and the text recognition model is trained by introducing a multi-head self-attention mechanism into a CNN-LSTM combination model.
[0030] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0031] 1. Considering that the placement direction of components in two-dimensional drawings will affect the recognition effect, the auxiliary image is obtained by rotating the image to be detected, and the accuracy of component recognition is improved by using two images; the labels, terminal numbers and line numbers in the wiring diagram are identified to ensure the integrity of the text content; the wiring links of each wiring diagram are constructed by identifying the components or line segments connected at both ends of the line segment, so that the fault source link and the influencing link can be automatically traced bidirectionally according to any component or line number in the wiring link, solving the problem of difficult recognition caused by complex line crossings, and improving the efficiency of fault analysis and the accuracy of problem location.
[0032] 2. When identifying line segments in the wiring diagram, first merge and filter duplicate line segments to reduce recognition errors; then remove the auxiliary frames in the wiring diagram through closed-loop recognition to improve the accuracy of topological relationship recognition; finally, identify the intersections and corners in the line through the intersection of horizontal and vertical line segments, correctly divide the line segments, determine the starting point and the end point, so that the wiring link information has directionality; provide forward and backward tracing and automatically filter out non-critical line segments, which is convenient for locating the source of the fault and analyzing the scope of impact.
[0033] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0035] Figure 1 This is a schematic diagram of the structure of a power grid station wiring fault auxiliary analysis system according to an embodiment of the present invention;
[0036] Figure 2 It is a wiring schematic diagram included in the power grid station drawing in the embodiment of the present invention. DETAILED DESCRIPTION
[0037] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0038] A specific embodiment of the present invention discloses a power grid station wiring fault auxiliary analysis system, such as Figure 1 As shown, including:
[0039] The station drawing import module is used to import the original image of the power grid station drawing, segment the original image to obtain each wiring diagram, and obtain each image to be detected by scaling each wiring diagram to a preset size, and obtain an auxiliary image corresponding to the image to be detected by rotating and scaling each wiring diagram to a preset size;
[0040] The wiring data recognition module is used to identify components and text content and associate them based on each image to be detected and its corresponding auxiliary image using multiple neural network models; the text content includes: label, terminal number and line number;
[0041] A wiring topology recognition module is used to recognize each line segment in each image to be detected, and to construct wiring link information of each wiring diagram according to the components or line segments connected at both ends of the line segment;
[0042] An auxiliary analysis input module is used to select the grid station drawings, wiring diagrams, and component numbers or line numbers in sequence through a multi-stage cascade method;
[0043] The fault auxiliary analysis module is used to analyze and display the fault source link and the influencing link from the corresponding wiring link information according to the component number or line number in the wiring diagram selected by the auxiliary analysis input module.
[0044] During implementation, considering that the placement direction of components in the two-dimensional drawing will affect the recognition effect, the auxiliary image is obtained by rotating the image to be detected, and the accuracy of component recognition is improved by using two images; the labels, terminal numbers and line numbers in the wiring diagram are identified to ensure the integrity of the text content; the wiring links of each wiring diagram are constructed by identifying the components or line segments connected at both ends of the line segment, so as to automatically perform two-way traceability according to any component or line number in the wiring link to analyze the fault source link and the influencing link, solve the problem of identification difficulty caused by complex line crossing, and improve the fault analysis efficiency and problem location accuracy.
[0045] (1) Station drawing import module
[0046] Specifically, the received power grid station drawings are first converted into original images in JPG format and imported into the system through the station drawing import module. Considering that there are some small noise points in the original image and there are some blurred areas around the outlines of some components in the drawings, in order to improve the visual effect and clarity of the image, the imported original image is preprocessed as follows: Gaussian filter calculation is performed using a 3×3 Gaussian convolution kernel; the smoothed original image is grayed and binarized to enhance the line outline, making it easier for subsequent segmentation and recognition.
[0047] Furthermore, it is considered that the drawings of power grid stations usually contain multiple independent wiring diagrams. For example, the secondary circuit drawings of the 10KV switch cabinet of the substation include: control circuit, energy storage circuit, AC current circuit, AC power supply circuit, heater circuit, lighting circuit, protection current circuit and other wiring diagrams. The preprocessed image is segmented to obtain each wiring diagram, including: using an edge detection algorithm to obtain the edge of each wiring diagram, exemplarily, using the Canny edge detection algorithm, and then using the contour tracking algorithm of OpenCV to perform connectivity analysis on the edges of each wiring diagram to obtain the contour of each wiring diagram; according to the contour of each wiring diagram, the respective rectangular bounding boxes are calculated in turn; in the preprocessed image, each rectangular bounding box is cut according to the rectangular bounding box to obtain each wiring diagram.
[0048] Each image to be detected is obtained by scaling each wiring diagram to a preset size, that is, the height-to-width ratio of each wiring diagram is fixed, the scaling ratios of height and width are calculated respectively according to the preset size, and the minimum scaling ratio is taken as the ratio to be processed. If the ratio to be processed is greater than 1 and less than the maximum enlargement threshold, the wiring diagram is enlarged according to the ratio to be processed; if the ratio to be processed is greater than the maximum enlargement threshold, the wiring diagram is enlarged according to the maximum enlargement threshold; if the ratio to be processed is less than 1, the wiring diagram is reduced according to the ratio to be processed; if the scaled size is inconsistent with the preset size, the blank area is filled with white pixels to obtain the image to be detected.
[0049] Exemplarily, the maximum magnification threshold is 3, and the processing ratio of a relatively small wiring diagram is magnified 4 times, which exceeds the maximum magnification threshold. In order to avoid image blurring caused by excessive magnification, after magnification according to the maximum magnification threshold, the remaining part of the preset size is filled with white pixels to obtain the corresponding image to be detected.
[0050] At the same time, the auxiliary image corresponding to the image to be detected is obtained by rotating and scaling each wiring diagram to a preset size. Each wiring diagram is rotated 90 degrees clockwise and then scaled to a preset size according to the above method to obtain the auxiliary image. The image to be detected and the auxiliary image obtained according to the same wiring diagram correspond one to one.
[0051] Calculate and save the transformation matrix that transforms the pixel coordinates in each auxiliary image to each image to be detected.
[0052] Image records and association relationship records are generated for the original image in this module, the wiring diagrams segmented therefrom, the image to be detected and the auxiliary image corresponding to each wiring diagram, and saved in a database.
[0053] Specifically, the original image is stored in the drawing table, including: drawing ID, importer ID, original image, drawing number, design unit; wherein the drawing number and design unit are identified by the wiring data recognition module; each segmented wiring diagram and its corresponding image to be detected and auxiliary image are stored in the wiring diagram, including: wiring diagram ID, drawing ID, wiring diagram upper left coordinate, wiring diagram lower right coordinate, contour area, wherein the wiring diagram upper left coordinate and wiring diagram lower right coordinate are the coordinates of the wiring diagram rectangular bounding box in the original image according to the drawing ID and the original image in the drawing table. Various images can be directly stored in the database as binary data, or stored in a file server, and the storage path is saved in the database.
[0054] (2) Wiring data identification module
[0055] 1) Identify components
[0056] It should be noted that in the wiring data recognition module, each image to be detected and its auxiliary image are sequentially passed into the component detection model, and the component frames and component categories in each image to be detected are obtained by fusing the two detection results output; the component detection model is obtained by training the improved YOLOv5 model.
[0057] Specifically, the improvements include:
[0058] ①Construct paired samples and adjust the model input channel.
[0059] It should be noted that, considering that some components in the wiring diagram are placed horizontally and some are placed vertically, the same component may have different recognition effects when placed in different directions. In this embodiment, after obtaining the original samples corresponding to each historical wiring diagram according to the method of step S1, in order to improve the recognition accuracy of the components, each historical wiring diagram is rotated 90 degrees clockwise to obtain the auxiliary samples corresponding to the original samples and put them into the sample set. Use labelimg software to mark the components in the sample, organize them into .txt format, and put them into the sample set folder.
[0060] Since the image to be detected and its auxiliary image in this embodiment are both black and white images, the input channels of the existing YOLOv5 model are changed from three color channels of RGB (red, green, and blue) to single channel input.
[0061] ② Adjust the model structure and introduce the channel attention mechanism.
[0062] It should be noted that the improved YOLOv5 model includes five parts in sequence: input layer, backbone layer, channel attention layer, bottleneck layer and prediction layer. After receiving the image, the input layer passes it to the backbone layer. The backbone layer is constructed in series by the Focus module, three groups of CBL+CSP modules, and CBL+spatial pyramid pooling module SPP to extract feature maps of different scales. Among them, the Focus module is used to slice and then splice the image; CBL is composed of convolution Conv, batch normalization BN and activation function Leaky Relu; CSP module is composed of CBL module, residual module and convolution layer.
[0063] The feature maps extracted by the second group of CBL+CSP modules, the third group of CBL+CSP modules and the spatial pyramid pooling module SPP in the backbone layer are respectively passed to the channel attention layer, that is, the compression module and the excitation module embedded in SENet (Squeeze-and-Excitation Networks), and the feature maps of the three scales extracted by the backbone layer are compressed and excited respectively and then passed to the bottleneck layer. The compression is to compress the information of each channel of the feature map through global average pooling, and the excitation module learns the importance weight of each channel through two fully connected layers, ignoring irrelevant features, thereby increasing the learning efficiency of the entire model. In addition, the number of parameters of the compression module and the excitation module is very small, which will not significantly increase the number of parameters of the entire model.
[0064] The bottleneck layer is composed of the feature pyramid network FPN and the path aggregation network PAN, which fuses the feature maps of different scales output by the channel attention layer; for example, the large-scale feature map has a lot of detailed information, which is upsampled and fused into the feature map of smaller size in the bottleneck layer to assist in the detection of small targets. The bottleneck layer passes the fused feature maps of different sizes to the prediction layer.
[0065] The prediction layer predicts objects of different scales in the image based on the feature maps of different scales output by the bottleneck layer.
[0066] ③Improve the model loss function for model parameter optimization.
[0067] It should be noted that the existing YOLOv5 model loss function consists of three parts: the first classification loss , confidence loss and positioning loss The classification loss uses the cross entropy loss function to measure the difference between the model's prediction of the target category and the actual label; the confidence loss uses the binary cross entropy loss function to measure the confidence level of whether the target exists in the predicted box; the positioning loss uses CIoU (Complete Intersection over Union) as the loss function of bounding box regression to measure the difference between the predicted target bounding box and the true bounding box. The loss of each part is calculated by calculating the respective losses at three scales (large, medium, and small) and then merging them.
[0068] Considering the different sizes of each wiring diagram, for example, the control circuit wiring diagram is much larger than the lighting circuit wiring diagram, the probability of small components in the small wiring diagram is relatively high, and the probability of large components in the large wiring diagram is relatively high. Therefore, when calculating the loss function, this embodiment dynamically adjusts the weight factor of the prediction box of different scales according to the ratio of the contour area of the historical wiring diagram to the area of the sample image. The smaller the contour area, the greater the weight factor of the small-scale prediction box.
[0069] Exemplarily, when the ratio of the contour area of the historical wiring diagram in the original sample to the sample image area is less than 0.4, the weight factors of the small, medium and large scale prediction boxes are 6, 5 and 3 respectively; when the ratio is greater than or equal to 0.4 and less than 0.7, the weight factors of the small, medium and large scale prediction boxes are 5, 6 and 3 respectively; when the ratio is greater than or equal to 0.7, the weight factors of the small, medium and large scale prediction boxes are 3, 5 and 6 respectively.
[0070] Added inter-class difference loss to the loss function , which is used to measure the difference in the center point coordinates, size width and size height of the prediction box between the original sample and the corresponding auxiliary sample. The formula is as follows:
[0071] ,
[0072] in, Indicates the number of prediction boxes, , and Represents the original sample The center point coordinates, size width and size height of the prediction box, and Indicates auxiliary sample The size width and size height of the prediction box. Since the auxiliary sample is obtained by rotating 90 degrees clockwise, the size width and size height of the prediction box in the auxiliary sample correspond to the size height and size width of the prediction box in the original sample after reverse rotation. Indicates auxiliary sample The center point coordinates of the predicted box The value obtained after the inverse rotation transformation.
[0073] Finally, the loss function of this scheme is Includes: First classification loss , confidence loss , positioning loss and inter-class difference loss , each part is given a certain weight coefficient, and the formula is as follows:
[0074] ,
[0075] in, , , and Respectively represent the weight coefficients of the first classification loss, confidence loss, positioning loss and inter-class difference loss; , and Represent the weight factors of large, medium and small scales respectively; , and Represents the classification loss of large, medium and small scales respectively; , and Represents the confidence loss of large, medium and small scales respectively; , and They represent the localization losses at large, medium and small scales respectively.
[0076] It should be noted that the choice of weight coefficients depends on the requirements of the specific task and the performance of the model. For example, if the model performs poorly in positioning, increase the weight of positioning loss; if the model has problems in classification, increase the weight of classification loss.
[0077] During the training process, 500 samples are randomly selected every 10 rounds for model verification, and the model with the best verification effect is saved, that is, the parameters with the smallest overall loss are saved. The batch size is set to 10, and the initial learning rate is set to 0.0001. The training is performed until the learning rate reaches 0.000001 and no longer decays, or the maximum number of iterations is reached, and the trained YOLOv5 model is obtained as the component detection model.
[0078] The original image to be detected and its rotated auxiliary image form an image pair which are input into the trained component detection model for detection, and the first detection result of the image to be detected and the second detection result of the auxiliary image are output. Both the first detection result and the second detection result include the coordinates of each component frame (2 coordinate values of the upper left corner, 2 coordinate values of the lower right corner, and the coordinates of the center point of the component frame), the height and width of the component frame, the confidence level, and the component category probability.
[0079] Finally, the two detection results are fused to obtain the component frames and component categories in each image to be detected, including:
[0080] According to the transformation matrix between each image to be detected and the corresponding auxiliary image, the coordinates of each component frame in the second detection result of the auxiliary image are converted to the coordinates in the image to be detected to obtain the third detection result; the component frames in the first detection result and the third detection result are matched with the minimum error between the component frames and less than the boundary error threshold as the matching condition, and the final component frame is obtained by calculating the intersection and union ratio for each pair of matched component frames, and the component category with the highest probability is taken as the final component category. The component frame coordinates and component category in the current wiring diagram are recorded.
[0081] It should be noted that the final component frame is obtained by calculating the intersection and union ratio for each pair of matching component frames, including:
[0082] According to the coordinates of the upper left corner and the lower right corner of the two matching component frames, the coordinates of the upper left corner and the lower right corner of the intersection are obtained; according to the coordinates of the upper left corner and the lower right corner of the intersection, the intersection area is calculated, and according to the intersection area and the areas of the two component frames, the union area is obtained;
[0083] The intersection over union (IoU) is calculated based on the intersection area and the union area. If the IoU is higher than the preset IoU threshold, the two bounding boxes are merged. Otherwise, the component box with higher confidence is taken from the two component boxes as the final component box.
[0084] Finally, the identified component information is saved in the component information table, including: component ID, wiring diagram ID, component category, component frame upper left coordinate, component frame lower right coordinate, component frame center point coordinate, component frame height and component frame width, among which it is associated with the wiring diagram according to the wiring diagram ID.
[0085] 2) Identify text content
[0086] It should be noted that the text content in the wiring diagram includes: label, terminal number and line number; the label is the component identification, the terminal number indicates the position of the component connecting the circuit line, and the line number indicates different connected circuit lines.
[0087] Specifically, if Figure 2 As shown, there are many ways to indicate the number, including: directly using the component code, for example, YK is used to indicate the remote control switch, and KK is used to indicate the control switch; using the component code + number, for example, S1, S2 and S3 are used to indicate three switches; using the component code + symbol + pin number, for example, CZ:A2 and CZ:A3 are used to indicate the number of aviation plugs CZ with different pins. If the component is placed horizontally, the number is above the component; if the component is placed vertically, the number is on the right side of the component.
[0088] The pin number is represented by different numbers. If the component uses a circle to represent its terminal, the pin number is written inside the circle. Otherwise, the pin number is written at the connection point between the two ends of the component and the circuit. For example, the transfer switch uses two circles to represent the switch terminals, and the pin number is written inside the circle; the switch status integrated indicator uses a rectangle to represent its shell, which includes many terminals represented by circles, and the pin number is also written inside the circle.
[0089] The line number is represented by different numbers, or characters + numbers, written above the horizontal line, or on the right side of the vertical line.
[0090] Therefore, considering that some pin numbers are inside the component and some are outside the component, different methods are used for identification.
[0091] For the text content inside the component, the component frame image is cut out according to the component frame and component category, and then the first text box inside the component frame is identified using OCR technology to obtain the terminal number inside the component.
[0092] Specifically, since the pin numbers inside components are usually in digital form, they are relatively easy to identify. To intercept the component frame image based on the component frame and component category is to obtain the components with the pin numbers written inside the components according to the component category, intercept a single component frame image based on the component frame coordinates of these components, and then use Tesseract-OCR to identify the first text box and the first text content in the component frame image, that is, to obtain the text box coordinates and the pin number where the pin number inside the component is located.
[0093] For the text content outside the component, the first text box and the component box are covered respectively to obtain two text detection images for each image to be detected, and at the same time, they are passed into the text box detection model to obtain the second text box outside the component box; the second text box image is intercepted from each image to be detected and passed into the text recognition model to identify the second text content.
[0094] It should be noted that the text outside the component is in the wiring diagram, with different lengths, variable positions, and uncertain directions. The text includes letters, numbers, and symbols. In addition, due to the different complexity of the wiring diagram, some places may have dense lines and text close to lines. It is difficult to accurately recognize all of them using the general optical character recognition method, and the effect is not good. Therefore, this embodiment first uses the text box detection model to obtain an accurate text box, and then cuts out the text image according to the text box and transmits it to the text recognition model to obtain the text in the text box.
[0095] It should be noted that the text box detection model is obtained by training the improved Faster R-CNN model. Considering that the components in the wiring diagram may affect the recognition of the text, directly removing the recognized component box may also remove part of the text and cause recognition errors. Therefore, the improved Faster R-CNN model in this embodiment receives two images at the same time, namely, the text content inside the component in the original image is covered, and the image obtained by covering each component in the original image, and uses two ResNet networks as a dual-branch feature extraction network to extract features from the two input images to obtain feature maps, and adds a feature pyramid network to fuse the feature maps extracted by the dual branches and then pass them to the region proposal network (RPN) and the region recognition network; the region proposal network predicts the candidate region based on the fused feature map and then passes it to the region recognition network, the region recognition network first uses the ROI pooling layer to extract the feature sub-map of the candidate region from the candidate region and the fused feature map, and then uses multiple fully connected layers to perform category prediction and bounding box regression on the candidate region based on the feature sub-map, that is: further extract features from the feature sub-map to predict the bounding box coordinates of the candidate region, and screen the bounding box of the candidate region through non-maximum suppression to obtain the precise coordinates of the text box.
[0096] When training the improved Faster R-CNN model, the loss function is calculated by calculating the second classification loss , boundary regression loss Difference between the two-branch feature map The second classification loss uses cross entropy loss, including the binary classification loss of the region proposal network for the foreground and background, and the classification loss of the region recognition network for the candidate region category; the boundary regression loss uses smooth L1 loss, including the offset loss of the predicted border and the real border of the candidate region by the region proposal network and the region recognition network; the difference of the two-branch feature map is obtained by calculating the cosine distance of the two-branch feature map, and the formula is as follows:
[0097] ,
[0098] in, , and Represent the second classification loss respectively , boundary regression loss and dual-branch feature map difference loss The weight of; P and Q represent the dual-branch feature map, Indicates taking the L2 norm.
[0099] It should be noted that the text recognition model is trained by introducing a multi-head self-attention mechanism into the CNN-LSTM combination model. The multi-head self-attention mechanism helps the model learn more subtle and accurate text information. The text recognition model includes: Convolutional Neural Network (CNN), sliding window module and Long Short-Term Memory (LSTM) with multi-head self-attention mechanism. Among them, the convolutional neural network CNN is used to extract the feature map of the text box image, and the sliding window module is used to select the feature vector in the feature map by sliding the window, and then pass it to the long short-term memory network module with multi-head attention mechanism after forming the feature matrix, to encode and decode the feature sequence, and output the text sequence in each text box image.
[0100] Total loss function when training a text recognition model The attention weight regularization loss is calculated by the following formula and character sequence loss The attention weight regularization loss is used to ensure that the model's attention distribution is concentrated in the text area and improve recognition accuracy; the character sequence loss measures the difference between the character sequence output by the model and the true character sequence:
[0101] ,
[0102] in, Indicates the maximum length of the output text sequence, represents the regularization coefficient, Indicates The attention weight of each head, represents the total number of attention heads, Indicates taking the L2 norm; Indicates Characters predicted as character set Middle The probability of a character, Indicates the real sequence One-hot encoding of character labels, Represents the weight of the character sequence loss.
[0103] After the improved Faster R-CNN model is trained, the text box detection model is obtained, and after the CNN-LSTM model with multi-head self-attention mechanism is trained, the text recognition model is obtained.
[0104] During implementation, for each image to be detected obtained in step S1, the first text box is covered with white to obtain a first text detection image; the component box is covered with white to obtain a second text detection image, and the first text detection image and the second text detection image are simultaneously transmitted to a text box detection model to obtain the coordinates of the second text box. The text box image is intercepted according to the coordinates of the second text box and scaled into a second text box image of the same size and then transmitted to a text recognition model to output the character sequence in each second text box image, and the second text content is recognized.
[0105] Preferably, considering that there will be no special symbols at the head and tail of the recognized character sequence, such as "?", "[", "]", "|", "丿", etc., by defining a regular expression, the illegal characters at the head and tail of the text are removed to obtain the text content corresponding to each second text box.
[0106] Furthermore, when associating the component with the external text content, calculate the distance between the center point coordinates of the component box and each second text box, and associate the second text box with a distance less than the distance threshold with the corresponding component box. If there is only one associated second text box, the label corresponding to the component is obtained; otherwise, recognize the text content in multiple second text boxes. When the text content is pure numbers, the terminal number outside the component is obtained; when the second text content contains characters, the label of the component is obtained; the remaining text content that is not associated with the component box and contains numbers in the text content is the wire number.
[0107] Finally, save the recognized text content in a text information table, including: text ID, wiring diagram ID, text content, upper left coordinates of the text box, lower right coordinates of the text box, center point coordinates of the text box, height of the text box, width of the text box, and text position. Among them, it is associated with the wiring diagram table according to the wiring diagram ID; a specific character is added to the text ID corresponding to the wire number to facilitate differentiation from the label and the terminal number; 0 is used to represent inside the component and 1 is used to represent outside the component in the text position. Save the association between the component and the text in a component-text association table, including: component ID, text ID, and text type. Among them, 0 is used to represent the label and 1 is used to represent the terminal number in the text type.
[0108] Preferably, the system of this embodiment further includes: a wiring data verification module, which is used to mark the image to be detected as an information image when there is no component box in the image to be detected; recognize the third text box and the third text content in the information image; parse the third text content to obtain the label, component category, name, model, and quantity as standard data; and verify the recognition result of the wiring data recognition module based on the standard data to obtain a verification result.
[0109] It should be noted that the design drawing information and wiring diagram component information are generally written in the form of a table in the lower right corner of the power grid station drawing. The design drawing information includes: project name, design unit name, date, drawing name and drawing number; the wiring diagram component information includes: serial number, label, name, model, quantity and remarks.
[0110] The wiring data verification module is used to verify the recognition results and improve the component data based on the wiring diagram information in the lower right corner, so as to maximize the data value in the power grid station drawings.
[0111] Specifically, when the component detection model is used to identify the component frame in each image to be detected in the wiring data recognition module, when there is no component frame in the detection result output by the component detection model, it means that the input image to be detected contains design unit information and wiring diagram component information, and it is marked as an information image; Tesseract-OCR is used to identify the third text box and the third text content in the information image; the third text content is parsed to obtain the label, component category, name, model and quantity as standard data; and the recognition result is verified based on the standard data to obtain a verification result.
[0112] It should be noted that parsing the third text content includes: obtaining wiring diagram information from the third text content according to a table template, identifying whether the label in the wiring diagram information contains preset characters, if so, truncating the label according to the preset characters to obtain the component code, obtaining the component category according to the component code, and obtaining the label of a single component according to the component code and quantity; if not, the label in the wiring diagram is the label of a single component, and the component category is obtained according to the label.
[0113] For example, the label in the wiring diagram information is "LP1~7", the name is "connecting piece", the model is "JL1-2.5 / 2", and the quantity is "7", that is, 7 connecting pieces are represented by one piece of information; when parsing, the component code "LP" is obtained according to the preset character "~", and the corresponding component category can be obtained according to the component code, and then according to the number of components, a digital number is added after the component code to get the label of a single component.
[0114] The parsed component information is saved to the component standard data table, including: serial number ID, drawing ID, original label, split label, name, model and quantity. Among them, the label of a single component is connected with a comma in the split label according to the association with the wiring diagram based on the drawing ID.
[0115] The design drawing information is parsed from the third text content and updated to the field of the corresponding drawing in the drawing table according to the drawing ID.
[0116] Furthermore, verification results are obtained based on verification of the recognition results with standard data, including: obtaining a list of components that exist in the recognition results but do not exist in the standard data, and a list of components that do not exist in the recognition results but exist in the standard data according to component categories; obtaining a list of components that exist in the recognition results but do not exist in the standard data, and a list of components that do not exist in the recognition results but exist in the standard data according to component numbers; obtaining component categories with inconsistent quantities according to component categories and quantities.
[0117] If the verification result is not empty, it means that there is a problem with the recognition result or the wiring diagram design itself; if the verification result is empty, it means that the recognition result is consistent with the wiring diagram information. The verification result is displayed in the wiring data verification module.
[0118] (3) Wiring topology identification module
[0119] It should be noted that this module identifies each line segment according to the following steps:
[0120] ① After covering the component frame and text frame in the image to be detected with white to remove interference, the line segment detector (LSD) algorithm in OpenCV is used to detect the image to be detected, and multiple original line segments are obtained, each of which includes the coordinates of two endpoints.
[0121] ② Calculate the absolute value of the slope of the original line segment based on the coordinates of the two endpoints of the original line segment. If the horizontal coordinates of the two end points are the same or the absolute value of the slope is greater than the first slope threshold, it is considered to be a vertical line segment. If the absolute value of the slope is less than or equal to the second slope threshold, it is considered to be a horizontal line segment.
[0122] Exemplarily, the first slope threshold is 5.5, and the second slope threshold is 0.3.
[0123] ③ According to the horizontal distance and vertical distance between the line segments, merge the overlapping line segments in the horizontal and vertical segments respectively.
[0124] It should be noted that since the LSD algorithm may identify thick lines as two parallel segments and vertically intersecting lines as four segments, repeated horizontal and vertical segments are merged. During implementation, all horizontal segments are first sorted in ascending order of the horizontal coordinates, and all vertical segments are sorted in ascending order of the vertical coordinates. The sorted horizontal segments are traversed, and for each horizontal segment, if the vertical distance to the next horizontal segment is less than the preset vertical distance threshold, and the horizontal distance is less than the preset horizontal distance threshold, the two segments are considered to be overlapping segments, and the two segments are merged into one segment, that is, the minimum horizontal coordinate and the maximum horizontal coordinate of the two segments are taken as the coordinates of the two endpoints of the merged segment. The same method is used to merge the overlapping segments in the vertical segments to obtain the merged horizontal segment and the merged vertical segment.
[0125] ④Identify whether the merged horizontal and vertical line segments will form a closed loop.
[0126] It should be noted that in some wiring diagrams, designers will add some auxiliary block diagrams, for example, Figure 2 In the example, a block diagram is used to assist in indicating that some lines are the wiring inside the circuit breaker. This auxiliary block diagram will seriously interfere with the identification of the line topology relationship, so it is necessary to remove the line segments generated by the auxiliary block diagram.
[0127] During implementation, the merged horizontal and vertical line segments are used as nodes. If the endpoints of the two line segments coincide or the distance between the endpoints is less than the distance threshold, an edge is established between the two line segments to construct a line segment connection graph. A graph search algorithm is used to identify whether there is a closed loop in the line segment connection graph. If so, the line segments corresponding to the nodes that constitute the closed loop are removed.
[0128] Exemplarily, a depth-first or breadth-first search algorithm is used to record visited nodes (ie line segments) during the search process. If the starting node is visited again and the number of nodes on the path is greater than or equal to 3, it means that a closed loop has been found.
[0129] ⑤ Identify whether there is an intersection between the horizontal and vertical line segments, and divide them according to the intersection to obtain the final line segments.
[0130] It should be noted that line segments can be merged to remove duplicate and overlapping line segments, but it is also necessary to identify the intersection of each line segment in order to analyze the accurate line branching and obtain the accurate topological relationship. Figure 2 As shown, a vertical line segment on the left intersects with many horizontal line segments. The vertical line segment on the left needs to be split to obtain the connection relationship between the line segments.
[0131] Specifically, the vertical line segments are traversed, and for each vertical line segment, if there is a horizontal line segment whose distance to the endpoint of the vertical line segment is less than the distance threshold, and if the endpoint of the vertical line segment intersects with the horizontal line segment after being extended, then the vertical line segment is extended to the intersection point, and the horizontal line segment is split into two new horizontal line segments based on the intersection point; if the endpoint of the horizontal line segment intersects with the vertical line segment after being extended, then the horizontal line segment is extended to the intersection point, and the vertical line segment is split into two new vertical line segments based on the intersection point.
[0132] Furthermore, considering that wiring diagrams are usually designed in a certain logical order for easy understanding and reading, this embodiment defines the starting point and end point of each line segment according to the reading habit from left to right and from top to bottom, obtains the elements or line segments connected at both ends of the line segment, and constructs the wiring link information of each wiring diagram.
[0133] Specifically, for a horizontal line segment, the endpoint with the smallest abscissa is taken as the starting point, and for a vertical line segment, the endpoint with the largest ordinate is taken as the starting point.
[0134] The connection condition is that the closest to the starting point / end point of the line segment and the distance is less than the distance threshold. For each line segment, first search for the component boxes that meet the connection conditions, and obtain the components connected to the starting point / end point of each line segment; identify whether the connected component has a pin number. If so, obtain the pin number closest to the starting point / end point based on the coordinates of the text box where the pin number is located; if the starting point or end point does not find a component box that meets the connection conditions, search for the end points or starting points that meet the connection conditions in the remaining line segments, and obtain the line segment connected to the starting point or end point of each line segment.
[0135] It should be emphasized that when searching for a line segment that meets the connection conditions at the starting point of a line segment, it is necessary to search from the end points of the remaining line segments. When searching for a line segment that meets the connection conditions at the end point of a line segment, it is necessary to search from the starting points of the remaining line segments. This is the only way to ensure the correctness of the line connection when tracing forward and backward.
[0136] It should be noted that some line segments in the wiring diagram correspond to line numbers. The line segment closest to the border of the text box where the offline number is located is obtained to obtain the element or line segment connected to the line corresponding to the line number. Exemplarily, in combination with the placement rule of the line number in this embodiment, the line segment closest to the lower border and left border of the text box where the offline number is located is obtained as the line segment corresponding to the line number.
[0137] Finally, the connection information of both ends of each line segment is saved in the database to construct the wiring link information of each wiring diagram, including:
[0138] Get the ID corresponding to the components or line segments connected at both ends of each line, save the line segment ID, starting point coordinates, end point coordinates, starting point connection ID, starting point connection type, starting point connection text, end point connection ID, end point connection type, and end point connection text for each line segment in each wiring diagram, and obtain the wiring link information of each wiring diagram; among which, the starting point connection ID and the end point connection ID are used to store the component ID or line segment ID; the starting point connection type includes components and line segments; the starting point connection text and the end point connection text are used to store the terminal number closest to the endpoint.
[0139] (4) Auxiliary analysis input module
[0140] It should be noted that, based on the stored drawing table, wiring diagram, component information table and text information table, selections are made in sequence in a multi-level cascade manner in the form of a drop-down box.
[0141] Specifically, the first level of the multi-level cascade is to obtain the drawing numbers of all imported power grid station drawings from the drawing table, and select a power grid station drawing from them; the second level is to obtain the segmented wiring diagram from the wiring diagram according to the selected power grid station drawing, and select a wiring diagram from it; the third level is to obtain the component number from the component information table and the line number from the text information table according to the selected wiring diagram, and display the component number and line number after merging, and select a component number or line number from them. According to the multi-level selected information, the selected drawing ID, wiring diagram ID, component ID or line segment ID is obtained for subsequent fault auxiliary analysis.
[0142] Preferably, each level of drop-down box has a fuzzy search function to filter out required information based on the input keywords.
[0143] (5) Fault auxiliary analysis module
[0144] It should be noted that the fault source link refers to the forward link of the faulty component or line, which is used to locate the fault cause, and the impact link refers to the backward link of the faulty component or line, which is used to analyze the impact range.
[0145] When analyzing the fault source link and the influencing link using the constructed wiring link information, the connected line segments are mainly used to find the previous / next component or line segment, but the lines without line numbers do not need to be displayed. Therefore, the fault source link and the influencing link display the associated components and lines with line numbers, which facilitates the operation and maintenance personnel to quickly locate and analyze.
[0146] According to the selected component number or line number in the wiring diagram selected by the auxiliary analysis input module, the fault source link is analyzed from the corresponding wiring link information, including:
[0147] First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the end connection ID in the wiring link information corresponding to the wiring diagram to find the starting connection ID, and continue to use the one or more starting connection IDs found as new end connection IDs for recursive search until no new starting connection ID is found. Then, filter out the information whose starting connection type is a component or the starting connection type is a line segment and the line number is not empty from the found information to obtain one or more fault source links.
[0148] According to the component number or line number in the wiring diagram selected by the auxiliary analysis input module, the influencing link is analyzed from the corresponding wiring link information, including:
[0149] First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the starting connection ID in the wiring link information corresponding to the wiring diagram to search for the end connection ID. Use the one or more end connection IDs found as new starting connection IDs for recursive search until no new end connection ID is found. Then, filter out the information whose end connection type is a component or the end connection type is a line segment and whose line number is not empty from the found information to obtain one or more influencing links.
[0150] It should be noted that the found fault source link and the influencing link are centered on the selected component or line and displayed using the front-end chart component. For example, the open source JavaScript graph visualization library GOJS is used to display the link information.
[0151] Preferably, in order to improve the front-end loading performance, the first-level link information is initially queried and displayed, and then queried and displayed level by level by clicking.
[0152] During implementation, when the operation and maintenance personnel find that there is a problem with a component, such as an indicator light is not on, the corresponding component number in the wiring diagram is selected step by step in the auxiliary analysis input module, and the two-way link of the indicator light is graphically displayed in the auxiliary analysis module to assist the operation and maintenance personnel in quickly locating the source of the fault. At the same time, the influencing link of the indicator light can be compared with the influencing range of the indicator light in the actual scenario, and the key influencing link can be identified, or the influencing link can be identified whether it is accurate, so as to facilitate continuous correction and promote continuous optimization of system functions.
[0153] It should be noted that the system of this embodiment further includes: a connection data retrieval module, which is used to obtain and display query results according to the received query parameters and query conditions.
[0154] Specifically, the system stores drawing tables, wiring diagrams, component information tables, text information tables, component text association tables and link information tables; a drawing contains one or more wiring diagrams, a wiring diagram contains multiple components, and each component corresponds to one or more texts; each component and line number has connection information.
[0155] According to the information stored in the above table, the query parameters are a combination of the fields in the table, and the query results include: the information and original image of each drawing; the wiring diagram information and image contained in each drawing; the component category, total number of components, and number of components of each component category contained in each wiring diagram; for each component, the component number, component category, terminal number, and front and rear connection information are displayed; for each line number, the front and rear connection information is displayed.
[0156] Compared with the prior art, the present embodiment provides a power grid station wiring fault auxiliary analysis system. Considering that the placement direction of components in a two-dimensional drawing will affect the recognition effect, the auxiliary image is obtained by rotating the image to be detected, and the accuracy of component recognition is improved by using two images; the label, terminal number and line number in the wiring diagram are recognized to ensure the integrity of the text content; the wiring link of each wiring diagram is constructed by identifying the components or line segments connected at both ends of the line segment, so that the fault source link and the impact link are automatically analyzed according to any component or line number in the wiring link, which solves the problem of recognition difficulty caused by complex line crossing and improves the fault analysis efficiency and problem location accuracy. When identifying the line segments in the wiring diagram, the recognition error is reduced by merging and filtering the repeated line segments; the auxiliary frame in the wiring diagram is removed by closed-loop recognition, which improves the accuracy of topological relationship recognition; finally, the intersection and corner in the line are identified by the intersection of horizontal and vertical line segments, the line segments are correctly segmented, and the starting point and end point are determined, so that the wiring link information has directionality; forward and backward tracing is provided and non-critical line segments are automatically filtered out, which is convenient for locating the fault source and analyzing the impact range.
[0157] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0158] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A power grid station wiring fault auxiliary analysis system, characterized in that: include: A station drawing import module is used to import the original image of the power grid station drawing, segment the original image to obtain each wiring diagram, obtain each image to be detected by scaling each wiring diagram to a preset size, and obtain an auxiliary image corresponding to the image to be detected by rotating and scaling each wiring diagram to a preset size; A wiring data recognition module, for identifying components and text content and associating them using multiple neural network models according to each image to be detected and its corresponding auxiliary image; the text content includes: label, terminal number and line number; A wiring topology recognition module, used to recognize each line segment in each of the images to be detected, and to construct wiring link information of each wiring diagram according to the components or line segments connected at both ends of the line segment; An auxiliary analysis input module is used to select the grid station drawings, wiring diagrams, and component numbers or line numbers in sequence through a multi-stage cascade method; A fault auxiliary analysis module, used to analyze and display the fault source link and the influencing link from the corresponding wiring link information according to the component number or line number in the wiring diagram selected by the auxiliary analysis input module; The wiring data recognition module uses multiple neural network models to recognize components and text content and associate them, including: First, identify the component frame and component category in each image to be detected, cut out the component frame image according to the component frame and component category, identify the first text frame inside the component frame, and obtain the terminal number inside the component; then identify the second text frame outside the component frame and its text content, calculate the distance between the component frame and the center point coordinates of each second text frame, associate the second text frame with a distance less than the distance threshold with the corresponding component frame, and if there is only one associated second text frame, obtain the label corresponding to the component; otherwise, identify the text content in multiple second text frames, and when the text content is pure numbers, obtain the terminal number outside the component; when the second text content contains characters, obtain the component label; The remaining text content that is not associated with a component frame and contains numbers is the wire number.
2. The power grid station wiring fault auxiliary analysis system according to claim 1 is characterized in that: The wiring topology recognition module recognizes each line segment in each of the images to be detected, including: Covering the bounding box where the components and text content in each image to be detected are located; detecting each image to be detected using a straight line detection algorithm to obtain a plurality of original line segments; dividing each original line segment into a horizontal line segment or a vertical line segment according to the slope of the original line segment; merging the overlapping line segments in the horizontal line segments and the vertical line segments according to the horizontal distance and the vertical distance between the line segments; Identify whether there is an intersection between the merged horizontal and vertical line segments. If so, segment the merged horizontal or vertical line segments according to the intersection. After deduplication, each line segment obtained after segmentation is the final identified line segment.
3. The power grid station wiring fault auxiliary analysis system according to claim 2 is characterized in that: Before identifying whether there is an intersection between the merged horizontal and vertical line segments, identifying whether the merged horizontal and vertical line segments will form a closed loop, including: taking the merged horizontal and vertical line segments as nodes, and if the endpoints of the two line segments coincide, establishing an edge between the two line segments to construct a line segment connection graph; using a graph search algorithm to identify whether there is a closed loop in the line segment connection graph, and if so, removing the line segments corresponding to the nodes that constitute the closed loop.
4. The power grid station wiring fault auxiliary analysis system according to claim 1, characterized in that: The wiring topology identification module obtains the elements or line segments connected at both ends of the line segment through the following steps: For a horizontal line segment, the endpoint with the smallest abscissa is taken as the starting point, and for a vertical line segment, the endpoint with the largest ordinate is taken as the starting point; The connection condition is that the closest to the starting point / end point of the line segment and the distance is less than the distance threshold. For each line segment, each component box that meets the connection condition is first searched to obtain the components connected to the starting point / end point of each line segment; Identify whether the connected component has a pin number. If so, get the pin number closest to the start / end point based on the coordinates of the text box where the pin number is located. If the starting point or end point does not find a component box that meets the connection conditions, find the end point or starting point that meets the connection conditions in the remaining line segments, and get the line segments connected to the start or end point of each line segment.
5. The power grid station wiring fault auxiliary analysis system according to claim 4, characterized in that: The wiring topology identification module constructs wiring link information of each wiring diagram, including: Get the ID corresponding to the components or line segments connected at both ends of each line, save the line segment ID, starting point coordinates, end point coordinates, starting point connection ID, starting point connection type, starting point connection text, end point connection ID, end point connection type, and end point connection text for each line segment in each wiring diagram, and obtain the wiring link information of each wiring diagram; among which, the starting point connection ID and the end point connection ID are used to store the component ID or line segment ID; the starting point connection type includes components and line segments; the starting point connection text and the end point connection text are used to store the terminal number closest to the endpoint.
6. The power grid station wiring fault auxiliary analysis system according to claim 5, characterized in that: The fault auxiliary analysis module analyzes the fault source link from the corresponding wiring link information according to the component number or line number in the wiring diagram selected by the auxiliary analysis input module, including: First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the end connection ID in the wiring link information corresponding to the wiring diagram to find the starting connection ID, and continue to use the one or more starting connection IDs found as new end connection IDs for recursive search until no new starting connection ID is found. Then, filter out the information whose starting connection type is a component or the starting connection type is a line segment and the line number is not empty from the found information to obtain one or more fault source links.
7. The power grid station wiring fault auxiliary analysis system according to claim 5, characterized in that: The fault auxiliary analysis module analyzes the influencing link from the corresponding wiring link information according to the component number or line number in the wiring diagram selected by the auxiliary analysis input module, including: First, obtain the component ID or line segment ID corresponding to the component number or line number in the wiring diagram, and then use it as the starting connection ID in the wiring link information corresponding to the wiring diagram to search for the end connection ID. Use the one or more end connection IDs found as new starting connection IDs for recursive search until no new end connection ID is found. Then, filter out the information whose end connection type is a component or the end connection type is a line segment and whose line number is not empty from the found information to obtain one or more influencing links.
8. The power grid station wiring fault auxiliary analysis system according to claim 1, characterized in that: The component frames and component categories in each image to be detected are identified by sequentially passing each image to be detected and its auxiliary image into a component detection model, and obtaining each component frame and component category in each image to be detected by fusing the two detection results output; the component detection model is obtained by training an improved YOLOv5 model.
9. The power grid station wiring fault auxiliary analysis system according to claim 1, characterized in that: The second text box outside the component box and its text content are identified by obtaining two text detection images for each image to be detected based on the first text box and the component box, and simultaneously passing them into a text box detection model to obtain the second text box outside the component box; the second text box image is intercepted from each image to be detected and passed into a text recognition model to identify the second text content; the text box detection model is obtained by training an improved Faster R-CNN model; and the text recognition model is trained by introducing a multi-head self-attention mechanism in a CNN-LSTM combination model.
Citation Information
Patent Citations
Bird visual target detection method combining YOLO and rotation-fusion strategy
CN112560675A
Method for generating wiring diagram in CIM-G format
CN116756896A
Objective conversion method and device for secondary paper drawing and PDF drawing of power grid plant station
CN117113460A