A method and device for checking a secondary terminal arrangement of a switchgear cabinet and a medium
By performing element analysis and hash value comparison on the blueprint and white diagram of the secondary terminal block of the cabinet, the problem of low verification accuracy in the existing technology is solved, and the accurate verification of the terminal block diagram and the improvement of security are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU POWER SUPPLY BUREAU GUANGDONG POWER GRID CO LTD
- Filing Date
- 2026-05-25
- Publication Date
- 2026-07-31
AI Technical Summary
The accuracy of the existing technology in verifying the differences between the blueprint and the white paper of the secondary terminal block of the cabinet is not high, which can easily lead to misjudgment and may cause serious accidents.
By parsing the blueprints and white images into primitives, converting them into structured terminal block strings, constructing a hash tree and calculating the root hash value, and using the uniqueness and irreversibility of the hash algorithm for comparison, non-critical interference information in image comparison is removed to ensure the accuracy of verification.
It achieves complete and accurate verification of the secondary terminal block diagram of the cabinet, reduces the misjudgment rate, and ensures the integrity and security of the wiring logic.
Smart Images

Figure CN122490598A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of secondary terminal block diagram verification for cabinets, and in particular to a method, apparatus and medium for verifying secondary terminal block diagrams for cabinets. Background Technology
[0002] The secondary terminal blocks of the power distribution cabinet are the connection hubs of the substation's secondary circuits, undertaking the signal transmission and electrical connection functions between protection devices, monitoring and control equipment, and switching mechanisms. The accuracy of its wiring logic directly determines the safe and stable operation of the power grid. The blueprints for the secondary terminal blocks of the power distribution cabinet are the legally mandated construction and operation and maintenance basis issued by the design institute, while the factory-issued wiring drawings are the actual wiring documents delivered by the equipment manufacturer along with the power distribution cabinet. Due to factors such as design changes, manufacturer production adjustments, and on-site construction modifications, inconsistencies in wiring logic between the two are highly likely. If effective verification is not performed, maintenance personnel may accidentally touch live terminals or trip operating switches when conducting power outage repairs and troubleshooting based on incorrect drawings, resulting in serious accidents such as large-scale power outages and economic losses.
[0003] Current technologies primarily employ image comparison for terminal block diagram verification. While image comparison improves efficiency to some extent by scanning two drawings and then matching their pixels, it is severely affected by non-critical information such as drawing quality, printing resolution, drawing style, frame line type, and font size, resulting in a high false positive rate. Therefore, there is an urgent need for a method that can address the problem of low accuracy in verifying differences between blueprints and white drawings of secondary terminal blocks for cabinets. Summary of the Invention
[0004] This application provides a method for verifying the secondary terminal block diagram of a cabinet, which can solve the problem of low accuracy in verifying the differences between the blueprint and white diagram of the secondary terminal block of the cabinet in the prior art.
[0005] In a first aspect, embodiments of the present invention provide a method for verifying the secondary terminal block diagram of a cabinet, including: Obtain the blueprint of the secondary terminal block of the cabinet to be verified, which represents the actual secondary circuit wiring of the cabinet, and the white diagram of the secondary terminal block of the cabinet, which represents the factory wiring of the internal equipment of the cabinet; wherein, the cabinet includes a number of terminals; The blueprint of the secondary terminal block of the cabinet is parsed to obtain the terminal block blueprint block string corresponding to each terminal, and the white diagram of the secondary terminal block of the cabinet is parsed to obtain the white diagram block string corresponding to each terminal. A blueprint hash tree is constructed based on the blueprint block strings of each terminal block, and the blueprint root hash value is determined based on the blueprint hash tree; A white image hash tree is constructed based on the white image block strings of each terminal block, and the root hash value of the white image is determined based on the white image hash tree; The blueprint root hash value and the whiteprint root hash value are compared to obtain the secondary terminal block diagram verification result of the cabinet.
[0006] This application upgrades the traditional image pixel-based comparison method to a structured semantic comparison method by parsing the blueprint and whiteboard drawings and converting them into strings corresponding to the terminals. This completely eliminates the influence of non-critical interference information such as drawing scanning quality, printing resolution, drawing style, drawing frame line type, and font size on the verification results, fundamentally eliminating the inherent high false positive rate problem of image comparison. Furthermore, by constructing blueprint hash trees and whiteboard hash trees based on the strings corresponding to each terminal and determining the root hash value, the uniqueness and irreversibility of the hash algorithm are utilized to transform complex wiring logic into unique digital identifiers. This ensures that if there is a difference in the terminal number, inner wiring, outer wiring, or connection piece status of any terminal, the final generated root hash value will be completely different, achieving accurate and complete verification of the overall wiring logic of the terminal block. Finally, the verification result is obtained by comparing the blueprint root hash value and the whiteboard root hash value. Therefore, this application solves the problem of low verification accuracy of differences between the blueprint and whiteboard drawings of secondary terminal blocks in the prior art.
[0007] As a preferred example of the first aspect, the step of parsing the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal includes: The blueprint of the secondary terminal block of the cabinet is parsed to identify the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal in the blueprint of the secondary terminal block of the cabinet. Then, the blueprint is segmented according to the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal to obtain the terminal block blueprint block corresponding to each terminal. Based on each terminal block blueprint block, determine the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal. Then, concatenate the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block blueprint block string corresponding to each terminal.
[0008] In this preferred example, by performing element parsing on the secondary terminal block blueprint of the cabinet, the corresponding straight lines, arcs, text, and spatial combination relationships of each terminal are identified and extracted, and independent terminal block blueprint blocks are accurately segmented. The unstructured drawing image is transformed into structured terminal unit data, and non-critical interference information such as drawing frames, line types, and fonts is completely removed. Then, the core attributes of the terminals are extracted and concatenated into a unified string according to a preset format, eliminating the format influence caused by differences in drawing habits. This provides an accurate and standardized data source for subsequent hash comparison, significantly improving the accuracy of terminal block drawing verification.
[0009] As a preferred example of the first aspect, the step of parsing the secondary terminal layout diagram of the cabinet to obtain the terminal layout diagram block string corresponding to each terminal includes: The secondary terminal layout diagram of the cabinet is subjected to primitive parsing to identify the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal in the secondary terminal layout diagram of the cabinet. Then, the diagram is segmented according to the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal to obtain the terminal layout diagram block corresponding to each terminal. Based on the terminal block diagrams, determine the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal. Then, concatenate the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block diagram string corresponding to each terminal.
[0010] In this preferred example, by performing element parsing on the secondary terminal block white diagram of the cabinet, the straight lines, arcs, text, and spatial combination relationships corresponding to each terminal are identified and extracted, and independent terminal block white diagram blocks are accurately segmented. The unstructured manufacturer drawings are transformed into structured terminal unit data, and non-critical interference information such as drawing frames and annotation styles are removed. Then, the core attributes of the terminals are extracted and concatenated into strings according to a unified preset format to eliminate format deviations caused by differences in drawing habits of different manufacturers. This provides an accurate white diagram data source for subsequent standardized hash comparison with the blueprint, ensuring consistency of the verification benchmark.
[0011] As a preferred example of the first aspect, the step of constructing a blueprint hash tree based on the blueprint block strings of each of the terminal blocks, and determining the blueprint root hash value based on the blueprint hash tree, includes: A blueprint hash tree is constructed layer by layer based on the blueprint block strings of each terminal block, and the root node hash value formed by the top layer of the blueprint hash tree is used as the blueprint root hash value.
[0012] As a preferred example of the first aspect, the step of constructing a blueprint hash tree layer by layer based on the blueprint block strings of each terminal block includes: For each terminal block blueprint block string, a preset hash algorithm is used to calculate the hash value of the first leaf node corresponding to each terminal. Based on the hash values of each of the first leaf nodes, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the blueprint hash tree. In each recursive process, the hash values of any two adjacent leaf nodes in the current level are concatenated to obtain a first concatenated string. Based on the first concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0013] In this preferred example, by using a preset hash algorithm to calculate the hash value of the leaf node corresponding to each terminal block blueprint block string, the difference in wiring logic of any terminal is reflected in the hash value. Then, by recursively concatenating the hash values of adjacent nodes from bottom to top and calculating the hash value of the parent node, a unique top-level root node hash value is finally generated, which transforms the wiring logic of the entire terminal block into a single digital identifier. This achieves accurate and complete verification of the overall wiring logic of the terminal block, and lays the foundation for quickly locating the different terminals in the future.
[0014] As a preferred example of the first aspect, the step of constructing a white image hash tree based on the white image block strings of each of the terminal blocks, and determining the white image root hash value based on the white image hash tree, includes: Based on the white image block strings of each terminal block, a white image hash tree is constructed layer by layer, and the root node hash value formed by the top layer of the white image hash tree is used as the white image root hash value.
[0015] As a preferred example of the first aspect, the step of constructing a white image hash tree layer by layer based on the white image block strings of each of the terminal blocks includes: For each terminal white block string, a preset hash algorithm is used to calculate the hash value of the second leaf node corresponding to each terminal; Based on the hash values of each second leaf node, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the white image hash tree. In each recursive process, the hash values of two adjacent leaf nodes in the current level are concatenated to obtain a second concatenated string. Based on the second concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0016] In this preferred example, by using a preset hash algorithm to calculate the hash value of the leaf node corresponding to each terminal block white block string, the difference in wiring logic of any terminal is reflected in the hash value, achieving accurate mapping at the terminal level. Then, by recursively concatenating the hash values of two adjacent nodes from bottom to top and calculating the hash value of the parent node, a unique top-level root node hash value is finally generated, transforming the wiring logic of the entire terminal block into a single digital identifier. This not only achieves complete verification of the wiring logic of the white block, but also provides a structural foundation for quickly locating the different terminals when comparing with the blueprint.
[0017] As a preferred example of the first aspect, comparing the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet includes: The blueprint root hash value and the whiteprint root hash value are compared to determine whether they are the same. If the root hash value of the blueprint is consistent with the root hash value of the whiteprint, it is determined that the overall wiring logic of the terminal blocks in the blueprint of the secondary terminal block of the cabinet and the whiteprint of the secondary terminal block of the cabinet is consistent, and a qualified verification result is obtained.
[0018] Secondly, the present invention provides a secondary terminal block diagram verification device for a cabinet, comprising: As a preferred example of the second aspect, the step of parsing the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal includes: The blueprint of the secondary terminal block of the cabinet is parsed to identify the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal in the blueprint of the secondary terminal block of the cabinet. Then, the blueprint is segmented according to the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal to obtain the terminal block blueprint block corresponding to each terminal. Based on each terminal block blueprint block, determine the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal. Then, concatenate the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block blueprint block string corresponding to each terminal.
[0019] As a preferred example of the second aspect, the step of parsing the secondary terminal layout diagram of the cabinet to obtain the terminal layout diagram block string corresponding to each terminal includes: The secondary terminal layout diagram of the cabinet is subjected to primitive parsing to identify the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal in the secondary terminal layout diagram of the cabinet. Then, the diagram is segmented according to the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal to obtain the terminal layout diagram block corresponding to each terminal. Based on the terminal block diagrams, determine the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal. Then, concatenate the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block diagram string corresponding to each terminal.
[0020] As a preferred example of the second aspect, the step of constructing a blueprint hash tree based on the blueprint block strings of each of the terminal blocks, and determining the blueprint root hash value based on the blueprint hash tree, includes: A blueprint hash tree is constructed layer by layer based on the blueprint block strings of each terminal block, and the root node hash value formed by the top layer of the blueprint hash tree is used as the blueprint root hash value.
[0021] As a preferred example of the second aspect, the step of constructing a blueprint hash tree layer by layer based on the blueprint block strings of each terminal block includes: For each terminal block blueprint block string, a preset hash algorithm is used to calculate the hash value of the first leaf node corresponding to each terminal. Based on the hash values of each of the first leaf nodes, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the blueprint hash tree. In each recursive process, the hash values of any two adjacent leaf nodes in the current level are concatenated to obtain a first concatenated string. Based on the first concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0022] As a preferred example of the second aspect, the step of constructing a white image hash tree based on the white image block strings of each of the terminal blocks, and determining the white image root hash value based on the white image hash tree, includes: Based on the white image block strings of each terminal block, a white image hash tree is constructed layer by layer, and the root node hash value formed by the top layer of the white image hash tree is used as the white image root hash value.
[0023] As a preferred example of the second aspect, the step of constructing a white image hash tree layer by layer based on the white image block strings of each terminal block includes: For each terminal white block string, a preset hash algorithm is used to calculate the hash value of the second leaf node corresponding to each terminal; Based on the hash values of each second leaf node, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the white image hash tree. In each recursive process, the hash values of two adjacent leaf nodes in the current level are concatenated to obtain a second concatenated string. Based on the second concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0024] As a preferred example of the second aspect, comparing the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet includes: The blueprint root hash value and the whiteprint root hash value are compared to determine whether they are the same. If the root hash value of the blueprint is consistent with the root hash value of the whiteprint, it is determined that the overall wiring logic of the terminal blocks in the blueprint of the secondary terminal block of the cabinet and the whiteprint of the secondary terminal block of the cabinet is consistent, and a qualified verification result is obtained.
[0025] Another embodiment of this application provides a terminal device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the secondary terminal block diagram verification method for the cabinet of this application.
[0026] Another embodiment of this application also provides a computer-readable storage medium item, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to perform the steps of the secondary terminal block diagram verification method of the cabinet of this application. Attached Figure Description
[0027] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating one embodiment of a method for verifying secondary terminal block diagrams in a display cabinet provided by the present invention; Figure 2 This is a module structure diagram of one embodiment of a secondary terminal block diagram verification device for a screen cabinet provided by the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0031] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0032] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0033] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0034] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0035] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0036] Example 1 Please refer to Figure 1 To address the issue of low accuracy in verifying the differences between the blueprint and white diagram of secondary terminal blocks for cabinets in existing technologies, this application provides a method for verifying secondary terminal block diagrams for cabinets, comprising: S1. Obtain the blueprint of the secondary terminal block of the cabinet to be verified, which is used to characterize the actual secondary circuit wiring of the cabinet, and the white diagram of the secondary terminal block of the cabinet, which is used to characterize the factory wiring of the internal equipment of the cabinet; wherein, the cabinet includes several terminals. Specifically, the corresponding drawings are retrieved from the substation's existing dual-dimensional structured file storage system: In the design project dimension folder, the electrical secondary construction blueprints or as-built blueprints, finalized and electronically signed by the design institute, are extracted as the secondary terminal block blueprints representing the actual secondary circuit wiring of the cabinet; in the physical facilities dimension folder, the factory wiring diagrams provided by the equipment manufacturer and delivered simultaneously with the cabinet are extracted as the secondary terminal block diagrams representing the factory wiring of the internal equipment of the cabinet. Both types of drawings are linked one-to-one with the cabinet to be verified using a unique structured code ID, ensuring that the retrieved blueprints and diagrams necessarily correspond to the same physical cabinet.
[0037] S2. Perform element parsing on the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal, and perform element parsing on the white diagram of the secondary terminal block of the cabinet to obtain the terminal block white diagram string corresponding to each terminal; In some embodiments, the step of parsing the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal includes: The blueprint of the secondary terminal block of the cabinet is parsed to identify the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal in the blueprint of the secondary terminal block of the cabinet. Then, the blueprint is segmented according to the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal to obtain the terminal block blueprint block corresponding to each terminal. Based on each terminal block blueprint block, determine the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal. Then, concatenate the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block blueprint block string corresponding to each terminal.
[0038] Specifically, the algorithm performs element analysis on the secondary terminal block blueprint of the power cabinet. It traverses all graphic elements in the drawing, identifying the first straight line, first arc, first text corresponding to each terminal, and the first spatial combination relationship between these elements. Based on the standard drawing specifications for power industry terminal blocks, and according to the physical arrangement order of terminals from top to bottom and from left to right, and the closed boundary characteristics of graphic elements, the continuous terminal block drawing is divided into independent terminal block blueprint blocks corresponding to individual terminals. After the terminal block blueprint blocks are divided, according to the preset comparison benchmark unification rules, all entries pointing to "inter-cabinet cables" in the analysis results are automatically removed, retaining only the connection parts between the internal equipment and terminals of the power cabinet. This is because the secondary terminal block white drawings provided by equipment manufacturers usually only include the factory wiring content within the cabinet and do not involve external cable connections between different power cabinets. This processing ensures that the verification benchmarks of the blueprint and the white drawing are completely consistent, avoiding misjudgments due to different comparison ranges. Throughout the analysis process, standardized data cleaning operations are performed simultaneously, automatically removing invisible characters such as spaces, line breaks, and tabs from all extracted text. Terminal segment names and terminal numbers are then sorted in ascending order according to their original serial numbers in the drawings, eliminating formatting interference caused by differences in drawing habits among different design institutes and designers. From each cleaned and standardized terminal block blueprint, the corresponding first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information are extracted. The first inner wiring information corresponds to the connection relationship between the terminal and internal protection devices, control equipment, and other components of the cabinet; the first outer wiring information corresponds to the connection relationship between the terminal and external cables of the cabinet; and the first connecting piece status information includes three specific states: short-circuited, open, and no connecting piece. Subsequently, the above five pieces of information for each terminal are strictly concatenated according to a preset fixed format: "terminal number, inner wiring 1, inner wiring 2, outer wiring 1, outer wiring 2, connecting piece status," ultimately yielding the terminal block blueprint string corresponding to each terminal.
[0039] In some embodiments, the step of parsing the secondary terminal block diagram of the cabinet to obtain the terminal block diagram string corresponding to each terminal includes: The secondary terminal layout diagram of the cabinet is subjected to primitive parsing to identify the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal in the secondary terminal layout diagram of the cabinet. Then, the diagram is segmented according to the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal to obtain the terminal layout diagram block corresponding to each terminal. Based on the terminal block diagrams, determine the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal. Then, concatenate the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block diagram string corresponding to each terminal.
[0040] Specifically, the algorithm performs element analysis on the secondary terminal block white diagram of the cabinet. It traverses all graphic elements in the drawing, identifies the second straight line, second arc, second text corresponding to each terminal, and the second spatial combination relationship between these elements. Based on the standard drawing specifications of the terminal block, and according to the physical arrangement order of the terminals and the boundary characteristics of the graphic elements, the continuous terminal block drawing is divided into independent terminal block white diagram blocks corresponding to individual terminals. During the analysis process, data cleaning is performed simultaneously, automatically removing invisible characters such as spaces, carriage returns, and tabs from all extracted text, and arranging the terminal segments and terminal numbers in ascending order according to their original serial numbers in the drawing, eliminating format differences caused by the drawing habits of different equipment manufacturers. After segmenting and cleaning the terminal block diagram, the corresponding second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information are extracted from each terminal block diagram. The second inner wiring information corresponds to the connection relationship between the internal equipment of the cabinet and the terminal, the second outer wiring information corresponds to the connection relationship between the external cable of the cabinet and the terminal, and the second connecting piece status information includes specific states such as short-circuited, open, and no connecting piece. Then, the above five pieces of information corresponding to each terminal are strictly concatenated according to the preset format of "terminal number, inner wiring 1, inner wiring 2, outer wiring 1, outer wiring 2, connecting piece status" to finally obtain the terminal block diagram string corresponding to each terminal.
[0041] S3. Construct a blueprint hash tree based on the blueprint block strings of each terminal block, and determine the blueprint root hash value based on the blueprint hash tree; In some embodiments, constructing a blueprint hash tree based on each of the terminal block blueprint block strings, and determining the blueprint root hash value based on the blueprint hash tree, includes: A blueprint hash tree is constructed layer by layer based on the blueprint block strings of each terminal block, and the root node hash value formed by the top layer of the blueprint hash tree is used as the blueprint root hash value.
[0042] In some embodiments, the step of constructing a blueprint hash tree layer by layer based on the blueprint block strings of each terminal block includes: For each terminal block blueprint block string, a preset hash algorithm is used to calculate the hash value of the first leaf node corresponding to each terminal. Based on the hash values of each of the first leaf nodes, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the blueprint hash tree. In each recursive process, the hash values of any two adjacent leaf nodes in the current level are concatenated to obtain a first concatenated string. Based on the first concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0043] Specifically, each terminal blueprint block string is processed individually using the preset SHA-256 hash algorithm, generating a leaf node hash value for each terminal. After all leaf node hash values for all terminals are calculated, a blueprint hash tree is built by recursively aggregating the hash values layer by layer according to the original arrangement of the terminals. During each layer's calculation, the hash values of adjacent leaf nodes at the current level are concatenated to form a new concatenated string. The SHA-256 hash algorithm is then used to recalculate the concatenated string to obtain the corresponding parent node hash value. This process is repeated iteratively upwards, merging all the hash results of the lower-level nodes until a unique root node hash value is generated at the top level. This root node hash value generated at the top level is then used directly as the blueprint root hash value.
[0044] S4. Construct a white image hash tree based on the white image block strings of each terminal block, and determine the white image root hash value based on the white image hash tree; In some embodiments, constructing a white image hash tree based on the white image block strings of each terminal block, and determining the white image root hash value based on the white image hash tree, includes: Based on the white image block strings of each terminal block, a white image hash tree is constructed layer by layer, and the root node hash value formed by the top layer of the white image hash tree is used as the white image root hash value.
[0045] In some embodiments, the step of constructing a white image hash tree layer by layer based on the white image block strings of each terminal block includes: For each terminal white block string, a preset hash algorithm is used to calculate the hash value of the second leaf node corresponding to each terminal; Based on the hash values of each second leaf node, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the white image hash tree. In each recursive process, the hash values of two adjacent leaf nodes in the current level are concatenated to obtain a second concatenated string. Based on the second concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0046] Specifically, for each terminal's white image block string, a preset SHA-256 hash algorithm is used to calculate the hash value of the leaf node corresponding to each terminal. After all leaf node hash values for all terminals are generated, a white image hash tree is built from bottom to top in a recursive manner, strictly following the arrangement order of the terminals in the drawing. During the processing of each layer, the hash values of the two adjacent nodes at the current layer are concatenated to obtain a new concatenated string. The same SHA-256 hash algorithm is then used to re-hash the concatenated string to obtain the hash value of the parent node corresponding to the previous layer. Through this continuous merging and recursive calculation method, the hash value is iterated until a unique root node hash value is formed at the top layer. The root node hash value formed at the top layer of the white image hash tree is directly designated as the white image root hash value. This construction method can completely solidify all the wiring logic information of each terminal in the entire terminal block diagram, such as the terminal number, internal and external wiring information, and connection piece status, into a unique digital identifier. If there is any discrepancy in the attributes or wiring logic of any terminal, a difference will be generated in the corresponding node of the hash tree, and will be passed up layer by layer, eventually reflected in the root hash value. At the same time, relying on the hierarchical structure of the hash tree, subsequent layer-by-layer comparisons can be quickly performed to locate the specific terminal with the discrepancy.
[0047] S5. Compare the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet.
[0048] In some embodiments, comparing the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet includes: The blueprint root hash value and the whiteprint root hash value are compared to determine whether they are the same. If the root hash value of the blueprint is consistent with the root hash value of the whiteprint, it is determined that the overall wiring logic of the terminal blocks in the blueprint of the secondary terminal block of the cabinet and the whiteprint of the secondary terminal block of the cabinet is consistent, and a qualified verification result is obtained.
[0049] Specifically, the calculated root hash value of the blueprint is directly compared with the root hash value of the whiteprint. First, it is determined whether the two values are completely consistent. If the two root hash values are exactly the same, it means that the terminal segment names, terminal numbers, internal and external wiring contents, and connection piece status information of all terminals in the blueprint and whiteprint are all matched without difference. The overall wiring logic of the secondary terminal block blueprint and whiteprint of the cabinet is completely consistent, and the terminal block drawing verification result is directly determined to be qualified. If the comparison finds that the root hash value of the blueprint and the root hash value of the whiteprint are inconsistent, the hash value of the comparison node is decomposed layer by layer from top to bottom based on the hash tree. The subtree branch with the difference is quickly located according to the logarithmic time complexity, and then the specific terminal number is located. It is then clearly distinguished whether the discrepancy is in the internal wiring, external wiring, or connection piece status of the terminal.
[0050] Example 2 like Figure 2 As shown, based on the above method embodiments, corresponding device embodiments are provided; An embodiment of the present invention provides a secondary terminal block diagram verification device for a cabinet, comprising: a first verification module 21, a second verification module 22, a third verification module 23, a fourth verification module 24 and a fifth verification module 25; The first verification module 21 is used to obtain the blueprint of the secondary terminal block of the cabinet corresponding to the cabinet to be verified, which represents the actual secondary circuit wiring of the cabinet, and the white diagram of the secondary terminal block of the cabinet representing the factory wiring of the internal equipment of the cabinet; wherein, the cabinet includes a plurality of terminals; The second verification module 22 is used to perform element parsing on the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal, and to perform element parsing on the white diagram of the secondary terminal block of the cabinet to obtain the terminal block white diagram string corresponding to each terminal. The third verification module 23 is used to construct a blueprint hash tree based on the blueprint block strings of each terminal block, and to determine the blueprint root hash value based on the blueprint hash tree; The fourth verification module 24 is used to construct a white image hash tree based on the white image block strings of each terminal block, and to determine the white image root hash value based on the white image hash tree; The fifth verification module 25 is used to compare the blueprint root hash value and the whiteprint root hash value to obtain the verification result of the secondary terminal block diagram of the cabinet.
[0051] In some embodiments, the step of parsing the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal includes: The blueprint of the secondary terminal block of the cabinet is parsed to identify the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal in the blueprint of the secondary terminal block of the cabinet. Then, the blueprint is segmented according to the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal to obtain the terminal block blueprint block corresponding to each terminal. Based on each terminal block blueprint block, determine the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal. Then, concatenate the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block blueprint block string corresponding to each terminal.
[0052] In some embodiments, the step of parsing the secondary terminal block diagram of the cabinet to obtain the terminal block diagram string corresponding to each terminal includes: The secondary terminal layout diagram of the cabinet is subjected to primitive parsing to identify the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal in the secondary terminal layout diagram of the cabinet. Then, the diagram is segmented according to the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal to obtain the terminal layout diagram block corresponding to each terminal. Based on the terminal block diagrams, determine the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal. Then, concatenate the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block diagram string corresponding to each terminal.
[0053] In some embodiments, constructing a blueprint hash tree based on each of the terminal block blueprint block strings, and determining the blueprint root hash value based on the blueprint hash tree, includes: A blueprint hash tree is constructed layer by layer based on the blueprint block strings of each terminal block, and the root node hash value formed by the top layer of the blueprint hash tree is used as the blueprint root hash value.
[0054] In some embodiments, the step of constructing a blueprint hash tree layer by layer based on the blueprint block strings of each terminal block includes: For each terminal block blueprint block string, a preset hash algorithm is used to calculate the hash value of the first leaf node corresponding to each terminal. Based on the hash values of each of the first leaf nodes, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the blueprint hash tree. In each recursive process, the hash values of any two adjacent leaf nodes in the current level are concatenated to obtain a first concatenated string. Based on the first concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0055] In some embodiments, constructing a white image hash tree based on the white image block strings of each terminal block, and determining the white image root hash value based on the white image hash tree, includes: Based on the white image block strings of each terminal block, a white image hash tree is constructed layer by layer, and the root node hash value formed by the top layer of the white image hash tree is used as the white image root hash value.
[0056] In some embodiments, the step of constructing a white image hash tree layer by layer based on the white image block strings of each terminal block includes: For each terminal white block string, a preset hash algorithm is used to calculate the hash value of the second leaf node corresponding to each terminal; Based on the hash values of each second leaf node, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the white image hash tree. In each recursive process, the hash values of two adjacent leaf nodes in the current level are concatenated to obtain a second concatenated string. Based on the second concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
[0057] In some embodiments, comparing the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet includes: The blueprint root hash value and the whiteprint root hash value are compared to determine whether they are the same. If the root hash value of the blueprint is consistent with the root hash value of the whiteprint, it is determined that the overall wiring logic of the terminal blocks in the blueprint of the secondary terminal block of the cabinet and the whiteprint of the secondary terminal block of the cabinet is consistent, and a qualified verification result is obtained.
[0058] For more detailed steps and working principles of this embodiment, please refer to the relevant description in Embodiment 1, but not limited to these descriptions.
[0059] In summary, this application upgrades the traditional image pixel-based comparison method to a structured semantic comparison method by parsing the blueprint and whiteboard drawings and converting them into strings corresponding to the terminals. This completely eliminates the influence of non-critical interference information such as drawing scanning quality, printing resolution, drawing style, drawing frame line type, and font size on the verification results, fundamentally eliminating the inherent high false positive rate problem of image comparison. Furthermore, by constructing blueprint hash trees and whiteboard hash trees based on the strings corresponding to each terminal and determining the root hash value, the uniqueness and irreversibility of the hash algorithm are utilized to transform complex wiring logic into unique digital identifiers. This ensures that if there is a difference in the terminal number, inner wiring, outer wiring, or connection piece status of any terminal, the final generated root hash value will be completely different, achieving accurate and complete verification of the overall wiring logic of the terminal block. Finally, the verification result is obtained by comparing the blueprint root hash value and the whiteboard root hash value. Therefore, this application solves the problem of low verification accuracy of differences between the blueprint and whiteboard drawings of secondary terminal blocks in the prior art.
[0060] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0061] Example 3 Based on the above embodiments of the secondary terminal block diagram verification method for the cabinet, another embodiment of this application provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the secondary terminal block diagram verification method for the cabinet according to any embodiment of this application.
[0062] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more module units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0063] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0064] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0065] Example 4 Based on the above-described method embodiments, another embodiment of this application provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the secondary terminal block diagram verification method for the cabinet described in any of the above-described method embodiments of this application.
[0066] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
Claims
1. A method for verifying the secondary terminal block diagram of a cabinet, characterized in that, include: Obtain the blueprint of the secondary terminal block of the cabinet to be verified, which represents the actual secondary circuit wiring of the cabinet, and the white diagram of the secondary terminal block of the cabinet, which represents the factory wiring of the internal equipment of the cabinet; wherein, the cabinet includes a number of terminals; The blueprint of the secondary terminal block of the cabinet is parsed to obtain the terminal block blueprint block string corresponding to each terminal, and the white diagram of the secondary terminal block of the cabinet is parsed to obtain the white diagram block string corresponding to each terminal. A blueprint hash tree is constructed based on the blueprint block strings of each terminal block, and the blueprint root hash value is determined based on the blueprint hash tree; A white image hash tree is constructed based on the white image block strings of each terminal block, and the root hash value of the white image is determined based on the white image hash tree; The blueprint root hash value and the whiteprint root hash value are compared to obtain the secondary terminal block diagram verification result of the cabinet.
2. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 1, characterized in that, The step of parsing the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal includes: The blueprint of the secondary terminal block of the cabinet is parsed to identify the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal in the blueprint of the secondary terminal block of the cabinet. Then, the blueprint is segmented according to the first straight line, first arc, first text and first spatial combination relationship corresponding to each terminal to obtain the terminal block blueprint block corresponding to each terminal. Based on each terminal block blueprint block, determine the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal. Then, concatenate the first terminal segment name, first terminal number, first inner wiring information, first outer wiring information, and first connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block blueprint block string corresponding to each terminal.
3. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 1, characterized in that, The step of parsing the secondary terminal layout diagram of the cabinet to obtain the terminal layout diagram block string corresponding to each terminal includes: The secondary terminal layout diagram of the cabinet is subjected to primitive parsing to identify the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal in the secondary terminal layout diagram of the cabinet. Then, the diagram is segmented according to the second straight line, second arc, second text and second spatial combination relationship corresponding to each terminal to obtain the terminal layout diagram block corresponding to each terminal. Based on the terminal block diagrams, determine the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal. Then, concatenate the second terminal segment name, second terminal number, second inner wiring information, second outer wiring information, and second connecting piece status information corresponding to each terminal according to a preset format to obtain the terminal block diagram string corresponding to each terminal.
4. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 1, characterized in that, The step of constructing a blueprint hash tree based on the blueprint block strings of each terminal block, and determining the blueprint root hash value based on the blueprint hash tree, includes: A blueprint hash tree is constructed layer by layer based on the blueprint block strings of each terminal block, and the root node hash value formed by the top layer of the blueprint hash tree is used as the blueprint root hash value.
5. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 4, characterized in that, The step of constructing a blueprint hash tree layer by layer based on the blueprint block strings of each terminal block includes: For each terminal block blueprint block string, a preset hash algorithm is used to calculate the hash value of the first leaf node corresponding to each terminal. Based on the hash values of each of the first leaf nodes, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the blueprint hash tree. In each recursive process, the hash values of any two adjacent leaf nodes in the current level are concatenated to obtain a first concatenated string. Based on the first concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
6. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 1, characterized in that, The step of constructing a white image hash tree based on the white image block strings of each terminal block, and determining the white image root hash value based on the white image hash tree, includes: Based on the white image block strings of each terminal block, a white image hash tree is constructed layer by layer, and the root node hash value formed by the top layer of the white image hash tree is used as the white image root hash value.
7. The method for verifying the secondary terminal block diagram of a cabinet as described in claim 6, characterized in that, The step of constructing a white image hash tree layer by layer based on the white image block strings of each terminal block includes: For each terminal white block string, a preset hash algorithm is used to calculate the hash value of the second leaf node corresponding to each terminal; Based on the hash values of each second leaf node, a recursive approach is used to calculate until the hash value of the top-level root node is generated, thus completing the construction of the white image hash tree. In each recursive process, the hash values of two adjacent leaf nodes in the current level are concatenated to obtain a second concatenated string. Based on the second concatenated string, a preset hash algorithm is used again to calculate the corresponding parent node hash value.
8. A method for verifying the secondary terminal block diagram of a cabinet as described in any one of claims 1 to 7, characterized in that, The step of comparing the blueprint root hash value and the whiteprint root hash value to obtain the secondary terminal block diagram verification result of the cabinet includes: The blueprint root hash value and the whiteprint root hash value are compared to determine whether they are the same. If the root hash value of the blueprint is consistent with the root hash value of the whiteprint, it is determined that the overall wiring logic of the terminal blocks in the blueprint of the secondary terminal block of the cabinet and the whiteprint of the secondary terminal block of the cabinet is consistent, and a qualified verification result is obtained.
9. A device for verifying the secondary terminal block diagram of a cabinet, characterized in that, include: The first verification module, the second verification module, the third verification module, the fourth verification module, and the fifth verification module; The first verification module is used to obtain a blueprint of the secondary terminal block of the cabinet to be verified, which represents the actual secondary circuit wiring of the cabinet, and a white diagram of the secondary terminal block of the cabinet, which represents the factory wiring of the internal equipment of the cabinet; wherein, the cabinet includes a plurality of terminals; The second verification module is used to perform element parsing on the blueprint of the secondary terminal block of the cabinet to obtain the terminal block blueprint block string corresponding to each terminal, and to perform element parsing on the white diagram of the secondary terminal block of the cabinet to obtain the terminal block white diagram block string corresponding to each terminal; The third verification module is used to construct a blueprint hash tree based on the blueprint block strings of each terminal block, and to determine the blueprint root hash value based on the blueprint hash tree; The fourth verification module is used to construct a white image hash tree based on the white image block strings of each terminal block, and to determine the white image root hash value based on the white image hash tree; The fifth verification module is used to compare the blueprint root hash value and the whiteprint root hash value to obtain the verification result of the secondary terminal block diagram of the cabinet.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform a secondary terminal block diagram verification method for a cabinet as described in any one of claims 1 to 8.