Graph consistency verification method and device, computer device and storage medium
By acquiring and updating graph feature information, constructing mapping relationships and performing text recognition, and combining Levenstein distance and topology graph information, the problem of insufficient automation in graph consistency verification in power systems is solved, and the cost of manual verification is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN POWER SUPPLY BUREAU
- Filing Date
- 2024-08-27
- Publication Date
- 2026-07-31
AI Technical Summary
In existing power system dispatch automation, the consistency verification of diagrams and models cannot take into account the system wiring diagrams under complex backgrounds, resulting in high manual verification costs and insufficient level of automated verification.
By obtaining graphical feature information from power system operation files, a mapping relationship between graphical coordinates and screen coordinates is constructed, target attribute box information is obtained, text recognition and supplementary feature information are updated, and graphical consistency is verified by combining Levenstein distance and network topology information.
It improves the automation level of pattern consistency verification, reduces verification costs, and can accurately locate the area to be verified and improve the equipment information in power grid business files.
Smart Images

Figure CN119150044B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data recognition and processing technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for verifying the consistency of image patterns. Background Technology
[0002] As the scale of power system dispatch automation continues to expand, the requirements for the operation and maintenance of power automation systems are also increasing. In daily operation and maintenance monitoring, consistency comparison of dispatch diagrams is one of the key tasks of main grid dispatch inspection.
[0003] However, current automated verification cannot take into account the wide variety of information in system wiring diagrams. When faced with complex system wiring diagrams, the current solution is to conduct inspections based on human experience. However, due to the complexity of the diagram structure and the large amount of information, the cost of manual verification is very high. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for graph consistency verification that can improve the automation level of graph consistency verification and reduce verification costs, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides a method for verifying the consistency of a graph model, including:
[0006] Obtain the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information;
[0007] Construct a mapping relationship between the coordinate information of the graphic model and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0008] Text recognition is performed based on the target attribute box information to obtain supplementary feature information;
[0009] The feature information of the image model to be verified is updated according to the supplementary feature information, and the consistency of the image model is verified according to the updated feature information of the image model to be verified.
[0010] In one embodiment, obtaining the target attribute box information corresponding to the image model to be verified based on the position mapping information includes:
[0011] Calculate the attribute box position information corresponding to the image model to be verified based on the position mapping information;
[0012] Obtain the attribute box data at the corresponding position based on the attribute box position information;
[0013] The target grayscale image is obtained by removing noise data from the attribute box data according to a preset grayscale threshold;
[0014] The target attribute box information is determined based on the target grayscale image.
[0015] In one embodiment, determining the target attribute box information based on the target grayscale image includes:
[0016] For the target grayscale image, projections are made in a first direction and a second direction on the same plane to obtain a target projected image; wherein the first direction and the second direction intersect.
[0017] A preliminary attribute box is determined based on the target projection image, and the brightness data of each pixel in the preliminary attribute box is determined.
[0018] The brightness ratio of the initial selection attribute box is calculated based on the brightness data; wherein, the brightness ratio refers to the proportion of the number of pixels in the initial selection box whose brightness data exceeds a preset brightness threshold to the total number of pixels;
[0019] If the brightness ratio is greater than a preset brightness ratio threshold, the initial selected attribute box is determined as the target attribute box, and the target attribute box information corresponding to the target attribute box is used.
[0020] In one embodiment, the step of performing text recognition based on the target attribute box information to obtain supplementary feature information includes:
[0021] Based on the target attribute box information, the information content within the target attribute box is detected to obtain text positioning information;
[0022] Text recognition is performed based on the text location information to obtain supplementary feature information.
[0023] In one embodiment, the updated feature information of the image to be verified includes text character information; the step of performing image consistency verification based on the updated feature information of the image to be verified includes:
[0024] For each of the corresponding graph patterns to be verified, the Levenstein distance data and the length of the longest common subsequence are calculated based on the text character information.
[0025] The character similarity between the graph patterns to be verified is calculated based on the Levenstein distance data and the length of the longest common subsequence.
[0026] The consistency of the image pattern is verified based on the character similarity.
[0027] In one embodiment, the updated graph pattern feature information to be verified further includes network topology graph information; the graph pattern consistency verification based on the updated graph pattern feature information to be verified further includes:
[0028] For each of the corresponding graph models to be verified, node similarity data and edge similarity data are calculated based on the network topology graph information.
[0029] Calculate the graph similarity between the graph models to be verified based on the node similarity data and the edge similarity data;
[0030] Graph similarity is used to verify graph model consistency.
[0031] Secondly, this application also provides a pattern consistency verification device, comprising:
[0032] The information acquisition module is used to acquire the feature information of the model to be verified from the power system operation file; wherein, the feature information of the model includes the model coordinate information;
[0033] The position mapping module is used to construct the mapping relationship between the coordinate information of the graphic model and the current screen coordinates, obtain the position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0034] The information recognition module is used to perform text recognition based on the target attribute box information to obtain supplementary feature information;
[0035] The consistency verification module is used to update the feature information of the image model to be verified according to the supplementary feature information, and to perform image model consistency verification according to the updated feature information of the image model to be verified.
[0036] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0037] Obtain the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information;
[0038] Construct a mapping relationship between the coordinate information of the graphic model and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0039] Text recognition is performed based on the target attribute box information to obtain supplementary feature information;
[0040] The feature information of the image model to be verified is updated according to the supplementary feature information, and the consistency of the image model is verified according to the updated feature information of the image model to be verified.
[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0042] Obtain the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information;
[0043] Construct a mapping relationship between the coordinate information of the graphic model and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0044] Text recognition is performed based on the target attribute box information to obtain supplementary feature information;
[0045] The feature information of the image model to be verified is updated according to the supplementary feature information, and the consistency of the image model is verified according to the updated feature information of the image model to be verified.
[0046] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0047] Obtain the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information;
[0048] Construct a mapping relationship between the coordinate information of the graphic model and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0049] Text recognition is performed based on the target attribute box information to obtain supplementary feature information;
[0050] The feature information of the image model to be verified is updated according to the supplementary feature information, and the consistency of the image model is verified according to the updated feature information of the image model to be verified.
[0051] The aforementioned graphic model consistency verification method, device, computer equipment, storage medium, and computer program product obtain graphic model feature information from the power system operation file, thereby obtaining graphic model coordinate information. This dynamically constructs a mapping relationship between the graphic model coordinate information and the current screen coordinates, obtaining position mapping information. Based on the position mapping information, it obtains the target attribute box information corresponding to the graphic model to be verified, thus accurately locating the area to be verified. Consistency verification is then performed on the content corresponding to the target attribute box of the graphic model to be verified. Text recognition is performed based on the target attribute box information to obtain supplementary feature information. The feature information of the graphic model to be verified is updated based on the supplementary feature information. Furthermore, the attribute box information is used to supplement missing equipment information in the power grid business file, further improving the feature information of the graphic model to be verified. Finally, graphic model consistency verification is performed based on the updated feature information of the graphic model to be verified. This improves the automation level of graphic model consistency verification and reduces verification costs. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 This is an application environment diagram of a graph pattern consistency verification method in one embodiment;
[0054] Figure 2 This is a flowchart illustrating a graph consistency verification method in one embodiment;
[0055] Figure 3 This is a flowchart illustrating step S204 of a graph consistency verification method in one embodiment;
[0056] Figure 4 This is a structural block diagram of a pattern consistency verification device in one embodiment;
[0057] Figure 5 This is an internal structural diagram of a computer device in one embodiment;
[0058] Figure 6 This is a diagram of the internal structure of a computer device in another embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] The pattern consistency verification method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. The data storage system can be used to store data such as feature information of the image model to be verified. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0061] In one exemplary embodiment, such as Figure 2 As shown, a graph pattern consistency verification method is provided, which is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps S202 to S208. Wherein:
[0062] Step S202: Obtain the feature information of the diagram model to be verified from the power system operation file.
[0063] The graph model feature information includes graph model coordinate information. Graph model consistency comparison refers to checking the consistency of two or more scheduling graph models (such as flowcharts, sequence diagrams, or other scheduling plans) in terms of structure and behavior by comparing them. The aforementioned graph model feature information refers to the characteristics used to characterize the multiple scheduling graph models to be verified in terms of flow, timing, connection relationships, and attributes.
[0064] For example, server 104 can obtain the feature information of the diagram to be verified from the power system operation file by means of file scanning.
[0065] Step S204: Construct a mapping relationship between the graphic model coordinate information and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information.
[0066] For example, server 104 can calculate the attribute box position information corresponding to the image model to be verified based on the position mapping information, obtain the attribute box data at the corresponding position based on the attribute box position information, remove noise data in the attribute box data based on the preset grayscale threshold, obtain the target grayscale image, and determine the target attribute box information based on the target grayscale image.
[0067] For example, taking a white attribute box as an example, while the background wiring diagram and indicator data are mostly red or yellow, server 104 can use a color filtering method to remove the parts other than white. Server 104 can set the required color threshold for specific situations to the "white" attribute range obtained from consulting materials to generate a white area mask. The original image and the mask are then ANDed. Opening and closing operations are implemented through morphological processing operations, and the structure S used for comparison is set to a square with a custom side length.
[0068] Step S206: Perform text recognition based on the target attribute box information to obtain supplementary feature information.
[0069] For example, server 104 can detect the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and perform text recognition based on the text positioning information to obtain supplementary feature information.
[0070] For example, in actual tasks, the background of wiring diagrams is complex, including component icons, component names, text information, etc., which can easily interfere with the text localization problem of traditional text recognition algorithms. Server 104 can adopt a two-stage OCR (Optical Character Recognition) algorithm that combines text detection and text recognition.
[0071] Server 104 can employ a PPOCR (Paddle Paddle OCR) network architecture combined with MobileNet-v3 as a text detection algorithm to detect information within the target attribute bounding box. The PPOCR model consists of a backbone network, a neck network, and a head network. The backbone network uses the MobileNet-v3 structure, primarily composed of convolutional, pooling, residual, and activation structures, divided into multiple stages. Each stage of the network contains one or more residual units. Each residual unit receives input and undergoes a "dimensionality increase-feature processing-compressed activation-dimensionality reduction" process to obtain new features. The new features are then added to the original input to obtain the output. The "dimensionality increase-feature processing-compressed activation-dimensionality reduction" process consists of the following sub-modules:
[0072] First, the feature dimension is increased through pointwise convolution. Then, spatial-scale feature processing is performed using deep convolutional layers with 3×3 or 5×5 kernels. If a compression activation module is used, the features obtained from deep convolution are duplicated. One copy is compressed into a 1×1 feature sequence through an average pooling layer, and then transformed into a set of weight sequences through a series of pointwise convolutions and non-linear activations. The weight sequence is then dot-productted with the previously duplicated feature map to enhance attention. Finally, pointwise convolution is used to increase the dimensionality. Deep convolution refers to performing convolution operations on each channel of the feature using a one-dimensional convolution kernel. Compared to traditional convolution, it has less computational cost but does not process the correlation information between channels. Pointwise convolution refers to performing convolution operations with a 1×1 kernel. This operation only operates in the feature dimension and does not use spatial dimension information. It is complementary to deep convolution and is often called separative convolution.
[0073] Furthermore, the neck region employs a feature pyramid structure, upsampling and concatenating feature maps of varying sizes output from different stages of the backbone network in ascending order of size. Finally, these maps are unified to the same size through upsampling at different ratios and then concatenated dimensionally. The purpose of the feature pyramid is to enhance feature information; features extracted from different senses contain target information of varying sizes, and the feature pyramid integrates this information.
[0074] The head uses a DBHead classification head, which is divided into a threshold detection head and a boundary detection head. These two heads utilize the enhanced features from the neck output to detect targets and boundaries, respectively. The difference maps of the two outputs from the detection head and the boundary head are processed by a differentiable binarization module to obtain a third output. Losses are calculated on these three outputs for training, with the goal of maximizing the accuracy of image and boundary predictions while minimizing the two overlapping regions. Only the output of the threshold detection head is used in the prediction phase.
[0075] For example, in the text recognition algorithm, this embodiment embeds professional knowledge in the power field into the text recognition. The server 104 can use the PPOCRv4-rec model to perform text recognition based on the text location information.
[0076] The PPOCRv4-rec model is also divided into a backbone, neck, and head. The backbone network adopts the PPHGNet-small (Small Multi-stage Sparse Pyramid Network) structure, the neck adopts the SVTR (Sequence-to-Visual Transformer) structure, and the head adopts the CTChead (Connectionist Temporal Classification Head) structure. The PPHGNet-small structure is designed with computational density in mind, using 3×3 convolutional kernels as much as possible. The overall structure is an improvement on VovNet, mainly consisting of multi-stage stacking. Each layer includes a learnable downsampling layer (LDSLayer) and the key structure HG-Block. The main function of the HG-Block structure is to provide attention. It concatenates different feature maps obtained through multiple convolutions according to their dimensions, then averages them and performs pointwise convolutions to obtain weights. These weights are multiplied by the original input according to their dimensions, thus assigning attention to different dimensions.
[0077] First, the features obtained from the head are segmented and embedded with positional information. Different hybridization modules are used to extract morphological information within characters and textual dependencies between characters. For the neck SVTR structure, a global / local information mixing algorithm based on a multi-head attention mechanism is designed to address both intra-character and inter-character information. The optimal order of these algorithms is obtained through ablation experiments. SVTR employs two methods for feature map downsampling: Merge and Combine. The former uses a 1:2 stride convolution in the length and width directions to compress height information, while the latter pools the height to 1. Since text layout is usually nearly horizontal, both methods compress information while avoiding interference with inter-character information in the horizontal direction.
[0078] Finally, the head uses the CTC structure to directly project the sequence features obtained from the neck onto the output dimension, and CTC post-processing is used to remove duplicates to obtain the recognition result.
[0079] Step S208: Update the feature information of the image model to be verified according to the supplementary feature information, and perform image model consistency verification according to the updated feature information of the image model to be verified.
[0080] The updated feature information of the graph model to be verified may include text character information and network topology graph information.
[0081] For example, for multiple corresponding graph patterns to be verified, the Levenshtein Distance (LD) and the length of the Longest Common Subsequence (LCS) are calculated based on the text character information; the character similarity between the graph patterns to be verified is calculated based on the Levenshtein Distance and the length of the Longest Common Subsequence; and graph pattern consistency is verified based on the character similarity.
[0082] For example, using characters as the editing unit, server 104 can calculate the minimum number of operations (deletion, insertion, replacement) required to move from one string to another, for string similarity calculation. For instance, given two strings S = S1S2S3…Sm and T = T1T2T3…Tn, a matrix LD[m+1, n+1] is constructed. Using dynamic programming, the value of LD(i,j) in each cell of the matrix is calculated iteratively. The bottom-right LD(m,n) represents the desired edit distance. The calculation formula is as follows:
[0083]
[0084] Min=min{LD(i-1,j)+1,LD(i,j-1)+1,LD(i-1,j-1)+f(i,j)}
[0085] In this context, f(i,j) = 1 when the i-th word of S is not equal to the j-th word of T; otherwise, f(i,j) = 0. LD itself represents the similarity between two strings; intuitively, the larger the LD, the smaller the similarity. The formula for calculating the similarity Sim(S,T) is as follows:
[0086] Sim(S,T)=1-LD / max(m,n)
[0087] Furthermore, server 104 can use an exhaustive method to solve for the length of the longest common subsequence: check whether all subsequences of string T are subsequences of S to determine whether they are common subsequences, and then select the longest one. However, for two strings with lengths of m and n respectively, the time complexity is exponential: O(2n*2m).
[0088] Server 104 can also use dynamic programming and recursion to solve for the length of the longest common subsequence: Let L[i,j] record the length of the longest common subsequence of sequences Si and Tj. Finally, the lengths of the LCS of S and T are recorded in L[i,j]. The recursive relationship is established as follows:
[0089]
[0090] When comparing the similarity between two strings S and T, the similarity calculation formula is given by combining LD and LCS as follows:
[0091] Sim(S,T) = LCS / (LCS + LD)
[0092] Furthermore, the space and time complexity of the traditional edit distance algorithm are both O(m*n). Considering that only LD(i,j - 1), LD(i - 1,j), and LD(i - 1,j - 1) are needed for each calculation of LD(i,j), that is, only the current column and the previous column are required for calculation. By using two column vectors instead of a matrix, Server 104 can save only the current state and the state of the previous operation each time. Without significantly affecting the result and time complexity, the space complexity is reduced to O(min(m,n)). Server 104 can input strings S and T and output the length of LD:
[0093] Exemplarily, Server 104 can set n as the length of S and m as the length of T (assuming n < m). If m = 0, return n; if n = 0, return m; create two vectors v0[m + 1] and v1[m + l]; initialize the values of v0[m + 1] to 0...m; check each character in S (i from 1 to n) and each character in T (j from 1 to m); set cost as the edit cost. If s[i] == t[j], then cost = 0; if s[i]!= t[j], then cost = 1; set the cell v1[j] as one of the following minimum values: +1 above the adjacent cell: v1[j - 1]+1, +1 to the left of the adjacent cell: v0[j]+1, +cost at the upper left corner of the diagonal of the cell: v0[j - 1]+cost. After completing the above iterative steps, the value of v1[m] is the value of the edit distance. Considering that when calculating L[i,j], it is directly related only to L[i - 1,j - 1], L[i,j - 1], and L[i - 1,j], that is, when calculating the subproblems of the i-th row of L[i], only the values of the (i - 1)-th row of L[i - 1] and the previous element L[i,j - 1] of L[i,j] are needed. At this time, without changing the time complexity, the space complexity is reduced from O(m*n) to O(n). Define an array base[] of length m + 1 and initialize it to 0, a recurrence leading value front = 0, and a currently calculated element pre (L[i,j] in meaning). After each calculation of L[i,j], update the value of front to base[j - 1], then update pre to front, and then continue to scan backward, noting the update of the last element. Iterate n times like this, and the value of base[m] at the end is the value of LCS.
[0094] Similarly, server 104 can input strings S and T, and output the LCS length: server 104 can input two strings S and T; define the array base[] with size T.length()+1, define the recursive leading front=0, and the current element pre=0; initialize base[] to 0, base[i]=0; check each character of S(ifrom1toS.length()); check each character of T(ifrom1toT.length()); loop to check if S[i-1]=T[j-1] then pre=base[j-1]+1; otherwise pre=max(front,base[j]); loop to update base and front, base[j-1]=front, front=pre; update base[T.length()]=front, check base[j](jfrom1toT.length()) and output the value of base[]; after looping the above steps, base[T.length()] is the value of LCS. When solving for LCS, server 104 first constructs and initializes a two-dimensional matrix L[m+1][n+1]. If Si = Tj, then L[i][j] = 1. Finally, the longest diagonal substring with 1s in the matrix is the LCCS (Longest Common Contiguous Subsequence). Considering the difficulty of searching, when the matrix needs to be filled with 1s, it is directly set to the value of the top left corner plus 1. In this way, the largest element in the matrix is the length of the LCCS, and the position of the first character of the LCCS is the coordinate output of the first cell that has changed.
[0095] This embodiment comprehensively considers the length and occurrence position of the longest continuous common substring (LCCS), introducing a variable p to represent the first position of the longest continuous common substring (LCCS) in the target string S. When the LCS length and LD size are the same, the larger the LCCS value, the greater the similarity. When the LCCS length is also the same, considering that the preceding character (the character before the currently processed character) has a greater impact on similarity than the succeeding character (the character after the currently processed character), a smaller p indicates that the first character of the LCCS is earlier and the similarity is greater. μ is a variable that balances this factor and can be manually set according to the strictness of the LCCS requirement. The new similarity calculation formula is defined as follows:
[0096]
[0097] Let the lengths of strings S and T be m and n, respectively. Following the optimization algorithm steps described above, we obtain the edit distance LD(S,T) and the length of the longest common subsequence LCS(S,T). Following the LCCS algorithm steps, we obtain the length of the longest common substring LCCS(S,T) and the position of the first character p of the substring. Meaningless full symbol comparisons are filtered out, which is more conducive to the comparison of power wiring diagram topology text.
[0098] For example, for multiple corresponding graph patterns to be verified, node similarity data and edge similarity data are calculated based on the network topology graph information; the graph similarity between the graph patterns to be verified is calculated based on the node similarity data and edge similarity data; and graph pattern consistency verification is performed based on the graph similarity.
[0099] For example, server 104 can define the network topology graph as a quadruple. in Describes the characteristics of a node, d p The feature dimension is represented by n, and the number of nodes is represented by n. Describe the characteristics of the edge, d q Let G represent the feature dimension, and m represent the number of edges. For example, if we describe the features of an edge using its length and direction, then the edge feature is a two-dimensional vector. G, H ∈ {0, 1} n×m This describes the correspondence between nodes and edges, or in other words, how the nodes are connected, which is the structure of the graph. Here, G represents the starting point of an edge, and H represents the ending point of an edge. Specifically, if g... ic =h jc =1 means that the c-th edge in the graph points from node i to node j.
[0100] Given two graphs and And define two affinity matrices K. p ∈R n1×n2 and K q ∈R m1×m2 These represent the similarity between nodes and between nodes, and between edges, respectively, in the two graphs. For example... The diagram represents... The i1th node and Similarly, the similarity between the i2th nodes in the array can be calculated. The diagram is described The c1th edge and graph Let the similarity between the c2th edges be denoted as X. Then the graph matching problem becomes finding the optimal matching relationship X between two graphs, such that the sum of the similarity between nodes and the similarity between edges is maximized.
[0101]
[0102] The first term represents the sum of similarities between matched nodes, and the second term represents the sum of similarities between matched edges. Here, X represents the matching relationship between nodes in the two graphs. i1,i2 =1 means the diagram The i-th node and the graph The 2nd match in the i-th node. The matching relationship between nodes must satisfy the one-to-one correspondence constraint, that is, X∈∏ is a permutation matrix.
[0103] ∏={X|X∈{0,1} n1×n2 X1 n2 ≤1 n1 ,X T 1 n1 =1 n2}
[0104] Among them, 1 n Let n represent a column vector of length n with all elements being 1. We allow graphs. and Since the sizes are different (i.e., the number of nodes is different), to avoid loss of generality, we stipulate that n1 ≥ n2. Equation (2) constraint diagram Each point in the array is related to Each point in the set has a unique corresponding match.
[0105] To more clearly describe and express the goal of graph matching, we unify the incidence matrices of nodes and edges into a single incidence matrix K∈R. n1n2×n1n2 In K, the diagonal elements represent the similarity between nodes, which is the original K. p Off-diagonal elements represent the similarity between edges, which is K. q For example, the off-diagonal element k i1i2,j1j2 This represents the diagram. The edge between nodes i1 and j1 The similarity of the edges between nodes i2 and j2 in the graph.
[0106] For example, server 104 can employ a factorization-based graph matching algorithm to compare the topological relationships between the wiring diagram and the design diagram. The incidence matrix K is composed of diagonal elements (node incidence matrix K). p ) and diagonal elements (edge incidence matrix K) q The matrix K is composed of n² × n² smaller blocks, as shown in the diagram above. Excluding the diagonal elements, K is a sparse block matrix, consisting of n² × n² smaller blocks K. ij ∈R n1×n1 Composition, some blocks K ij It is a zero matrix, which means There is no edge connecting the i-th and j-th nodes in the matrix, and these zero matrices can be obtained through... To retrieve, that is, if Then the corresponding block K ij =0, for non-zero block K ij There are closed-form solutions Where c is the graph Based on the above structural characteristics, the index between the i-th and j-th nodes in the matrix can be decomposed into:
[0107]
[0108] in Let Kronecker product of matrices be used. Using the above formula, the large matrix K is decomposed into a combination of 6 smaller matrices, which reduces the algorithm complexity from... This decreases to O(n1m1+n2m2+n1n2+m1m2). Therefore, an equivalent graph matching objective function is obtained.
[0109]
[0110] in, The Hadamard product of matrices Y∈{0,1} m1×m2 The matrix y represents the correspondence between edges. c1c2 =1 indicates a diagram The c1th and c2th edges in the graph are matched. Based on the above graph matching algorithm, the topology matching relationship between the design graph and the wiring diagram can be constructed, and then the conclusion can be drawn as to whether the graph topology is consistent.
[0111] In the above-mentioned graphic model consistency verification method, the graphic model feature information to be verified is obtained from the power system operation file, and the graphic model coordinate information is obtained. This dynamically constructs a mapping relationship between the graphic model coordinate information and the current screen coordinates, obtaining position mapping information. Based on the position mapping information, the target attribute box information corresponding to the graphic model to be verified is obtained, thus accurately locating the area to be verified. Consistency verification is then performed on the content corresponding to the target attribute box of the graphic model to be verified. Text recognition is performed based on the target attribute box information to obtain supplementary feature information. The feature information of the graphic model to be verified is updated based on the supplementary feature information. Furthermore, the attribute box information is used to supplement missing equipment information in the power grid business file, further improving the feature information of the graphic model to be verified. Finally, graphic model consistency verification is performed based on the updated feature information of the graphic model to be verified. This method can improve the automation level of graphic model consistency verification and reduce verification costs.
[0112] In one exemplary embodiment, such as Figure 3 As shown, the steps for determining the target attribute box information based on the target grayscale image may include steps S302 to S308. Wherein:
[0113] Step S302: For the target grayscale image, project it in the first direction and the second direction in the same plane to obtain the target projected image.
[0114] The first direction and the second direction intersect. For example, the first direction can be the horizontal direction in the image containing the target grayscale image, and the second direction can be the vertical direction in the image containing the target grayscale image.
[0115] For example, server 104 can first use morphological image processing methods to further reduce background noise for the target attribute box, return a binarized grayscale image as a new target grayscale image, and then perform binarized projection of the obtained target grayscale image in the horizontal and vertical directions to obtain horizontal and vertical projection histograms, thereby obtaining the target projection image.
[0116] Step S304: Determine the initial selection attribute box based on the target projection image, and determine the brightness data of each pixel in the initial selection attribute box.
[0117] For example, server 104 can traverse the histogram in both the horizontal and vertical directions, bridging short gaps between zero values to find the largest continuous interval that meets preset requirements. These preset requirements may include the location of the central region and the length range of the continuous region. Next, server 104 can merge the two largest intervals obtained from the two directions in both dimensions to obtain the coordinates of the four corner points of a rectangle, thus obtaining the initial attribute box and its corresponding information. Further, server 104 can determine the brightness data of each pixel in the initial attribute box based on the initial attribute box information.
[0118] The horizontal and vertical histograms can be obtained using the `np.sum` function. This function allows you to specify summation conditions, such as `img>240`, to count valid pixels, and sets the `axis` parameter to specify the direction of the count. To avoid interference from the interface toolbar and sidebar, the valid pixels within this range need to be removed from the histogram.
[0119] Step S306: Calculate the brightness ratio of the initial selected attribute box based on the brightness data.
[0120] The brightness ratio refers to the proportion of pixels in the initial selection frame whose brightness exceeds a preset brightness threshold to the total number of pixels. For example, server 104 can obtain the brightness data of all pixels in the current initial selection attribute frame, or it can extract brightness data from pixels at intervals within the initial selection attribute frame to calculate the brightness ratio.
[0121] Step S308: If the brightness ratio is greater than the preset brightness ratio threshold, determine the initial selected attribute box as the target attribute box, and then determine the target attribute box information corresponding to the target attribute box.
[0122] For example, server 104 can determine whether the current initial attribute box contains an irrelevant background by judging whether the proportion of the number of pixels whose brightness data exceeds the preset brightness threshold in the range of the initial attribute box exceeds the preset range. If the brightness proportion is too low, it means that the current initial attribute box contains an irrelevant background, and the initial attribute box needs to be reselected.
[0123] Furthermore, after obtaining the target attribute box information, the server 104 can output the feature point coordinates (e.g., corner coordinates) of the target attribute box and perform image segmentation based on the coordinates.
[0124] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0125] Based on the same inventive concept, this application also provides a pattern consistency verification device for implementing the pattern consistency verification method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more pattern consistency verification device embodiments provided below can be found in the limitations of the pattern consistency verification method described above, and will not be repeated here.
[0126] In one exemplary embodiment, such as Figure 4 As shown, a pattern consistency verification device is provided, comprising: an information acquisition module 402, a position mapping module 404, an information recognition module 406, and a consistency verification module 408, wherein:
[0127] The information acquisition module 402 is used to acquire the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information;
[0128] The position mapping module 404 is used to construct the mapping relationship between the graphic model coordinate information and the current screen coordinates, obtain the position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information;
[0129] Information recognition module 406 is used to perform text recognition based on target attribute box information to obtain supplementary feature information;
[0130] The consistency verification module 408 is used to update the feature information of the graph model to be verified based on the supplementary feature information, and to perform graph model consistency verification based on the updated feature information of the graph model to be verified.
[0131] In one embodiment, the location mapping module 404 includes:
[0132] The position analysis unit is used to calculate the position information of the attribute box corresponding to the image model to be verified based on the position mapping information.
[0133] The data matching unit is used to obtain the attribute box data at the corresponding position based on the attribute box position information;
[0134] The data processing unit is used to remove noisy data from the attribute box data according to a preset grayscale threshold to obtain the target grayscale image;
[0135] The information determination unit is used to determine the target attribute box information based on the target grayscale image.
[0136] In one embodiment, the information determination unit is specifically used to: project the target grayscale image onto a first direction and a second direction in the same plane to obtain a target projected image; wherein the first direction and the second direction intersect; determine a preliminary selection attribute box based on the target projected image, and determine the brightness data of each pixel in the preliminary selection attribute box; calculate the brightness ratio of the preliminary selection attribute box based on the brightness data; wherein the brightness ratio refers to the proportion of the number of pixels in the preliminary selection box whose brightness data exceeds a preset brightness threshold to the total number of pixels; if the brightness ratio is greater than the preset brightness ratio threshold, determine the preliminary selection attribute box as the target attribute box, and determine the target attribute box information corresponding to the target attribute box.
[0137] In one embodiment, the information recognition module 406 is specifically used to: detect the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and perform text recognition based on the text positioning information to obtain supplementary feature information.
[0138] In one embodiment, the updated feature information of the image to be verified includes text character information; the consistency verification module 408 includes:
[0139] The first calculation unit is used to calculate the Levenstein distance data and the length of the longest common subsequence based on the text character information for multiple corresponding graph patterns to be verified.
[0140] The first analysis unit is used to calculate the character similarity between the graph patterns to be verified based on the Levenstein distance data and the length of the longest common subsequence.
[0141] The first verification unit is used to verify the consistency of the image pattern based on character similarity.
[0142] In one embodiment, the updated graph pattern feature information to be verified further includes network topology graph information; the graph pattern consistency verification based on the updated graph pattern feature information to be verified further includes:
[0143] The second calculation unit is used to calculate node similarity data and edge similarity data for the corresponding multiple graph models to be verified, respectively, based on the network topology graph information.
[0144] The second analysis unit is used to calculate the graph similarity between the graph models to be verified based on node similarity data and edge similarity data.
[0145] The second verification unit is used to verify the consistency of the graph model based on the graph similarity.
[0146] Each module in the aforementioned pattern consistency verification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0147] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores data such as feature information of the graphic model to be verified. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a graphic model consistency verification method.
[0148] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a pattern consistency verification method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0149] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0150] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: obtaining feature information of a graphic model to be verified from a power system operation file; wherein the graphic model feature information includes graphic model coordinate information; constructing a mapping relationship between the graphic model coordinate information and the current screen coordinates to obtain position mapping information, and obtaining target attribute box information corresponding to the graphic model to be verified based on the position mapping information; performing text recognition based on the target attribute box information to obtain supplementary feature information; updating the feature information of the graphic model to be verified based on the supplementary feature information, and performing graphic model consistency verification based on the updated feature information of the graphic model to be verified.
[0151] In one embodiment, when the processor executes the computer program, it further performs the following steps: calculating the attribute box position information corresponding to the image model to be verified based on the position mapping information; obtaining the attribute box data at the corresponding position based on the attribute box position information; removing noise data from the attribute box data based on a preset grayscale threshold to obtain a target grayscale image; and determining the target attribute box information based on the target grayscale image.
[0152] In one embodiment, when the processor executes the computer program, it further performs the following steps: projecting the target grayscale image onto a first direction and a second direction in the same plane to obtain a target projected image; wherein the first direction and the second direction intersect; determining a preliminary selection attribute box based on the target projected image, and determining the brightness data of each pixel in the preliminary selection attribute box; calculating the brightness ratio of the preliminary selection attribute box based on the brightness data; wherein the brightness ratio refers to the proportion of the number of pixels in the preliminary selection box whose brightness data exceeds a preset brightness threshold to the total number of pixels; if the brightness ratio is greater than the preset brightness ratio threshold, determining the preliminary selection attribute box as the target attribute box, and based on the target attribute box information corresponding to the target attribute box.
[0153] In one embodiment, when the processor executes the computer program, it further performs the following steps: detecting the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and performing text recognition based on the text positioning information to obtain supplementary feature information.
[0154] In one embodiment, when the processor executes the computer program, it further performs the following steps: for each of the corresponding multiple graph patterns to be verified, calculate the Levenstein distance data and the length of the longest common subsequence based on the text character information; calculate the character similarity between the graph patterns to be verified based on the Levenstein distance data and the length of the longest common subsequence; and perform graph pattern consistency verification based on the character similarity.
[0155] In one embodiment, when the processor executes the computer program, it further performs the following steps: for the corresponding plurality of graph patterns to be verified, calculate node similarity data and edge similarity data respectively based on the network topology graph information; calculate the graph similarity between the graph patterns to be verified based on the node similarity data and edge similarity data; and perform graph pattern consistency verification based on the graph similarity.
[0156] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: obtaining feature information of a graphic model to be verified from a power system operation file; wherein the feature information of the graphic model includes graphic model coordinate information; constructing a mapping relationship between the graphic model coordinate information and the current screen coordinates to obtain position mapping information, and obtaining target attribute box information corresponding to the graphic model to be verified based on the position mapping information; performing text recognition based on the target attribute box information to obtain supplementary feature information; updating the feature information of the graphic model to be verified based on the supplementary feature information, and performing graphic model consistency verification based on the updated feature information of the graphic model to be verified.
[0157] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: calculating the attribute box position information corresponding to the image model to be verified based on the position mapping information; obtaining the attribute box data at the corresponding position based on the attribute box position information; removing noise data from the attribute box data based on a preset grayscale threshold to obtain a target grayscale image; and determining the target attribute box information based on the target grayscale image.
[0158] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: projecting the target grayscale image onto a first direction and a second direction in the same plane to obtain a target projected image; wherein the first direction and the second direction intersect; determining a preliminary selection attribute box based on the target projected image, and determining the brightness data of each pixel in the preliminary selection attribute box; calculating the brightness ratio of the preliminary selection attribute box based on the brightness data; wherein the brightness ratio refers to the proportion of the number of pixels in the preliminary selection box whose brightness data exceeds a preset brightness threshold to the total number of pixels; if the brightness ratio is greater than the preset brightness ratio threshold, determining the preliminary selection attribute box as the target attribute box, and based on the target attribute box information corresponding to the target attribute box.
[0159] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: detecting the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and performing text recognition based on the text positioning information to obtain supplementary feature information.
[0160] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each of the corresponding multiple graph patterns to be verified, calculate the Levenstein distance data and the length of the longest common subsequence based on the text character information; calculate the character similarity between the graph patterns to be verified based on the Levenstein distance data and the length of the longest common subsequence; and perform graph pattern consistency verification based on the character similarity.
[0161] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for the corresponding plurality of graph patterns to be verified, calculate node similarity data and edge similarity data respectively based on the network topology graph information; calculate the graph similarity between the graph patterns to be verified based on the node similarity data and edge similarity data; and perform graph pattern consistency verification based on the graph similarity.
[0162] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: obtaining feature information of a graphic model to be verified from a power system operation file; wherein the graphic model feature information includes graphic model coordinate information; constructing a mapping relationship between the graphic model coordinate information and the current screen coordinates to obtain position mapping information, and obtaining target attribute box information corresponding to the graphic model to be verified based on the position mapping information; performing text recognition based on the target attribute box information to obtain supplementary feature information; updating the feature information of the graphic model to be verified based on the supplementary feature information, and performing graphic model consistency verification based on the updated feature information of the graphic model to be verified.
[0163] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: calculating the attribute box position information corresponding to the image model to be verified based on the position mapping information; obtaining the attribute box data at the corresponding position based on the attribute box position information; removing noise data from the attribute box data based on a preset grayscale threshold to obtain a target grayscale image; and determining the target attribute box information based on the target grayscale image.
[0164] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: projecting the target grayscale image onto a first direction and a second direction in the same plane to obtain a target projected image; wherein the first direction and the second direction intersect; determining a preliminary selection attribute box based on the target projected image, and determining the brightness data of each pixel in the preliminary selection attribute box; calculating the brightness ratio of the preliminary selection attribute box based on the brightness data; wherein the brightness ratio refers to the proportion of the number of pixels in the preliminary selection box whose brightness data exceeds a preset brightness threshold to the total number of pixels; if the brightness ratio is greater than the preset brightness ratio threshold, determining the preliminary selection attribute box as the target attribute box, and based on the target attribute box information corresponding to the target attribute box.
[0165] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: detecting the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and performing text recognition based on the text positioning information to obtain supplementary feature information.
[0166] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each of the corresponding multiple graph patterns to be verified, calculate the Levenstein distance data and the length of the longest common subsequence based on the text character information; calculate the character similarity between the graph patterns to be verified based on the Levenstein distance data and the length of the longest common subsequence; and perform graph pattern consistency verification based on the character similarity.
[0167] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for the corresponding plurality of graph patterns to be verified, calculate node similarity data and edge similarity data respectively based on the network topology graph information; calculate the graph similarity between the graph patterns to be verified based on the node similarity data and edge similarity data; and perform graph pattern consistency verification based on the graph similarity.
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of verifying graph module consistency, the method comprising: The method includes: Obtain the feature information of the diagram model to be verified from the power system operation file; wherein, the feature information of the diagram model includes the diagram model coordinate information; Construct a mapping relationship between the coordinate information of the graphic model and the current screen coordinates to obtain position mapping information, and obtain the target attribute box information corresponding to the graphic model to be verified based on the position mapping information; Text recognition is performed based on the target attribute box information to obtain supplementary feature information; The feature information of the image model to be verified is updated according to the supplementary feature information, and the consistency of the image model is verified according to the updated feature information of the image model to be verified. The step of obtaining the target attribute box information corresponding to the image model to be verified based on the position mapping information includes: Calculate the attribute box position information corresponding to the image model to be verified based on the position mapping information; Obtain the attribute box data at the corresponding position based on the attribute box position information; The target grayscale image is obtained by removing noise data from the attribute box data according to a preset grayscale threshold; Determine the target attribute box information based on the target grayscale image; Determining the target attribute box information based on the target grayscale image includes: For the target grayscale image, projections are made in a first direction and a second direction on the same plane to obtain a target projected image; wherein the first direction and the second direction intersect. A preliminary attribute box is determined based on the target projection image, and the brightness data of each pixel in the preliminary attribute box is determined. The brightness ratio of the initial selection attribute box is calculated based on the brightness data; wherein, the brightness ratio refers to the proportion of the number of pixels in the initial selection attribute box whose brightness data exceeds a preset brightness threshold to the total number of pixels; If the brightness ratio is greater than a preset brightness ratio threshold, the initially selected attribute box is determined as the target attribute box, and the corresponding target attribute box information is determined based on the target attribute box.
2. The method according to claim 1, characterized in that, The step of performing text recognition based on the target attribute box information to obtain supplementary feature information includes: Based on the target attribute box information, the information content within the target attribute box is detected to obtain text positioning information; Text recognition is performed based on the text location information to obtain supplementary feature information.
3. The method according to any one of claims 1 to 2, characterized in that, The updated feature information of the image to be verified includes text character information; the step of performing image consistency verification based on the updated feature information of the image to be verified includes: For each of the corresponding graph patterns to be verified, the Levenstein distance data and the length of the longest common subsequence are calculated based on the text character information. The character similarity between the graph patterns to be verified is calculated based on the Levenstein distance data and the length of the longest common subsequence. The consistency of the image pattern is verified based on the character similarity.
4. The method according to claim 3, characterized in that, The updated graph pattern feature information to be verified also includes network topology graph information; the graph pattern consistency verification based on the updated graph pattern feature information to be verified further includes: For each of the corresponding graph models to be verified, node similarity data and edge similarity data are calculated based on the network topology graph information. Calculate the graph similarity between the graph models to be verified based on the node similarity data and the edge similarity data; Graph similarity is used to verify graph model consistency.
5. A pattern consistency verification device, characterized in that, The device includes: The information acquisition module is used to acquire the feature information of the model to be verified from the power system operation file; wherein, the feature information of the model includes the model coordinate information; A position mapping module is used to construct a mapping relationship between the coordinate information of the image model and the current screen coordinates to obtain position mapping information; calculate the attribute box position information corresponding to the image model to be verified based on the position mapping information; obtain attribute box data at the corresponding position based on the attribute box position information; remove noise data from the attribute box data based on a preset grayscale threshold to obtain a target grayscale image; project the target grayscale image onto a first direction and a second direction in the same plane to obtain a target projection image; wherein the first direction and the second direction intersect; determine a preliminary attribute box based on the target projection image, and determine the brightness data of each pixel in the preliminary attribute box; calculate the brightness ratio of the preliminary attribute box based on the brightness data; wherein the brightness ratio refers to the proportion of the number of pixels in the preliminary attribute box whose brightness data exceeds a preset brightness threshold to the total number of pixels; if the brightness ratio is greater than the preset brightness ratio threshold, determine the preliminary attribute box as the target attribute box, and determine the corresponding target attribute box information based on the target attribute box; The information recognition module is used to perform text recognition based on the target attribute box information to obtain supplementary feature information; The consistency verification module is used to update the feature information of the image model to be verified according to the supplementary feature information, and to perform image model consistency verification according to the updated feature information of the image model to be verified.
6. The apparatus according to claim 5, characterized in that, The information recognition module is used to detect the information content within the target attribute box based on the target attribute box information to obtain text positioning information; and to perform text recognition based on the text positioning information to obtain supplementary feature information.
7. The apparatus according to any one of claims 5 to 6, characterized in that, The updated feature information of the graph pattern to be verified includes text character information; the consistency verification module is used to calculate the Levenstein distance data and the longest common subsequence length based on the text character information for each of the corresponding graph patterns to be verified. The character similarity between the graph patterns to be verified is calculated based on the Levenstein distance data and the length of the longest common subsequence; graph pattern consistency is verified based on the character similarity.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.