Method for checking the dimensions of a valve model and electronic device

By automating the acquisition and comparison of dimensional information between valve models and drawings, the problem of low efficiency in verifying valve dimensions in nuclear power engineering has been solved. This achieves efficient dimensional verification, is applicable to various drawing formats, and improves design efficiency and accuracy.

CN122197290APending Publication Date: 2026-06-12CHINA NUCLEAR POWER ENGINEERING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA NUCLEAR POWER ENGINEERING CO LTD
Filing Date
2026-02-03
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

In existing technologies, the verification of the external dimensions of valve models in nuclear power engineering relies on manual comparison of drawings and models, which is inefficient and prone to errors, especially when design requirements are tight.

Method used

By obtaining the first dimension information of the valve model, extracting the coordinate information of the annotation lines and text blocks in the valve drawing, establishing the correlation, identifying the direction of the annotation lines, and comparing the numerical information, the valve model and the drawing's external dimensions can be automatically verified.

Benefits of technology

It enables automated verification of valve model dimensions, improving verification efficiency, reducing design errors and rework rates, and is applicable to various drawing formats, covering more than 90% of drawing formats in industrial scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122197290A_ABST
    Figure CN122197290A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of valve size verification, and discloses a valve model appearance size verification method and electronic equipment, the method comprising: obtaining first size information of a valve model of a target valve; extracting a marking line in a valve drawing of the target valve and first coordinate information of the marking line; extracting a text block in the valve drawing and second coordinate information of the text block; establishing an association between the marking line and the text block based on the first coordinate information and the second coordinate information; identifying the direction of the marking line to obtain the direction of the marking line; comparing numerical information in the text block associated with the marking line in the same direction to obtain second size information of the target valve in the valve drawing; and obtaining an appearance size verification result of the valve model based on a comparison of the first size information and the second size information. The present application can manually compare the length difference and height difference between a valve drawing and a valve model, and solve the problem of low efficiency of appearance size verification of a valve model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of valve dimension verification technology, specifically to a method and electronic equipment for verifying the external dimensions of valve models. Background Technology

[0002] Nuclear power engineering pipelines involve a vast number of valves, with nearly 20,000 valves throughout the entire nuclear island. The dimensions of these valves influence the layout of upstream and downstream pipeline components and surrounding objects, making subsequent adjustments particularly difficult in confined spaces. Currently, when designing valve models, engineers rely on manual comparison of length and height differences between valve drawings and the actual models to verify valve dimensions. This manual review is labor-intensive and inefficient. Summary of the Invention

[0003] This invention provides a method and electronic device for verifying the external dimensions of a valve model, in order to solve the problem of low efficiency in verifying the external dimensions of valve models caused by manually comparing the length and height differences between valve drawings and valve models.

[0004] In a first aspect, the present invention provides a method for verifying the external dimensions of a valve model, comprising:

[0005] Obtain the first dimension information of the valve model of the target valve; Extract the annotation lines and the first coordinate information of the annotation lines from the valve drawing of the target valve; Extract the text block and the second coordinate information of the text block from the valve drawing; Based on the first coordinate information and the second coordinate information, establish the association between the annotation line and the text block; The direction of the annotation line is obtained by performing direction identification on the annotation line; By comparing the numerical information in the text blocks associated with the annotation lines in the same direction, the second dimension information of the target valve in the valve drawing is obtained; Based on the comparison between the first dimension information and the second dimension information, the external dimension verification result of the valve model is obtained.

[0006] In a second aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method for verifying the external dimensions of a valve model as described in the first aspect or any corresponding embodiment.

[0007] The valve model dimensional verification method provided by this invention obtains the first dimensional information of the target valve model, providing a data foundation for subsequent dimensional verification. Then, it extracts the annotation lines, their first coordinate information, text blocks, and second coordinate information from the valve drawing, providing a data foundation for the association between annotation lines and text blocks. Next, based on the first and second coordinate information, it establishes the association between annotation lines and text blocks, facilitating accurate identification of annotation information in the valve drawing through the annotation lines and their associated text blocks. Then, it identifies the direction of the annotation lines. Since annotation lines used to indicate height and length in valve drawings are usually located in a specific direction, by comparing the numerical information in the text blocks associated with annotation lines in the same direction, the dimensional information of the target valve in the valve drawing, such as the height and length of the target valve, can be accurately analyzed to obtain the second dimensional information of the target valve in the valve drawing. Finally, it compares the first and second dimensional information to determine the dimensional differences between the valve model and the valve drawing, obtaining the dimensional verification result of the valve model. This achieves automated dimensional verification of the valve model and improves the efficiency of dimensional verification. Attached Figure Description

[0008] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0009] Figure 1 This is a flowchart illustrating a method for verifying the external dimensions of a valve model according to an embodiment of the present invention. Figure 2 This is a structural block diagram of a valve model external dimension verification device according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0010] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0011] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0012] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0013] Traditional valve dimensional verification relies on manual comparison of 2D drawings and 3D model data. This process involves numerous manufacturers, inconsistent drawing versions, and a large number of drawings. Furthermore, the mixing of dimensions with annotation lines and symbols in valve drawings increases the difficulty of verification, leading to inefficient dimensional consistency verification and consequently, inefficient and error-prone design processes. Under tight design deadlines and limited personnel, designers need to improve their efficiency—specifically, the efficiency of valve dimensional consistency verification—to ensure the successful completion of new designs and meet the project timelines of nuclear power projects.

[0014] Most existing automated verification tools are limited to a single data source (such as only supporting editable CAD models), lacking methods for establishing structured data for valve dimensional information and intelligent cross-platform (PDF drawings, 3D models) comparison capabilities. Therefore, there is an urgent need for a method that can simplify the consistency verification of valve drawings and 3D models, so as to reduce the time designers spend on redesign and improve design efficiency.

[0015] According to an embodiment of the present invention, a method for verifying the external dimensions of a valve model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0016] This embodiment provides a method for verifying the external dimensions of a valve model, which can be used in electronic devices such as servers and computers. Figure 1 This is a flowchart of a method for verifying the external dimensions of a valve model according to an embodiment of the present invention, as shown below. Figure 1 As shown, the process includes the following steps: Step S101: Obtain the first dimension information of the valve model of the target valve.

[0017] The target valve model is a three-dimensional model of the target valve. The first dimension information includes the valve length and valve height of the target valve in the valve model.

[0018] Specifically, the first dimension information of the valve model of the target valve is obtained through the identification code of the target valve, such as the RIN code (Regulatory Identification Number).

[0019] Step S102: Extract the annotation lines and the first coordinate information of the annotation lines from the valve drawing of the target valve.

[0020] The first coordinate information includes the endpoint coordinates of the two endpoints of the label line.

[0021] Specifically, for valve drawings in vector format, a coding platform (such as Python) is used to extract the annotation lines and their first coordinate information. For valve drawings in scanned format, a line detection algorithm is used to extract the annotation lines and their first coordinate information.

[0022] Step S103: Extract the text block and the second coordinate information of the text block from the valve drawing.

[0023] The second coordinate information includes the vertex coordinates of at least two vertices of the text block.

[0024] Specifically, for valve drawings that are vector files, a coding platform (such as Python) is used to write a language to extract text blocks and their second coordinate information.

[0025] Specifically, for valve drawings that are scanned files, the Paddle OCR engine is initialized using Optical Character Recognition (OCR) technology to extract text blocks and their second coordinate information.

[0026] Step S104: Based on the first coordinate information and the second coordinate information, establish the association between the annotation line and the text block.

[0027] Specifically, based on the first and second coordinate information, the first center coordinates of the annotation line and the second center coordinates of the text block are determined. The association between the annotation line and the text block is established based on the distance between the first center coordinates and the second center coordinates of the text block.

[0028] Step S105: Identify the direction of the annotation line to obtain its direction.

[0029] The direction of the label lines includes both horizontal and vertical directions.

[0030] Specifically, for valve drawings in vector format, the direction of the annotation line is determined by the distance between its two endpoints. For valve drawings in scanned format, the direction of the annotation line is determined by the target angle between the text block associated with the annotation line and the horizontal reference line.

[0031] Step S106: Compare the numerical information in the text blocks associated with the annotation lines in the same direction to obtain the second dimension information of the target valve in the valve drawing.

[0032] Specifically, the numerical information in the text blocks associated with the horizontal dimension lines is compared, and the maximum value is taken as the valve length of the target valve in the valve drawing. Similarly, the numerical information in the text blocks associated with the vertical dimension lines is compared, and the maximum value is taken as the valve height of the target valve in the valve drawing.

[0033] Step S107: Based on the comparison between the first dimension information and the second dimension information, the external dimension verification result of the valve model is obtained.

[0034] The second dimension information includes the valve length and valve height of the target valve in the valve drawing.

[0035] This embodiment of the valve model's external dimension verification method obtains the valve drawing and the first dimension information of the target valve model, providing a data foundation for subsequent dimension verification. Then, it extracts the annotation lines, their first coordinate information, and the text blocks and their second coordinate information from the valve drawing, providing a data foundation for the association between annotation lines and text blocks. Next, based on the first and second coordinate information, it establishes the association between annotation lines and text blocks, facilitating accurate identification of annotation information in the valve drawing through the annotation lines and their associated text blocks. Then, it identifies the direction of the annotation lines. Since annotation lines used to indicate height and length in valve drawings are usually located in a specific direction, by comparing the numerical information in the text blocks associated with annotation lines in the same direction, the external dimension information of the target valve in the valve drawing, such as the height and length of the target valve, can be accurately analyzed to obtain the second dimension information of the target valve in the valve drawing. Furthermore, by comparing the first dimension information with the second dimension information, the difference in external dimensions between the valve model and the valve drawing is determined, and the external dimension verification result of the valve model is obtained. This realizes the automated verification of the external dimensions of the valve model and improves the efficiency of external dimension verification.

[0036] In some optional embodiments, the extraction of the annotation lines from the valve drawing of the target valve in step S102 above includes: Step b1: If the valve drawing is a vector file, extract the first line segment and the coordinates of the endpoints of the first line segment from the valve drawing.

[0037] The vector files are PDF files.

[0038] Specifically, if the valve drawing is a vector file, use PyMuPDF to parse the vector paths in the vector file, such as Line, Curve, and Polygon, and extract the first line segment and the coordinates of the endpoints of the first line segment in the valve drawing.

[0039] It should be noted that the endpoint coordinates of the first line segment in step b1 include the endpoint coordinates of the two endpoints of the first line segment.

[0040] Step b2: Analyze the endpoints of the first line segment to obtain the shape of the endpoints of the first line segment.

[0041] Specifically, one endpoint of the first line segment can be analyzed to obtain the shape of that endpoint. Alternatively, both endpoints of the first line segment can be analyzed to obtain the shapes of both endpoints.

[0042] Step b3: Determine the length of the first line segment based on the coordinates of its endpoints.

[0043] In practical applications, the coordinates of the first endpoint of the first line segment are (x1, y1), and the coordinates of the second endpoint of the first line segment are (x2, y2). The formula for calculating the length of the first line segment is: .

[0044] Step b4: If the endpoint shape of the first line segment is a preset shape and the length of the first line segment is greater than the first preset length threshold, then the first line segment is used as a label line.

[0045] The preset shape is the endpoint shape of commonly used annotation lines, such as a triangle.

[0046] Optionally, the first preset length threshold can be 20px or 25px, without specific limitation.

[0047] The valve model external dimension verification method provided in this embodiment extracts the first line segment and the endpoint coordinates of the first line segment from the valve drawing, and obtains the endpoint shape and line length of the first line segment based on the endpoint of the first line segment. Finally, it determines the annotation line according to the comparison relationship between the endpoint shape of the first line segment, the length of the first line segment and a first preset length threshold. This achieves accurate recognition of the annotation line of the valve drawing when the drawing type of the valve drawing is a vector file.

[0048] In some optional implementations, step b2 above, analyzing the endpoints of the first line segment to obtain the endpoint shapes of the first line segment, includes: Step b21: Identify a first object within a preset range of the endpoints of the first line segment, the first object including at least one of a closed path and an included angle of the line segment.

[0049] The included angle of the line segments is the angle between adjacent line segments at the endpoints of the first line segment.

[0050] Step b22: Determine the endpoint shape of the first line segment based on the first object.

[0051] Specifically, if a closed path appears within a preset range of the endpoints of the first line segment, or if the angle between the first line segment and an adjacent line segment is an acute angle, then the shape of the endpoints of the first line segment is determined to be a preset shape.

[0052] The valve model external dimension verification method provided in this embodiment determines the shape of the endpoint of the first line segment by identifying the closed path or the angle between the endpoints of the first line segment within a preset range, thereby achieving accurate identification of the endpoint shape of the first line segment.

[0053] In some optional embodiments, the extraction of the annotation lines from the valve drawing of the target valve in step S102 above includes: Step b5: If the valve drawing is a scanned file, extract the second line segment and the coordinates of its endpoints from the valve drawing.

[0054] The scanned document is a scanned PDF file.

[0055] Specifically, if the valve drawing is a scanned file, PyMuPDF is used to convert the scanned file into an image with a resolution of no less than 600dpi. Based on the Open CV (Open Source Computer Vision Library) platform and using a line detection algorithm, the first line segment and the coordinates of the endpoints of the first line segment in the valve drawing are extracted.

[0056] Optionally, the line detection algorithm can be either the Hough Transform algorithm or the LSD (Line Segment Detector) algorithm; no specific limitation is made here.

[0057] Step b6: Perform contour analysis on the valve drawing to obtain the first identifier of the preset shape in the valve drawing and the identifier coordinates of the first identifier.

[0058] The first identifier of the preset shape is an arrow.

[0059] Step b7: Based on the coordinates of the markers and the endpoint coordinates of the second line segment, determine the distance between the second line segment and each of the first markers.

[0060] Step b8: If the distance between the second line segment and any first identifier is less than the first preset distance threshold, and the length of the second line segment is greater than the second preset length threshold, then the second line segment is used as a label line.

[0061] Optionally, the first preset length threshold and the second preset length threshold can be the same.

[0062] Specifically, if the distance between the endpoint of the second line segment and any first identifier is less than a first preset distance threshold, and the length of the second line segment is greater than a second preset length threshold, the second line segment is associated with the first identifier, and the second line segment and the associated first identifier are used as a label line.

[0063] In some optional implementations, the step S104 above, which establishes the association between the annotation line and the text block based on the first coordinate information and the second coordinate information, includes: Step c1: Determine the first center coordinates of the annotation line based on the first coordinate information.

[0064] Specifically, the first coordinate information includes the endpoint coordinates of the two endpoints of the label line. Taking the endpoint coordinates of the two endpoints as (x3, y3) and (x4, y4) as an example, the first center coordinate of the label line is ((x3+x4) / 2, (y3+y4) / 2).

[0065] Step c2: Determine the second center coordinates of the text block based on the second coordinate information.

[0066] Specifically, taking the top left corner coordinates (x5, y5) and top right corner coordinates (x6, y6) of the text block as an example, the second center coordinates of the text block are ((x5+x6) / 2, (y5+y6) / 2).

[0067] Step c3: Determine the center distance between the annotation line and the text block based on the first center coordinate and the second center coordinate.

[0068] Specifically, the Euclidean distance between the first center coordinate and the second center coordinate is calculated, and the Euclidean distance between the first center coordinate and the second center coordinate is used as the center distance between the annotation line and the text block.

[0069] Step c4: Establish a relationship between the annotation lines and the text blocks whose center distance is less than the second preset distance threshold.

[0070] Optionally, the second preset distance threshold can be 5mm or 8mm, depending on the actual situation, and is not limited here.

[0071] Specifically, the annotation lines whose center distance is less than the second preset distance threshold are associated with the text block, and the association information is recorded as Dimension 1.

[0072] The valve model external dimension verification method provided in this embodiment calculates the first center coordinate of the annotation line and the second center coordinate of the text block to obtain the center distance between the annotation line and the text block. Finally, based on the comparison relationship between the center distance and the second preset distance threshold, the association relationship between the annotation line and the text block is established, realizing the accurate association between the annotation line and the text block and improving the accuracy of valve external dimension verification.

[0073] In some optional implementations, step S105 above, which involves identifying the direction of the annotation line to obtain its direction, includes: Step d1: If the valve drawing is a vector file, determine the horizontal and vertical distances between the two endpoints of the annotation line based on the endpoint coordinates of the two endpoints of the annotation line.

[0074] Specifically, the horizontal distance between the two endpoints of the label line is |x1-x2|, and the vertical distance between the two endpoints of the label line is |y1-y2|.

[0075] Step d2: If the horizontal distance is less than the third preset distance threshold, then the direction of the marking line is determined to be vertical.

[0076] Optionally, the third preset distance threshold can be 1mm or 2mm, depending on the actual situation, and no specific limitation is made here.

[0077] Specifically, if the horizontal distance is less than the third preset distance threshold, it means that the coordinates of the two ends of the annotation line are close in the horizontal direction, and the direction of the annotation line is determined to be vertical.

[0078] Step d3: If the vertical distance is less than the fourth preset distance threshold, then the direction of the marking line is determined to be horizontal.

[0079] Optionally, the third preset distance threshold can be the same as or different from the fourth preset distance threshold.

[0080] Specifically, if the vertical distance is less than the fourth preset distance threshold, it means that the coordinates of the two ends of the annotation line are close in the vertical direction, and the direction of the annotation line is determined to be horizontal.

[0081] The valve model's external dimension verification method provided in this embodiment, when the valve drawing is a vector file, determines the direction of the annotation line by comparing the relationship between the lateral distance between the two endpoints of the annotation line and a third preset distance threshold, and the relationship between the longitudinal distance and a fourth preset distance threshold. Accurate determination of the annotation line direction is achieved through coordinate calculation of the vector drawing.

[0082] In some optional implementations, step S105 above, which involves identifying the direction of the annotation line to obtain its direction, includes: Step d4: If the valve drawing is a scanned file, then determine the target angle between the text block associated with the annotation line and the horizontal reference line based on the vertex coordinates of the text block associated with the annotation line.

[0083] Specifically, the Paddle OCR engine integrated into the Python platform is used to identify text blocks in valve drawings, obtain the vertex coordinates of the text blocks associated with the annotation lines, connect the vertex coordinates of two adjacent vertices to form a third line segment, calculate the angle between the third line segment and the horizontal reference line, and obtain the target angle between the text blocks associated with the annotation lines and the horizontal reference line.

[0084] Step d5: If the target angle is less than the first preset angle threshold, then the direction of the marking line is determined to be horizontal.

[0085] Optionally, the first preset angle threshold can be 10° or 15°, without specific limitation.

[0086] Step d6: If the target angle is greater than the first preset angle threshold and the target angle is less than the second preset angle threshold, then the direction of the marking line is determined to be vertical, and the second preset angle threshold is greater than the first preset angle threshold.

[0087] Optionally, the second preset angle threshold can be 80° or 100°, without specific limitation.

[0088] The valve model external dimension verification method provided in this embodiment determines the direction of the annotation line by calculating the target angle between the text block associated with the annotation line and the horizontal reference line, thus achieving accurate determination of the standard line direction when the valve drawing is a scanned file.

[0089] In some optional implementations, the method for verifying the external dimensions of the valve model further includes: Step e1: Filter the text blocks that do not contain size information to obtain the filtered text blocks.

[0090] Specifically, a filtering method using regular expressions is adopted to filter out text blocks that do not contain size information (i.e., interference information), resulting in filtered text blocks, and the result is recorded as Dimension 2.

[0091] Interference information includes ">", "MIN", "disassembly space", and other information unrelated to size.

[0092] Step e2: Only retain the annotation lines associated with the filtered text blocks.

[0093] Specifically, only the annotation lines associated with the text blocks in Dimension 2 are retained.

[0094] Furthermore, if the user needs to verify the internal components of the target valve (e.g., handwheel), then according to the user's requirements, a text block with a symbol prefix (e.g., Φ20) is extracted from Dimension 2 using a filtering method that uses regular expressions to restrict conditions, and recorded as Dimension 3. The internal components of the target valve are then verified based on Dimension 3.

[0095] The valve model external dimension verification method provided in this embodiment filters text blocks that do not contain dimension information to obtain filtered text blocks, eliminating interference information unrelated to dimension information, ensuring the accuracy of subsequent valve external dimension information verification, and improving the efficiency of valve external dimension information verification.

[0096] In some optional implementations, the numerical information in the text blocks associated with the annotation lines in the same direction in step S106 above is compared to obtain the second dimension information of the target valve in the valve drawing, including: Step f1: For the horizontal annotation lines, based on the maximum value of the numerical information in the text block associated with the annotation lines, obtain the valve length of the target valve in the valve drawing.

[0097] Specifically, an iterative calculation method is used to compare the text blocks associated with the horizontal annotation lines, and the maximum value of the numerical information in the text block is taken as the valve length L of the target valve in the valve drawing.

[0098] Step f2: For the vertical annotation lines, based on the maximum value of the numerical information in the text block associated with the annotation lines, obtain the valve height of the target valve in the valve drawing.

[0099] Specifically, an iterative calculation method is used to compare the text blocks associated with the vertical annotation lines, and the maximum value of the numerical information in the text block is taken as the valve height H of the target valve in the valve drawing.

[0100] As an application embodiment of this invention, the first dimension information of the target valve is obtained based on its RIN code. When the valve drawing of the target valve is a vector file, annotation lines and text blocks are extracted using a Python programming language. The annotation lines and text blocks in the valve drawing are identified to obtain the first coordinate information of the annotation lines (i.e., the coordinates of the two endpoints) and the second coordinate information of the text blocks (the vertex coordinates of the text blocks). The direction of the annotation lines is then determined based on the horizontal and vertical distances between the endpoint coordinates of the annotation lines. When the valve drawing of the target valve is a scanned file, the first coordinate information of the annotation lines is obtained based on a line detection algorithm. The second coordinate information of the text blocks is obtained based on OCR technology. The direction of the standard line is then determined based on the angle between the text blocks and the horizontal reference line. Subsequently, the center distance between the annotation lines and the text blocks is determined based on the distance between the first midpoint coordinates of the annotation lines and the second midpoint coordinates of the text blocks. The annotation lines are then associated with the corresponding text blocks based on a comparison between the center distance and a second preset distance threshold. Furthermore, a filtering method using regular expressions is employed to filter text blocks that do not contain dimensional information (i.e., interference information), resulting in filtered text blocks. Only the annotation lines associated with these filtered text blocks are retained. Next, an iterative calculation method is used to select the maximum value from the text blocks associated with horizontal annotation lines as the valve length of the target valve in the valve drawing, and the maximum value from the text blocks associated with vertical annotation lines as the valve height of the target valve in the valve drawing. The valve length and valve height are used as the second dimensional information of the target valve. Finally, the first and second dimensional information are compared to obtain the dimensional verification result of the valve model.

[0101] This invention addresses the characteristics of pipeline valve drawings in nuclear power engineering, is compatible with both vector and scanned files, and covers more than 90% of drawing formats in industrial settings. It avoids the inherent drawbacks of manual review, such as high workload, high error rate, and low efficiency. It enables intelligent extraction of valve dimensions from drawings, improves the efficiency of valve dimension verification, reduces rework rates caused by design errors, and enhances the work efficiency of nuclear power engineering designers.

[0102] This embodiment also provides a valve model dimensional verification device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0103] This embodiment provides a device for verifying the external dimensions of a valve model, such as... Figure 2As shown, it includes: The first acquisition module 201 is used to acquire the first dimension information of the valve model of the target valve.

[0104] The first extraction module 202 is used to extract the annotation lines and the first coordinate information of the annotation lines from the valve drawing of the target valve.

[0105] The second extraction module 203 is used to extract text blocks and the second coordinate information of the text blocks from the valve drawing.

[0106] The association module 204 is used to establish the association relationship between the annotation line and the text block based on the first coordinate information and the second coordinate information.

[0107] The direction recognition module 205 is used to recognize the direction of the annotation line and obtain the direction of the annotation line.

[0108] The second acquisition module 206 is used to compare the numerical information in the text block associated with the annotation line in the same direction to obtain the second dimension information of the target valve in the valve drawing.

[0109] The dimension verification module 207 is used to obtain the external dimension verification result of the valve model based on the comparison between the first dimension information and the second dimension information.

[0110] In some alternative implementations, the first extraction module 202 includes: The first extraction unit is used to extract the first line segment and the coordinates of the endpoints of the first line segment from the valve drawing if the drawing type of the valve drawing is a vector file.

[0111] The endpoint analysis unit is used to analyze the endpoints of the first line segment to obtain the endpoint shapes of the first line segment.

[0112] The length determination unit is used to determine the length of the first line segment based on the coordinates of the endpoints of the first line segment.

[0113] The first confirmation unit is used to designate the first line segment as a label line if the endpoint shape of the first line segment is a preset shape and the length of the first line segment is greater than a first preset length threshold.

[0114] In some optional implementations, the endpoint analysis unit includes: The first analysis subunit is used to identify a first object within a preset range of the endpoints of the first line segment, the first object including at least one of a closed path and an included angle of the line segment.

[0115] The second analysis subunit is used to determine the endpoint shape of the first line segment based on the first object.

[0116] In some optional implementations, the first extraction module 202 further includes: The second extraction unit is used to extract the second line segment and the coordinates of the endpoints of the second line segment from the valve drawing if the drawing type of the valve drawing is a scanned file.

[0117] The identification unit is used to perform contour analysis on the valve drawing to obtain the first identifier of the preset shape in the valve drawing and the identifier coordinates of the first identifier.

[0118] The distance determination unit is used to determine the distance between the second line segment and each first identifier based on the identifier coordinates and the endpoint coordinates of the second line segment.

[0119] The second confirmation unit is used to designate the second line segment as a label line if the distance between the second line segment and any first identifier is less than a first preset distance threshold and the length of the second line segment is greater than a second preset length threshold.

[0120] In some alternative implementations, the association module 204 includes: The first processing unit is used to determine the first center coordinates of the annotation line based on the first coordinate information.

[0121] The second processing unit is used to determine the second center coordinates of the text block based on the second coordinate information.

[0122] The third processing unit is used to determine the center distance between the annotation line and the text block based on the first center coordinate and the second center coordinate.

[0123] The association establishment unit is used to establish association relationships between annotation lines and text blocks whose center distance is less than a second preset distance threshold.

[0124] In some optional implementations, the first coordinate information includes the endpoint coordinates of the two endpoints of the annotation line, and the direction recognition module 205 includes: The first identification unit is used to determine the horizontal and vertical distances between the two endpoints of the annotation line based on the endpoint coordinates of the two endpoints of the annotation line if the drawing type of the valve drawing is a vector file.

[0125] The second identification unit is used to determine that the direction of the marking line is horizontal if the horizontal distance is less than the second preset distance threshold.

[0126] The third identification unit is used to determine that the direction of the marking line is vertical if the longitudinal distance is less than the third preset distance threshold.

[0127] In some optional implementations, the second coordinate information includes the vertex coordinates of at least two vertices of the text block. The direction recognition module 205 also includes: The fourth identification unit is used to determine the target angle between the text block associated with the annotation line and the horizontal reference line based on the vertex coordinates of the text block associated with the annotation line if the drawing type of the valve drawing is a scanned file.

[0128] The fifth identification unit is used to determine that the direction of the marking line is horizontal if the target angle is less than the first preset angle threshold.

[0129] The sixth identification unit is used to determine that the direction of the marking line is vertical if the target angle is greater than the first preset angle threshold and the target angle is less than the second preset angle threshold, and the second preset angle threshold is greater than the first preset angle threshold.

[0130] In some optional implementations, the dimensional verification device for the valve model further includes: The filtering module is used to filter text blocks that do not contain size information, resulting in filtered text blocks.

[0131] The first processing module is used to retain only the annotation lines associated with the filtered text blocks.

[0132] In some optional implementations, the second acquisition module 206 includes: The length acquisition unit is used to obtain the valve length of the target valve in the valve drawing based on the maximum value of the numerical information in the text block associated with the horizontal annotation line.

[0133] The height acquisition unit is used to obtain the valve height of the target valve in the valve drawing based on the maximum value of the numerical information in the text block associated with the vertical annotation line.

[0134] The valve model dimensional verification device provided in this embodiment of the invention can execute the valve model dimensional verification method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0135] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0136] The following is a detailed reference. Figure 3The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 301, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 302 or a program loaded from memory 308 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device. The processor 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0137] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0138] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 309, or installed from a memory 308, or installed from a ROM 302. When the computer program is executed by the processor 301, it performs the functions defined in the valve model dimensional verification method of the embodiments of the present invention.

[0139] Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0140] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the method for verifying the external dimensions of the valve model shown in the above embodiments is implemented.

[0141] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0142] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for verifying the external dimensions of a valve model, characterized in that, The method includes: Obtain the first dimension information of the valve model of the target valve; Extract the annotation lines and the first coordinate information of the annotation lines from the valve drawing of the target valve; Extract the text block and the second coordinate information of the text block from the valve drawing; Based on the first coordinate information and the second coordinate information, establish the association between the annotation line and the text block; The direction of the annotation line is obtained by performing direction identification on the annotation line; By comparing the numerical information in the text blocks associated with the annotation lines in the same direction, the second dimension information of the target valve in the valve drawing is obtained; Based on the comparison between the first dimension information and the second dimension information, the external dimension verification result of the valve model is obtained.

2. The method according to claim 1, characterized in that, The step of extracting the annotation lines from the valve drawing of the target valve includes: If the valve drawing is a vector file, then extract the first line segment and the coordinates of the endpoints of the first line segment from the valve drawing. The endpoints of the first line segment are analyzed to obtain the shape of the endpoints of the first line segment; The length of the first line segment is determined based on the coordinates of its endpoints. If the endpoint shape of the first line segment is a preset shape and the length of the first line segment is greater than a first preset length threshold, then the first line segment is used as a label line.

3. The method according to claim 2, characterized in that, The step of analyzing the endpoints of the first line segment to obtain the endpoint shapes of the first line segment includes: Identify a first object within a preset range of the endpoints of the first line segment, the first object including at least one of a closed path and an included angle of the line segment; The endpoint shape of the first line segment is determined based on the first object.

4. The method according to claim 1, characterized in that, The step of extracting the annotation lines from the valve drawing of the target valve includes: If the valve drawing is a scanned file, then extract the second line segment and the coordinates of the endpoints of the second line segment from the valve drawing; The valve drawing is subjected to contour analysis to obtain a first identifier of a preset shape in the valve drawing and the identifier coordinates of the first identifier; Based on the coordinates of the markers and the coordinates of the endpoints of the second line segment, the distance between the second line segment and each of the first markers is determined; If the distance between the second line segment and any of the first markers is less than a first preset distance threshold, and the length of the second line segment is greater than a second preset length threshold, then the second line segment is used as a marker line.

5. The method according to claim 1, characterized in that, The step of establishing the association between the annotation line and the text block based on the first coordinate information and the second coordinate information includes: The first center coordinates of the annotation line are determined based on the first coordinate information; The second center coordinates of the text block are determined based on the second coordinate information; Based on the first center coordinates and the second center coordinates, determine the center distance between the annotation line and the text block; An association is established between the annotation line and the text block for the center distances that are less than a second preset distance threshold.

6. The method according to claim 1, characterized in that, The first coordinate information includes the endpoint coordinates of the two endpoints of the annotation line; the step of identifying the direction of the annotation line to obtain its direction includes: If the valve drawing is a vector file, then the horizontal and vertical distances between the two endpoints of the annotation line are determined based on the endpoint coordinates of the two endpoints of the annotation line. If the lateral distance is less than a third preset distance threshold, then the direction of the marking line is determined to be vertical. If the longitudinal distance is less than the fourth preset distance threshold, then the direction of the marking line is determined to be horizontal.

7. The method according to claim 1, characterized in that, The second coordinate information includes the vertex coordinates of at least two vertices of the text block; the step of identifying the direction of the annotation line to obtain the direction of the annotation line includes: If the valve drawing is a scanned file, the target angle between the text block associated with the annotation line and the horizontal reference line is determined based on the vertex coordinates of the text block associated with the annotation line. If the target angle is less than the first preset angle threshold, then the direction of the marking line is determined to be horizontal. If the target angle is greater than a first preset angle threshold and the target angle is less than a second preset angle threshold, then the direction of the marking line is determined to be vertical, and the second preset angle threshold is greater than the first preset angle threshold.

8. The method according to claim 1, characterized in that, The method further includes: The text blocks that do not contain size information are filtered to obtain filtered text blocks; Only the annotation lines associated with the filtered text blocks are retained.

9. The method according to claim 1, characterized in that, The comparison of numerical information in the text blocks associated with the annotation lines in the same direction to obtain the second dimension information of the target valve in the valve drawing includes: For the horizontal annotation line, the valve length of the target valve in the valve drawing is obtained based on the maximum value of the numerical information in the text block associated with the annotation line; For the vertical annotation line, the valve height of the target valve in the valve drawing is obtained based on the maximum value of the numerical information in the text block associated with the annotation line.

10. An electronic device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the computer instructions to perform the method for verifying the external dimensions of the valve model according to any one of claims 1 to 9.